Skip to content

Commit

Permalink
Merge pull request #8 from ifacesoft/composer
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
dp-ifacesoft committed Mar 20, 2015
2 parents 6385746 + 46463b9 commit 548d9c4
Show file tree
Hide file tree
Showing 7 changed files with 1,405 additions and 10,528 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ before_script:
- mysql -e "create database IF NOT EXISTS test;" -uroot
- ./Bin/install.sh
- wget http://getcomposer.org/composer.phar
- ./cli Ice:Composer_Update
- php composer.phar install

script: ./cli Ice:Phpunit_Run

Expand Down
14 changes: 10 additions & 4 deletions Source/Ice/Action/Composer/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Ice\Core\Action;
use Ice\Core\Logger;
use Ice\Core\Module;
use Ice\Helper\Console;

/**
Expand Down Expand Up @@ -70,7 +71,11 @@ class Composer_Update extends Action
protected static function config()
{
return [
'view' => ['template' => '']
'view' => ['template' => ''],
'input' => [
'vendor' => ['default' => 'ifacesoft/composer'],
'command' => ['default' => '/bin/composer']
]
];
}

Expand All @@ -87,11 +92,12 @@ protected static function config()
*/
public function run(array $input)
{
$command = VENDOR_DIR . $input['vendor'] . $input['command'];

Console::run([
'cd ' . MODULE_DIR,
'php composer.phar self-update',
'php composer.phar clear-cache',
'php composer.phar update --prefer-source'
'php ' . $command . ' clear-cache',
'php ' . $command . ' update --prefer-source'
]);
}
}
4 changes: 2 additions & 2 deletions Source/Ice/Helper/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ public static function run($commands, $toDevNull = false)
$commandString = '';

foreach ((array)$commands as $command) {
$commandString .= $command . ' && ';
$commandString .= $command . ' && \\' . "\n";
}

$commandString = substr($commandString, 0, -4);
$commandString = substr($commandString, 0, -5);

if ($toDevNull) {
$commandString .= ' > /dev/null 2>&1';
Expand Down
11,565 changes: 1,048 additions & 10,517 deletions Var/vendor/phpunit/coverage.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

define('MODULE_DIR', __DIR__ . '/');
define('MODULE_CONFIG_PATH', 'Config/Ice/Core/Module.php');
define('VENDOR_DIR', dirname(MODULE_DIR) . '/_vendor/Ice/');
define('VENDOR_DIR', dirname(MODULE_DIR) . '/_vendor/');

$loader = require VENDOR_DIR . 'autoload.php';

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
}
],
"config": {
"vendor-dir": "../_vendor/Ice/"
"vendor-dir": "../_vendor/"
},
"autoload": {
"psr-4": {"Ice\\": "Source/Ice/"}
},
"require": {
"php": ">=5.5",
"twig/twig": "1.*",
"smarty/smarty": "3.1.*"
"smarty/smarty": "3.1.*",
"ifacesoft/composer": "dev-master"
},
"require-dev": {
"firephp/firephp-core": "dev-master",
Expand Down
Loading

0 comments on commit 548d9c4

Please sign in to comment.