Skip to content

Commit

Permalink
Merge pull request consolidation#28 from pmcjury/master
Browse files Browse the repository at this point in the history
fixes consolidation#26 to use robo.phar standalone even if vendor dir exists, and you don't have Robo as a dependency
  • Loading branch information
DavertMik committed Jun 4, 2014
2 parents 550f08f + b0a3639 commit 4a27ae8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
19 changes: 13 additions & 6 deletions robo
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/usr/bin/env php
<?php
if (file_exists(__DIR__.'/vendor/autoload.php')) {
require_once __DIR__.'/vendor/autoload.php';
} elseif (file_exists(__DIR__.'/../../autoload.php')) {
require_once __DIR__ . '/../../autoload.php';
} else {
/**
* if we're running from phar load the phar autoload, else let the script 'robo' search for the autoloader
*/
if(strpos(basename(__FILE__), 'phar')){
require_once 'phar://robo.phar/vendor/autoload.php';
}

else{
if (file_exists(__DIR__.'/vendor/autoload.php')) {
require_once __DIR__.'/vendor/autoload.php';
} elseif (file_exists(__DIR__.'/../../autoload.php')) {
require_once __DIR__ . '/../../autoload.php';
} else {
require_once 'phar://robo.phar/vendor/autoload.php';
}
}
$runner = new \Robo\Runner();
$runner->execute();
4 changes: 0 additions & 4 deletions src/Task/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public function getCommand()
* $this->taskComposerInstall('path/to/my/composer.phar')
* ->preferDist()
* ->run();
* ?>
*
* // optimize autoloader with custom path
* $this->taskComposerInstall('path/to/my/composer.phar')
Expand Down Expand Up @@ -158,7 +157,6 @@ public function run()
* $this->taskComposerUpdate('path/to/my/composer.phar')
* ->preferDist()
* ->run();
* ?>
*
* // optimize autoloader with custom path
* $this->taskComposerUpdate('path/to/my/composer.phar')
Expand Down Expand Up @@ -192,13 +190,11 @@ public function run()
* $this->taskComposerDumpAutoload('path/to/my/composer.phar')
* ->preferDist()
* ->run();
* ?>
*
* // optimize autoloader dump with custom path
* $this->taskComposerDumpAutoload('path/to/my/composer.phar')
* ->optimize()
* ->run();
* ?>
*
* // optimize autoloader dump with custom path and no dev
* $this->taskComposerDumpAutoload('path/to/my/composer.phar')
Expand Down

0 comments on commit 4a27ae8

Please sign in to comment.