本文整理匯總了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;
}