-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory_limit
option is not properly validate when passed via MemoryOptions::__construct
or set via MemoryOptions#setMemoryLimit
#54
Comments
Would you be able to write a small integration test using |
I will try to find some time the next days to write some tests. |
Introduced in time immaterial by b87cc74 There are no tests whatsoever for options object. For this problem ini_set/ini_get is not needed. Test that:
|
I just created a pull request, but there are some issues with my formatting. Do you have a code style XML somewhere for PHPStorm which I can use? Furthermore I added these tests:
as valid ones. In my opinion they should raise an InvalidArgumentException as well. What do you think? Which values do we want to allow? Only integers and "G", "M" and "k" as suffix, right? If so, I could adapt the regex and the tests. Also I added to return "null" when "null" is given to normalize, because it broke the already existing test |
There's a PHPCS configuration at the root of the repository: laminas-cache-storage-adapter-memory/phpcs.xml Lines 1 to 20 in d2c357a
Worth discussing on the PR directly :) |
__construct
or set via MemoryOptions#setMemoryLimit
__construct
or set via MemoryOptions#setMemoryLimit
Memory::__construct
or set via MemoryOptions#setMemoryLimit
Memory::__construct
or set via MemoryOptions#setMemoryLimit
memory_limit
option is not properly validate when passed via MemoryOptions::__construct
or set via MemoryOptions#setMemoryLimit
Hi,
I'm debugging why my given memory limit is not being applied in the adapter. Looks like there is a bug in the MemoryOptions. I think
preg_match
in this linelaminas-cache-storage-adapter-memory/src/MemoryOptions.php
Line 88 in d2c357a
should use the parameter
$value
instead ofini_get('memory_limit')
?BR,
Alex
The text was updated successfully, but these errors were encountered: