Cache BUG
| From: | yavor shahpasov | Date: | Tue, 10 Jul 2001 14:03:21 +0000 |
| Subject: | Cache BUG | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-615@lists.php.net to get a copy of this message | ||
around line 89 in Cache/Container/file.php
if (!file_exists($this->cache_dir) || !is_dir($this->cache_dir))
mkdir($this->cache_dir, 0755);
the above condition returns true if cache_dir is null thus raising an
error when you try to create a directory, maybe the check should be
(!file_exists($this->cache_dir) || !is_dir($this->cache_dir)) &&
($this->cache_dir)
or maybe there should be a check somewhere to set cache_dir to default
if it's null.
This error was produced when calling
$cache = new Cache("file", array("group"=>"default"));
Another minor problem is when creating a cache instance as so
$cache = new Cache("file", array("group"=>"default",
"cache_dir"=>"cache"));
I ended up having a directory called cachedefault instead of
cache/default, maybe some checking
should be used on the last char of cache_dir, see if it's a '/' if not
append a '/' to it.
yavo
The difference between a good man and a bad one is the choice of cause -
William James