Joined May 2013
·

Nir Gavish

Hertzlia, Israel
·
·

Posted to PHP caching without headaches over 1 year ago

Thanks, fixed.

Posted to Validation is (mostly) dead. over 1 year ago

Hi man!
On the contrary. I'm quite happy not having read "About Face", that way I can have the illusion of having had an original thought, and you can have the illusion of having told me off. It's a win-win. :) All my love.

Posted to Validation is (mostly) dead. over 1 year ago

Wow! Thanks :) Pun intended, getting validation for this idea feels good :)

Posted to PHP caching without headaches over 1 year ago

1) PHP manual states 0777, not 777: http://php.net/manual/en/function.mkdir.php - if you are aware of any distinction, please share.

2) $action = null; is a residual line, shouldn't be there, fixed, thanks.

3) Incorrect, using the elsif as a condition in the first 'if' will yield an error if the file doesn't exist.

4) The last action is meant for you to be able to determine if a cache was used or not from the same script, has nothing to do with PHP being stateless.

4(2)-6) What are you suggesting? Solution? I suspect you tried to manually fail the flock($fp, LOCK_EX) condition, which will not give you the same results as when the file really DID fail to flock.

7) Destroy does not traverse directories, it unlinks the file directly if no wildcard is present, and unlinks multiple files if a wildcard IS present.

8) You're correct, this is not ideal: Hardcoded for simplicity, when implemented in the framework, it will have a config value in the config file, and in any case, you can change this value at runtime as much as you want.

9) I don't tend to handle function input when it's only exposed to the developer. It would be the same as saying the developer can unlink('index.php') - Yup, they sure can.

10) You're right, shouldn't be there in a finished class, but will stay there for now.

11) It's a long debate, I'm not particularly fond of static, and Apex has instances of libraries, not static calls, but it seemed more appropriate here.

12) -"-

13) -"-

14) Yes, really. APC and memcacheD have my respect, and I intend the finished version to have a switch for file, database, apc, and memcached - but for now this is the POC. I have used filesystem caching with great success in places where the other methods were not viable.

15) First time I've ever gotten a complaint over too much documentation.

16) Thanks.

Other than that, good points :)

Achievements
103 Karma
5,842 Total ProTip Views
Interests & Skills