Variable constants in PHP -


is possible change value of constant in php? want sensible defaults configuration files our project.

currently doing:

config.php:

define('web_root', '/home/user/public_html'); 

config.default.php:

defined('web_root') || define('web_root', '/home/user/public_html'); 

the problem in cases, may want access configuration defaults inside 'config.php'. example:

config.php

define('user_file_root', web_root.'/files'); 

the scheme constants configuration has been used 5 years, , rewriting framework not option.

it's constant, , definition shouldn't able redefine it. problem lies in code logic if ended needing redefine it.

but if still want go on path can use runkit_constant_redefine


Comments

Popular posts from this blog

python - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -

node.js - Nodejs javascript implementation of PBEWithMD5AndTripleDES/CBC/PKCS5Padding -