Skip to content

Commit 7b0ade1

Browse files
committed
Update setup php version
Add support for composer2 libs
1 parent 6f5e13c commit 7b0ade1

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
- name: Checkout code
1313
uses: actions/checkout@master
1414
- name: Setup PHP
15-
uses: shivammathur/setup-php@v1
15+
uses: shivammathur/setup-php@v2
1616
with:
1717
php-version: '7.3'
1818
extensions: mbstring, intl, posix
1919
ini-values: memory_limit=256M, max_execution_time=0, phar.readonly=0
20-
pecl: false
20+
tools: pecl
2121
- name: Build project
2222
run: |
2323
bin/compile

src/Services/Compiler.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use RuntimeException;
77
use SplFileInfo;
88
use Symfony\Component\Finder\Finder;
9+
use function file_exists;
910
use function shell_exec;
1011
use function str_replace;
1112
use function strtr;
@@ -73,18 +74,25 @@ public function compile($pharFile = 'somnambulist-project-manager.phar')
7374
$this->addFile($phar, $file);
7475
}
7576

77+
$testFor = [
78+
'include_paths.php', 'platform_check.php', 'installed.php', 'InstalledVersions.php', 'installed.json',
79+
];
80+
7681
$this->addFile($phar, new SplFileInfo($basePath . '/vendor/autoload.php'));
7782
$this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_namespaces.php'));
7883
$this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_psr4.php'));
7984
$this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_classmap.php'));
8085
$this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_files.php'));
8186
$this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/autoload_real.php'));
8287
$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-
}
8688
$this->addFile($phar, new SplFileInfo($basePath . '/vendor/composer/ClassLoader.php'));
8789

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+
8896
$this->addBin($phar);
8997

9098
// Stubs

0 commit comments

Comments
 (0)