-
Notifications
You must be signed in to change notification settings - Fork 4.2k
add a basic composer configuration file #52
Conversation
I'm not as familiar with composer as I should be (it's on my "to learn about" list), so I'm not completely sure what this actually does, how it ties (for example) the minimum-stability with a branch or tag on github. |
You guys should create a Zend Framework 2 Module for PHPExcel too! |
@vinigarcia87 Sorry i don't see the connection with composer config |
ZF2 uses composer and PSR-0 autoload to install vendor modules... |
@MarkBaker composer has become more or less the defacto tool for managing dependencies with php. there already seem to be 2 people that have forked this code and created their "own" composer packages: it would be good to get this from the source. |
@MarkBaker plz check http://www.youtube.com/watch?v=9A4XrB5g0fk&feature=player_embedded to learn more about composer |
If I am correctly reading the code PHPExcel will also register its own autoloader in Classes/PHPExcel.php: /** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
} In PHPExcel/Autoloader.php: PHPExcel_Autoloader::Register(); If PHPExcel will support installation via Composer (+1 from me), is there a way to circumvent loading PHPExcel's own autoloader as well? |
+1 |
1 similar comment
+1 |
Hopefully composer file now in place, and I'm sure somebody who knows more about these things will correct me if it's wrong |
thx .. i added some comments for things that need to be fixed. FYI there is |
Some suggestion ... diff --git a/composer.json b/composer.json
index c6ef49c..a547934 100644
--- a/composer.json
+++ b/composer.json
@@ -4,7 +4,7 @@
"keywords": ["PHP","Excel","OpenXML","xlsx","xls","spreadsheet"],
"homepage": "http://phpexcel.codeplex.com",
"type": "library",
- "license": "LGPL",
+ "license": "LGPL-2.1",
"authors": [
{
"name": "Maarten Balliauw",
@@ -22,15 +22,15 @@
],
"require": {
"php": ">=5.2.0",
+ "ext-gd": "*",
"ext-xml": "*"
},
- "recommend": {
- "ext-zip": "*",
- "ext-gd2": "*"
+ "suggest": {
+ "ext-zip": "Only needed by PHPExcel_Reader_Excel2007, PHPExcel_Writer_Excel2007, PHPExcel_Reader_OOCalc"
},
"autoload": {
"psr-0": {
- "PHPExcel": ""
+ "PHPExcel": "Classes/"
}
}
} |
Package has already been registered on packagist.org - https://packagist.org/packages/phpoffice/phpexcel |
"ext-gd": "*", isn't required though, it's only used if you want to use the exact method for autosizing column width, or rendering charts as jpg images |
see #51
to test installation with composer:
add this to your composer.json config file
then run
A class mapping is generated in
vendor/composer/autoload_classmap.php
and you need only to include the autoloadervendor/autoload.php