From b32c55a39cba7e5392da49ccd033dc2b76102f02 Mon Sep 17 00:00:00 2001 From: Usman Ikram Date: Mon, 10 Feb 2020 00:52:54 +0100 Subject: [PATCH] Update TravisCI config for PHP7.4 --- .travis.yml | 7 ++++++- system/Autoloader/FileLocator.php | 4 ++-- system/HTTP/Files/UploadedFile.php | 5 +++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index cdda6078b5e2..bc21825c760b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php php: - 7.2 - 7.3 + - 7.4 - nightly matrix: @@ -16,7 +17,7 @@ global: # Recommended by Travis support sudo: required -dist: trusty +dist: xenial group: edge env: @@ -30,6 +31,10 @@ services: - postgresql - redis-server +cache: + directories: + - vendor + script: - php vendor/bin/phpunit -v diff --git a/system/Autoloader/FileLocator.php b/system/Autoloader/FileLocator.php index ad4a8122a3ee..0b78e9c0ebfb 100644 --- a/system/Autoloader/FileLocator.php +++ b/system/Autoloader/FileLocator.php @@ -239,7 +239,7 @@ public function search(string $path, string $ext = 'php'): array foreach ($this->getNamespaces() as $namespace) { - if (is_file($namespace['path'] . $path)) + if (isset($namespace['path']) && is_file($namespace['path'] . $path)) { $foundPaths[] = $namespace['path'] . $path; } @@ -288,7 +288,7 @@ protected function getNamespaces() $namespaces = []; // Save system for last - $system = null; + $system = []; foreach ($this->autoloader->getNamespace() as $prefix => $paths) { diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index 1826a7a07bac..62a245ba0873 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -182,8 +182,9 @@ public function move(string $targetPath, string $name = null, bool $overwrite = } catch (Exception $e) { - $error = error_get_last(); - throw HTTPException::forMoveFailed(basename($this->path), $targetPath, strip_tags($error['message'])); + $error = error_get_last(); + $message = isset($error['message']) ? strip_tags($error['message']) : ''; + throw HTTPException::forMoveFailed(basename($this->path), $targetPath, $message); } @chmod($targetPath, 0777 & ~umask());