Changeset 551
- Timestamp:
- Mar 17, 2010, 11:38:11 AM (15 years ago)
- Location:
- trunk/xpressme_integration_kit
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/admin/index.php
r518 r551 166 166 global $xoopsModule; 167 167 include(dirname(__FILE__) . '/../wp-includes/version.php'); 168 require_once dirname(dirname( __FILE__ )).'/ class/config_from_xoops.class.php' ;168 require_once dirname(dirname( __FILE__ )).'/include/memory_limit.php' ; 169 169 170 170 if ($is_report) { … … 196 196 echo ini_get( 'memory_limit' ); 197 197 echo "<br />\n"; 198 $xoops_config = new ConfigFromXoops; 199 $xoops_config->xpress_set_memory_limmit(); 198 xpress_set_memory_limmit(); 200 199 echo "change memory_limit: " ; 201 200 echo ini_get( 'memory_limit' ); … … 270 269 echo ini_get( 'memory_limit' ); 271 270 echo "</text><br />"; 272 $xoops_config = new ConfigFromXoops; 273 $xoops_config->xpress_set_memory_limmit(); 271 xpress_set_memory_limmit(); 274 272 echo "<label>change memory_limit:</label><text>"; 275 273 echo ini_get( 'memory_limit' ); -
trunk/xpressme_integration_kit/class/config_from_xoops.class.php
r531 r551 101 101 $this->set_module_version(); 102 102 $this->set_wp_version(); 103 $this->xpress_get_module_id();104 $this->xoops_language = $this->xpress_get_xoops_config('language');105 $this->xpress_get_module_config();106 103 } 107 104 … … 300 297 } 301 298 302 function xpress_get_xoops_config($config_name = '',$mid = 0){303 $ret = '';304 $cn = mysql_connect($this->xoops_db_host, $this->xoops_db_user, $this->xoops_db_pass);305 if (!$cn) return $ret;306 307 $db_selected = mysql_select_db($this->xoops_db_name, $cn);308 if ($db_selected){309 $table_name = $this->xoops_db_prefix . '_config';310 $sql = "SELECT conf_value AS value FROM $table_name WHERE `conf_modid` = $mid AND `conf_name` = '$config_name'";311 if($result = mysql_query($sql)){312 $row = mysql_fetch_assoc($result);313 $ret = $row['value'];314 } else {315 $ret = $sql;316 }317 }318 if( ! defined( 'XOOPS_ROOT_PATH' ) ) mysql_close($cn);319 return $ret;320 }321 322 function xpress_get_module_config(){323 $this->module_config= array();324 $cn = mysql_connect($this->xoops_db_host, $this->xoops_db_user, $this->xoops_db_pass);325 if (!$cn) return $ret;326 327 $db_selected = mysql_select_db($this->xoops_db_name, $cn);328 if ($db_selected){329 $table_name = $this->xoops_db_prefix . '_config';330 $sql = "SELECT conf_name AS name, conf_value AS value FROM $table_name WHERE `conf_modid` = $this->module_id";331 if($result = mysql_query($sql)){332 while ($row = mysql_fetch_assoc($result)) {333 $this->module_config[$row['name']] = $row['value'];334 }335 }336 }337 if( ! defined( 'XOOPS_ROOT_PATH' ) ) mysql_close($cn);338 return $this->module_config;339 }340 341 function xpress_get_module_id(){342 $this->module_id = '';343 $cn = mysql_connect($this->xoops_db_host, $this->xoops_db_user, $this->xoops_db_pass);344 if ($cn){345 $db_selected = mysql_select_db($this->xoops_db_name, $cn);346 if ($db_selected){347 $table_name = $this->xoops_db_prefix . '_modules';348 $sql = "SELECT mid FROM $table_name WHERE `dirname` = '$this->module_name'";349 if($result = mysql_query($sql)){350 $row = mysql_fetch_assoc($result);351 $this->module_id = $row['mid'];352 }353 }354 if( ! defined( 'XOOPS_ROOT_PATH' ) ) mysql_close($cn);355 }356 return $this->module_id;357 }358 359 360 // Set XPressME memory limit361 function xpress_set_memory_limmit(){362 $memory = $this->module_config['memory_limit'];363 if (empty($memory)) return;364 if ( !defined('WP_MEMORY_LIMIT') )365 define('WP_MEMORY_LIMIT', $memory . 'M');366 if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) )367 @ini_set('memory_limit', WP_MEMORY_LIMIT);368 }369 370 371 372 299 } 373 300 ?> -
trunk/xpressme_integration_kit/include/add_xpress_config.php
r491 r551 3 3 require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 4 4 $xoops_config = new ConfigFromXoops; 5 $xoops_config->xpress_set_memory_limmit();6 5 require_once dirname( __FILE__ ).'/set_cash_cookie_path.php' ; 7 6 ?> -
trunk/xpressme_integration_kit/include/add_xpress_process.php
r549 r551 107 107 108 108 require_once( dirname( __FILE__ ).'/request_url.php'); 109 require_once( dirname( __FILE__ ).'/memory_limit.php'); 109 110 if (is_xpress_index_page_call()){ 110 111 //$_SERVER['REQUEST_METHOD'] = 'POST' is … … 115 116 require_once $xoops_config->xoops_mainfile_path; //It is necessary to execute it for the user attestation before wp-settings.php. 116 117 $_SERVER['REQUEST_METHOD'] = $request_method; 117 118 xpress_set_memory_limmit(); // Set memory limmit.(Limmit Value from XPressMe modele config.) 118 119 unset($offset); //This Trap is provides the case where $offset is defined on the XOOPS side. 119 120 require_once(ABSPATH.'wp-settings.php'); … … 181 182 if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path; // for Notification_triggerEvent 182 183 if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path; // for Notification_triggerEvent 184 xpress_set_memory_limmit(); // Set memory limmit.(Limmit Value from XPressMe modele config.) 183 185 ?>
Note: See TracChangeset
for help on using the changeset viewer.