Re: Router::parseExtensions, RequestHandler and arguments

2009-09-08 Thread Martin Westin
That is the kind of urls you will get when using parseExtensions. The extension will always be last in the url chain and not specifically attached to the action name. It sounds like you are constructing your own string urls. If you use array urls it will sort itself out a bit easier since Cake

Re: Plugins and associations

2009-09-08 Thread Martin Westin
A few things that look wrong: var $name = 'User' in the model has to be renamed along with the class and file. var $belongsTo = array('Cms.Group') is linking to a Cms plugin while the class and Controller is referring to Epicms the plugin name, model/controller prefix class name prefix... all

Re: Setting Up CakePHP on MAC with MAMP and Eclipse

2009-09-07 Thread Martin Westin
A few points for installing Cake to run in Mamp. Simplest way is to drop the whole Cake folder (containing cake,app,vendors...) into Mamp's htdocs folder. Should be: /Applications/MAMP/htdocs That should have Cake running but you probably need / want the database too, right. You need to rename

Re: Session timeout way too short

2009-09-04 Thread Martin Westin
already a lot of information stored but if i can't come up with a better solution i will try the DB sessions On 3 Sep., 15:47, Martin Westin martin.westin...@gmail.com wrote: Just a few suggestions. These are not definitive answers. Some PHP installations have a session garbage collection

Re: Problem serving video to Mac/Safari/Quicktime

2009-09-04 Thread Martin Westin
with setting security to low.  Although it's not necessarily a proper solution, perhaps it might lead to a better solution.  Have you been able to track down the reason why there are multiple requests/loads on the same file? On Sep 3, 1:42 pm, Martin Westin martin.westin...@gmail.com wrote

Re: Menus best practice

2009-09-04 Thread Martin Westin
You can create an empty element in all the other apps and just include the element in the layout. You can also let the current app use another layout, one which inherits the global layout. In this special layout you include the menu element (somehow). I often work like this. With one base-layout

Re: Problem serving video to Mac/Safari/Quicktime

2009-09-04 Thread Martin Westin
Nope. I really thought that setting a future expire header might work. For now, I set Configure::write('Session.checkAgent', false); for request to the problematic action. At least I am only lowering security for that small part of the app. On Sep 4, 4:41 pm, Martin Westin martin.westin

Re: textmate snippets not working

2009-09-03 Thread Martin Westin
then fired up TextMate, but alas, still no luck. I went into the bundle's Snippet directory and listed the permissions there: -rw-r--r-- Don't these need to be executable? Thanks again. On Sep 2, 3:36 am, Martin Westin martin.westin...@gmail.com wrote: Bundles? Unless that's a typo, you

Re: User preferences

