How reload config file |
Hi
I have a script file that when i run it command line and start in loop for accept socket There is big problem On start script file,i load config file and i use it in this file But when i change config file,i have to can access to new data Example $config['title'] = 'hello'; And run php script.php and waiting... I change title to world But because file is running,i cannot access to new data I try to reload with $this->load->config('my_config') But it is unless Please help me
(02-12-2020, 11:06 AM)omid_student Wrote: Hi Instead of changing the config file you can change the value of $this->config['title'] while the script is running e.g. PHP Code: $this->config['title'] = 'World'; Otherwise, you have to exit the script, change the config file and run the script again before the new value can be used.
(02-12-2020, 12:15 PM)dave friend Wrote:(02-12-2020, 11:06 AM)omid_student Wrote: Hi This is good when i reload page But when config file loaded,anything changes not affect on your command
(02-12-2020, 05:02 PM)dave friend Wrote:(02-12-2020, 01:26 PM)omid_student Wrote: This is good when i reload page Yes that may be but i have to reload file,because i edit config file from file manager not with coding
I could control my process with SIGHUP for reload files
But when i use $this->load->config('config'); New values not get Why?
Are you using page caching?
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
You could make your own config file and always load that one when needed.
using the config load method. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I am a bit confused. I had the same trouble but when i came to think about it, i realized what i was doing is a mistake. Let me explain. The values in the config file are like constants relating to the settings. If my understanding is correct, these settings should be fixed and should put into our own config.php file. The file can be autoloaded each time. If changes are allowed to be made, then these should be loaded into a database table or json/ini files.
|
Welcome Guest, Not a member yet? Register Sign In |