How to create global configuration file?

后端 未结 3 1044
-上瘾入骨i
-上瘾入骨i 2021-01-12 05:02

Is there any possibility to create a configuration file with global variables that are visible inside the class? Something similar to this:

config.php:



        
3条回答
  •  不知归路
    2021-01-12 05:50

    You could try defines:

    define('host_address', 'root');
    define('username', 'root');
    

    `Usage:

    DB::getInstance(array(host_address, username, ...));
    

提交回复
热议问题