Best Practices for multiple cake apps sharing tables?
For example, I would like to build one app to manage the users and groups for all my other apps. Single sign on if you will. --- How do I name tables? I've noticed I run into trouble attempting to use tablePrefixes in either project, particularly with HABTM joinTables: master_groups master_groups_users master_users project1_stuff project1_thingers Accessing the groups+users relationship and join table is problematic. But maybe that's because I'm trying to create models in the project app too. --- What's the best strategy for not repeating work? So far, I've tried re-creating the User and Group model in the project, but that has problems mentioned above. Aside from the table naming, do I need to also redefine all the methods I already wrote in the Master User/Group app? Is this something that I need to wrap into a behavior of some sort? --- I've tried explicitly defining my join tables, but from within Project1, cake tries to attach the Project1_ prefix to the groups_users join table. Even when I specify the table name in the habtm relationship, it still appends the prefix. The hack as I see it is to just explicitly define each table, but that feels very un-cake-like and hackish. --~--~-~--~~~---~--~~ 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: Best Practices for multiple cake apps sharing tables?
I looked at the plugin docs again and it wasn't clear whether I would be able to create relationships between the main app and models from the plugin and that's what I'm looking for. e.g. Users + Posts, etc In my work environment, I am looking to establish common master apps (like User Group management, higher level reporting functionality, etc) for use within other cake apps as well as possibly non-cake apps which I can slightly adapt. Aside from creating One Monster Application (eww), what are my options? Just plug ins? I'm devouring books and articles but haven't come across something that addressed it or provided a solution --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Core Unit Tests Failing for me
I'm new to unit testing and especially cakephp unit testing, so I've come across a few confusing things. Please excuse me if I'm overlooking something obvious. To simplify things, I dropped fresh installs of cake on two different php servers at the office. One runs PHP 5.2.1 and the other 5.0.4. Both point to the same mysql db. On the PHP 5.0.4 install, I get this error when trying to run all tests: Fatal error: Call to undefined method ReflectionClass::hasMethod() in /Library/WebServer/Documents/cake1.2.tests/vendors/simpletest/ reflection_php5.php on line 223 On the PHP 5.2.1 install, This is the result: All Core Tests * Failed Expected false, got [Boolean: true] at [/var/www/html/ cake1.2.tests/cake/tests/cases/basics.test.php line 70] /var/www/html/cake1.2.tests/cake/tests/cases/basics.test.php - BasicsTest - testUses * Failed Expected false, got [Boolean: true] at [/var/www/html/ cake1.2.tests/cake/tests/cases/basics.test.php line 71] /var/www/html/cake1.2.tests/cake/tests/cases/basics.test.php - BasicsTest - testUses * Skipped Memcache is not installed or configured properly at [/ var/www/html/cake1.2.tests/cake/tests/cases/libs/cache/ memcache.test.php line 55] * Skipped Xcache is not installed or configured properly at [/var/ www/html/cake1.2.tests/cake/tests/cases/libs/cache/xcache.test.php line 50] * Skipped Apc is not installed or configured properly at [/var/www/ html/cake1.2.tests/cake/tests/cases/libs/cache/apc.test.php line 50] * Skipped OverloadableTest not implemented at [/var/www/html/ cake1.2.tests/cake/tests/cases/libs/overloadable.test.php line 44] * Failed Equal expectation fails with member [singularized] as key list [] does not match key list [SomePages, Pages, Timesheets, TestDispatchPages, OtherPages, MyPlugin, ArticlesTest, Tests, SomePosts, TestCachedPages] at [/var/www/html/cake1.2.tests/cake/tests/ cases/libs/inflector.test.php line 61] /var/www/html/cake1.2.tests/cake/tests/cases/libs/ inflector.test.php - InflectorTest - testInstantiation Fatal error: Nesting level too deep - recursive dependency? in / var/www/html/cake1.2.tests/vendors/simpletest/expectation.php on line 246 I assume first that a release isn't supposed to fail test suites included with the source on two different php installs. Is there something I should be checking for? Additionally, I've noticed some failures leave test_suite tables. Even worse, when re-running the test, it assumes takes aren't there that are and vice versa. Again, is this something errant on my end? Thanks in advance for pointing me in the right direction. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
HABTM, tablePrefix, joinTable issues
I've seen variants of issues involving these topics posted, but not this particular one. I use a master _users table and _groups table in my projects. A given project will have tablePrefix set to projectname_ and all the tables specific to that project are correctly named projectname_tablename. Unfortunately if I try to establish HABTM between _users and _groups or either of those tables and a table from a specific project, it gets ugly. My goal is to have my tables look like this: - _groups - _users - _groups_users (join table) - projectprefix_comments - projectprefix_comments_users (join table) - projectprefix_posts - projectprefix_posts_users (join table) - projectprefix_comments_posts (join table) I have currently resorted to specifying every single table in each model and removing any tablePrefix settings. I cannot specify a tablePrefix when defining the habtm relationship, and the useTable value is automatically appended by the project level tablePrefix, ignoring any Model level tablePrefix. Admittedly, sorting out which prefixes should automagically be used may be debatable, but I think I should have the ability to clear tablePrefix and set joinTable to explicitly point to any given table in my habtm definition. I hope that was clear. Does anyone have any clean fixes for this? Thanks in advance for any advice --~--~-~--~~~---~--~~ 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: Filemaker and CakePHP
My workgroup also uses filemaker for some existing projects so I've had interest in this as well. I'm new to filemaker, but recently started using the Filemaker API (not FX) and while it seems kind of clunky, it worked. I have not used the API inside the cakephp framework, but I imagine if you drop Filemaker API into the vendors folder and load it appropriately, you can just use the API as you would in 'normal' php code that utilized the API. In the worst case, you will be back to a non-cake existence when asking the model to provide data as the nice 'automagic' functions obviously won't work. Potentially, you can roll up your sleeves and extend(?) the existing find() function and others to go through filemaker. Unfortunately, you'll likely run into trouble with existing filemaker apps because they were probably created in the 'usual' way - in large flat denormalized tables. This will wreck a lot of the automagic so you'll need to evaluate the existing data first and assess whether or not normalizing it will mess up existing apps. Good luck On Jul 17, 10:49 am, Eric [EMAIL PROTECTED] wrote: The database is going to be updated primarily from an existing Filemaker application. However, there will be some changes from the web site that will need to be added to the database, ie. new user registration, new posts from the users. I would expect there to be daily modifications of existing data from the filemaker client, and a large influx of new data from the FileMaker client about once a month. The database is relational and is being run on the latest version of Filemaker. There is not a huge amount of data currently, but the site is expected to grow. Thanks. On Jul 16, 9:44 pm, GravyFace [EMAIL PROTECTED] wrote: Is the data on the website going to be read-only? How often is the data going to change? How much data? Is the data relational? What version if Filemaker? Can't really expect us to give you advice without knowing what it is you're trying to do. On Wed, Jul 16, 2008 at 8:19 PM, Grant Cox [EMAIL PROTECTED] wrote: A few years ago I had to work with Cake and Filemaker - but thankfully I convinced them that the website could use it's own database, and their internal Filemaker database would just synchronise from this live site with a Filemaker script (one way synch only). There was just a cake action that output appropriate data as an XML file suitable for Filemaker, and the Filemaker script updated from this (with a recorded macro, as I recall). But the final solution is quite limited (one way, not automatic), and it was a pain to work with - I really didn't like FileMaker after that. Admittedly, this was back when Filemaker was not relational either (FM 6 or 7 as I recall), so maybe things have improved. But if it still doesn't support SQL, maybe not. On Jul 17, 5:24 am, Eric [EMAIL PROTECTED] wrote: Hi, Has anyone had success using Filemaker as a repository for Cake? There have been a few posts here on the issue, but nothing for quite some time. I realize it is quite a task since Filemaker does not really handle SQL. Filemaker does have a PHP API and there is something called FX.php which is another way of accessing the data. The problem that I am facing is that a customer has an internal Filemaker database which they would like users of their website to have access to some of the data. They are moving their site's hosting internally to facilitate this change. If anyone has any other ideas of how to get the filemaker data into Cake, I am all ears. I was thinking some sort of database synchronization, but I think that will be more trouble then it is worth, if it is even possible. Thanks! --~--~-~--~~~---~--~~ 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: What happens with CakePHP Cookbook?
Truly a step in the right direction. I am one of those in desperate need of the docs and hope they continue to improve daily. Thanks everyone involved for all contributions big and small. On Jul 18, 6:43 am, villas [EMAIL PROTECTED] wrote: @keymaster I'm sorry about misinterpreting your post. I guess it was difficult for me to imagine that people being 'desperate' could ever be an endorsement. Thanks for clarifying. Best wishes. On Jul 18, 12:08 pm, keymaster [EMAIL PROTECTED] wrote: Villas, You completely misread my post. The intent is 180 degrees opposite what you understood. I am praising John Anderson and team for the incredible effort they have put out over the last few months, to take the 1.2 docs from a state where the docs added almost no value, to the point where people are now desperate for the book (because it adds so much value). I would say that is quite an accomplishment. Forget the glitch, I and everyone else knows it's only temporary. Hope I stand clarified. --~--~-~--~~~---~--~~ 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: What happens with CakePHP Cookbook?
You're right, I thought it disappeared completely, but looks like it's simply lost its navigation. For example, this works: http://book.cakephp.org/view/66/models (thank you history!) On Jul 17, 4:27 pm, august.gresens [EMAIL PROTECTED] wrote: Yes, I'm noticing this as well - makes it very hard to navigate the docs. A On Jul 17, 2:54 pm, itsnotvalid [EMAIL PROTECTED] wrote: I don't know if it is just me or not,http://book.cakephp.orgseemsto have some problems with table of contents. Individual pages could be reached, but the indexes are all messed up and went missing. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cookbook disappeared?
Did the cookbook disappear for anyone else? I was in the middle of reading it when all content vanished. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---