Skip to content

Commit

Permalink
Update Box
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored and muglug committed May 15, 2018
1 parent 59d3256 commit 1ecf1c4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/bin/psalm.phar
/build/
/vendor/
/.DS_Store
/.php_cs.cache
Expand Down
7 changes: 1 addition & 6 deletions bin/build-phar.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/usr/bin/env bash
if ! php -r 'extension_loaded("bz2") or exit(1);' ; then
echo "You need to install (or enable) bz2 php extension"
exit 1
fi

composer bin box install

vendor/bin/box compile

bin/psalm.phar --config=bin/phar.psalm.xml --root=src
build/psalm.phar --config=bin/phar.psalm.xml
18 changes: 7 additions & 11 deletions box.json.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{
"main" : "psalm",
"output" : "bin/psalm.phar",
"directories" : [
"assets",
"src",
"vendor"
],
"files" : [
"composer.json",
"composer.lock",
"config.xsd"
"output" : "build/psalm.phar",
"files": [
"src/command_functions.php",
"src/psalm.php",
"src/psalter.php"
],
"files-bin": ["config.xsd"],
"directories-bin" : ["assets"],
"intercept" : false,
"compactors" : [
"KevinGH\\Box\\Compactor\\PhpScoper"
Expand Down
10 changes: 10 additions & 0 deletions scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ function ($filePath, $prefix, $contents) {

return $contents;
},
function ($filePath, $prefix, $contents) {
return str_replace(
'\\'.$prefix.'\Composer\Autoload\ClassLoader',
'\Composer\Autoload\ClassLoader',
$contents
);
},
function ($filePath, $prefix, $contents) {
if ($filePath === realpath(__DIR__ . '/src/Psalm/Config.php')) {
return str_replace(
Expand Down Expand Up @@ -108,4 +115,7 @@ function ($filePath, $prefix, $contents) {
return $contents;
},
],
'whitelist' => [
\Composer\Autoload\ClassLoader::class,
]
];

0 comments on commit 1ecf1c4

Please sign in to comment.