예제 #1
0
파일: Log.php 프로젝트: Doluci/tomatocart
 public static function getFormattedString($string)
 {
     if (Piwik::isPhpCliMode()) {
         $string = str_replace(array('<br>', '<br />', '<br/>'), "\n", $string);
         $string = strip_tags($string);
     }
     return $string;
 }
예제 #2
0
파일: Controller.php 프로젝트: ntulip/piwik
 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
0
 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;
 }
 /**
  * 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
0
 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;
 }