Skip to content

Commit

Permalink
Merge pull request #1 from k1LoW/composer
Browse files Browse the repository at this point in the history
Add composer.json
  • Loading branch information
k1LoW committed Nov 11, 2014
2 parents 68e13b9 + 53b61b5 commit 936c08c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*~
\#*\#
\#*\#
/vendor
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<?php
App::build(array(
'Plugin' => 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 "<?php
class DATABASE_CONFIG {
Expand All @@ -49,4 +49,4 @@ before_script:
- cd ./cakephp

script:
- ./lib/Cake/Console/cake test Xls Lib/Xls --stderr
- ./lib/Cake/Console/cake test Xls Lib/Xls --stderr
14 changes: 6 additions & 8 deletions Lib/Xls.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?php
App::import('Vendor', 'PHPExcel', array('file' => '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;
Expand Down Expand Up @@ -278,4 +276,4 @@ private function __replace($value){
return false;
}
}
}
}
22 changes: 22 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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.*"
}
}

0 comments on commit 936c08c

Please sign in to comment.