3 class mw_env_versions extends mw_env{
8 function version($application){
9 return isset($this->versions[$application]) ? $this->versions[$application] : false;
12 function load_versions(){
13 $this->xml_parser = new sxml();
14 $app_config_file = $this->path("mw_dir")."app/config.xml";
15 if(file_exists($app_config_file)){
16 $this->_load_version("mtweb", $app_config_file);
18 if(($plugins = $this->plugins()) !== false){
19 foreach($plugins as $plugin_name => $plugin){
20 $this->load_plugin_version($plugin_name);
23 else $this->erreur("impossible de lire les fichiers de configuration pour les plugins", true);
26 function _load_version($app_name, $app_config_file){
27 $this->xml_parser->parse(file_get_contents($app_config_file));
28 $app_config = $this->xml_parser->data["config"][0];
29 if(isset($app_config["subs"]["version"][0]["data"])){
30 $this->versions[$app_name] = $app_config["subs"]["version"][0]["data"];
34 function load_plugin_version($plugin_name){
35 $app_config_file = $this->path("mw_dir")."plugins/".$plugin_name."/app/config.xml";
36 if(file_exists($app_config_file)){
37 $this->_load_version($plugin_name, $app_config_file);