本文整理匯總了PHP中Piwik\Updater::hasNewVersion方法的典型用法代碼示例。如果您正苦於以下問題:PHP Updater::hasNewVersion方法的具體用法?PHP Updater::hasNewVersion怎麽用?PHP Updater::hasNewVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Updater
的用法示例。
在下文中一共展示了Updater::hasNewVersion方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getComponentUpdates
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;
}
示例2: getUpdatesForDimension
/**
* @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;
}
示例3: getComponentUpdates
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;
}