- Timestamp:
- May 20, 2011, 1:55:21 PM (14 years ago)
- Location:
- branches/Ver3.0/xpressme_integration_kit/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Ver3.0/xpressme_integration_kit/include/memory_limit.php
r551 r752 3 3 function xpress_set_memory_limmit(){ 4 4 global $xoops_config; 5 global $xoopsDB ;5 global $xoopsDB,$xoopsModule,$xoopsModuleConfig; 6 6 7 $module_id = ''; 8 $memory = ''; 9 10 if (!is_object($xoops_config)){ 11 require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 12 $xoops_config = new ConfigFromXoops; 13 } 14 15 $has_xoops_db = (!empty($xoopsDB)); 16 if (!$has_xoops_db) { 17 $cn = mysql_connect($xoops_config->xoops_db_host, $xoops_config->xoops_db_user, $xoops_config->xoops_db_pass); 18 if ($cn){ 19 $db_selected = mysql_select_db($xoops_config->xoops_db_name, $cn); 20 } 21 } 22 23 // get module ID 24 $module_table = $xoops_config->xoops_db_prefix . '_modules'; 25 $module_sql = "SELECT mid FROM $module_table WHERE `dirname` = '$xoops_config->module_name'"; 26 if ($has_xoops_db) { 27 if ($result = $xoopsDB->query($module_sql, 0, 0)){ 28 $row = $xoopsDB->fetchArray($result); 29 $module_id = $row['mid']; 30 } 31 } else { 32 if ($db_selected){ 33 if($result = mysql_query($module_sql)){ 34 $row = mysql_fetch_assoc($result); 35 $module_id = $row['mid']; 36 } 37 } 38 } 39 if (!empty($module_id)){ 40 // get memory_limit 41 $config_table = $xoops_config->xoops_db_prefix . '_config'; 42 $config_sql = "SELECT conf_value FROM $config_table WHERE `conf_modid` = $module_id AND `conf_name` = 'memory_limit'"; 43 if ($has_xoops_db) { 44 if ($result = $xoopsDB->query($config_sql, 0, 0)){ 45 $row = $xoopsDB->fetchArray($result); 46 $memory = $row['conf_value']; 47 } 48 } else { 49 if ($db_selected){ 50 if($result = mysql_query($config_sql)){ 51 $row = mysql_fetch_assoc($result); 52 $memory = $row['conf_value']; 53 } 54 } 55 } 56 } 57 if (!$has_xoops_db) { 58 mysql_close($cn); 59 } 7 $memory = ! empty($xoopsModuleConfig) ? $xoopsModuleConfig['memory_limit'] : 0; 60 8 61 9 if (empty($memory)) return; -
branches/Ver3.0/xpressme_integration_kit/include/onuninstall.php
r751 r752 9 9 function xpress_onuninstall_base( $module , $mydirname ) 10 10 { 11 global $xoopsDB ;11 global $xoopsDB,$xoopsModule; 12 12 // transations on module uninstall 13 13 … … 23 23 } 24 24 25 $mid = $ module->getVar('mid') ;25 $mid = $xoopsModule->getVar('mid') ; 26 26 27 27 $xp_prefix = preg_replace('/wordpress/','wp',$mydirname);
Note: See TracChangeset
for help on using the changeset viewer.