From fabe60ab68b2a0f52a7fa2b44f946d269171788b Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Wed, 30 May 2018 07:21:34 -0400 Subject: [PATCH] Fix #748 - correct paths that stopped working --- box.json.dist | 2 +- scoper.inc.php | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/box.json.dist b/box.json.dist index c927932ff62..a3d64b7bb20 100644 --- a/box.json.dist +++ b/box.json.dist @@ -12,5 +12,5 @@ "KevinGH\\Box\\Compactor\\PhpScoper" ], "chmod" : "0755", - "compression": "GZ" + "compression": "NONE" } diff --git a/scoper.inc.php b/scoper.inc.php index dedd86dc95a..2fbf60f7438 100644 --- a/scoper.inc.php +++ b/scoper.inc.php @@ -6,7 +6,7 @@ function ($filePath, $prefix, $contents) { // // PHP-Parser patch // - if ($filePath === realpath(__DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php')) { + if ($filePath === 'vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php') { $length = 15 + strlen($prefix) + 1; return preg_replace( @@ -26,7 +26,7 @@ function ($filePath, $prefix, $contents) { ); }, function ($filePath, $prefix, $contents) { - if ($filePath === realpath(__DIR__ . '/src/Psalm/Config.php')) { + if ($filePath === 'src/Psalm/Config.php') { return str_replace( $prefix . '\Composer\Autoload\ClassLoader', 'Composer\Autoload\ClassLoader', @@ -37,7 +37,7 @@ function ($filePath, $prefix, $contents) { return $contents; }, function ($filePath, $prefix, $contents) { - if (strpos($filePath, realpath(__DIR__ . '/src/Psalm')) === 0) { + if (strpos($filePath, 'src/Psalm') === 0) { return str_replace( [' \\Psalm\\', ' \\PhpParser\\'], [' \\' . $prefix . '\\Psalm\\', ' \\' . $prefix . '\\PhpParser\\'], @@ -48,7 +48,7 @@ function ($filePath, $prefix, $contents) { return $contents; }, function ($filePath, $prefix, $contents) { - if (strpos($filePath, realpath(__DIR__ . '/vendor/openlss')) === 0) { + if (strpos($filePath, 'vendor/openlss') === 0) { return str_replace( $prefix . '\\DomDocument', 'DomDocument', @@ -59,10 +59,10 @@ function ($filePath, $prefix, $contents) { return $contents; }, function ($filePath, $prefix, $contents) { - if ($filePath === realpath(__DIR__ . '/src/Psalm/PropertyMap.php') - || $filePath === realpath(__DIR__ . '/src/Psalm/CallMap.php') - || $filePath === realpath(__DIR__ . '/src/Psalm/Stubs/CoreGenericFunctions.php') - || $filePath === realpath(__DIR__ . '/src/Psalm/Stubs/CoreGenericClasses.php') + if ($filePath === 'src/Psalm/PropertyMap.php' + || $filePath === 'src/Psalm/CallMap.php' + || $filePath === 'src/Psalm/Stubs/CoreGenericFunctions.php' + || $filePath === 'src/Psalm/Stubs/CoreGenericClasses.php' ) { $contents = str_replace( ['namespace ' . $prefix . ';', $prefix . '\\\\', $prefix . '\\'], @@ -82,7 +82,7 @@ function ($filePath, $prefix, $contents) { return $contents; }, function ($filePath, $prefix, $contents) { - if ($filePath === realpath(__DIR__ . '/src/Psalm/Checker/Statements/Expression/Call/MethodCallChecker.php')) { + if ($filePath === 'src/Psalm/Checker/Statements/Expression/Call/MethodCallChecker.php') { return str_replace( 'case \'Psalm\\\\', 'case \'' . $prefix . '\\\\Psalm\\\\', @@ -93,7 +93,7 @@ function ($filePath, $prefix, $contents) { return $contents; }, function ($filePath, $prefix, $contents) { - if ($filePath === realpath(__DIR__ . '/src/Psalm/Type.php')) { + if ($filePath === 'src/Psalm/Type.php') { return str_replace( 'get_class($type) === \'Psalm\\\\', 'get_class($type) === \'' . $prefix . '\\\\Psalm\\\\', @@ -104,7 +104,7 @@ function ($filePath, $prefix, $contents) { return $contents; }, function ($filePath, $prefix, $contents) { - if ($filePath === realpath(__DIR__ . '/src/psalm.php')) { + if ($filePath === 'src/psalm.php') { return str_replace( '\\' . $prefix . '\\PSALM_VERSION', 'PSALM_VERSION',