Re: String concatenation not working

2007-11-12 Thread Baz
There is no asynchronous call done during an HTTP GET/POST unless you're
running PHP with FastCGI or something. And even then, there's a lot of other
parameters. PHP scripts stop when the client connection dies.

If *all* we're looking for is a database backup, there are prewritten
scripts that already do that...and there is a free cron service that you can
use.

I really don't get why we're making this so hard. But maybe that's just me,
I'm lazy that way.
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Nov 12, 2007 12:21 PM, technicaltitch <[EMAIL PROTECTED]> wrote:

>
> That is exactly how I intend to kick this off thanksif I ever get
> it working!
>
> (By sticking the code after the redirect call the backup will
> presumably be dealt with asynchronously.)
>
> On Nov 12, 4:19 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> > you could also do a 'lazy mans' cron. and just have a script that is
> > kicked off the first time a web page is loaded every n-days.  I use
> > the robots.txt because I really don't care too much if once every
> > month late at night it takes a while to load.  I also dynamically
> > generate that page for a couple of other reasons.
> >
> > Sam D
> >
> > On 11/12/07, technicaltitch <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Thanks very much for your help, but I'm afraid I don't have a
> > > workstation to run this from. Also, having this arrive at people's
> > > inboxes is incredibly convenient. I'm just at a complete loss as to
> > > why the string concatenation doesn't work.
> >
> > > On Nov 12, 1:08 pm, Guillaume <[EMAIL PROTECTED]> wrote:
> > > > If your host allows it, you can use your own workstation and program
> a
> > > > script that periodically does something like
> >
> > > > mysqldump -C --host DB_HOSTNAME -u USERNAME -p PASSWORD DB_NAME >
> > > > mysdump.sql
> >
> > > > over the network.
> >
> > > > Your mysql needs to be reachable from outside the server.
> >
> > > > My host used to allow it and it was a very convenient and quick
> (owing
> > > > to the C option) way to backup a database remotely.
> >
> > > > There can be security hazards though (but sending the dump via email
> > > > too).
> >
> > > > Guillaumehttp://cherryonthe.popnews.com
> >
> > > > On 12 nov, 10:21, technicaltitch <[EMAIL PROTECTED]> wrote:
> >
> > > > > surely it is easier to concatenate a string in PHP than change my
> > > > > host?! i'm keen to hear of workarounds, but mostly hoping for help
> > > > > with the string handling.
> >
> > > > > our hosting is US$11 per year which is incredibly competitive, we
> are
> > > > > very happy with their service (faultless in several years) and
> > > > > familiar with the setup - and every single cent makes a difference
> in
> > > > > bolivia. ( they are bargainvault.com and the website i'm replacing
> iswww.intiwarayassi.org)
> >
> > > > > On Nov 11, 9:55 pm, Steve Boyd <[EMAIL PROTECTED]> wrote:
> >
> > > > > > then changes your host.  there is incredibly cheap hosting
> everywhere
> > > > > > (well within the USA anyhow) that allows you cron jobs + all the
> other
> > > > > > bells and whistles
> >
> > > > > > On Nov 12, 8:37 am, technicaltitch <[EMAIL PROTECTED]>
> wrote:
> >
> > > > > > > because it's for a bolivian volunteer organization we're using
> > > > > > > incredibly cheap hosting which doesn't allow us cron jobs. i
> thought
> > > > > > > this would be trivial.
> >
> > > > > > > On Nov 11, 5:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > > On Nov 11, 1:33 pm, technicaltitch <[EMAIL PROTECTED]>
> wrote:
> > > > > > > > 
> >
> > > > > > > > Why would you not use mysqldump and a cron job?
> >
> > > > > > > > AD- Hide quoted text -
> >
> > > > > > - Show quoted text -- Hide quoted text -
> >
> > > > - Show quoted text -
> >
> > --
> > (the old fart) the advice is free, the lack of crankiness will cost you
> >
> > - its a fine line between a real question and an idiot
> >
> > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/-Hide
> >  quoted text -
> >
> > - Show quoted text -
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Transform column names

2007-11-12 Thread mmalca

That's a good idea (why didn't occur to me?). Tnx.

On Nov 13, 5:21 am, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
> Assuming your db supports views, I'd probably just build some
> read/write db views that hide the ugly column names with the names
> you'd prefer to use, and then use the views as the $table for your
> model etc.
>
> Wayne
>
> On 11/12/07, mmalca <[EMAIL PROTECTED]> wrote:
>
>
>
> > Iam looking for a way to transform column names (behaviour perhaps?).
> > I have an existing database with very confusing column names (like
> > FP002EX - remember Fortran) and would like to display/use/edit them in
> > cakephp via friendlier name: eg FP002EX -> title
>
> > Something like:
>
> > class MyModel extends AppModel {
> > var $actsAs = array('transnames');
> > var $transNames = array('FP002EX'=>'title',...);
> > }
>
> > controller usage:
> > $this->data['MyModel']['title'] = 'New title'; // would set FP002EX
> > $this->save($this->data);
>
> > Is there an existing solution to my problem? Can someone point me to
> > the best way for implementing this behaviour?
> > Tnx


--~--~-~--~~~---~--~~
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: Newbie: how can I do this?

2007-11-12 Thread Baz
Yes,

It is a database design question.

No you can't relate them in the users table because a user can have more
than one friend. I think this is what they are suggesting:

Table: friends_users
id - int
user_id - int
friend_id - int


In this case, I don't think you would use a *friends* table. When looking up
user with id = 1, you'd have to query his friends separately. Without giving
it too much thought, there would be two queries for his friends:

select friend_id from user_friend where user_id = 1
and
select user_id from user_friend where friend_id = 1

Off the top of my head, I would perform these two searches in my controller
and merge both results into an array. But that's just my lazy code talking.
Keep in mind, I'm not too good with the HABTM association.

Good luck
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Nov 12, 2007 9:42 PM, mbavio <[EMAIL PROTECTED]> wrote:

>
> Baz,
>
> Thanks for your quickly answer. By the way, I´ve read your blog. Great
> articles!
>
> Going back to my problem...
>
> Beyond making Bob and Tim friends, what I wanna know is what to put in
> the Friends table... The IDs of the Users again? Isnt that a useless
> repetition? Cant I simply relate the Users in the same table? I think
> this issue is beyond I´m using Cake, Ruby or Assembler... It´s a
> question of database design, and I´m simply lost... Any brillant idea?
>
> Martin Bavio
>
> On Nov 13, 12:24 am, Baz <[EMAIL PROTECTED]> wrote:
> > Hmmmph,
> >
> > I was wondering that myself. The easy way is to do what's suggested
> above,
> > but duplicate and entry for each relationship:
> >
> > Eg. When Bob becomes Tim's friend (in the before/afterSave) force and
> entry
> > that makes Tim Bob's friend.
> >
> > Of you could have one relationship and simply check the "other
> direction"
> > logically in your controllers. But I don't think there are any easy Cake
> > answers.
> > --
> > Baz L
> > Web Development 2.0: Web Design, CakePHP,
> Javascripthttp://www.WebDevelopment2.com/
> >
> > On Nov 12, 2007 9:14 PM, mbavio <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Christopher:
> >
> > > I understand the basics behind Cake´s HATBM, but I do not understand
> > > how to implement here... You have to notice that "Friends" are also
> > > "Users", so I dont know how to build the tables. Should I put the same
> > > id in both tables? If not, what is the primary key in the "Friends"
> > > table?
> > > This case is typical in a CMS, where you want to let the user make
> > > "friends" in the community. Anybody who has solved this particular
> > > problem?
> >
> > > Thanks.
> >
> > > On Nov 12, 7:43 pm, "Christopher E. Franklin, Sr."
> > > <[EMAIL PROTECTED]> wrote:
> > > > Yes, this is a HABTM relationship both ways between friends and
> > > > users.  Define the $hasAndBelongsToMany variable at the top of each
> > > > model appropriately and then make an extra db table named:
> > > > friends_users and within the table, you will have two fields,
> > > > friend_id and user_id.
> >
> > > > After you have a few users and friends, if you want to see a user's
> > > > friend of a friend of a friend, you use, the recursive option for
> the
> > > > model:
> > > > eg-
> > > > $this->User->recursive = 1;
> >
> > > > The higher you go, the more levels deep will get returned
> >
> > > > On Nov 12, 2:20 pm, mbavio <[EMAIL PROTECTED]> wrote:
> >
> > > > > I have a 'User' model, and I want that my Users can have Friends,
> > > > > being Friends other Users. Is this a "self HATBM"? How can I solve
> > > > > this problem?
> >
> > > > > Thanks.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Schema generation

2007-11-12 Thread Dr. Tarique Sani

On Nov 12, 2007 11:16 PM, Gwoo <[EMAIL PROTECTED]> wrote:
>
> run 'cake schema help' from the command line.
>

Just tried it to generate a schema - barfs on the enum fields

