本文整理汇总了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;
}