当前位置: 首页>>代码示例>>PHP>>正文


PHP Updater::getComponentUpdates方法代码示例

本文整理汇总了PHP中Piwik\Updater::getComponentUpdates方法的典型用法代码示例。如果您正苦于以下问题:PHP Updater::getComponentUpdates方法的具体用法?PHP Updater::getComponentUpdates怎么用?PHP Updater::getComponentUpdates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\Updater的用法示例。


在下文中一共展示了Updater::getComponentUpdates方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dispatch

 public function dispatch()
 {
     $module = Common::getRequestVar('module', '', 'string');
     $action = Common::getRequestVar('action', '', 'string');
     if ($module == 'CoreUpdater' || $module == 'Proxy' || $module == 'Installation' || $module == 'LanguagesManager' && $action == 'saveLanguage') {
         return;
     }
     $updater = new PiwikCoreUpdater();
     $updates = $updater->getComponentsWithNewVersion(array('core' => Version::VERSION));
     if (!empty($updates)) {
         Filesystem::deleteAllCacheOnUpdate();
     }
     if ($updater->getComponentUpdates() !== null) {
         if (FrontController::shouldRethrowException()) {
             throw new Exception("Piwik and/or some plugins have been upgraded to a new version. \n" . "--> Please run the update process first. See documentation: http://piwik.org/docs/update/ \n");
         } elseif ($module === 'API') {
             $outputFormat = strtolower(Common::getRequestVar('format', 'xml', 'string', $_GET + $_POST));
             $response = new ResponseBuilder($outputFormat);
             $e = new Exception('Database Upgrade Required. Your Piwik database is out-of-date, and must be upgraded before you can continue.');
             echo $response->getResponseException($e);
             Common::sendResponseCode(503);
             exit;
         } else {
             Piwik::redirectToModule('CoreUpdater');
         }
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:27,代码来源:CoreUpdater.php

示例2: dispatch

 public function dispatch()
 {
     $module = Common::getRequestVar('module', '', 'string');
     $action = Common::getRequestVar('action', '', 'string');
     $updater = new PiwikCoreUpdater();
     $updates = $updater->getComponentsWithNewVersion(array('core' => Version::VERSION));
     if (!empty($updates)) {
         Filesystem::deleteAllCacheOnUpdate();
     }
     if ($updater->getComponentUpdates() !== null && $module != 'CoreUpdater' && $module != 'Proxy' && $module != 'Installation' && !($module == 'LanguagesManager' && $action == 'saveLanguage')) {
         if (FrontController::shouldRethrowException()) {
             throw new Exception("Piwik and/or some plugins have been upgraded to a new version. \n" . "--> Please run the update process first. See documentation: http://piwik.org/docs/update/ \n");
         } else {
             Piwik::redirectToModule('CoreUpdater');
         }
     }
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:17,代码来源:CoreUpdater.php

示例3: runUpdaterAndExit

 public function runUpdaterAndExit($doDryRun = null)
 {
     $updater = new DbUpdater();
     $componentsWithUpdateFile = $updater->getComponentUpdates();
     if (empty($componentsWithUpdateFile)) {
         throw new NoUpdatesFoundException("Everything is already up to date.");
     }
     SettingsServer::setMaxExecutionTime(0);
     $welcomeTemplate = '@CoreUpdater/runUpdaterAndExit_welcome';
     $doneTemplate = '@CoreUpdater/runUpdaterAndExit_done';
     $viewWelcome = new View($welcomeTemplate);
     $this->addCustomLogoInfo($viewWelcome);
     $this->setBasicVariablesView($viewWelcome);
     $viewDone = new View($doneTemplate);
     $this->addCustomLogoInfo($viewDone);
     $this->setBasicVariablesView($viewDone);
     $doExecuteUpdates = Common::getRequestVar('updateCorePlugins', 0, 'integer') == 1;
     if (is_null($doDryRun)) {
         $doDryRun = !$doExecuteUpdates;
     }
     if ($doDryRun) {
         $viewWelcome->queries = $updater->getSqlQueriesToExecute();
         $viewWelcome->isMajor = $updater->hasMajorDbUpdate();
         $this->doWelcomeUpdates($viewWelcome, $componentsWithUpdateFile);
         return $viewWelcome->render();
     }
     // Web
     if ($doExecuteUpdates) {
         $this->warningMessages = array();
         $this->doExecuteUpdates($viewDone, $updater, $componentsWithUpdateFile);
         $this->redirectToDashboardWhenNoError($updater);
         return $viewDone->render();
     }
     exit;
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:35,代码来源:Controller.php

示例4: updateDatabase

 public static function updateDatabase($force = false)
 {
     Cache::deleteTrackerCache();
     Option::clearCache();
     if ($force) {
         // remove version options to force update
         Option::deleteLike('version%');
         Option::set('version_core', '0.0');
     }
     $updater = new Updater();
     $componentsWithUpdateFile = $updater->getComponentUpdates();
     if (empty($componentsWithUpdateFile)) {
         return false;
     }
     $result = $updater->updateComponents($componentsWithUpdateFile);
     if (!empty($result['coreError']) || !empty($result['warnings']) || !empty($result['errors'])) {
         throw new \Exception("Failed to update database (errors or warnings found): " . print_r($result, true));
     }
     return $result;
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:20,代码来源:Fixture.php

示例5: updateComponents

 /**
  * @return array|bool
  */
 protected function updateComponents()
 {
     Access::getInstance();
     return Access::doAsSuperUser(function () {
         $updater = new Updater();
         $componentsWithUpdateFile = $updater->getComponentUpdates();
         if (empty($componentsWithUpdateFile)) {
             return false;
         }
         $result = $updater->updateComponents($componentsWithUpdateFile);
         return $result;
     });
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:16,代码来源:Controller.php


注:本文中的Piwik\Updater::getComponentUpdates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。