Changeset 5869

Show
Ignore:
Timestamp:
07/01/08 21:41:59 (2 months ago)
Author:
p_lindheimer
Message:

try and set memory_limit when config is too small

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/bin/retrieve_conf

    r5836 r5869  
    206206        $db_engine = $amp_conf["AMPDBENGINE"]; 
    207207} 
    208  
    209 // Define the notification class for logging to the dashboard 
    210 // 
    211 $nt = notifications::create($db); 
    212208 
    213209// **** Create symlinks array 
     
    275271out(_("OK")); 
    276272 
     273// Define the notification class for logging to the dashboard 
     274// 
     275$nt = notifications::create($db); 
     276 
     277/* 
     278*/ 
     279// Check and increase php memory_limit if needed and if allowed on the system 
     280// 
     281$current_memory_limit = rtrim(ini_get('memory_limit'),'M'); 
     282$proper_memory_limit = '100'; 
     283if ($current_memory_limit < $proper_memory_limit) { 
     284        if (ini_set('memory_limit',$proper_memory_limit.'M') !== false) { 
     285                $nt->add_notice('core', 'MEMLIMIT', _("Memory Limit Changed"), sprintf(_("Your memory_limit, %sM, is set too low and has been increased to %sM. You may want to change this in you php.ini config file"),$current_memory_limit,$proper_memory_limit)); 
     286        } else { 
     287                $nt->add_warning('core', 'MEMERR', _("Low Memory Limit"), sprintf(_("Your memory_limit, %sM, is set too low and may cause problems. FreePBX is not able to change this on your system. You should increase this to %sM in you php.ini config file"),$current_memory_limit,$proper_memory_limit)); 
     288        } 
     289} else { 
     290        $nt->delete('core', 'MEMLIMIT'); 
     291} 
    277292 
    278293//TODO : make this engine-neutral 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads