Zen Cart Logo
Forums / Contribution-Writing Guidelines / adding constants - PHP Notice: Use of undefined constant

adding constants - PHP Notice: Use of undefined constant

Views: 8,819

Results 1 to 1 of 1
4 May 2016, 6:07 AM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

adding constants - PHP Notice: Use of undefined constant

Just to continue what I was on about previously...
https://www.zen-cart.com/showthread.php?154453-Correct-method-to-add-new-define-constant

While investigating another issue, I have php error reporting to E_ALL and find errors such as this, for

[04-May-2016 07:28:09 Europe/Madrid] PHP Notice: Use of undefined constant RG_BC_DC_SIZES - assumed 'RG_BC_DC_SIZES' in blahblah\includes\languages\english\extra_definitions\motorvista_boilerplate_text_en.php on line 367

I have a look at /includes/modules/extra_definitions.php and incidentally/off-topic find this non-bug where the echo is in the wrong place

  //steve wrong place      echo 'LOADING: ' . $ws_languages_extra_definitions_directory_template . $file . ' ' . $file_cnt . '<br />';
if (file_exists($ws_languages_extra_definitions_directory_template . $file)) {
include($ws_languages_extra_definitions_directory_template . $file);
//      echo 'LOADING: ' . $ws_languages_extra_definitions_directory_template . $file . ' ' . $file_cnt . '<br />';//steve right place
} else {
include($ws_languages_extra_definitions_directory . $file);
//      echo 'LOADING: ' . $ws_languages_extra_definitions_directory . $file . ' ' . $file_cnt . '<br />';
}

This proves the files in extra_definitions are all included as expected...so why are there php notices?