Re: Changing global layout - this problem is different from the rest of the problems reported on this group
Hi bingo I initially thought of doing that..but there are some problem. Let me explain you my scenario. Perhaps the better approach would be to put the layout at the start of the url as people do with language like this: /en/us/controller/action I think that modrewrite is then used to work everything out. If you search this group for info about language and modrewrite I am sure that you will find some answers. I have no experience with this myself, so can't elaborate further. Regards, Langdon --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Changing global layout - this problem is different from the rest of the problems reported on this group
Hi Langdon, I think I am able to do what you suggested...but now the problem is that I can't have two windows having different layout. If I want to manage information specific to particular window, where it should be stored. I am not an expert of session or cookie and have only information that cookie is save on client side whereas session is saved on server side. But are both shared between windows ? Regards, On Mar 7, 1:52 am, Langdon Stevenson [EMAIL PROTECTED] wrote: Hi bingo If the user has to choose the layout why not just give them a link or button to a controller that sets the chosen layout and stores the result? They click once and the value is set, and you just check the session on each request. This seems easier to me than always having to interrogate the URL to see if there is layout info in there. I expect that it would get very messy if you pass variables to the controller as well. Regards, Langdon I want users to have an option to select layout. More specifically, each user will have an option to select one of the layout from three different layout choices. snip --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange findAll Result with complex query
Hi Zoltan Thank you. But do you know a workarround for this: $fieldArray = array('id', 'prev', 'filename', 'fileExtension','folder',if(fileExtension='0', filename, concat(filename, '.', fileExtension)) AS fullfilename); $fileData = $this-controller-$controllerName-findAll(id=$id, $fieldArray); $queryArray = array( $controllerName.id = != $id, $controllerName.folder = 0, $controllerName.prev = $fileData[0][$controllerName][prev] ,having = array(fullfilename = skyline.jpg) ); $findOther = $this-controller-$controllerName- findAll($queryArray, $fieldArray); I dont know how to access 'fullfilename', defined in the AS statement. Using it as showed in the example i dont get any result. Thanks Aldo On Mar 6, 10:58 pm, Zoltan [EMAIL PROTECTED] wrote: I had this problem a while back too - I believe it has to do with a join occurring (the 'having' part?). There isn't really a way to get around this AFAIK, and I think it was explained as a feature to me more so than a 'bug'. Zoltanwww.yyztech.ca On Mar 6, 2:16 pm, Aldo [EMAIL PROTECTED] wrote: Hello I'm getting a strange result with the following configuration in my component: $fieldArray = array('id', 'prev', 'filename', 'fileExtension','folder',if(fileExtension='0', filename, concat(filename, '.', fileExtension)) AS fullfilename); $fileData = $this-controller-$controllerName-findAll(id=$id, $fieldArray); $queryArray = array( $controllerName.id = != $id, $controllerName.folder = 0, $controllerName.prev = $fileData[0][$controllerName][prev] ,having = array($controllerName.filename = skyline.jpg) ); $findOther = $this-controller-$controllerName-findAll($queryArray, $fieldArray); Result of $findOther: Array ( [0] = Array ( [Treeview] = Array ( [id] = 15 [prev] = 1 [filename] = nyc_skyline.jpg [fileExtension] = 0 [folder] = 0 ) [0] = Array ( [fullfilename] = skyline.jpg ) ) ) Why the 'fullfilename' field is not showed in the 'Treeview' array? Thanks for any help. Aldo --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Changing global layout - this problem is different from the rest of the problems reported on this group
hi Langdon, so is there a way to store variables that are specific to particular window. I search through groups and there were some mention about application specific variables. But I didn't find much information about application specific variable. I think, I want to give user flexibility to open two different windows with two different layouts? Is that possible. Regards On Mar 7, 3:20 am, Langdon Stevenson [EMAIL PROTECTED] wrote: Hi bingo snip I am not an expert of session or cookie and have only information that cookie is save on client side whereas session is saved on server side. But are both shared between windows ? Yes, both should be shared between multiple windows. Regards, Langdon --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions problem
Yep! They're the same... The phpinfo() shows the php.ini info, plus a couple more stuff... You don't have acess to php.ini? Well...let's see what we can do... First of all, you can force manually the session start...how? Like this: session_start(); $_SESSION['car'] = 'Dodge Charger R/T'; This code, placed on your controller, starts the session and stores a session variable named car with value Dodge Charger R/T. Then you, when you're done you can kill the session with: session_destroy(); And that should do it... Good luck! On Mar 6, 10:39 am, bingo [EMAIL PROTECTED] wrote: Hi, I checked my phpinfo() details and over there it shows session_cookie_lifetime = 0. Is this the same cookie_lifetime you were talking off or is there some other...I don't have access to php.ini file.. Regards, bingo On Mar 6, 5:24 am, mindcharger [EMAIL PROTECTED] wrote: Hi, To make the session time longer go to php.ini and set session.cookie_lifetime to 0 that means (keep session alive until browser is closed)... As for security risks...I think you can answer that for yourself...if there wasn't risk, there would be no session...:-) The rule: Longer Sessions, Less Security As for gmail, I don't know how it works, but I think it must do some sort of session renewal... Good luck On Mar 5, 2:39 pm, bingo [EMAIL PROTECTED] wrote: I have a similar problem.once I login successfully and if there is no activity, the session exprires automatically after few minutes.. Does it mean, I need to increase session.gc_maxlifetime . What should be the value if I want session remain active indefinitely...and what are the security risks with that...I am wondering how my gmail session always remain active... looking forward for some insights regards, bingo On Mar 3, 8:09 am, mindcharger [EMAIL PROTECTED] wrote: Hello, Do you the PHP Sessions active? This is not CAKESession, is PHPSession. To check if you have the PHP Sessions active go to your php.ini file, find the 'Session' section and check for something like this: session.auto_start = 1 //This will turn on thesessionsession.gc_maxlifetime = 1440 // this is th # of seconds your data will remain insessionsession.cache_expire = 180 // this is the # of minutes after wich your document will expire These are the things I believe that can go wrong with your description... Good luck! On Mar 2, 7:07 pm, jamiro [EMAIL PROTECTED] wrote: hi , I have a problem in the handling of sessions, my configuration in core.php is: define('CAKE_SESSION_SAVE', 'php'); define('CAKE_SECURITY', 'medium'); now my problem is when refresh the page (or change the page), my sessionid changes and I cannot read the stored thing previously: here an example of my situation: file: a_controller.php function index($id=1) { $this-Session- write('estandar', $id);} file: b_controller.php function index() { $estandarSession=$this-Session- read('estandar');} $estandarSession receives nothing... some suggestion? thanks sorry for my terrible english ...- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
File download authorization
Hello, I have created a site that works with the oth authentication. I have a media directory that contains medias that only authenticated users should download. I have created a controller wich read the directory (through the Folder class) and a view that publish the file contents. Now, how can i limit the download to the authenticated users only? Security by hiding the files is no security. If i put an .htaccess in the media directoy can stop the downloads but for everyone. And i dont want to add an extra .htaccess login mechanism. Maybe someone has already solved that problem and can point me in the right direction :-) --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Thesis ideas
ERPs are great for large to mid-size companies, but it's not a solution for a small companies (like mine) who may want something more flexible than QickBooks, but far less involved than and an ERP. That middle ground is completely missing in the OpenSource accounting app market. That's my take. Agreed. I haven't been impressed with the opensource ERP systems that I have seen. And then there is the matter of localisation for tax rules. All in all, its a difficult product/problem. Regards, Langdon --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions problem
Hi mindcharger, Thanks for the information. I will give it a try. For now, I tried playing with Cake_Session_Save and Security. I modified Cake_Session_Save to database and security to medium. These changes solved my current problems. Regards, Ritesh On Mar 7, 3:44 am, mindcharger [EMAIL PROTECTED] wrote: Yep! They're the same... The phpinfo() shows the php.ini info, plus a couple more stuff... You don't have acess to php.ini? Well...let's see what we can do... First of all, you can force manually the session start...how? Like this: session_start(); $_SESSION['car'] = 'Dodge Charger R/T'; This code, placed on your controller, starts the session and stores a session variable named car with value Dodge Charger R/T. Then you, when you're done you can kill the session with: session_destroy(); And that should do it... Good luck! On Mar 6, 10:39 am, bingo [EMAIL PROTECTED] wrote: Hi, I checked my phpinfo() details and over there it shows session_cookie_lifetime = 0. Is this the same cookie_lifetime you were talking off or is there some other...I don't have access to php.ini file.. Regards, bingo On Mar 6, 5:24 am, mindcharger [EMAIL PROTECTED] wrote: Hi, To make the session time longer go to php.ini and set session.cookie_lifetime to 0 that means (keep session alive until browser is closed)... As for security risks...I think you can answer that for yourself...if there wasn't risk, there would be no session...:-) The rule: Longer Sessions, Less Security As for gmail, I don't know how it works, but I think it must do some sort of session renewal... Good luck On Mar 5, 2:39 pm, bingo [EMAIL PROTECTED] wrote: I have a similar problem.once I login successfully and if there is no activity, the session exprires automatically after few minutes.. Does it mean, I need to increase session.gc_maxlifetime . What should be the value if I want session remain active indefinitely...and what are the security risks with that...I am wondering how my gmail session always remain active... looking forward for some insights regards, bingo On Mar 3, 8:09 am, mindcharger [EMAIL PROTECTED] wrote: Hello, Do you the PHP Sessions active? This is not CAKESession, is PHPSession. To check if you have the PHP Sessions active go to your php.ini file, find the 'Session' section and check for something like this: session.auto_start = 1 //This will turn on thesessionsession.gc_maxlifetime = 1440 // this is th # of seconds your data will remain insessionsession.cache_expire = 180 // this is the # of minutes after wich your document will expire These are the things I believe that can go wrong with your description... Good luck! On Mar 2, 7:07 pm, jamiro [EMAIL PROTECTED] wrote: hi , I have a problem in the handling of sessions, my configuration in core.php is: define('CAKE_SESSION_SAVE', 'php'); define('CAKE_SECURITY', 'medium'); now my problem is when refresh the page (or change the page), my sessionid changes and I cannot read the stored thing previously: here an example of my situation: file: a_controller.php function index($id=1) { $this-Session- write('estandar', $id);} file: b_controller.php function index() { $estandarSession=$this-Session- read('estandar');} $estandarSession receives nothing... some suggestion? thanks sorry for my terrible english ...- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Changing global layout - this problem is different from the rest of the problems reported on this group
Hi bingo flexibility to open two different windows with two different layouts? Is that possible. No idea sorry. Perhaps through the URL would be the best way. Regards, Langdon --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Different Validations on 1 Table (Model) Based on the Action
On 3/7/07, cecplex [EMAIL PROTECTED] wrote: What if I have 15 fields and I only want 2 of them validated. Is there no construct available to let me validate a specific set of fields? Did you try out validating anything? CakePHP will validate only those fields which are provided to it Cheers Tarique -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog: http://cheesecake-photoblog.org = --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Different Validations on 1 Table (Model) Based on the Action
This overrides built-in validates and allows you to pass an array of field names that you want to check. Pretty much like the one above but I didn't like how that one permanently changed the fields that were set for model-validate. Bonus would be to make it so you could change the rules by passing an assoc array of new rules. function validates($fields = null) { if (is_array($fields) count($fields)) { $validate = $this-validate; $ignore = array_diff(array_keys($this-validate), $fields); foreach ($ignore as $field) { unset($this-validate[$field]); } $return = parent::validates(); $this-validate = $validate; return $return; } else { return parent::validates(); } } if ($this-User-validates(array('user', 'password'))) { // Check login } On Mar 6, 3:42 pm, Mariano Iglesias [EMAIL PROTECTED] wrote: On the User model class add a function like: function validateFields($fields) { $ignore = array_diff(array_keys($this-validate), $fields); foreach($ignore as $field) { unset($this-validate[$field]); } } You could also instead move this function to AppModel so you can have it available for other models. Then on your controller: $this-User-validateFields(array('user', 'password')); if ($this-User-set($this-data) $this-User-validates()) { // Check login } -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog:http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de cecplex Enviado el: Martes, 06 de Marzo de 2007 08:15 p.m. Para: Cake PHP Asunto: Re: Different Validations on 1 Table (Model) Based on the Action What if I have 15 fields and I only want 2 of them validated. Is there no construct available to let me validate a specific set of fields? --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File download authorization
I think you should make your files hidden or not accessible by web (with the help of .htaccess) and then make a controller that will return the file's data (with a new layout of course) which will return the file's mime and other good headers you like to send. the auth code should be on that controller too i don't know if there are performance issues with this method but it is a sulotion On Mar 7, 10:32 am, Alain Martini [EMAIL PROTECTED] wrote: Hello, I have created a site that works with the oth authentication. I have a media directory that contains medias that only authenticated users should download. I have created a controller wich read the directory (through the Folder class) and a view that publish the file contents. Now, how can i limit the download to the authenticated users only? Security by hiding the files is no security. If i put an .htaccess in the media directoy can stop the downloads but for everyone. And i dont want to add an extra .htaccess login mechanism. Maybe someone has already solved that problem and can point me in the right direction :-) --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
cached queries
HI, I have a hmabm relationship between two objects, product and category, the product controller collects multiple new objects via. a soap interface an inputs them into the database including the categories they belong to, there is a request action for each category within a product to check if the category exists, if it does it returns the id of the category, if it doesn't it creates the category then returns the id. The issue I have is that when entering multiple products in one request the database queries seem to be cached and the same category get entered multiple times rather than returning the id of the category created previously in the same request. How do I stop cake caching the database queries ? thanks -- chris third --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cake Recipes cancelled
Today I found a new post on h3rald.com, Fabio Cevasco's blog. http://www.h3rald.com/blog/view/42 It seems that the book will never come out and I'm really disappointed. I tought that it would be a great deal for Cake. For me (and I believe a lot of other people) buying a book and learning from it is much more productive than reading fragmented articles on the bakery or digging in the google group. So...I hope that something can still change and I'm really interested on hearing the position of the Cake Software Foundation simone --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unique subdomain for each user
Brian, is this after you did your apache setup? On Mar 6, 2:01 pm, Brian French [EMAIL PROTECTED] wrote: I'm dealing with his now. the way i have figured it out is to check the domain in the app_controller.php's beforeFilter() method. Then look up that user info based on the domain and save the user's info in the session. Then in your other controllers you do: $this-model-findAll(model.user_id='.$this-Session- read('User.id').'); There may be a better way, but this seems to work the best for me. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
afterSave callbacks
Hi, Have a really simple problem and wonder if someone can give me some advice. The problem is as follows: I want to add item, price and quantity into a table but I also want the total price (i.e. price*qty) to be inserted into the same row. I have played with afterSave callbacks in the model but I can get it working. Can anyone give me some advice and am I going about it the right way. Thanks Mike. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Recipes cancelled
On 3/7/07, kinto [EMAIL PROTECTED] wrote: So...I hope that something can still change and I'm really interested on hearing the position of the Cake Software Foundation +1 to that - I too was looking forward to the book Tarique -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog: http://cheesecake-photoblog.org = --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: email form
Mariano Iglesias írta: I use WinMerge (since I'm on a XP box): http://winmerge.org/ With it you open the original file on one side, the modified on another, and it generates the .patch file. I use linux, and I think eclipse can make patch and there is a program diff, what can generate patches. diff -up old.php new.php file.patch -- Ámon Tamás http://linkfelho.amon.hu --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange findAll Result with complex query
You should access it like: $fileData[INDEX_HERE][0][fullfilename][prev] like a: $fileData[0][0][fullfilename][prev] On 7 мар, 16:11, Aldo [EMAIL PROTECTED] wrote: Hi Zoltan Thank you. But do you know a workarround for this: --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange findAll Result with complex query
Yes, this way I get the value. But building the query cake seams not to find the column 'fullfilename' and not build the 'HAVING' right. the finished sql query should look like this: select id, prev, filename, fileExtension if(fileExtension='0', filename, concat(filename, '.', fileExtension)) AS fullfilename from treeview where id!=58 AND folder=0 AND prev=1 HAVING fullfilename = 'skyline.jpg' But like showed in the post before this part of the statement in cake seams to cause an error: having = array(fullfilename = skyline.jpg) So the problem is not getting the value of 'fullfilename', it's setting the filed 'fullfilename'. Any idea? Thanks! On Mar 7, 1:26 pm, Sergei [EMAIL PROTECTED] wrote: You should access it like: $fileData[INDEX_HERE][0][fullfilename][prev] like a: $fileData[0][0][fullfilename][prev] On 7 мар, 16:11, Aldo [EMAIL PROTECTED] wrote: Hi Zoltan Thank you. But do you know a workarround for this: --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email problem
Same problem here. The variables I set in a controller action with $this-set('foo', 'bar'); are not available in the view which is rendered by the EmailComponent (the viewVars array is empty) It looks like that after rendering the mail template: bNotice/b (8)/a: Undefined variable: username [bCORE/app/ views/elements/email/text/user/activation.ctp/b, line b1/b] (I used this tutorial from the bakery: http://bakery.cakephp.org/articles/view/203) Ideas to solve this, anyone? On 16 Feb., 21:45, Toby Parent [EMAIL PROTECTED] wrote: Now I'm trying to figure out why variables set in my controller aren't available to myemail. Wondering if I'm somehow unsetting them somewhere else... --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems with hasAndBelongsToMany
I believe that would be the best approach. Then you would just have to do one save, using the joining table for the current record. And of course using that method, there could be any number of fields in the joining table. On Mar 6, 8:23 am, Grant Cox [EMAIL PROTECTED] wrote: To have more than just the two foreign ids, then you need a join model in the middle. There was word that the HABTM relationship will be extended to allow this to be through a model, but I don't think this is implemented yet. In the meantime, you need to make the middle model and associate it yourself - ie: Profile hasMany EventProfile Event hasMany EventProfile EventProfile belongsTo Profile,Event this EventProfile will be a new model, which uses your join table, and can have whatever additional data it likes. You will then need to manage creating/removing these joins in your application yourself. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unique subdomain for each user
You can setup Apache to accept multiple domains/subdomains for a virtual host. You will need to setup apache to use virtual hosts, read the Apache documentation here: http://httpd.apache.org/docs/2.0/vhosts/name-based.html Then you can set up a virtual host with your base domain name and add an alias with a subdomain wildcard. Something like this: ServerName domain.tld ServerAlias *.domain.tld After that, use mod_rewrite rule to rewrite the URL and append the subdomain to your URL's before it is passed to Cake rewrite rules. By the way, Apache can't just accept subdomains by itself, you will still need to have the DNS entries for the sub domains set up correctly. So in order for you to be able to create users on the fly you will need a DNS server that can either accept the *.domain.tld wildcard and return the correct entry or have some other method to set the entry automatically for each username.domain.tld Hope this helps. - barduck On Mar 6, 8:09 pm, phirschybar [EMAIL PROTECTED] wrote: This is probably just an apache question but I figure somebody in the group would know the answer... My app needs to work so that username.appdomain.com maps to appdomain.com/username/controller/action/.. Is this a simple apache setup trick? Users need to be able to create accounts themselves so I cannot do manual httpd.conf edits for each user... Thoughts? --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
HABTM search with condition on each table
Hey I've had a bit of a nosey around and can't seem to find the answer to my problem. I have two tables ( cars, products) and a join table ( cars_products) all set up with a HABTM relationship using bake.php. I want to be able to return a set of results from products that are related to a particular car and also filtered by another field in products. $the code that i'm using is: $conditions = array ( 'Car.id' = $carId, 'Product.category_id' = $categoryId ); $this-set ( 'productList', $this-Product-findAll ( $conditions ) ); which just outputs SQL Error in model Product: 1109: Unknown table 'Car' in where clause I have tried it the other way around and i just get warned that Product is an unknown table. I'm sure I am missing something as this is a fairly simple query to do with pure SQL --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Different Validations on 1 Table (Model) Based on the Action
That sounds familiar ;) I wouldn't override validates, as on CakePHP 1.1 the parameter to validates() has a different meaning to the one you are using, while in 1.2 validates() is supposed to take no parameters ($data parameter is deprecated.) I think it'd be better to have it as a separate function (something like expects()) Also it wouldn't hurt to back the validation rules and restore after validation. Once again, on AppModel: function validateFields($fields) { if (!isset($this-__backValidateRules)) { $this-__backValidateRules = array(); } $ignore = array_diff(array_keys($this-validate), $fields); foreach($ignore as $field) { $this-__backValidateRules[$field] = $this-validate[$field]; unset($this-validate[$field]); } } function validates($param) { $validates = parent::validates($param); if (isset($this-__backValidateRules)) { foreach($this-__backValidateRules as $field = $rule) { $this-validate[$field] = $rule; } $this-__backValidateRules = array(); } return $validates; } So this way after validation is performed rules are restored to their original state. PS: Note that I'm not doing anything with validates() parameter, I'm just passing it through. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de scragz Enviado el: Miércoles, 07 de Marzo de 2007 06:56 a.m. Para: Cake PHP Asunto: Re: Different Validations on 1 Table (Model) Based on the Action This overrides built-in validates and allows you to pass an array of field names that you want to check. Pretty much like the one above but I didn't like how that one permanently changed the fields that were set for model-validate. Bonus would be to make it so you could change the rules by passing an assoc array of new rules. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: afterSave callbacks
Mike, Can I respectfully ask you that you provide more information as to why you can't get it working? It makes us waste emails to keep explaining that there's no easy way to tell what is wrong when you don't even tell us what's not working. So instead of just saying something doesn't work, show us what you wanted to do, how you were trying to do it (source code) and why you think it is not working (error message, queries sent to the database that you think are wrong, etc. etc.) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de mike Enviado el: Miércoles, 07 de Marzo de 2007 08:11 a.m. Para: Cake PHP Asunto: afterSave callbacks The problem is as follows: I want to add item, price and quantity into a table but I also want the total price (i.e. price*qty) to be inserted into the same row. I have played with afterSave callbacks in the model but I can get it working. Can anyone give me some advice and am I going about it the right way. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Recipes cancelled
On 3/7/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On the blogpost i read some negative comments towards the authors of cakephp. Which comment in particular? There are somethings which can be inferred as negative about Cake Foundation in the post itself but I did not find anything in the comments... Tarique -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog: http://cheesecake-photoblog.org = --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Recipes cancelled
It is true, the book deal between the Cake Software Foundation, Fabio Cevasco, and Peachpit Press has been cancelled. This decision was unanimously reached by all members of the CSF as well as other members of the community who where involved in peer review. In short, we were dissatisfied with the direction the project was taking, and the inadequate way in which the framework was being represented. However, this absolutely does not mean that there will be no CakePHP book. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions problem
In my case my solution was: define('CAKE_SESSION_SAVE', ''); Is a good solution? thanks. On 7 mar, 03:52, bingo [EMAIL PROTECTED] wrote: Hi mindcharger, Thanks for the information. I will give it a try. For now, I tried playing with Cake_Session_Save and Security. I modified Cake_Session_Save to database and security to medium. These changes solved my current problems. Regards, Ritesh On Mar 7, 3:44 am, mindcharger [EMAIL PROTECTED] wrote: Yep! They're the same... The phpinfo() shows the php.ini info, plus a couple more stuff... You don't have acess to php.ini? Well...let's see what we can do... First of all, you can force manually the session start...how? Like this: session_start(); $_SESSION['car'] = 'Dodge Charger R/T'; This code, placed on your controller, starts the session and stores a session variable named car with value Dodge Charger R/T. Then you, when you're done you can kill the session with: session_destroy(); And that should do it... Good luck! On Mar 6, 10:39 am, bingo [EMAIL PROTECTED] wrote: Hi, I checked my phpinfo() details and over there it shows session_cookie_lifetime = 0. Is this the same cookie_lifetime you were talking off or is there some other...I don't have access to php.ini file.. Regards, bingo On Mar 6, 5:24 am, mindcharger [EMAIL PROTECTED] wrote: Hi, To make the session time longer go to php.ini and set session.cookie_lifetime to 0 that means (keep session alive until browser is closed)... As for security risks...I think you can answer that for yourself...if there wasn't risk, there would be no session...:-) The rule: Longer Sessions, Less Security As for gmail, I don't know how it works, but I think it must do some sort of session renewal... Good luck On Mar 5, 2:39 pm, bingo [EMAIL PROTECTED] wrote: I have a similar problem.once I login successfully and if there is no activity, the session exprires automatically after few minutes.. Does it mean, I need to increase session.gc_maxlifetime . What should be the value if I want session remain active indefinitely...and what are the security risks with that...I am wondering how my gmail session always remain active... looking forward for some insights regards, bingo On Mar 3, 8:09 am, mindcharger [EMAIL PROTECTED] wrote: Hello, Do you the PHP Sessions active? This is not CAKESession, is PHPSession. To check if you have the PHP Sessions active go to your php.ini file, find the 'Session' section and check for something like this: session.auto_start = 1 //This will turn on thesessionsession.gc_maxlifetime = 1440 // this is th # of seconds your data will remain insessionsession.cache_expire = 180 // this is the # of minutes after wich your document will expire These are the things I believe that can go wrong with your description... Good luck! On Mar 2, 7:07 pm, jamiro [EMAIL PROTECTED] wrote: hi , I have a problem in the handling of sessions, my configuration in core.php is: define('CAKE_SESSION_SAVE', 'php'); define('CAKE_SECURITY', 'medium'); now my problem is when refresh the page (or change the page), my sessionid changes and I cannot read the stored thing previously: here an example of my situation: file: a_controller.php function index($id=1) { $this-Session- write('estandar', $id);} file: b_controller.php function index() { $estandarSession=$this-Session- read('estandar');} $estandarSession receives nothing... some suggestion? thanks sorry for my terrible english ...- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Recipes cancelled
Acutally i primarly meant the comments inside the post. (in the linguistic meaning of comment there can be comments *inside* a post, not only comments *on* the post) And whenever somebody agrees with (comments *on* the post) that, it counts too. some quotes: I hardly understand this decision of the Cake Software Fondation. or even Grrr I would like to kick the ass of the someone who didn't like the idea... On Mar 7, 3:05 pm, Dr. Tarique Sani [EMAIL PROTECTED] wrote: On 3/7/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On the blogpost i read some negative comments towards the authors of cakephp. Which comment in particular? There are somethings which can be inferred as negative about Cake Foundation in the post itself but I did not find anything in the comments... Tarique --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to send patches
I believe that it hurries to me in sending patch for this ticket: https://trac.cakephp.org/ticket/1854. It must have sent here first? greetings --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Installation Problem -- Need Help!!!
Thank you, guys, for your help! I just changed it to the dev installation and it works as it is. But when I opened the default page in a browser, it said: Your database configuration file is not present. Do you know what it refers to? Thanks a lot! S. On Mar 6, 8:51 pm, hydra12 [EMAIL PROTECTED] wrote: I don't know what your setup is like, but I explained to someone else how I do my alternative setup here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... I have a cake folder and an app folder inside my server's document root (htdocs for most people, it seems). I only had to change 1 line in my app's webroot/index.php file to make it work. I hope it helps. hydra12 On Mar 6, 3:53 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: I uploaded my bootstrap and core.php to the files section of this group:http://groups.google.com/group/cake-php/files?hl=en The only thing I have changed in core.php was the DEBUG and the CAKE_SESSION_SAVE' parts. Change define('CAKE_SESSION_SAVE', 'database'); to define('CAKE_SESSION_SAVE', 'php'); after you donwload it. If you still get errors about require() your installation may be corrupt. Try and re-download the latest version fromwww.cakephp.org On Mar 6, 1:07 pm, Somewhere [EMAIL PROTECTED] wrote: I just installed the CakePHP on the Apache 2.0 with PHP 5. I used the Alternative installation on the CakePHP manual. However, when I tried to connect to the default page on a web browser, I got this error message: Warning: require(config/core.php) [function.require]: failed to open stream: No such file or directory in /usr/lib/cake/cake/bootstrap.php on line 34 Fatal error: require() [function.require]: Failed opening required 'config/core.php' (include_path='/usr/lib/cake:/home/ywang/cakephp/:.:/ usr/local/lib/php') in /usr/lib/cake/cake/bootstrap.php on line 34 What might cause the problem? (I have set up the path in index.php file following the instructions on the manual.) Thanks a lot!- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange findAll Result with complex query
Just to clarify, I added the debugger message: Generated query from cake: SELECT `Treeview`.`id`, `Treeview`.`prev`, `Treeview`.`filename`, `Treeview`.`fileExtension`, if(fileExtension='0', filename, concat(filename, '.', fileExtension)) AS fullfilename, `Treeview`.`folder` FROM `treemenu` AS `Treeview` WHERE (`Treeview`.`id` != '58') AND (`Treeview`.`folder` = '0') AND (`Treeview`.`prev` = '1') AND ((`fullfilename` = 'pager.html')) AND (`Treeview`.`prev` = '1') Error from cake: 1054: Unknown column 'fullfilename' in 'where clause' The query should be: SELECT `Treeview`.`id`, `Treeview`.`prev`, `Treeview`.`filename`, `Treeview`.`fileExtension`, if(fileExtension='0', filename, concat(filename, '.', fileExtension)) AS fullfilename, `Treeview`.`folder` FROM `treemenu` AS `Treeview` WHERE (`Treeview`.`id` != '58') AND (`Treeview`.`folder` = '0') AND (`Treeview`.`prev` = '1') HAVING ((`fullfilename` = 'pager.html')) Any idea what is wrong with my query definition? $queryArray = array( $controllerName.id = != $id, $controllerName.folder = 0, $controllerName.prev = $fileData[0][$controllerName][prev] ,having = array(fullfilename = pager.html) ); Thank your any help! On Mar 7, 1:54 pm, Aldo [EMAIL PROTECTED] wrote: Yes, this way I get the value. But building the query cake seams not to find the column 'fullfilename' and not build the 'HAVING' right. the finished sql query should look like this: select id, prev, filename, fileExtension if(fileExtension='0', filename, concat(filename, '.', fileExtension)) AS fullfilename from treeview where id!=58 AND folder=0 AND prev=1 HAVING fullfilename = 'skyline.jpg' But like showed in the post before this part of the statement in cake seams to cause an error: having = array(fullfilename = skyline.jpg) So the problem is not getting the value of 'fullfilename', it's setting the filed 'fullfilename'. Any idea? Thanks! On Mar 7, 1:26 pm, Sergei [EMAIL PROTECTED] wrote: You should access it like: $fileData[INDEX_HERE][0][fullfilename][prev] like a: $fileData[0][0][fullfilename][prev] On 7 мар, 16:11, Aldo [EMAIL PROTECTED] wrote: Hi Zoltan Thank you. But do you know a workarround for this: --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to send patches
Simply attach the patch to the respective ticket. There is no need to post the patch here. -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: afterSave callbacks
OK, point taken. Never used afterSave before so not sure how they are supposed to work with the function in the controller. Currently I have the standard save function in the controller that adds the row made up on item, qty and price. Then in the model.. function afterSave() { $this-data['Orderitem']['price'] = $price; $this-data['Orderitem']['qty'] = $qty; $total_price = $price*$qty; $this-params['data']['Orderitem']['total_price'] = $total_price; $this-Order-Orderitem-save($this-params['data']); return true; } What I get is the [item] inserted but no price or qty and the total_price tuple set to 0 Also the errors.. Notice: Undefined variable: price in /app/models/orderitem.php on line 18 Notice: Undefined variable: qty in app/models/orderitem.php on line 19 Notice: Undefined variable: qty in app/models/orderitem.php on line 21 Notice: Undefined variable: price in app/models/orderitem.php on line 21 Hope that's enough info. As always any help greatly appreciated!! Thanks On Mar 7, 1:44 pm, Mariano Iglesias [EMAIL PROTECTED] wrote: Mike, Can I respectfully ask you that you provide more information as to why you can't get it working? It makes us waste emails to keep explaining that there's no easy way to tell what is wrong when you don't even tell us what's not working. So instead of just saying something doesn't work, show us what you wanted to do, how you were trying to do it (source code) and why you think it is not working (error message, queries sent to the database that you think are wrong, etc. etc.) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog:http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de mike Enviado el: Miércoles, 07 de Marzo de 2007 08:11 a.m. Para: Cake PHP Asunto: afterSave callbacks The problem is as follows: I want to add item, price and quantity into a table but I also want the total price (i.e. price*qty) to be inserted into the same row. I have played with afterSave callbacks in the model but I can get it working. Can anyone give me some advice and am I going about it the right way. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Java Servlet Application Context, Equivalent in cakePHP?
Hello, Like one would store data into a cakePHP session with $this-Session- Write('key', 'value'), is there a way to store data into a context that can be accessed by other controllers? Important to note is that such data is not known from start, so i'd rather not write such variables in configuration files etc. In the Java Servlet Api, the application context would be an ideal solution... does cakePHP has something similar? Thanks in advance --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with Access Control List
if ($access === false) Is this just a typo? --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Installation Problem -- Need Help!!!
You are going to have to read the installation instructions again all the way through as well as the manual on www.cakephp.org On Mar 7, 7:46 am, Somewhere [EMAIL PROTECTED] wrote: Thank you, guys, for your help! I just changed it to the dev installation and it works as it is. But when I opened the default page in a browser, it said: Your database configuration file is not present. Do you know what it refers to? Thanks a lot! S. On Mar 6, 8:51 pm, hydra12 [EMAIL PROTECTED] wrote: I don't know what your setup is like, but I explained to someone else how I do my alternative setup here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... I have a cake folder and an app folder inside my server's document root (htdocs for most people, it seems). I only had to change 1 line in my app's webroot/index.php file to make it work. I hope it helps. hydra12 On Mar 6, 3:53 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: I uploaded my bootstrap and core.php to the files section of this group:http://groups.google.com/group/cake-php/files?hl=en The only thing I have changed in core.php was the DEBUG and the CAKE_SESSION_SAVE' parts. Change define('CAKE_SESSION_SAVE', 'database'); to define('CAKE_SESSION_SAVE', 'php'); after you donwload it. If you still get errors about require() your installation may be corrupt. Try and re-download the latest version fromwww.cakephp.org On Mar 6, 1:07 pm, Somewhere [EMAIL PROTECTED] wrote: I just installed the CakePHP on the Apache 2.0 with PHP 5. I used the Alternative installation on the CakePHP manual. However, when I tried to connect to the default page on a web browser, I got this error message: Warning: require(config/core.php) [function.require]: failed to open stream: No such file or directory in /usr/lib/cake/cake/bootstrap.php on line 34 Fatal error: require() [function.require]: Failed opening required 'config/core.php' (include_path='/usr/lib/cake:/home/ywang/cakephp/:.:/ usr/local/lib/php') in /usr/lib/cake/cake/bootstrap.php on line 34 What might cause the problem? (I have set up the path in index.php file following the instructions on the manual.) Thanks a lot!- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Prompting downloads after HTML has been rendered
Hrmm, you had a good idea but, I am not figuring out how to implement this. I sat there for an hour yesterday just thinking about it. My problem is that I have a simple array with the path and name of the file. The file name and paths change dynamically but with flash and redirect, I don't see a way to pass the data to a new page. is $this- data global? I mean if $this-data contains my array, when the page gets redirected, it goes bye-bye, yeah? Here is the array I am trying to pass: $data = array('AdminTool' = array('success' = true, 'filepath' = '/ whatever/here/', 'filename' = 'blah_blah_2007-03-06_12:14:03.zip')); I get this array from functions in the model that collect the information for me and zips it. The model passes the array with where the zip is located and the name of the zip file. From the controller I could just set the zipinfo variable with the array and access it that way but, the problem comes in where, if I want to display HTML like success here is what info was collected, and once that view loads, have the browser automatically bring up the download box for the zip file. This, for me, is more about a can it be done or not and to implement it whether it would be useful or not. It just means that my knowledge will grow. On Mar 6, 12:50 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: AH! Good stuff! Didn't think about that. Thank you for the reply. On Mar 6, 12:17 pm, AD7six [EMAIL PROTECTED] wrote: On Mar 6, 8:38 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: This isn't really a cake question I guess... but I cannot find the answer and this group has a bunch of smart cookies. How do I get the browser to prompt the user to download a file AFTER HTML has been rendered? Render a view with a meta redirect to the url that is (or will serve) the file. The 10s way to do it is to use the controller flash method. HTH, AD --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: afterSave callbacks
That's fantastic, you're a legend! Thanks so much for your help. On Mar 7, 4:10 pm, ianh [EMAIL PROTECTED] wrote: More info needed as MI says. Based on whats available why not do it as a beforeSave? Only one expensive write to your DB then. function beforeSave() { // assuming your data is in $this-data $this-data[MODELNAME]['total'] = $this-data[MODELNAME]['price'] * $this-data[MODELNAME]['quantity']; // v important to do the return true otherwise the beforeSave fails. return true; } More on beforeSave in the manual ian --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Prompting downloads after HTML has been rendered
On Mar 7, 5:32 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Hrmm, you had a good idea but, I am not figuring out how to implement this. I do it almost exactly as I described. I sat there for an hour yesterday just thinking about it. My problem is that I have a simple array with the path and name of the file. The file name and paths change dynamically but with flash and redirect, I don't see a way to pass the data to a new page. is $this-data global? I mean if $this-data contains my array, when the page gets redirected, it goes bye-bye, yeah? Here is the array I am trying to pass: $data = array('AdminTool' = array('success' = true, 'filepath' = '/ whatever/here/', 'filename' = 'blah_blah_2007-03-06_12:14:03.zip')); redirect to /whatever/here/blah_blah_2007-03-06_12:14:03.zip OR redirect to some controller method that uses the passed parameters or the session to find the right file to serve. I get this array from functions in the model that collect the information for me and zips it. The model passes the array with where the zip is located and the name of the zip file. From the controller I could just set the zipinfo variable with the array and access it that way but, the problem comes in where, if I want to display HTML like success here is what info was collected, and once that view loads, have the browser automatically bring up the download box for the zip file. You'd need to edit your zip generating function (are you using the zip component) such that it also generates a list of files it found, and returns that on success (for example). This, for me, is more about a can it be done or not and to implement it whether it would be useful or not. It just means that my knowledge will grow. Sure it can ;). HTH, AD --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model Problem: Need reverse hasOne
Thanks for the quick reply. I tried what you suggested but i got the same result by writting the Profile model like this: class Profile extends AppModel { var $name = 'Profile'; var $recursive = 3; var $belongsTo = array('Location' = array('className' = 'Country', 'conditions' = '', 'order' = '', 'foreignKey' = 'location_id' ), 'Nationality' = array('className' = 'Country', 'conditions' = '', 'order' = '', 'foreignKey' = 'nationality_id' ) ); } The problem is that when i do a findAll on the Users, it first runs a query that selects Users with left joined Profiles, then it runs a query for each Profile, and then one query for each Country in each Profile. So to select 2 Users it uses 5 queries. I would like to have one big query... or at least avoid the query that selectes the Profile since that is already selected in the Users query (with joins) On Mar 7, 8:43 am, Langdon Stevenson [EMAIL PROTECTED] wrote: Hi gribelu What you need to do is create two new models for the countries table: location.php nationality.php These models will both use the countries table, and can, if you choose have a hasMany relationship to Profile. Then in your Profile model, you have two belongsTo relationships, one to each of the new models above. In the Profiles table you need to rename your foreign key fields: location_id nationality_id This should do the trick, and Cake will do all of the heavy lifting for you. No queries to write. I recommend that you read up in the manual about belongsTo relationships and using tables with different names in a model. That should fill in the details that I have not included here. Regards, Langdon I'm currently building the front page for an application. On this page there's a list of users with some of their profile data. The model looks kinda like this: User hasOne Profile In the 'profiles' table i have two fields 'location' and 'nationality' wich both point to id's from the countries table. What i want is to get the country_name from that table and use it in my view. Using multiple Profile hasOne Country doesn't work (duh).. If i use multiple Country belongsTo Profile almost works but it doesn't use joins and it's just plain wrong for what i need. Is there a way to make this work without writting the entire query by hand? Also, i don't want multiple queries per user.. that would be bad for performance. Thank you --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Cake Recipes cancelled
Its a shame that the deal was cancelled but Im sure there will be a no proposal for a CakePHP book. I would work on it myself but I lack the English skills to do so. I am willing to write in Spanish, though ;) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar _ De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Larry E. Masters aka PhpNut Enviado el: Miércoles, 07 de Marzo de 2007 12:10 p.m. Para: cake-php@googlegroups.com Asunto: Re: Cake Recipes cancelled It is true, the book deal between the Cake Software Foundation, Fabio Cevasco, and Peachpit Press has been cancelled. This decision was unanimously reached by all members of the CSF as well as other members of the community who where involved in peer review. In short, we were dissatisfied with the direction the project was taking, and the inadequate way in which the framework was being represented. However, this absolutely does not mean that there will be no CakePHP book. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Paginate + RequestAction Problem
Hi All I'm getting trouble with paginating comments. In my users controller $this-set('scheld',$this-requestAction('/scheldues/getScheldue/ Users/'.$id)); $this-paginate['Comment'] = array( 'limit' = 4, 'order' = array ('Comment.created' = 'desc'), ); $com = $this-paginate('Comment',array('Comment.where_id'= $id,'Comment.type'=$this-name)); $this-set(compact('com')); - In view -- ?=$paginator-prev(); ? | Page ?=$paginator-counter(); ? | ?= $paginator-next(); ? - When the View is rendered i have Paging links like this http://localhost/bare/scheldues/getScheldue/2/page:2 how can i get them to be like this -- http://localhost/users/view/22/page:2 What is bare and why paginate gets RequestAction URL? --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
if ($this-paramStyle==get) { $this-url = str_replace($this-controller-webroot,/,$this-controller-here); echo ###.$this-controller-here; pa
hello, i'm using this pagination component: http://bakery.cakephp.org/articles/view/65 in combination with admin routing. in this method, the property here evaluates to /cake/index.php/admintransactions/index/ insteaf of /cake/index.php/admin/transactions/index/ /** * Set the base url for updates. * * @param unknown */ function _initURL() { ... ... } else // No url in the parameters, derive it. { if ($this-paramStyle==get) { $this-url = str_replace($this-controller- webroot,/,$this-controller-here); echo ###.$this-controller-here; } what can i do ? thanks, jyrgen --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Installation Problem -- Need Help!!!
Yes, thank you for the reply! I have succesfully installed Cake now. I followed the online example of Blog and created the DB and the code. But when I tried to connect to it, I got this fatal error: Fatal error: Class 'PostsController' not found in /usr/local/apache2/ htdocs/cake/cake/dispatcher.php on line 158 I did change the routes.php file like this: // $Route-connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); $Route-connect ('/', array('controller'='posts', 'action'='index')); The Dir root for the cake on the server is: /usr/local/apache/htdocs/cake (The defaulty wwwroot is /usr/local/apache/htdocs for that server.) I have no clue about what is wrong with the code now since I am really a freshman in the bakery. Thanks a lot! On Mar 7, 11:23 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: You are going to have to read the installation instructions again all the way through as well as the manual onwww.cakephp.org On Mar 7, 7:46 am, Somewhere [EMAIL PROTECTED] wrote: Thank you, guys, for your help! I just changed it to the dev installation and it works as it is. But when I opened the default page in a browser, it said: Your database configuration file is not present. Do you know what it refers to? Thanks a lot! S. On Mar 6, 8:51 pm, hydra12 [EMAIL PROTECTED] wrote: I don't know what your setup is like, but I explained to someone else how I do my alternative setup here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... I have a cake folder and an app folder inside my server's document root (htdocs for most people, it seems). I only had to change 1 line in my app's webroot/index.php file to make it work. I hope it helps. hydra12 On Mar 6, 3:53 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: I uploaded my bootstrap and core.php to the files section of this group:http://groups.google.com/group/cake-php/files?hl=en The only thing I have changed in core.php was the DEBUG and the CAKE_SESSION_SAVE' parts. Change define('CAKE_SESSION_SAVE', 'database'); to define('CAKE_SESSION_SAVE', 'php'); after you donwload it. If you still get errors about require() your installation may be corrupt. Try and re-download the latest version fromwww.cakephp.org On Mar 6, 1:07 pm, Somewhere [EMAIL PROTECTED] wrote: I just installed theCakePHPon the Apache 2.0 with PHP 5. I used the Alternative installation on theCakePHPmanual. However, when I tried to connect to the default page on a web browser, I got this error message: Warning: require(config/core.php) [function.require]: failed to open stream: No such file or directory in /usr/lib/cake/cake/bootstrap.php on line 34 Fatal error: require() [function.require]: Failed opening required 'config/core.php' (include_path='/usr/lib/cake:/home/ywang/cakephp/:.:/ usr/local/lib/php') in /usr/lib/cake/cake/bootstrap.php on line 34 What might cause the problem? (I have set up the path in index.php file following the instructions on the manual.) Thanks a lot!- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
pagination + admin routing, paging base url issue
hi, i use this pagination component, in combination with admin routing http://bakery.cakephp.org/articles/view/65 i had to change if ($this-paramStyle==get) { $this-url = str_replace($this-controller- webroot,/,$this-controller-here); } into if ($this-paramStyle==get) { $this-url = str_replace($this-controller- webroot,/,$this-controller-here); $this-url = str_replace('admin',,$this-url); } (method _initURL(), line 347ff.) which cuts out the word admin out of /admintransactions/index. in order to get the correct base url for the paging helper. did anybody experience the same ? hmm,, regards, jyrgen --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Installation Problem -- Need Help!!!
What is your current directory structure? That would help in diagnosing your problem. On Mar 7, 12:06 pm, Somewhere [EMAIL PROTECTED] wrote: Yes, thank you for the reply! I have succesfully installed Cake now. I followed the online example of Blog and created the DB and the code. But when I tried to connect to it, I got this fatal error: Fatal error: Class 'PostsController' not found in /usr/local/apache2/ htdocs/cake/cake/dispatcher.php on line 158 I did change the routes.php file like this: // $Route-connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); $Route-connect ('/', array('controller'='posts', 'action'='index')); The Dir root for the cake on the server is: /usr/local/apache/htdocs/cake (The defaulty wwwroot is /usr/local/apache/htdocs for that server.) I have no clue about what is wrong with the code now since I am really a freshman in the bakery. Thanks a lot! On Mar 7, 11:23 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: You are going to have to read the installation instructions again all the way through as well as the manual onwww.cakephp.org On Mar 7, 7:46 am, Somewhere [EMAIL PROTECTED] wrote: Thank you, guys, for your help! I just changed it to the dev installation and it works as it is. But when I opened the default page in a browser, it said: Your database configuration file is not present. Do you know what it refers to? Thanks a lot! S. On Mar 6, 8:51 pm, hydra12 [EMAIL PROTECTED] wrote: I don't know what your setup is like, but I explained to someone else how I do my alternative setup here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... I have a cake folder and an app folder inside my server's document root (htdocs for most people, it seems). I only had to change 1 line in my app's webroot/index.php file to make it work. I hope it helps. hydra12 On Mar 6, 3:53 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: I uploaded my bootstrap and core.php to the files section of this group:http://groups.google.com/group/cake-php/files?hl=en The only thing I have changed in core.php was the DEBUG and the CAKE_SESSION_SAVE' parts. Change define('CAKE_SESSION_SAVE', 'database'); to define('CAKE_SESSION_SAVE', 'php'); after you donwload it. If you still get errors about require() your installation may be corrupt. Try and re-download the latest version fromwww.cakephp.org On Mar 6, 1:07 pm, Somewhere [EMAIL PROTECTED] wrote: I just installed theCakePHPon the Apache 2.0 with PHP 5. I used the Alternative installation on theCakePHPmanual. However, when I tried to connect to the default page on a web browser, I got this error message: Warning: require(config/core.php) [function.require]: failed to open stream: No such file or directory in /usr/lib/cake/cake/bootstrap.php on line 34 Fatal error: require() [function.require]: Failed opening required 'config/core.php' (include_path='/usr/lib/cake:/home/ywang/cakephp/:.:/ usr/local/lib/php') in /usr/lib/cake/cake/bootstrap.php on line 34 What might cause the problem? (I have set up the path in index.php file following the instructions on the manual.) Thanks a lot!- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Installation Problem -- Need Help!!!
It's the default structure that comes directly out of the cake box. I never changed it. Is it what you need? Thanks a lot! On Mar 7, 1:40 pm, hydra12 [EMAIL PROTECTED] wrote: What is your current directory structure? That would help in diagnosing your problem. On Mar 7, 12:06 pm, Somewhere [EMAIL PROTECTED] wrote: Yes, thank you for the reply! I have succesfully installed Cake now. I followed the online example of Blog and created the DB and the code. But when I tried to connect to it, I got this fatal error: Fatal error: Class 'PostsController' not found in /usr/local/apache2/ htdocs/cake/cake/dispatcher.php on line 158 I did change the routes.php file like this: // $Route-connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); $Route-connect ('/', array('controller'='posts', 'action'='index')); The Dir root for the cake on the server is: /usr/local/apache/htdocs/cake (The defaulty wwwroot is /usr/local/apache/htdocs for that server.) I have no clue about what is wrong with the code now since I am really a freshman in the bakery. Thanks a lot! On Mar 7, 11:23 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: You are going to have to read the installation instructions again all the way through as well as the manual onwww.cakephp.org On Mar 7, 7:46 am, Somewhere [EMAIL PROTECTED] wrote: Thank you, guys, for your help! I just changed it to the dev installation and it works as it is. But when I opened the default page in a browser, it said: Your database configuration file is not present. Do you know what it refers to? Thanks a lot! S. On Mar 6, 8:51 pm, hydra12 [EMAIL PROTECTED] wrote: I don't know what your setup is like, but I explained to someone else how I do my alternative setup here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... I have a cake folder and an app folder inside my server's document root (htdocs for most people, it seems). I only had to change 1 line in my app's webroot/index.php file to make it work. I hope it helps. hydra12 On Mar 6, 3:53 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: I uploaded my bootstrap and core.php to the files section of this group:http://groups.google.com/group/cake-php/files?hl=en The only thing I have changed in core.php was the DEBUG and the CAKE_SESSION_SAVE' parts. Change define('CAKE_SESSION_SAVE', 'database'); to define('CAKE_SESSION_SAVE', 'php'); after you donwload it. If you still get errors about require() your installation may be corrupt. Try and re-download the latest version fromwww.cakephp.org On Mar 6, 1:07 pm, Somewhere [EMAIL PROTECTED] wrote: I just installed theCakePHPon the Apache 2.0 with PHP 5. I used the Alternative installation on theCakePHPmanual. However, when I tried to connect to the default page on a web browser, I got this error message: Warning: require(config/core.php) [function.require]: failed to open stream: No such file or directory in /usr/lib/cake/cake/bootstrap.php on line 34 Fatal error: require() [function.require]: Failed opening required 'config/core.php' (include_path='/usr/lib/cake:/home/ywang/cakephp/:.:/ usr/local/lib/php') in /usr/lib/cake/cake/bootstrap.php on line 34 What might cause the problem? (I have set up the path in index.php file following the instructions on the manual.) Thanks a lot!- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Recipes cancelled
Suspected something of the sort when Amazon modified the release date to push it back three months... -Toby kinto wrote: ... It seems that the book will never come out and I'm really disappointed. ... simone --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakePHP and Version control Poll
On 3/5/07, AD7six [EMAIL PROTECTED] wrote: On Mar 5, 9:52 pm, Sonic Baker [EMAIL PROTECTED] wrote: Hi bakers, I know this has been touched on before but I would like to pay a revisit if you'll bare with me for a few minutes. With the advent of cakePHP 1.2 on the horizon people have been coming out with some nice additions to the framework which require external libraries to be added to the Global 'Vendors' directory. Since I usually only keep my 'app' directory under version control this causes me re-think my practices once again. Therefore, I was wondering if you would take a minute to share your version control strategies so we may see a show of hands and see the most common set-ups used. So, which of the following set-ups do you use: (a) Keep your entire cake installation with your application in your own Repository and merge new changes as necessary with every new release drop. (b) Keep your entire cake installation with your application in your own Repository and use svn::externals to point the framework files to the cakePHP repository. That's me too. externals only for the cake folder. Hi there AD7six, Do you mean only the 'cake' subfolder within the framework? (c) Keep only your 'app' directories under version control so that they can be checked out into any version of the framework. (d) Other. One other thing I've noticed with my set-up [(c) above] is that, while I can check out my application (written with cake 1.1.x.x) into a copy of the 1.2.x.x framework, I seem to be missing some files in my 'app' directory (and associated subdirectories) which are included in the default 1.2.x.xskeleton 'app' directory. Is there a set-up where I can automatically find the missing files using version control techniques? Using a vendor branch approach for that would work (adding a clean cake zip file to your repository, and copying from there to your working structure as a starting point), although if you are using externals for the cake folder it might be less hassle to check for things manually (new things don't appear that often in the app folder). Hmmm.., I'm thinking of creating a 1.2 branch in my repo. This and going from there. I haven't thought out the logistics of this yet but I suspect trouble when my 1.1.x.x branch only had the 'app' dir versioned and my 1.2.x.x branch has the extra dirs with externals. Any tips? Cheers, Sonic --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakePHP and Version control Poll
On 3/5/07, Grant Cox [EMAIL PROTECTED] wrote: I'm using (b) at the moment too, but the application started as just having my app folder in version control, and the core cake libs outside of this (c). So my folder structure is more like trunk/ trunk/libs/ trunk/libs/cake_1.2.x.x_branch trunk/src/ trunk/src/config ... webroot and to tell you the truth, this is a bit of a pain for the same reason you originally mentioned - global vendors. The only thing I use that needs this is Daniel Hofstetter's test suite, but synchronising this across our machines is already a pain, as these files are inside the externals of the cake libs, and I can't see how to actually include it in my app's repository. Hi Grant, Daniel's test suite is also the reason I'm looking into the new structure and your problem is the one I've feared. I wonder is it possible to move your 'app' directory into the cake directory and define everything except 'vendors' as externals? Right now I'm not sure what the best structure is. I like being able to update my cake libs to any revision easily, but I would like my app to automatically check out with a particular cakephp revision (the revision I was using when I committed my app) too... I guess nothing is perfect :) Well, I suppose you could tag your app with the framework before you update the framework. Maybe that wouldn't make sense. hmmm.. Sonic --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Developement Environment
I am looking at CakePHP for several large scale projects. One thing I'm wondering about is the best way to set up a development environment. My idea Environment looks like this: - Source Code is stored in SVN or CVS - Developers check out code and work on thier own system of choice, and commit changes to the code - Code/Database changes are checked out to a QA environment to testing - Code/Database are checked out of Version Control to production environment for test This is a lot of environments for one set of code to jump around in. How does cakePHP handle this? Will configuration environment for CakePHP allow it to jump from computer to computer without any problems? If this is not ideal, what then is a proper way to develop and release within the Cake infrastructure? How do you and your company handle this issue? Thank you for your time, Rob --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email problem
Been playing with it a bit my self (and submitted a patch to nate) but try this $this-Email-Controller-set(); I'm working on tracking down why $this-set isn't working, but the above should work in the meantime Sam D On 3/7/07, Marcus [EMAIL PROTECTED] wrote: Same problem here. The variables I set in a controller action with $this-set('foo', 'bar'); are not available in the view which is rendered by the EmailComponent (the viewVars array is empty) It looks like that after rendering the mail template: bNotice/b (8)/a: Undefined variable: username [bCORE/app/ views/elements/email/text/user/activation.ctp/b, line b1/b] (I used this tutorial from the bakery: http://bakery.cakephp.org/articles/view/203) Ideas to solve this, anyone? On 16 Feb., 21:45, Toby Parent [EMAIL PROTECTED] wrote: Now I'm trying to figure out why variables set in my controller aren't available to myemail. Wondering if I'm somehow unsetting them somewhere else... -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Developement Environment
the way that we handle it is that the config folder is not in svn (ignore property is set) this way on our dev setups the debug settings and db settings can be what we want them to be. we have a beta site that is constantly updated to latest code (using a post-commit callback in svn) at some point it we will probably hook it into our cruise control processes that we use for our Java Stuts app suite. and our deployed version only comes out of the tags that are marked with the cake rev number that they have passed Q/A for. On 3/7/07, rtconner [EMAIL PROTECTED] wrote: I am looking at CakePHP for several large scale projects. One thing I'm wondering about is the best way to set up a development environment. My idea Environment looks like this: - Source Code is stored in SVN or CVS - Developers check out code and work on thier own system of choice, and commit changes to the code - Code/Database changes are checked out to a QA environment to testing - Code/Database are checked out of Version Control to production environment for test This is a lot of environments for one set of code to jump around in. How does cakePHP handle this? Will configuration environment for CakePHP allow it to jump from computer to computer without any problems? If this is not ideal, what then is a proper way to develop and release within the Cake infrastructure? How do you and your company handle this issue? Thank you for your time, Rob -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Installation Problem -- Need Help!!!
I could be wrong, but it sounds like cake is having trouble finding your posts_controller.php. I'm assuming that it's in cake/app/ controllers/posts_controller.php? The class should be class PostsController extends AppController. Is that what you have? It might help if you could put your code up someplace so we could look at it. On Mar 7, 12:55 pm, Somewhere [EMAIL PROTECTED] wrote: It's the default structure that comes directly out of the cake box. I never changed it. Is it what you need? Thanks a lot! On Mar 7, 1:40 pm, hydra12 [EMAIL PROTECTED] wrote: What is your current directory structure? That would help in diagnosing your problem. On Mar 7, 12:06 pm, Somewhere [EMAIL PROTECTED] wrote: Yes, thank you for the reply! I have succesfully installed Cake now. I followed the online example of Blog and created the DB and the code. But when I tried to connect to it, I got this fatal error: Fatal error: Class 'PostsController' not found in /usr/local/apache2/ htdocs/cake/cake/dispatcher.php on line 158 I did change the routes.php file like this: // $Route-connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); $Route-connect ('/', array('controller'='posts', 'action'='index')); The Dir root for the cake on the server is: /usr/local/apache/htdocs/cake (The defaulty wwwroot is /usr/local/apache/htdocs for that server.) I have no clue about what is wrong with the code now since I am really a freshman in the bakery. Thanks a lot! On Mar 7, 11:23 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: You are going to have to read the installation instructions again all the way through as well as the manual onwww.cakephp.org On Mar 7, 7:46 am, Somewhere [EMAIL PROTECTED] wrote: Thank you, guys, for your help! I just changed it to the dev installation and it works as it is. But when I opened the default page in a browser, it said: Your database configuration file is not present. Do you know what it refers to? Thanks a lot! S. On Mar 6, 8:51 pm, hydra12 [EMAIL PROTECTED] wrote: I don't know what your setup is like, but I explained to someone else how I do my alternative setup here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... I have a cake folder and an app folder inside my server's document root (htdocs for most people, it seems). I only had to change 1 line in my app's webroot/index.php file to make it work. I hope it helps. hydra12 On Mar 6, 3:53 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: I uploaded my bootstrap and core.php to the files section of this group:http://groups.google.com/group/cake-php/files?hl=en The only thing I have changed in core.php was the DEBUG and the CAKE_SESSION_SAVE' parts. Change define('CAKE_SESSION_SAVE', 'database'); to define('CAKE_SESSION_SAVE', 'php'); after you donwload it. If you still get errors about require() your installation may be corrupt. Try and re-download the latest version fromwww.cakephp.org On Mar 6, 1:07 pm, Somewhere [EMAIL PROTECTED] wrote: I just installed theCakePHPon the Apache 2.0 with PHP 5. I used the Alternative installation on theCakePHPmanual. However, when I tried to connect to the default page on a web browser, I got this error message: Warning: require(config/core.php) [function.require]: failed to open stream: No such file or directory in /usr/lib/cake/cake/bootstrap.php on line 34 Fatal error: require() [function.require]: Failed opening required 'config/core.php' (include_path='/usr/lib/cake:/home/ywang/cakephp/:.:/ usr/local/lib/php') in /usr/lib/cake/cake/bootstrap.php on line 34 What might cause the problem? (I have set up the path in index.php file following the instructions on the manual.) Thanks a lot!- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Developement Environment
This is a lot of environments for one set of code to jump around in. How does cakePHP handle this? Will configuration environment for CakePHP allow it to jump from computer to computer without any problems? I use Ant to build my projects to dev, test, and production environments. Configuration values are set in the build file and substituted into config files at build time. This works very well for me and causes no problem. Your approach sounds reasonable to me. Regards, Langdon --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model Problem: Need reverse hasOne
If you just want one big query, then you will need to code it yourself and use $this-Profile-query() to run it. Multiple queries is the price you pay for Cake's automation of relationships. If you are worried about this for performance reasons, then I would suggest that you do some bench marks. Work out how much each approach differs, then decide if its worth bothering with. To me, one of the biggest benefits of using Cake is that I don't have to maintain mountains of SQL code. For that price I will gladly pay for some extra server horse power if required. Just my personal opinion of course. Regards, Langdon The problem is that when i do a findAll on the Users, it first runs a query that selects Users with left joined Profiles, then it runs a query for each Profile, and then one query for each Country in each Profile. So to select 2 Users it uses 5 queries. I would like to have one big query... or at least avoid the query that selectes the Profile since that is already selected in the Users query (with joins) --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakePHP and Version control Poll
On 05-Mar-2007, at 14:52, Sonic Baker wrote: (d) Other. project-dir trunk Rakefile config/ Doxyfile Doxyfile_cake lighttpd.conf deploy.rb docs/ media/ root/ .htaccess app/ cake/ docs/ index.php vendors/ releases/ 2006-03-22_1.0.0 2006-03-25_1.0.1 2006-06-12_1.0.2 2007-01-05_1.1.0 ... branches/ Basically, I try to keep everything related to the project in one spot in the repository. The Rakefile has utility tasks for things like dumping the Db to a file, starting the lighttpd server, wrapping a filter around svk's output to remove things like Cake's cachefiles, launching TextMate and pointing it at the root/app directory, running doxygen, opening doxy's output in Safari, and the like. Automating the mundane stuff prevents me from mistyping commands and greatly reduces the keystrokes required. The docs/ and media/ directories hod -- unsurprisingly -- project documentation and any media files (i.e. PSDs of the layout elements, TeX source, etc.) When I want to deploy out the Apache-based servers, I just have to upload the contents of root/. Depending on the server, I can do that via capistrano, svn export, or plain old FTP. Once the project hits a milestone, I just svk cp trunk/ into an appropriately named subdirectory in releases. And the same standard methodology for branching. Integrating new releases of Cake is done by hand. Usually, it just requires deleting cake/, docs/, vendors/, and index.php from root/ and dropping in the new versions thereof. I don't really need to retain the modification history for the cake files, since I have access to it in my SVK mirror of the cake/branches/1.2.x.x directory. Ideally, I would keep the sources for lighttpd, php, PCRE, etc in a tools/ directory inside trunk/, and then run the project entirely out of the trunk directory. But that'd take some time to setup and -- being a small shop -- there wouldn't be much immediate benefit. Hopefully that's not too boring a tour. s. PGP.sig Description: This is a digitally signed message part
Re: Handling upload in related model data setup
On Mar 7, 12:32 am, Grant Cox [EMAIL PROTECTED] wrote: If you want to do it in a single action, then keep as much of your Screenshot processing / validation in your Screenshot model, and have the extra bits in the Entries/add action. I was working towards that until I realized that I wasn't sure where my data ends up after it gets submitted. Would it make sense to prepare the file upload data in the Entries model and then pass that to a method of Screenshots to handle the rest? I'm not really sure what the proper way is to call a method in Screenshots from Entry and passing it the data of the uploaded file. Does it by any chance already have the data if I'd just call Screenshot-add() due to the hasMany relation and the ?php echo $html- file('Screenshot/file')? way of submitting? I really should read more about debugging cakephp so I get a better idea of what's going on. Anyway, thanks for pointing me in the right direction Grant. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Prompting downloads after HTML has been rendered
Awesome! I decided to use the Session controller as it seems to work the best for me since the user has to be logged in (in the future) to be able to perform these functions. It works now. Had a slight problem with the zip file format for some reason. If I name the file with a date and/or time in the filename itself, the zip file craps out. I am guessing it's the semicolons in the file name used with the time. So I just named the file to backup.xml and made the zip file name dynamically with a date and time. I like to include my code for other people to look at and use/ critique. When I have a problem with something, I always like a demonstration with the explanation so, here it is. Sorry if it is a large amount of information. Here is my resulting code using the flash and session controller: /** * This function is used to backup the specified tables in the database and * present them as a zip file or regular file and xml or regular sql depending * on what the user has selected. * @todo Get the controller to do a flash maybe to forward to another url * after the view so the download will happen */ function database_backup($classifieds = false) { // If you pass classifieds it will just backup the classifieds and association tables // This is for convenience if ($classifieds == 'classifieds') { $this-zipinfo = $this-AdminTool- backup_classified_tables(); if (!$this-zipinfo['success']) { $this-set('error', 'Fail'); $this-render(); } else { $this-AdminTool-empty_classified_tables(); } if (isset ($this-zipinfo)) { $this-Session-write('fileinfo', $this-zipinfo); $this-flash('Your backup was successful!br /Your download will begin in 5 seconds orbr /click here to begin now.', '/ admin_tools/download_file/', 5); } } // This part is where you select which tables you want to backup if (isset ($this-data)) { // We got data back from the form, process it $this-fileinfo= $this-AdminTool-database_backup($this- data); // Test to see if the file export and zipping were successful if ($this-fileinfo['success'] == false) { $this-flash('ERROR: Could not back up the specified tables!', '/admin_tools/', 5); $this-render(); } } else { // We recieved no data from the form, so present the form // Here we privide the list for the checkboxes of the tables in the database $this-dbinfo= $this-AdminTool-getDBInfo(); $this-set('dbinfo', $this-dbinfo); $this-render(); } // The form was processed and the files were backed up and zipped, forward to the file download if (isset ($this-fileinfo)) { // We want to set the path, filename and application type in the session so when we // forward the user, we can read it again. $this-Session-write('fileinfo', $this-fileinfo); $this-flash('Your backup was successful!br /Your download will begin in 5 seconds orbr /click here to begin now.', '/ admin_tools/download_file/', 5); } } /** * This is the main function I use for zip and other files to be downloaded * via the admin_tools controller. It is mainly used for database backups. * The function checks the session information for fileinfo array to get the * path and the name of the file as well as the content type. Once it checks * it initiats a browser download window and exits. */ function download_file() { if ($this-Session-read('fileinfo')) { $this-fileinfo= $this-Session-read('fileinfo'); header('Pragma: public'); header('Content-type: ' . $this-fileinfo['contenttype']); header('Content-length: ' . filesize($this- fileinfo['filepath'] . $this-fileinfo['filename'])); header(Content-Transfer-Encoding: binary); header('Content-Disposition: attachment; filename=' . $this-fileinfo['filename'] . ''); readfile($this-fileinfo['filepath'] . $this- fileinfo['filename']); exit (); } else { $this-flash('There was an error downloading the file!', '/ admin_tools/', 5); } } Here is the model functions: /** * This function is used to make backups of the selected tables in a database * @var array The array should be a cake array obtained from a form * @return array We return an array here containing success or failure with the path and filename of the backup
Re: Installation Problem -- Need Help!!!
Yes, the file is in the cake/app/controllers/ dir. Here is the code for the posts_controller.php: class PostsController extends AppController { var $name = 'Posts'; function index() { $this-set('posts', $this-Post-findAll()); } function view($id = null) { $this-Post-id = $id; $this-set('post', $this-Post-read()); } function add() { if (!empty($this-data)) { if ($this-Post-save($this-data)) { $this-flash('Your post has been saved.','/posts'); } } } function delete($id) { $this-Post-del($id); $this-flash('The post with id: '.$id.' has been deleted.', '/ posts'); } } function edit($id = null) { if (empty($this-data)) { $this-Post-id = $id; $this-data = $this-Post-read(); } else { if ($this-Post-save($this-data['Post'])) { $this-flash('Your post has been updated.','/posts'); } } } ? also the dir structure is like: /usr/local/apache/htdocs/cake/ -cake - app - cake - docs - index.php - vendors When I did the installation, I didn't change anything for the module mod_rewrite. Thanks, S. On Mar 7, 4:05 pm, hydra12 [EMAIL PROTECTED] wrote: I could be wrong, but it sounds like cake is having trouble finding your posts_controller.php. I'm assuming that it's in cake/app/ controllers/posts_controller.php? The class should be class PostsController extends AppController. Is that what you have? It might help if you could put your code up someplace so we could look at it. On Mar 7, 12:55 pm, Somewhere [EMAIL PROTECTED] wrote: It's the default structure that comes directly out of the cake box. I never changed it. Is it what you need? Thanks a lot! On Mar 7, 1:40 pm, hydra12 [EMAIL PROTECTED] wrote: What is your current directory structure? That would help in diagnosing your problem. On Mar 7, 12:06 pm, Somewhere [EMAIL PROTECTED] wrote: Yes, thank you for the reply! I have succesfully installed Cake now. I followed the online example of Blog and created the DB and the code. But when I tried to connect to it, I got this fatal error: Fatal error: Class 'PostsController' not found in /usr/local/apache2/ htdocs/cake/cake/dispatcher.php on line 158 I did change the routes.php file like this: // $Route-connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); $Route-connect ('/', array('controller'='posts', 'action'='index')); The Dir root for the cake on the server is: /usr/local/apache/htdocs/cake (The defaulty wwwroot is /usr/local/apache/htdocs for that server.) I have no clue about what is wrong with the code now since I am really a freshman in the bakery. Thanks a lot! On Mar 7, 11:23 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: You are going to have to read the installation instructions again all the way through as well as the manual onwww.cakephp.org On Mar 7, 7:46 am, Somewhere [EMAIL PROTECTED] wrote: Thank you, guys, for your help! I just changed it to the dev installation and it works as it is. But when I opened the default page in a browser, it said: Your database configuration file is not present. Do you know what it refers to? Thanks a lot! S. On Mar 6, 8:51 pm, hydra12 [EMAIL PROTECTED] wrote: I don't know what your setup is like, but I explained to someone else how I do my alternative setup here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... I have a cake folder and an app folder inside my server's document root (htdocs for most people, it seems). I only had to change 1 line in my app's webroot/index.php file to make it work. I hope it helps. hydra12 On Mar 6, 3:53 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: I uploaded my bootstrap and core.php to the files section of this group:http://groups.google.com/group/cake-php/files?hl=en The only thing I have changed in core.php was the DEBUG and the CAKE_SESSION_SAVE' parts. Change define('CAKE_SESSION_SAVE', 'database'); to define('CAKE_SESSION_SAVE', 'php'); after you donwload it. If you still get errors about require() your installation may be corrupt. Try and re-download the latest version fromwww.cakephp.org On Mar 6, 1:07 pm, Somewhere [EMAIL PROTECTED] wrote: I just installed theCakePHPon the Apache 2.0 with PHP 5. I used the Alternative installation on theCakePHPmanual. However, when I tried to connect to the default page on a web browser, I got this error message:
Re: Changing global layout - this problem is different from the rest of the problems reported on this group
I believe you can set cookies based on the URL path, i.e a cookie for / path1 differs from that for /path2, but I don´t know of any ´per window ´ facility, and if it can be done I´d imagine you´d have to use javascript. I agree with the above post that your layout may need to be the first parameter. I assume you´re familar with named parameters, i.e layout:default/ other_param:5. If your params are anonymous and you´re relying on their order to work out which isw which, I´d imagine this could get very confusing! Good luck, Woody On Mar 7, 3:02 am, Langdon Stevenson [EMAIL PROTECTED] wrote: Hi bingo flexibility to open two different windows with two different layouts? Is that possible. No idea sorry. Perhaps through the URL would be the best way. Regards, Langdon --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to send patches
Since that ticket has been marked as an Enhancement, it will be implemented by the developers when they are ready to do so. This may not be in the next month, the next release, or even at all. You have attached the diff to the ticket, and that's really all you can do. In the meantime, just have this functionality implemented in your local copy if you need it. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Changing global layout - this problem is different from the rest of the problems reported on this group
Nice one Woody, I hadn't thought of named params (have not used them in Cake myself, so it never occurred to me). I just saw them mentioned in another post before which is the first time I have come across them. That sounds like the solution to this problem all right. Regards, Langdon the_woodsman wrote: I believe you can set cookies based on the URL path, i.e a cookie for / path1 differs from that for /path2, but I don´t know of any ´per window ´ facility, and if it can be done I´d imagine you´d have to use javascript. I agree with the above post that your layout may need to be the first parameter. I assume you´re familar with named parameters, i.e layout:default/ other_param:5. If your params are anonymous and you´re relying on their order to work out which isw which, I´d imagine this could get very confusing! Good luck, Woody --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Changing global layout - this problem is different from the rest of the problems reported on this group
Hi woody, after you mentioned i looked into the named parameter option. Till now I was using the order to get parameters. However the problem still persist. I don't see how it can solve the problem. The problem is that using the bookmarklet, the user is directed to a web form..but if he is not registered he will be directed to login page by OthAuth authentication system. Since the global layout is not changed..the website will appear with default layout. I am not an expert but I believe there has to be a way to set window specific parameters... I hope I am able to explain my problem Regards, bingo On Mar 7, 5:35 pm, the_woodsman [EMAIL PROTECTED] wrote: I believe you can set cookies based on the URL path, i.e a cookie for / path1 differs from that for /path2, but I don´t know of any ´per window ´ facility, and if it can be done I´d imagine you´d have to use javascript. I agree with the above post that your layout may need to be the first parameter. I assume you´re familar with named parameters, i.e layout:default/ other_param:5. If your params are anonymous and you´re relying on their order to work out which isw which, I´d imagine this could get very confusing! Good luck, Woody On Mar 7, 3:02 am, Langdon Stevenson [EMAIL PROTECTED] wrote: Hi bingo flexibility to open two different windows with two different layouts? Is that possible. No idea sorry. Perhaps through the URL would be the best way. Regards, Langdon- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Handling upload in related model data setup
I've worked a bit more on my problem since my last post. I am now able to save my entry, get its ID and then call $this-Entry-Screenshot- save($this-data); Then I use the beforeSave callback in my Screenshot model to check and move the file. If that succeeds I allow the data to be saved to the database. Although it works, this doesn't seem like the proper way to do it and I'm running into problems later with errors and removing files. I think I'm going to have to use separate forms for each model unless someone can point me to example files that have two models and controllers handle input from one form. Right now what I want to do is more than my knowledge of MCV and cakephp allows me to do. --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
need help with SQLite
Does cakephp support SQLite? I'm getting the impression it does however i've had no luck using it. my database.php is set up as follows: var $default = array('driver'='sqlite', 'connect'='sqlite_open', 'database'='test.db'); and i'm getting the following error: Fatal error: Call to undefinded function sqlite_open() in /srv/test/ cake/libs/model/dbo/dbo_sqlite.php on line 102 any help would be greatly appreciated... --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Sanitize and hyphens
I have several areas of my site where it is necessary to sanitize large amounts of user form data. cleanArray() makes this process a breeze - however, I have found that it replaces hyphens ('-') with the htmlentity equivalent ('#45;'). This is a big problem for email addresses, which may contain hyphens. How should I be handling this? My best solution was to create a fixSafeChar() function to convert the hyphens back. But this seems pretty crude. Any suggestions? Is cleanArray() not the right function for the task? Thanks! --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
SQLite
Does cakephp support SQLite? I'm getting the impression it does however i've had no luck using it. my database.php is set up as follows: var $default = array('driver'='sqlite', 'connect'='sqlite_open', 'database'='test.db'); and i'm getting the following error: Fatal error: Call to undefinded function sqlite_open() in /srv/test/ cake/libs/model/dbo/dbo_sqlite.php on line 102 any help would be greatly appreciated... --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: SQLite
STOP SPAMMING Please. We got 4 messages with the same content, and different subject. One time is enough. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de AzenAlex Enviado el: Miércoles, 07 de Marzo de 2007 08:14 p.m. Para: Cake PHP Asunto: SQLite Does cakephp support SQLite? I'm getting the impression it does however i've had no luck using it. my database.php is set up as follows: var $default = array('driver'='sqlite', 'connect'='sqlite_open', 'database'='test.db'); and i'm getting the following error: Fatal error: Call to undefinded function sqlite_open() in /srv/test/ cake/libs/model/dbo/dbo_sqlite.php on line 102 any help would be greatly appreciated... --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: SQLite
SQLite support is only available for PHP5, and you have to make sure PHP is installed with it. See here: http://php.net/sqlite On Mar 7, 6:13 pm, AzenAlex [EMAIL PROTECTED] wrote: Does cakephp support SQLite? I'm getting the impression it does however i've had no luck using it. my database.php is set up as follows: var $default = array('driver'='sqlite', 'connect'='sqlite_open', 'database'='test.db'); and i'm getting the following error: Fatal error: Call to undefinded function sqlite_open() in /srv/test/ cake/libs/model/dbo/dbo_sqlite.php on line 102 any help would be greatly appreciated... --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange findAll Result with complex query
Idea is simple: Use $this-query() to make custom sql queries. Don't mess with findAll() if you need something complex with grouping, having, cases and so on. On 7 мар, 23:49, Aldo [EMAIL PROTECTED] wrote: Just to clarify, I added the debugger message: Generated query from cake: --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: pagination + admin routing, paging base url issue
maybe this patch is causing the problem http://bakery.cakephp.org/articles/view/56 (hosting admin url on subdomains) j --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to send patches
thanks Grant, are what wanted to know --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
New Cake FAQ
Hey Y'all, We're putting together an official CakePHP FAQ. So add your recommended frequently asked questions (and answers) here: https://trac.cakephp.org/ticket/1576 --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sanitize and hyphens
On 3/8/07, squidliberty [EMAIL PROTECTED] wrote: How should I be handling this? My best solution was to create a fixSafeChar() function to convert the hyphens back. But this seems pretty crude. Thats what I have done as well... However, the problem is usually in the URLs and emails - a better solution is to use a regex for validating. The presumption being if it validates it does not need cleaning ;) Cheers Tarique -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog: http://cheesecake-photoblog.org = --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Flaw in bake.php when ids are 0
I have found a flaw with bake.php when building controllers. If you view a page it runs if(!$id) { $this-flash('Invalid Pg Controllers Pg Action', array('action'='index')); } This mean that is the id is 0 it will show the error. I am using version cake_1.2.0.4451alpha Should I report it? --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Flaw in bake.php when ids are 0
Should I report it? no. no db I know of defaults to starting an auto_inc field with 0 --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Recipes cancelled
On 3/7/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: some quotes: I hardly understand this decision of the Cake Software Fondation. or even Grrr I would like to kick the ass of the someone who didn't like the idea... Hmmm.. may be I am a bit thick skinned but I would categorize both of the above as valid opinions of an aggrieved individual and everyone else is free to agree or disagree with them. Hardly an offensive against CSF I would say Since Larry has already put in an official statement it is EOT for me. Cheers Tarique -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog: http://cheesecake-photoblog.org = --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Flaw in bake.php when ids are 0
lol, mine seem to and I think thats a little hard headed to think that no one will ever use an id of 0. It was a simple fix to. just changed bake.php to error check ids with !isset($id) instead of !$db On Mar 7, 8:42 pm, Walker Hamilton [EMAIL PROTECTED] wrote: Should I report it? no. no db I know of defaults to starting an auto_inc field with 0 --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file upload
You should be aware that this doesn't protect the files themselves in any way. If a user knows, or can guess, the name of a file that exists within that directory they can still browse directly to it. On Feb 22, 8:23 am, bingo [EMAIL PROTECTED] wrote: Hi, Thanks for all your reply. I think putting .htaccess is better than puttin index.html. This is because I will have multiple folders insidefilesdirectory. If I use index.html then I will need to put index.html in all the sub directory too. However, If I just put one .htaccess in thefilesdirectory, it can control browsing behaviour for all the subdirectory too. Regards, Ritesh On Feb 22, 7:05 am, John [EMAIL PROTECTED] wrote: Hi Or just add a blank index.html file to thefilesdirectory - people trying to browse will just see a blank page - and of course you can edit the file to show whatever you want. John --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---