Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

Removing unnecessary strict checks

posted by rizqidjamaluddin 7 years ago

One issue I've come across quite a bit in Flourish is that a lot of fact-checking goes on behind the scenes. For example, fCache (which, by definition of a cache, should be fast) does a lot of is_writable and is_dir checks whenever it loads a directory cache, which is typically once per script execution. I've found that this adds up to quite a few unnecessary calls.

In practice, there should be no need for Flourish to check this constantly.

On one of my projects that bases itself on Flourish, I instead implement a "strict" setting that enables all of these checks, so a developer (or cron job) can check these when necessary, while leaving it out of normal execution.

This problem is most prominent with the filesystem features, which are constantly doing checks - some justified, some unnecessary. It's also seen, for example, in setting a session storage path, which also checks the directory on every execution. And it's even more problematic on platforms with slower filesystem access, like the PagodaBox PaaS.