Why are yo closing a dir three times (line 140 - 143)? The first invalidates the resource, it seems (gets an integer, random? value). The last two will fail, and it seems that muting them with
@ has no effect.
The strict issues:
You are accessing
self::cms()->dao. This means you are getting the object instance, since
cms() returns it, and then setting a static property. The
->dao means that you are setting a static property as if it was a normal property of an instance. A static property belongs to the class itself, and is not a genuine object property, as a property that can be different from instance to instance. The
-> constructor is for accessing properties existing in the instance (created object of the class). That's why you get strict warnings. It's a kind of "doing it wrong". It will work, I guess, but I find the strict warnings useful and educating in the PHP OOP field. Just as getting things to work is important, our understanding, as developers, of why things work, and why things might not work, is equally important. It makes us more able to maintain the code, and the code more "future proof". So, to me, strict warnings, as I get very often, tells me I am not quite understanding what I'm doing here.
A you know very well, you access static properties by
classname::property and never through