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


PHP Piwik_Updater類代碼示例

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


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

示例1: dispatch

	function dispatch()
	{
		$language = Piwik_Common::getRequestVar('language', '', 'string');
		if($language != '')
		{
			$updaterController = new Piwik_CoreUpdater_Controller();
			$updaterController->saveLanguage();
			exit;
		}

		$updater = new Piwik_Updater();
		$updater->addComponentToCheck('core', Piwik_Version::VERSION);
		
		$plugins = Piwik_PluginsManager::getInstance()->getInstalledPlugins();
		foreach($plugins as $pluginName => $plugin)
		{
			$updater->addComponentToCheck($pluginName, $plugin->getVersion());
		}
		
		$componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
		if(count($componentsWithUpdateFile) == 0)
		{
			return;
		}
			
		$updaterController = new Piwik_CoreUpdater_Controller();
		$updaterController->runUpdaterAndExit($updater, $componentsWithUpdateFile);
	}	
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:28,代碼來源:CoreUpdater.php

示例2: update

 static function update()
 {
     try {
         Piwik_Updater::updateDatabase(__FILE__, self::getSql());
     } catch (Exception $e) {
     }
 }
開發者ID:neolf,項目名稱:PIWIK4MOBILE,代碼行數:7,代碼來源:1.7-b1.php

