當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik\Updater類代碼示例

本文整理匯總了PHP中Piwik\Updater的典型用法代碼示例。如果您正苦於以下問題:PHP Updater類的具體用法?PHP Updater怎麽用?PHP Updater使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Updater類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doUpdate

 public function doUpdate(Updater $updater)
 {
     // delete schema version_
     Option::delete('version_Referers');
     $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
     // old plugins deleted in 2.0-a17 update file
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:7,代碼來源:2.0-a13.php

示例2: doUpdate

 public function doUpdate(Updater $updater)
 {
     $salt = Common::generateUniqId();
     $config = Config::getInstance();
     $superuser = $config->superuser;
     if (!isset($superuser['salt'])) {
         try {
             if (is_writable(Config::getLocalConfigPath())) {
                 $superuser['salt'] = $salt;
                 $config->superuser = $superuser;
                 $config->forceSave();
             } else {
                 throw new \Exception('mandatory update failed');
             }
         } catch (\Exception $e) {
             throw new \Piwik\UpdaterErrorException("Please edit your config/config.ini.php file and add below <code>[superuser]</code> the following line: <br /><code>salt = {$salt}</code>");
         }
     }
     $plugins = $config->Plugins;
     if (!in_array('MultiSites', $plugins)) {
         try {
             if (is_writable(Config::getLocalConfigPath())) {
                 $plugins[] = 'MultiSites';
                 $config->Plugins = $plugins;
                 $config->forceSave();
             } else {
                 throw new \Exception('optional update failed');
             }
         } catch (\Exception $e) {
             throw new \Exception("You can now enable the new MultiSites plugin in the Plugins screen in the Piwik admin!");
         }
     }
     $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:34,代碼來源:0.5.4.php

示例3: 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

示例4: doUpdate

 public function doUpdate(Updater $updater)
 {
     try {
         $updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
     } catch (\Exception $e) {
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:7,代碼來源:1.4-rc1.php

示例5: doUpdate

 public function doUpdate(Updater $updater)
 {
     $updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
     try {
         \Piwik\Plugin\Manager::getInstance()->activatePlugin('Events');
     } catch (\Exception $e) {
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:8,代碼來源:2.0-b3.php

示例6: getNamespace

 private function getNamespace($component)
 {
     $updater = new Updater();
     $className = $updater->getUpdateClassName($component, 'xx');
     $className = str_replace('Updates_xx', '', $className);
     $className = trim($className, '\\');
     return $className;
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:8,代碼來源:GenerateUpdate.php

示例7: doUpdate

 public function doUpdate(Updater $updater)
 {
     // manually remove ExampleFeedburner column
     $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
     // remove ExampleFeedburner plugin
     $pluginToDelete = 'ExampleFeedburner';
     self::deletePluginFromConfigFile($pluginToDelete);
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:8,代碼來源:1.9.1-b2.php

示例8: doUpdate

 public function doUpdate(Updater $updater)
 {
     $pluginManager = \Piwik\Plugin\Manager::getInstance();
     try {
         $pluginManager->activatePlugin('UserLanguage');
     } catch (\Exception $e) {
     }
     $updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:9,代碼來源:2.11.0-b4.php

示例9: doUpdate

 public function doUpdate(Updater $updater)
 {
     $updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
     self::updateIPAnonymizationSettings();
     try {
         Manager::getInstance()->activatePlugin('TestRunner');
     } catch (\Exception $e) {
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:9,代碼來源:2.9.0-b1.php

示例10: doUpdate

 public function doUpdate(Updater $updater)
 {
     $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
     try {
         self::migrateConfigSuperUserToDb();
     } catch (\Exception $e) {
         throw new UpdaterErrorException($e->getMessage());
     }
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:9,代碼來源:2.0.4-b5.php

示例11: testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst

 public function testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst()
 {
     $updater = new Updater(PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/', PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/');
     $updater->markComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
     $updater->markComponentSuccessfullyUpdated('core', '0.1');
     $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile(array('testpluginUpdates' => '0.1', 'core' => '0.3'));
     $this->assertEquals(2, count($componentsWithUpdateFile));
     reset($componentsWithUpdateFile);
     $this->assertEquals('core', key($componentsWithUpdateFile));
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:10,代碼來源:UpdaterTest.php

示例12: doUpdate

 public function doUpdate(Updater $updater)
 {
     $updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
     $obsoleteDirectories = array('/plugins/AdminHome', '/plugins/Home', '/plugins/PluginsAdmin');
     foreach ($obsoleteDirectories as $dir) {
         if (file_exists(PIWIK_INCLUDE_PATH . $dir)) {
             Filesystem::unlinkRecursive(PIWIK_INCLUDE_PATH . $dir, true);
         }
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:10,代碼來源:0.2.10.php

示例13: doUpdate

 public function doUpdate(Updater $updater)
 {
     $updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
     // DeviceDetection upgrade in beta1 timed out on demo #6750
     $archiveBlobTables = self::getAllArchiveBlobTables();
     foreach ($archiveBlobTables as $table) {
         self::updateBrowserArchives($table);
         self::updateOsArchives($table);
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:10,代碼來源:2.10.0-b5.php

示例14: doUpdate

 public function doUpdate(Updater $updater)
 {
     try {
         self::enableMaintenanceMode();
         $updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
         self::disableMaintenanceMode();
     } catch (\Exception $e) {
         self::disableMaintenanceMode();
         throw $e;
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:11,代碼來源:1.9-b9.php

示例15: doUpdate

 public function doUpdate(Updater $updater)
 {
     $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
     $this->migratePluginEmailUpdateSetting();
     // added .woff and woff2 whitelisted file for apache webserver
     ServerFilesGenerator::deleteHtAccessFiles();
     ServerFilesGenerator::createHtAccessFiles();
     // Renamed plugin ExampleRssWidget -> RssWidget
     \Piwik\Plugin\Manager::getInstance()->activatePlugin('RssWidget');
     \Piwik\Plugin\Manager::getInstance()->deactivatePlugin('ExampleRssWidget');
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:11,代碼來源:3.0.0-b1.php


注:本文中的Piwik\Updater類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。