Re: Manual entry for habtm linking table.
Thanks Paul, First time for me in Cake, normally use WP and Codeigniter but wanted to try out the baking. I was trying to over complicate it with: $db_data = array( 'teacher_id' = $teacher['Teacher']['id'], 'tclass_id' = $tclass['Tclass']['id'] ); $this-Teacher-TeachersTclasses-create(); $this-Teacher-TeachersTclasses- save($db_data); but actually this just worked.. $this-Teacher-query(INSERT INTO teachers_tclasses (tclass_id, teacher_id) VALUES (.$tclass_id., .$teacher['Teacher'] ['id'].);); Cheers Chris On Sep 16, 8:37 am, WebbedIT p...@webbedit.co.uk wrote: If using Cakes HABTM automagic the table should be named classes_teachers and have the following fields id (primary_key, auto_inc) class_id teacher_id After that it's a case of INSERT INTO classes_teachers (class_id, teacher_id) SELECT class_id, teacher_id FROM import_table HTH, Paul @phpMagpie On Sep 15, 9:24 pm, porangi.chris porangi.ch...@gmail.com wrote: hi, First time user of cake with CI background, I have two tables teachers and classes that share a many to many relationship e.g. Teacher-Classes. I'm having to import the data from CSV files that have been exported from another system that we have limited access to. I've got the classes working - I can scan through the file and add the class if it doesn't already exist but I need to add the links between class and teacher. I have an associative array with the two ids (tclass_id and teacher_id) ready but what query call would I make to insert this as a row in the teacher_class table? Thanks in advance for any help. Chris -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Sessions Best Practice Question
Using the session data is fine, but no need to put it as a hidden field, in fact that's a bad idea as anyone could look at source and see the users id or worse change their user id value with FireBug and add items to another users account. Just inject the user_id into $this-data in the controller before saving. HTH, Paul @phpMagpie On Sep 18, 4:35 am, Media Affect themediaaff...@gmail.com wrote: I am trying to determine the best way to grab out the signed in user_id for adding items to another belongsto table. Is it ok to use the session data for this? I could easily use this as a hidden field in the form data. $session-read('Auth.User.id') ? But, does this belong in a controller? What is the best and most secure way to do this? I have a Users table with id, name and password I have a Authors table with id, user_id, address, city, state, zip Users won't be able to access each others account data. So after baking the app I would remove the User.name dropdown. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Login to a CakePHP application from another site doesn't work
Before considering this, as if you anr your users really want a low security website? On Sep 17, 8:09 pm, Filipinho M. dos Santos filipin...@gmail.com wrote: Try to change the security level, I think cakephp block acess from other domains, depending the level of security. 2011/9/16 WebbedIT p...@webbedit.co.uk There is a reason they are slightly more involved and in your eyes excessive, because they ensure a level of security! You should never accept POST data which did not originate from a form on your site (and never accept data that is not POSTed) unless that sites has been previously authenticated and has some sort of key/token in place (i.e. as part of an API/RESTful app). HTH, Paul @phpMagpie On Sep 15, 8:33 am, byqsri marco.rizze...@gmail.com wrote: For the thing that I must do I think that is excessive use OAuth or OpenID. Do a simple autologin with javascript I think that is the better solution. Do CakePHP forbid to do a login from a page that isn't the loginAction of Auth component ? On 15 Set, 08:04, Zaky Katalan-Ezra procsh...@gmail.com wrote: Use oauth http://oauth.net/, openid http://openid.net/ ... On Wed, Sep 14, 2011 at 7:56 PM, byqsri marco.rizze...@gmail.com wrote: Hi I have my web application in CakePHP . All works fine. Now I would do an autologin in my web application from another site . To do this I have done a identical login form in my site and with javascrpt I post it to my web application. But it doesn't work . With this method I can't login to my web application . I always redirect tio login page. I have verify that the session is lost between the login and the redirect to initial page of my web application. Can someone help me about this? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Regards, Zaky Katalan-Ezra QA Administratorwww.IGeneriX.com Sites.IGeneriX.com 054-7762312 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Media plugin and user plugin
It would be mch better if you tried to debug why it is causing the user record not to save. My questions where the first steps in trying to do that. HTH, Paul @phpMagpie On Sep 17, 6:51 pm, Zaky Katalan-Ezra procsh...@gmail.com wrote: I didn't change register action at all. I just added the Media behaviors to user model $actsAs. Its working perfectly in other controllers. Anyway I found a solution: I needed the media plugin in order to upload the user profile image. I removed the 'Media.Coupler' from the user model $actsAs and add this code at user controller upload_image action: public function upload_image() { $this-User-Behaviors-attach('Media.Coupler'); ... ... $this-User-Behaviors-detach('Media.Coupler'); $this-redirect($this-referer()); } But it means that I can't add image_file field to registration form. After the user registered and verified his account he should enter his profile page and add an image. I should try using the media plugin on a clean solution to decide where is the problem On Fri, Sep 16, 2011 at 12:34 PM, WebbedIT p...@webbedit.co.uk wrote: More information required ... - have you echoed $this-data on submit to see what data there is - how are you calling save in the controller? - have you looked at the sql dump to see what Cake is trying? HTH, Paul @phpMagpie On Sep 15, 11:11 am, ZAky procsh...@gmail.com wrote: adding media plugin, 'Media.Coupler', behavior to users plugin model prevent creating new user. I want to save the profile image path in users table. Any suggestions? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: ajax observeField()
As soon as you start playing with Ajax requests you really do need to install FireBug or something similar so you can look at the console and see if requests are being fired, with what data and what is being returned. Without it your debugging bling most of the time. HTH, Paul @phpMagpie On Sep 17, 4:15 pm, aortizhi aorti...@gmail.com wrote: Hi guys, i have a problem using this ajax function, i'm new on cakephp and don't know if i'm making a mistake. I hace a observeFiel in my view as follows: ?php echo $this-Form-create('ArchivosSistema', array('action' = 'add1'));? fieldset legend?php __('Agregar un archivo al sistema'); ?/legend pPor favor llene los siguientes campos: br /Datos para crear archivo:/p ?php echo $this-Form-input('proveedore_id'); echo $this-Form-input('nombre_archivo'); echo $this-Form-input('token_separador'); echo $this-Form-input('Tabla_Correspondiente', array('options' = $campos, 'empty'='--Seleccionar--')); ? ?php echo $ajax-observeField( 'ArchivosSistemaTokenSeparador', array('url' = array( 'action' = 'myfunction' ), 'frequency' = 0.1,)); /fieldset ?php echo $this-Form-end(__('Aceptar', true));? and in my controller i have 'myFunction' just doing an echo as follows: class ArchivosSistemasController extends AppController { var $name = 'ArchivosSistemas'; var $helpers = array('Html','Ajax','Javascript'); var $components = array( 'RequestHandler' ); all other functions goes here. function myfunction(){ echo Llama la funcion; } } but it does anything when i change the value to the field token_separador, can anyone help -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: cakephp screws up all other php work
...Exactly as Larry puts it. I'd suggest you play with *any* new framework out of your webroot directory, which will have the salutary effect of forcing you to learn how to use some aspect of .htaccess files (because you'll need to do a RewriteBase directive for that directory with cakephp, for example). Matt Murphy On Sat, Sep 17, 2011 at 7:02 PM, Larry E. Masters php...@gmail.com wrote: CakePHP did not screw it up, check for the .htaccess file you probably left behind when you deleted to code. The error message tells you exactly what you need to do and gives you the basic code you need to copy and paste it into the file that you are being told to create. -- Larry E. Masters On Sat, Sep 17, 2011 at 11:38 AM, rhkennerly rhkenne...@gmail.com wrote: system is MBP/OSX/MAMP all latest updates a customer wanted me to look at a CakePHP product he was evaluating. Once I installed CakePHP in the root of localhost, all I get for any other production in php on localhost is internal 500 errors. I can fix this by removing cake and mamp restarting and reinstalling mamp, but there has to be a way to coexist that I am just not getting. While I have your attention, I'm also getting a CakePHP error that I don't know how to fix Missing Controller Error: CoopController could not be found. Error: Create the class CoopController below in file: app/Controller/ CoopController.php ?php class CoopController extends AppController { } ? This file does not exist in the code at all. What am I missing? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Haml and sass in CakePHP
I'd rather not add support for HAML and SASS directly to CakePHP. This would require re-implementing both DSL's in PHP, and under a license that is compatible with CakePHP's. The re-implementation alone is reason enough to not bother with it. Not to mention the additional burden of maintaining documentation, bugs, for these features. These DSLs, while useful could also be interpreted as 'bloat' but people not using them. I'd rather keep CakePHP small, and leave features like this up to the plugin community. -Mark On Sep 16, 3:32 am, Chris ch.ti...@googlemail.com wrote: I think Sass won't be a problem as you could set it to compile to webroot/css/ On 16 Sep., 08:59, Walther waltherl...@gmail.com wrote: CakePHP isn't modeled after Ruby (Or Ruby on Rails). It is simply a PHP framework that follows the MVC architecture, and Ruby on Rails is a Ruby framework that also follows the MVC architecture. That is pretty much their only simularity. Perhaps you could be better helped if you actually added what warnings and notices you get. People can't guess them out of the blue. Also, remember that quite a bit has changed in CakePHP 2.0, so unless that plugin has been specifically modified for CakePHP 2.0, you are going to need to follow the migration guide to change it to work with 2.0. On Sep 16, 3:56 am, Chris Cinelli chris.cine...@formativelearning.com wrote: I forgot to mention that I tried to follow the instruction here :https://github.com/goncaloesteves/phamlp/blob/master/Cake/Installatio... And I even substitute var $view = 'Haml'; = var $viewClass = 'Haml'; But cake give warning and notice later. On Thu, Sep 15, 2011 at 6:28 PM, Chris Cinelli chris.cine...@formativelearning.com wrote: I think almost everybody familiar with Ruby knows: http://haml-lang.com/ and http://sass-lang.com/ Since CakePHP is modeled after Ruby and in the spirit of having to write less code with more syntactic juice it would be great to have them in cake. Fortunately someone already though to that. So here is this great piece of code that has CakePHP extension: https://github.com/goncaloesteves/phamlp But following the instruction in the Cake folder does not make it work in Cake 2.0. Someone know how to solve the problem? On a side node, I think that it would be great to add it to Cake as a default plugin. Ruby 3.1 added sass with compass ( http://compass-style.org/) as default. Best, Chris -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: http://ci.cakephp.org/
Not yet, but I hope to get around to adding it as part of the 2.0 docs. The CakePHP configuration is stupid simple right now, and mainly consists of running the AllTests. -Mark On Sep 17, 3:21 pm, Meroe whme...@gmail.com wrote: Any documentation on how you set up CI for cakephp using jenkins? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
RE: http://ci.cakephp.org/
Mark, Thanks. I was actually able to figure out what I needed from the console output on http://ci.cakephp.org I created some test cases and I'm good to go now with unit testing, code coverage, etc within Jenkins for Cakephp 2.x Thanks! Here is what I did: I created this in the Test/Case folder and it seems to work for testing my app controllers. class AllControllerTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All Controller class tests'); $suite-addTestDirectory(APP_TEST_CASES . DS . 'Controller'); return $suite; } } From within jenkins I do: /opt/Cake/Console/cake testsuite app AllController --stderr --log-junit build/logs/junit.xml --coverage-clover build/logs/clover.xml -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of mark_story Sent: Sunday, September 18, 2011 12:03 PM To: CakePHP Subject: Re: http://ci.cakephp.org/ Not yet, but I hope to get around to adding it as part of the 2.0 docs. The CakePHP configuration is stupid simple right now, and mainly consists of running the AllTests. -Mark On Sep 17, 3:21 pm, Meroe whme...@gmail.com wrote: Any documentation on how you set up CI for cakephp using jenkins? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
CakePHP triple layered edition released
The CakePHP core team is proud to announce the immediate availability of CakePHP 1.2.11, 1.3.12 and 2.0.0-RC2. Both 1.2.11 and 1.3.12 are bugfix/maintenance releases. This triple release also contains the second iteration of the 2.0 version release candidates mostly featuring fixes, new test cases and a few new enhancements. There were no backwards incompatible changes in any of three versions. Grab them while they're fresh in the download[1] page! Among the relevant changes introduced in every branch we can highlight the following: (please note that every version is sharing the relevant fixes and commits for common bugs) 1.2 - Fixed file deletion issue in windows where unlink() cannot delete files that have open file handles. - Fixed multiple issues with security component - Fixed issue where times between 12:00 and 12:59 would be incorrectly marked as am in TimeHelper - Fixed multiple bugs in Xml library - Fixed bugs in Set::extract() function - Fixing issues with duplicate content/empty tags with CacheHelper This version has finally been tagged after a very long time featuring over 15 commits and 10 tickets resolved. For a complete list of changes please take a look at the changelog[2] 1.3 - Fixed bugs in CakeSchema related to Postgres - Fixed bugs on Containable behavior - Added unix sockets support to memcache. - Fixed bug where scientific notations were not passed to mysql in their original form which resulted in loss of precision - Fixed bugs in Set::extract() function - Changing Postgresql to use DELETE FROM instead of TRUNCATE. This should improve compatibility with databases using constraints in Fixtures A total of 53 commits closing over 20 tickets consolidates this version as the most stable and well tests CakePHP version yet. For a complete list of changes please take a look at the changelog[3] 2.0 - The 'default' config for Configure class is now auto created on first use if not already created. - Made full page caching + Themes work. - Fixed multiple bugs in form helper and Rss helper - Improved the upgrade shell - Deprecated the %page% style placeholders in PaginatorHelper. Updating scaffold and bake templates to not use deprecated placeholders. - Model validation messages now accept sprintf placeholders that will get filled with parameter from the 'rule' key in the validation array - Added a bunch of new tests to the suite 64 commits and over 10 tickets closed can be found at the complete changelog[4] We're getting very close to a final stable 2.0 release. The team is now focused in fixing any remaining bugs and improving the documentation which can be found in the new 2.0 book[5]. If you feel like you can give us a hand on polishing and improving the documentation, please feel free to fork the repo[6] and send us pull request for changes. We are also looking forward improving our API documentation, so pull requests for doc blocks in code are also very welcome! A huge thanks to all involved in terms of both contributions through commits, tickets, documentation edits, and people attending CakeFest 2011 which was even better than last year's. Links - [1] http://github.com/cakephp/cakephp/downloads - [2] http://cakephp.org/changelogs/1.2.11 - [3] http://cakephp.org/changelogs/1.3.12 - [4] http://cakephp.org/changelogs/2.0.0-RC2 - [5] http://book.cakephp.org/2.0/en/ - [7] https://github.com/cakephp/docs -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
RE: CakePHP triple layered edition released
Excellent thanks! From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of José Lorenzo Sent: Sunday, September 18, 2011 10:09 PM To: cake-php@googlegroups.com Subject: CakePHP triple layered edition released The CakePHP core team is proud to announce the immediate availability of CakePHP 1.2.11, 1.3.12 and 2.0.0-RC2. Both 1.2.11 and 1.3.12 are bugfix/maintenance releases. This triple release also contains the second iteration of the 2.0 version release candidates mostly featuring fixes, new test cases and a few new enhancements. There were no backwards incompatible changes in any of three versions. Grab them while they're fresh in the download[1] page! Among the relevant changes introduced in every branch we can highlight the following: (please note that every version is sharing the relevant fixes and commits for common bugs) 1.2 · Fixed file deletion issue in windows where unlink() cannot delete files that have open file handles. · Fixed multiple issues with security component · Fixed issue where times between 12:00 and 12:59 would be incorrectly marked as am in TimeHelper · Fixed multiple bugs in Xml library · Fixed bugs in Set::extract() function · Fixing issues with duplicate content/empty tags with CacheHelper This version has finally been tagged after a very long time featuring over 15 commits and 10 tickets resolved. For a complete list of changes please take a look at the changelog[2] 1.3 · Fixed bugs in CakeSchema related to Postgres · Fixed bugs on Containable behavior · Added unix sockets support to memcache. · Fixed bug where scientific notations were not passed to mysql in their original form which resulted in loss of precision · Fixed bugs in Set::extract() function · Changing Postgresql to use DELETE FROM instead of TRUNCATE. This should improve compatibility with databases using constraints in Fixtures A total of 53 commits closing over 20 tickets consolidates this version as the most stable and well tests CakePHP version yet. For a complete list of changes please take a look at the changelog[3] 2.0 · The 'default' config for Configure class is now auto created on first use if not already created. · Made full page caching + Themes work. · Fixed multiple bugs in form helper and Rss helper · Improved the upgrade shell · Deprecated the %page% style placeholders in PaginatorHelper. Updating scaffold and bake templates to not use deprecated placeholders. · Model validation messages now accept sprintf placeholders that will get filled with parameter from the 'rule' key in the validation array · Added a bunch of new tests to the suite 64 commits and over 10 tickets closed can be found at the complete changelog[4] We're getting very close to a final stable 2.0 release. The team is now focused in fixing any remaining bugs and improving the documentation which can be found in the new 2.0 book[5]. If you feel like you can give us a hand on polishing and improving the documentation, please feel free to fork the repo[6] and send us pull request for changes. We are also looking forward improving our API documentation, so pull requests for doc blocks in code are also very welcome! A huge thanks to all involved in terms of both contributions through commits, tickets, documentation edits, and people attending CakeFest 2011 which was even better than last year's. Links · [1] http://github.com/cakephp/cakephp/downloads http://github.com/cakephp/cakephp/downloads · [2] http://cakephp.org/changelogs/1.2.11 http://cakephp.org/changelogs/1.2.11 · [3] http://cakephp.org/changelogs/1.3.12 http://cakephp.org/changelogs/1.3.12 · [4] http://cakephp.org/changelogs/2.0.0-RC2 http://cakephp.org/changelogs/2.0.0-RC2 · [5] http://book.cakephp.org/2.0/en/ http://book.cakephp.org/2.0/en/ · [7] https://github.com/cakephp/docs https://github.com/cakephp/docs -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php