本文整理匯總了PHP中eZContentLanguage::setCronjobMode方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentLanguage::setCronjobMode方法的具體用法?PHP eZContentLanguage::setCronjobMode怎麽用?PHP eZContentLanguage::setCronjobMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentLanguage
的用法示例。
在下文中一共展示了eZContentLanguage::setCronjobMode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: clearCronjobMode
/**
* Switches off the cronjob mode.
*
* \see eZContentLanguage::setCronjobMode()
*/
static function clearCronjobMode()
{
eZContentLanguage::setCronjobMode(false);
}
示例2: MaxScriptExecutionTime
*/
/* No more than one instance of a cronjob script can be run at any given time.
If a script uses more time than the configured MaxScriptExecutionTime (see
cronjob.ini), the next instance of it will try to gracefully steal the
cronjob script mutex. If the process has been running for more than two
times MaxScriptExecutionTime, the original process will be killed.
*/
/* Set a default time zone if none is given. The time zone can be overridden
in config.php or php.ini.
*/
if (!ini_get("date.timezone")) {
date_default_timezone_set("UTC");
}
require_once 'autoload.php';
require_once 'kernel/common/i18n.php';
eZContentLanguage::setCronjobMode();
$cli = eZCLI::instance();
$script = eZScript::instance(array('debug-message' => '', 'use-session' => true, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$webOutput = $cli->isWebOutput();
function help()
{
$argv = $_SERVER['argv'];
$cli = eZCLI::instance();
$cli->output("Usage: " . $argv[0] . " [OPTION]... [PART]\n" . "Executes eZ Publish cronjobs.\n" . "\n" . "General options:\n" . " -h,--help display this help and exit \n" . " -q,--quiet do not give any output except when errors occur\n" . " -s,--siteaccess selected siteaccess for operations, if not specified default siteaccess is used\n" . " -d,--debug display debug output at end of execution\n" . " -c,--colors display output using ANSI colors\n" . " --sql display sql queries (must be used in conjunction with debug option)\n" . " --logfiles create log files\n" . " --no-logfiles do not create log files (default)\n" . " --list list all cronjobs parts and the scripts contained by each one\n" . " --no-colors do not use ANSI coloring (default)\n");
}
function changeSiteAccessSetting(&$siteaccess, $optionData)
{
$cli = eZCLI::instance();
if (file_exists('settings/siteaccess/' . $optionData)) {
$siteaccess = $optionData;