2009-09-03 Thread Martin Westin
I'd say that what is best depends on how many preferences you anticipate in your application. One field per preference in the user's table works fine for a very few but can start looking messy after a while. I have seen e-commerce applications with 50+ fields in the products table (is_hardware,

Re: HTML Encoding for German

2009-09-03 Thread Martin Westin
You need to manage your character encoding a bit more than that, I think. You have a lot of variables that all should be in sync with each-other for the best results. -Your editor (Textmate, Eclipse, Notepad...) -Your documents (created before now) should be checked and converted. -Your CakePHP

Re: How to hide id with router::connect

2009-09-03 Thread Martin Westin
The url is what tells cake what to do. If you hide the id you remove the id and Cake will have not idea what id you want. The url must contain some kind of unique identifier...but not specifically the numeric id from the database. You need to alter your action so it can use the make and model

Re: $form-select SELECTED how to ? ? ?

2009-09-03 Thread Martin Westin
Not 100% sure it works when you go directly to html-select but I know it works for input. There is the manual way: $form-input('Modelname.fieldname', array( 'type'='select', 'options'=$list, 'value'=$your_selected_value )); But the magic of Cake can do for you is where

Re: Session timeout way too short

2009-09-03 Thread Martin Westin
Just a few suggestions. These are not definitive answers. Some PHP installations have a session garbage collection that is a bit hyperactive. If you were to chage to cake session storage that would eliminate that source. I have noticed that when outputting some files to the browser (small

Problem serving video to Mac/Safari/Quicktime

2009-09-03 Thread Martin Westin
Hi, I was wondering if anyone had a good way they use to serve video that works for Quicktime inside Safari on a Mac? Sound simple, right? Just use Media view. Problem is that after much checking Charles (debug proxy) clued me in on the fact that when you serve the file, the browser first loads

Re: Problem serving video to Mac/Safari/Quicktime

2009-09-03 Thread Martin Westin
Just noticed that I forgot the mention that this appears to be a Snow Leopard problem. Mac OS X 10.6, the new sand-boxed plugins in Safari and the rewritten Quicktime. On Sep 3, 6:18 pm, Martin Westin martin.westin...@gmail.com wrote: Hi, I was wondering if anyone had a good way they use

Re: Fatal error: Method Overloadable::__call() must take exactly 2 arguments in overloadable_php4.php on line 79

2009-09-03 Thread Martin Westin
And you are sure you are doing that using php4 and not 5? AFAIK __call is defined in the language in php4. Only in php5 did they add that. This is why cake has these two files. Compare them (overloadable_php4 and overloadable_php5) and you will see that the php5 version contains very little

Re: Learning cakePHP debugging

2009-09-02 Thread Martin Westin
Any reason you are not just using debug? debug($activeUser); I have never used the Debugger class myself. I am generally content to just debug to screen when something strange happens. /Martin On Sep 2, 2:36 am, abc sudmo...@gmail.com wrote: Use the var_dump of php,     ob_start();      

Re: Upgrade to new Cake PHP version

2009-09-02 Thread Martin Westin
wrote: So I generally only replace the cake folder with the one from the new release? And what about the app and vendor folders? On 31 Aug., 15:29, Martin Westin martin.westin...@gmail.com wrote: Generally you can just replace your cake folder with the new one or do a pull if you use Git

Re: textmate snippets not working

2009-09-02 Thread Martin Westin
Bundles? Unless that's a typo, you might need to stick with one bundle for CakePHP or you might get some conflict. I have this one http://svn.textmate.org/trunk/Review/Bundles/PHP%20Cake.tmbundle installed in ~/Library/Application Support/TextMate/Bundles/ It works as it should for me. dat will

Re: CakePHP + PHP5.3 = ?

2009-09-01 Thread Martin Westin
@Joel Do you have any insight into the reason for keeping Cake1.2 on PHP 5.2? At the moment the latest stable CakePHP will not run on the latest stable PHP. Since this just sound odd I imagine there was a discussion, reasons weighed for and against, tests done and all that. I ask since my

Re: Dependent=true, too much data is deleted

2009-08-31 Thread Martin Westin
This might be the same problem I had when migrating to 1.2 last year. The conditions in all associations MUST be arrays or you will get these kinds of strange problems. so try: array('Comment.parent_type'='event') /Martin On Aug 30, 8:06 am, Jeroen jdenh...@inflate.nl wrote: Hi all, Nasty

Re: Using Cake models from non-cake project

2009-08-31 Thread Martin Westin
It really is as simple as Felix writes. It is just that his post is from 2006 and a few details have changed. I just tried this on 1.2 stable and it does work: $_GET['url'] = 'favicon.ico'; require_once('path_to_app_dir'.DS.'webroot'.DS.'index.php'); // and then for example: $PostModel =

Re: Upgrade to new Cake PHP version

2009-08-31 Thread Martin Westin
I am not sure you mean version 1.1 to 1.2 or every small update like 1.2.3 to 1.2.4? I will assume you are talking about possible incompatibilities between versions and updated cake files in the app dir. Small updates to the stable 1.2 will probably not ever change any file in the app

Re: Upgrade to new Cake PHP version

2009-08-31 Thread Martin Westin
latest stable release (1.2.3) to the latest stable (1.2.4). There seem to be a lot of differences between the files, at least that's what I get when using WinMerge to compare the files. On 31 Aug., 13:13, Martin Westin martin.westin...@gmail.com wrote: I am not sure you mean version 1.1

CakePHP + PHP5.3 = ?

2009-08-30 Thread Martin Westin
Can anyone say a few words about the plans for Cake in relation to PHP 5.3? Will compatibility be added in a point-update (1.2.5 maybe) or is the policy to not support 5.3 for a while? I found a previous thread that ended in suggesting we use Cake 1.3 dev (= not stable). This was not afaik an

Re: CakePHP + PHP5.3 = ?

2009-08-30 Thread Martin Westin
specific. It has a whole new core and setup so it probably wont be backwards compatible. http://code.cakephp.org/cake3 On Aug 30, 1:56 am, Martin Westin martin.westin...@gmail.com wrote: Can anyone say a few words about the plans for Cake in relation to PHP 5.3? Will compatibility

Re: CakePHP + PHP5.3 = ?

2009-08-30 Thread Martin Westin
and setup so it probably wont be backwards compatible. http://code.cakephp.org/cake3 On Aug 30, 1:56 am, Martin Westin martin.westin...@gmail.com wrote: Can anyone say a few words about the plans for Cake in relation to PHP 5.3? Will compatibility be added in a point-update (1.2.5 maybe

Re: Cloud application with CakePHP? Different databases with same app.

2009-08-27 Thread Martin Westin
I detailed how I do it in an article in the Bakery: http://bakery.cakephp.org/articles/view/one-core-one-app-multiple-domains It works on one Cake core, one app, one apache (or nginx) vhost (with multiple aliases). It makes development-specific settings easy as-well since that is handled the

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread Martin Westin
Cake can handle it... what you are really asking is wether your server can handle it without any type of load-balancing. This is a much harder question to answer since it would depend on many factors. The reason Cake is a good framework for your situation is that it is designed to help you out

Re: One app db, many domains - what is the right mix?

2009-08-25 Thread Martin Westin
the header hostname to a config subdirectory and loads the appropriate db config file. Not quite what I'm looking to achieve but some good concepts there. On Aug 25, 1:25 am, Martin Westin martin.westin...@gmail.com wrote: Did you check the bakery? I think I remember seeing something

Re: Possible, saving null with saveField?

2009-08-25 Thread Martin Westin
I forgot to reply earlier. Thanks, that worked great. On Aug 19, 11:02 am, viktor vnyst...@gmail.com wrote: you could try Model-saveField('fieldName', 'NULL'); On Aug 18, 10:00 am, Martin Westin martin.westin...@gmail.com wrote: Hi, I would prefer to be abel to use saveField

Re: really wierd problem

2009-08-25 Thread Martin Westin
I'd say the problem is a grammatical one. (I'm one to talk!) One Post, Many Posts One Location, Many Locations One PieceOfInformation, Many PiecesOfInformation Information is an odd substantive. It does not really have singular or plural forms in the normal sense. At the top of the controller,

Re: Howto sort forum threads?

2009-08-25 Thread Martin Westin
I have two ideas but I can't be sure which is the best for you. One way to go is to force joins (or possibly sub-selects) and sort on the modified field from the replies table. You wouldn't want to or need to get all the records just the most recent one. Another way to go is to try to make

Re: encoding problems: utf-8

2009-08-25 Thread Martin Westin
You should try to pin-point it a bit. Is the browser receiving the correct encoding in the header? Is the problem for static text in the layout or text from the database? Is the problem there for both old data and new data? There are many little details that are important since you can

Re: really wierd problem

2009-08-25 Thread Martin Westin
plural.I thought we keep this name convention even if there is not plural. :) 2009/8/25 Martin Westin martin.westin...@gmail.com I'd say the problem is a grammatical one. (I'm one to talk!) One Post, Many Posts One Location, Many Locations One PieceOfInformation, Many PiecesOfInformation

Beware of isset() - Tip, OT

2009-08-25 Thread Martin Westin
Using isset(), there is a potential problem that escaped me until today. You can get false positives from isset on associative arrays. $data['Modelname']['field1'] = 'some string'; isset($data['Modelname']['field1']) = true as I would expect $data['Modelname'] = 'some string';

Re: Export to Excel

2009-08-24 Thread Martin Westin
There is a trick that almost makes me love Microsoft... You can export an html table to Excel. Just output a table, maybe some heading before and a p-tag after if you like... no layout... no full html document needed. Just make the browser think this html table is an excel file and Excel will

Re: Please Help!! my password is always null!!!

2009-08-24 Thread Martin Westin
My guess is that Auth component is doing it. If you are doing your own authentication you have to remove Auth from your list of components. And if you do want to use Auth ten you shouldn't do any of the authenticating stuff yourself. /Martin On Aug 24, 6:50 am, liaogz82 liaog...@gmail.com

Re: Please Help!! my password is always null!!!

2009-08-24 Thread Martin Westin
/Martin On Aug 24, 9:06 am, liaogz82 liaog...@gmail.com wrote: so if i want to use authentication, how should i go about doing it? Gangzheng On Aug 24, 2:03 pm, Martin Westin martin.westin...@gmail.com wrote: My guess is that Auth component is doing it. If you are doing your own

