Piwik\Updater::hasNewVersion PHP Method

hasNewVersion() public method

Component has a new version?
public hasNewVersion ( string $componentName ) : boolean
$componentName string
return boolean TRUE if compoment is to be updated; FALSE if not
    public function hasNewVersion($componentName)
    {
        return isset($this->componentsWithNewVersion[$componentName]);
    }

Usage Example

 public static function getComponentUpdates(Updater $updater)
 {
     $updater->addComponentToCheck('core', Version::VERSION);
     $plugins = \Piwik\Plugin\Manager::getInstance()->getLoadedPlugins();
     foreach ($plugins as $pluginName => $plugin) {
         $updater->addComponentToCheck($pluginName, $plugin->getVersion());
     }
     $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
     if (count($componentsWithUpdateFile) == 0 && !$updater->hasNewVersion('core')) {
         return null;
     }
     return $componentsWithUpdateFile;
 }
All Usage Examples Of Piwik\Updater::hasNewVersion