8000 Add a script to package everything in a standalone PHP script · symfony/requirements-checker@6b7e3d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b7e3d7

Browse files
committed
Add a script to package everything in a standalone PHP script
1 parent 290c368 commit 6b7e3d7

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

bin/release.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
$root = dirname(__DIR__);
4+
$contents = '';
5+
foreach ([
6+
'src/Requirement.php',
7+
'src/PhpConfigRequirement.php',
8+
'src/RequirementCollection.php',
9+
'src/ProjectRequirements.php',
10+
'src/SymfonyRequirements.php',
11+
'bin/requirements-checker.php',
12+
] as $file) {
13+
$contents .= file_get_contents($root.'/'.$file);
14+
}
15+
16+
$contents = str_replace('<?php', '', $contents);
17+
$contents = preg_replace('{^require_once .+$}m', '', $contents);
18+
19+
file_put_contents($root.'/check-requirements.php', "<?php\n".$contents);

bin/requirements-checker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
require_once $autoloader;
1818
} elseif (file_exists($autoloader = __DIR__.'/../vendor/autoload.php')) {
1919
require_once $autoloader;
20-
} else {
20+
} elseif (!class_exists('Symfony\Requirements\Requirement', false)) {
2121
require_once dirname(__DIR__).'/src/Requirement.php';
2222
require_once dirname(__DIR__).'/src/RequirementCollection.php';
2323
require_once dirname(__DIR__).'/src/PhpConfigRequirement.php';

0 commit comments

Comments
 (0)
0