From 25e5978ae8c833dba850a655da49d338cd14c3a5 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 16 Jan 2021 14:49:56 -0800 Subject: [PATCH] CLI mode debug class clean exit fix. --- e107_admin/footer.php | 4 ++-- e107_handlers/db_debug_class.php | 3 +++ e107_handlers/e107_class.php | 3 ++- e107_tests/tests/unit/scriptsTest.php | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/e107_admin/footer.php b/e107_admin/footer.php index 890c43a04..2a2b5bf29 100644 --- a/e107_admin/footer.php +++ b/e107_admin/footer.php @@ -423,5 +423,5 @@ if(!e107::isCli()) e107::getSession()->shutdown(); // Shutdown $e107->destruct(); - $e107_Clean_Exit = TRUE; // For registered shutdown function -- let it know all is well! -} \ No newline at end of file +} +$e107_Clean_Exit = TRUE; // For registered shutdown function -- let it know all is well! \ No newline at end of file diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index 165fc7c1e..283ece8e7 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -1146,6 +1146,9 @@ global $error_handler, $e107_Clean_Exit, $In_e107_Footer, $ADMIN_DIRECTORY; + + // $ADMIN_DIRECTORY = e107::getFolder('admin'); + if(isset($e107_Clean_Exit)) { return; diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index a6246db28..3123207fe 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -775,9 +775,10 @@ class e107 /** * Get folder name (e107_config) * Replaces all $(*)_DIRECTORY globals + * @example * Example: $e107->getFolder('images'); * - * @param string $for + * @param string $for admin | plugin | * @return string */ public static function getFolder($for) diff --git a/e107_tests/tests/unit/scriptsTest.php b/e107_tests/tests/unit/scriptsTest.php index 33e1e2c0a..368e4ad15 100644 --- a/e107_tests/tests/unit/scriptsTest.php +++ b/e107_tests/tests/unit/scriptsTest.php @@ -29,6 +29,8 @@ } global $pref, $ns, $tp, $frm; + global $error_handler, $e107_Clean_Exit, $In_e107_Footer, $ADMIN_DIRECTORY; + $pref = e107::getPref(); $ns = e107::getRender(); $tp = e107::getParser();