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


PHP Updater::updateDatabase方法代码示例

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


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

示例1: update

 public static function update()
 {
     $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::updateDatabase(__FILE__, self::getSql());
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:34,代码来源:0.5.4.php

示例2: update

 static function update()
 {
     try {
         Updater::updateDatabase(__FILE__, self::getSql());
     } catch (\Exception $e) {
     }
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:7,代码来源:1.7-b1.php

示例3: update

 static function update()
 {
     // manually remove ExampleFeedburner column
     Updater::updateDatabase(__FILE__, self::getSql());
     // remove ExampleFeedburner plugin
     $pluginToDelete = 'ExampleFeedburner';
     self::deletePluginFromConfigFile($pluginToDelete);
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:8,代码来源:1.9.1-b2.php

示例4: update

 static function update()
 {
     Updater::updateDatabase(__FILE__, self::getSql());
     try {
         \Piwik\Plugin\Manager::getInstance()->activatePlugin('Events');
     } catch (\Exception $e) {
     }
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:8,代码来源:2.0-b3.php

示例5: update

 static function update()
 {
     $pluginManager = \Piwik\Plugin\Manager::getInstance();
     try {
         $pluginManager->activatePlugin('UserLanguage');
     } catch (\Exception $e) {
     }
     Updater::updateDatabase(__FILE__, self::getSql());
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:9,代码来源:2.11.0-b4.php

示例6: update

 public static function update()
 {
     Updater::updateDatabase(__FILE__, self::getSql());
     self::updateIPAnonymizationSettings();
     try {
         Manager::getInstance()->activatePlugin('TestRunner');
     } catch (\Exception $e) {
     }
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:9,代码来源:2.9.0-b1.php

示例7: update

 static function update()
 {
     Updater::updateDatabase(__FILE__, self::getSql());
     try {
         self::migrateConfigSuperUserToDb();
     } catch (\Exception $e) {
         throw new UpdaterErrorException($e->getMessage());
     }
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:9,代码来源:2.0.4-b5.php

示例8: update

 static function update()
 {
     Updater::updateDatabase(__FILE__, self::getSql());
     $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:josl,项目名称:CGE-File-Sharing,代码行数:10,代码来源:0.2.10.php

示例9: update

 public static function update()
 {
     Updater::updateDatabase(__FILE__, self::getSql());
     // DeviceDetection upgrade in beta1 timed out on demo #6750
     $archiveBlobTables = self::getAllArchiveBlobTables();
     foreach ($archiveBlobTables as $table) {
         self::updateBrowserArchives($table);
         self::updateOsArchives($table);
     }
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:10,代码来源:2.10.0-b5.php

示例10: update

 static function update()
 {
     try {
         self::enableMaintenanceMode();
         Updater::updateDatabase(__FILE__, self::getSql());
         self::disableMaintenanceMode();
     } catch (\Exception $e) {
         self::disableMaintenanceMode();
         throw $e;
     }
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:11,代码来源:1.8.4-b1.php

示例11: update

 public static function update()
 {
     // delete schema version_
     Option::delete('version_Referers');
     Updater::updateDatabase(__FILE__, self::getSql());
     // old plugins deleted in 2.0-a17 update file
     try {
         \Piwik\Plugin\Manager::getInstance()->activatePlugin('Referrers');
     } catch (\Exception $e) {
     }
     try {
         \Piwik\Plugin\Manager::getInstance()->activatePlugin('ScheduledReports');
     } catch (\Exception $e) {
     }
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:15,代码来源:2.0-a13.php

示例12: update

 static function update()
 {
     try {
         $dashboards = Db::fetchAll('SELECT * FROM `' . Common::prefixTable('user_dashboard') . '`');
         foreach ($dashboards as $dashboard) {
             $idDashboard = $dashboard['iddashboard'];
             $login = $dashboard['login'];
             $layout = $dashboard['layout'];
             $layout = html_entity_decode($layout);
             $layout = str_replace("\\\"", "\"", $layout);
             Db::query('UPDATE `' . Common::prefixTable('user_dashboard') . '` SET layout = ? WHERE iddashboard = ? AND login = ?', array($layout, $idDashboard, $login));
         }
         Updater::updateDatabase(__FILE__, self::getSql());
     } catch (\Exception $e) {
     }
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:16,代码来源:1.7.2-rc7.php

示例13: update

 public static function update()
 {
     $config = Config::getInstance();
     $dbInfos = $config->database;
     if (!isset($dbInfos['schema'])) {
         try {
             if (is_writable(Config::getLocalConfigPath())) {
                 $config->database = $dbInfos;
                 $config->forceSave();
             } else {
                 throw new \Exception('mandatory update failed');
             }
         } catch (\Exception $e) {
         }
     }
     Updater::updateDatabase(__FILE__, self::getSql());
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:17,代码来源:0.6.3.php

示例14: update

 static function update()
 {
     // first we disable the plugins and keep an array of warnings messages
     $pluginsToDisableMessage = array('SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/502'>Click here.</a>", 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>");
     $disabledPlugins = array();
     foreach ($pluginsToDisableMessage as $pluginToDisable => $warningMessage) {
         if (\Piwik\Plugin\Manager::getInstance()->isPluginActivated($pluginToDisable)) {
             \Piwik\Plugin\Manager::getInstance()->deactivatePlugin($pluginToDisable);
             $disabledPlugins[] = $warningMessage;
         }
     }
     // Run the SQL
     Updater::updateDatabase(__FILE__, self::getSql());
     // Outputs warning message, pointing users to the plugin download page
     if (!empty($disabledPlugins)) {
         throw new \Exception("The following plugins were disabled during the upgrade:" . "<ul><li>" . implode('</li><li>', $disabledPlugins) . "</li></ul>");
     }
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:18,代码来源:0.6-rc1.php

示例15: update

 static function update()
 {
     $config = Config::getInstance();
     $dbInfos = $config->database;
     if (!isset($dbInfos['schema'])) {
         try {
             if (is_writable(Config::getLocalConfigPath())) {
                 $dbInfos['schema'] = 'Myisam';
                 $config->database = $dbInfos;
                 $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>[database]</code> the following line: <br /><code>schema = Myisam</code>");
         }
     }
     Updater::updateDatabase(__FILE__, self::getSql());
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:19,代码来源:0.6.3.php


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