Re: One app db, many domains - what is the right mix?

2009-08-24 Thread Martin Westin
Did you check the bakery? I think I remember seeing something like that in some article a while back. /Martin On Aug 24, 3:38 pm, jonoa jonoaus...@gmail.com wrote: Hello all Big thanks to all the people who contribute to CakePHP - has certainly put some structure in to my development and

Re: How do I merge 2 tables

2009-08-23 Thread Martin Westin
Here are two basic example of how you do it using MySQL insert with a select statement for the values. http://mysql-tips.blogspot.com/2005/04/mysql-insert-select-example.html and the variation where you can trick mysql into doing an update.

Re: Contains and conditions gives rather unexpected results

2009-08-19 Thread Martin Westin
Well the manual might be slightly misleading. The text states that Containable can filter the associated data. It is the example output that is wrong (AFAIK), showing data as from a join. Containable does nothing more than filter the returned data, model for model. It does not mimic joins. I am

Re: Contain() or INNER JOIN

2009-08-19 Thread Martin Westin
You are right (in the subject), you need a join. You can force Cake to do joins if you build something like what Nate wrote about in january: http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find I took some ideas from that and made a joining feature that would join

Re: Problems with print_r

2009-08-19 Thread Martin Westin
That should work even though inside a Cake app you should use debug ($this) for some extra features. (like the debug not printing when you set the app in production mode) var_dump($this) is another one you can try. If none of them work you are in trouble :) On Aug 19, 4:02 pm, Gildonei Mendes

Possible, saving null with saveField?

2009-08-18 Thread Martin Westin
Hi, I would prefer to be abel to use saveField for a simple ajax inline- edit functionality. Setting a value is fine, clearing out the field does not apear to work. I can't seem to call Model-saveField ('fieldname',null) or even pass an empty string. Am I doing something wrong or is it just not

Re: Routing with slugs.

2009-08-18 Thread Martin Westin
if you are going for slugs with the controller prefixed (/consulting/ some_slug_of_mine) and not application-global slugs (/ a_globally_unique_slug) then you don't really have to do anything to the routing settings. I have just gone from a controller with: function view($id) { $this-data =

Re: Routing with slugs.

2009-08-18 Thread Martin Westin
I should also say that the routing bit is useful as a first line of defence against bad slugs. On Aug 18, 12:46 pm, Taff taff.law...@googlemail.com wrote: After reading throughhttp://book.cakephp.org/view/46/Routes-Configuration along withhttp://c7y.phparch.com/c/entry/1/art,cake-seoand

Re: Routing with slugs.

2009-08-18 Thread Martin Westin
controller_from_cakes other methods (just the view). Thanks again Taff On Aug 18, 1:49 pm, Martin Westin martin.westin...@gmail.com wrote: I should also say that the routing bit is useful as a first line of defence against bad slugs. On Aug 18, 12:46 pm, Taff taff.law...@googlemail.com

Re: Complex Find Conditions

2009-08-18 Thread Martin Westin
What if you ask the question naming the Models and associations between them, and what you were expecting to get back as the result of the query. Finds and conditions depend greatly on the associations between the models involded. Some use joins, most do not and all that. SQL syntax also looks

