Skip to content

Commit 68326d5

Browse files
authored
Merge pull request #598 from ergebnis/fix/autoload
Fix: Explicitly include `src/` directory when compiling PHAR
2 parents 0019770 + c561045 commit 68326d5

File tree

5 files changed

+42
-2
lines changed

5 files changed

+42
-2
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.github/ export-ignore
22
/.phive/ export-ignore
3+
/bin/ export-ignore
34
/phar/ export-ignore
45
/test/ export-ignore
56
/.editorconfig export-ignore

.github/workflows/integrate.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,13 @@ jobs:
742742
name: "phpunit-slow-test-detector-phar"
743743
path: "${{ env.PHPUNIT_SLOW_TEST_DETECTOR_PHAR }}"
744744

745-
- name: "Remove autoloader for composer"
746-
run: "composer install --ansi --no-autoloader --no-interaction"
745+
- name: "Remove autoload configuration for composer"
746+
run: "php bin/remove-autoload-configuration.php"
747+
748+
- name: "Install ${{ matrix.dependencies }} dependencies with composer"
749+
uses: "ergebnis/.github/actions/composer/[email protected]"
750+
with:
751+
dependencies: "${{ matrix.dependencies }}"
747752

748753
- name: "Run phar tests with phpunit/phpunit:7.5.0"
749754
if: "matrix.phpunit-version == '7.5.0'"

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88

99
For a full diff see [`2.15.0...main`][2.15.0...main].
1010

11+
### Fixed
12+
13+
- Explicitly included `src/` directory when building PHAR ([#598]), by [@localheinz]
14+
1115
## [`2.15.0`][2.15.0]
1216

1317
For a full diff see [`2.14.0...2.15.0`][2.14.0...2.15.0].
@@ -337,6 +341,7 @@ For a full diff see [`7afa59c...1.0.0`][7afa59c...1.0.0].
337341
[#533]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/533
338342
[#534]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/534
339343
[#559]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/559
344+
[#598]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/598
340345

341346
[@HypeMC]: https://github.com/HypeMC
342347
[@localheinz]: https://github.com/localheinz
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* Copyright (c) 2021-2024 Andreas Möller
7+
*
8+
* For the full copyright and license information, please view
9+
* the LICENSE.md file that was distributed with this source code.
10+
*
11+
* @see https://github.com/ergebnis/phpunit-slow-test-detector
12+
*/
13+
14+
$composerJsonFile = __DIR__ . '/../composer.json';
15+
16+
$composerJson = \json_decode(
17+
\file_get_contents($composerJsonFile),
18+
false
19+
);
20+
21+
$composerJson->autoload = new stdClass();
22+
23+
\file_put_contents($composerJsonFile, \json_encode(
24+
$composerJson,
25+
\JSON_PRETTY_PRINT | \JSON_PRESERVE_ZERO_FRACTION | \JSON_UNESCAPED_SLASHES
26+
));

box.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"KevinGH\\Box\\Compactor\\Php"
66
],
77
"compression": "GZ",
8+
"directories": [
9+
"src/"
10+
],
811
"files": [
912
"manifest.xml"
1013
],

0 commit comments

Comments
 (0)