Hi folks.  I just upgraded to 1.2 and found the same problem.  I've
discovered that it is, in fact, a bug of some kind, probably related
to a method in one of Cake's core configuration files.

What I did was trace this Cache::config() entry (found at the end of
[your_app]/config/core.php) and saw that it's default parameter was
'File', which I found out pointed to the file located at cake/libs/
cache/file.php.

I opened this up and scrolled to line 86 and ADDED the marked lines
below to test the issue of fwd- or back-slashes between directories:

function init($settings = array()) {
                parent::init($settings);
                $defaults = array('path' => CACHE, 'prefix'=> 'cake_', 'lock'=>
false, 'serialize'=> true);
                $this->settings = array_merge($defaults, $this->settings,
$settings);
                if(!isset($this->__File)) {
                        $this->__File =& new File($this->settings['path'] . DS 
. 'cake');
                }
ADD--->    echo '<br> before cd: '.$this->settings['path'];
ADD--->    $this->settings['path'] = str_replace('/','\\',$this-
>settings['path']);
                $this->settings['path'] = $this->__File->Folder->cd($this-
>settings['path']);
ADD--->    echo '<br> after cd: '.$this->settings['path'];
                if(empty($this->settings['path'])) {
                        return false;
                }

                return $this->__active();
        }

Now, refresh the page on which you received the cache error.  It is
gone now.  This is because $this->__File->Folder->cd() does not honor
the proper slashing for finding directories and files.  Without the
str_replace() function I added in the second line, the cd() method
destroys the path information for Windows, causing this init() method
to return false and throwing the caching error.

I'll go report this to the powers that be.

Adam Friedman


On Mar 20, 1:25 am, markfm <[EMAIL PROTECTED]> wrote:
> index.php inside webroot
> define('ROOT', DS.'web'.DS.'xampp'.DS.'koekAPPS'.DS.'koekApp1');
> define('APP_DIR',dirname('koekApp1'));
> define('CAKE_CORE_INCLUDE_PATH', DS.'web'.DS.'xampp'.DS.'koek');
>
> Try this instead:
> define('ROOT', 'C:' . DS . 'web' . DS . 'xampp' . DS .
> 'koekAPPS');                     // Start the path with 'C:' and take
> off the name of the app defined in the next line
> define('APP_DIR',dirname('koekApp1'));
> define('CAKE_CORE_INCLUDE_PATH', 'C:' . DS . 'web' . DS . 'xampp' .
> DS . 'koek');   // Again, start with 'C:'
>
> --Mark
>
> On Jan 29, 1:08 am, benstof <[EMAIL PROTECTED]> wrote:
>
> > I'm getting the following error for cache in 1.2.
>
> > Warning (512): Cache not configured properly.
> > Please check Cache::config(); in APP/config/core.php
> > [C:\web\xampp\koek\cake\libs\configure.php, line 630]
>
> > My setup is as follows.
>
> > /koekApps/
> >     /koekApp1/
> >             /config
> >             /controllers
> >             /models
> >             /plugins
> >             /tmp
> >             /vendors
> >             /views
> >             .htaccess
> >              index.php
> > /koek/
> >          /cake
> >          /vendors
> >         .htaccess
> >           index.php
>
> >     /htdocs/   (webroot)
> >          /koekApp1
>
> > index.php inside webroot
> > define('ROOT', DS.'web'.DS.'xampp'.DS.'koekAPPS'.DS.'koekApp1');
> > define('APP_DIR',dirname('koekApp1'));
> > define('CAKE_CORE_INCLUDE_PATH', DS.'web'.DS.'xampp'.DS.'koek');
>
> > This setup has worked for me before, numerous times. Its only now in
> > 1.2 that the cache throws that error.
>
> > When I do pr(Cache::config) from C:\web\xampp\koekApps\koekApp1\views
> > \pages\home.ctp
> > I get and empty string.
> > When I do pr(Cache::settings) from C:\web\xampp\koekApps\koekApp1\views
> > \pages\home.ctp
> > I get an empty array.
>
> > So it seems to me, the config method in core.php never gets called for
> > Cache.
> > If anyone know the solution to this, please let me know.
>
> > Let me know if you need more info from my side.
>
> > Ben

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to