Warning: Schema generation error: invalid column type enum('no','yes')
does not exist in DBO in
/home/tarique/apps/xampp-linux-1.6/lampp/htdocs/cheesecake2/cake/libs/model/schema.php
on line 423

Cheers
Tarique

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Transform column names

2007-11-12 Thread Wayne Fay

Assuming your db supports views, I'd probably just build some
read/write db views that hide the ugly column names with the names
you'd prefer to use, and then use the views as the $table for your
model etc.

Wayne

On 11/12/07, mmalca <[EMAIL PROTECTED]> wrote:
>
> Iam looking for a way to transform column names (behaviour perhaps?).
> I have an existing database with very confusing column names (like
> FP002EX - remember Fortran) and would like to display/use/edit them in
> cakephp via friendlier name: eg FP002EX -> title
>
> Something like:
>
> class MyModel extends AppModel {
> var $actsAs = array('transnames');
> var $transNames = array('FP002EX'=>'title',...);
> }
>
> controller usage:
> $this->data['MyModel']['title'] = 'New title'; // would set FP002EX
> $this->save($this->data);
>
> Is there an existing solution to my problem? Can someone point me to
> the best way for implementing this behaviour?
> Tnx
>
>
> >
>

--~--~-~--~~~---~--~~
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: Newbie: how can I do this?

2007-11-12 Thread mbavio

Baz,

Thanks for your quickly answer. By the way, I´ve read your blog. Great
articles!

Going back to my problem...

Beyond making Bob and Tim friends, what I wanna know is what to put in
the Friends table... The IDs of the Users again? Isnt that a useless
repetition? Cant I simply relate the Users in the same table? I think
this issue is beyond I´m using Cake, Ruby or Assembler... It´s a
question of database design, and I´m simply lost... Any brillant idea?

Martin Bavio

On Nov 13, 12:24 am, Baz <[EMAIL PROTECTED]> wrote:
> Hmmmph,
>
> I was wondering that myself. The easy way is to do what's suggested above,
> but duplicate and entry for each relationship:
>
> Eg. When Bob becomes Tim's friend (in the before/afterSave) force and entry
> that makes Tim Bob's friend.
>
> Of you could have one relationship and simply check the "other direction"
> logically in your controllers. But I don't think there are any easy Cake
> answers.
> --
> Baz L
> Web Development 2.0: Web Design, CakePHP, 
> Javascripthttp://www.WebDevelopment2.com/
>
> On Nov 12, 2007 9:14 PM, mbavio <[EMAIL PROTECTED]> wrote:
>
>
>
> > Christopher:
>
> > I understand the basics behind Cake´s HATBM, but I do not understand
> > how to implement here... You have to notice that "Friends" are also
> > "Users", so I dont know how to build the tables. Should I put the same
> > id in both tables? If not, what is the primary key in the "Friends"
> > table?
> > This case is typical in a CMS, where you want to let the user make
> > "friends" in the community. Anybody who has solved this particular
> > problem?
>
> > Thanks.
>
> > On Nov 12, 7:43 pm, "Christopher E. Franklin, Sr."
> > <[EMAIL PROTECTED]> wrote:
> > > Yes, this is a HABTM relationship both ways between friends and
> > > users.  Define the $hasAndBelongsToMany variable at the top of each
> > > model appropriately and then make an extra db table named:
> > > friends_users and within the table, you will have two fields,
> > > friend_id and user_id.
>
> > > After you have a few users and friends, if you want to see a user's
> > > friend of a friend of a friend, you use, the recursive option for the
> > > model:
> > > eg-
> > > $this->User->recursive = 1;
>
> > > The higher you go, the more levels deep will get returned
>
> > > On Nov 12, 2:20 pm, mbavio <[EMAIL PROTECTED]> wrote:
>
> > > > I have a 'User' model, and I want that my Users can have Friends,
> > > > being Friends other Users. Is this a "self HATBM"? How can I solve
> > > > this problem?
>
> > > > Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Newbie: how can I do this?

2007-11-12 Thread Baz
Hmmmph,

I was wondering that myself. The easy way is to do what's suggested above,
but duplicate and entry for each relationship:

Eg. When Bob becomes Tim's friend (in the before/afterSave) force and entry
that makes Tim Bob's friend.

Of you could have one relationship and simply check the "other direction"
logically in your controllers. But I don't think there are any easy Cake
answers.
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Nov 12, 2007 9:14 PM, mbavio <[EMAIL PROTECTED]> wrote:

>
> Christopher:
>
> I understand the basics behind Cake´s HATBM, but I do not understand
> how to implement here... You have to notice that "Friends" are also
> "Users", so I dont know how to build the tables. Should I put the same
> id in both tables? If not, what is the primary key in the "Friends"
> table?
> This case is typical in a CMS, where you want to let the user make
> "friends" in the community. Anybody who has solved this particular
> problem?
>
> Thanks.
>
>
>
> On Nov 12, 7:43 pm, "Christopher E. Franklin, Sr."
> <[EMAIL PROTECTED]> wrote:
> > Yes, this is a HABTM relationship both ways between friends and
> > users.  Define the $hasAndBelongsToMany variable at the top of each
> > model appropriately and then make an extra db table named:
> > friends_users and within the table, you will have two fields,
> > friend_id and user_id.
> >
> > After you have a few users and friends, if you want to see a user's
> > friend of a friend of a friend, you use, the recursive option for the
> > model:
> > eg-
> > $this->User->recursive = 1;
> >
> > The higher you go, the more levels deep will get returned
> >
> > On Nov 12, 2:20 pm, mbavio <[EMAIL PROTECTED]> wrote:
> >
> > > I have a 'User' model, and I want that my Users can have Friends,
> > > being Friends other Users. Is this a "self HATBM"? How can I solve
> > > this problem?
> >
> > > Thanks.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Newbie: how can I do this?

2007-11-12 Thread mbavio

Christopher:

I understand the basics behind Cake´s HATBM, but I do not understand
how to implement here... You have to notice that "Friends" are also
"Users", so I dont know how to build the tables. Should I put the same
id in both tables? If not, what is the primary key in the "Friends"
table?
This case is typical in a CMS, where you want to let the user make
"friends" in the community. Anybody who has solved this particular
problem?

Thanks.



On Nov 12, 7:43 pm, "Christopher E. Franklin, Sr."
<[EMAIL PROTECTED]> wrote:
> Yes, this is a HABTM relationship both ways between friends and
> users.  Define the $hasAndBelongsToMany variable at the top of each
> model appropriately and then make an extra db table named:
> friends_users and within the table, you will have two fields,
> friend_id and user_id.
>
> After you have a few users and friends, if you want to see a user's
> friend of a friend of a friend, you use, the recursive option for the
> model:
> eg-
> $this->User->recursive = 1;
>
> The higher you go, the more levels deep will get returned
>
> On Nov 12, 2:20 pm, mbavio <[EMAIL PROTECTED]> wrote:
>
> > I have a 'User' model, and I want that my Users can have Friends,
> > being Friends other Users. Is this a "self HATBM"? How can I solve
> > this problem?
>
> > Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: String concatenation not working

2007-11-12 Thread Baz
Wow,
And I thought I was cheap. No worries dude. Read the next two posts and you
shouldn't have to go through all this headache. I've been using them for
years before I just ponied up the money for a better host.

http://www.webdevelopment2.com/automate-database-backup-webcron-cron-jobs-problem/
http://www.webdevelopment2.com/automate-mysql-database-backup-webcron-cron-jobs-problem-part-2/

FYI, a cheap host (especially one that cheap) is going to come back and bite
you in the but. And it will be worse than just lack of cron jobs. Trust me,
you get what you pay for.
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Nov 12, 2007 8:37 PM, Samuel DeVore <[EMAIL PROTECTED]> wrote:

>
> is it possible that those sql dumps could be popping php's memory?
>
> On 11/12/07, igor <[EMAIL PROTECTED]> wrote:
> >
> > Have you tried to debug() those seperately?
> >
> > Like...
> > debug($sql_string);
> > debug($sql_string[1]);
> > debug($sql_string2);
> > debug($sql_string3);
> >
> > Maybe that could help to see where you lose your data?
> >
> > Hope this helps..
> >
> >
> > >
> >
>
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Why use formhelpers?

2007-11-12 Thread Baz
Sorry, my bad. You're right.


--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Nov 12, 2007 4:26 PM, Marcin Jaworski <[EMAIL PROTECTED]> wrote:

>
> It should be name="data[Model][field]", not id :).
>
> On 12 Lis, 22:22, Baz <[EMAIL PROTECTED]> wrote:
> > You could just forgo the form helper and make the form yourself I guess.
> >
> > The IDs used to send stuff to $this->data are pretty self explanitory:
> > id="data[Model][field]"
> > --
> > Baz L
> > Web Development 2.0: Web Design, CakePHP,
> Javascripthttp://www.WebDevelopment2.com/
> >
> > On Nov 12, 2007 2:34 PM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > On 11/12/07, MikeK <[EMAIL PROTECTED]> wrote:
> >
> > > > Ths is not meant to be disrespectful in anyway -- I love cake and it
> > > > has been a productivity boon, and I respect all that contribute to
> it.
> > > > However as I continue to develop cake code I have found myself
> > > > wondering why I am using the form helpers at all. It has been moving
> > > > through various CSS templates that has brought me to this point.
> >
> > > In the same vein (not to be disrespectful) but the form helpers help
> > > you make forms. :) now if you are picky about how you want your forms
> > > to look you probably won't want to use them.  But I think that goes
> > > with all helpers.  In the old HtmlHelper did all the stuff and
> > > formsHelper was a waste of bits.  I used the html helper as a kind of
> > > base class and built on it for MyHtmlHelper  and  I will probably do
> > > the same thing as I get more picky about the output in the "brave new
> > > world" of 1.2  (I'm a bit of an engineer so it is possible that might
> > > never happen, I'm more concerned about the pig then the lipstick ;)
> >
> > > But I have to say that the best way to try to get a change implemented
> > > is tickets with patches.  In my way of looking at it the thing that I
> > > will probably want to override the most is the wrapper function that
> > > kind of makes it all look so clean in the code and so pretty in the
> > > result, at least when my css/designer god (his name is Lance and you
> > > can't have him) is done with it.
> >
> > > I look at the helpers like I do the scaffold and bake results.  Great
> > > place to start but probably going to need some tuning before
> > > production.
> >
> > > Sam D
> > > --
> > > (the old fart) the advice is free, the lack of crankiness will cost
> you
> >
> > > - its a fine line between a real question and an idiot
> >
> > >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: unbind a behavior / ActsAs

2007-11-12 Thread Zoltan

Thanks for the help - I ended up going with the:
unset($this->Photo->behaviors['file']);

from SANIsoft - worked perfectly, hope it makes it into Cake 1.2 as a
regular feature.

Zoltan
www.yyztech.ca



On Nov 11, 4:55 pm, francky06l <[EMAIL PROTECTED]> wrote:
> There is also something about this there :
>
> http://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-ru...
>
> On Nov 11, 8:58 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Nov 11, 7:49 pm, Zoltan <[EMAIL PROTECTED]> wrote:
>
> > > I'm doing a save on a model inside a controller to update one field,
> > > however it is triggering a behavior attached to that model. Is there a
> > > way to temporarily (like unbind) disable this ActAs so it isn't
> > > called.
>
> > > Zoltanwww.yyztech.ca
>
> >https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/model/beh...
>
> > and put something like:
>
> > function enable(&$model, $enable = null) {
> > if ($enable !== null) {
> > $this->settings[$model->name]['enabled'] = $enable;
> > }
> > return $this->settings[$model->name]['enabled'];
> > }
>
> > in your behavior such that you have a means to edit this parameter.
>
> > hth,
>
> > AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: String concatenation not working

2007-11-12 Thread Samuel DeVore

is it possible that those sql dumps could be popping php's memory?

On 11/12/07, igor <[EMAIL PROTECTED]> wrote:
>
> Have you tried to debug() those seperately?
>
> Like...
> debug($sql_string);
> debug($sql_string[1]);
> debug($sql_string2);
> debug($sql_string3);
>
> Maybe that could help to see where you lose your data?
>
> Hope this helps..
>
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Unit testing in 1.1

2007-11-12 Thread Samuel DeVore

Isn't that what the http://cakeforge.org/projects/testsuite/ was for?
I know I have at least one old 1.1 site using it.  I thought

On 11/12/07, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
>
>  Hey Steve,
>
>  Hey I'm wondering what the best way to running unit tests in cake
> 1.1. I notice in /config/database.php there is a config for a test
> database, so this functionality must be built in somewhere...
>
>  No. Afaik there is no official support for unit testing in Cake 1.1. You
> should still be able to use PhpUnit or SimpleTest to hack something together
> of your own.
>
>  -- Felix
>  --
>  Blogger: http://www.thinkingphp.org/
>  Entrepreneur: http://www.posttask.com/ -- currently in private beta, ask me
> for invite / password
>  Freelancer: http://www.fg-webdesign.de/
>
>
> AIM:theundefined87
> Skype:TimeFor23
> Other IM:felixge.de
> Mobile (USA):+1 404 3888693
> Mobile (GER):+49 162 9391612
> Twitter:http://twitter.com/felixge
>
>
>  Steve Boyd wrote:
>  Hey I'm wondering what the best way to running unit tests in cake
> 1.1. I notice in /config/database.php there is a config for a test
> database, so this functionality must be built in somewhere...
>
>
>
>
>
>
>  >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



habtm problem

2007-11-12 Thread Dianne van Dulken

Hi there,

I have a problem with a has and belongs to many association, and I was
hoping that I could get some help, as none of the ones I have found so
far seem to be working.

I have a table, teasers, which is associated with another table,
articles.  Pretty standard connection

table:  articles_teasers
article_id
teaser_id

In my teaser view, I want the user to be able to define the articles
by means of a comma delimited list.  I'm populating this fine, by
using implode.  I am getting the array back from the list fine, by
using explode, in beforeSave.

My problem is now that I am having trouble actually getting this to
save.

I thought I had found a solution at the bakery
http://bakery.cakephp.org/articles/view/add-delete-habtm-behavior.  I
still think this is probably the correct solution, but when I try to
use it, I get

Notice (8): Undefined property:  Teaser::$Teaser [APP\models
\teaser.php, line 70]

and can't work out how to fix this.  If I call the habtmAdd function
as $this->habtmAdd('Teaser', 'Article' etc, it doesn't throw an error,
but doesn't save either.

The relevant bits of my model are:

class Teaser extends AppModel {

  var $name = 'Teaser';
 var $actsAs = 'ExtendAssociations';
var $belongsTo = array('Section');
var $hasAndBelongsToMany = array(
'Sections'=>array('className'=>'Section'),
'Articles'=>array('className'=>'Article',
'joinTable' => 'articles_teasers',
'foreignKey' => 'teaser_id',
'associationForeignKey' => 'article_id',
'conditions'=>'`pub_status` = 1',
'order'=>'title'));
var $order = 'title';

function generateLinkedArticlesList($id = null) {
$articleids = array();
if (isset($this->data['Articles'])) {
foreach ($this->data['Articles'] as $article) {
array_push($articleids,
$article['id'] );
}
} else if (isset($this->data['Teaser']['articles'] )){
 return $this->data['Teaser']['articles'];
}
return implode(",", $articleids);

}



   function beforeSave() {
   $articles =  explode(",", $_POST["data"]['Teaser']
["articles"]);
   $this->Teaser->habtmAdd('Article',  $this->data['Teaser']
['id'], $articles);
   return parent::beforeSave();
   //return false;

   }

Any ideas?

Thanks a lot

Di


--~--~-~--~~~---~--~~
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: Why use formhelpers?

2007-11-12 Thread Grant Cox

Just make your own helper that extends/uses the form helper, but puts
the appropriate surrounding elements for your site.


--~--~-~--~~~---~--~~
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: Why use formhelpers?

2007-11-12 Thread MikeK

Thanks for the replies guys -- I'll read those references. Like I
said, no disrespect intended, and I'm not asking for changes nor
claiming any of this is a bug. Generally I am "picky" about how things
look, and anyone building a production site should be "picky" -- it's
either the way it should look or it's not ;) Technology should be an
enabler, not something you find yourself spending time to "go around".
It's just one of those little areas that for me has turned into the
less than 5% of the CakePHP architecture that falls into "go around"
rather than enabling.

Are you sure you don't want to share your CSS guru? lol UI code is
such an art in itself, it just kills me to dedicate such effort to
look and feel rather than function, but as my UI gurus point out it
either looks as good as it can or it doesn't!


--~--~-~--~~~---~--~~
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: blog tutorial not working with simple user authentification tutorial?

2007-11-12 Thread L

My CAKE_SECURITY is set to "medium", but I'm still redirected to the
login page.
So, my session is never saved in the users_controller?


--~--~-~--~~~---~--~~
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: Controller Named "Folders"

2007-11-12 Thread strykstaguy

thanks

On Nov 12, 4:10 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> Yes there is a cakephp class with that name see the api
>
> http://api.cakephp.org/1.2/class_folder.html
>
> and then
>
> http://api.cakephp.org/1.2/classes.htmlfor the future
>
> Sam D
>
> On 11/12/07, strykstaguy <[EMAIL PROTECTED]> wrote:
>
>
>
> > Stupid question, I am working on a project and have a database named
> > "folders" and the model "folder" and controller
> > "folders_controller.php" i keep getting
>
> > Fatal error: Call to undefined method Folder::findAll() in E:\Program
> > Files\xampp\htdocs\project\app\controllers\folders_controller.php on
> > line 6
>
> > When i renamed everythign to "tag" and "tags" it worked properly, is
> > there a conflict when using the name "folder"
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: String concatenation not working

2007-11-12 Thread igor

Have you tried to debug() those seperately?

Like...
debug($sql_string);
debug($sql_string[1]);
debug($sql_string2);
debug($sql_string3);

Maybe that could help to see where you lose your data?

Hope this helps..


--~--~-~--~~~---~--~~
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: Unit testing in 1.1

2007-11-12 Thread Felix Geisendörfer
Hey Steve,
> Hey I'm wondering what the best way to running unit tests in cake
> 1.1.  I notice in /config/database.php there is a config for a test
> database, so this functionality must be built in somewhere...
>   
No. Afaik there is no official support for unit testing in Cake 1.1. You 
should still be able to use PhpUnit or SimpleTest to hack something 
together of your own.

-- Felix
--
Blogger: http://www.thinkingphp.org/
Entrepreneur: http://www.posttask.com/ /-- currently in private beta, 
ask me for invite / password/
Freelancer: http://www.fg-webdesign.de/

AIM:theundefined87
Skype:  TimeFor23
Other IM:   felixge.de 
Mobile (USA):   +1 404 3888693
Mobile (GER):   +49 162 9391612
Twitter:http://twitter.com/felixge



Steve Boyd wrote:
> Hey I'm wondering what the best way to running unit tests in cake
> 1.1.  I notice in /config/database.php there is a config for a test
> database, so this functionality must be built in somewhere...
>
>
> >
>
>   

--~--~-~--~~~---~--~~
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: Newbie: how can I do this?

2007-11-12 Thread Christopher E. Franklin, Sr.

Yes, this is a HABTM relationship both ways between friends and
users.  Define the $hasAndBelongsToMany variable at the top of each
model appropriately and then make an extra db table named:
friends_users and within the table, you will have two fields,
friend_id and user_id.

After you have a few users and friends, if you want to see a user's
friend of a friend of a friend, you use, the recursive option for the
model:
eg-
$this->User->recursive = 1;

The higher you go, the more levels deep will get returned

On Nov 12, 2:20 pm, mbavio <[EMAIL PROTECTED]> wrote:
> I have a 'User' model, and I want that my Users can have Friends,
> being Friends other Users. Is this a "self HATBM"? How can I solve
> this problem?
>
> Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Why use formhelpers?

2007-11-12 Thread Marcin Jaworski

It should be name="data[Model][field]", not id :).

On 12 Lis, 22:22, Baz <[EMAIL PROTECTED]> wrote:
> You could just forgo the form helper and make the form yourself I guess.
>
> The IDs used to send stuff to $this->data are pretty self explanitory:
> id="data[Model][field]"
> --
> Baz L
> Web Development 2.0: Web Design, CakePHP, 
> Javascripthttp://www.WebDevelopment2.com/
>
> On Nov 12, 2007 2:34 PM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 11/12/07, MikeK <[EMAIL PROTECTED]> wrote:
>
> > > Ths is not meant to be disrespectful in anyway -- I love cake and it
> > > has been a productivity boon, and I respect all that contribute to it.
> > > However as I continue to develop cake code I have found myself
> > > wondering why I am using the form helpers at all. It has been moving
> > > through various CSS templates that has brought me to this point.
>
> > In the same vein (not to be disrespectful) but the form helpers help
> > you make forms. :) now if you are picky about how you want your forms
> > to look you probably won't want to use them.  But I think that goes
> > with all helpers.  In the old HtmlHelper did all the stuff and
> > formsHelper was a waste of bits.  I used the html helper as a kind of
> > base class and built on it for MyHtmlHelper  and  I will probably do
> > the same thing as I get more picky about the output in the "brave new
> > world" of 1.2  (I'm a bit of an engineer so it is possible that might
> > never happen, I'm more concerned about the pig then the lipstick ;)
>
> > But I have to say that the best way to try to get a change implemented
> > is tickets with patches.  In my way of looking at it the thing that I
> > will probably want to override the most is the wrapper function that
> > kind of makes it all look so clean in the code and so pretty in the
> > result, at least when my css/designer god (his name is Lance and you
> > can't have him) is done with it.
>
> > I look at the helpers like I do the scaffold and bake results.  Great
> > place to start but probably going to need some tuning before
> > production.
>
> > Sam D
> > --
> > (the old fart) the advice is free, the lack of crankiness will cost you
>
> > - its a fine line between a real question and an idiot
>
> >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Newbie: how can I do this?

2007-11-12 Thread mbavio

I have a 'User' model, and I want that my Users can have Friends,
being Friends other Users. Is this a "self HATBM"? How can I solve
this problem?

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Controller Named "Folders"

2007-11-12 Thread Samuel DeVore

Yes there is a cakephp class with that name see the api

http://api.cakephp.org/1.2/class_folder.html

and then

http://api.cakephp.org/1.2/classes.html for the future

Sam D

On 11/12/07, strykstaguy <[EMAIL PROTECTED]> wrote:
>
> Stupid question, I am working on a project and have a database named
> "folders" and the model "folder" and controller
> "folders_controller.php" i keep getting
>
> Fatal error: Call to undefined method Folder::findAll() in E:\Program
> Files\xampp\htdocs\project\app\controllers\folders_controller.php on
> line 6
>
> When i renamed everythign to "tag" and "tags" it worked properly, is
> there a conflict when using the name "folder"
>
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Controller Named "Folders"

2007-11-12 Thread strykstaguy

Stupid question, I am working on a project and have a database named
"folders" and the model "folder" and controller
"folders_controller.php" i keep getting

Fatal error: Call to undefined method Folder::findAll() in E:\Program
Files\xampp\htdocs\project\app\controllers\folders_controller.php on
line 6

When i renamed everythign to "tag" and "tags" it worked properly, is
there a conflict when using the name "folder"


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Unit testing in 1.1

2007-11-12 Thread Steve Boyd

Hey I'm wondering what the best way to running unit tests in cake
1.1.  I notice in /config/database.php there is a config for a test
database, so this functionality must be built in somewhere...


--~--~-~--~~~---~--~~
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: Why use formhelpers?

2007-11-12 Thread Baz
You could just forgo the form helper and make the form yourself I guess.

The IDs used to send stuff to $this->data are pretty self explanitory:
id="data[Model][field]"
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Nov 12, 2007 2:34 PM, Samuel DeVore <[EMAIL PROTECTED]> wrote:

>
> On 11/12/07, MikeK <[EMAIL PROTECTED]> wrote:
> >
> > Ths is not meant to be disrespectful in anyway -- I love cake and it
> > has been a productivity boon, and I respect all that contribute to it.
> > However as I continue to develop cake code I have found myself
> > wondering why I am using the form helpers at all. It has been moving
> > through various CSS templates that has brought me to this point.
> >
>
> In the same vein (not to be disrespectful) but the form helpers help
> you make forms. :) now if you are picky about how you want your forms
> to look you probably won't want to use them.  But I think that goes
> with all helpers.  In the old HtmlHelper did all the stuff and
> formsHelper was a waste of bits.  I used the html helper as a kind of
> base class and built on it for MyHtmlHelper  and  I will probably do
> the same thing as I get more picky about the output in the "brave new
> world" of 1.2  (I'm a bit of an engineer so it is possible that might
> never happen, I'm more concerned about the pig then the lipstick ;)
>
> But I have to say that the best way to try to get a change implemented
> is tickets with patches.  In my way of looking at it the thing that I
> will probably want to override the most is the wrapper function that
> kind of makes it all look so clean in the code and so pretty in the
> result, at least when my css/designer god (his name is Lance and you
> can't have him) is done with it.
>
> I look at the helpers like I do the scaffold and bake results.  Great
> place to start but probably going to need some tuning before
> production.
>
> Sam D
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Why use formhelpers?

2007-11-12 Thread Samuel DeVore

On 11/12/07, MikeK <[EMAIL PROTECTED]> wrote:
>
> Ths is not meant to be disrespectful in anyway -- I love cake and it
> has been a productivity boon, and I respect all that contribute to it.
> However as I continue to develop cake code I have found myself
> wondering why I am using the form helpers at all. It has been moving
> through various CSS templates that has brought me to this point.
>

In the same vein (not to be disrespectful) but the form helpers help
you make forms. :) now if you are picky about how you want your forms
to look you probably won't want to use them.  But I think that goes
with all helpers.  In the old HtmlHelper did all the stuff and
formsHelper was a waste of bits.  I used the html helper as a kind of
base class and built on it for MyHtmlHelper  and  I will probably do
the same thing as I get more picky about the output in the "brave new
world" of 1.2  (I'm a bit of an engineer so it is possible that might
never happen, I'm more concerned about the pig then the lipstick ;)

But I have to say that the best way to try to get a change implemented
is tickets with patches.  In my way of looking at it the thing that I
will probably want to override the most is the wrapper function that
kind of makes it all look so clean in the code and so pretty in the
result, at least when my css/designer god (his name is Lance and you
can't have him) is done with it.

I look at the helpers like I do the scaffold and bake results.  Great
place to start but probably going to need some tuning before
production.

Sam D
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Why use formhelpers?

2007-11-12 Thread Wayne Fay

I don't disagree with many of your comments.

I've run into some form issues too, but I've posted them and some have
already been resolved:
https://trac.cakephp.org/ticket/3317
https://trac.cakephp.org/ticket/3354
https://trac.cakephp.org/ticket/3412

I don't think  should be automatic either. Perhaps post a couple
bugs (with patches!) and track them for a bit. If they make sense,
they will probably be accepted.

Wayne

On 11/12/07, MikeK <[EMAIL PROTECTED]> wrote:
>
> Ths is not meant to be disrespectful in anyway -- I love cake and it
> has been a productivity boon, and I respect all that contribute to it.
> However as I continue to develop cake code I have found myself
> wondering why I am using the form helpers at all. It has been moving
> through various CSS templates that has brought me to this point.
>
> I find myself spending lots of time reading form helper code to figure
> out what it wants, and looking at emitted code to figure out what it
> did. When I could have just coded the html myself with far less
> trouble. Furthermore it's not particularly more readable code as a
> result of using helpers. (the only thing that I hate more is messing
> with CSS).
>
> Half the time I am writing code to make the helpers NOT emit a div
> where I don't want one. Other times it is to specify css classes where
> necessary in html anchors to go with a css style -- or to redefine the
> emitted div for a label to be what I need to to be. Generally I'm of
> the opinion that these helpers shouldn't emit ANY divs -- it's very
> uncakelike to force a view/css structureon a developer -- seems to me
> they should be completely independent.
>
> Is it me or is there truly diminishing returns here? For example:
>
> input('boat', array('error' => 'Boat is required',
> 'div' => '', 'class' => 'field', 'label' => array('class' => 'left',
> 'text' => 'Boat:')));?>
>
> input('favorite lure', array('div' => '', 'class' =>
> 'field', 'label' => array('class' => 'left', 'text' => 'Favorite
> Lure:')));?>
>
> submit('Update', array('div' => false, 'class' =>
> 'button', 'id' => 'submit'));?>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Why use formhelpers?

2007-11-12 Thread Gwoo

http://live.cakephp.org/shows/view/4


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Why use formhelpers?

2007-11-12 Thread MikeK

Ths is not meant to be disrespectful in anyway -- I love cake and it
has been a productivity boon, and I respect all that contribute to it.
However as I continue to develop cake code I have found myself
wondering why I am using the form helpers at all. It has been moving
through various CSS templates that has brought me to this point.

I find myself spending lots of time reading form helper code to figure
out what it wants, and looking at emitted code to figure out what it
did. When I could have just coded the html myself with far less
trouble. Furthermore it's not particularly more readable code as a
result of using helpers. (the only thing that I hate more is messing
with CSS).

Half the time I am writing code to make the helpers NOT emit a div
where I don't want one. Other times it is to specify css classes where
necessary in html anchors to go with a css style -- or to redefine the
emitted div for a label to be what I need to to be. Generally I'm of
the opinion that these helpers shouldn't emit ANY divs -- it's very
uncakelike to force a view/css structureon a developer -- seems to me
they should be completely independent.

Is it me or is there truly diminishing returns here? For example:

input('boat', array('error' => 'Boat is required',
'div' => '', 'class' => 'field', 'label' => array('class' => 'left',
'text' => 'Boat:')));?>

input('favorite lure', array('div' => '', 'class' =>
'field', 'label' => array('class' => 'left', 'text' => 'Favorite
Lure:')));?>

submit('Update', array('div' => false, 'class' =>
'button', 'id' => 'submit'));?>


--~--~-~--~~~---~--~~
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: Cookie With Multi Dimensional Array Cannot Be Read (Sometimes) Is This A Bug?

2007-11-12 Thread Baz
Sorry, didn't know cookies were plain text.

So serialization *should* work always, but it doesn't if you set the
encryption option to *off*.
I'm just sharing information trying to save others the hours I've spent with
this problem.
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Nov 12, 2007 11:31 AM, Ivolution <[EMAIL PROTECTED]> wrote:

>
> I agree with Grant Cox..
> You can't just write any variable to a cookie. With plaintext strings
> this works, but when you have complex datatypes like multidimensional
> arrays, you have to convert it somehow to a plaintext string.
> This is exactly where the serialize() function kicks in: the only
> thing this function does is generate a storable representation
> (plaintext string) of any value.
> So there's no encryption involved at all (though it looks encrypted if
> you look at the value). If you want to encrypt your information (seems
> to be a good thing since it's about user-logins), you should serialize
> your array, and then encrypt it's output before you pass it to the
> cookie. When retrieving the cookie, it's obviously the other way
> round.
>
>
> On Nov 12, 5:43 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> > The reason it works in the first controller is because it is not
> > reading from the cookie itself - it also saves the data to a local
> > variable and it is reading back from that.  Because there is no
> > automatic serialization going on, only strings are written to the
> > cookie - so a complex data type will never work in your second
> > controller (or after refreshing the page, or whatever so that it does
> > actually read the cookie).
> >
> > I can't think of any reason that it would not work without encryption
> > though...
>
>
> >
>

--~--~-~--~~~---~--~~
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: Auth/ACL problem: "You are not authorized to access that location."

2007-11-12 Thread Jeff Loiselle aka phishy

Hey guys,

I've been working on an ACL plugin if you're interested.
http://bakery.cakephp.org/articles/view/acl-management-plugin

Regards,
jeff


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Saving data in '/posts/view' instead of '/posts/add' = bad practice? How can I fix this?

2007-11-12 Thread Action

This is for a blog with posts and comments.

On /posts/view/blog_post_name, I have the blog post, its comments, and
an add comment form. Right now, the add comment form submits to the
same controller function used for this view (/posts/view). The data is
saved using /posts/view and then you are redirected back to the same
view with the blog post (/posts/view/blog_post_name).

It works, but it seems like using the /posts/view function to save
data isn't good practice.

So, I want to have the form either submit to /posts/addcomment or
even /comments/add. The problem is that if I do this, I can't figure
out how to get back to the /posts/view/blog_post_name page and still
have the validation error messages appear (I don't want another view
for /posts/addcomment or /comments/add). I've tried $this->render()
and $this->redirect() and with both the error message don't appear. So
far, it seems like the error messages will only appear in the view
corresponding to the controller function the form is submitted to.

Is my aforementioned working method (using /posts/view to handle
comment saving) bad practice? If so, is there any way I can save the
data in /posts/addcomment or /comments/add and have it return to the /
posts/view/blog_post_name view with the validation error messages
working? For example, can I bind a different view to a particular
controller function?

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Adding Data into 2 Models in One View

2007-11-12 Thread Miyagi

still having a great deal of trouble with this one...

It seems like the majority of the computation would be done in add()
within the project_controller

The confusing part for me would be how to populate the Address ID in
the Project_Address table.
Would the Address have to be entered first, then grabbed, and then
inputted into the project model along with the rest of the data?

Thinking this framework couldn't do something like this..


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: String concatenation not working

2007-11-12 Thread technicaltitch

That is exactly how I intend to kick this off thanksif I ever get
it working!

(By sticking the code after the redirect call the backup will
presumably be dealt with asynchronously.)

On Nov 12, 4:19 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> you could also do a 'lazy mans' cron. and just have a script that is
> kicked off the first time a web page is loaded every n-days.  I use
> the robots.txt because I really don't care too much if once every
> month late at night it takes a while to load.  I also dynamically
> generate that page for a couple of other reasons.
>
> Sam D
>
> On 11/12/07, technicaltitch <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
>
> > Thanks very much for your help, but I'm afraid I don't have a
> > workstation to run this from. Also, having this arrive at people's
> > inboxes is incredibly convenient. I'm just at a complete loss as to
> > why the string concatenation doesn't work.
>
> > On Nov 12, 1:08 pm, Guillaume <[EMAIL PROTECTED]> wrote:
> > > If your host allows it, you can use your own workstation and program a
> > > script that periodically does something like
>
> > > mysqldump -C --host DB_HOSTNAME -u USERNAME -p PASSWORD DB_NAME >
> > > mysdump.sql
>
> > > over the network.
>
> > > Your mysql needs to be reachable from outside the server.
>
> > > My host used to allow it and it was a very convenient and quick (owing
> > > to the C option) way to backup a database remotely.
>
> > > There can be security hazards though (but sending the dump via email
> > > too).
>
> > > Guillaumehttp://cherryonthe.popnews.com
>
> > > On 12 nov, 10:21, technicaltitch <[EMAIL PROTECTED]> wrote:
>
> > > > surely it is easier to concatenate a string in PHP than change my
> > > > host?! i'm keen to hear of workarounds, but mostly hoping for help
> > > > with the string handling.
>
> > > > our hosting is US$11 per year which is incredibly competitive, we are
> > > > very happy with their service (faultless in several years) and
> > > > familiar with the setup - and every single cent makes a difference in
> > > > bolivia. ( they are bargainvault.com and the website i'm replacing 
> > > > iswww.intiwarayassi.org)
>
> > > > On Nov 11, 9:55 pm, Steve Boyd <[EMAIL PROTECTED]> wrote:
>
> > > > > then changes your host.  there is incredibly cheap hosting everywhere
> > > > > (well within the USA anyhow) that allows you cron jobs + all the other
> > > > > bells and whistles
>
> > > > > On Nov 12, 8:37 am, technicaltitch <[EMAIL PROTECTED]> wrote:
>
> > > > > > because it's for a bolivian volunteer organization we're using
> > > > > > incredibly cheap hosting which doesn't allow us cron jobs. i thought
> > > > > > this would be trivial.
>
> > > > > > On Nov 11, 5:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > > > > > > On Nov 11, 1:33 pm, technicaltitch <[EMAIL PROTECTED]> wrote:
> > > > > > > 
>
> > > > > > > Why would you not use mysqldump and a cron job?
>
> > > > > > > AD- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/- Hide 
> quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Schema generation

2007-11-12 Thread [EMAIL PROTECTED]

All looks very cool.

Is there any plan for any sort of versioning support and or data
manipulation. At the moment the CakeSchema seems to only support
creating and dropping fields / tables. What would be really nice would
be to see something closer to Rails YAML based migrations. I know
someone wrote up something like this a while back as an add on, but it
would be nice to see this sort of schema manipulation in core cake.

I'm especially thinking of the sort of scenarios where you might want
to create views / transform existing data into a new form, run
slightly more custom sql etc, and something which can version a
database schema.

Is there anything in the pipeline for this?

Simon

On Nov 12, 5:46 pm, Gwoo <[EMAIL PROTECTED]> wrote:
> run 'cake schema help' from the command line.


--~--~-~--~~~---~--~~
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: Schema generation

2007-11-12 Thread Gwoo

run 'cake schema help' from the command line.


--~--~-~--~~~---~--~~
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: Cookie With Multi Dimensional Array Cannot Be Read (Sometimes) Is This A Bug?

2007-11-12 Thread Ivolution

I agree with Grant Cox..
You can't just write any variable to a cookie. With plaintext strings
this works, but when you have complex datatypes like multidimensional
arrays, you have to convert it somehow to a plaintext string.
This is exactly where the serialize() function kicks in: the only
thing this function does is generate a storable representation
(plaintext string) of any value.
So there's no encryption involved at all (though it looks encrypted if
you look at the value). If you want to encrypt your information (seems
to be a good thing since it's about user-logins), you should serialize
your array, and then encrypt it's output before you pass it to the
cookie. When retrieving the cookie, it's obviously the other way
round.


On Nov 12, 5:43 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> The reason it works in the first controller is because it is not
> reading from the cookie itself - it also saves the data to a local
> variable and it is reading back from that.  Because there is no
> automatic serialization going on, only strings are written to the
> cookie - so a complex data type will never work in your second
> controller (or after refreshing the page, or whatever so that it does
> actually read the cookie).
>
> I can't think of any reason that it would not work without encryption
> though...


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Adding Data into 2 Models in One View

2007-11-12 Thread Miyagi

Simple tasks becoming a little frustrating in Cake. Still getting used
to this whole concept.
I'm trying to accomplish adding an Address Model along with the rest
of the Project Information.

Project hasOne Address
Address hasOne State and hasOne County
(Do I need to define that Address belongsTo Project?)

What should be defined in the Adddress add?
and the views?


--~--~-~--~~~---~--~~
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: .htaccess problem

2007-11-12 Thread schneimi

I had a similar problem and found the following solution somewhere on
the web, just put it in the first .htaccess file, maybe it helps you
too.


   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteCond  %{REQUEST_FILENAME} !-d
   RewriteCond  %{REQUEST_FILENAME} !-f
   RewriteRule(.*)  app/webroot/$1 [L]


[EMAIL PROTECTED] schrieb:
> in my cakephp
>
> i want to do some url rewrite but whenever i put some url rule on my
> htaccess it gives (none)500 error
>
> my url is
>
> http://www.xaprio.com/Client/work/PHPcake/shop?sn=a&lb=harish
>
> and i want
>
> http://www.xaprio.com/Client/work/PHPcake/shop/a/lb/harish
>
> shop is my function in a controller
>
> plz help me
> thanx in advance


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Schema generation

2007-11-12 Thread mike

So, I was reading PHPNut's lovely announcement about some of the new
features released in the pre-beta of 1.2 from a couple weeks ago and
couldn't help but notice this little tidbit of info:

Also in the database department, schema generation has been
implemented for
several databases.  Schema generation allows you to create and edit
your
database schemas with your favorite tool, and Cake's schema tools will
manage the changes for you.

Anyone know anything about these fanciful schema tools and how they
manage the changes?
I don't see anything about them in the new manual, any hints in terms
of where some info/code might appear in the core or in the API would
be much appreciated.

Thanks!
Mike


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Transform column names

2007-11-12 Thread djiize

I think the best way for you is to create a TransformField behavior,
and override afterFind (to populate 'title' in array) and beforeSave
(to change 'title' to 'FP002EX' in UPDATE) in it.
If it's just for one table, directly override them in your model.
Maybe you'll need to override other callbacks too, check API:
http://api.cakephp.org/1.2/class_model_behavior.html

On Nov 12, 8:22 am, mmalca <[EMAIL PROTECTED]> wrote:
> Iam looking for a way to transform column names (behaviour perhaps?).
> I have an existing database with very confusing column names (like
> FP002EX - remember Fortran) and would like to display/use/edit them in
> cakephp via friendlier name: eg FP002EX -> title
>
> Something like:
>
> class MyModel extends AppModel {
> var $actsAs = array('transnames');
> var $transNames = array('FP002EX'=>'title',...);
>
> }
>
> controller usage:
> $this->data['MyModel']['title'] = 'New title'; // would set FP002EX
> $this->save($this->data);
>
> Is there an existing solution to my problem? Can someone point me to
> the best way for implementing this behaviour?
> Tnx


--~--~-~--~~~---~--~~
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: String concatenation not working

2007-11-12 Thread Samuel DeVore

you could also do a 'lazy mans' cron. and just have a script that is
kicked off the first time a web page is loaded every n-days.  I use
the robots.txt because I really don't care too much if once every
month late at night it takes a while to load.  I also dynamically
generate that page for a couple of other reasons.

Sam D

On 11/12/07, technicaltitch <[EMAIL PROTECTED]> wrote:
>
> Thanks very much for your help, but I'm afraid I don't have a
> workstation to run this from. Also, having this arrive at people's
> inboxes is incredibly convenient. I'm just at a complete loss as to
> why the string concatenation doesn't work.
>
>
> On Nov 12, 1:08 pm, Guillaume <[EMAIL PROTECTED]> wrote:
> > If your host allows it, you can use your own workstation and program a
> > script that periodically does something like
> >
> > mysqldump -C --host DB_HOSTNAME -u USERNAME -p PASSWORD DB_NAME >
> > mysdump.sql
> >
> > over the network.
> >
> > Your mysql needs to be reachable from outside the server.
> >
> > My host used to allow it and it was a very convenient and quick (owing
> > to the C option) way to backup a database remotely.
> >
> > There can be security hazards though (but sending the dump via email
> > too).
> >
> > Guillaumehttp://cherryonthe.popnews.com
> >
> > On 12 nov, 10:21, technicaltitch <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > surely it is easier to concatenate a string in PHP than change my
> > > host?! i'm keen to hear of workarounds, but mostly hoping for help
> > > with the string handling.
> >
> > > our hosting is US$11 per year which is incredibly competitive, we are
> > > very happy with their service (faultless in several years) and
> > > familiar with the setup - and every single cent makes a difference in
> > > bolivia. ( they are bargainvault.com and the website i'm replacing 
> > > iswww.intiwarayassi.org)
> >
> > > On Nov 11, 9:55 pm, Steve Boyd <[EMAIL PROTECTED]> wrote:
> >
> > > > then changes your host.  there is incredibly cheap hosting everywhere
> > > > (well within the USA anyhow) that allows you cron jobs + all the other
> > > > bells and whistles
> >
> > > > On Nov 12, 8:37 am, technicaltitch <[EMAIL PROTECTED]> wrote:
> >
> > > > > because it's for a bolivian volunteer organization we're using
> > > > > incredibly cheap hosting which doesn't allow us cron jobs. i thought
> > > > > this would be trivial.
> >
> > > > > On Nov 11, 5:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
> >
> > > > > > On Nov 11, 1:33 pm, technicaltitch <[EMAIL PROTECTED]> wrote:
> > > > > > 
> >
> > > > > > Why would you not use mysqldump and a cron job?
> >
> > > > > > AD- Hide quoted text -
> >
> > > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: String concatenation not working

2007-11-12 Thread technicaltitch

Thanks very much for your help, but I'm afraid I don't have a
workstation to run this from. Also, having this arrive at people's
inboxes is incredibly convenient. I'm just at a complete loss as to
why the string concatenation doesn't work.


On Nov 12, 1:08 pm, Guillaume <[EMAIL PROTECTED]> wrote:
> If your host allows it, you can use your own workstation and program a
> script that periodically does something like
>
> mysqldump -C --host DB_HOSTNAME -u USERNAME -p PASSWORD DB_NAME >
> mysdump.sql
>
> over the network.
>
> Your mysql needs to be reachable from outside the server.
>
> My host used to allow it and it was a very convenient and quick (owing
> to the C option) way to backup a database remotely.
>
> There can be security hazards though (but sending the dump via email
> too).
>
> Guillaumehttp://cherryonthe.popnews.com
>
> On 12 nov, 10:21, technicaltitch <[EMAIL PROTECTED]> wrote:
>
>
>
> > surely it is easier to concatenate a string in PHP than change my
> > host?! i'm keen to hear of workarounds, but mostly hoping for help
> > with the string handling.
>
> > our hosting is US$11 per year which is incredibly competitive, we are
> > very happy with their service (faultless in several years) and
> > familiar with the setup - and every single cent makes a difference in
> > bolivia. ( they are bargainvault.com and the website i'm replacing 
> > iswww.intiwarayassi.org)
>
> > On Nov 11, 9:55 pm, Steve Boyd <[EMAIL PROTECTED]> wrote:
>
> > > then changes your host.  there is incredibly cheap hosting everywhere
> > > (well within the USA anyhow) that allows you cron jobs + all the other
> > > bells and whistles
>
> > > On Nov 12, 8:37 am, technicaltitch <[EMAIL PROTECTED]> wrote:
>
> > > > because it's for a bolivian volunteer organization we're using
> > > > incredibly cheap hosting which doesn't allow us cron jobs. i thought
> > > > this would be trivial.
>
> > > > On Nov 11, 5:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > > > > On Nov 11, 1:33 pm, technicaltitch <[EMAIL PROTECTED]> wrote:
> > > > > 
>
> > > > > Why would you not use mysqldump and a cron job?
>
> > > > > AD- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AclAdmin

2007-11-12 Thread seacloud9

I have applied AclAdmin to my application it affects all areas but the
actual component.  I have it setup to deny access to the public for
the plugin but it always allows unathenticated users access?  It is
perplexing wondering if anyone has had the same issue.  I also have
set var $publicAccess ='false'; in the generic controller still the
public can access it?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



send email is fail. Loop is not going in send function

2007-11-12 Thread ritu

I m trying to send mail. I am using the function sendTemplatemail()
from bakery.
But i cant send mails.Mail send function is not working.
also i want to take the data for sending mail from the form.It is
different every time.

Thanks in advance
plz help me


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: String concatenation not working

2007-11-12 Thread Guillaume

If your host allows it, you can use your own workstation and program a
script that periodically does something like

mysqldump -C --host DB_HOSTNAME -u USERNAME -p PASSWORD DB_NAME >
mysdump.sql

over the network.

Your mysql needs to be reachable from outside the server.

My host used to allow it and it was a very convenient and quick (owing
to the C option) way to backup a database remotely.

There can be security hazards though (but sending the dump via email
too).

Guillaume
http://cherryonthe.popnews.com


On 12 nov, 10:21, technicaltitch <[EMAIL PROTECTED]> wrote:
> surely it is easier to concatenate a string in PHP than change my
> host?! i'm keen to hear of workarounds, but mostly hoping for help
> with the string handling.
>
> our hosting is US$11 per year which is incredibly competitive, we are
> very happy with their service (faultless in several years) and
> familiar with the setup - and every single cent makes a difference in
> bolivia. ( they are bargainvault.com and the website i'm replacing 
> iswww.intiwarayassi.org)
>
> On Nov 11, 9:55 pm, Steve Boyd <[EMAIL PROTECTED]> wrote:
>
> > then changes your host.  there is incredibly cheap hosting everywhere
> > (well within the USA anyhow) that allows you cron jobs + all the other
> > bells and whistles
>
> > On Nov 12, 8:37 am, technicaltitch <[EMAIL PROTECTED]> wrote:
>
> > > because it's for a bolivian volunteer organization we're using
> > > incredibly cheap hosting which doesn't allow us cron jobs. i thought
> > > this would be trivial.
>
> > > On Nov 11, 5:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > > > On Nov 11, 1:33 pm, technicaltitch <[EMAIL PROTECTED]> wrote:
> > > > 
>
> > > > Why would you not use mysqldump and a cron job?
>
> > > > AD- Hide quoted text -
>
> > - Show quoted text -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



blog tutorial not working with simple user authentification tutorial?

2007-11-12 Thread [EMAIL PROTECTED]

Hi, I start learning cake by following the blog and user
authentification tutorials on the manual. However, when I try to put
these two applications together, they don't work as the way I
expected. Simply, I just want when a user logs in, he can read all
pages of the blog. If someone tries to access any page the blog before
he has logged in, he is redirected to the login page.

Here is the problem:
I never get into the blog, even I login properly. Whatever I do, I am
redirected to the login page.

My posts_controller of the blog looks like this

class PostsController extends AppController
{
var $name = 'Posts';

function beforeFilter()
{
$this->checkSession();
}

function index()
{   ...

}

function view($id)
{   ...
}

function add()
{ ...
}

function delete($id)
{   ...
}

function edit($id = null)
{   ...
}
}

My users_controller and app_controller are same as described in the
tutorials.
Tried to search for the solution, but didn't get any luck for two
days. And I am sure this can be solved easily.
Any helps would be appreciate, thank you!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Transform column names

2007-11-12 Thread mmalca

Iam looking for a way to transform column names (behaviour perhaps?).
I have an existing database with very confusing column names (like
FP002EX - remember Fortran) and would like to display/use/edit them in
cakephp via friendlier name: eg FP002EX -> title

Something like:

class MyModel extends AppModel {
var $actsAs = array('transnames');
var $transNames = array('FP002EX'=>'title',...);
}

controller usage:
$this->data['MyModel']['title'] = 'New title'; // would set FP002EX
$this->save($this->data);

Is there an existing solution to my problem? Can someone point me to
the best way for implementing this behaviour?
Tnx


--~--~-~--~~~---~--~~
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: AuthComponent - unchanged password

2007-11-12 Thread Mike Digital Egg

Hi Francky,

Thanks for the advice, that worked a treat. It's usually something
simple with Cake, you just need a few pointers every now and then :)

Cheers

Mike

On Nov 12, 12:30 pm, francky06l <[EMAIL PROTECTED]> wrote:
> I came across this, the way I  solved it :
>
> - I use another field name than password in the form (ie: mypass), in
> my controller is this field is not blank I generate (before save):
> $this->data['User']['password'] = $this->Auth->password($this-
>
> >data['User']['mypass'])
>
> - in a second project I wanted to "confirm" the new password (if
> changed), I just use a check box labeled as "reset password" and
> another field 'confirmpass". I use the same approach as above but the
> condition being the check box checked or not
>
> Hope this helps
>
> On Nov 12, 12:23 pm, Mike Digital Egg <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
>
> > I am using the Auth Component for 1.2 which is working great but I
> > have just come across a problem which I can't work out.
>
> > I have a user management system which is basically just a form
> > containing the user details, these details will need to be editable.
> > All good so far, the problem I am having is that if I want to leave
> > the password unchanged (by leaving the password field blank)and just
> > change the username for example the Auth component overwrites the
> > existing password with a hash of "". Is there a way of asetting it so
> > that a blank password means keep the original?
>
> > Cheers
>
> > Mike


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sessions

2007-11-12 Thread joost de keijzer

Hi Beno,

Is CAKE_SECURITY is set to "high" in your 1.1.18 apps core.php?
Setting it to "medium" will then probaply fix your problem.

Also see https://trac.cakephp.org/ticket/3507 .

On Nov 12, 1:47 pm, Beno <[EMAIL PROTECTED]> wrote:
> hi I have this problem i do not know if it is a bug in new version of
> cake. After i upgrated from preveious version cake to version
> 1.1.18.5850 the seesions are sometime droped. A tried the older
> version and everithnik is ok. In change log are same updates about
> seesion. Have sombody the same experience ?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Sessions

2007-11-12 Thread Beno

hi I have this problem i do not know if it is a bug in new version of
cake. After i upgrated from preveious version cake to version
1.1.18.5850 the seesions are sometime droped. A tried the older
version and everithnik is ok. In change log are same updates about
seesion. Have sombody the same experience ?


--~--~-~--~~~---~--~~
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: AuthComponent - unchanged password

2007-11-12 Thread francky06l

I came across this, the way I  solved it :

- I use another field name than password in the form (ie: mypass), in
my controller is this field is not blank I generate (before save):
$this->data['User']['password'] = $this->Auth->password($this-
>data['User']['mypass'])

- in a second project I wanted to "confirm" the new password (if
changed), I just use a check box labeled as "reset password" and
another field 'confirmpass". I use the same approach as above but the
condition being the check box checked or not

Hope this helps

On Nov 12, 12:23 pm, Mike Digital Egg <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I am using the Auth Component for 1.2 which is working great but I
> have just come across a problem which I can't work out.
>
> I have a user management system which is basically just a form
> containing the user details, these details will need to be editable.
> All good so far, the problem I am having is that if I want to leave
> the password unchanged (by leaving the password field blank)and just
> change the username for example the Auth component overwrites the
> existing password with a hash of "". Is there a way of asetting it so
> that a blank password means keep the original?
>
> Cheers
>
> Mike


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AuthComponent - unchanged password

2007-11-12 Thread Mike Digital Egg

Hi,

I am using the Auth Component for 1.2 which is working great but I
have just come across a problem which I can't work out.

I have a user management system which is basically just a form
containing the user details, these details will need to be editable.
All good so far, the problem I am having is that if I want to leave
the password unchanged (by leaving the password field blank)and just
change the username for example the Auth component overwrites the
existing password with a hash of "". Is there a way of asetting it so
that a blank password means keep the original?

Cheers

Mike


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use "vendors" directory to share Fckeditor?

2007-11-12 Thread avairet

Hello!

Thank's for your reply. My question wasn't clear...
Of course, "editor directory" and "fckconfig.js", "fckeditor.js",
"fcktemplates.xml",  "fckstyles.xml" must be in "webroot/js/" because
of the client javascript!

My real problem is that if I put "fckeditor.php" file (the class) in
"cake/vendors", the class is not found in my Helper.
But, if I put "fckeditor.php" in "app/vendors", that's OK.
For only one app is good, but to share cake core between many app,
this would be better to share fckeditor too.

Excuse me for my simple English, I hope my post is understandable...

BR

Avairet




On 9 nov, 19:12, chad <[EMAIL PROTECTED]> wrote:
> I have been unsuccessful with using fckeditor from the vendors
> directory as well.  I think fckeditor servers html as well as js, so I
> don't think that the vendors dir is equiped for such a complex
> javascript app.  I solved this buy writing a really simple rsync
> script to copy fckeditor to all of my apps' webroot/js dir.
>
> On Nov 9, 9:01 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > My Cake 1.2 installation:
>
> > - "Cake core" and "vendors dir" are in 'C:/WEB/cake'
>
> > - "App dir" is in 'C:/WEB/cake_apps/caketests'
>
> > - "Webroot dir" is in 'C:/WEB/www/caketests' (in the web server
> > document root).
>
> > I want use Fckeditor and share between multi-app.
> > So I copy FCK "editor dir", "fckconfig.js", "fckeditor.php", etc. in
> > 'C:/WEB/cake/vendors/fckeditor/
>
> > Then I write "vendor('fckeditor')" at the top of my controller.
> > But when I try to instanciate my Fckeditor object in a helper/view,
> > Cake answer me "Class 'FCKeditor' not found"?!
> > Same problem if I write "vendor('fckeditor')" in my view or in my
> > helper...
>
> > How can I do that?
>
> > HELPER :
>
> > class FckeditorHelper extends Helper {
> > public function load ($editor_name,$dimensions = array(),$toolbar =
> > 'Default') {
> > if (empty($dimensions))
> > {
> > $dimensions['width'] = 500;
> > $dimensions['height'] = 300;
> > }
> > $my_editor = new FCKeditor($editor_name);
> > $my_editor->BasePath =
> > 'c:'.DS.'WEB'.DS.'cake'.DS.'vendors'.DS.'fckeditor/';
> > $my_editor->Width = $dimensions['width'];
> > $my_editor->Height = $dimensions['height'];
> > $my_editor->ToolbarSet = $toolbar;
> > $this->controller->set('fckeditor', $my_editor);
> > }
>
> > }
>
> > Avairet


--~--~-~--~~~---~--~~
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: Disabling cake on a subdomain for Joomla

2007-11-12 Thread MrTufty

Install Joomla into a folder in app/webroot/, then point your
subdomain at that.

I've successfully done this for phpBB (although user database
integration is an entirely different beast).

On Nov 11, 4:26 pm, chogi <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> Got a quick question. I got cake running on my root folder of my
> shared host. I made a subdomain and i want to run joomla on it. But
> when I try to access the subdomain address, it shows "missing
> controller"
>
> Is there anyway to bypass cake or htaccess so that it doesnt look for
> the controller when I try to access the subdomain?
>
> Thanks,
> Chogi


--~--~-~--~~~---~--~~
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: String concatenation not working

2007-11-12 Thread technicaltitch

surely it is easier to concatenate a string in PHP than change my
host?! i'm keen to hear of workarounds, but mostly hoping for help
with the string handling.

our hosting is US$11 per year which is incredibly competitive, we are
very happy with their service (faultless in several years) and
familiar with the setup - and every single cent makes a difference in
bolivia. ( they are bargainvault.com and the website i'm replacing is
www.intiwarayassi.org )


On Nov 11, 9:55 pm, Steve Boyd <[EMAIL PROTECTED]> wrote:
> then changes your host.  there is incredibly cheap hosting everywhere
> (well within the USA anyhow) that allows you cron jobs + all the other
> bells and whistles
>
> On Nov 12, 8:37 am, technicaltitch <[EMAIL PROTECTED]> wrote:
>
>
>
> > because it's for a bolivian volunteer organization we're using
> > incredibly cheap hosting which doesn't allow us cron jobs. i thought
> > this would be trivial.
>
> > On Nov 11, 5:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > > On Nov 11, 1:33 pm, technicaltitch <[EMAIL PROTECTED]> wrote:
> > > 
>
> > > Why would you not use mysqldump and a cron job?
>
> > > AD- Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: get/put/delete/post HTTP requests in CakePHP 1.2

2007-11-12 Thread joelmoss

Take a look at Router::mapResources



On Nov 11, 11:37 pm, Aaron  Shafovaloff <[EMAIL PROTECTED]> wrote:
> I saw the following 
> athttp://www.xml.com/pub/a/2007/01/24/whats-new-in-prototype-15.html
>
> ---
>
> The standard XMLHttpRequest object at the heart of Ajax functionality
> only allows HTTP GET and POST methods, but RESTfully-designed web
> applications often call for the lesser-used methods, like PUT and
> DELETE. Until browsers support the full range of HTTP methods,
> Prototype offers a compromise: "tunneling" those methods over POST, by
> including a _method query parameter with the request. You can now
> specify the intended HTTP method with the method option on all Ajax
> functions (the default is POST). Methods other than GET or POST will
> actually be requested with POST, but will have a _method query
> parameter appended to the request URL. For example:
>
> // Creates a POST request to /feeds/1.rss?_method=PUT
> new Ajax.Request('/feeds/1.rss', { method:'put', postBody:myXML,
> contentType:'application/rss+xml' });
>
> Of course, the server side of the application must be written to
> understand this convention as well, but if you use Rails, you'll get
> the behavior for free.
>
> ---
>
> Then I saw this athttp://prototypejs.org/api/ajax/options
>
> As a Ruby On Rails special, Prototype also reacts to other verbs (such
> as 'put' and 'delete' by actually using 'post' and putting an extra
> '_method' parameter with the originally requested method in there.
>
> ---
>
> I was wondering if, like Rails, CakePHP had this feature?


--~--~-~--~~~---~--~~
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: searching in multiple related Models (tables)

2007-11-12 Thread senser

@R. Rajesh Jeba Anbiah - thanks for this direction. It;s very useful,
nut I still can't figure out my wonder.

Let's say we have two tables (models) - "A" & "B" with associations:
"A" hasMany "B"
"B" belongsTo "A"
And we are searching with criteria for table "A" (for example "A.id
>5"). If we search through model "A" with something like "$this->A-
>findAll($query, null, null, null, null, 2)" Cake doesn't recursively
find records in model B (doesn't make JOIN).
If try to search through  model "B" Cake makes LEFT JOIN but it's not
decision because it's possble record in table "A" to not have an
associated record in table "B"


On Nov 10, 7:22 pm, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Nov 9, 4:57 pm, senser <[EMAIL PROTECTED]> wrote:
>
> > I have a big wonder about implementing a simple search form in my
> > CakePHP application.
> > Let's say we have 4 related tables (models): countries(id, name),
> > customers(id, first_name, surname), years(id, year) and
> > customer_years(id, year_id, customer_id, data).
> > They have associations:
>
> > customers *belongsTo* countries  (aka countries *hasMany* customers)
>
> > customers *hasMany* customer_years  (aka customer_years *belongsTo*
> > customers)
>
> > years *hasMany* customer_years  (aka customer_years *belongsTo* years)
>
>   
>
>My personal understanding is that you don't need to fiddle with the
> join table (no need to create model for join table and no need to
> define association for that model). *I might be wrong though*
>
>For search related 
> discussionshttp://groups.google.com/group/cake-php/web/frequent-discussions
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---