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

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -