From d0ab979826d2abe1e60ba22984704da4ed567b66 Mon Sep 17 00:00:00 2001 From: gavin murambadoro Date: Wed, 22 Jan 2020 13:05:55 +0200 Subject: [PATCH] Fix the warning in ActiveRecord.php "PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters" --- ActiveRecord.php | 100 +++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/ActiveRecord.php b/ActiveRecord.php index 084587547..5965d09e0 100644 --- a/ActiveRecord.php +++ b/ActiveRecord.php @@ -1,50 +1,50 @@ -get_model_directory(); - $root = realpath(isset($path) ? $path : '.'); - - if (($namespaces = ActiveRecord\get_namespaces($class_name))) - { - $class_name = array_pop($namespaces); - $directories = array(); - - foreach ($namespaces as $directory) - $directories[] = $directory; - - $root .= DIRECTORY_SEPARATOR . implode($directories, DIRECTORY_SEPARATOR); - } - - $file = "$root/$class_name.php"; - - if (file_exists($file)) - require_once $file; -} \ No newline at end of file +get_model_directory(); + $root = realpath(isset($path) ? $path : '.'); + + if (($namespaces = ActiveRecord\get_namespaces($class_name))) + { + $class_name = array_pop($namespaces); + $directories = array(); + + foreach ($namespaces as $directory) + $directories[] = $directory; + + $root .= DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $directories); + } + + $file = "$root/$class_name.php"; + + if (file_exists($file)) + require_once $file; +}