diff --git a/bin/compile b/bin/compile index 589db50d1..3bb0fb73d 100755 --- a/bin/compile +++ b/bin/compile @@ -1,15 +1,7 @@ #!/usr/bin/env php + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +function includeIfExists($file) { + if (file_exists($file)) { + return include $file; + } +} + +if ((!$loader = includeIfExists(__DIR__.'/../../../.composer/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../vendor/.composer/autoload.php'))) { + die('You must set up the project dependencies, run the following commands:'.PHP_EOL. + 'curl -s http://getcomposer.org/installer | php'.PHP_EOL. + 'php composer.phar install'.PHP_EOL); +} + +return $loader; \ No newline at end of file diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 39c661936..a4f2e7cec 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -10,18 +10,5 @@ * file that was distributed with this source code. */ -function autoload($file) { - if (file_exists($file)) { - return include $file; - } else { - return false; - } -} - -if ((!$loader = autoload(__DIR__.'/../../../.composer/autoload.php')) && (!$loader = autoload(__DIR__.'/../vendor/.composer/autoload.php'))) { - die('You must set up the project dependencies, run the following commands:'.PHP_EOL. - 'curl -s http://getcomposer.org/installer | php'.PHP_EOL. - 'php composer.phar install'.PHP_EOL); -} - +$loader = require __DIR__.'/../src/bootstrap.php'; $loader->add('Composer\Test', __DIR__);