From ce1cee6bcec085f89beef315a91df4566e8d2e59 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sat, 5 Jun 2010 18:11:53 +0000 Subject: [PATCH] =?UTF-8?q?=D0=B2=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20GetVersion()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/classes/Plugin.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/engine/classes/Plugin.class.php b/engine/classes/Plugin.class.php index 79c63f93..cb57b8c7 100644 --- a/engine/classes/Plugin.class.php +++ b/engine/classes/Plugin.class.php @@ -222,6 +222,20 @@ abstract class Plugin extends Object { return false; } + /** + * Получает версию плагина + * + * @return unknown + */ + public function GetVersion() { + preg_match('/^Plugin([\w]+)$/i',get_class($this),$aMatches); + $sPluginXML = Config::Get('path.root.server').'/plugins/'.strtolower($aMatches[1]).'/'.ModulePlugin::PLUGIN_XML_FILE; + if($oXml = @simplexml_load_file($sPluginXML)) { + return (string)$oXml->version; + } + return null; + } + public function __call($sName,$aArgs) { return Engine::getInstance()->_CallModule($sName,$aArgs); }