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
Post a Comment