Adjust phar compiler to work with composer autoloader
parent
b0e5d901ac
commit
60db5d2c3b
|
@ -1,7 +1,12 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require __DIR__.'/../tests/bootstrap.php';
|
||||
if (!@include __DIR__.'/../vendor/.composer/autoload.php') {
|
||||
die('You must set up the project dependencies, run the following commands:
|
||||
wget http://getcomposer.org/composer.phar
|
||||
php composer.phar install
|
||||
');
|
||||
}
|
||||
|
||||
use Composer\Compiler;
|
||||
|
||||
|
|
|
@ -51,7 +51,19 @@ class Compiler
|
|||
$this->addFile($phar, $file);
|
||||
}
|
||||
|
||||
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../tests/bootstrap.php'));
|
||||
$finder = new Finder();
|
||||
$finder->files()
|
||||
->ignoreVCS(true)
|
||||
->name('*.php')
|
||||
->in(__DIR__.'/../../vendor/symfony/')
|
||||
;
|
||||
|
||||
foreach ($finder as $file) {
|
||||
$this->addFile($phar, $file);
|
||||
}
|
||||
|
||||
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/.composer/autoload.php'));
|
||||
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/.composer/autoload_namespaces.php'));
|
||||
$this->addComposerBin($phar);
|
||||
|
||||
// Stubs
|
||||
|
|
Loading…
Reference in New Issue