Skip to content

Commit

Permalink
*6076* Plug-In version entries are not properly being installed/updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrandel committed Oct 29, 2010
1 parent cee3460 commit 933dc1a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions classes/install/Installer.inc.php
Expand Up @@ -701,6 +701,39 @@ function columnExists($tableName, $columnName) {
}
return false;
}

/**
* Insert or update plugin data in versions
* and plugin_settings tables.
* @return boolean
*/
function addPluginVersions() {
$versionDao =& DAORegistry::getDAO('VersionDAO');
import('lib.pkp.classes.site.VersionCheck');
$categories = PluginRegistry::getCategories();
foreach ($categories as $category) {
PluginRegistry::loadCategory($category);
$plugins = PluginRegistry::getPlugins($category);
if (is_array($plugins)) {
foreach ($plugins as $plugin) {
$versionFile = $plugin->getPluginPath() . '/version.xml';

if (FileManager::fileExists($versionFile)) {
$versionInfo =& VersionCheck::parseVersionXML($versionFile);
$pluginVersion = $versionInfo['version'];
} else {
$pluginVersion = new Version(
1, 0, 0, 0, Core::getCurrentDate(), 1,
'plugins.'.$category, basename($plugin->getPluginPath()), '', 0
);
}
$versionDao->insertVersion($pluginVersion, true);
}
}
}

return true;
}
}

?>

0 comments on commit 933dc1a

Please sign in to comment.