Re: Cache BUG
| From: | Christian Stocker | Date: | Tue, 10 Jul 2001 14:40:38 +0000 |
| Subject: | Re: Cache BUG | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-616@lists.php.net to get a copy of this message | ||
Hi
fixed the bugs ;)
chrgu
On Tue, 10 Jul 2001, yavor shahpasov wrote:
> 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
>
>
>
--
nam...christian stocker adr...bremgartnerstr. 66, ch-8003 zurich
pho...+41 1 451 6021 www...http://phant.ch/chregu
mob...+41 76 561 8860 ema...chregu@phant.ch