Re: question: file not found or missing controller error?

2009-08-17 Thread Martin Westin
Configure::write('debug', n ); Setting debug to 0 will make make respond with a 404. Anytime debug is on (more than 0), Cake expects you to be building or testing the application. Cake does not try to make a difference between the missing file /posts/edit/1 and /files/images/ not_here.jpg. It

Re: Authentication error

2009-08-17 Thread Martin Westin
Auth does that to ensure the password is never shown in plain text... in a log, in an unexpected debug output or some similar situation. By the time you get the data Auth has already done it's authentication and the password should be more or less unimportant. On Aug 17, 9:38 am, Veoempleo

Re: Save HABTM, Undefined index: id

2009-08-17 Thread Martin Westin
Which model doesn't have an id field? If it has an pk or uid or some other name you should just let Cake know via the attribute $primaryKey. The join-table can manage without any primary key as long as you don't store any extra data in it. But this is not encouraged, it seems to be considered as

Re: question: file not found or missing controller error?

2009-08-17 Thread Martin Westin
If you don't deal with the webserver config much it would be easy to overlook that the whole Cake app more or less acts as an error page for missing files. Any real file is sent directly and any missing file results in php and Cake getting the url to try to make sense of it. On Aug 17, 10:08 

Re: Validating user password after Auth

2009-08-14 Thread Martin Westin
When do you do this validation? Saving a User record or logging n? If it is logging in then IMHO all is fine. Auth should hash anything that comes in. blank password = wrong pasword and all that... If you are editing or creating users then you can name the password field in the edit form to

Re: Is it an insert or an update?

2009-08-14 Thread Martin Westin
I have not found any Cake function to handle it. I use query() to add an ...ON DUPLICATE KEY... for the one single place I need it. It is a huge performance boost if you kan let MySQL do it compared to doing a find to check before saving. /Martin On Aug 14, 3:58 am, Jamie jamie@gmail.com

Re: Strange contain/find issue

2009-08-13 Thread Martin Westin
Two quick questions / checks. What does the sql output say? Is the missing data being queried at all? What happens if you use recursive instead of containable? /Martin On Aug 13, 10:35 am, WebbedIT p...@webbedit.co.uk wrote: I have been trying to debug an issue I am facing for over 3 hours

Re: Will speed be affected?

2009-08-12 Thread Martin Westin
I don't think that will slow things down significantly. Cake caches paths (in debug=0) and locations of classes. Logically the more directories php has as include paths the more time an include will take but that is also very little extra time and probably hardly measurable in this case. /Martin

Re: HTML helper in function?

2009-08-12 Thread Martin Westin
I don't know how you do it James. I just did a quick test in a view and defining a function inline in the view will not provide that function with access to the local variables outside the function ($html, $form...) One ugly way of making it work is to make a global reference to the html helper

Re: Log Errors when debug = 0?

2009-08-12 Thread Martin Westin
AppController::beforeFilter() to load the new debugger: App::import('Vendor', 'TDebugger'); Debugger::invoke(new TDebugger()); Seems to work - if anyone can think of a better way of doing it let me know :) David On Aug 11, 8:03 am, Martin Westin martin.westin...@gmail.com wrote: libs

Re: clearCache() unexpected behavior

2009-08-12 Thread Martin Westin
Yes that was what I meant, but I probably wasn't clear enough. But I don't understand why it should do even that. clearCache() with no filename does that already. Why would I want the fallback behavior of - if 'cachefile' does not exist then delete every other cache file - in the view directory

Re: Array help

2009-08-11 Thread Martin Westin
If looping the results start becoming too slow for you, you can force Cake to do a join which will make the whole result disappear if the Post is empty. Nate wrote about it and inspired me to build my own variation.

Re: Custom library functions

2009-08-11 Thread Martin Westin
If you start adding more functions you may want to put them into a separate file. The top of my bootstrap.php looks like this: // This would mess things up royally-- App::import('Vendor', 'basics'); require_once(APP.'vendors'.DS.'basics.php'); I mention it mostly because you have to do a good

Re: PDF reader in view without new header

