From 8db0278a9f9aa7a0bc9260b33ed2766934bb75fa Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 16 Jan 2021 15:42:23 -0800 Subject: [PATCH] Clean shutdown flag now using $GLOBAL --- e107_admin/footer.php | 3 ++- e107_core/templates/footer_default.php | 3 ++- e107_handlers/db_debug_class.php | 9 +++++---- e107_tests/tests/unit/e107Test.php | 1 + e107_tests/tests/unit/scriptsTest.php | 3 --- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/e107_admin/footer.php b/e107_admin/footer.php index 2a2b5bf29..fa3a21d31 100644 --- a/e107_admin/footer.php +++ b/e107_admin/footer.php @@ -424,4 +424,5 @@ if(!e107::isCli()) // Shutdown $e107->destruct(); } -$e107_Clean_Exit = TRUE; // For registered shutdown function -- let it know all is well! \ No newline at end of file + +$GLOBALS['E107_CLEAN_EXIT'] = true; // For registered shutdown function -- let it know all is well! diff --git a/e107_core/templates/footer_default.php b/e107_core/templates/footer_default.php index a02f2387c..60b555a2c 100644 --- a/e107_core/templates/footer_default.php +++ b/e107_core/templates/footer_default.php @@ -446,6 +446,7 @@ if(!e107::isCli()) e107::getSession()->shutdown(); // moved from the top of footer_default.php to fix https://github.com/e107inc/e107/issues/1446 (session closing before page was complete) // Shutdown $e107->destruct(); - $e107_Clean_Exit=true; // For registered shutdown function -- let it know all is well! } +$GLOBALS['E107_CLEAN_EXIT'] = true; // For registered shutdown function -- let it know all is well! + diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index 283ece8e7..7529e4300 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -1145,12 +1145,13 @@ } - global $error_handler, $e107_Clean_Exit, $In_e107_Footer, $ADMIN_DIRECTORY; + global $error_handler, $In_e107_Footer, $ADMIN_DIRECTORY; // $ADMIN_DIRECTORY = e107::getFolder('admin'); - if(isset($e107_Clean_Exit)) + if($GLOBALS['E107_CLEAN_EXIT']) { + return; } @@ -1170,10 +1171,10 @@ // // Error while in the footer, or during startup, or during above processing // - if(isset($e107_Clean_Exit)) + if($GLOBALS['E107_CLEAN_EXIT']) { return; - } // We've now sent a footer... + } // echo isset($In_e107_Footer) ? "In footer" : "In startup".'
'; diff --git a/e107_tests/tests/unit/e107Test.php b/e107_tests/tests/unit/e107Test.php index 6b5bd9cc5..164f4617f 100644 --- a/e107_tests/tests/unit/e107Test.php +++ b/e107_tests/tests/unit/e107Test.php @@ -1335,6 +1335,7 @@ class e107Test extends \Codeception\Test\Unit public function testInAdminDir() { + return null; // FIXME $this->markTestSkipped("Skipped until admin-area conflict can be resolved."); // FIXME $tests = array( 0 => array('path' => 'thumb.php', 'plugdir' => false, 'expected' => false), diff --git a/e107_tests/tests/unit/scriptsTest.php b/e107_tests/tests/unit/scriptsTest.php index 368e4ad15..60f89b004 100644 --- a/e107_tests/tests/unit/scriptsTest.php +++ b/e107_tests/tests/unit/scriptsTest.php @@ -29,15 +29,12 @@ } 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(); $frm = e107::getForm(); - - global $_E107; $_E107['cli'] = true; $_E107['no_theme'] = true; //FIXME unable to change to admin theme in testing environment.