Re: 404 requests filling view cache

2015-10-28 Thread lowpass
@euromark This affects caching? The issue is that the bad requests are
nonetheless being saved to the cache views dir.

@ojtibi Sorry, should have included that.

core.php:

Configure::write('Cache.disable', false);
Configure::write('Cache.check', true);

$engine = 'File';
if (extension_loaded('apc') && function_exists('apc_dec') &&
(php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) {
$engine = 'Apc';
}

$duration = '+999 days';
if (Configure::read('debug') >= 1) {
$duration = '+10 seconds';
}

Cache::config('_cake_core_', array(
'engine' => $engine,
'prefix' => 'cake_core_',
'path' => CACHE . 'persistent' . DS,
    'serialize' => ($engine === 'File'),
'duration' => $duration
));

Cache::config('_cake_model_', array(
'engine' => $engine,
'prefix' => 'cake_model_',
    'path' => CACHE . 'models' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
));


bootstrap.php:
Cache::config('default', array('engine' => 'File'));

Just a simple site, nothing special, as you can see.

I'm wondering if it's less to do with cache config but in error handling.
Something to tell Cake, "btw, don't cache this". But I'm not seeing
anything like that.

On Wed, Oct 28, 2015 at 7:36 AM, euromark  wrote:

> Yes, in 2.4+ there is a skipLog param:
>
> http://book.cakephp.org/2.0/en/appendices/2-4-migration-guide.html#errorhandler
>
> But I just log them to a different log file via custom handler:
> See
> https://github.com/dereuromark/cakephp-tools/wiki/Included-fixes-and-migration-tweaks#bugfixes--useful-adjustments
> and
> https://github.com/dereuromark/cakephp-tools/blob/master/src/Error/ErrorHandler.php
> .
>
> Mark
>
>
>
> Am Mittwoch, 28. Oktober 2015 01:34:43 UTC+1 schrieb cricket:
>>
>> Cake 2.2.4 (Yeah, i know -- need to upgrade this site!)
>>
>> I just noticed that the view cache dir has a bunch of files along the
>> lines of:
>>
>>
>> s_2fabc_2fabc_2fabc_2f_24_7b_40print_28md5_28base64_decode_28mzywd2vic2nhbg_29_29_29_7d_2f.php
>>
>> Looks like the work of script kiddies. However, I'm also seeing things
>> like this:
>>
>> articles_deep_denial_or_disinformation.php
>> articles_dee.php
>>
>> The first is the correct name/path and the second one is incomplete.
>> There are several examples of this. I dunno if it's a Cake issue or not but
>> the latter really shouldn't be cached as it's a 404.
>>
>> Is there some way to tell Cake *not* to cache these?
>>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 404 requests filling view cache

2015-10-28 Thread euromark
Yes, in 2.4+ there is a skipLog param:
http://book.cakephp.org/2.0/en/appendices/2-4-migration-guide.html#errorhandler

But I just log them to a different log file via custom handler:
See 
https://github.com/dereuromark/cakephp-tools/wiki/Included-fixes-and-migration-tweaks#bugfixes--useful-adjustments
and 
https://github.com/dereuromark/cakephp-tools/blob/master/src/Error/ErrorHandler.php
 
.

Mark



Am Mittwoch, 28. Oktober 2015 01:34:43 UTC+1 schrieb cricket:
>
> Cake 2.2.4 (Yeah, i know -- need to upgrade this site!)
>
> I just noticed that the view cache dir has a bunch of files along the 
> lines of:
>
>
> s_2fabc_2fabc_2fabc_2f_24_7b_40print_28md5_28base64_decode_28mzywd2vic2nhbg_29_29_29_7d_2f.php
>
> Looks like the work of script kiddies. However, I'm also seeing things 
> like this:
>
> articles_deep_denial_or_disinformation.php
> articles_dee.php
>
> The first is the correct name/path and the second one is incomplete. There 
> are several examples of this. I dunno if it's a Cake issue or not but the 
> latter really shouldn't be cached as it's a 404.
>
> Is there some way to tell Cake *not* to cache these?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 404 requests filling view cache

2015-10-27 Thread OJ Tibi - @ojtibi
How does your cache configuration look like?

On Wednesday, October 28, 2015 at 8:34:43 AM UTC+8, cricket wrote:
>
> Cake 2.2.4 (Yeah, i know -- need to upgrade this site!)
>
> I just noticed that the view cache dir has a bunch of files along the 
> lines of:
>
>
> s_2fabc_2fabc_2fabc_2f_24_7b_40print_28md5_28base64_decode_28mzywd2vic2nhbg_29_29_29_7d_2f.php
>
> Looks like the work of script kiddies. However, I'm also seeing things 
> like this:
>
> articles_deep_denial_or_disinformation.php
> articles_dee.php
>
> The first is the correct name/path and the second one is incomplete. There 
> are several examples of this. I dunno if it's a Cake issue or not but the 
> latter really shouldn't be cached as it's a 404.
>
> Is there some way to tell Cake *not* to cache these?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


404 requests filling view cache

2015-10-27 Thread lowpass
Cake 2.2.4 (Yeah, i know -- need to upgrade this site!)

I just noticed that the view cache dir has a bunch of files along the lines
of:

s_2fabc_2fabc_2fabc_2f_24_7b_40print_28md5_28base64_decode_28mzywd2vic2nhbg_29_29_29_7d_2f.php

Looks like the work of script kiddies. However, I'm also seeing things like
this:

articles_deep_denial_or_disinformation.php
articles_dee.php

The first is the correct name/path and the second one is incomplete. There
are several examples of this. I dunno if it's a Cake issue or not but the
latter really shouldn't be cached as it's a 404.

Is there some way to tell Cake *not* to cache these?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


View Cells cache

2015-03-06 Thread lorenzoshake
hi, i'm develop with cake 3 and i'm using view cells feature cache.
The cache is created but the method called is always called.

Example:
$cell = $this->cell('Posts::getLatest', [], ['cache' => true]);
echo $cell;

the cache is created but i put an echo in getLatest method, the echo will 
print:

public fuction getLatest()
{
echo ":)";
   .
}

is this normal? Can I bypass the calling and get only generated cache?

Thanks!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Warning (512): cake_model cache was unable to write

2014-09-29 Thread majna
"unable write 'default_aptutori_a....' to Apc cache"

I guess your app/Config/core.php needs to be updated for 2.5.
APC as a default cache engine was removed two years ago, in 2.3
https://github.com/cakephp/cakephp/commit/2f7f5e13224537eaa4da6b825b1d106bebc35d05

On Tuesday, September 30, 2014 6:26:39 AM UTC+2, Jeremy Burns wrote:
>
> I had a similar issue when running MAMP locally. I fixed it by turning off 
> MAMP’s internal caching. Not sure if that’s the same issue you’re facing. 
>
> On 30 Sep 2014, at 01:12, Andras Kende > 
> wrote: 
>
> > Try deleting the files within app/tmp folders. 
> > 
> > and adding  'mask' => 0777 to 
> > core.php 
> > Cache::config('_cake_core_', array(... 
> > Cache::config('_cake_model_', array(... 
> > https://github.com/cakephp/cakephp/blob/master/app/Config/core.php#L294 
> > 
> > Andras Kende 
> > 
> > 
> > On Sep 29, 2014, at 4:02 PM, ajt > 
> wrote: 
> > 
> >> 2.5 but I checked many posts on the issue and I dont think that makes 
> any difference. 
> >> The only solution was to chmod the app/tmp folders and subfolders but i 
> did that. 
> >> 
> >> I am using cpanel and have no command prompt to run scripts 
> >> 
> >> -- 
> >> Like Us on FaceBook https://www.facebook.com/CakePHP 
> >> Find us on Twitter http://twitter.com/CakePHP 
> >> 
> >> --- 
> >> You received this message because you are subscribed to the Google 
> Groups "CakePHP" group. 
> >> To unsubscribe from this group and stop receiving emails from it, send 
> an email to cake-php+u...@googlegroups.com . 
> >> To post to this group, send email to cake...@googlegroups.com 
> . 
> >> Visit this group at http://groups.google.com/group/cake-php. 
> >> For more options, visit https://groups.google.com/d/optout. 
> > 
> > -- 
> > Like Us on FaceBook https://www.facebook.com/CakePHP 
> > Find us on Twitter http://twitter.com/CakePHP 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "CakePHP" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to cake-php+u...@googlegroups.com . 
> > To post to this group, send email to cake...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/cake-php. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Warning (512): cake_model cache was unable to write

2014-09-29 Thread Jeremy Burns
I had a similar issue when running MAMP locally. I fixed it by turning off 
MAMP's internal caching. Not sure if that's the same issue you're facing.

On 30 Sep 2014, at 01:12, Andras Kende  wrote:

> Try deleting the files within app/tmp folders.
> 
> and adding  'mask' => 0777 to
> core.php
> Cache::config('_cake_core_', array(...
> Cache::config('_cake_model_', array(...
> https://github.com/cakephp/cakephp/blob/master/app/Config/core.php#L294
> 
> Andras Kende
> 
> 
> On Sep 29, 2014, at 4:02 PM, ajt  wrote:
> 
>> 2.5 but I checked many posts on the issue and I dont think that makes any 
>> difference.
>> The only solution was to chmod the app/tmp folders and subfolders but i did 
>> that.
>> 
>> I am using cpanel and have no command prompt to run scripts
>> 
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>> 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Warning (512): cake_model cache was unable to write

2014-09-29 Thread Andras Kende
Try deleting the files within app/tmp folders.

and adding  'mask' => 0777 to
core.php
Cache::config('_cake_core_', array(...
Cache::config('_cake_model_', array(...
https://github.com/cakephp/cakephp/blob/master/app/Config/core.php#L294

Andras Kende


On Sep 29, 2014, at 4:02 PM, ajt  wrote:

> 2.5 but I checked many posts on the issue and I dont think that makes any 
> difference.
> The only solution was to chmod the app/tmp folders and subfolders but i did 
> that.
> 
> I am using cpanel and have no command prompt to run scripts
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Warning (512): cake_model cache was unable to write

2014-09-29 Thread ajt
2.5 but I checked many posts on the issue and I dont think that makes any 
difference.
The only solution was to chmod the app/tmp folders and subfolders but i did 
that.

I am using cpanel and have no command prompt to run scripts

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cakephp Cache expiration doesn't work?

2014-06-14 Thread Anja Liebermann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Shabnam,


I never configured Apc ( had admins for that) but maybe the limit is in
the apc configuration.

Calamity Jane



Am 13.06.2014 09:45, schrieb shabnam koosha:
> 
> 
> Hi,
> 
> I'm pretty new to Cakephp. I'm trying to use Apc engine and I'd like my 
> cached stuff gets expired in 3 days. However, it seems like the expiration 
> time is just a few hours, as when the user logs in, s/he will be logged out 
> in a few hours.
> 
> Here is all the changes I have made in my bootstrap.php and core.php:
> 
> in bootstrap:
> 
> I just commented out "//Cache::config('default', array('engine' => 
> 'File')); " and added:
> 
> Cache::config('default', array(
> 'engine' => 'Apc', //[required]
> 'duration' => 4320, //[optional]
> 'probability' => 100, //[optional]
> 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional]  prefix every 
> cache file with this string)); 
> 
> and in Core.php:
> 
> I added timeout parameter:
> 
> Configure::write('Session', array(
> 'defaults' => 'php',
> 'timeout' => 4320   
> ));
> 
> I checked most of the relevant questions and none of the solutions worked 
> for me:
> 
> Changing 'timeout' to 'session.timeout', changing 4320 to '4320' and ,...
> 
> Thanks for you help in advance. :)
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlOcnKMACgkQbOdiIJzHNKFH7wCgvUTheiIVnZFm1PCoirjL1BBu
lx0AnReMAbPGh1vi/aoGumAPCLkb4kah
=tJEb
-END PGP SIGNATURE-

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Cakephp Cache expiration doesn't work?

2014-06-13 Thread shabnam koosha


Hi,

I'm pretty new to Cakephp. I'm trying to use Apc engine and I'd like my 
cached stuff gets expired in 3 days. However, it seems like the expiration 
time is just a few hours, as when the user logs in, s/he will be logged out 
in a few hours.

Here is all the changes I have made in my bootstrap.php and core.php:

in bootstrap:

I just commented out "//Cache::config('default', array('engine' => 
'File')); " and added:

Cache::config('default', array(
'engine' => 'Apc', //[required]
'duration' => 4320, //[optional]
'probability' => 100, //[optional]
'prefix' => Inflector::slug(APP_DIR) . '_', //[optional]  prefix every 
cache file with this string)); 

and in Core.php:

I added timeout parameter:

Configure::write('Session', array(
'defaults' => 'php',
'timeout' => 4320   
));

I checked most of the relevant questions and none of the solutions worked 
for me:

Changing 'timeout' to 'session.timeout', changing 4320 to '4320' and ,...

Thanks for you help in advance. :)

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Cache Memcache engine help

2014-04-08 Thread Advantage+
I have / think Memcache engine is set up correct. (v 2.4.6)

 

Core.php:

$engine = 'Memcache';

Cache::config('inmemory', array(

'engine' => 'Memcache',

'duration' => 3600,

'serialize' => true,

'servers' => array(

'127.0.0.1:11211'), 

'persistent' => true,

'compress' => false));

 

And a File cache:

Cache::config('default', array(  

    'engine' => 'File', 

'prefix' => '', 

'duration'=> '+1 week',  

'path' => CACHE . 'default' . DS,));

 

If I check the server the memcache shows the data being cached, the record_
c6a82b1532947c1c8111327581487e74 exists. But in the Model Callback I want to
delete the cached record on save / delete.

Check the database and records are getting saved / updated / deleted but the
cache "inmemory" never gets deleted. Only if I use "default" does it
actually cache the record and delete in the call backs.

 

Aftersave / afterdelete::

$cache_id = md5($this->id);

Cache::delete('record_'.$cache_id, 'inmemory');

 

But it does not delete.

 

If I change it to 

Cache::delete('record_'.$cache_id, 'default');

It will delete the record.

 

 

Any ideas?

 

Thanks,

Dave

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Problem associated with app/tmp/cache/persistent

2014-03-10 Thread AD7six


On Tuesday, 4 March 2014 18:56:03 UTC+1, Francisco Chacon wrote:
>
> Hi:
>
> We have developed several websites using Cake and have found that when the 
> values in the persistent cache reaches a file size of close to 30,000, the 
> services
> for uploading images and sending emails stop working.
> The sites have been checked by two persons, but not deeply familiar with 
> Cake.
> Any suggestions will be appreciated.
>

Doesn't sound like it has anything to do with Cake per-se. 

Depending on the drive format 30K is the maximum number of files you can 
store in a folder (what are you storing?). After this point you won't be 
able to put new files in the folder.

The normal solution is to use subfolders:

asdfasdfasdfasdfasdf
->
as/df/asdfasdfasdfasdf

AD

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Problem associated with app/tmp/cache/persistent

2014-03-05 Thread Francisco Chacon
Hi:

We have developed several websites using Cake and have found that when the 
values in the persistent cache reaches a file size of close to 30,000, the 
services
for uploading images and sending emails stop working.
The sites have been checked by two persons, but not deeply familiar with 
Cake.
Any suggestions will be appreciated.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Adding a new counter cache

2014-01-23 Thread euromark
If you want a simple CakePHP only solution:
http://www.dereuromark.de/2013/10/29/resetbehavior-and-hazardablebehavior/

you simply create a shell command "counts" or sth
and add those 2 lines to re-save all records in a loop

$this->Post->Behaviors->load('Tools.Reset', array('fields' => 
array(...)));
$this->Post->resetRecords();

the countercache should update itself - done :)



Am Montag, 15. März 2010 19:16:56 UTC+1 schrieb Brenda:
>
> I'm upgrading an existing model to include counters for some of the
> hasMany relationships. They all start out as zero, even though there
> are many hasMany records; each record gets updated once a save/delete
> occurs.
>
> Is there any way to tell Cake to go through and update all the
> counters, so I can get correct initial values? Or should I just write
> a SQL query to do it?
>
> thanks...
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Adding a new counter cache

2014-01-23 Thread Paul Gardner
No .. It will only run through the table once updating all records.
On 23 Jan 2014 12:34, "Aurelian Apostol"  wrote:

> Wouldn't this run an infinte loop? It needs a further WHERE clause maybe
> where model_a.model_b_count IS NOT NULL
>
> marți, 16 martie 2010, 10:28:28 UTC+2, phpMagpie a scris:
>>
>> I would also run a SQl query direct on the database using phpMyAdmin
>> or the CLI
>>
>> UPDATE model_a SET model_a.model_b_count = (SELECT COUNT(model_b.id)
>> FROM model_b WHERE model_b.model_a_id = model_a.id)
>>
>> HTH
>>
>> Paul
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/J6qKv8EBLMY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Adding a new counter cache

2014-01-23 Thread Aurelian Apostol
Wouldn't this run an infinte loop? It needs a further WHERE clause maybe 
where model_a.model_b_count IS NOT NULL

marți, 16 martie 2010, 10:28:28 UTC+2, phpMagpie a scris:
>
> I would also run a SQl query direct on the database using phpMyAdmin
> or the CLI
>
> UPDATE model_a SET model_a.model_b_count = (SELECT COUNT(model_b.id)
> FROM model_b WHERE model_b.model_a_id = model_a.id)
>
> HTH
>
> Paul
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Weird problem with Form Helper and cache

2013-12-06 Thread HK
I use cake some years now from v1.2

I will write down a problem I had just to share it with you and find out 
whether it's a bug or not.

In my app controller in beforeFilter I have:

> if (($newarticles = Cache::read('newarticles', 'short')) == null)
>
> {
>
>   $this->loadModel('Article');
>
>   $this->Article->recursive = -1;
>
>
>>   $newarticles = $this->Article->find('all', array(...some 
>> conditions...);
>
>   Cache::write('newarticles', $newarticles, 'short');
>
>     }
>
>

that is to show to a widget in my default layout some new articles. I don't 
want to query the DB all the time so I cache them. 
In another form (users/edit) I load the user model which hasOne UserDetail. 
UserDetail has a field newarticles.

When I use  

>  echo $this->Form->input('UserDetail.newarticles', array(
>   'type'  => 'checkbox',
>   'label' => 'new articles?',
>   'div'   => array('class' => 'checkbox'))) . "\n";


a select box appears with data from $newarticles in AppController. Isn't 
that a weird behaviour?

thanks a lot

PS: in AppController I renamed $newarticles to $newarticles1 and everything 
is fine.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CakePHP themed + cache + gzip enabled + Avast AV + Chrome == Problem

2013-11-04 Thread Salines
Hi, José Lorenzo

thanks for your reply.

I removed my code from bootstrap.php and .htaccess file
and put in the app controller following:

---
public function beforeRender(){
$this->response->compress();
 }
---

Website is now working correctly, and the server delivers gzipped html. How 
to enable the same for css and js?

Thank you again,
Best Regards

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CakePHP themed + cache + gzip enabled + Avast AV + Chrome == Problem

2013-11-04 Thread José Lorenzo
This is not how you should setup the request compression in CakePHP, please 
read about CakeRequest::compress(). Even though there is a way to do in php 
I strongly recommend no to, gzip compression should be done in the webserver

On Monday, November 4, 2013 10:58:19 AM UTC+1, Salines wrote:
>
> Hi people,
>
> I have a problem, wich I can not solve.
>
> on page www.detas.ba I have enabled cache and gzip. Views, css, js, are 
> in the themed folder. (App/View/Themed/Detas/...)
>
> On my computer I use Chrome browser and Avast antivirus program.
>
> When I access a page on eg http://detas.ba/sat/792-Casio_LTP_1230D_1CDFand 
> click quickly to any link (button) on the side, my browser sometimes 
> Download .gz file, instead of displaying the page.
>
> If I leave out any part of the heading combinations (CakePHP themed + 
> cache + gzip enabled +  Avast AV + Chrome), this problem does not occur.
>
> For example, if:
>
> CakePHP themed + cache + gzip enabled + Avast AV +* Firefox* *!=* Problem
> CakePHP themed + cache + gzip enabled + *disabled Avast AV* + Chrome 
> *!=*Problem
> CakePHP themed + cache + *gzip disabled* + Avast AV + Chrome *!=* Problem
> *C**akePHP without themed layou*t + cache + gzip enabled + Avast AV + 
> Chrome *!=* Problem
>
> In bootstrap.php I have the following:
>
> CakePlugin::loadAll();
> Cache::config('default', array('engine' => 'File'));
>  if (Configure::read('debug') < 2) {
> @ob_start ('ob_gzhandler');
> header('Content-Type: text/html; charset: UTF-8');
> header('Cache-Control: must-revalidate');
> header("Expires: " . gmdate('D, d M Y H:i:s', time() - 1) . ' GMT');
> }
>
> in .htaccess
>
> 
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
> 
>
> #Gzip/deflate
> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css 
> application/x-javascript text/javascript application/javascript
> BrowserMatch ^Mozilla/4 gzip-only-text/html
> BrowserMatch ^Mozilla/4\.0[678] no-gzip
> BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
> Header append Vary User-Agent
>
> # BEGIN EXPIRES
> 
> ExpiresActive On
> ExpiresDefault "access plus 10 days"
> ExpiresByType text/css "access plus 1 week"
> ExpiresByType text/plain "access plus 1 month"
> ExpiresByType image/gif "access plus 1 month"
> ExpiresByType image/png "access plus 1 month"
> ExpiresByType image/jpeg "access plus 1 month"
> ExpiresByType application/x-javascript "access plus 1 month"
> ExpiresByType application/javascript "access plus 1 week"
> ExpiresByType application/x-icon "access plus 1 year"
> 
> # END EXPIRES
>
> Does anyone have similar problems, similar experience and solution?
>
> Thank you,
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CakePHP themed + cache + gzip enabled + Avast AV + Chrome == Problem

2013-11-04 Thread Salines
I forgot to write that I use the latest version of CakePHP Framework 2.4.2

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


CakePHP themed + cache + gzip enabled + Avast AV + Chrome == Problem

2013-11-04 Thread Salines
Hi people,

I have a problem, wich I can not solve.

on page www.detas.ba I have enabled cache and gzip. Views, css, js, are in 
the themed folder. (App/View/Themed/Detas/...)

On my computer I use Chrome browser and Avast antivirus program.

When I access a page on eg http://detas.ba/sat/792-Casio_LTP_1230D_1CDF and 
click quickly to any link (button) on the side, my browser sometimes 
Download .gz file, instead of displaying the page.

If I leave out any part of the heading combinations (CakePHP themed + cache 
+ gzip enabled +  Avast AV + Chrome), this problem does not occur.

For example, if:

CakePHP themed + cache + gzip enabled + Avast AV +* Firefox* *!=* Problem
CakePHP themed + cache + gzip enabled + *disabled Avast AV* + Chrome *!=*Problem
CakePHP themed + cache + *gzip disabled* + Avast AV + Chrome *!=* Problem
*C**akePHP without themed layou*t + cache + gzip enabled + Avast AV + 
Chrome *!=* Problem

In bootstrap.php I have the following:

CakePlugin::loadAll();
Cache::config('default', array('engine' => 'File'));
 if (Configure::read('debug') < 2) {
@ob_start ('ob_gzhandler');
header('Content-Type: text/html; charset: UTF-8');
header('Cache-Control: must-revalidate');
header("Expires: " . gmdate('D, d M Y H:i:s', time() - 1) . ' GMT');
}

in .htaccess


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]


#Gzip/deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css 
application/x-javascript text/javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

# BEGIN EXPIRES

ExpiresActive On
ExpiresDefault "access plus 10 days"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/plain "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-icon "access plus 1 year"

# END EXPIRES

Does anyone have similar problems, similar experience and solution?

Thank you,

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: how to get cache file name in arabic language

2013-09-27 Thread Eric Haskins
That is going to be tied to the OS the files are on. Most Linux webservers 
won't support that charset. You will need to come up with another way

Eric

On Thursday, September 26, 2013 7:50:57 AM UTC-4, Mokdij wrote:
>
> I am developing a website in Arabic language, i need to use a slug in 
> Arabic characters but my problem is that the cache file name show 
> characters like Ù«, ØÃ, ì, ù, à in place of normal characters.
>
> example :
> post_من-نحن ==> the slug is: من-نحن
>
> post_٬مŠ-ومدØ٠ع-كمروي-ÙÙŠ-تØرÙات-ااØ
>
> so how to do to get a cache file name in arabic language ?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: how to get cache file name in arabic language

2013-09-27 Thread Anja Liebermann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Mokdij,

interesting problem. Is just the file name messed up or is it also the
cache content?
If it is "just" the file name then the challenge is to find something
which is connectetd to the real string but writeable in Ascii. How about
your own filenaming methos which replaces the arabic letters with the
Hexcode? Then it would even be reversable.

Anja


Am 26.09.2013 13:50, schrieb Mokdij:
> I am developing a website in Arabic language, i need to use a slug in 
> Arabic characters but my problem is that the cache file name show 
> characters like Ù«, ØÃ, ì, ù, à in place of normal characters.
> 
> example :
> post_من-نحن ==> the slug is: من-نحن
> 
> post_٬مŠ-ومدØ٠ع-كمروي-ÙÙŠ-تØرÙات-ااØ
> 
> so how to do to get a cache file name in arabic language ?
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlJF3MAACgkQbOdiIJzHNKGqowCcDDSR+cACG3bbssIqZMGmHwFn
ndYAniOjn11+Q//0+sni9+X5Ythivxhz
=0mCH
-END PGP SIGNATURE-

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


how to get cache file name in arabic language

2013-09-26 Thread Mokdij
I am developing a website in Arabic language, i need to use a slug in 
Arabic characters but my problem is that the cache file name show 
characters like Ù«, ØÃ, ì, ù, à in place of normal characters.

example :
post_من-نحن ==> the slug is: من-نحن

post_٬مŠ-ومدØ٠ع-كمروي-ÙÙŠ-تØرÙات-ااØ

so how to do to get a cache file name in arabic language ?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Check Cache view

2013-09-17 Thread localhost
Hello

First let me thank you Cakephp team for this amazing Caching system, very 
easy to use and saved us a lot of time.


Just one question .

Currently I'm using cache view for a page that require a lot of time to 
generate, (i'm using the data generation in the controller and then the 
view generation in the view), is they are way in the controller to check if 
the view is cached or not?

basicly I want to check in the controller if the view still valid so I 
don't need to generate the data again in the controller.


Thanks

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clear element cache cakphp 2.0

2013-09-05 Thread Dinesh Kumar
Hi,

somehow element_unique is working now. 

On Wednesday, September 4, 2013 3:00:17 PM UTC+5:30, Dinesh Kumar wrote:
>
> i have similar issue.here is my code:
> $this->element('app_images', array(), array('cache' => array('config' 
> => 'default', 'key' => 'unique')));
>
> my cache named: cake_element_unique
>
> i have tried below methods but none of them work.
>
> Cache::delete('unique','default');
> Cache::delete('element_unique','default');
> Cache::delete('cake_element_unique','default');
>
> Thanks in advance,
>
>
>
> On Friday, January 6, 2012 5:13:55 PM UTC+5:30, Jeremy Burns wrote:
>>
>> What happens when you try 'element_unique'? Or if that fails, 
>> 'cake_element_unique'?
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com 
>>
>> On 6 Jan 2012, at 11:18:07, Waterschaats wrote:
>>
>> I've successfully cached an element with in my layout.ctp:
>> $this->element('main_menu', array(), array("cache" => array('config'
>> => 'default', 'key' => 'unique')));
>>
>> which results in a cache file named: 'cake_element_unique'
>>
>> I can't delete this specific cache file using the following code in my
>> controller, what am I doing wrong?
>>
>> $key='unique';
>> Cache::delete($key, $config = 'default');
>>
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+u...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
>>
>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clear element cache cakphp 2.0

2013-09-04 Thread Dinesh Kumar
i have similar issue.here is my code:
$this->element('app_images', array(), array('cache' => array('config' 
=> 'default', 'key' => 'unique')));

my cache named: cake_element_unique

i have tried below methods but none of them work.

Cache::delete('unique','default');
Cache::delete('element_unique','default');
Cache::delete('cake_element_unique','default');

Thanks in advance,



On Friday, January 6, 2012 5:13:55 PM UTC+5:30, Jeremy Burns wrote:
>
> What happens when you try 'element_unique'? Or if that fails, 
> 'cake_element_unique'?
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 6 Jan 2012, at 11:18:07, Waterschaats wrote:
>
> I've successfully cached an element with in my layout.ctp:
> $this->element('main_menu', array(), array("cache" => array('config'
> => 'default', 'key' => 'unique')));
>
> which results in a cache file named: 'cake_element_unique'
>
> I can't delete this specific cache file using the following code in my
> controller, what am I doing wrong?
>
> $key='unique';
> Cache::delete($key, $config = 'default');
>
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+u...@googlegroups.com  For more options, visit this 
> group at http://groups.google.com/group/cake-php
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Cache Help

2013-08-01 Thread Reuben
Oh, nice. My original reply was deleted.

Anyhoo, I might suggest that you only clear the cache for the particular 
Form(s) that were deleted or saved, using Cache::delete('getFormsById' . 
$id).  Although you may need to double check the event of multiple Forms 
being saved or deleted.  I think afterSave() and afterDelete() gets called 
for each entry, but you may want to check, just in case.

Regards
Reuben Helms

On Friday, 2 August 2013 01:48:26 UTC+10, Eric Haskins wrote:
>
> Here is one of my models for dynamic forms. I hope it helps this is 
> CakePHP 2.x  so I clear cache afterSave (editing a forms structure) or 
> afterDelete (selfexplanatory)  
>
> class Forms extends AppModel {
> public $primaryKey = 'id';
> 
> public function afterSave($created) {
>     parent::afterSave($created);
> Cache::clear();
> clearCache();
> }
>
> public function  afterDelete() {
> parent::afterDelete();
> Cache::clear();
> clearCache();
> }
> 
> public function getFormsById($id){
> if (($form = Cache::read('getFormsById'.$id)) === false) {
> $form = $this->find('first', array('conditions' => 
> array('Forms.id'=>$id,'Forms.site_id'=> 
>  Configure::read('Settings.site_id';
> Cache::write('getFormsById'.$id, $form);
> }
> return $form;
> }
> }
>
> Hope this helps.  I am new to Cake cache so if I am wrong someone please 
> feel free to point it out
>
> Eric Haskins
> High Octane Brands LLC
> "Building Brands Not Just Business"
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache Help

2013-08-01 Thread Eric Haskins
Here is one of my models for dynamic forms. I hope it helps this is CakePHP 
2.x  so I clear cache afterSave (editing a forms structure) or afterDelete 
(selfexplanatory)  

class Forms extends AppModel {
public $primaryKey = 'id';

public function afterSave($created) {
parent::afterSave($created);
    Cache::clear();
clearCache();
}

public function  afterDelete() {
parent::afterDelete();
    Cache::clear();
clearCache();
}

public function getFormsById($id){
if (($form = Cache::read('getFormsById'.$id)) === false) {
$form = $this->find('first', array('conditions' => 
array('Forms.id'=>$id,'Forms.site_id'=> 
 Configure::read('Settings.site_id';
Cache::write('getFormsById'.$id, $form);
}
return $form;
}
}

Hope this helps.  I am new to Cake cache so if I am wrong someone please 
feel free to point it out

Eric Haskins
High Octane Brands LLC
"Building Brands Not Just Business"

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache Help

2013-07-29 Thread jmn2k1
You must "invalidate" the cache, ie, delete the cache in a onSave callback.

On Friday, July 26, 2013 9:05:30 PM UTC-3, advantage+ wrote:
>
> Maybe I was reading wrong but I was under the impression if you cache an 
> object (find data) if it was different it would delete the original cached 
> data.
>
>  
>
> I am caching the results of a find, but as admin if I edit the record the 
> cached data is always returned not the new data.
>
>  
>
> Is ther a way to fetch new data after save and delete cached info?
>
>  
>
> *Dave Maharaj*
>
> *Freelance Designer | Developer*
> [image: Description: header_logo]
> www.movepixels.com  |  d...@movepixels.com   |  709.800.0852
>
>  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache Help

2013-07-28 Thread Reuben
I must admit, I've never cached model data. I figure the database engine 
will be better at caching data for quick (and often) retrieval in its 
buffers.  But I have done caching of results of web services, and the 
occasional view.

If you had to do caching of model data, then I would recommend clearing the 
relevant caches in the afterSave() and afterDelete() methods.  And even 
then, you should only need to clear the entry for the specific cached 
record.  You just need to make sure you an reproduce the key that you're 
using to save the data from the afterSave and afterDelete locations.

Regards
Reuben Helms

On Saturday, 27 July 2013 10:05:30 UTC+10, advantage+ wrote:
>
> Maybe I was reading wrong but I was under the impression if you cache an 
> object (find data) if it was different it would delete the original cached 
> data.
>
>  
>
> I am caching the results of a find, but as admin if I edit the record the 
> cached data is always returned not the new data.
>
>  
>
> Is ther a way to fetch new data after save and delete cached info?
>
>  
>
> *Dave Maharaj*
>
> *Freelance Designer | Developer*
> [image: Description: header_logo]
> www.movepixels.com  |  d...@movepixels.com   |  709.800.0852
>
>  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Cache Help

2013-07-26 Thread Advantage+
Maybe I was reading wrong but I was under the impression if you cache an
object (find data) if it was different it would delete the original cached
data.

 

I am caching the results of a find, but as admin if I edit the record the
cached data is always returned not the new data.

 

Is ther a way to fetch new data after save and delete cached info?

 

Dave Maharaj

Freelance Designer | Developer
Description: header_logo
www.movepixels.com  |   <mailto:d...@movepixels.com> d...@movepixels.com  |
709.800.0852

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


<>

Re: Strange cache behavior in console scripts

2013-06-24 Thread Simon Males
I experienced a similar issue, basically it was impossible to define TMP in
cake.php. The below patch has being merged into the 2.4 branch.

https://github.com/cakephp/cakephp/commit/9c113247de151a15340231013926ed08fd8f61ee


On Tue, Jun 25, 2013 at 6:22 AM, Chris Cinelli <
chris.cine...@formativelearning.com> wrote:

> We are using CakePHP 2.2.3. We moved the tmp folder from /app/tmp to /tmp (to
> the same level of /app). So we removed the /app/tmp folder and we added
> these lines to /app/webroot/index.php:
>
> //We like the TMP folder outside the app folder!
> define('TMP',  dirname(dirname(dirname(dirname(__FILE__.DS.'tmp'.DS);
>
> Every once in a while we have problems with Console shell scripts.
> With CORE_DEBUG > 0 everything works fine but when CORE_DEBUG = 0 we get
> strange error (Ex: table does not exist when instead it exists in the DB).
> Again everything works with CORE_DEBUG > 0.
>
> The workaround has been deleting the files in:
> /lib/Cake/Console/Templates/skel/tmp/cache/models/
>
> Some questions:
>
>1.  Why are not the cache files being updated? What is the cache logic?
>2. In ShellDispatcher.php in function _bootstrap(), There is this:
>if (!is_dir(ROOT . DS . APP_DIR . DS . 'tmp')) {
>   define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console'
>. DS . 'Templates' . DS . 'skel' . DS . 'tmp' . DS);
>}
>This is pretty awkward. So :
>   1. Why is the cache set in this almost impossible to find folder
>   inside the cake core /lib folder ?
>   2. Why the condition is if (!is_dir(ROOT . DS . APP_DIR . DS .
>   'tmp')) ... instead of if (defined('TMP')) ... ?
>   This prevents to define TMP in /app/Console/cake.php and the only
>   way to fix is to mess up with ShellDispatcher.php under /lib that makes
>   updating CakePHP a little more error prone (we need to remember that we
>   change stuff in /lib)
>
>
> --
> Best,
>Chris
>
> --Everything should be made as simple as possible, but not simpler (Albert
> Einstein)
> Read it as: "As simple as possible, as complex as necessary"
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Simon Males

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Strange cache behavior in console scripts

2013-06-24 Thread Chris Cinelli
We are using CakePHP 2.2.3. We moved the tmp folder from /app/tmp to /tmp (to
the same level of /app). So we removed the /app/tmp folder and we added
these lines to /app/webroot/index.php:

//We like the TMP folder outside the app folder!
define('TMP',  dirname(dirname(dirname(dirname(__FILE__.DS.'tmp'.DS);

Every once in a while we have problems with Console shell scripts.
With CORE_DEBUG > 0 everything works fine but when CORE_DEBUG = 0 we get
strange error (Ex: table does not exist when instead it exists in the DB).
Again everything works with CORE_DEBUG > 0.

The workaround has been deleting the files in:
/lib/Cake/Console/Templates/skel/tmp/cache/models/

Some questions:

   1.  Why are not the cache files being updated? What is the cache logic?
   2. In ShellDispatcher.php in function _bootstrap(), There is this:
   if (!is_dir(ROOT . DS . APP_DIR . DS . 'tmp')) {
  define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' .
   DS . 'Templates' . DS . 'skel' . DS . 'tmp' . DS);
   }
   This is pretty awkward. So :
  1. Why is the cache set in this almost impossible to find folder
  inside the cake core /lib folder ?
  2. Why the condition is if (!is_dir(ROOT . DS . APP_DIR . DS .
  'tmp')) ... instead of if (defined('TMP')) ... ?
  This prevents to define TMP in /app/Console/cake.php and the only way
  to fix is to mess up with ShellDispatcher.php under /lib that makes
  updating CakePHP a little more error prone (we need to remember that we
  change stuff in /lib)


-- 
Best,
   Chris

--Everything should be made as simple as possible, but not simpler (Albert
Einstein)
Read it as: "As simple as possible, as complex as necessary"

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache Implement on ACL

2013-05-23 Thread rchavik


On Thursday, 23 May 2013 22:10:32 UTC+7, Yasir Arafat wrote:
>
> Hello,
> I have used ACL in an application. It was fine when there were very few 
> functionality but day by day as the functionalities are increased the load 
> time is also increasing. I make sure about 
>
>
>
>- *D**atabase is normalized properly*
>- *I**ndex field properly*
>- *T**able engine is innoDB*. 
>
>
> I get little improvement but that's not sufficient. So i think if i can 
> implement cache on ACL that will help me
>
> So i need help on implementing ACL or if you have any other suggesions.
>
>
Maybe 
https://github.com/croogo/croogo/blob/1.5/Plugin/Acl/Controller/Component/Auth/AclCachedAuthorize.php
 
could be used/modified as a starting point.

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to use Cache Helper and execute UPDATE query on every URL request?

2013-05-17 Thread Salines
Thanks

Dana petak, 17. svibnja 2013. 10:45:07 UTC+2, korisnik AD7six napisao je:
>
> Of course cached views skip the controller - that's the whole purpose of 
> caching your views.
>
> The "normal" way to increment a counter would be to include the equivalent 
> of :
>
> 
>
> In your view file - and have a controller action which increments the 
> counter and responds with a valid image:
>
> function record_view($id) {
> $this->Article->updateAll(array('views' => 'views + 1'));
> $this->viewClass = 'Media';
>  render a 1x1px image.
> }
>
> hth,
>
> AD
>
> On Friday, 17 May 2013 00:33:24 UTC+2, Salines wrote:
>>
>> Hi,
>> I use the Cache Helper, to cache my views, but now I need to implement a 
>> simple UPDATE query in my view() action.
>>
>> When I use the cached views, CakePHP skip actions in the the controller?
>> I want to record the number of hits on each article!
>>
>> Can someone point me in the right direction?
>>
>> Thanks!
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to use Cache Helper and execute UPDATE query on every URL request?

2013-05-17 Thread AD7six
Of course cached views skip the controller - that's the whole purpose of 
caching your views.

The "normal" way to increment a counter would be to include the equivalent 
of :



In your view file - and have a controller action which increments the 
counter and responds with a valid image:

function record_view($id) {
$this->Article->updateAll(array('views' => 'views + 1'));
$this->viewClass = 'Media';
 render a 1x1px image.
}

hth,

AD

On Friday, 17 May 2013 00:33:24 UTC+2, Salines wrote:
>
> Hi,
> I use the Cache Helper, to cache my views, but now I need to implement a 
> simple UPDATE query in my view() action.
>
> When I use the cached views, CakePHP skip actions in the the controller?
> I want to record the number of hits on each article!
>
> Can someone point me in the right direction?
>
> Thanks!
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to use Cache Helper and execute UPDATE query on every URL request?

2013-05-16 Thread Salines
Hi,
I use the Cache Helper, to cache my views, but now I need to implement a 
simple UPDATE query in my view() action.

When I use the cached views, CakePHP skip actions in the the controller?
I want to record the number of hits on each article!

Can someone point me in the right direction?

Thanks!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Cache Initiation

2013-05-13 Thread BarbarianGeek
When and where during application startup does the Cache get initiated and 
the $_map property of App.php get set?

I can't figure out where this gets initiated and a lot of my paths are 
misconfigured when I run a console shell. Its probably some weird 
configuration I have incorrectly set so I want to see how those paths that 
are being set in $_map are being set.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Bug in Cache/CacheEngine.php at Line 60 wehnelt i use netbeans plugin

2013-05-03 Thread Jacques Levavasseur
I add date_default_timezone_set('Europe/Paris') because Therese si an error 
Wotherspoon strtotime

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Cache Rest

2013-04-12 Thread Leonardo Jorge Dias Carmo
Sup guys,

I'm developing a rest api for an app with cakephp to be consumed by 
smarthphones, and i need to make a cache of data.

I already make cache of queries with apc, but i still have traffic with 
this...

i'll probably use http cache expire, but when expire, the data can be the 
same and will generated unnecessary traffic because the size of packet...

Why i'm doing this??
3G in brazil sucks

My objective is reduce the traffic size

Example how will work:

 - SMARTHPHONE: Make a requisition

 - SERVER: receive the requisition, 

  - SERVER: generate a md5 of content

  - SERVER: save in a DB, the url and url parameters associated to the md5 
of content that will be returned

 - SERVER: return the content with generated md5
 
- SMARTHPHONE: storage the content, and create a hashmap with url with 
params, md5 of content, expire date, and the content

So when expires :

- SMARTHPHONE: make new requisition, sending the md5

- SERVER: receive the requisition and verify if the generated content is 
different verifying both md5

 - SERVER: if different, return the new content and new md5
 
 - SERVER: if equal, return the new expire date

 - SMARTHPHONE: if diffrent, storage the new data
 
 - SMARTHPHONE: if equal, update the new expire date

---
So, i don't know if already exist a plugin that handle this...

And what I wrote above make any sense


Thanks, and sorry for my english



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Memcache Cache::read help

2013-04-11 Thread Advantage+
I have setup memcache on my localhost and it is caching the queries fine. 

Check the server and I see the slab and the keys of cached data from my
queries.

 

Example for State model:

a:65:{i:15;s:7:"Alabama";i:14;s:6:"Alask
a";i:17;s:7:"Arizona";i:16;s:8:"Arkansas
";i:18;s:10:"California";i:19;s:8:"Color
ado";i:20;s:11:"Connecticut";i:22;s:8:"D elaware";i:21;s:20:"District of
Columbia ";i:23;s:7:"Florida";i:24;s:7:"Georgia";
i:25;s:6:"Hawaii";i:27;s:5:"Idaho";i:28;
s:8:"Illinois";i:29;s:7:"Indiana";i:26;s
:4:"Iowa";i:30;s:6:"Kansas";i:31;s:8:"Ke
ntucky";i:32;s:9:"Louisiana";i:35;s:5:"M
aine";i:34;s:8:"Maryland";i:33;s:13:"Mas
sachusetts";i:36;s:8:"Michigan";i:37;s:9
:"Minnesota";i:39;s:11:"Mississippi";i:3
8;s:8:"Missouri";i:40;s:7:"Montana";i:43
;s:8:"Nebraska";i:47;s:6:"Nevada";i:44;s :13:"New Hampshire";i:45;s:10:"New
Jersey";i:46;s:10:"New Mexico";i:48;s:8:"New York";i:41;s:14:"North
Carolina";i:42;s: 12:"North Dakota";i:49;s:4:"Ohio";i:50;s
:8:"Oklahoma";i:51;s:6:"Oregon";i:52;s:1 2:"Pennsylvania";i:53;s:12:"Rhode
Island ";i:54;s:14:"South Carolina";i:55;s:12:" South
Dakota";i:56;s:9:"Tennessee";i:57; s:5:"Texas";i:58;s:4:"Utah";i:61;s:7:"Ve
rmont";i:60;s:14:"Virgin Islands";i:59;s
:8:"Virginia";i:62;s:10:"Washington";i:6 4;s:13:"West
Virginia";i:63;s:9:"Wiscons in";i:65;s:7:"Wyoming";i:1;s:7:"Alberta"
;i:2;s:16:"British Columbia";i:3;s:8:"Ma nitoba";i:4;s:13:"New
Brunswick";i:5;s:2 5:"Newfoundland and Labrador";i:7;s:21:" Northwest
Territories";i:6;s:11:"Nova Sc otia";i:8;s:7:"Nunavut";i:9;s:7:"Ontario
";i:10;s:20:"Prince Edward Island";i:11;
s:6:"Quebec";i:12;s:13:"Saskatachewan";i :13;s:5:"Yukon";}

 

and in memcache the "key" is 'state_list'

 

But when reading the Cache::read('state_list', 'inmemory'); //it always
returns false.

 

Just for testing I have this snip of code:

 

$settings = Cache::read('state_list', 'inmemory');

debug($settings); // returns false

if (empty($settings)) {

   $settings = ClassRegistry::init('User')->_getStates();

}

 

debug($settings); // shows all the states

 

core.php has:

 

$engine = 'Memcache';

 

Cache::config(

   'inmemory', array(

   'engine' => 'Memcache',

   'duration' => 3600,

   'serialize' => true,

   'servers' => array(

  '127.0.0.1:11211'), 

  'persistent' => true,

  'compress' => false));

 

Any ideas why it is not reading the Cache key?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: unserialize() [function.unserialize]: Error at offset 0 of 4283 bytes [CORE\Cake\Cache\Engine\FileEngine.php, line 197]

2013-04-09 Thread Jeremy Burns : Class Outfit
Clear all files (not folders) in /app/tmp/cache and try again.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 9 Apr 2013, at 08:36, Sandip Das  wrote:

> Please hgelp me , i am gettinh this notice in 
> CakePHP 2.3.2.
> 
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




unserialize() [function.unserialize]: Error at offset 0 of 4283 bytes [CORE\Cake\Cache\Engine\FileEngine.php, line 197]

2013-04-09 Thread Sandip Das
Please hgelp me , i am gettinh this notice in 
CakePHP 2.3.2.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache::clearGroup in model and component building cache again

2013-02-26 Thread LDSign
Just one addition: The "unlink"-error is the same when I use the
AutoCache-Plugin instead of the component-logic above...

On Feb 26, 6:50 pm, LDSign  wrote:
> Hi
>
> I have ran into a problem which drives me crazy :(
>
> Ive a component which is used on every page to build the navigation for
> every individual user. The navigation is database driven so caching is a
> good idea - so far so good
>
> The cache is built in the startup-callback of the component like so
> (package and agent is just an example):
>
> > public function initialize(Controller $controller) {
> > parent::initialize($controller);
> > $package = Cache::read($this->Auth->user('id'),'packages');
>
> > if (!$package) {
> > $agent = ClassRegistry::init('Agent')->find('first',array('conditions' =>
> > array('Agent.id' => $this->Auth->user('Company.agent_id';
>
> > if (!empty($agent)) {
> > Cache::write($this->Auth->user('id'), $agent['Package'],'packages');
> > }
> > }
> > }
>
> This works as expected (if the cache file does not exist it would be
> generated).
>
> Now, I would like to push the creation of the cache manually when a
> data-change happens. So Ive put an afterSave-callback in the model:
>
> public function afterSave($created) {
>
> > Cache::clearGroup('packages');
> > }
>
> This works too if I test this seperatly. But when I use this "together"
> with the component-callback I will get an error-message:
>
> *Warning* (2): 
> unlink(C:\xampp\htdocs\ebsst\tmp\cache\packages\ebsst_package_73): Permission 
> denied [*CORE\Cake\Cache\Engine\FileEngine.php*, line *368*]
>
> The cache-file is not cleared though. I guess the file is locked by the 
> file-system (Xampp on Windows 7) through the component. I am not sure about 
> the order of these callbacks and how they interfere between models and 
> components. So ive tried different callbacks in both - but no luck.
>
> Do you have a hint to solve this problem or is this a complete false approach?
>
> Thanks,
> Frank

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Cache::clearGroup in model and component building cache again

2013-02-26 Thread LDSign
Hi

I have ran into a problem which drives me crazy :(

Ive a component which is used on every page to build the navigation for 
every individual user. The navigation is database driven so caching is a 
good idea - so far so good

The cache is built in the startup-callback of the component like so 
(package and agent is just an example):
 

> public function initialize(Controller $controller) {
> parent::initialize($controller);
> $package = Cache::read($this->Auth->user('id'),'packages');
>
> if (!$package) {
> $agent = ClassRegistry::init('Agent')->find('first',array('conditions' => 
> array('Agent.id' => $this->Auth->user('Company.agent_id';
>
> if (!empty($agent)) {
> Cache::write($this->Auth->user('id'), $agent['Package'],'packages');
> }
> }
> }
>

This works as expected (if the cache file does not exist it would be 
generated).

Now, I would like to push the creation of the cache manually when a 
data-change happens. So Ive put an afterSave-callback in the model:

public function afterSave($created) {
> Cache::clearGroup('packages');
> }
>

This works too if I test this seperatly. But when I use this "together" 
with the component-callback I will get an error-message:

*Warning* (2): 
unlink(C:\xampp\htdocs\ebsst\tmp\cache\packages\ebsst_package_73): Permission 
denied [*CORE\Cake\Cache\Engine\FileEngine.php*, line *368*]

The cache-file is not cleared though. I guess the file is locked by the 
file-system (Xampp on Windows 7) through the component. I am not sure about the 
order of these callbacks and how they interfere between models and components. 
So ive tried different callbacks in both - but no luck.

Do you have a hint to solve this problem or is this a complete false approach?

Thanks,
Frank


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




cakephp 2 disabled cache after save

2013-02-25 Thread Lolalola
Hi,
after insert or delete i don't wish delete view cache, but cake do it 
automatically. How disabled clear cache after save, delete functions?

My try, but still the same:

if($this->User->save($data, array('callbacks' => false)))

 
Thanks

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache errors on Heroku with update to 2.3 but works fine on local?

2013-02-14 Thread Brad Koch
You're correct that Aspen and Bamboo are read only, but that doesn't apply
here because the Cedar stack (which all PHP apps run on) has a writeable
ephemeral file system [1].

Figured out my case though, CakePHP's default .gitignore [2] ignores the
tmp directory.  Therefore, since the entire tmp directory structure didn't
exist, it couldn't write the files it needed into the tmp directory.

So, when starting a new CakePHP app, make sure that you actually commit the
tmp directories into your repository.

[1] https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem
[2] https://github.com/cakephp/cakephp/blob/master/.gitignore

On Sat, Feb 9, 2013 at 12:28 PM, Simon Males  wrote:

> Issue is not CakePHP 2.3 specific. Heroku is a read only file system[1].
>
> Though you can write to /tmp. So in core.php, when setting
> Cache::config() update the value of the 'path' key to '/tmp'. I've
> also shared my production Cache::config() settings[2].
>
> [1] https://devcenter.heroku.com/articles/read-only-filesystem
> [2] https://gist.github.com/sime/4746187
>
> On Sat, Feb 9, 2013 at 2:21 PM, Shahruk Khan 
> wrote:
> > Did not resolve the issue as of yet. I tried to change the caching
> engine to
> > Redis but that requires a username / password and I never got past that.
> > I've made a post on the official CakePHP group on Facebook.
> >
> > On Tuesday, January 29, 2013 11:43:10 PM UTC-5, Shahruk Khan wrote:
> >>
> >> I just updated my cake application to 2.3 and I started getting internal
> >> errors on my heroku application.
> >>
> >> Warning (512): /app/www/app/tmp/cache/ is not writable
> >> [CORE/Cake/Cache/Engine/FileEngine.php, line 336]
> >>
> >> Warning (2): file_put_contents(/app/www/app/tmp/logs/error.log)
> >> [http://php.net/function.file-put-contents]: failed to open stream: No
> such
> >> file or directory [CORE/Cake/Log/Engine/FileLog.php, line 88]
> >>
> >>
> >> This works fine on my local server. Any tips?
> >
> > --
> > Like Us on FaceBook https://www.facebook.com/CakePHP
> > Find us on Twitter http://twitter.com/CakePHP
> >
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to cake-php+unsubscr...@googlegroups.com.
> > To post to this group, send email to cake-php@googlegroups.com.
> > Visit this group at http://groups.google.com/group/cake-php?hl=en.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
>
>
> --
> Simon Males
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Brad Koch

Email: bradkoch2...@gmail.com
Phone: 989-372-1212

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache errors on Heroku with update to 2.3 but works fine on local?

2013-02-09 Thread Simon Males
Issue is not CakePHP 2.3 specific. Heroku is a read only file system[1].

Though you can write to /tmp. So in core.php, when setting
Cache::config() update the value of the 'path' key to '/tmp'. I've
also shared my production Cache::config() settings[2].

[1] https://devcenter.heroku.com/articles/read-only-filesystem
[2] https://gist.github.com/sime/4746187

On Sat, Feb 9, 2013 at 2:21 PM, Shahruk Khan  wrote:
> Did not resolve the issue as of yet. I tried to change the caching engine to
> Redis but that requires a username / password and I never got past that.
> I've made a post on the official CakePHP group on Facebook.
>
> On Tuesday, January 29, 2013 11:43:10 PM UTC-5, Shahruk Khan wrote:
>>
>> I just updated my cake application to 2.3 and I started getting internal
>> errors on my heroku application.
>>
>> Warning (512): /app/www/app/tmp/cache/ is not writable
>> [CORE/Cake/Cache/Engine/FileEngine.php, line 336]
>>
>> Warning (2): file_put_contents(/app/www/app/tmp/logs/error.log)
>> [http://php.net/function.file-put-contents]: failed to open stream: No such
>> file or directory [CORE/Cake/Log/Engine/FileLog.php, line 88]
>>
>>
>> This works fine on my local server. Any tips?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Simon Males

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache errors on Heroku with update to 2.3 but works fine on local?

2013-02-08 Thread Shahruk Khan
Did not resolve the issue as of yet. I tried to change the caching engine 
to Redis but that requires a username / password and I never got past that. 
I've made a post on the official CakePHP group on Facebook.

On Tuesday, January 29, 2013 11:43:10 PM UTC-5, Shahruk Khan wrote:
>
> I just updated my cake application to 2.3 and I started getting internal 
> errors on my heroku application.
>
> *Warning* (512): /app/www/app/tmp/cache/ is not writable 
> [*CORE/Cake/Cache/Engine/FileEngine.php*, line *336*]
>
> *Warning* (2): file_put_contents(/app/www/app/tmp/logs/error.log) 
> [http://php.net/function.file-put-contents]: failed to open stream: No such 
> file or directory [*CORE/Cake/Log/Engine/FileLog.php*, line *88*]
>
>
> This works fine on my local server. Any tips?
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache errors on Heroku with update to 2.3 but works fine on local?

2013-02-08 Thread Brad Koch
Ran into the same problem with a new Heroku app of ours.  However, we've
been running the file cache on an older app for over a year and never had
problems.  (Both are on the cedar stack.)  Did you ever get to the bottom
of this?

I assume it has something to do with Heroku's philosophy of read-only
source code, but we should have the ephemeral file system so that shouldn't
matter.

On Wed, Jan 30, 2013 at 8:59 AM, Shahruk Khan wrote:

> Here's the thing - Heroku uses EC2, meaning that any files written are
> deleted on Git push. But I think you're right, so I'm gonna contact Heroku
> support the moment I get the chance. Thanks
>
>
> On Wednesday, January 30, 2013 7:51:12 AM UTC-5, Luciano Bargmann wrote:
>>
>> First things first: I am almost sure you have a write permission problem.
>> Have you tried to fix that?
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Brad Koch

Email: bradkoch2...@gmail.com
Phone: 989-372-1212

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Using CacheHelper to cache JSON views

2013-01-31 Thread erictr1ck
I having the same exact issue with  2.2.4. Did you ever find a way to get 
this to work?

On Friday, July 27, 2012 10:58:10 AM UTC-4, Falagar wrote:
>
> I cannot get this to work in 2.2. This is what I have tried:
>
> First I just followed the book to create JSON views (
> http://book.cakephp.org/2.0/en/views/json-and-xml-views.html). Works 
> great. I get JSON data back.
>
> Then I followed the CacheHelper instructions (
> http://book.cakephp.org/2.0/en/core-libraries/helpers/cache.html). I 
> un-commented Cache.check in core.php, added the CacheHelper in my 
> Controller and defined $cacheAction. This works great for HTML Views. But, 
> for JSON views nothing gets cached unfortunately.
>
> I found this post: 
> http://lars-schenk.com/cached-json-or-xml-view-with-cakephp/523 that ran 
> into a similar issue (albeit in an earlier version of Cake that didn't have 
> JsonView yet).
>
> So I tried to use his method, and apply it to 2.2. I took 
> Router::parseExtensions( 'json' ) out, took the RequestHandler out, created 
> a json.ctp layout file.
>
>
>  configure::write('debug',0); // surpress all debug output on json views
> header('Content-type: text/x-json');?> $this->fetch('content'); ?>
>  
>
> a feed.ctp view file
>
> 
>  
>
> and changed my controller action to just set the layout and data
>
> $this->layout = 'json';$this->view = 'feed';$this->set( 'data', $data );
>  
>
> This works somewhat. I get the JSON file the first time, but when I 
> request that action again, the response contains
>
> 
>  
>
> before the actual JSON data, so it won't work for my client app. I can see 
> that chunk of text in the actual cache file as well, which I think is the 
> problem.
>
> So I am not quite sure how to proceed.
>
> Am I just missing something painfully obvious?
>
> Any help would be greatly appreciated.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache errors on Heroku with update to 2.3 but works fine on local?

2013-01-30 Thread Shahruk Khan
Here's the thing - Heroku uses EC2, meaning that any files written are 
deleted on Git push. But I think you're right, so I'm gonna contact Heroku 
support the moment I get the chance. Thanks 

On Wednesday, January 30, 2013 7:51:12 AM UTC-5, Luciano Bargmann wrote:
>
> First things first: I am almost sure you have a write permission problem. 
> Have you tried to fix that?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Cache errors on Heroku with update to 2.3 but works fine on local?

2013-01-30 Thread Luciano Bargmann
First things first: I am almost sure you have a write permission problem. Have 
you tried to fix that?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Cache errors on Heroku with update to 2.3 but works fine on local?

2013-01-29 Thread Shahruk Khan
I just updated my cake application to 2.3 and I started getting internal 
errors on my heroku application.

*Warning* (512): /app/www/app/tmp/cache/ is not writable 
[*CORE/Cake/Cache/Engine/FileEngine.php*, line *336*]

*Warning* (2): file_put_contents(/app/www/app/tmp/logs/error.log) 
[http://php.net/function.file-put-contents]: failed to open stream: No such 
file or directory [*CORE/Cake/Log/Engine/FileLog.php*, line *88*]


This works fine on my local server. Any tips?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cache::cleargroup() doesn't make sense to me

2013-01-17 Thread stork


> But then why does cleargroup() take a config as a parameter which defaults 
> to "default"?
>

Cake needs to know which engine and prefix you want to use for cleargroup().
 

> Am I missing something?
>

You're probably missing ClearCache plugin - it allows to clear cache group 
even if it is specified in cache configurations with different cache 
engines and different prefixes.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Cache::cleargroup() doesn't make sense to me

2013-01-16 Thread bbf
According to:
http://book.cakephp.org/2.0/en/core-libraries/caching.html#using-groups

"Groups are shared across all cache configs using the same engine and same 
prefix. If you are using groups and what to take advantage of group 
deletion, choose a common prefix for all your configs."

So this seems that you can use cleargroup() to clear a specified group 
across all cache configs.  But then why does cleargroup() take a config as 
a parameter which defaults to "default"?

How is it going to clear the specified group across all configs if it 
defaults to the "default" config?  Am I supposed to call it multiple times 
specifying a different cache config each time? Seems to defeat the purpose 
of groups.

ex:
Cache::config('short', array(
'engine' => 'File',
'duration'=> 60,
'serialize' => true,
'prefix' => 'CA',
'groups' => array('posts')
));

Cache::config('med', array(
'engine' => 'File',
'duration'=> 180,
'serialize' => true,
'prefix' => 'CA',
'groups' => array('posts')
));

Cache::config('long', array(
'engine' => 'File',
'duration'=> 300,
'serialize' => true,
'prefix' => 'CA',
'groups' => array('posts')
));

So for the above, according to the docs and api
Cache::cleargroup('posts') 
would clear "posts" group but only if using the 'default' config.  

Am I missing something?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: modifying cache times based on API call

2012-10-16 Thread Greg Skerman
ok so one idea I had was to call GC before every read, and then read
everything with an obnoxiously long expiry time via set...

which seems terrible to me but might work - anyone got any better ideas?


On Mon, Oct 15, 2012 at 1:18 AM, Greg Skerman  wrote:

> Hi,
>
> I am connecting an API which provides values that are intended to instruct
> the consumer on how long to cache a result for. Different API calls have
> different cache times (and these cache times may be variable, so setting up
> a config for each possible outcome is out of the question).
>
> Essentially there is a callTime and a cacheTime value in the response -
> callTime is the server timestamp that the data was retrieved, and cacheTime
> is the server timestamp that I am expected to wait until I make the next
> call.
>
> Now, I can easily perform some date math here to figure out the cache time
> and plug it into cache::set before writing my local cache - but whilst
> reading the caching documentation on the subject I discovered this:
>
> *If you use Cache::set() to change the settings for a write, you should
> also use Cache::set() before reading the data back in. If you fail to do
> so, the default settings will be used when the cache key is read.:*
>
> How does one get around this? I cannot "know" the cache duration until
> *after* I have read the value - and if the default is used there is a good
> chance that the value will be prematurely garbage collected. If I set the
> default value to an obscenely long time (upwards of 24 hours), then I run
> the risk that the cache will *never* be garbage collected.
>
> Do I need to store a "key map" somewhere that describes the cache time
> values so I can look them up? or is there a way to inspect the cache time
> before reading the value?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




modifying cache times based on API call

2012-10-14 Thread Greg Skerman
Hi,

I am connecting an API which provides values that are intended to instruct
the consumer on how long to cache a result for. Different API calls have
different cache times (and these cache times may be variable, so setting up
a config for each possible outcome is out of the question).

Essentially there is a callTime and a cacheTime value in the response -
callTime is the server timestamp that the data was retrieved, and cacheTime
is the server timestamp that I am expected to wait until I make the next
call.

Now, I can easily perform some date math here to figure out the cache time
and plug it into cache::set before writing my local cache - but whilst
reading the caching documentation on the subject I discovered this:

*If you use Cache::set() to change the settings for a write, you should
also use Cache::set() before reading the data back in. If you fail to do
so, the default settings will be used when the cache key is read.:*

How does one get around this? I cannot "know" the cache duration until
*after* I have read the value - and if the default is used there is a good
chance that the value will be prematurely garbage collected. If I set the
default value to an obscenely long time (upwards of 24 hours), then I run
the risk that the cache will *never* be garbage collected.

Do I need to store a "key map" somewhere that describes the cache time
values so I can look them up? or is there a way to inspect the cache time
before reading the value?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Memory Cache not release after 3 or 4 query is running.

2012-09-14 Thread Ratha
Hi ,
I am having a problem that CakePHP is not release the cache  from my server 
memory.
we have 2 GB of RAM. after users visit 5 or 6 time the server memory start 
to increase from 1.2 GB to 1.9GB some time it crush our server.
Any idea how to clear this cache from memory. for my core file i have set 
 Configure::write('Cache.disable', true);
but cakephp kind of ignore it .

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-08-24 Thread Johnny Perk
Hi I joined and I am posting right now because of the lack of succes I have 
seen all over the web about this issue and while looking for the solution I 
found MANY production sites with this warning messages all overas this 
is the first post that comes up on google when you search for this issue 
here goes the solution.

I solved this problem on fedora 17. I did two things:
1 Add my user to apache group, add apache user to my user group.
2 Read carefully SELinux logs, on fedora I had to issue some commands (that 
was sugested copy/paste by the details in the SELinux warning) to let cake 
write files. If your distribution of SE does not give you a simple option 
to allow or not, disable SELinux as last resort.

So add apache and your user to each other group and disable (or allow cake 
on) SELinux.

I hope this helps and bring me good karma =]

On Sunday, May 6, 2012 2:09:36 PM UTC-3, Joseph wrote:
>
> If you're encountering the SplFileInfo error in CakePHP2 and you're 
> absolutely certain that your file/directory permissions are set up 
> properly, then one other thing to check is your PHP version. Cake2 requires 
> PHP 5.2.8 or greater and although you'd usually be alerted on the default 
> page if you were using the wrong version, you wouldn't be alerted if you'd 
> developed your app on one server and then moved it to another.
>
> I experienced this error after developing a Cake2 app on a PHP5.3 server 
> and then moving it to a PHP 5.1 server. Upgrading to 5.2.17 (which is above 
> 5.2.8) solved the problem.
>
>
> On Saturday, February 18, 2012 2:50:13 AM UTC+7, D Mahoney wrote:
>>
>>  That suggestion sounds reasonable. Tried that, but still have same 
>> issue. 
>>
>> I changed the cache config to add 'mask' => 0666  in 
>> app/Config/bootstrap.php (Cache::config('default', array('engine' => 
>> 'File', 'mask' => 0666));), then deleted the cache files with 
>> "find ./*/tmp/cache -type f \( -name 'cake_*' -o -name 'element_*' -o 
>> -name '*.*' \) -exec rm {} \;" then restarted lighttpd. Also made sure to 
>> chown /srv/www/lighttpd to lighttpd:lighttpd since that's the user lighttpd 
>> will run as. Now when I go to the application URL I'm seeing:
>>
>>  *Warning* (2): 
>> SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us)
>>  [function.SplFileInfo-openFile 
>> <http://107.22.127.119:8000/function.SplFileInfo-openFile>]: failed to open 
>> st
>> ream: No such file or directory [*CORE/Cake/Cache/Engine/FileEngine.php*, 
>> line *293*]
>>
>> *Warning* (512): Cannot open file 
>> '/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us' 
>> [*CORE/Cake/Cache/Engine/FileEngine.php*, line*300*]
>>
>>
>> Still at a loss here!
>>
>>
>> On 02/17/2012 01:10 PM, 0x20h wrote: 
>>
>> try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
>> then delete all cache files.
>>
>> The Problem occurs when you create the cache files under different users
>> (e.g. from cli and lighttpd as www-data)
>>
>>
>>  
>>  

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Weird Cake 2 cache issue when sorting

2012-08-15 Thread Devario Johnson
ok I found the solution.  Here it is for anyone that needs it

Not sure why any of the other clear caching methods didnt work but in the 
controller this worked for me

$this->disableCache();

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Weird Cake 2 cache issue when sorting

2012-08-15 Thread Devario Johnson
btw...if I refresh, it goes away and works fine for that particular sort

On Wednesday, August 15, 2012 6:32:45 PM UTC-4, Devario Johnson wrote:
>
> Hi all, I have a weird thing that I am seeing and I was hoping someone 
> could shed some light on it.
>
> Config => Cache.check, true / or not true same result
>   => Cache.disable, true / or not same result
>
> here is the flow..
>
> User logs in -> sees db data -> sorts it  all is well logs out
> new user logs in (same machine) -> sees db data pertinent to them -> tries 
> to sort = old cached data from previous sort comes back
>
> How do I disable this?
>
>  DBDataHere 
>
> Doesnt seem to affect it
>
> *interesting tidbit, on my local machine, the nocacheblocks works and this 
> doesnt happen...when I up it to the server...I see this behavior.  
>
> any ideas?  Cache folder is fully writable, (though im thinking this may 
> be a local browser thing???)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Weird Cake 2 cache issue when sorting

2012-08-15 Thread Devario Johnson
Hi all, I have a weird thing that I am seeing and I was hoping someone 
could shed some light on it.

Config => Cache.check, true / or not true same result
  => Cache.disable, true / or not same result

here is the flow..

User logs in -> sees db data -> sorts it  all is well logs out
new user logs in (same machine) -> sees db data pertinent to them -> tries 
to sort = old cached data from previous sort comes back

How do I disable this?

 DBDataHere 

Doesnt seem to affect it

*interesting tidbit, on my local machine, the nocacheblocks works and this 
doesnt happen...when I up it to the server...I see this behavior.  

any ideas?  Cache folder is fully writable, (though im thinking this may be 
a local browser thing???)

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Intermittent cache write failures with files or memcached - NginX, PHP-FPM, Load Balanced

2012-08-10 Thread Ryan Willis
It was a write permissions error on the files and a storage error in
Memcached. Oddly enough, I can no longer reproduce these. It must be a
server level problem. Thanks for your response and I will update if I
figure out what it was.

Ryan

On Thu, Aug 9, 2012 at 9:20 PM, Dr. Tarique Sani wrote:

> What is the error you are getting then attempting to re-write cache?
> OR is it that the code is not reaching the write to cache stage?
>
> Tarique
>
> On Thu, Aug 9, 2012 at 10:03 PM, Ryan Willis  wrote:
> > Howdy :)
> >
> > To give you a feel for the environment, we have a highly available
> > configuration of two load balanced web servers and two database servers
> > (master/slave). We are using CakePHP 2.2.1 on NginX and PHP-FPM with PHP
> > 5.4. We are noticing intermittent cache write failures despite having
> tried
> > both file based caching and memcached. For file based caching, even with
> > permissions being 777 and the umask set to 777, a cache file cannot be
> > overwritten once it is written. On the memcached side, the store failures
> > follow the same pattern. Once it has been written, it cannot be
> overwritten
> > when it expires.
> >
> > I am at a loss. At first I thought it had something to do with our file
> > syncing on the web servers but then we moved to memcached to sitestep the
> > issue and we are having the same problem. Any ideas?
> >
> > Thanks in advance!
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com.
> > Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
> >
> >
>
>
>
> --
> =
> PHP for E-Biz: http://sanisoft.com
> =
>
> --
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Intermittent cache write failures with files or memcached - NginX, PHP-FPM, Load Balanced

2012-08-09 Thread Dr. Tarique Sani
What is the error you are getting then attempting to re-write cache?
OR is it that the code is not reaching the write to cache stage?

Tarique

On Thu, Aug 9, 2012 at 10:03 PM, Ryan Willis  wrote:
> Howdy :)
>
> To give you a feel for the environment, we have a highly available
> configuration of two load balanced web servers and two database servers
> (master/slave). We are using CakePHP 2.2.1 on NginX and PHP-FPM with PHP
> 5.4. We are noticing intermittent cache write failures despite having tried
> both file based caching and memcached. For file based caching, even with
> permissions being 777 and the umask set to 777, a cache file cannot be
> overwritten once it is written. On the memcached side, the store failures
> follow the same pattern. Once it has been written, it cannot be overwritten
> when it expires.
>
> I am at a loss. At first I thought it had something to do with our file
> syncing on the web servers but then we moved to memcached to sitestep the
> issue and we are having the same problem. Any ideas?
>
> Thanks in advance!
>
> --
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>



-- 
=
PHP for E-Biz: http://sanisoft.com
=

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Intermittent cache write failures with files or memcached - NginX, PHP-FPM, Load Balanced

2012-08-09 Thread Ryan Willis
Howdy :)

To give you a feel for the environment, we have a highly available 
configuration of two load balanced web servers and two database servers 
(master/slave). We are using CakePHP 2.2.1 on NginX and PHP-FPM with PHP 
5.4. We are noticing intermittent cache write failures despite having tried 
both file based caching and memcached. For file based caching, even with 
permissions being 777 and the umask set to 777, a cache file cannot be 
overwritten once it is written. On the memcached side, the store failures 
follow the same pattern. Once it has been written, it cannot be overwritten 
when it expires.

I am at a loss. At first I thought it had something to do with our file 
syncing on the web servers but then we moved to memcached to sitestep the 
issue and we are having the same problem. Any ideas?

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Using CacheHelper to cache JSON views

2012-07-27 Thread Falagar
 

I cannot get this to work in 2.2. This is what I have tried:

First I just followed the book to create JSON views (
http://book.cakephp.org/2.0/en/views/json-and-xml-views.html). Works great. 
I get JSON data back.

Then I followed the CacheHelper instructions (
http://book.cakephp.org/2.0/en/core-libraries/helpers/cache.html). I 
un-commented Cache.check in core.php, added the CacheHelper in my 
Controller and defined $cacheAction. This works great for HTML Views. But, 
for JSON views nothing gets cached unfortunately.

I found this post: 
http://lars-schenk.com/cached-json-or-xml-view-with-cakephp/523 that ran 
into a similar issue (albeit in an earlier version of Cake that didn't have 
JsonView yet).

So I tried to use his method, and apply it to 2.2. I took 
Router::parseExtensions( 'json' ) out, took the RequestHandler out, created 
a json.ctp layout file.


fetch('content'); ?>
 

a feed.ctp view file


 

and changed my controller action to just set the layout and data

$this->layout = 'json';$this->view = 'feed';$this->set( 'data', $data );
 

This works somewhat. I get the JSON file the first time, but when I request 
that action again, the response contains


 

before the actual JSON data, so it won't work for my client app. I can see 
that chunk of text in the actual cache file as well, which I think is the 
problem.

So I am not quite sure how to proceed.

Am I just missing something painfully obvious?

Any help would be greatly appreciated.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how clear cache this view

2012-07-21 Thread Thiago Belem
Maybe the URL shouldn't contain special characters?

Att.,
--
***Thiago Belem*
Desenvolvedor
Rio de Janeiro - RJ - Brasil

*Assando Sites* - Curso online de *CakePHP*
assando-sites.com.br <http://goo.gl/b1EEd>

thiagobelem.net
cont...@thiagobelem.net

*Skype / gTalk **»* thiago.belem.web
*LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt



On Sat, Jul 21, 2012 at 12:10 PM, Điển vũ  wrote:

> I have a page with url : *http://example.com/threads/**một wiki và diễn
> đàn tự do về*  (controller/slug)
> cached in
> tmp/cache/views/*
> threads_view_m_e1_bb_99t_wiki_v_c3_a0_di_e1_bb_85n_c4_91_c3_a0n_t_e1_bb_b1_do_v_e1.php
> *
>
> how can i clear cache this page ?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


how clear cache this view

2012-07-21 Thread Điển vũ
I have a page with url : *http://example.com/threads/**một wiki và diễn đàn 
tự do về*  (controller/slug)
cached in
tmp/cache/views/*
threads_view_m_e1_bb_99t_wiki_v_c3_a0_di_e1_bb_85n_c4_91_c3_a0n_t_e1_bb_b1_do_v_e1.php
*

how can i clear cache this page ? 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cache::delete not working.

2012-07-17 Thread ianemv
More than a year, have you solved or find out a solution to this issue?

On Monday, 23 May 2011 12:44:44 UTC+8, Krissy Masters wrote:
>
> Not sure why it won’t delete.
>
>  
>
> I even handcoded it and put the code in the controller view function to 
> test out that there was a cache key, so I know its being read but nothing.
>
>  
>
> $read_me = Cache::read( 'info_'.$cache_id, 'inmemory');
>
>  
>
> debug($read_me);
>
> //shows full data set check memcache key and yep its there
>
>  
>
>  
>
> Cache::delete( 'info_'.$cache_id, 'inmemory');
>
>  
>
> Still there..no new call to fetch the data to re-cache it it just never 
> deletes.
>
> Debug 0
>
>  
>
> Any ideas?
>
>  
>
>  
>
>  
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake 2.1 Method Cache

2012-05-11 Thread José Lorenzo
Yes, it is possible, it is the compilation of all queries that your 
application usually does.

El domingo, 6 de mayo de 2012 18:56:21 UTC-4:30, Mika escribió:
>
> The array has 500,000 entries in the [name] index!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake 2.1 Method Cache

2012-05-06 Thread Mika
The array has 500,000 entries in the [name] index!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cake 2.1 Method Cache

2012-05-06 Thread Mika
Is it normal for /app/tmp/cache/persistent/
[cacheprefix]_cake_core_method_cache to be around 20MB in size?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-05-06 Thread Joseph
If you're encountering the SplFileInfo error in CakePHP2 and you're 
absolutely certain that your file/directory permissions are set up 
properly, then one other thing to check is your PHP version. Cake2 requires 
PHP 5.2.8 or greater and although you'd usually be alerted on the default 
page if you were using the wrong version, you wouldn't be alerted if you'd 
developed your app on one server and then moved it to another.

I experienced this error after developing a Cake2 app on a PHP5.3 server 
and then moving it to a PHP 5.1 server. Upgrading to 5.2.17 (which is above 
5.2.8) solved the problem.


On Saturday, February 18, 2012 2:50:13 AM UTC+7, D Mahoney wrote:
>
>  That suggestion sounds reasonable. Tried that, but still have same issue. 
>
> I changed the cache config to add 'mask' => 0666  in 
> app/Config/bootstrap.php (Cache::config('default', array('engine' => 
> 'File', 'mask' => 0666));), then deleted the cache files with 
> "find ./*/tmp/cache -type f \( -name 'cake_*' -o -name 'element_*' -o 
> -name '*.*' \) -exec rm {} \;" then restarted lighttpd. Also made sure to 
> chown /srv/www/lighttpd to lighttpd:lighttpd since that's the user lighttpd 
> will run as. Now when I go to the application URL I'm seeing:
>
>  *Warning* (2): 
> SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us)
>  [function.SplFileInfo-openFile 
> <http://107.22.127.119:8000/function.SplFileInfo-openFile>]: failed to open st
> ream: No such file or directory [*CORE/Cake/Cache/Engine/FileEngine.php*, 
> line *293*]
>
> *Warning* (512): Cannot open file 
> '/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us' 
> [*CORE/Cake/Cache/Engine/FileEngine.php*, line*300*]
>
>
> Still at a loss here!
>
>
> On 02/17/2012 01:10 PM, 0x20h wrote: 
>
> try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
> then delete all cache files.
>
> The Problem occurs when you create the cache files under different users
> (e.g. from cli and lighttpd as www-data)
>
>
>  
>  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP Cache Help Needed

2012-04-21 Thread stork
- rewrite this component as a helper
- use cached element 
http://book.cakephp.org/2.0/en/views.html#caching-elements
- done

If you want to keep your code as a component, use beforeRender() callback 
instead of beforeFilter(), example:

# app/Config/bootstrap.php
Cache::config('short', array(

'duration' => '+15 minutes'
));

class AppController extends Controller {

public function beforeRender() {
$wordpress_posts = Cache::read('wordpress_posts', 'short');
if (empty($wordpress_posts)) {
$wordpress_posts = 
$this->Components->load('Wordpress')->getPosts();
Cache::write('wordpress_posts', $wordpress_posts, 'short');
}
$this->set('wordpress_posts', $wordpress_posts);
   }
}

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakePHP Cache Help Needed

2012-04-20 Thread creat1v1ty
Does anyone have experience with Cake cache who's willing to lend me a hand?

Here is my situation:

In the footer of my website I am pulling in my 3 most recent blog posts 
from Wordpress.com (the website, not a local installation). The way I am 
accomplishing this is by parsing the XML feed from WP. I've created a 
component to do this:

===

App::uses('Component', 'Controller');
App::uses('Xml', 'Utility'); 

class WordpressComponent extends Component {

public $wp_feed = 'http://blog.mydomain.com/feed/';

public $numberOfItems = 3;

public function getPosts() {
// Parse XML from Wordpress Blog
$xml = Xml::build($this->wp_feed);
$parsed_xml = Set::reverse($xml);
$blog_posts = $parsed_xml['rss']['channel']['item'];

// Build simplified array of post title and link
$result = array();
$counter = 0;
foreach ($blog_posts as $post) {
$tmp = array();
$tmp['title'] = $post['title'];
$tmp['link'] = $post['link'];
$tmp['pubDate'] = date("F d, Y", strtotime($post['pubDate']));
array_push($result, $tmp);
$counter++;
if ($counter >= $this->numberOfItems) {
break;
}
}
return $result;
}

}

===

Then, since I need the posts to show up on all my pages, I've done the 
following in my AppController:

===

class AppController extends Controller {

public $components = array('Session', 'Wordpress');

public function beforeFilter() {
$wordpress_posts = $this->Wordpress->getPosts();
$this->set('wordpress_posts', $wordpress_posts);
}

}

===

In am then displaying the results in the footer of my layout file.

The problem is that it's taking a noticeable amount of time to parse the 
XML and relay the posts to my layout. I'm assuming this is because it's 
doing the same thing on every page.

What I would like to know is how I can cache the posts so that I'm not 
having to parse the XML for every page load. Unfortunately, however, I 
don't have any experience working with cache - will someone please help me 
come up with a solution?

Thanks in advance.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP 1.3 and Cache read in error views

2012-04-13 Thread Michał Piotrowski
I solved my problem... solutions is:
Cache::read(cacheName,'cacheConfigName'); in the errors views default 
config doesn't works automatically...   

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakePHP 1.3 and Cache read in error views

2012-04-13 Thread Michał Piotrowski
Hello!

I'm using in views code like this:

$var = Cache::read(cachName);

And works fine with one exception, with ErrorHandler... in errors
views Cake can't read cache?

Maybe I shouldn't  use 'read cache' in views?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cache errors

2012-04-01 Thread Jeremy Burns | Class Outfit
Thanks, and for the record, the errors have disappeared.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Apr 2012, at 20:14:04, 0x20h wrote:

> Yeah, odd behavior. FYI it has been switched in 2.x, see
> http://cakephp.lighthouseapp.com/projects/42648/tickets/1988
>  
> 
> Am 01.04.2012 14:22, schrieb Jeremy Burns | Class Outfit:
>> 
>> Thanks - I hadn't realised that was an option. Have set and tested it and 
>> will monitor to see if that resolves it.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> http://www.classoutfit.com
>> 
>> On 1 Apr 2012, at 11:02:29, 0x20h wrote:
>> 
>>> Have you configured your cache with "lock" => true ?
>>> 
>>> Am 31.03.2012 07:13, schrieb Jeremy Burns:
>>>> Although my site and cache is functioning, my debug log is littered
>>>> with errors similar to this:
>>>> 
>>>> 2012-03-30 23:45:28 Notice: Notice (8): unserialize() [>>> href='function.unserialize'>function.unserialize]: Error at offset
>>>> 4065 of 4085 bytes in [/var/www/clients/client1/_sites/cakes/1_3_13/
>>>> cake/libs/cache/file.php, line 190]
>>>> 2012-03-31 04:59:18 Notice: Notice (8): unserialize() [function.unserialize]: Error at
>>>> offset 1056757 of 1056757 bytes in [/var/www/clients/client1/_sites/
>>>> cakes/1_3_13/cake/libs/cache/file.php, line 190]
>>>> 
>>>> Anyone got any pointers please?
>>>> 
>>> 
>>> 
>>> -- 
>>> Our newest site for the community: CakePHP Video Tutorials 
>>> http://tv.cakephp.org 
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>>> others with their CakePHP related questions.
>>> 
>>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/cake-php
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cache errors

2012-04-01 Thread 0x20h
Yeah, odd behavior. FYI it has been switched in 2.x, see
http://cakephp.lighthouseapp.com/projects/42648/tickets/1988
 

Am 01.04.2012 14:22, schrieb Jeremy Burns | Class Outfit:
> Thanks - I hadn't realised that was an option. Have set and tested it
> and will monitor to see if that resolves it.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 1 Apr 2012, at 11:02:29, 0x20h wrote:
>
>> Have you configured your cache with "lock" => true ?
>>
>> Am 31.03.2012 07:13, schrieb Jeremy Burns:
>>> Although my site and cache is functioning, my debug log is littered
>>> with errors similar to this:
>>>
>>> 2012-03-30 23:45:28 Notice: Notice (8): unserialize() [>> href='function.unserialize'>function.unserialize]: Error at offset
>>> 4065 of 4085 bytes in [/var/www/clients/client1/_sites/cakes/1_3_13/
>>> cake/libs/cache/file.php, line 190]
>>> 2012-03-31 04:59:18 Notice: Notice (8): unserialize() [>> <http://php.net/function.unserialize%27>>function.unserialize]:
>>> Error at
>>> offset 1056757 of 1056757 bytes in [/var/www/clients/client1/_sites/
>>> cakes/1_3_13/cake/libs/cache/file.php, line 190]
>>>
>>> Anyone got any pointers please?
>>>
>>
>>
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>> help others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com
>> <mailto:cake-php+unsubscr...@googlegroups.com> For more options,
>> visit this group at http://groups.google.com/group/cake-php
>
> -- 
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and
> help others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cache errors

2012-04-01 Thread Jeremy Burns | Class Outfit
Thanks - I hadn't realised that was an option. Have set and tested it and will 
monitor to see if that resolves it.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Apr 2012, at 11:02:29, 0x20h wrote:

> Have you configured your cache with "lock" => true ?
> 
> Am 31.03.2012 07:13, schrieb Jeremy Burns:
>> Although my site and cache is functioning, my debug log is littered
>> with errors similar to this:
>> 
>> 2012-03-30 23:45:28 Notice: Notice (8): unserialize() [> href='function.unserialize'>function.unserialize]: Error at offset
>> 4065 of 4085 bytes in [/var/www/clients/client1/_sites/cakes/1_3_13/
>> cake/libs/cache/file.php, line 190]
>> 2012-03-31 04:59:18 Notice: Notice (8): unserialize() [function.unserialize]: Error at
>> offset 1056757 of 1056757 bytes in [/var/www/clients/client1/_sites/
>> cakes/1_3_13/cake/libs/cache/file.php, line 190]
>> 
>> Anyone got any pointers please?
>> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cache errors

2012-04-01 Thread 0x20h
Have you configured your cache with "lock" => true ?

Am 31.03.2012 07:13, schrieb Jeremy Burns:
> Although my site and cache is functioning, my debug log is littered
> with errors similar to this:
>
> 2012-03-30 23:45:28 Notice: Notice (8): unserialize() [ href='function.unserialize'>function.unserialize]: Error at offset
> 4065 of 4085 bytes in [/var/www/clients/client1/_sites/cakes/1_3_13/
> cake/libs/cache/file.php, line 190]
> 2012-03-31 04:59:18 Notice: Notice (8): unserialize() [function.unserialize]: Error at
> offset 1056757 of 1056757 bytes in [/var/www/clients/client1/_sites/
> cakes/1_3_13/cake/libs/cache/file.php, line 190]
>
> Anyone got any pointers please?
>


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cache errors

2012-03-30 Thread Jeremy Burns
Although my site and cache is functioning, my debug log is littered
with errors similar to this:

2012-03-30 23:45:28 Notice: Notice (8): unserialize() [function.unserialize]: Error at offset
4065 of 4085 bytes in [/var/www/clients/client1/_sites/cakes/1_3_13/
cake/libs/cache/file.php, line 190]
2012-03-31 04:59:18 Notice: Notice (8): unserialize() [function.unserialize]: Error at
offset 1056757 of 1056757 bytes in [/var/www/clients/client1/_sites/
cakes/1_3_13/cake/libs/cache/file.php, line 190]

Anyone got any pointers please?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: After a while Cache is not writeable

2012-03-30 Thread stork
You'll have to configure that for _cake_core_ cache, see 
http://book.cakephp.org/2.0/en/development/configuration.html#core-cache-configuration

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: After a while Cache is not writeable

2012-03-30 Thread stork
This happens if you run console shell/task as root user with su or cron. 
Either specify user www-data in crontab, or change cache configuration to 
'mask' => 0644, or - don't use FileEngine in production.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


After a while Cache is not writeable

2012-03-30 Thread Kai Szymanski
Hi!

I have a strange problem with my cakephp-Installation on Ubuntu 10.04
Server: Everything works fine but after a while i get the warning:

fopen(/rootdir/cakephp/app/tmp/cache/persistent/cake_core_default_de-
de) [function.fopen]: failed to open stream: Permission denied [CORE/
cake/libs/cache/file.php, line 142]

If i examine the file its owned by root.

Then i set the right owner (www-data) and everything works fine (for a
while). I cant figure out what happen. Everything else (tmp-Dir,
cachedir a.s.o.) is not affected...only the above file.

Thanks!

Best regards,
  Kai.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


cache helper isnt aware of routes?

2012-03-27 Thread K3
I have implemented view caching on my app and it works fine
it caches view method from posts controller (posts/view)
However, after i added

Router::connect('/', array('controller' => 'posts', 'action' =>
'view',1));

it wont cache the main page. Seems it checks only url as a string and
is not aware of routes. Can anyone help me solve this issue or give me
some tips?

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-20 Thread Lucho Molina
Makes sense, thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-20 Thread Thomas Ploch
You can tell cronjobs under which user it should run. For your case 
apparantly it should be the apache user.

The default mask value '0664' was intentional because of security issues.

Try 'sudo -u {apache-user} cake {shellname} {command}' or set the 
default mask in core.php __before__ you use the shell.

This way you won't get any warnings at all.

Kind regards
Thomas

On 20.02.2012 16:19, Lucho Molina wrote:
I'm with you @huoxito. This seems to be an issue introduced in 2.0 as 
I never had it on 1.3.


Anyway, I tried the 'mask' => 0666 solution but didn't work. I'm also 
running shell scripts on a cron, so every time it ran, the 
persmissions were changed. So my temporary solution was to add the 
Apache user to the same group as the CLI user. Now this is my local 
environment, I'm not sure this will be good to implement in production.

--
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and 
help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this 
group at http://groups.google.com/group/cake-php


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-20 Thread Lucho Molina
I'm with you @huoxito. This seems to be an issue introduced in 2.0 as I 
never had it on 1.3. 

Anyway, I tried the 'mask' => 0666 solution but didn't work. I'm also 
running shell scripts on a cron, so every time it ran, the persmissions 
were changed. So my temporary solution was to add the Apache user to the 
same group as the CLI user. Now this is my local environment, I'm not sure 
this will be good to implement in production.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-19 Thread huoxito
Still dont understand why CakePHP 2.x has this kind of issue, getting 
permissions errors for command line user and apache user. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-18 Thread 0x20h
Of course, i meant 2.0.6 :-)

Am 18.02.2012 20:21, schrieb 0x20h:
> Hmm, looking at the FileEngine.php#293 of the current release (2.0.5)
> there is no call to openFile().
> You should probably upgrade cakephp to the current version.
> If I remember correctly, there has been an issue in an early 2.0 version.
>
> Also, from a security perspective it's not a good idea to chown the
> whole directory to lighttpd. It's ok if lighttpd has r-x access.
> Otherwise any vulnerable script could write to files in your webroot.
> Just make app/tmp writeable.
>
>
> Am 17.02.2012 20:50, schrieb D Mahoney:
>> That suggestion sounds reasonable. Tried that, but still have same
>> issue.
>>
>> I changed the cache config to add 'mask' => 0666  in
>> app/Config/bootstrap.php (Cache::config('default', array('engine' =>
>> 'File', 'mask' => 0666));), then deleted the cache files with
>> "find ./*/tmp/cache -type f \( -name 'cake_*' -o -name 'element_*' -o
>> -name '*.*' \) -exec rm {} \;" then restarted lighttpd. Also made
>> sure to chown /srv/www/lighttpd to lighttpd:lighttpd since that's the
>> user lighttpd will run as. Now when I go to the application URL I'm
>> seeing:
>>
>> *Warning* (2): 
>> SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us)
>>  [funct
>> ion.SplFileInfo-openFile 
>> <http://107.22.127.119:8000/function.SplFileInfo-openFile>]: failed to open 
>> st
>> ream: No such file or directory [*CORE/Cake/Cache/Engine/FileEngine.php*, 
>> line *293*]
>> *Warning* (512): Cannot open file 
>> '/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us' 
>> [*CORE/Cake/Cache/Engine/FileEngine.php*, line*300*]
>>
>> Still at a loss here!
>>
>>
>> On 02/17/2012 01:10 PM, 0x20h wrote:
>>> try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
>>> then delete all cache files.
>>>
>>> The Problem occurs when you create the cache files under different users
>>> (e.g. from cli and lighttpd as www-data)
>>>
>>
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>> help others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>> group at http://groups.google.com/group/cake-php
>
> -- 
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and
> help others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-18 Thread 0x20h
Hmm, looking at the FileEngine.php#293 of the current release (2.0.5)
there is no call to openFile().
You should probably upgrade cakephp to the current version.
If I remember correctly, there has been an issue in an early 2.0 version.

Also, from a security perspective it's not a good idea to chown the
whole directory to lighttpd. It's ok if lighttpd has r-x access.
Otherwise any vulnerable script could write to files in your webroot.
Just make app/tmp writeable.


Am 17.02.2012 20:50, schrieb D Mahoney:
> That suggestion sounds reasonable. Tried that, but still have same issue.
>
> I changed the cache config to add 'mask' => 0666  in
> app/Config/bootstrap.php (Cache::config('default', array('engine' =>
> 'File', 'mask' => 0666));), then deleted the cache files with
> "find ./*/tmp/cache -type f \( -name 'cake_*' -o -name 'element_*' -o
> -name '*.*' \) -exec rm {} \;" then restarted lighttpd. Also made sure
> to chown /srv/www/lighttpd to lighttpd:lighttpd since that's the user
> lighttpd will run as. Now when I go to the application URL I'm seeing:
>
> *Warning* (2): 
> SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us)
>  [function.SplFileInfo-openFile 
> <http://107.22.127.119:8000/function.SplFileInfo-openFile>]: failed to open st
> ream: No such file or directory [*CORE/Cake/Cache/Engine/FileEngine.php*, 
> line *293*]
> *Warning* (512): Cannot open file 
> '/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us' 
> [*CORE/Cake/Cache/Engine/FileEngine.php*, line*300*]
>
> Still at a loss here!
>
>
> On 02/17/2012 01:10 PM, 0x20h wrote:
>> try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
>> then delete all cache files.
>>
>> The Problem occurs when you create the cache files under different users
>> (e.g. from cli and lighttpd as www-data)
>>
>
> -- 
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and
> help others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-17 Thread Bowei
I experienced today after creating shell scripts in command line.  The
cache dir was writeable by apache user.

I chown the cache file to apache user, and the warning disappeared.




On Feb 17, 11:10 am, 0x20h  wrote:
> try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
> then delete all cache files.
>
> The Problem occurs when you create the cache files under different users
> (e.g. from cli and lighttpd as www-data)
>
> Am 17.02.2012 16:28, schrieb CatDude:
>
>
>
>
>
>
>
> > Greetings, all. I'm helping a friend debug his CakePHP install and am
> > encountering the message in the subject. Specifically, I see a lot
> > of :
>
> > 2012-02-17 15:20:06: (mod_fastcgi.c.2701) FastCGI-stderr: PHP
> > Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
> > persistent/cake_core_file_map) [function.SplFileInfo-openFile]: failed to open stream:
> > No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
> > FileEngine.php on line 300
> > PHP Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
> > persistent/cake_core_object_map) [function.SplFileInfo-openFile]: failed to open stream:
> > No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
> > FileEngine.php on line 300
>
> > CakePHP (CakePHP(tm) v 1.2.0.5012) is being run under lighttpd on
> > Centos 5.4. The directory being referenced has permissions 777, as do
> > the files in that directory. I wrote a little one line script that
> > opens /srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map
> > with a mode of "w" and it works fine. When I change the mode to "c
> > +" (which the FileEngine.php script is attempting to do) I get:
> > failed to open stream: Inappropriate ioctl for device in /root/
> > ftest_c.php
>
> > This is not the sort of error I expect to see! Suggestions?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-17 Thread D Mahoney

That suggestion sounds reasonable. Tried that, but still have same issue.

I changed the cache config to add 'mask' => 0666  in 
app/Config/bootstrap.php (Cache::config('default', array('engine' => 
'File', 'mask' => 0666));), then deleted the cache files with
"find ./*/tmp/cache -type f \( -name 'cake_*' -o -name 'element_*' -o 
-name '*.*' \) -exec rm {} \;" then restarted lighttpd. Also made sure 
to chown /srv/www/lighttpd to lighttpd:lighttpd since that's the user 
lighttpd will run as. Now when I go to the application URL I'm seeing:


*Warning*  (2): 
SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us)
 [function.SplFileInfo-openFile  
<http://107.22.127.119:8000/function.SplFileInfo-openFile>]: failed to open 
stream: No such file or directory [*CORE/Cake/Cache/Engine/FileEngine.php*, line  
*293*]

*Warning*  (512): Cannot open file 
'/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us' 
[*CORE/Cake/Cache/Engine/FileEngine.php*, line*300*]


Still at a loss here!


On 02/17/2012 01:10 PM, 0x20h wrote:

try to set the 'mask' =>  0666 option for the file cache (in boostrap.php),
then delete all cache files.

The Problem occurs when you create the cache files under different users
(e.g. from cli and lighttpd as www-data)



--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-17 Thread 0x20h
try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
then delete all cache files.

The Problem occurs when you create the cache files under different users
(e.g. from cli and lighttpd as www-data)

Am 17.02.2012 16:28, schrieb CatDude:
> Greetings, all. I'm helping a friend debug his CakePHP install and am
> encountering the message in the subject. Specifically, I see a lot
> of :
>
> 2012-02-17 15:20:06: (mod_fastcgi.c.2701) FastCGI-stderr: PHP
> Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
> persistent/cake_core_file_map) [function.SplFileInfo-openFile]: failed to open stream:
> No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
> FileEngine.php on line 300
> PHP Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
> persistent/cake_core_object_map) [function.SplFileInfo-openFile]: failed to open stream:
> No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
> FileEngine.php on line 300
>
> CakePHP (CakePHP(tm) v 1.2.0.5012) is being run under lighttpd on
> Centos 5.4. The directory being referenced has permissions 777, as do
> the files in that directory. I wrote a little one line script that
> opens /srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map
> with a mode of "w" and it works fine. When I change the mode to "c
> +" (which the FileEngine.php script is attempting to do) I get:
> failed to open stream: Inappropriate ioctl for device in /root/
> ftest_c.php
>
> This is not the sort of error I expect to see! Suggestions?
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-17 Thread CatDude
Greetings, all. I'm helping a friend debug his CakePHP install and am
encountering the message in the subject. Specifically, I see a lot
of :

2012-02-17 15:20:06: (mod_fastcgi.c.2701) FastCGI-stderr: PHP
Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
persistent/cake_core_file_map) [function.SplFileInfo-openFile]: failed to open stream:
No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
FileEngine.php on line 300
PHP Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
persistent/cake_core_object_map) [function.SplFileInfo-openFile]: failed to open stream:
No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
FileEngine.php on line 300

CakePHP (CakePHP(tm) v 1.2.0.5012) is being run under lighttpd on
Centos 5.4. The directory being referenced has permissions 777, as do
the files in that directory. I wrote a little one line script that
opens /srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map
with a mode of "w" and it works fine. When I change the mode to "c
+" (which the FileEngine.php script is attempting to do) I get:
failed to open stream: Inappropriate ioctl for device in /root/
ftest_c.php

This is not the sort of error I expect to see! Suggestions?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Newbie question: Disable Cache

2012-01-26 Thread rocha9000
This issue has been resolved. It turned out to be my webhost caching the 
generated cache files. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


  1   2   3   4   5   6   7   8   9   >