2009-08-11 Thread Martin Westin
Since you are pointing to a real file that exists and is readable (right?) your problem is probably not header. The url method is for controllers and actions. Try using the webroot method. You supply it with the path you want and it will add the base url for you. echo

Re: CakePHP (and other leading php frameworks) vs. Drupal custom modules

2009-08-10 Thread Martin Westin
A bit OT, but for general interest check out http://openatrium.com/ It is a groupware-type application written on top of Drupal. I have never used Drupal but if I was to start I would first look at how they did it. Of-course you wanted to know about going the other way... from Drupal to Cake or

Re: lazy loading?

2009-08-10 Thread Martin Westin
I think you may be on a different level to that trac note. You would have to confirm the following but I believe this is generally correct: Cake does lazy loading of the classes... classes never referenced during a request will not be included, loaded and instantiated. Cake does no lazy loading

Re: Inter Model Communication

2009-08-10 Thread Martin Westin
Depends on what you want. For simple things I have done a few manual things. For example: ModelA needs to tell ModelB to perform some general action: $model = ClassRegistry::init('ModelB'); $model-doYourThing(); For more complete event handling you could check out:

Re: MISSING TABLE

2009-08-10 Thread Martin Westin
I saw this tiny detail that looks odd: Error: Database table fams s for model Fams was not found. Somewhere you are referencing a Model called Fams which tries to load a table calles fams s. That is the missing table. Check everywhere for any reference to Fams at all, one of them should probably

clearCache() unexpected behavior

2009-08-10 Thread Martin Westin
Hi, I like posting here before adding anything to trac to get some feedback first. clearCache() in basics.php does clearing up of specific cache files. I have been under the impression that it was not necessary for me to check the existence of the cached file first but it looks like I have to.

Re: lazy loading?

