diff --git a/.gitignore b/.gitignore index 1b7f6df..9006122 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *~ -\#*\# \ No newline at end of file +\#*\# +/vendor diff --git a/.travis.yml b/.travis.yml index f374329..c3d7f54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,27 +2,27 @@ language: php php: - 5.3 + - 5.4 + - 5.5 env: - - DB=mysql CAKEPHP=2.1.4 - - DB=mysql CAKEPHP=2.2.7 - - DB=mysql CAKEPHP=2.3.6 + - DB=mysql CAKEPHP=2.3.10 + - DB=mysql CAKEPHP=2.4.10 + - DB=mysql CAKEPHP=2.5.5 before_script: - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS cakephp_test;'; fi" + - composer install --dev - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi" - wget https://github.com/cakephp/cakephp/tarball/$CAKEPHP -O cake.tar.gz - tar xf cake.tar.gz - mv cakephp-cakephp-* ./cakephp - - wget https://github.com/PHPOffice/PHPExcel/tarball/develop -O PHPExcel.tar.gz - - tar xf PHPExcel.tar.gz - - mv PHPOffice-PHPExcel-* ./cakephp/app/Vendor/PHPExcel - chmod -R 777 ./cakephp/app/tmp - echo " array('/home/travis/build/k1LoW/'), )); CakePlugin::loadAll(); + ini_set('include_path', '/home/travis/build/k1LoW/Xls/vendor/phpunit/phpunit' . PATH_SEPARATOR . ini_get('include_path')); " > cakephp/app/Config/bootstrap.php - echo " 'PHPExcel' . DS . 'Classes' . DS . 'PHPExcel.php')); -App::import('Vendor', 'PHPExcel_IOFactory', array('file' => 'PHPExcel' . DS . 'Classes' . DS . 'PHPExcel' . DS . 'IOFactory.php')); -App::import('Vendor', 'PHPExcel_Cell_AdvancedValueBinder', array('file' => 'PHPExcel' . DS . 'Classes' . DS . 'PHPExcel' . DS . 'Cell' . DS . 'AdvancedValueBinder.php')); +if (file_exists(dirname(__FILE__) . '/../vendor/autoload.php')) { + require_once(dirname(__FILE__) . '/../vendor/autoload.php'); +} /** + * Xls * - * - * - * @params */ -class Xls{ +class Xls { public $xls; private $data; @@ -278,4 +276,4 @@ private function __replace($value){ return false; } } -} \ No newline at end of file +} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0a28062 --- /dev/null +++ b/composer.json @@ -0,0 +1,22 @@ +{ + "name": "k1low/xls", + "description": "Xls: PHPExcel wrapper for CakePHP", + "type": "cakephp-plugin", + "keywords": ["cakephp", "excel"], + "homepage": "https://github.com/k1LoW/Xls", + "license": "MIT", + "authors": [ + { + "name": "Ken'ichiro Oyama", + "homepage": "https://github.com/k1LoW", + "role": "Author" + } + ], + "require": { + "composer/installers": "*", + "phpoffice/phpexcel": "*" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + } +}