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


PHP Piwik_Updater::updateDatabase方法代码示例

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


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

示例1: update

	static function update()
	{
		if(Piwik::isTimezoneSupportEnabled())
		{
			Piwik_Updater::updateDatabase(__FILE__, self::getSql());
		}
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:7,代码来源:0.9.1.php

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

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

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

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

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

示例7: update

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

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

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

示例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()
	{
		$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

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

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

示例14: update

	static function update()
	{
		Piwik_Updater::updateDatabase(__FILE__, array(
			'ALTER TABLE `'. Piwik::prefixTable('log_conversion') .'`
				CHANGE `idlink_va` `idlink_va` INT(11) DEFAULT NULL' => false,
			'ALTER TABLE `'. Piwik::prefixTable('log_conversion') .'`
				CHANGE `idaction` `idaction` INT(11) DEFAULT NULL' => false,
		));
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:9,代码来源:0.4.1.php

示例15: update

    static function update()
    {
        // alter table to set the utf8 collation
        $tablesToAlter = Piwik::getTablesInstalled(true);
        foreach ($tablesToAlter as $table) {
            $sqlarray['ALTER TABLE `' . $table . '`
				CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci '] = false;
        }
        Piwik_Updater::updateDatabase(__FILE__, $sqlarray);
    }
开发者ID:ntulip,项目名称:piwik,代码行数:10,代码来源:0.2.33.php


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