Re: The First CakePHP Book is out!
Just got the book and had a quick skim through it. The chapters on ORM and AJAX seem very interesting. Looking forward to going through it in detail. Thanks and congratulations to the authors and the team behind the project. I am also looking forward to David's book as well. I hope these will propel CakePHP to the next level. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
postgres dbo alterSchema and index
Hi, I was looking to use the schema shell tool for our project but it seems that postgres support is not quite there yet. In my attempts to use schema I've figured out that the postgres dbo does not have the alterSchema and the index methods implemented (overridden from the base class) which means if you're on postgres you can't use schema. So I was wondering if there was any plans to get postgres dbo upto what it needs to be so that schema would work. Is this something that will be ready for 1.2? I'd really like to use this as I think its a really neat way of managing database versions. Regards Ziad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: schema shell problem
Was looking into doing the alterSchema function for postgres dbo and found that postgres dbo doesnt have the index function either! This seems a lot more complex than the alterSchema function so I might just have to wait for the Cake guys to get around to supporting postgres properly. On Jul 5, 12:26 pm, Ziad <[EMAIL PROTECTED]> wrote: > Yeah postgres dbo seems quite far behind MySQL which is a bit of > shame. > > Just out of interest, how do you manage your database versioning? > > On Jul 5, 10:23 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > > > Please do. > > I'm using postgres too but i dont use schema cause i use native > > postgres uuid types and other db specific features. > > Postgre dbo may need some working to get it to mysqls level > > > On Sat, Jul 5, 2008 at 8:43 AM, Ziad <[EMAIL PROTECTED]> wrote: > > > > Figured out what the problem is! the postgres driver does not override > > > the alterSchema method which is responsible for generating the SQL for > > > altering the schema. It is there in the mysql driver and works fine > > > there. I'll try and do it for the postgres driver and update this post > > > when/if I do. > > > > On Jul 5, 5:26 am, Ziad <[EMAIL PROTECTED]> wrote: > > >> Hi Marcin, > > > >> I know in normal situation I'd run 'cake schema generate' to update my > > >> schema with my new DB and then commit that for others to pick up. But > > >> I am trying to emulate the situation where my schema is different to > > >> my DB and to use 'cake schema run update' to update my DB. > > > >> Does that make sense? > > > -- > > Marcin Domanskihttp://kabturek.info --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: schema shell problem
Yeah postgres dbo seems quite far behind MySQL which is a bit of shame. Just out of interest, how do you manage your database versioning? On Jul 5, 10:23 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > Please do. > I'm using postgres too but i dont use schema cause i use native > postgres uuid types and other db specific features. > Postgre dbo may need some working to get it to mysqls level > > > > On Sat, Jul 5, 2008 at 8:43 AM, Ziad <[EMAIL PROTECTED]> wrote: > > > Figured out what the problem is! the postgres driver does not override > > the alterSchema method which is responsible for generating the SQL for > > altering the schema. It is there in the mysql driver and works fine > > there. I'll try and do it for the postgres driver and update this post > > when/if I do. > > > On Jul 5, 5:26 am, Ziad <[EMAIL PROTECTED]> wrote: > >> Hi Marcin, > > >> I know in normal situation I'd run 'cake schema generate' to update my > >> schema with my new DB and then commit that for others to pick up. But > >> I am trying to emulate the situation where my schema is different to > >> my DB and to use 'cake schema run update' to update my DB. > > >> Does that make sense? > > -- > Marcin Domanskihttp://kabturek.info --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: schema shell problem
Figured out what the problem is! the postgres driver does not override the alterSchema method which is responsible for generating the SQL for altering the schema. It is there in the mysql driver and works fine there. I'll try and do it for the postgres driver and update this post when/if I do. On Jul 5, 5:26 am, Ziad <[EMAIL PROTECTED]> wrote: > Hi Marcin, > > I know in normal situation I'd run 'cake schema generate' to update my > schema with my new DB and then commit that for others to pick up. But > I am trying to emulate the situation where my schema is different to > my DB and to use 'cake schema run update' to update my DB. > > Does that make sense? > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: schema shell problem
Hi Marcin, I know in normal situation I'd run 'cake schema generate' to update my schema with my new DB and then commit that for others to pick up. But I am trying to emulate the situation where my schema is different to my DB and to use 'cake schema run update' to update my DB. Does that make sense? On Jul 4, 5:39 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > hey > > > Then I go to the DB and drop the nickname column and then try and run: > > you should jsut run cake schema generate the second time to save you > changes to a new schema. > cake schema run update is used when you have newer schema file and > older db config. > > > > > -- > > cake schema run update > > -- > > > and I get this: > > > -- > > Welcome to CakePHP v1.2.0.7296 RC2 Console > > --- > > App : app > > Path: /home/ziad/public_html/newmts/app > > --- > > Cake Schema Shell > > --- > > Comparing Database to Schema... > > PHP Warning: array_diff_assoc(): Argument #2 is not an array in /home/ > > ziad/public_html/newmts/cake/libs/model/schema.php on line 396 > > > Warning: array_diff_assoc(): Argument #2 is not an array in /home/ziad/ > > public_html/newmts/cake/libs/model/schema.php on line 396 > > > The following statements will run. > > > Are you sure you want to alter the tables? (y/n) > > [n] > y > > > Updating Database... > > users is up to date. > > End update. > > -- > > > Nothing changes in the database! I except the users table to have the > > nickname column added but it doesn't. > > > Anybody have this problem? Any ideas how to fix this? I'd really like > > to use this feature of Cake 1.2. > > > Thanks in advance. > > > p.s. I have Cake 1.2 RC2 and PostgreSQL 8.2 > > -- > Marcin Domanskihttp://kabturek.info --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
schema shell problem
Hi, I really like the idea of the schema shell tool. I am looking to use it on a rather big project that we are about to embark on, this would be really useful. I am just messing around with it to see how to do things and have run into a problem. I have this table: -- create table users ( id serial primary key, name varchar(200) not null, email varchar(200) not null, username varchar(20) not null, password varchar(200) not null, nickname varchar(20) ); -- I ran: -- cake schema generate -- and i got this schema.php: -- array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 11, 'key' => 'primary'), 'name' => array('type'=>'string', 'null' => false, 'length' => 200), 'email' => array('type'=>'string', 'null' => false, 'length' => 200), 'username' => array('type'=>'string', 'null' => false, 'length' => 20), 'password' => array('type'=>'string', 'null' => false, 'length' => 200), 'nickname' => array('type'=>'string', 'null' => true, 'length' => 20), 'indexes' => array('0' => array()) ); } ?> -- Then I go to the DB and drop the nickname column and then try and run: -- cake schema run update -- and I get this: -- Welcome to CakePHP v1.2.0.7296 RC2 Console --- App : app Path: /home/ziad/public_html/newmts/app --- Cake Schema Shell --- Comparing Database to Schema... PHP Warning: array_diff_assoc(): Argument #2 is not an array in /home/ ziad/public_html/newmts/cake/libs/model/schema.php on line 396 Warning: array_diff_assoc(): Argument #2 is not an array in /home/ziad/ public_html/newmts/cake/libs/model/schema.php on line 396 The following statements will run. Are you sure you want to alter the tables? (y/n) [n] > y Updating Database... users is up to date. End update. -- Nothing changes in the database! I except the users table to have the nickname column added but it doesn't. Anybody have this problem? Any ideas how to fix this? I'd really like to use this feature of Cake 1.2. Thanks in advance. p.s. I have Cake 1.2 RC2 and PostgreSQL 8.2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake integration with other app and session
Hi Chris, Thanks for your response, that certainly goes some way towards explaining why it happens. What about my question of do you see any issue/problem with commenting out this session recreation code? I guess there is the general issue of sharing session data between two applications, but if both applications are generally secure then are there any other issues that people can see? Sorry to be somewhat pedantic about this, its just that if anyone out there can see an issue then that would save me getting too deep into this before having to pull back. Thanks again. On May 8, 4:59 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Thu, May 8, 2008 at 6:55 AM, Ziad <[EMAIL PROTECTED]> wrote: > > > The problem that I was having was with sessions. It seems that Cake > > closes any existing session before doing anything with sessions within > > Cake. Session data from my other app is available in Cake. But session > > data that I save in Cake is not available in the other app. I've got > > around this by commenting out line 167 in cake/libs/session.php: > > Sometimes this happens depending on the security level in > config/core.php. If you have it set to high, it recreates the session > on every page load. > > Hope that helps. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cake integration with other app and session
Hi everyone, I have an issue that I'd like people's comment(s) on. I am trying to integrate an existing app with Cake. We are planning to move the entire app over to Cake eventually but will have to do it in stages. So we are planning to write new parts of the app in Cake and slowly move old stuff over. The problem that I was having was with sessions. It seems that Cake closes any existing session before doing anything with sessions within Cake. Session data from my other app is available in Cake. But session data that I save in Cake is not available in the other app. I've got around this by commenting out line 167 in cake/libs/session.php: function start() { if (function_exists('session_write_close')) { // session_write_close(); <-- this line } $this->__initSession(); return $this->__startSession(); } This seems to work fine but I was wondering if any of the Cake experts could point out any negative implications/side effects of doing this. I would really appreciate any feedback from you guys. Thanks in advance. Ziad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Model within Model
Hi all, I did some searching for this but could not find anything. Is there a way for me to get access to other models from within a model? What I want to do is have my own function inside one of my models that needs access to another model. How can this be achieved? So something like the $uses in controllers. Does it exist? Thanks in advance. Ziad --~--~-~--~~~---~--~~ 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: Postgres sequence not updating!
Thanks Nate, that seems to have fixed the problem! We guessed it was a caching problem but just couldn't figure out how to turn it off. Thanks again for your quick response. On Aug 24, 1:33 pm, nate <[EMAIL PROTECTED]> wrote: > $this->Foo->cacheQueries = false; > > On Aug 24, 7:53 am, Ziad <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > I have a sequence (in postgres) that I am using to get invoice > > numbers. This sequence is not 'attached' to any of the models, I am > > just using it to generate numbers. However, when I call a nextval on > > the sequence in a loop, I keep getting the same number from the > > sequence: > > > foreach(...) { > > > $invNumberRes = null; > > $invNumber = null; > > $invNumberRes = $this->Fee->execute("SELECT > > nextval('invoice_number')"); > > $invNumber = $invNumberRes[0][0]['nextval']; > > > } > > > I am getting the same value each time I am going around the loop. But > > each time I run the script the number is being incremented by 1. Even > > stranger, when I run a: > > SELECT currval('invoice_number'); > > > on the database directly its not changing after the script! > > > Any help with this would be greatly appreciated. > > > Cake version: 1.1.13.4450 > > PHP version: 5.2 > > PostgreSQL version: 8.2.4 > > > Thanks in advance. > > > Ziad --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Postgres sequence not updating!
Hi everyone, I have a sequence (in postgres) that I am using to get invoice numbers. This sequence is not 'attached' to any of the models, I am just using it to generate numbers. However, when I call a nextval on the sequence in a loop, I keep getting the same number from the sequence: foreach(...) { $invNumberRes = null; $invNumber = null; $invNumberRes = $this->Fee->execute("SELECT nextval('invoice_number')"); $invNumber = $invNumberRes[0][0]['nextval']; } I am getting the same value each time I am going around the loop. But each time I run the script the number is being incremented by 1. Even stranger, when I run a: SELECT currval('invoice_number'); on the database directly its not changing after the script! Any help with this would be greatly appreciated. Cake version: 1.1.13.4450 PHP version: 5.2 PostgreSQL version: 8.2.4 Thanks in advance. Ziad --~--~-~--~~~---~--~~ 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: Mission critical application & high security user auth and access levels
Hello Langdon; thanks for the great advice. as far as security goes i will go with your opinion and use cakes ACL. about oscommerce it completely agree with you. i once built a site and integrated oscommers into it, it was the worse experince i ever had. this thing is a monster, every other line is a mix of php, sql, and straigh up html. looks like a spaghitti dish that went horribly wrong. but hey, its free! i researched and found "BakeSale" http://bakesalehq.com/, its a php based but very simple, i think im going to use it and hopefully be able to integrate a payment gateway into it. let me know about your custom shopping cart. thanks for hte advise again regards Zee On 3/27/07, Langdon Stevenson <[EMAIL PROTECTED]> wrote: > > > Hi Zee > > > Any suggestions? othAuth perhaps? oscommerce? hmmm > > My preference for authentication id d_auth (passwords not transmitted in > the clear). > > I use ACL for access control to both functionality (actions) and to data > > I have built a number of sites with osCommerce and Cake (and Drupal) and > frankly I am sick of it. osC is a great product if you spend all of your > time in it. But personally, after the logical simple way Cake apps are > built I find osC a nightmare to maintain and troubleshoot. I have > reached the point of frustration that I am ready to built a Cake based > shop (probably as a plugin to make it more easily re-usable). > > Just my thoughts/opinions of course. > > 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: Assocciation
Mike; thanks alot, thats excatly what im trying to do. im used to hard code my php from ground up suddenly this cake is so easy but i keep thinking and expecting complex. i was trying to build custom sql functions inside models and cotrollers for that matter but thanks to you Ziad On Oct 24, 11:32 am, "Mikee Freedom" <[EMAIL PROTECTED]> wrote: > morning Z, > > For the actual dynamic menu you've got as many options as the Internet > can throw at you. I quite like the pure CSS version by StylePhreak but > everyone has their own opinion. > > Would welcome suggestions if anyone had a pearler. > > As for pulling your data from the DB in a way that would easily > translate in to this format I would say you could do a simple findAll > on your category Model with recursive set to 1 and it should do the > trick. > > This will give you a list of all your categories and all products > associated to each one. As long as your hasMany association exists > from your category to your product and your belongsTo from your > product to your category. > > Is this what you're after? Have you gone through the associations > section of the manual? > > Cheers, > mikee > > On 24/10/06,Ziad<[EMAIL PROTECTED]> wrote: > > > > > > > Hello everyone: > > > i have been trying out cake for a week to decide wheather to use it for > > my app dev. > > > so far so good but im having difficulity with complex queries and table > > assocciations. > > > i built 2 simple tables as a try out; > > > table categories: > > id > > name > > description > > > table products; > > id > > name > > description > > category_id > > > i built folders, models, controllers and views for each table and all > > great > > at last im trying to build a dynamic menu from database to display > > category and products related to that specific category as follows: > > category1 > > - product1 > > - product2 > > - product3 > > > category2 > > -product1 > > -product2 > > -product3 > > > i played around with the models and controles but no idea > > > your help is greately appreciated > > thanx > > Z- 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 -~--~~~~--~~--~--~---
Assocciation
Hello everyone: i have been trying out cake for a week to decide wheather to use it for my app dev. so far so good but im having difficulity with complex queries and table assocciations. i built 2 simple tables as a try out; table categories: id name description table products; id name description category_id i built folders, models, controllers and views for each table and all great at last im trying to build a dynamic menu from database to display category and products related to that specific category as follows: category1 - product1 - product2 - product3 category2 -product1 -product2 -product3 i played around with the models and controles but no idea your help is greately appreciated thanx Z --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---