Changeset 932

Show
Ignore:
Timestamp:
06/05/10 22:11:53 (20 months ago)
Author:
ort
Message:

в плагины добавлен метод GetVersion?()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/engine/classes/Plugin.class.php

    r901 r932  
    223223        } 
    224224         
     225        /** 
     226         * Получает версию плагина 
     227         * 
     228         * @return unknown 
     229         */ 
     230        public function GetVersion() { 
     231                preg_match('/^Plugin([\w]+)$/i',get_class($this),$aMatches);             
     232                $sPluginXML = Config::Get('path.root.server').'/plugins/'.strtolower($aMatches[1]).'/'.ModulePlugin::PLUGIN_XML_FILE; 
     233                if($oXml = @simplexml_load_file($sPluginXML)) { 
     234                        return (string)$oXml->version; 
     235                } 
     236                return null; 
     237        } 
     238         
    225239        public function __call($sName,$aArgs) { 
    226240                return Engine::getInstance()->_CallModule($sName,$aArgs);