本文整理汇总了PHP中GO::cronIsRunning方法的典型用法代码示例。如果您正苦于以下问题:PHP GO::cronIsRunning方法的具体用法?PHP GO::cronIsRunning怎么用?PHP GO::cronIsRunning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GO
的用法示例。
在下文中一共展示了GO::cronIsRunning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionStore
/**
* Get a list of all created Cronjob models
*
* @param array $params
*/
public function actionStore($params)
{
if (!\GO::cronIsRunning()) {
throw new \GO\Base\Exception\NoCron();
}
$colModel = new \GO\Base\Data\ColumnModel(\GO\Base\Cron\CronJob::model());
$colModel->formatColumn('active', '$model->isRunning()?\\GO::t("running","cron"):$model->active');
$store = new \GO\Base\Data\DbStore('GO\\Base\\Cron\\CronJob', $colModel, $params);
$store->defaultSort = 'name';
$response = $this->renderStore($store);
echo $response;
}
示例2: runOnce
public static function runOnce()
{
if (!\GO::cronIsRunning()) {
throw new \GO\Base\Exception\NoCron();
}
$jobClass = get_called_class();
$job = new $jobClass();
$cron = new \GO\Base\Cron\CronJob();
$cron->name = $job->getLabel();
$cron->active = true;
$cron->autodestroy = true;
$cron->minutes = '*';
$cron->hours = '*';
$cron->monthdays = '*';
$cron->months = '*';
$cron->weekdays = '*';
$cron->job = $jobClass;
if (!$cron->save()) {
throw new Exception("Failed to save cron job '{$jobClass}'");
}
return $cron;
}
示例3: test_system
//.........这里部分代码省略.........
$ze1compat = ini_get('zend.ze1_compatibility_mode');
$test['name'] = 'zend.ze1_compatibility_mode';
$test['showSuccessFeedback'] = false;
$test['pass'] = empty($ze1compat);
$test['feedback'] = 'Fatal error: zend.ze1_compatibility_mode is enabled. ' . $product_name . ' can\'t run with this setting enabled';
$test['fatal'] = true;
$tests[] = $test;
$url = "http" . (!empty($_SERVER['HTTPS']) ? "s" : "") . "://" . $_SERVER['HTTP_HOST'];
$headers = @get_headers($url . '/caldav');
$test['name'] = 'CalDAV alias';
$test['showSuccessFeedback'] = false;
$test['pass'] = $headers && (strpos($headers[0], '401') !== false || strpos($headers[0], '200') !== false);
$test['feedback'] = "Note: The alias /caldav was not detected. Please create: Alias /caldav /groupoffice/modules/caldav/calendar.php.";
$test['fatal'] = false;
$tests[] = $test;
$headers = @get_headers($url . '/.well-known/caldav');
$test['name'] = 'CalDAV autodiscovery';
$test['showSuccessFeedback'] = false;
$test['pass'] = $headers && (strpos($headers[0], '301') !== false || strpos($headers[0], '200') !== false);
$test['feedback'] = "Note: The redirect /.well-known/caldav was not detected. Please create a redirect: Redirect 301 /.well-known/caldav /caldav";
$test['fatal'] = false;
$tests[] = $test;
$headers = @get_headers($url . '/carddav');
$test['name'] = 'CardDAV alias';
$test['showSuccessFeedback'] = false;
$test['pass'] = $headers && (strpos($headers[0], '401') !== false || strpos($headers[0], '200') !== false);
$test['feedback'] = "Note: The alias /carddav was not detected. Please create: Alias /carddav /groupoffice/modules/carddav/addressbook.php.";
$test['fatal'] = false;
$tests[] = $test;
$headers = @get_headers($url . '/.well-known/carddav');
$test['name'] = 'CardDAV autodiscovery';
$test['showSuccessFeedback'] = false;
$test['pass'] = $headers && (strpos($headers[0], '301') !== false || strpos($headers[0], '200') !== false);
$test['feedback'] = "Note: The redirect /.well-known/carddav was not detected. Please create a redirect: Redirect 301 /.well-known/carddav /carddav";
$test['fatal'] = false;
$tests[] = $test;
$headers = @get_headers($url . '/Microsoft-Server-ActiveSync');
// var_dump($headers);
$test['name'] = 'Microsoft-Server-ActiveSync alias';
$test['showSuccessFeedback'] = false;
$test['pass'] = $headers && (strpos($headers[0], '401') !== false || strpos($headers[0], '200') !== false);
$test['feedback'] = "Note: The alias /Microsoft-Server-ActiveSync was not detected. Please create: Alias /Microsoft-Server-ActiveSync /groupoffice/modules/z-push/index.php.";
$test['fatal'] = false;
$tests[] = $test;
$test['name'] = 'Shared Memory Functions';
$test['showSuccessFeedback'] = false;
$test['pass'] = function_exists('sem_get') && function_exists('shm_attach') && function_exists('sem_acquire') && function_exists('shm_get_var');
$test['feedback'] = "InterProcessData::InitSharedMem(): PHP libraries for the use shared memory are not available. Z-push will work unreliably!";
$test['fatal'] = false;
$tests[] = $test;
$test['name'] = 'Process Control Extensions';
$test['showSuccessFeedback'] = false;
$test['pass'] = function_exists('posix_getuid');
$test['feedback'] = "Process Control Extensions PHP library not avaialble. Z-push will work unreliably!";
$test['fatal'] = false;
$tests[] = $test;
if (class_exists('GO')) {
// $test['name']='Writable license file';
// $test['pass']=GO::getLicenseFile()->exists() && GO::getLicenseFile()->isWritable();
// $test['feedback']="Fatal: the license file ".GO::getLicenseFile()->path()." is not writable. Please make it writable for the webserver.";
// $test['fatal']=true;
//
// $tests[]=$test;
$root = dirname(dirname(__FILE__));
if ($ioncubeWorks && is_dir($root . '/modules/professional')) {
$test['name'] = 'Professional license';
$test['showSuccessFeedback'] = false;
// if(!file_exists(GO::config()->root_path.'groupoffice-pro-'.\GO::config()->getMajorVersion().'-license.txt')){
// $test['feedback']='Warning: There\'s no license file "groupoffice-pro-'.\GO::config()->getMajorVersion().'-license.txt" in the root of Group-Office. The professional modules will not be enabled.';
// $test['fatal']=false;
// $test['pass']=false;
// }else
if (!\GO::scriptCanBeDecoded('Professional')) {
$test['feedback'] = 'Warning: Your professional license is invalid. The professional modules will not be enabled. Please contact Intermesh about this problem and supply the output of this page.';
$test['fatal'] = false;
$test['pass'] = false;
} else {
$test['feedback'] = '';
$test['fatal'] = false;
$test['pass'] = true;
}
$tests[] = $test;
}
if (\GO::isInstalled()) {
$test['name'] = 'Protected files path';
$test['showSuccessFeedback'] = false;
$test['pass'] = is_writable(\GO::config()->file_storage_path);
$test['feedback'] = 'Fatal error: the file_storage_path setting in config.php is not writable. You must correct this or ' . $product_name . ' will not run.';
$test['fatal'] = false;
$tests[] = $test;
$test['name'] = 'Cronjob';
$test['showSuccessFeedback'] = false;
$test['pass'] = GO::cronIsRunning();
$test['feedback'] = "Warning: The main cron job doesn't appear to be running. Please add a cron job: \n\n* * * * * www-data php " . \GO::config()->root_path . "groupofficecli.php -c=" . \GO::config()->get_config_file() . " -r=core/cron/run -q > /dev/null";
$test['fatal'] = false;
$tests[] = $test;
}
}
return $tests;
}