本文整理匯總了PHP中Piwik::isPhpCliMode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik::isPhpCliMode方法的具體用法?PHP Piwik::isPhpCliMode怎麽用?PHP Piwik::isPhpCliMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik
的用法示例。
在下文中一共展示了Piwik::isPhpCliMode方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getFormattedString
public static function getFormattedString($string)
{
if (Piwik::isPhpCliMode()) {
$string = str_replace(array('<br>', '<br />', '<br/>'), "\n", $string);
$string = strip_tags($string);
}
return $string;
}
示例2: runUpdaterAndExit
public function runUpdaterAndExit($updater, $componentsWithUpdateFile)
{
if (empty($componentsWithUpdateFile)) {
return;
}
if (Piwik::isPhpCliMode()) {
Piwik::setMaxExecutionTime(0);
$view = Piwik_View::factory('update_welcome');
$this->doWelcomeUpdates($view, $componentsWithUpdateFile);
if (!$this->coreError) {
$view = Piwik_View::factory('update_database_done');
$this->doExecuteUpdates($view, $updater, $componentsWithUpdateFile);
}
} else {
if (Piwik_Common::getRequestVar('updateCorePlugins', 0, 'integer') == 1) {
$view = Piwik_View::factory('update_database_done');
$this->doExecuteUpdates($view, $updater, $componentsWithUpdateFile);
} else {
$view = Piwik_View::factory('update_welcome');
$this->doWelcomeUpdates($view, $componentsWithUpdateFile);
}
}
exit;
}
示例3: runUpdaterAndExit
public function runUpdaterAndExit()
{
$updater = new Piwik_Updater();
$componentsWithUpdateFile = Piwik_CoreUpdater::getComponentUpdates($updater);
if (empty($componentsWithUpdateFile)) {
return;
}
Piwik::setMaxExecutionTime(0);
if (Piwik::isPhpCliMode()) {
$view = Piwik_View::factory('update_welcome');
$this->doWelcomeUpdates($view, $componentsWithUpdateFile);
if (!$this->coreError) {
$view = Piwik_View::factory('update_database_done');
$this->doExecuteUpdates($view, $updater, $componentsWithUpdateFile);
}
} else {
if (Piwik_Common::getRequestVar('updateCorePlugins', 0, 'integer') == 1) {
$this->warningMessages = array();
$view = Piwik_View::factory('update_database_done');
$this->doExecuteUpdates($view, $updater, $componentsWithUpdateFile);
} else {
$view = Piwik_View::factory('update_welcome');
$view->queries = $updater->getSqlQueriesToExecute();
$this->doWelcomeUpdates($view, $componentsWithUpdateFile);
}
}
exit;
}
示例4: isArchivingDisabled
/**
* Returns true if, for some reasons, triggering the archiving is disabled.
*
* @return bool
*/
protected function isArchivingDisabled()
{
static $archivingIsDisabled = null;
if (is_null($archivingIsDisabled)) {
$archivingIsDisabled = false;
$enableBrowserArchivingTriggering = (bool) Zend_Registry::get('config')->General->enable_browser_archiving_triggering;
if ($enableBrowserArchivingTriggering == false) {
if (!Piwik::isPhpCliMode()) {
$archivingIsDisabled = true;
}
}
}
return $archivingIsDisabled;
}
示例5: runUpdaterAndExit
public function runUpdaterAndExit($updater, $componentsWithUpdateFile)
{
if (empty($componentsWithUpdateFile)) {
return;
}
if (Piwik::isPhpCliMode()) {
@set_time_limit(0);
$view = new Piwik_View('CoreUpdater/templates/cli_update_welcome.tpl', null, false);
$this->doWelcomeUpdates($view, $componentsWithUpdateFile);
if (!$this->coreError) {
$view = new Piwik_View('CoreUpdater/templates/cli_update_database_done.tpl', null, false);
$this->doExecuteUpdates($view, $updater, $componentsWithUpdateFile);
}
} else {
if (Piwik_Common::getRequestVar('updateCorePlugins', 0, 'integer') == 1) {
$view = new Piwik_View('CoreUpdater/templates/update_database_done.tpl');
$this->doExecuteUpdates($view, $updater, $componentsWithUpdateFile);
} else {
$view = new Piwik_View('CoreUpdater/templates/update_welcome.tpl');
$this->doWelcomeUpdates($view, $componentsWithUpdateFile);
}
}
exit;
}