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 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;
 }
Beispiel #2
0
 /**
  * @param ActionDimension|ConversionDimension|VisitDimension $dimension
  * @param string $componentPrefix
  * @param array $existingColumnsInDb
  * @param array $conversionColumns
  * @return array
  */
 private function getUpdatesForDimension(PiwikUpdater $updater, $dimension, $componentPrefix, $existingColumnsInDb, $conversionColumns = array())
 {
     $column = $dimension->getColumnName();
     $componentName = $componentPrefix . $column;
     if (!$updater->hasNewVersion($componentName)) {
         return array();
     }
     if (array_key_exists($column, $existingColumnsInDb)) {
         if ($dimension instanceof VisitDimension) {
             $sqlUpdates = $dimension->update($conversionColumns);
         } else {
             $sqlUpdates = $dimension->update();
         }
     } else {
         $sqlUpdates = $dimension->install();
     }
     return $sqlUpdates;
 }
Beispiel #3
0
 public static function getComponentUpdates(Updater $updater)
 {
     $updater->addComponentToCheck('core', Version::VERSION);
     $manager = \Piwik\Plugin\Manager::getInstance();
     $plugins = $manager->getLoadedPlugins();
     foreach ($plugins as $pluginName => $plugin) {
         if ($manager->isPluginInstalled($pluginName)) {
             $updater->addComponentToCheck($pluginName, $plugin->getVersion());
         }
     }
     $columnsVersions = ColumnsUpdater::getAllVersions();
     foreach ($columnsVersions as $component => $version) {
         $updater->addComponentToCheck($component, $version);
     }
     $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
     if (count($componentsWithUpdateFile) == 0) {
         ColumnsUpdater::onNoUpdateAvailable($columnsVersions);
         if (!$updater->hasNewVersion('core')) {
             return null;
         }
     }
     return $componentsWithUpdateFile;
 }