Compass (SASS) with 2.0

2011-12-20 Thread Justin Edwards
Has anyone created a compass (sass) layout version of the cakephp generic css? I have been creating my own templates using compass, and they work, but I can't bake views with the template I've created without having to do a lot of work to change the view.If anyone else has already created a t

Re: Organizing Controllers into subfolders in CakePHP 2

2011-12-20 Thread José Lorenzo
I would use plugins, it is a very natural way of organizing related code into logical and reusable chunks -- 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 rela

Re: Store Plaintext Password on login

2011-12-20 Thread José Lorenzo
read $this->data in beforeFilter(), the password will be plain text there. -- 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

Re: What's all this SQL being run when running a controller unit test plan?

2011-12-20 Thread José Lorenzo
Comparing floats in PHP is super annoying, go to the line that is comparing those 2 numbers and cast both values as string. $this->assertEqual((string) $value1, (string) $value2); -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Qu

Re: What's all this SQL being run when running a controller unit test plan?

2011-12-20 Thread José Lorenzo
Those queries are generated by the fixtures in your app, those classes generate fake model data in separate tables in order to test the features safely. Although if you did not know about it, then those queries are being run on your main database!! (with a table prefix in order to preserve the

Re: What's all this SQL being run when running a controller unit test plan?

2011-12-20 Thread Yves S. Garret
One more thing, I noticed this just now. When running the tests, these are the results that I have found. - FAILED Equal expectation fails with member [0] with member [0] with member [floatvalue] at character 14 with [3.1415926535898] and [3.14159265358979] at [D:\Inetpub\wwwroot

Store Plaintext Password on login

2011-12-20 Thread succer...@tiscali.it
Hi! Have you ever faced the problem of storing password on wrong login attemps? I know that on registration i can add a "confirmation_password" field and store that password on the db in clear, but i don't need that. I need to boost up security on login brutefroce attack to (hopefully) recognize th

What's all this SQL being run when running a controller unit test plan?

2011-12-20 Thread Yves S. Garret
I am going through unit test portion of the cookbook (I am using CakePHP 1.3), I go to the test.php page and click on the controller link there and wait... Then I see a page displayed with a slew of SQL at the bottom, which I copied to show below: http://bin.cakephp.org/view/2008902189 Why is tha

Re: Organizing Controllers into subfolders in CakePHP 2

2011-12-20 Thread Miles J
Well my question is, why do you have so many controllers? Secondly, use plugins. Its basically a more advanced replacement for what you need. On Dec 20, 12:41 pm, Brad Koch wrote: > Alright, that makes sense.  Point of clarification, what's the > preferred convention on this now then?  Should yo

Re: Organizing Controllers into subfolders in CakePHP 2

2011-12-20 Thread Brad Koch
Alright, that makes sense. Point of clarification, what's the preferred convention on this now then? Should you abstain from organizing your files into subdirectories, even if it means you end up with 100 controllers in the same directory? Or is there some other recommended way of organizing the

Re: Organizing Controllers into subfolders in CakePHP 2

2011-12-20 Thread Larry E. Masters
As we are moving CakePHP closer to a version of PHP the supports namespaces the decision was made now to remove this "feature". We also started following the PSR-0 for CakePHP 2.0 and above, to comply with it we would have needed to remove them anyway. -- Larry E. Masters On Tue, Dec 20, 2011 a

Re: Organizing Controllers into subfolders in CakePHP 2

2011-12-20 Thread Brad Koch
That works, but I'm still curious as to what exactly happened to this feature, as it seemed to be widely promoted: * http://groups.google.com/group/cake-php/browse_thread/thread/95da5e676c12581c * http://cakebaker.42dh.com/2007/11/22/organizing-your-code-with-folders/ * http://holisticnetworking.ne

Re: Organizing Controllers into subfolders in CakePHP 2

2011-12-20 Thread Thiago Belem
Maybe this can help: http://book.cakephp.org/2.0/en/development/configuration.html#bootstrapping-cakephp This file is ideal for a number of common bootstrapping tasks: - Defining convenience functions. - Registering global constants. - Defining additional model, view, and controller pat

Re: Unit tests in CakePHP

2011-12-20 Thread Yves S. Garret
One more question. Can Unit Testing in CakePHP be used to test whether the layout in a browser is displayed correctly? Has anyone done this? How much success did you encounter doing this? On Tue, Dec 20, 2011 at 10:20 AM, Yves S. Garret wrote: > lol, I actually meant to do that before I forgo

Re: virtualfields + description cache

2011-12-20 Thread vekija
Did you try to set cacheSources to false in the model, as it has cacheSources property? On Dec 19, 5:48 pm, Janos Csikos wrote: > Hi All, > > I have a problem with the description caching in datasource (CakePHP > 1.3.12). Or maybe with my solution. > > My problem: > I need to count a value based

Organizing Controllers into subfolders in CakePHP 2

2011-12-20 Thread Brad Koch
In previous versions of CakePHP, you could organize Controllers into subfolders. In CakePHP 2, when I try this I encounter missing controller errors. Anyone know the reason for this? How can you enable storing controllers in subfolders in CakePHP 2? -- Our newest site for the community: CakePH

Re: comparing arrays

2011-12-20 Thread roundrightfarm
thanks, I didn't notice your change the first time around On Dec 20, 10:14 am, euromark wrote: > thats not what i was saying > you sure can > and I already gave you the answer in the previous post :) > > On 20 Dez., 17:33, roundrightfarm wrote: > > > > > > > > > Thanks, > > To make sure I'm unde

Re: comparing arrays

2011-12-20 Thread euromark
thats not what i was saying you sure can and I already gave you the answer in the previous post :) On 20 Dez., 17:33, roundrightfarm wrote: > Thanks, > To make sure I'm undersatnding correctly, you can not change the > values in an array that is being scanned by foreach, you need to send > chang

Re: schema shell for cakephp 2 - migrate new tables?

2011-12-20 Thread mikeottinger
Excellent, I'd come across this but didn't notice a port to cakephp 2.0 had been done. This is exactly what I'm looking for. 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 othe

Re: Multi-level Authorization?

2011-12-20 Thread Wendall
If I just use $this->Auth->login() the login fails. I think it's because I'm using only a passcode to log users in rather than a username/password combo. The login form only has a passcode field, no username is involved in the authentication process. I'm not sure how to get the Auth->login() met

Re: comparing arrays

2011-12-20 Thread roundrightfarm
Thanks, To make sure I'm undersatnding correctly, you can not change the values in an array that is being scanned by foreach, you need to send changes based on the scan to a new variable? This worked $weeks_prices = array(); foreach($discount_prices as $key => $discount_price){

Re: comparing arrays

2011-12-20 Thread euromark
basic php you cannot override $discount_price locally and expect it to change anything outside of the loop and the scope of this change if(!isset($discount_price)) $discount_prices[$key] = $item_prices[$key]; On 20 Dez., 16:37, roundrightfarm wrote: > The two arrays made with find() look like I

comparing arrays

2011-12-20 Thread roundrightfarm
The two arrays made with find() look like I would expect them to, but the foreach loop leaves $discount_prices (of which many have null values) unaffected. What am I missing here? //get regular prices $item_prices = $this->Item->find('list', array('fields' => array('Item.price'))

Re: HABTM example for CakeDC Search plugin

2011-12-20 Thread designv...@gmail.com
This is what I have currently: var $filterArgs = array( array('name' => 'filter', 'type' => 'query', 'method' => 'orConditions'), array('name' => 'filter', 'type' => 'subquery', 'method' => 'findByTags', 'field' => 'NewsPost.id'), ); public function findByTags($dat

Re: best use of var $uses in a controller

2011-12-20 Thread roundrightfarm
What I understand from the manual is that if the model you need to access is associated with the current controller's model, you don't need to add it to $uses. Also that you don't need to add the current controller's model to $uses unless you have added another model, in which case it becomes nece

Re: Unit tests in CakePHP

2011-12-20 Thread Yves S. Garret
lol, I actually meant to do that before I forgot :) It's 1.3. BTW, what's the difference between unit testing when in 1.3 and 2.0? On Tue, Dec 20, 2011 at 10:19 AM, euromark wrote: > you should tell us what cake version you are using :) > > On 20 Dez., 16:13, "Yves S. Garret" > wrote: > > Hey

