| | 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'; |
|---|
| | 283 | if ($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 | } |
|---|