cron - New instance in a cronjob php -


i want execute periodic task using php script.

inside script (into cron job), trying instantiate class without success:

the include works fine:

include_once (dirname(__file__).\'../my/class/myobjectmgrclass.php\');

but try instantiate class, cron not work anymore:

$myobjectmgr = new myobjectmgr(); 

"include_once()" try include file define won't stop script if doesn't exists try use require_once(), trigger fatal error if file missing. way when concatenate dirname, add , / begin of string

 require_once (dirname(__file__)). '/../my/class/myobjectmgrclass.php'; 

also don't use \ unless want escape something.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -