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


PHP Piwik_Updater::addComponentToCheck方法代码示例

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


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

 public function test_updaterChecksCoreAndPlugin_checkThatCoreIsRanFirst()
 {
     $updater = new Piwik_Updater();
     $updater->pathUpdateFilePlugins = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/';
     $updater->pathUpdateFileCore = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/';
     $updater->recordComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
     $updater->addComponentToCheck('testpluginUpdates', '0.1');
     $updater->recordComponentSuccessfullyUpdated('core', '0.1');
     $updater->addComponentToCheck('core', '0.3');
     $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
     $this->assertTrue(count($componentsWithUpdateFile) == 2);
     reset($componentsWithUpdateFile);
     $this->assertTrue(key($componentsWithUpdateFile) == 'core');
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:14,代码来源:Updater.test.php

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

示例4: 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'
			// Proxy module is used to redirect users to piwik.org, should still work when Piwik must be updated
			&& $module != 'Proxy')
		{
			Piwik::redirectToModule('CoreUpdater');
		}
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:18,代码来源:CoreUpdater.php

示例5: displayScreenForCoreAndPluginsUpdatesIfNecessary

 public static function displayScreenForCoreAndPluginsUpdatesIfNecessary()
 {
     $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,代码行数:15,代码来源:Piwik.php


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