Re: Unit tests in CakePHP

2011-12-20 Thread euromark
you should tell us what cake version you are using :) On 20 Dez., 16:13, "Yves S. Garret" wrote: > Hey guys, I'm embarking on writing some unit tests for a simple app.  I > honestly don't know what I'm doing, but am looking at the following > resources as a start: > > http://bakery.cakephp.org/ar

Unit tests in CakePHP

2011-12-20 Thread Yves S. Garret
Hey guys, I'm embarking on writing some unit tests for a simple app. I honestly don't know what I'm doing, but am looking at the following resources as a start: http://bakery.cakephp.org/articles/mariano/2007/04/13/testing-models-with-cakephp-1-2-test-suite http://book.cakephp.org/view/1200/Testi

Re: HABTM example for CakeDC Search plugin

2011-12-20 Thread designv...@gmail.com
Yep! Sure did! I was fairly sure I had followed everything correctly, but I kept getting "Operand should contain 1 column" error? I looked at debug and the 'tags' portion of the query was returning all the fields not just the id's? I think it's something to do with containable, but I couldn't fi

Re: HABTM example for CakeDC Search plugin

2011-12-20 Thread José Lorenzo
Did you read this? http://cakedc.com/downloads/view/cakephp_search_plugin -- 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

Re: Problem with transaction in version 2.0

