Performance wise, I was wondering which method of defining constants/settings is better?
Using a config.ini file through a class like Zend_Config_Ini or just defining a series of php constants?
Performance wise, I was wondering which method of defining constants/settings is better?
Using a config.ini file through a class like Zend_Config_Ini or just defining a series of php constants?
Since using .ini files requires a call to parse_ini_file() (and thus reads a file on disk) it will be trivially slower than defining constants inline. Though if you define your constants in a seperate PHP file and include() it would probably come to the same thing.
However, I would usually recommend using .ini files because it is more maintainable and makes deployments simpler.
Defining PHP constants is faster.
Why: