From 44d2c40675045a68836e475f42b7741b45177c26 Mon Sep 17 00:00:00 2001 From: ryanrath Date: Wed, 26 Jun 2024 10:44:53 -0400 Subject: [PATCH] Fix Migration Class Warning Generation (#1877) * Reducing PHP Warnings This bit of code is being told to process not-files on PHP 7.4 AppKernels. So adding a quick check to make sure that the fd actually points to a file before processing will make it so those error messages aren't generated. --- .../OpenXdmod/Migration/ConfigFilesMigration.php | 4 ++-- classes/OpenXdmod/Migration/Migration.php | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/classes/OpenXdmod/Migration/ConfigFilesMigration.php b/classes/OpenXdmod/Migration/ConfigFilesMigration.php index a7241ca451..46d6b3f4c8 100644 --- a/classes/OpenXdmod/Migration/ConfigFilesMigration.php +++ b/classes/OpenXdmod/Migration/ConfigFilesMigration.php @@ -187,7 +187,7 @@ protected function writeJsonConfigFile($name, array $data) $file = implode( DIRECTORY_SEPARATOR, array( - $this->config->getBaseDir(), + CONFIG_DIR, "$name.json" ) ); @@ -249,7 +249,7 @@ protected function assertJsonConfigIsWritable($name) $file = implode( DIRECTORY_SEPARATOR, array( - $this->config->getBaseDir(), + CONFIG_DIR, "$name.json" ) ); diff --git a/classes/OpenXdmod/Migration/Migration.php b/classes/OpenXdmod/Migration/Migration.php index e0a97e7e35..464e16e574 100644 --- a/classes/OpenXdmod/Migration/Migration.php +++ b/classes/OpenXdmod/Migration/Migration.php @@ -28,13 +28,6 @@ abstract class Migration */ protected $newVersion; - /** - * An empty default Configuration object. - * - * @var Configuration - */ - protected $config; - /** * Logger object. * @@ -53,15 +46,7 @@ public function __construct($currentVersion, $newVersion) $this->currentVersion = $currentVersion; $this->newVersion = $newVersion; - $this->logger = Log::singleton('null'); - - $this->config = Configuration::factory( - ".", - CONFIG_DIR, - $this->logger - ); - } /**