2011-12-20 Thread Vekija
It seems that you're calling transactions methods from the model while you should call them from the datasource instance. Try something like this. $datasource = $this->StadiobingoBet->getDataSource(); $datasource->begin($this->StadiobingoBet); if($this->StadiobingoBet->saveAll($yourdata, array('

HABTM example for CakeDC Search plugin

2011-12-20 Thread designv...@gmail.com
Hi there, Has anyone got an example of how to use the CakeDC plugin to query a related habtm relationship? I have a standard posts/tags setup and want to query the tags as well as the posts. TIA d//t -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check o

Re: Problem with transaction in version 2.0

2011-12-20 Thread Matteo Landi
On 12/20, socrates wrote: > No in fact it does not solve my problem, but maybe i don't understand very > well. > This is my piece of code: > > $this->StadiobingoBet->query('SET AUTOCOMMIT = OFF'); > debug($this->StadiobingoBet->begin()); > if (!$this->StadiobingoBet->saveAll(null, array('atomic

Re: Problem with transaction in version 2.0

2011-12-20 Thread socrates
No in fact it does not solve my problem, but maybe i don't understand very well. This is my piece of code: $this->StadiobingoBet->query('SET AUTOCOMMIT = OFF'); debug($this->StadiobingoBet->begin()); if (!$this->StadiobingoBet->saveAll(null, array('atomic' => true, 'validate' => false))) { $th

Re: Problem with transaction in version 2.0

2011-12-20 Thread socrates
Yes, it seems to work correctly, but there some thing unclear! if I call Model->rollback(); the changes on the associated table were made! If something went wrong during the insert of the new row the associated model table were not modified, and it's correct. But Why if I call rollaback the chang

Re: Problem with transaction in version 2.0

2011-12-20 Thread Matteo Landi
On 12/20, socrates wrote: > I found a possible solution here! Transaction Commit and > Rollback > Tnx. Let us know if that solves your problems. Regards, Matteo > > -- > Our newest site for the community: CakePHP Video Tutorials >

Re: Problem with transaction in version 2.0

2011-12-20 Thread socrates
I found a possible solution here! Transaction Commit and Rollback Tnx. -- 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

Problem with transaction in version 2.0

2011-12-20 Thread socrates
Hello I'm alessandro, and i'm working on a software that need in some case to use transaction. I have configured my mysql to start with Innodb as default engine, my table are all with InnoDb engine, and i try to use Model->saveAssociated() to start a transaction (i pass the $option with 'atomic' se

Re: Question about routing

2011-12-20 Thread jmail
No there is no reason - I didn't knew about it. So if I understand I can do something like that Configure::write('Routing.prefixes', array('admin')); Router::connect('/{$prefix}/:controller/:action', array('controller' => "{$prefix}".:controller)); right? I am new to CakePHP but I've got expe

Re: CakePHP 2.0 and Form Wizard

2011-12-20 Thread Clint
Thanks Sam. I had to execute the command from the main directory containing the cake code and then it found the plugin. Upgrade worked, still had some errors but they were the same issues I had when getting it to run in 1.3 Turns out I was on the right path originally when modifying the files b