本文整理汇总了PHP中Cron::function_exists方法的典型用法代码示例。如果您正苦于以下问题:PHP Cron::function_exists方法的具体用法?PHP Cron::function_exists怎么用?PHP Cron::function_exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cron
的用法示例。
在下文中一共展示了Cron::function_exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute_call_back
/**
* executes the cron functions from the callback
* @return function outup
*/
public function execute_call_back()
{
$return = FALSE;
if ($this->loaded()) {
if (Cron::function_exists($this->callback)) {
$params = explode(self::PARAMS_SEPARATOR, $this->params);
if (is_array($params)) {
$return = call_user_func_array($this->callback, $params);
} else {
$return = call_user_func($this->callback);
}
} else {
//if function not found deactivate the cron
$this->date_started = Date::unix2mysql();
$this->active = 0;
$this->running = 0;
$this->output = 'Error: Function not found';
$this->save();
}
}
return $return;
}
示例2: execute_call_back
/**
* executes the cron functions from the callback
* @return function outup
*/
public function execute_call_back()
{
$return = FALSE;
if ($this->loaded()) {
if (Cron::function_exists($this->callback)) {
$params = explode(self::PARAMS_SEPARATOR, $this->params);
try {
if (is_array($params)) {
$return = call_user_func_array($this->callback, $params);
} else {
$return = call_user_func($this->callback);
}
} catch (Exception $e) {
Kohana::$log->add(Log::ERROR, 'Cron - ' . $this->callback . ' - ' . print_r($e->getMessage(), 1));
}
} else {
//if function not found deactivate the cron
$this->date_started = Date::unix2mysql();
$this->active = 0;
$this->running = 0;
$this->output = 'Error: Function not found';
$this->save();
}
}
return $return;
}