Don't report error at admin/reports/status when PHP memory limit set to -1 (Unlimited)

TR - April 30, 2009 - 20:46
Project:ImageAPI
Version:6.x-1.x-dev
Component:ImageAPI GD
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

When the server PHP memory limit is set to -1 (i.e. Unlimited), ImageAPI GD reports an error at admin/reports/status saying the memory limit should be increased. (system.module used to do this as well, but has since been changed in Drupal 6 to correctly recognize a memory limit of -1.) The attached patch modifies imageapi_gd_requirements() to recognize -1 as being sufficient memory. The new code is a modified version of the code that already exists in system.install to make this same test.

AttachmentSize
imageapi_gd.install.patch1.46 KB

#1

drewish - May 1, 2009 - 15:16
Status:needs review» needs work

Ah I wasn't aware that -1 was a valid memory limit. Just double checked the PHP docs to be sure. The only thing I'd change it to preserve the current behavior of only listing the requirement when there's a problem. That page is noisy enough as it is so I'd rather avoid adding more items to it.

#2

TR - May 2, 2009 - 03:33
Status:needs work» needs review

Here you go. As a bonus, I also created a patch to address this same issue in 7.x-1.x-dev. I have tested both, of course.

AttachmentSize
d6_imageapi_gd.install.patch 568 bytes
d7_imageapi_gd.install.patch 570 bytes

#3

drewish - May 2, 2009 - 09:48

Looks really good. If you had one second to just add a comment that -1 means unlimited memory then those are totally RTBC.

#4

TR - May 2, 2009 - 19:25

Added comment, re-rolled patches:

AttachmentSize
d6_imageapi_gd.install.patch 726 bytes
d7_imageapi_gd.install.patch 726 bytes

#5

drewish - May 2, 2009 - 19:45
Status:needs review» fixed

great, thanks a bunch. committed to HEAD and DRUPAL-6--1

#6

System Message - May 16, 2009 - 19:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.