Proposed Patch/Bugfix: Improve memory_limit handling
-
The ADA plugin is currently incorrectly interpreting memory_limit and is actually setting it lower than what I have the server set to (this is something that appears to only be present in the paid version since the free/basic version doesn’t work with memory_limit at all, currently).
I have the server’s memory_limit set to 2G, but it’s currently seeing that as being less than 256 due to it not converting the memory_limit to bytes first (it then sets the memory_limit to 256MB which gives it more limited resources than the 2GB I want to give it).
– I’ve come up with a suggested patch to fix this. –
You can see the updated startup.php and res/installation.php files here: https://gist.github.com/KZeni/1aa295bd6298a5a89e4d36613479bfd4 (see revision history enabled between the current version & the new ones: https://gist.github.com/KZeni/1aa295bd6298a5a89e4d36613479bfd4/revisions [note: I have trailing whitespace automatically removed by my editor so it’s showing more edits than what I really made.])Essentially, I added the new
return_bytes()function to the very top of the startup.php file so it can be used throughout the plugin as needed (it’s called by both startup.php and installation.php). I then swapped out the memory_limit code in startup.php for https://gist.github.com/KZeni/1aa295bd6298a5a89e4d36613479bfd4#file-startup-php-L285 (notice how bytes are also used for setting the memory_limit to prevent the notice in installation.php from being triggered [they’re on the same page]) and then swapped out the memory_limit code in installation.php for https://gist.github.com/KZeni/1aa295bd6298a5a89e4d36613479bfd4#file-installation-php-L454 (notice the minor text change to the message as well as the if condition).I would love to see this officially implemented in the next update to the plugin.
Btw, I submitted this via the contact us form at https://www.alumnionlineservices.com/contact-us/, but I didn’t get a confirmation email so I submitted this here as well just in case it didn’t go through.
The topic ‘Proposed Patch/Bugfix: Improve memory_limit handling’ is closed to new replies.