Re: SQL sum function to store as single variable

2012-04-23 Thread 0x20h
Am 22.04.2012 20:24, schrieb kdubya: > [...] > This can be written as a find(): > $total = $this->CustomerPurchases->find('first', > array('conditions'=>array('customerbill_id'=>$billid), > 'fields'=>array('sum(customerpurchases.amount) as total')); I think something like $total = $this->Customer

Re: Cache errors

2012-04-01 Thread 0x20h
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: >>> A

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.unse

Re: Cakephp 2.1 ACL Issue

2012-03-28 Thread 0x20h
Please provide more information on your setup and your problem, otherwise nobody is going to be able help you. Am 27.03.2012 09:02, schrieb sneha: > Hi, > > I am using the ACL component of cakephp 2.1, I am facing issue with > acl permissions check. I have integrated the ACL and created the > gro

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

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

2012-02-18 Thread 0x20h
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/201

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 de

Re: Can't get .htaccess override to work in 2.0

2012-02-13 Thread 0x20h
As the last warning states, your cache directory is not writeable. Make it writeable to the your webserver's user, e.g. chmod -R 777 app/tmp Am 13.02.2012 21:16, schrieb Yves S. Garret: > Ok, here's my problem, after going through the install instructions > and getting most of the problems resolv

Re: Is it possible to turn off transactions in saveAll() ?

2012-01-13 Thread 0x20h
Am 12.01.2012 18:18, schrieb Patrick: > Hahaha... I can't believe I've made stupid mistake like that. > Yes, I typed 'false' as a string. > Now this script is able to rollback() :D > But new problems arise :( > If the 'atomic' set to false, how I know when saveAll() fails? > Because when I put save

Re: why bindModel dont use the behaviour of my model

2012-01-13 Thread 0x20h
Am 13.01.2012 16:07, schrieb Arnold: > bindModel should works with the behaviors of the binded model have in > $actsAs? > > i have this: > > ModelA: > > $this->bindModel(array('hasMany' => array('ModelB' => > array('className' => 'ModelB'; > $this->contain(array('ModelB')); > pr($this->read(nul

Re: Is it possible to turn off transactions in saveAll() ?

2012-01-11 Thread 0x20h
probably the problem ist that 'atomic' should be boolean false, not the string 'false' which will be evaluated to (bool) true... Am 11.01.2012 19:01, schrieb Patrick: > I've tried changing the 'atomic' option to 'false', but apparently > there is no difference. > Still can't rollback() when saveA

Re: Permission problems with baking and running the app

2011-11-20 Thread 0x20h
What version of cake are you using? There was an issue in 1.3.12, see http://cakephp.lighthouseapp.com/projects/42648/tickets/2080-core-cache-files-can-not-be-written-by-cron-and-web-user#ticket-2080-6 Am 20.11.2011 15:53, schrieb func0der: > Hey guys, > > i reinstalled my Ubuntu couple of weeks a

Re: Implement Getter/Setter in Model-Classes

2011-11-19 Thread 0x20h
Am 17.11.2011 12:18, schrieb Gerrit: > It's already called after Model->read()?? Yes, read() find()s the requested record and sets the result to $this->data. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.c

Re: Concurrency control

2011-11-15 Thread 0x20h
Am 14.11.2011 17:14, schrieb phpMagpie: > Not sure if there is an existing behaviour, but if you create a > created and modified field Cake will automagically update them. Check > these to see if they have been updated since form load et voila. Looking at the modified date does guarantee mutual ex

Re: Really Annoying Error

2011-11-07 Thread 0x20h
It's not recommended to use FileCache for webserver environment (it's ok for cli though). Thats because the filecache engine uses flock() to synchronize concurrent access which locks on process level. Hence, in a multithreaded environment several requests handled by the same process will successful

Re: Really Annoying Error

2011-11-03 Thread 0x20h
Does this problem persist if you switch cache backends or can you blame a certain engine? Am 03.11.2011 16:56, schrieb zuha: > I'm not longer sure how this is happening anymore, but its a recurring > problem with Cake 2.0, and there is no exception or error message to > help figure it out. Simpl

Re: Cached Forms Don't Submit

2011-10-30 Thread 0x20h
When beforeFilter() gets called cake is already rendering the "cached version". (see dispatcher::cached() and ViewHelper#__writeFile()). Regarding to the docs its not recommended to use the callbacks ( http://book.cakephp.org/view/1380/Caching-in-the-Controller ) . I would probably try to separate

Re: Cache FileEngine

2011-10-28 Thread 0x20h
Hi Sebastien, please read http://book.cakephp.org/2.0/en/contributing/code.html to find out how you can contribute patches. Am 28.10.2011 15:30, schrieb Sandreu: > Hello, > > I made an increment for file engine system. > My problem was that in APC cache, the cache is not shared between CLI > and

Re: fopen(.../app/tmp/cache/persistent/cake_core_default_en-us) [function.fopen]: failed to open stream: No such file or directory

2011-09-13 Thread 0x20h
Tom, from the stack trace of the error message on your site I conclude that you checked out the latest 1.3 branch, not Cake 1.3.11. Since the release of 1.3.11 there has been a change on writing cache files to gain atomicity, so I guess that error is a bug. Am 13.09.2011 22:54, schrieb Tom Belkn

Re: fopen(.../app/tmp/cache/persistent/cake_core_default_en-us) [function.fopen]: failed to open stream: No such file or directory

2011-09-12 Thread 0x20h
Hey Tom, what php/cake version is running on your server? Also, have you tried to delete the files in app/tmp/cache and does the problem persist? Am 12.09.2011 04:37, schrieb Tom Belknap: > Hmm... No luck, any other ideas? I've been using CakePHP for over a > year and never had this problem. I up

Re: Corrupted app/tmp/cache/views/ Files

2011-08-30 Thread 0x20h
Hey Mike, I unserialize()'d the files you provided and they all seem to be ok, however there are no cached views. Next time you should tar app/tmp/cache/views or app/tmp/cache. Anyway, there was an issue with locks when using file cache which was (hopefully) solved only recently, see http://cakep

Re: Using SELECT... FOR UPDATE in cakephp

2011-08-15 Thread 0x20h
Am 15.08.2011 21:08, schrieb Teddy Zeenny: > Oh you are definitely right. I made up the example as I was writing > the post, this is not a real case in my application.. Besides, I use > ACL for privileges :) > > But such cases do happen (inserting or updating based on a SELECT > result) and it can

Re: Using SELECT... FOR UPDATE in cakephp

2011-08-15 Thread 0x20h
Am 14.08.2011 12:46, schrieb Teddy Zeenny: > That is an interesting idea. (Although I don't think it would give me > the exact SELECT .. FOR UPDATE functionality, but I guess it's as > close as I can get). It would only allow 1 Process to access the if clause and it would return *immediately* on *a

Re: Using SELECT... FOR UPDATE in cakephp

2011-08-13 Thread 0x20h
Maybe an alternative would be to use mysqls GET_LOCK... e.g. $record = find('first', array(...,'fields' => array('GET_LOCK("foo",0) AS lock', ...) if ($record[0]['lock']) { ... } didn't try that, just a shot in the blue. Of course the named lock should be unique on what you want to lock. Am 10

Re: Where should i contact right people in CakePHP.org because this security critical problem

2011-06-23 Thread 0x20h
Am 23.06.2011 21:22, schrieb majna: > ... > > Proposal: > - add notice in docs and cake "core.php" config > - enable "code and context" only for dev host (127.0.0.1) or remove it > (not very useful) +1, never used context. > - stop arguing and be polite :) +1 > On Jun 23, 8:47 pm, AD7six wrote: >>

Re: Is this possible a big issue

2011-05-06 Thread 0x20h
Am 06.05.2011 11:05, schrieb Ryan Schmidt: > On May 6, 2011, at 03:59, datgs wrote: > >> I've worked with CakePHP magical created, modified and updated. And I >> found that automation of getting current time based on php at >> >> $time = strtotime('now'); >> >> I think it is not good for some case,

Re: Cache problem using CakePHP default File config on apache 1.3.x - server crashes

2011-04-19 Thread 0x20h
Just a shot in the blue: Have you tried to set the 'lock' => true option in your Cache::config ? Am 19.04.2011 15:49, schrieb luke BAKING barker: > Hi I am using some controller level caching for a few actions on a > couple of cakePHP sites. both are cake1.3 sites, and are on the same > VPS, runni

Re: saveAll and validate=>only

2011-03-30 Thread 0x20h
Am 29.03.2011 19:07, schrieb euromark: > i would expect saveAll to return either true or false > but instead it returns an array with the individual results The return value depends on the 'atomic' option. You should get a boolean return value when 'atomic' is set to true (which is the default) an