zikula/FileSystem — pull request #1 by atarnowsky (2013-06-20 19:44:49+00:00)
Title: Make getContents() return false when given a file name that does not exist

getContents' docblock indicates that it returns false upon failure. I've found that if you specify a file that does not exist, the call to $this->fget returns false (as one would expect from it's docblock). However, this causes stream_get_contents to throw an exception saying it's not expecting a boolean value as a parameter. To remedy this and properly return 'false' upon failure, I just ensure the call to 'fget' returns true before proceeding with the stream_get_contents call. If not true, I return false.