Changeset 113 for trunk/include/config_from_xoops.class.php
- Timestamp:
- Mar 18, 2009, 5:50:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/config_from_xoops.class.php
r100 r113 27 27 var $module_url; 28 28 var $module_db_prefix; 29 var $module_version; 30 var $module_codename; 29 31 var $xoops_upload_path; 30 32 var $xoops_upload_url; … … 148 150 $this->module_db_prefix = $this->xoops_db_prefix . '_' . $this->module_name . '_'; 149 151 152 $this->set_module_version(); 153 150 154 } 151 155 … … 153 157 return dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; 154 158 } 155 159 160 // set XPressME module virsion and codename from xoops_versions.php 161 function set_module_version(){ 162 $xoops_version_file = dirname(dirname(__FILE__)) . '/xoops_version.php'; 163 if(file_exists($xoops_version_file)){ 164 $version_file = file($xoops_version_file); 165 $version_pattern = '(\$modversion\[\s*\'version\'\s*\])\s*=\s*[\'"]([^\'"]*)[\'"]'; 166 $codename_pattern = '(\$modversion\[\s*\'codename\'\s*\])\s*=\s*[\'"]([^\'"]*)[\'"]'; 167 $version_found = false; 168 $codename_found = false; 169 for ($i = 0 ; $i <count($version_file) ; $i++){ 170 if (preg_match( "/$version_pattern/", $version_file[$i] ,$v_matches )){ 171 $this->module_version = $v_matches[2]; 172 $version_found = true; 173 } 174 if (preg_match( "/$codename_pattern/", $version_file[$i] ,$c_matches )){ 175 $this->module_codename = $c_matches[2]; 176 $codename_found = true; 177 } 178 if ( $version_found && $codename_found ) break; 179 } 180 } 181 } 182 156 183 } 157 184 ?>
Note: See TracChangeset
for help on using the changeset viewer.