From 288324b14a7d1ed3f587bec246eb3d45d5c0525a Mon Sep 17 00:00:00 2001 From: jcarter Date: Wed, 27 May 2020 16:38:23 +1000 Subject: [PATCH 1/4] chore(QueuedJobDescriptor): Depreciated syntax for string subscript --- code/dataobjects/QueuedJobDescriptor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/dataobjects/QueuedJobDescriptor.php b/code/dataobjects/QueuedJobDescriptor.php index 6a53bc5a..e3a0e5c5 100644 --- a/code/dataobjects/QueuedJobDescriptor.php +++ b/code/dataobjects/QueuedJobDescriptor.php @@ -180,7 +180,7 @@ public function activateOnQueue() { protected function getJobDir() { // make sure our temp dir is in place. This is what will be inotify watched $jobDir = Config::inst()->get('QueuedJobService', 'cache_dir'); - if ($jobDir{0} != '/') { + if ($jobDir[0] != '/') { $jobDir = TEMP_FOLDER . '/' . $jobDir; } From fbc0ec938daec9db62ff602a8de8477cb2cc512c Mon Sep 17 00:00:00 2001 From: jcarter Date: Tue, 2 Jun 2020 10:49:03 +1000 Subject: [PATCH 2/4] fix(QueuedJobService): Store trace to avoid warnings in php 7 --- code/services/QueuedJobService.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/services/QueuedJobService.php b/code/services/QueuedJobService.php index 74b5e2b5..18e684fc 100644 --- a/code/services/QueuedJobService.php +++ b/code/services/QueuedJobService.php @@ -919,7 +919,7 @@ public function clear() { /** * For logging and catching exceptions thrown during AbstractQueuedJob::process() * and similar. - */ + */ public function handleException($exception) { $errno = E_USER_ERROR; $type = get_class($exception); @@ -935,8 +935,10 @@ public function handleException($exception) { /** * Works like the core Silverstripe error handler without exiting * on fatal messages. - */ + */ public function handleError($errno, $errstr, $errfile, $errline) { + $trace = debug_backtrace(); + if (error_reporting()) { // Don't throw E_DEPRECATED in PHP 5.3+ /*if (defined('E_DEPRECATED')) { @@ -951,14 +953,14 @@ public function handleError($errno, $errstr, $errfile, $errline) { case E_DEPRECATED: case E_USER_DEPRECATED: case E_STRICT: - Debug::noticeHandler($errno, $errstr, $errfile, $errline, debug_backtrace()); + Debug::noticeHandler($errno, $errstr, $errfile, $errline, $trace); break; case E_WARNING: case E_CORE_WARNING: case E_USER_WARNING: case E_RECOVERABLE_ERROR: - Debug::warningHandler($errno, $errstr, $errfile, $errline, debug_backtrace()); + Debug::warningHandler($errno, $errstr, $errfile, $errline, $trace); break; default: From e9bc07c44a738e93cee03ea6df46217862867d21 Mon Sep 17 00:00:00 2001 From: jcarter Date: Thu, 4 Jun 2020 08:56:39 +1000 Subject: [PATCH 3/4] chore(travis): Update config for builds and 7.4 --- .travis.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6f081dc..66a2a5c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,27 @@ -# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details +# See https://github.com/silverstripe/silverstripe-travis-support for setup details -sudo: false +dist: trusty language: php matrix: include: - - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3 - - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3.1 - - php: 5.6 - env: DB=PGSQL CORE_RELEASE=3.2 - - php: 7.0 - env: DB=MYSQL CORE_RELEASE=3.6 - - php: 7.1 + - php: '5.6' env: DB=MYSQL CORE_RELEASE=3.6 + - php: '7.0' + env: DB=MYSQL CORE_RELEASE=3.7 + - php: '7.1' + env: DB=PGSQL CORE_RELEASE=3.7 + - php: '7.2' + env: DB=MYSQL CORE_RELEASE=3.7 + - php: '7.3' + env: DB=MYSQL CORE_RELEASE=3.7 + - php: '7.4' + env: DB=MYSQL CORE_RELEASE=3.7 before_script: - composer self-update || true - - git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support + - git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss - cd ~/builds/ss - composer install From c91e8efd28508266893154340aeccdb919ffca00 Mon Sep 17 00:00:00 2001 From: jcarter Date: Thu, 4 Jun 2020 09:08:03 +1000 Subject: [PATCH 4/4] chore(7.4): Replace Object with SS_Object --- _config.php | 4 ++++ code/services/QueuedJobService.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/_config.php b/_config.php index 8023481e..74e5aab2 100644 --- a/_config.php +++ b/_config.php @@ -1,5 +1,9 @@ Implementation; - $job = Object::create($impl); + $job = SS_Object::create($impl); /* @var $job QueuedJob */ if (!$job) { throw new Exception("Implementation $impl no longer exists");