|
6 | 6 | use RuntimeException;
|
7 | 7 | use SplFileInfo;
|
8 | 8 | use Symfony\Component\Finder\Finder;
|
| 9 | +use function file_exists; |
9 | 10 | use function shell_exec;
|
10 | 11 | use function str_replace;
|
11 | 12 | use function strtr;
|
@@ -73,18 +74,25 @@ public function compile($pharFile = 'somnambulist-project-manager.phar')
|
73 | 74 | $this->addFile($phar, $file);
|
74 | 75 | }
|
75 | 76 |
|
| 77 | + $testFor = [ |
| 78 | + 'include_paths.php', 'platform_check.php', 'installed.php', 'InstalledVersions.php', 'installed.json', |
| 79 | + ]; |
| 80 | + |
76 | 81 | $this->addFile($phar, new SplFileInfo($basePath . '/vendor/autoload.php'));
|
77 | 82 | $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_namespaces.php'));
|
78 | 83 | $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_psr4.php'));
|
79 | 84 | $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_classmap.php'));
|
80 | 85 | $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_files.php'));
|
81 | 86 | $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_real.php'));
|
82 | 87 | $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_static.php'));
|
83 |
| - if (file_exists($basePath . '/vendor/composer/include_paths.php')) { |
84 |
| - $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/include_paths.php')); |
85 |
| - } |
86 | 88 | $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/ClassLoader.php'));
|
87 | 89 |
|
| 90 | + foreach ($testFor as $test) { |
| 91 | + if (file_exists($basePath . '/vendor/composer/' . $test)) { |
| 92 | + $this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/' . $test)); |
| 93 | + } |
| 94 | + } |
| 95 | + |
88 | 96 | $this->addBin($phar);
|
89 | 97 |
|
90 | 98 | // Stubs
|
|
0 commit comments