Any way to determine cake's memory usage?

2008-02-02 Thread keymaster
In a mid-size app I just upgraded from 1.1.19 to 1.2 beta, I am running out of memory (the 8M PHP limit). This is occuring on searches which return more than 10-15 products. The results returned by the search are only around 300Kb, so it doesn't seem like the search results themselves are what i

Can you paginate a hasMany ?

2008-02-02 Thread salimk786
I have two models: class Store extends AppModel { var $name = 'Store'; var $belongsTo = array('Storeregion'); } class Storeregion extends AppModel { var $name = 'Storeregion'; var $hasMany = 'Store'; } A region can have many stores. Here is an example: Array ( [

Re: use different model in different controller.

2008-02-02 Thread keymaster
Don't use $uses, ever. It is terrible for performance. Always access models through their associations, ie. $this->model1- >model2->find(); If you don't have any associations to the model you want, use the following before accessing your model: App::import('Model', 'Product'); $tmpProduct = new

Re: How to create RSS feeds in 1.2?

2008-02-02 Thread nate
http://cake.insertdesignhere.com/posts/view/8 On Feb 2, 11:49 pm, Action <[EMAIL PROTECTED]> wrote: > Is there any documentation on how RSS feeds are created in 1.2? I just > need to see an example, but I can't seem to find one anywhere... --~--~-~--~~~---~--~~ You

How to create RSS feeds in 1.2?

2008-02-02 Thread Action
Is there any documentation on how RSS feeds are created in 1.2? I just need to see an example, but I can't seem to find one anywhere... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this

Re: Accessing cake session from outside

2008-02-02 Thread brian_gaff
Let me know if it works, i'm curious myself. On Feb 1, 5:58 am, Paolo <[EMAIL PROTECTED]> wrote: > Thank you very much, I'll try that. > > On 31 Gen, 06:29, brian_gaff <[EMAIL PROTECTED]> wrote: > > > Now that I think about it, it's a little harder. > > > Firstly, if you're storing your session

Re: use different model in different controller.

2008-02-02 Thread brian_gaff
Anupom has already told you the correct way to do it; however, if you really really want to do it like: $this->Category->find(); Then you need to add this line to the top of your Products controller: var $uses = array('Product', 'Category'); BRIAN On Feb 1, 11:47 pm, Rgarg <[EMAIL PROTECTE

Re: use different model in different controller.

2008-02-02 Thread Anupom
Try this $this->set('data', $this->Product->Category->findAllThreaded(null, null, 'parent_id')); $CategoryArray = $this->Product->Category->generateList(null, 'parent_id'); $this->set('CategoryArray', $CategoryArray); On Feb 2, 2008 1:47 PM, Rgarg <[EMAIL PROTECTED]> wrote:

Re: Open Source PHP Encoder Suitable for CakePHP

2008-02-02 Thread Baz
I haven't had much success with the normal tools out there, with more than stripping whitespace. I guess all those $this->set's don't really like getting encoded. On Feb 2, 2008 1:10 AM, rayhan <[EMAIL PROTECTED]> wrote: > > Dear expart, > >I am looking fo a source code encoder for my CakePHP

Re: Display form validation error troubles

2008-02-02 Thread EchoChargen
Maybe if you post some of the code, someone will have some suggestions. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe

Re: What is the Better MVC Practice?

2008-02-02 Thread chad
Neil - you're right on, put that logic in the model, that way it can be reused if you need it elsewhere and changed in one place. On Feb 2, 9:53 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On Feb 2, 2008 9:35 PM, Neil <[EMAIL PROTECTED]> wrote: > > > > > I want to count some data from my

Re: Display form validation error troubles

2008-02-02 Thread Neil
thanks for the suggestions. I tried to handle the comment validation in my Post model however this does not work. It simply ignore all the validation rules. When I handle validation in the Comment model everything works, it just does not show the errors. any other suggestions? On Feb 2, 10:39 a

Re: ACL Table Creation

2008-02-02 Thread david_setwise
Thanks! I figured it was in the code somewhere but I only looked in the cake folder, rather than the app folder. Finally I can keep going on figuring out this ACL stuff. David On Feb 2, 4:23 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote: > check inside the config/sql/ > > for db_acl.sql > > run

Re: Help with data validation...

2008-02-02 Thread Siebren Bakker
'verufy' => array( 'rule' => array('identicalFields', 'password'), 'message' => 'Passwords must match' ) after the validate array have this: /*function to make sure that 2 entered fields are identical*/ function

Re: Segmentation fault on baking controller

2008-02-02 Thread Doug @ Straw Dogs
I've found the solution to this: You must build the models and controllers for 'parent' tables (those that haveMany) before you build their childrens controllers. On Feb 3, 12:08 am, "Doug @ Straw Dogs" <[EMAIL PROTECTED]> wrote: > On Cake 1.2 beta:: > > When I bake a controller that has belongs

Re: ACL Table Creation

2008-02-02 Thread Sam Sherlock
check inside the config/sql/ for db_acl.sql run that through phpmyadmin On 02/02/2008, david_setwise <[EMAIL PROTECTED]> wrote: > > > Hi bakers, > > I do not have access to the console because I am working in a shared > environment. I am sure others have this issue. Can someone please > post t

Segmentation fault on baking controller

2008-02-02 Thread Doug @ Straw Dogs
On Cake 1.2 beta:: When I bake a controller that has belongsTo associations I get a segmentation fault. This gets printed to the screen after asking the creation questions. Specifically "Would you like to create the methods for admin routing". Any ideas? :( --~--~-~--~~--

ACL Table Creation

2008-02-02 Thread david_setwise
Hi bakers, I do not have access to the console because I am working in a shared environment. I am sure others have this issue. Can someone please post the SQL to create the three ACL tables for v1.2? Thanks, David --~--~-~--~~~---~--~~ You received this message

Re: Fatal error: Call to a member function schema() on a non-object

2008-02-02 Thread AD7six
On Feb 2, 4:22 pm, "Doug @ Straw Dogs" <[EMAIL PROTECTED]> wrote: > I'm having loads of problems using bake in 1.2 beta. The above error > ("Fatal error: Call to a member function schema() on a non-object") > occurs when I attempt to bake a view for my tables called "apps". > > It has multiple

Re: Determining and setting dev/staging/live database connection in a Shell script

2008-02-02 Thread AD7six
On Feb 2, 7:24 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > In a shell the SERVER_NAME environment variable isn't set, so if > DATABASE_CONFIG relies on it then the connection won't be made. How enlightening ;). So regarding the answer to my question (of why you were relying on the host

Re: Newbie Question about Cake

2008-02-02 Thread [EMAIL PROTECTED]
instead of http://localhost try http://localhost/ On Feb 2, 6:41 am, "David H. Trang" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm currently new to CakePHP and PHP in general. > > I currently have Apache , PostGres, PHP set up and working correctly. > I also have CakePHP setup and working correctly b

Re: Determining and setting dev/staging/live database connection in a Shell script

2008-02-02 Thread [EMAIL PROTECTED]
In a shell the SERVER_NAME environment variable isn't set, so if DATABASE_CONFIG relies on it then the connection won't be made. On Feb 2, 4:25 am, AD7six <[EMAIL PROTECTED]> wrote: > On Feb 2, 10:04 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > My solution is to abandon the DATABASE

Re: missing_layout.ctp

2008-02-02 Thread Tapos Pal
Make your own layout and named it default.thtml the put it in the views/layout folder. Hope this will solve your problem. On Feb 2, 2008 12:25 AM, Feris Thia <[EMAIL PROTECTED]> wrote: > > Hi All, > > I try to add missing_layout.ctp and succeed to display the replacement > for error messages. Th

Re: What is the Better MVC Practice?

2008-02-02 Thread Dr. Tarique Sani
On Feb 2, 2008 9:35 PM, Neil <[EMAIL PROTECTED]> wrote: > > I want to count some data from my database and then display the amount > in my view. > From reading the manual I would think the proper MVC was would be to > make a function in my Model that counts the records in the field and > then use

What is the Better MVC Practice?

2008-02-02 Thread Neil
I want to count some data from my database and then display the amount in my view. >From reading the manual I would think the proper MVC was would be to make a function in my Model that counts the records in the field and then use the controller to send the result of that Model function to my view

Re: Display form validation error troubles

2008-02-02 Thread EchoChargen
Neil - I am new Cake user, but I was able to get validation working with forms for different models. By setting the error messages in the model. Here's a snip from my User model: 'city' => array( 'required' => array( 'rule' =

Re: Baked Views have no fields...

2008-02-02 Thread Doug @ Straw Dogs
This is on version 1.1 - the currently available stable download. The pattern appears to be: Any table of two words like "widget_types" or "incoming_calls" fails to bake views with fields. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are

Fatal error: Call to a member function schema() on a non-object

2008-02-02 Thread Doug @ Straw Dogs
I'm having loads of problems using bake in 1.2 beta. The above error ("Fatal error: Call to a member function schema() on a non-object") occurs when I attempt to bake a view for my tables called "apps". It has multiple relationships to other tables. Mainly "hasMany" relationships. I've created

Re: Determining and setting dev/staging/live database connection in a Shell script

2008-02-02 Thread AD7six
On Feb 2, 10:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > My solution is to abandon the DATABASE_CONFIG constructor logic that > uses HTTP_SERVER. Instead I'm doing svn ignore on database.php and > changing the values in the three different installations. I'm curious to know what one

no error option for a select form element

2008-02-02 Thread Carl
I have a client who has a select element and a requirement that the user actually make a selection from the drop down list of options. I checked the form->select part of the API and there is no 'error' option as there is for say the input element. How do I take advantage of the 1.2 validation capa

Re: CLOB in cakephp 1.2

2008-02-02 Thread Tristan
Nik we have been using your behavior and were getting errors when going through foreach($this->model->_schema->value as $key => $value) { ... } it appeared $this->model->_schema->value is not a valid array (did not exist for us), we removed the "->value" part and it worked just fine. Thanks a lo

Re: Debugger stuck in a loop

2008-02-02 Thread Bryn
I have found similar infinite recursion problems anytime there is a php notice thrown. I've been able to work around it by disabling the debugger from handling phps error handling I put define("DISABLE_DEFAULT_ERROR_HANDLING", true); temporarily in debugger.php until this is fixed but you could

Open Source PHP Encoder Suitable for CakePHP

2008-02-02 Thread rayhan
Dear expart, I am looking fo a source code encoder for my CakePHP application. Please help me on this topic. Sincerely, Md. Rayhan Chowdhury --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" gro

HTML Helper - flash support

2008-02-02 Thread Ata Alqadi
Hello, I needed to use flash files in my site, so i wrote the following function: function flash($path, $name, $width, $height, $scale = "exactfit", $wmode = "transparent"){ if (is_array($path)) { $path = Router::url($path); } elseif ($path{0} === '/') {

index.php not defaulting

2008-02-02 Thread David H. Trang
I'm having problems with my index.php. I have not touched it at all but everytime I go to http://localhost it gives me the directory of files instead of just opening index.php for me. Is there something in the httpd.conf that I'm forgetting to edit? I have changed so that DocumentIndex is index.ht

Newbie Question about Cake

2008-02-02 Thread David H. Trang
Hi, I'm currently new to CakePHP and PHP in general. I currently have Apache , PostGres, PHP set up and working correctly. I also have CakePHP setup and working correctly but for some reason when I try to go to http://localhost I see my directory instead of it going to index.php. I have changed

Multiple Schemas in PostgreSQL

2008-02-02 Thread Prozac
Hi, im new at this group and also kind of new using cakePHP, im having a problem with an app im working on with multiple schemas. Now, in this app there are tables relations between schemas, at first i thought i could use a different connection for each schema, but that didn't work. I found in

Re: Determining and setting dev/staging/live database connection in a Shell script

2008-02-02 Thread [EMAIL PROTECTED]
My solution is to abandon the DATABASE_CONFIG constructor logic that uses HTTP_SERVER. Instead I'm doing svn ignore on database.php and changing the values in the three different installations. On Feb 2, 2:26 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Anyone know how to do this? I'm cur

Determining and setting dev/staging/live database connection in a Shell script

2008-02-02 Thread [EMAIL PROTECTED]
Anyone know how to do this? I'm currently determining the database connection with a DATABASE_CONFIG constructor based on the host name and need an explicit way to set it with the 'cake' shell startup command since DATABASE_CONFIG won't have access to env('HTTP_SERVER'). I envision it looking lik