[eluser]jayapalchandran[/eluser]
Hi,
I am calling a controller/function from command line like the following like said in other posts of stackoverflow
I am in the directory where index.php in located that is document root and i have set path to the php.exe so that i can call it from anywhere.
Quote:d:\\www\htdocs\site\> php index.php cronjob localhost /cronjob
there is a space between localhost and /crontab
and in the index.php i have given
Code:
if(isset($argv[1]) && $argv[1]=='cronjob')
{
$_SERVER['SERVER_NAME'] = $argv[2];
$_SERVER['PATH_INFO'] = $argv[3];
$_SERVER['REQUEST_URI'] = $argv[3];
$_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__);
}
i am setting this because when running from command line server name, document root will be empty
For my old projects in codeigniter the above works prefectly.
But in my recent projects i get the error constants already defined.
there are some constants in constants file but to make it easy for me i have defined all my constants in config.php
so i get an error constants already defined.
when i checked by echoing a string from config.php it echoed two times...
Does the config.php gets executed twice?