当前位置: 首页>>代码示例>>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;未经允许,请勿转载。