Skip to content

Commit

Permalink
Merge pull request #176 from theofidry/bugfix/dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
theofidry authored Apr 28, 2018
2 parents 6c8f1c3 + bd88f92 commit d34ee97
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 111 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ env:

matrix:
include:
- php: '7.2'
- php: '7.1'
env: DEPLOY=true
- php: '7.2'
- php: '7.2'
env: COVERAGE='true'
- php: '7.2'
env: SYMFONY_VERSION='v3'
- php: nightly
allow_failures:
- php: nightly
fast_finish: true
Expand Down
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@
"humbug/php-scoper": "^1.0@dev",
"justinrainbow/json-schema": "^5.2",
"nikic/iter": "^1.6",
"padraic/phar-updater": "^1.0",
"phpseclib/phpseclib": "~2.0",
"seld/jsonlint": "^1.6",
"symfony/console": "^3.4 || ^4.0",
"symfony/filesystem": "^3.4 || ^4.0",
"symfony/finder": "^3.4 || ^4.0",
"symfony/process": "^3.4 || ^4.0",
"symfony/var-dumper": "^3.4 || ^4.0",
"webmozart/path-util": "^2.3"
},
Expand Down
69 changes: 10 additions & 59 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 2 additions & 48 deletions src/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,55 +26,9 @@
use function sys_get_temp_dir;
use function unlink;

// TODO: update PHP-Scoper to get rid of this horrible hack at some point
$findPhpScoperFunctions = function (): void {
if (file_exists($autoload = __DIR__.'/../../php-scoper/src/functions.php')) {
// Is installed via Composer
require_once $autoload;

return;
}

if (file_exists($autoload = __DIR__.'/../vendor/humbug/php-scoper/src/functions.php')) {
// Is scoped (in PHAR or dumped directory) or is installed locally
require_once $autoload;

return;
}

if ('phar://' === substr(__FILE__, 0, 7)) {
// Is in the PHAR but the PHAR has been renamed without the extension `.phar`. As a result the PHAR protocol
// `phar://path/to/file/in/PHAR` will not work.
// See https://github.com/amphp/parallel/commit/732694688461936bec02c0ccf020dfee10c4f7ee
if (defined('PHAR_COPY')) {
return;
}

$pharPath = dirname(substr(__FILE__, 7), 2);
define('PHAR_COPY', sys_get_temp_dir().'/phar-'.bin2hex(random_bytes(10)).'.phar');

copy($pharPath, \PHAR_COPY);

$autoload = 'phar://'.\PHAR_COPY.'/vendor/humbug/php-scoper/src/functions.php';

register_shutdown_function(static function (): void {
@unlink(\PHAR_COPY);
});

require_once $autoload;

return;
}

throw new RuntimeException('Unable to find the PHP-Scoper functions.');
};

$GLOBALS['_BOX_BOOTSTRAP'] = function () use ($findPhpScoperFunctions): void {
$findPhpScoperFunctions();

($GLOBALS['_BOX_BOOTSTRAP'] = function (): void {
\KevinGH\Box\register_aliases();
};
$GLOBALS['_BOX_BOOTSTRAP']();
})();

// Convert errors to exceptions
set_error_handler(
Expand Down

0 comments on commit d34ee97

Please sign in to comment.