2009-08-10 Thread Martin Westin
Typical me. I never got to my real point. I wanted to say that if you are having serious performance problems even while containing queries then that is a bit odd. What is the difference if you bench an action with the unneeded associations commented out completely (which should keep the models

Re: Storing arrays in the database (one field many values)

2009-08-10 Thread Martin Westin
I use serialization when: 1. The array is a preference hash (used for settings in plugins). This is a kind of caching to the db if you will. 2. The array is a very complex or in some other way messy structure that is only stored for logging purposes. One example is the rats-nest called MM7 (SOAP

How to handle non English text searches?

2009-07-30 Thread Martin Westin
Hi, This has been nagging at the back of my head for a long time. I feel like I should be using schema migrations. Especially for one constantly evolving app I work on. But I have not found any way that handles non English text without my interfering with the schema details directly (in MySQL in

Re: Problem with cake and HTML encoding

2009-07-09 Thread Martin Westin
Did I get this right: This problem is with datetime-fields when one of your layouts is used bit not the other. The problem looks a bit like an encoding problem (utf8/latin1) of some kind. I try to make sure that html layouts, Cake's app encoding, sql connection, database, tables and fields... in

Re: Problem with cake and HTML encoding

2009-07-09 Thread Martin Westin
Connection, the DB and all the DB's tables have the same collation (latin1_swedish_ci) - all the DateTime fields has no collation selected - Cake app has UTF-8 encoding the problem is still here :( On 9 Lug, 11:54, Martin Westin martin.westin...@gmail.com wrote: Did I get this right

Re: Conditions on 2 models with the relationship hasMany

2009-07-08 Thread Martin Westin
For your find to work the way you expect it you need to use a join in the query. hasMany doesn't do this by default. You can do the query from the other side, since belongsTo is a joining association. $results = $this-Company-Location-find('all',...); Or you you can specify a join. Check out

Poll: What do you build with CakePHP?

2009-07-08 Thread Martin Westin
I was wondering what type of apps you all build? Mainly, do you mostly build: 1. hosted applications (e.g. Bakery, TheChaw, Backpack...), hosted in a single place where every user has an account in the same instance of the application. or 2. distributable applications (e.g. Neutrino, Wordpress,

Re: Why there are so many failed requests in my cake site?

2009-06-28 Thread Martin Westin
You probably don't really have any failed requests http://www.google.com/search?q=apache+bench+failed+length I suggest looking at the top result. On Jun 27, 5:08 am, joshua josh...@gmail.com wrote: Hi Cakes, Today I use ab to give a test of my cake site, there are so many failed requests in

Re: Containable grabbing too much data

2009-06-26 Thread Martin Westin
You don't show: var $actsAs = array('Containable'); On Jun 25, 11:59 pm, Miles J mileswjohn...@gmail.com wrote: So I know how to use containable really well, but this is being weird. Its pulling ALL relations, even when I limit it with containable. Heres my models. class ArticleFavorite

Re: Cake function that does Model.Field to $array[Model][Field]

2009-06-26 Thread Martin Westin
I think that can be handled by the Set class. I am not sure if find does use that one but you can use it to get the same kind of results. If you look at a class like Configure, you can do Configure::read ('Some.dot.path') and get back the data from the equivalent array position. In there it is

Re: Any idea how re-index results?

2009-06-21 Thread Martin Westin
find('list') with multiple fields defined should also work, I think. On Jun 21, 11:50 am, Dr. Loboto drlob...@gmail.com wrote: $data = array ('Fuelprice' = Set::combine($data, 'Fuelprice.{n}.id', 'Fuelprice.{n}')); On Jun 21, 12:18 am, Petr Vytlačil petr.vytla...@gmail.com wrote: Hi,

Re: Problem with Large Datasets

2009-06-16 Thread Martin Westin
If you want to stay in Cake-land as much as possible try making use of the joins key in your options for find(). Nate wrote a nice article showing how to get going: http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find General advice (apart from your big search

Re:

2009-06-16 Thread Martin Westin
This? As in $this-recfunction... On Jun 16, 1:56 pm, lakers fan lakersfa...@msn.com wrote: Hello,      I want to write a recursive function in my users controller which will be called from the url. http://localhost/cake/users/recfunction/param1/param2 This recfunction will call itself

Re: CakePHP resources

2009-06-15 Thread Martin Westin
You seem to focus on some odd topics. http://web-funda.blogspot.com/2009/06/select-box-in-cakephp-12-generatelist.html Why? I just don't get it. Why would you ever want to enclose find ('list') in a method that mimics the old argument lists? I mean, you are not doing it to avoid re-writing an

Re: added a 'created'-field in my table, but it's not filled

2009-06-15 Thread Martin Westin
Have you allowed NULL on the created field? (and modified) I am not at all sure anymore but I have a vague memory of this being significant... and os it appears to be still: http://book.cakephp.org/view/69/created-and-modified On Jun 15, 12:04 am, Peter peterdun...@gmail.com wrote: I read

Re: cake compatibility problem

2009-06-15 Thread Martin Westin
Most likely: no. I, for one, haven't touched my config files and I also run on 1.2.2 on one server (1.2.3 for other installations). No cache problems using File engine for me. If you using some special Cache, or just the default File engine, then have a look at the changelog to see if anything

Re: How using shells inside plugin directory

2009-06-15 Thread Martin Westin
Just call it like any other shell should work asaik. For example like Mark's benchmarking shell in DebugKit: http://thechaw.com/debug_kit/wiki/docs/benchmark-shell On Jun 13, 11:04 am, marco.rizze...@gmail.com marco.rizze...@gmail.com wrote: Hi I have installed a plugin in my cakephp app.

Re: Can containable GROUP BY?

2009-06-12 Thread Martin Westin
, NO, A, B, C). The alternative to containing, I know of, is to loop the found questions and find the grouped answers for each in separate queries... or doing a custom query but I'd rather not do that. On Jun 12, 7:57 am, Martin Westin martin.westin...@gmail.com wrote: Thanks Brian, So, you have

Re: How to model a web host app?

2009-06-12 Thread Martin Westin
Sure, full domains is just a matter of modifying the way you find the correct config. Come to think of it, the code at the bakery does that already. It is the very simplest, most generic way of doing it. I have variations where it checks the root domain and only allows sub- domains. It then

Re: Containable recursive find problem

2009-06-12 Thread Martin Westin
You just go: 'contain' = array( 'Product' = array( 'conditions' = array('Product.id' = $productId), 'Module' = array( 'Subject' ) ), 'Check' ) That is: in contain you simply name the nearest associates and in each of those you name furhter associates to return. On Jun

Re: Advice about file security

2009-06-12 Thread Martin Westin
I just had a small question. Any particular reason you want to put the files on a separate server and get them via ftp? The easiest way to secure the acces to the files is (as it sounds like you are doing) to send them out through a controller/action that checks that you have purchased that

Re: Html-image outputs path relative to index.php, doesn't work if the url is (localhost)/app/controller/action

2009-06-11 Thread Martin Westin
having img in front. On 10 jun, 09:27, Martin Westin martin.westin...@gmail.com wrote: Problems with linking to images css or javascript are often the result of problems with the rewriting of urls. That is why I wanted you to check the .htaccess files were there. Also the fact that you had

Can containable GROUP BY?

2009-06-11 Thread Martin Westin
Hi, I find myself needing to get associated data grouped by a field but Containable seems to interpret the group key as an extra field to include. @line 267 containable specifies a bunch of valid options but groups is not one of them. Trying to be cheeky and adding group to the list makes the

Re: Can containable GROUP BY?

2009-06-11 Thread Martin Westin
Thanks Brian, So, you have to trick Containable by puting it into a condition ... like the good old days :) /Martin On Jun 11, 6:01 pm, brian bally.z...@gmail.com wrote: Have a look at this thread: http://groups.google.com/group/cake-php/browse_thread/thread/4b1351b6... On Thu, Jun 11,

Re: Html-image outputs path relative to index.php, doesn't work if the url is (localhost)/app/controller/action

2009-06-10 Thread Martin Westin
/controller/ action/parameter, because the image doesn't exist in /controller/ action/img/image.gif. Maybe this has to do with the default.ctp being rendered before it is passed to the action, so it doens't know how to construct the url for the action? On 9 jun, 16:20, Martin Westin martin.westin

Re: Wizard Component and Routes

2009-06-10 Thread Martin Westin
I have used the wizard component (the one found at the bakery) a little and I don't think is supports routes like that out of the box. You might be able to trick it (but probably not) by dynamically setting $this-Wizard-wizardAction to the desired path. I have stored data in the session at the

Re: List of protected class names

2009-06-10 Thread Martin Westin
The list could be long if you wanted to be complete. Look at the api for a good start. Any class-name there is reserved and could cause trouble. http://api.cakephp.org/classes The only ones I have come across in real life have been File and Folder. I had a file manager app using those

Re: Html-image outputs path relative to index.php, doesn't work if the url is (localhost)/app/controller/action

2009-06-09 Thread Martin Westin
believe I was the only one with this problem... On 8 jun, 16:11, Martin Westin martin.westin...@gmail.com wrote: Not a bug. You either have a configuration problem or just missed how your install does its redirection. You should never have to use app in your urls. try using urls like

Re: bug in recursive?

2009-06-08 Thread Martin Westin
Another hint: When the data is not joined you can also do dynamic ordering on the related data (not the primary data by the related values though) using Containable Behaviour. On Jun 7, 10:04 pm, fain182 fain...@gmail.com wrote: In your Sito model, set your default sort order like so:    

Re: Accounting Application with CakePHP

2009-06-08 Thread Martin Westin
If you have a good feeling about Cake: Go for it! Dealing with complex data relationships is one of the areas where a quality framework (CakePHP) will really help you stay sane. Associations are 90% automatic once setup. (you might find one or two situations where you want to use your own query)

Re: bug in recursive?

2009-06-08 Thread Martin Westin
If you are querying Category you specify the order for Catrgory in the find, using order like normal. The SubCategory data will (should) use the order specified in the relationship written in the Category model and the order for Item should by default be what is defined in SubCategory. Using

Re: Postgresql unix socket

2009-06-08 Thread Martin Westin
I have never used Postgres but shouldn't you specify only the folder where the socket is located for Postgres? From what I can read of how the connection works you should: host == folder to socket port == null The manual page you link to describes database configs in general. My interpretation

<    1   2   3   4   5   >