示例3: update

	static function update()
	{
		if(Piwik::isTimezoneSupportEnabled())
		{
			Piwik_Updater::updateDatabase(__FILE__, self::getSql());
		}
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:7,代碼來源:0.9.1.php

示例4: update

	static function update()
	{
		Piwik_Updater::updateDatabase(__FILE__, array(
			'ALTER TABLE `'. Piwik::prefixTable('user_dashboard') .'`
				CHANGE `layout` `layout` TEXT NOT NULL' => false,
		));
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:7,代碼來源:0.2.35.php

示例5: 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=http://dev.piwik.org/trac/ticket/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=http://dev.piwik.org/trac/ticket/45'>Click here.</a>"
		);
		$disabledPlugins = array();
		foreach($pluginsToDisableMessage as $pluginToDisable => $warningMessage) 
		{
			if(Piwik_PluginsManager::getInstance()->isPluginActivated($pluginToDisable))
			{
				Piwik_PluginsManager::getInstance()->deactivatePlugin($pluginToDisable);
				$disabledPlugins[] = $warningMessage;
			}
		}
		
		// Run the SQL
		Piwik_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:BackupTheBerlios,項目名稱:oos-svn,代碼行數:29,代碼來源:0.6-rc1.php

示例6: update

 static function update()
 {
     $salt = Piwik_Common::generateUniqId();
     if (!isset(Piwik_Config::getInstance()->superuser['salt'])) {
         try {
             if (is_writable(Piwik_Config::getLocalConfigPath())) {
                 Piwik_Config::getInstance()->setConfigOption('superuser', 'salt', $salt);
                 Piwik_Config::getInstance()->forceSave();
             } else {
                 throw new Exception('mandatory update failed');
             }
         } catch (Exception $e) {
             throw new Piwik_Updater_UpdateErrorException("Please edit your config/config.ini.php file and add below <code>[superuser]</code> the following line: <br /><code>salt = {$salt}</code>");
         }
     }
     $plugins = Piwik_Config::getInstance()->Plugins;
     if (!in_array('MultiSites', $plugins)) {
         try {
             if (is_writable(Piwik_Config::getLocalConfigPath())) {
                 $plugins[] = 'MultiSites';
                 Piwik_Config::getInstance()->setConfigSection('Plugins', $plugins);
                 Piwik_Config::getInstance()->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!");
         }
     }
     Piwik_Updater::updateDatabase(__FILE__, self::getSql());
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:31,代碼來源:0.5.4.php

示例7: update

	static function update()
	{
		$sqlarray = array(
			'ALTER TABLE `'. Piwik::prefixTable('log_visit') .'`
				ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => false,
			// 0.2.27 [826]
			'ALTER IGNORE TABLE `'. Piwik::prefixTable('log_visit') .'`
				CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => false,
		);

		$tables = Piwik::getTablesCreateSql();
		$sqlarray[ $tables['log_conversion'] ] = false;
		$sqlarray[ $tables['goal'] ] = false;

		$tables = Piwik::getTablesInstalled();
		foreach($tables as $tableName)
		{
			if(preg_match('/archive_/', $tableName) == 1)
			{
				$sqlarray[ 'CREATE INDEX index_all ON '. $tableName .' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)' ] = false;
			}
		}

		Piwik_Updater::updateDatabase(__FILE__, $sqlarray);
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:25,代碼來源:0.2.27.php

示例8: update

	static function update()
	{
		$config = Zend_Registry::get('config');
		$dbInfos = $config->database->toArray();
		if(!isset($dbInfos['schema']))
		{
			try {
				if(is_writable( Piwik_Config::getDefaultUserConfigPath() ))
				{
					$dbInfos['schema'] = 'Myisam';
					$config->database = $dbInfos;

					$config->__destruct();
					Piwik::createConfigObject();
				}
				else
				{
					throw new Exception('mandatory update failed');
				}
			} catch(Exception $e) {
				throw new Piwik_Updater_UpdateErrorException("Please edit your config/config.ini.php file and add below <code>[database]</code> the following line: <br /><code>schema = Myisam</code>");
			}
		}

		Piwik_Updater::updateDatabase(__FILE__, self::getSql());
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:26,代碼來源:0.6.3.php

示例9: update

 static function update()
 {
     Piwik_Updater::updateDatabase(__FILE__, self::getSql());
     try {
         Piwik_PluginsManager::getInstance()->activatePlugin('Transitions');
     } catch (Exception $e) {
     }
 }
開發者ID:nomoto-ubicast,項目名稱:piwik,代碼行數:8,代碼來源:1.9-b19.php

示例10: update

    static function update()
    {
        Piwik_Updater::updateDatabase(__FILE__, array('ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
				ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => '/1060/', 'ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
				ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => '/1060/', 'ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
				ADD `config_gears` TINYINT(1) NOT NULL AFTER  `config_windowsmedia`,
				ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => false));
    }
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:8,代碼來源:0.4.2.php

示例11: update

	static function update()
	{
		Piwik_Updater::updateDatabase(__FILE__, array(
			'DELETE FROM `'.  Piwik::prefixTable('user_dashboard') ."`
				WHERE layout LIKE '%.getLastVisitsGraph%'
				OR layout LIKE '%.getLastVisitsReturningGraph%'" => false,
		));
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:8,代碼來源:0.2.37.php

示例12: update

    static function update()
    {
        Piwik_Updater::updateDatabase(__FILE__, array('UPDATE `' . Piwik::prefixTable('log_visit') . '`
				SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false, 'ALTER TABLE `' . Piwik::prefixTable('log_visit') . '`
				CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => false, 'UPDATE `' . Piwik::prefixTable('logger_api_call') . '`
				SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => false, 'ALTER TABLE `' . Piwik::prefixTable('logger_api_call') . '`
				CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => false));
    }
開發者ID:ntulip,項目名稱:piwik,代碼行數:8,代碼來源:0.4.php

示例13: update

 static function update()
 {
     // manually remove ExampleFeedburner column
     Piwik_Updater::updateDatabase(__FILE__, self::getSql());
     // remove ExampleFeedburner plugin
     $pluginToDelete = 'ExampleFeedburner';
     self::deletePluginFromConfigFile($pluginToDelete);
 }
開發者ID:nomoto-ubicast,項目名稱:piwik,代碼行數:8,代碼來源:1.9.1-b2.php

示例14: update

	static function update()
	{
		$tables = Piwik::getTablesCreateSql();
		Piwik_Updater::updateDatabase(__FILE__, array(
			'DROP TABLE IF EXISTS `'. Piwik::prefixTable('option') .'`' => false,
			$tables['option'] => false,
		));
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:8,代碼來源:0.2.13.php

示例15: dispatch

 function dispatch()
 {
     $module = Piwik_Common::getRequestVar('module', '', 'string');
     $updater = new Piwik_Updater();
     $updater->addComponentToCheck('core', Piwik_Version::VERSION);
     $updates = $updater->getComponentsWithNewVersion();
     if (!empty($updates)) {
         Piwik::deleteAllCacheOnUpdate();
     }
     if (self::getComponentUpdates($updater) !== null && $module != 'CoreUpdater' && $module != 'Proxy') {
         if (Piwik_FrontController::shouldRethrowException()) {
             throw new Exception("Piwik and/or some plugins have been upgraded to a new version. Please run the update process first. See documentation: http://piwik.org/docs/update/");
         } else {
             Piwik::redirectToModule('CoreUpdater');
         }
     }
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:17,代碼來源:CoreUpdater.php


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