From fa0f34a21130dd1dc6eb1791ec17895272f03aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sat, 28 Apr 2018 17:45:07 +0100 Subject: [PATCH 1/2] Update dependencies - Update dependencies as if were on PHP 7.1 - Update the current dependencies - Remove unnused `symfony/process` - Remove unnused `padraic/phar-updater` --- .travis.yml | 5 ++-- composer.json | 2 -- composer.lock | 69 +++++++---------------------------------------- src/bootstrap.php | 50 ++-------------------------------- 4 files changed, 14 insertions(+), 112 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82a270155..3ea10094e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,15 +14,14 @@ 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 before_install: diff --git a/composer.json b/composer.json index 4b49224c0..fcac2a319 100644 --- a/composer.json +++ b/composer.json @@ -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" }, diff --git a/composer.lock b/composer.lock index df476b4f7..4647d8dc2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a79228b0119a9f3dbcd3ade691c7ad33", + "content-hash": "720dd89c24948ad1d8fd3304c6b16ef2", "packages": [ { "name": "amphp/amp", @@ -948,12 +948,12 @@ "source": { "type": "git", "url": "https://github.com/humbug/php-scoper.git", - "reference": "561bcde3f65146f2fef771fcf3783b22d0c83bf4" + "reference": "450fe36a7457847d0cb431e7379b5df9d05992a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/humbug/php-scoper/zipball/561bcde3f65146f2fef771fcf3783b22d0c83bf4", - "reference": "561bcde3f65146f2fef771fcf3783b22d0c83bf4", + "url": "https://api.github.com/repos/humbug/php-scoper/zipball/450fe36a7457847d0cb431e7379b5df9d05992a4", + "reference": "450fe36a7457847d0cb431e7379b5df9d05992a4", "shasum": "" }, "require": { @@ -964,8 +964,7 @@ "roave/better-reflection": "^2.0", "symfony/console": "^3.2 || ^4.0", "symfony/filesystem": "^3.2 || ^4.0", - "symfony/finder": "^3.2 || ^4.0", - "symfony/requirements-checker": "^1.0" + "symfony/finder": "^3.2 || ^4.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.1", @@ -984,12 +983,12 @@ } }, "autoload": { + "files": [ + "src/functions.php" + ], "psr-4": { "Humbug\\PhpScoper\\": "src/" - }, - "files": [ - "src/check.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1010,7 +1009,7 @@ } ], "description": "Prefixes all PHP namespaces in a file or directory.", - "time": "2018-03-04T12:43:00+00:00" + "time": "2018-04-25T21:59:07+00:00" }, { "name": "justinrainbow/json-schema", @@ -2256,54 +2255,6 @@ "homepage": "https://symfony.com", "time": "2018-04-03T05:24:00+00:00" }, - { - "name": "symfony/requirements-checker", - "version": "v1.0.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/requirements-checker.git", - "reference": "4cad41f35d5c561d84b6385c627a3785c55fec1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/requirements-checker/zipball/4cad41f35d5c561d84b6385c627a3785c55fec1d", - "reference": "4cad41f35d5c561d84b6385c627a3785c55fec1d", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "bin": [ - "bin/requirements-checker" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Requirements\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Check Symfony requirements and give recommendations", - "keywords": [ - "configuration", - "distribution" - ], - "time": "2018-04-17T12:14:14+00:00" - }, { "name": "symfony/var-dumper", "version": "v4.0.8", diff --git a/src/bootstrap.php b/src/bootstrap.php index a2185533b..703fd825c 100755 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -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( From bd88f9283cee3c9c6dbd11a26efe993afe8887b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sat, 28 Apr 2018 17:59:42 +0100 Subject: [PATCH 2/2] Remove nightly build --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3ea10094e..c6e05eba6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ matrix: env: COVERAGE='true' - php: '7.2' env: SYMFONY_VERSION='v3' + allow_failures: - php: nightly fast_finish: true