View | Details | Raw Unified | Return to bug 6076 | Differences between
and this patch

Collapse All | Expand All

(-)a/classes/install/Installer.inc.php (+33 lines)
 Lines 816-821   class Installer { Link Here 
816
		}
816
		}
817
		return false;
817
		return false;
818
	}
818
	}
819
820
	/**
821
	 * Insert or update plugin data in versions
822
	 * and plugin_settings tables.
823
	 * @return boolean
824
	 */
825
	function addPluginVersions() {
826
		$versionDao =& DAORegistry::getDAO('VersionDAO');
827
		import('lib.pkp.classes.site.VersionCheck');
828
		$categories = PluginRegistry::getCategories();
829
		foreach ($categories as $category) {
830
			PluginRegistry::loadCategory($category);
831
			$plugins = PluginRegistry::getPlugins($category);
832
			if (is_array($plugins)) {
833
				foreach ($plugins as $plugin) {
834
					$versionFile = $plugin->getPluginPath() . '/version.xml';
835
836
					if (FileManager::fileExists($versionFile)) {
837
						$versionInfo =& VersionCheck::parseVersionXML($versionFile);
838
						$pluginVersion = $versionInfo['version'];
839
					} else {
840
						$pluginVersion = new Version(
841
							1, 0, 0, 0, Core::getCurrentDate(), 1,
842
							'plugins.'.$category, basename($plugin->getPluginPath()), '', 0
843
						);
844
					}
845
					$versionDao->insertVersion($pluginVersion, true);
846
				}
847
			}
848
		}
849
850
		return true;
851
	}
819
}
852
}
820
853
821
?>
854
?>

Return to bug 6076