File tree Expand file tree Collapse file tree 7 files changed +10
-7
lines changed
tests/phpunit/modules/core Expand file tree Collapse file tree 7 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11APP_NAME = Cypht
22
3+ DEBUG_LOG = true
4+
35DB_CONNECTION_TYPE = host
46DB_DRIVER = mysql
57DB_PORT =
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ public function define_default_constants($config) {
8787 define ('DEFAULT_INLINE_MESSAGE_STYLE ' , $ config ->get ('default_setting_inline_message_style ' , 'right ' ));
8888 define ('DEFAULT_ENABLE_KEYBOARD_SHORTCUTS ' , $ config ->get ('default_setting_enable_keyboard_shortcuts ' , false ));
8989 define ('DEFAULT_ENABLE_SIEVE_FILTER ' , $ config ->get ('default_setting_enable_sieve_filter ' , false ));
90+ define ('DEFAULT_DEBUG_LOG ' , $ config ->get ('debug_log ' , false ));
9091 }
9192
9293 /**
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ public function __construct($config) {
234234 * @return void
235235 */
236236 public function process_module_setup () {
237- if (DEBUG_MODE or $ site_config ->get ('debug_log ' )) {
237+ if (DEBUG_MODE or $ this -> site_config ->get ('debug_log ' )) {
238238 $ this ->setup_debug_modules ();
239239 }
240240 else {
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ public static function load_page_stats() {
172172 * @return boolean|null
173173 */
174174function elog ($ mixed ) {
175- if (DEBUG_MODE or env ( ' DEBUG_LOG ' , false ) ) {
175+ if (DEBUG_MODE ) {
176176 $ bt = debug_backtrace ();
177177 $ caller = array_shift ($ bt );
178178 Hm_Debug::add (sprintf ('ELOG called in %s at line %d ' , $ caller ['file ' ], $ caller ['line ' ]));
Original file line number Diff line number Diff line change @@ -620,7 +620,7 @@ protected function output() {
620620 'var hm_is_logged = function () { return ' .($ this ->get ('is_logged ' ) ? '1 ' : '0 ' ).'; }; ' .
621621 'var hm_empty_folder = function() { return " ' .$ this ->trans ('So alone ' ).'"; }; ' .
622622 'var hm_mobile = function() { return ' .($ this ->get ('is_mobile ' ) ? '1 ' : '0 ' ).'; }; ' .
623- 'var hm_debug = function() { return " ' .( DEBUG_MODE ? '1 ' : '0 ' ). '"; }; ' .
623+ 'var hm_debug = function() { return " ' . (( DEBUG_MODE || DEFAULT_DEBUG_LOG ) ? '1 ' : '0 ' ) . '"; }; ' .
624624 'var hm_mailto = function() { return ' .($ this ->get ('mailto_handler ' ) ? '1 ' : '0 ' ).'; }; ' .
625625 'var hm_page_name = function() { return " ' .$ this ->html_safe ($ this ->get ('router_page_name ' )).'"; }; ' .
626626 'var hm_language_direction = function() { return " ' .$ this ->html_safe ($ this ->dir ).'"; }; ' .
@@ -1313,7 +1313,7 @@ class Hm_Output_main_menu_start extends Hm_Output_Module {
13131313 */
13141314 protected function output () {
13151315 $ res = '' ;
1316- if (DEBUG_MODE ) {
1316+ if (DEBUG_MODE or DEFAULT_DEBUG_LOG ) {
13171317 $ res .= '<span title=" ' .
13181318 $ this ->trans ('Running in debug mode. See https://cypht.org/install.html Section 6 for more detail. ' ).
13191319 '" class="debug_title"> ' .$ this ->trans ('Debug ' ).'</span> ' ;
@@ -1631,7 +1631,7 @@ class Hm_Output_content_section_start extends Hm_Output_Module {
16311631 * Opens a main tag for the primary content section
16321632 */
16331633 protected function output () {
1634- return '<main class="container-fluid content_cell" id="cypht-main"><div class="offline"> ' .$ this ->trans ('Offline ' ).'</div><div class="row m-0 position-relative "> ' ;
1634+ return '<main class="container-fluid content_cell" id="cypht-main"><div class="offline"> ' .$ this ->trans ('Offline ' ).'</div><div class="row m-0"> ' ;
16351635 }
16361636}
16371637
Original file line number Diff line number Diff line change 99
1010class Hm_Output_push_js_include extends Hm_Output_Module {
1111 protected function output () {
12- if (DEBUG_MODE ) {
12+ if (DEBUG_MODE or DEFAULT_DEBUG_LOG ) {
1313 return '<script type="text/javascript" src="third_party/push.min.js"></script> ' ;
1414 }
1515 }
Original file line number Diff line number Diff line change @@ -981,7 +981,7 @@ public function test_folder_list_end() {
981981 public function test_content_section_start () {
982982 $ test = new Output_Test ('content_section_start ' , 'core ' );
983983 $ res = $ test ->run ();
984- $ this ->assertEquals (array ('<main class="container-fluid content_cell" id="cypht-main"><div class="offline">Offline</div><div class="row m-0 position-relative "> ' ), $ res ->output_response );
984+ $ this ->assertEquals (array ('<main class="container-fluid content_cell" id="cypht-main"><div class="offline">Offline</div><div class="row m-0"> ' ), $ res ->output_response );
985985 }
986986 /**
987987 * @preserveGlobalState disabled
You can’t perform that action at this time.
0 commit comments