Re: Model find() to return object; instead of array (?)

2008-04-04 Thread R. Rajesh Jeba Anbiah

On Apr 4, 11:41 pm, Baz <[EMAIL PROTECTED]> wrote:
> Just throwing in my two cents, but I've had frequent problems with
> phpMyAdmin exceeding timeout limits (and once even memory limits) on a
> shared hosts...
>
> So, trying to compare phpMyAdmin with what you're trying to do isn't really
> fair. All it does are imports and exports (in terms of large processes).

  I haven't checked phpMyAdmin lately. But, as I remember, the
export to SQL on phpMyAdmin is on-the-fly meaning that it is been sent
to the browser in record by record.

  Of late, I have also seen programmers choose the direct export
in SQL--instead of choosing it to zip/bzip---so that they don't get
memory errors.

> However, you *should* be fine with just pumping up both the allocated RAM
> and exec. time for PHP, if you truly want to have this done through CakePHP.
>
> But what you're describing is neither a limitation for CakePHP or PHP
> itself. You just have a butt load of data to deal with and memory issues are
> going to be a problem with a butt load of data.

   I don't know why most of the experts are overlooking the
situation. Some long time ago, when I said that there is no need for
PHP 4 support, everyone was overlooking; now fairly everyone is
realizing; similarly, I hope this situation will be realized sooner or
later.

  The "export data" option is a common feature needed for any
webapp--whether created with Cake or vanilla PHP.

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



Re: Newbie theming question

2008-04-04 Thread Dr. Tarique Sani
On Fri, Apr 4, 2008 at 9:27 PM, baal32 <[EMAIL PROTECTED]> wrote:

>
> Yeah actually - I read the sanisoft one, the pseudocoder one, and the
> manual page on views (the layouts section)
>
> The sansoft and pseudocoder tutorials don't address how to create a
> theme nor do they give an example.



There is no hidden magic - nothing more to add

There obviously are some errors in your application of the tutorials to your
project eg: app/views/themed/(themename)/default.ctp should be
app/views/themed/(themename)/layouts/default.ctp - presuming default.ctp is
your layout - on what basis are you claiming that the layout is working for
you?

if you have created your theme folders properly and placed the CSS where you
are claiming then $html->css('style') should link it properly.  Take a look
at the source of the rendered page, see what is the URL which is being
outputted for the CSS file.

Also the thumb rule is "Think harder" If others can do it - so can you.

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: JS and CSS selectors - WAS: How can I user jQuery insted of prototype?

2008-04-04 Thread Langdon Stevenson

Hi Sam

This isn't an issue of understanding jquery, I was just curious to know 
how Martin applies his javascript dynamically via css selectors.  A 
quick Google search turned up Behaviour as one way of doing this.  At 
first glance it appears to be a library whose purpose is allowing JS to 
be attached to DOM objects via CSS classes and IDs, hence the question.

Regards,
Langdon


Sam Sherlock wrote:
> Have you tried asking the jquery list for help?
> 
> Once cake have rendered code to the view. jquery can take over from 
> there, then you just need to adapt  any jquery code you learning from to 
> work with cake (change urls to controller/action/view)
> 
> mail me off list if you want some more indepth info (I feel rest of 
> cakelist would may think this is digressing away from cake)
> 
> On 04/04/2008, *Langdon Stevenson* <[EMAIL PROTECTED] 
> > wrote:
> 
> 
> Hi Martin
> 
> 
>  > I do not use any helper for jquery, myself. Since all my javascript,
>  > including ajax, is applied dynamically to css selectors I have no
> real
>  > need for a helper.
> 
> Do you use the Behaviour js library for this?
> 
>http://www.bennolan.com/behaviour/
> 
> Or something else?
> 
> Regards,
> Langdon
> 
> 
> 
> > 

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



Re: Amazon s3 + CakePHP

2008-04-04 Thread Adam Royle

Ok fine, here it is, warts and all.

http://bin.cakephp.org/view/517863202

A few things to be aware of...

It requires two fields to be in your database table..

path
s3_url

Path is a relative path to your file from the videos folder.

So if you have

/files/videos/myvideo.flv

The path would be simply myvideo.flv

I know this is a bit weird, but it's how I've done it.

It uses a sha1_file hash as the filename when uploaded to s3.

And finally, if you change the path of your file, you'll need to empty
out s3_path as well if you want the new one to be uploaded.

Cheers,
Adam

On Apr 5, 11:40 am, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
> Hi Adam,
>
> >  I used this class to do the heavy 
> > lifting:http://undesigned.org.za/2007/10/22/amazon-s3-php-class
>
> >  Then I created an S3 behaviour which reads the bucket login
> >  information from app/config/s3.php much like database confs. I'll
> >  probably share it later on down the track when I've cleaned it up a
> >  bit.
>
> I'd be really interested in seeing your behaviour etc, happily in an
> 'unclean' state if you'd like to share.
>
> cheers,
>
> jon
>
> --
>
> jon bennett
> w:http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
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: Amazon s3 + CakePHP

2008-04-04 Thread Jon Bennett

Hi Adam,

>  I used this class to do the heavy lifting: 
> http://undesigned.org.za/2007/10/22/amazon-s3-php-class
>
>  Then I created an S3 behaviour which reads the bucket login
>  information from app/config/s3.php much like database confs. I'll
>  probably share it later on down the track when I've cleaned it up a
>  bit.

I'd be really interested in seeing your behaviour etc, happily in an
'unclean' state if you'd like to share.

cheers,

jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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: Amazon s3 + CakePHP

2008-04-04 Thread Adam Royle

I used this class to do the heavy lifting: 
http://undesigned.org.za/2007/10/22/amazon-s3-php-class

Then I created an S3 behaviour which reads the bucket login
information from app/config/s3.php much like database confs. I'll
probably share it later on down the track when I've cleaned it up a
bit.

Adam


On Apr 5, 12:46 am, John R <[EMAIL PROTECTED]> wrote:
> The next step of my uber fun app is getting Amazon s3 to play nice
> with CakePHP. Sure, I can add the class to Vendors and do everything
> manually - but what is the cooler way? Are there any components/
> helpers built to orchestrate 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: Amazon AWS SimpleDB

2008-04-04 Thread Dr. Tarique Sani
The microsoft product is a bit more powerful but still not useful for
anything beyond simple lists.

HTH
Tarique

On Fri, Apr 4, 2008 at 6:54 PM, Howard Lince <[EMAIL PROTECTED]> wrote:

>
> Thanks for the info.. I was hoping for a scalable solution for my
> website, maybe Microsoft's competing product SSDS (headed to beta) may
> give us more options..
> http://www.microsoft.com/sql/dataservices/default.mspx
>
> I have seen many articles claim it's already in beta however.. I can't
> seem to find much information on it, Would you happen to know more?
>
> On Apr 4, 12:29 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> > On Fri, Apr 4, 2008 at 4:04 AM, Howard Lince <[EMAIL PROTECTED]> wrote:
> >
> > >  Hello all, This is my first post in google groups, I was curious if
> > >  anyone has attempted an amazon web services SimpleDB database model
> > >  which could be incorporated into. I have been accepted into the beta
> > >  and the service itself is decently priced, I was hoping to use it
> with
> > >  cakePHP but have not found any leads yet
> >
> > Hey Howard,
> >
> > I had looked into creating one...until I dug around deeper and saw
> > that there is no way to do joins on SimpleDB tables, which sort of
> > defeats the purpose of using it in Cake.
> >
> > Check out this article for some more details about it
> >
> > http://developer.amazonwebservices.com/connect/entry.jspa?externalID=...
> >
> > --
> > Chris Hartjes
> > Internet Loudmouth
> > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
> >
>


-- 
=
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: Amazon s3 + CakePHP

2008-04-04 Thread Dr. Tarique Sani
The coolest way is to use Jungle Disk and forget fiddling with your code -
been there done that.

Tarique

On Fri, Apr 4, 2008 at 8:16 PM, John R <[EMAIL PROTECTED]> wrote:

>
> The next step of my uber fun app is getting Amazon s3 to play nice
> with CakePHP. Sure, I can add the class to Vendors and do everything
> manually - but what is the cooler way? Are there any components/
> helpers built to orchestrate this?
> >
>


-- 
=
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: New Tree item parent_id is given 0 rather than NULL

2008-04-04 Thread Adam Royle

I had noticed this too, however I just added this to my model.

Cheers,
Adam


function beforeSave(){
if (isset($this->data[$this->alias]['parent_id']) && 
empty($this-
>data[$this->alias]['parent_id'])){
$this->data[$this->alias]['parent_id'] = null;
}
return true;
}

On Apr 5, 6:25 am, acoustic_overdrive <[EMAIL PROTECTED]>
wrote:
> I noticed that when I insert a new item into a tree using the
> TreeBehaviour, if I leave the parent_id blank, the resulting insert
> query sets parent_id to '' (an empty string). This causes MySQL to set
> the field to 0 even if NULL is the default. So all newly created items
> that don't have parents are given a parent of 0 rather than NULL.
> Obviously it would be better to have cake insert NULL, but I suppose
> this would mean modifying the TreeBehaviour which I'm not too keen on
> as it's part of the core.
>
> The strange thing is that when a previously inserted item is Edited
> and saved without changing the data, NULL is set in the query,
> correctly. Perhaps it's something in the database abstraction layer?
> It must handle null values as empty strings when inserting and as NULL
> when updating?
>
> This was mentioned a few years ago 
> here:http://groups.google.com/group/cake-php/browse_thread/thread/a26e4032...
>
> Any assistance would be great. I'm using a recent cake 1.2 nightly,
> but it seems to happen with the beta too.
>
> Jamie
--~--~-~--~~~---~--~~
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 component not hashing all passwords.

2008-04-04 Thread Chris Hartjes

On Fri, Apr 4, 2008 at 7:43 PM, dw <[EMAIL PROTECTED]> wrote:
>
>  thanks for the replies. i've been picking through auth.php for some
>  glimmer of what might be going on, but no dice. the thing which
>  baffles me is that it works for one method but not the other. here is
>  some code (i included the model, controller, and the two views):
>
>  http://bin.cakephp.org/view/1092010887
>

I noticed a couple of things.

1) you are missing the isAuthorized() method in your controllers.  You
need it if you've set $this->Auth->authorize to 'controller'
2) You don't need $this->Auth->fields = array('username' =>
'username', 'password' => 'password'); in your beforeFIlter() because
those are the default values

Now, I've never implemented any sort of "change password"
functionality, as I always assign people passwords when they forget
their old one.  However, I did do an action to add people via admin

57 function admin_add() {
 58 if (!empty($this->data)) {
 59 $this->User->create();
 60 if ($this->User->save($this->data)) {
 61 $this->Session->setFlash(__('The User has been
saved', true));
 62 $this->redirect(array('action'=>'index'));
 63 } else {
 64 $this->Session->setFlash(__('The User could not be
saved. Please, try again.', true));
 65 }
 66 }
 67 }

I don't have a regular add action.

Hope that helps.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "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 component not hashing all passwords.

2008-04-04 Thread dw

thanks for the replies. i've been picking through auth.php for some
glimmer of what might be going on, but no dice. the thing which
baffles me is that it works for one method but not the other. here is
some code (i included the model, controller, and the two views):

http://bin.cakephp.org/view/1092010887

thanks.

On Apr 4, 4:07 pm, Baz <[EMAIL PROTECTED]> wrote:
> The name of the filed isn't an issue.
>
> Although for a true implementation he'll have to user fields such as
> new_password, he shouldn't have to for his implementation. He said that all
> the vies have the same  $form->password('User.password', array('size' =>
> '30','label'=>false))
>
> I'm assuming all of these are in the user model...so I'm not sure why it
> isn't hashing.
>
> As I said, paste some code in bin.cakephp.org, I'm intrigued.
>
> On Fri, Apr 4, 2008 at 2:48 PM, aranworld <[EMAIL PROTECTED]> wrote:
>
> > Have you tried this out using a different name for the column holding
> > the password?
>
> > I call my password field "passwd", because I believe 'password' is a
> > reserved keyword in MySQL.
>
> > At any rate, I found that in order to perform data validation on the
> > submitted password, I had to manually hash the password like you do.
>
> > In the form, I collect the password in a field named "new_passwd":
>
> >$form->text('User.new_passwd',  array('type' => 'password', 'size'
> > => '80') );
>
> > In my controller, I create a new data field called 'new_passwd_hash':
> > if( !empty( $this->data['User']['new_passwd']) ){
> >$this->data['User']['new_passwd_hash'] = $this->Auth-
> > >password( $this->data['User']['new_passwd'] );
> > }
>
> > In my model, all the validation rules are applied to the 'new_passwd'
> > field, but in my beforeSave() function of the User model, I do:
> > if( !empty( $this->data['User']['new_passwd_hash'] ) ){
> >$this->data['User']['passwd'] = $this->data['User']
> > ['new_passwd_hash'];
> > }
>
> > If the validation rules pass, then the passwd field is set to the hash
> > value, which is the only value sent to the database.
>
> > You are right that it should automatically work like you are expecting
> > it to, but since the automatic hashing of the password prevents you
> > from doing any validation on the submitted password, it is probably
> > preferrable to do it manually anyways.  For example, a blank password
> > value will get hashed so that it looks like a real password.
>
> > Also, you might want to re-think using md5.  Although it is pretty
> > good, most hard core security experts consider it an outdated hashing
> > algorithm that is too insecure to be used anymore.
>
> > On Apr 4, 12:03 pm, Baz <[EMAIL PROTECTED]> wrote:
> > > Yes, that's what I meanthmmmph...well
>
> > > Do some code dumps in bin.cakephp.org I guess
>
> > > On Fri, Apr 4, 2008 at 1:53 PM, dw <[EMAIL PROTECTED]> wrote:
>
> > > > Do you mean in the controllers? I do call parent::beforeFilter() in
> > > > each of their beforeFilter().
>
> > > > On Apr 4, 11:32 am, Baz <[EMAIL PROTECTED]> wrote:
> > > > > In your other models, are you calling parent::beforeFilter() in
> > > > > beforeFilter?
>
> > > > > On Fri, Apr 4, 2008 at 1:07 PM, dw <[EMAIL PROTECTED]> wrote:
>
> > > > > > I have a User model, which has an admin_add function. The user's
> > > > > > password is being hashed just fine. I also have an admin_pw
> > function,
> > > > > > with which an admin can change a user's password, and a change_pw
> > > > > > function, which lets the user change their own password. The Auth
> > > > > > component is not hashing passwords for the latter two functions. I
> > > > > > cannot see a difference in the views/functions and can't figure
> > out
> > > > > > what is wrong. Does anyone have any ideas?
>
> > > > > > in app_controller:
>
> > > > > > function beforeFilter(){
> > > > > >   Security::setHash("md5");
> > > > > >$this->Auth->model = 'User';
> > > > > >$this->Auth->fields = array('username' => 'username',
> > > > > > 'password' => 'password');
> > > > > >$this->Auth->sessionKey = 'User';
> > > > > >$this->Auth->loginAction = array('controller' => 'users',
> > > > > > 'action' => 'login');
> > > > > >$this->Auth->loginRedirect = array('controller' =>
> > 'profiles',
> > > > > > 'action'=>'report_index');
> > > > > >$this->Auth->logoutRedirect = null;
> > > > > >$this->Auth->loginError = 'Invalid username / password
> > > > > > combination. Please try again';
> > > > > >$this->Auth->authorize = 'controller';
> > > > > >}
>
> > > > > > all three views use:
> > > > > > $form->password('User.password', array('size' =>
> > '30','label'=>false))
>
> > > > > > I do a straight $this->User->save($this->data) in all three
> > functions,
> > > > > > but for the admin_pw and change_pw i need to do this first:
> > > > > > $this->data['User']['password'] = $this->Auth->password($this-
> > > > > > >data['User']['password']);
> > > > > > If i don't, 

Re: Auth component not hashing all passwords.

2008-04-04 Thread Baz
The name of the filed isn't an issue.

Although for a true implementation he'll have to user fields such as
new_password, he shouldn't have to for his implementation. He said that all
the vies have the same  $form->password('User.password', array('size' =>
'30','label'=>false))

I'm assuming all of these are in the user model...so I'm not sure why it
isn't hashing.

As I said, paste some code in bin.cakephp.org, I'm intrigued.

On Fri, Apr 4, 2008 at 2:48 PM, aranworld <[EMAIL PROTECTED]> wrote:

>
> Have you tried this out using a different name for the column holding
> the password?
>
> I call my password field "passwd", because I believe 'password' is a
> reserved keyword in MySQL.
>
> At any rate, I found that in order to perform data validation on the
> submitted password, I had to manually hash the password like you do.
>
> In the form, I collect the password in a field named "new_passwd":
>
>$form->text('User.new_passwd',  array('type' => 'password', 'size'
> => '80') );
>
> In my controller, I create a new data field called 'new_passwd_hash':
> if( !empty( $this->data['User']['new_passwd']) ){
>$this->data['User']['new_passwd_hash'] = $this->Auth-
> >password( $this->data['User']['new_passwd'] );
> }
>
> In my model, all the validation rules are applied to the 'new_passwd'
> field, but in my beforeSave() function of the User model, I do:
> if( !empty( $this->data['User']['new_passwd_hash'] ) ){
>$this->data['User']['passwd'] = $this->data['User']
> ['new_passwd_hash'];
> }
>
> If the validation rules pass, then the passwd field is set to the hash
> value, which is the only value sent to the database.
>
> You are right that it should automatically work like you are expecting
> it to, but since the automatic hashing of the password prevents you
> from doing any validation on the submitted password, it is probably
> preferrable to do it manually anyways.  For example, a blank password
> value will get hashed so that it looks like a real password.
>
> Also, you might want to re-think using md5.  Although it is pretty
> good, most hard core security experts consider it an outdated hashing
> algorithm that is too insecure to be used anymore.
>
> On Apr 4, 12:03 pm, Baz <[EMAIL PROTECTED]> wrote:
> > Yes, that's what I meanthmmmph...well
> >
> > Do some code dumps in bin.cakephp.org I guess
> >
> > On Fri, Apr 4, 2008 at 1:53 PM, dw <[EMAIL PROTECTED]> wrote:
> >
> > > Do you mean in the controllers? I do call parent::beforeFilter() in
> > > each of their beforeFilter().
> >
> > > On Apr 4, 11:32 am, Baz <[EMAIL PROTECTED]> wrote:
> > > > In your other models, are you calling parent::beforeFilter() in
> > > > beforeFilter?
> >
> > > > On Fri, Apr 4, 2008 at 1:07 PM, dw <[EMAIL PROTECTED]> wrote:
> >
> > > > > I have a User model, which has an admin_add function. The user's
> > > > > password is being hashed just fine. I also have an admin_pw
> function,
> > > > > with which an admin can change a user's password, and a change_pw
> > > > > function, which lets the user change their own password. The Auth
> > > > > component is not hashing passwords for the latter two functions. I
> > > > > cannot see a difference in the views/functions and can't figure
> out
> > > > > what is wrong. Does anyone have any ideas?
> >
> > > > > in app_controller:
> >
> > > > > function beforeFilter(){
> > > > >   Security::setHash("md5");
> > > > >$this->Auth->model = 'User';
> > > > >$this->Auth->fields = array('username' => 'username',
> > > > > 'password' => 'password');
> > > > >$this->Auth->sessionKey = 'User';
> > > > >$this->Auth->loginAction = array('controller' => 'users',
> > > > > 'action' => 'login');
> > > > >$this->Auth->loginRedirect = array('controller' =>
> 'profiles',
> > > > > 'action'=>'report_index');
> > > > >$this->Auth->logoutRedirect = null;
> > > > >$this->Auth->loginError = 'Invalid username / password
> > > > > combination. Please try again';
> > > > >$this->Auth->authorize = 'controller';
> > > > >}
> >
> > > > > all three views use:
> > > > > $form->password('User.password', array('size' =>
> '30','label'=>false))
> >
> > > > > I do a straight $this->User->save($this->data) in all three
> functions,
> > > > > but for the admin_pw and change_pw i need to do this first:
> > > > > $this->data['User']['password'] = $this->Auth->password($this-
> > > > > >data['User']['password']);
> > > > > If i don't, the plain text password is saved to the db.
> >
> > > > > any ideas? thanks.
> > > > > -d
> >
>

--~--~-~--~~~---~--~~
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: External Link in Excel Doesn't Load Session

2008-04-04 Thread francky06l

What happen when you invoke this outside of Excel (browser) ? Does it
work as expected ?


On Apr 4, 4:49 pm, Spectacularium <[EMAIL PROTECTED]> wrote:
> I'm having a problem with a link to CakePHP from an Excel spreadsheet.
> I log in to the web site. then click on the link in excel. When the
> browser opens it presents me with the login page again. Once I log in
> I'm redirected to the root instead of the page I requested.
>
> If I paste the link in or click on any other links it works fine.
>
> I was using OthAuth but decided to try Auth and the same thing
> happens.
>
> I have the following in configuration:
>
> Session.cookie  = 'MASTER_CAKEPHP'
> Session.timeout = 120
> Session.start = true
> Session.checkAgent = false
> Security.level = 'low'
> Security.salt = 'DEVelpomentMASter5y5t3/\\/\\'
>
> I have the following in the app_controller:
> [code]
> function beforeFilter() {
> $this->Auth->authenticate = $this;
> }
>
> function hashPasswords( $data ) {
> if( isset( $data['User']['password'] ) ){
> $data['User']['password'] = md5( 
> $data['User']['password'] );
> }
> return $data;
> }
> [/code]
>
> The log in function in the user controller is empty.
>
> The only thing I've tracked down after several days of debugging is
> that the session_id that is created on the first load of the page is
> different to the one created when it redirects to the log in page.
>
> Am I missing a setting or is this a bug? It's driving me nuts. If I
> can get it to just redirect to the correct page I'll be happy. Any
> help is appreciated.
--~--~-~--~~~---~--~~
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 manage different site instances...

2008-04-04 Thread francky06l

As I understood the state is for the complete "site", such as having
"vote" state (for every visitor) for 2 weeks, then another stage for a
definite period and so on ...So, for me, does not relate of the
visitor but more on "when" the visit occurs
Correct me if I am wrong 

On Apr 4, 5:28 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> So set a "state" field for the user.  Have your controller methods
> render the views in the order you need them to be in and check the
> state in each method and redirect if a user tries to hit an action out
> of order.
>
> On Thu, Apr 3, 2008 at 10:07 PM, John R <[EMAIL PROTECTED]> wrote:
>
> >  Adam -
>
> >  That's a good idea, except each stage will have a whole bunch of
> >  functions and such, not just a single one for each.
>
> >  b logica -
>
> >  This entire area of the app runs through the contests controller, so
> >  unless I am missing something, I don't think I could use other
> >  controllers.
>
> >  John
>
> >  On Apr 3, 6:09 pm, Adam Royle <[EMAIL PROTECTED]> wrote:
> >  > I would do something like this, where getCurrentStage() returns a
> >  > string "submit" or "vote":
>
> >  > function beforeFilter(){
> >  > $currentStage = $this->Contest->getCurrentStage();
> >  > if ($this->action != $currentStage){
> >  > $this->setAction($currentStage);
> >  > }
>
> >  > }
>
> >  > function submit() {
>
> >  > }
>
> >  > function vote() {
>
> >  > }
>
> >  > Hope that helps.
>
> >  > Cheers,
> >  > Adam
>
> >  > On Apr 4, 5:15 am, John R <[EMAIL PROTECTED]> wrote:
>
> >  > > My application is a series of "contests" with different stages
> >  > > (submission, voting, awards, etc.)
>
> >  > > For each stage, the site is going to function completely differently.
> >  > > During Stage 1 (submission) for instance, you will be able to upload,
> >  > > critique, etc. The front page will be a huge list of all submissions,
> >  > > etc. During Stage 2 (voting), you will not be able to upload, only
> >  > > vote on submissions from Stage 1. etc.etc.etc.etc.
>
> >  > > I am having a hard time coming up with a good method for this. The
> >  > > current stage is stored in the Contests table of the database.
> >  > > Ideally, I would like to basically have a different controller for
> >  > > each stage - so it would have it's own functions, views, etc. - but at
> >  > > the end of the day - its just a part of the contests_controller. I
> >  > > also thought of running a check for the current stage in
> >  > > beforeRender() of the contests_controller and then redirecting or
> >  > > pointing somewhere else, but I just dont know! Any feedback would be
> >  > > great!
--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread francky06l

My two cents as well, for 600 000+ records (even less) mysqldump is
best ...
Concerning phpmyAdmin, the frequent problems I have is on
importing ..so again mysql in shell solves this ..


On Apr 4, 8:41 pm, Baz <[EMAIL PROTECTED]> wrote:
> Just throwing in my two cents, but I've had frequent problems with
> phpMyAdmin exceeding timeout limits (and once even memory limits) on a
> shared hosts...
>
> So, trying to compare phpMyAdmin with what you're trying to do isn't really
> fair. All it does are imports and exports (in terms of large processes).
>
> However, you *should* be fine with just pumping up both the allocated RAM
> and exec. time for PHP, if you truly want to have this done through CakePHP.
>
> But what you're describing is neither a limitation for CakePHP or PHP
> itself. You just have a butt load of data to deal with and memory issues are
> going to be a problem with a butt load of data.
--~--~-~--~~~---~--~~
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 trying to get through the CakePHP 'IBM' tutorial

2008-04-04 Thread Scott Ackerman

I can change the document root on my web server to serve directly out
of the "cake" directory, but I don't want to as I have other apps that
run on my server. What seems strange is that I went through the
initial setup as described in the manual and connected with the
database just fine. But when I follow the tutorial on IBM's web site
they are essentially recommending that it be set up like:

/document root
/cake
/app
/vendors
.htaccess
index.php

but the cake manual says that this will work

/document root
/cakePHP
/cake
/app
/vendors

But if you look at the "blog" tutorial that is in the CakePHP manual,
it is recommending that the structure be set up the way IBM
recommends. So I guess I am trying to find out what configuration file
needs to be set to serve the cake app's out of their own directories,
without having to program absolute directory structure information
into the controller.

On Apr 4, 1:03 pm, Rusty <[EMAIL PROTECTED]> wrote:
> I believe that it is in your site setup that you would change it so
> that the root of your website was at /localhost/cake.
>
> I have mine on a shared hosting account, so setting the home page of
> the site to be the /cake_install/app/webroot worked for me.
>
> Hope that helps.
> Rusty
>
> On Apr 4, 9:57 am, Scott Ackerman <[EMAIL PROTECTED]> wrote:
>
> > I am "trying" to get through the "Cook up Web sites fast with CakePHP"
> > tutorial at IBM's website. I have created the initial database, the
> > model, the view and the controller. I am at the part where I am
> > testing it for the first time. I have the CakePHP install installed in
> > a directory called "cake" in my webroot. So in the case of the example
> > to test the registration I use 'localhost/cake/users/register' which
> > takes me to the registration form. I then fill out the form and click
> > the "register" button. But the controller returns me to 'localhost/
> > users/register' which of course gives me a "page not found" error. I
> > can see what the problem is but I am not sure what to do to fix it.
> > The controller  looks like this:
>
> > 
> > class UsersController extends AppController {
>
> > function register() {
> > if (!empty($this->params['form'])) {
> > if ($this->User->save($this->params['form'])) {
> > $this->flash('Your registration information was
> > accepted.', '/users/register');
> > }
> > else {
> > $this->flash('There was a problem with your
> > registration', '/users/register');
> > }
> > }
> > }
> > }
>
> > ?>
>
> > Now I know that I could change the directories to '/cake/users/
> > register', but it seems that there should be a way for Cake to pickup
> > the directory that it is installed in and insert it (since it is
> > already inserting the URL just to get to the 'users' subdirectory. Or
> > is it assumed that you will always have everything that is in the
> > initial install folder directly in the document root? I didn't find a
> > config file that I could specify the initial directory for CakePHP. I
> > hope I am making sense. My understanding was that I could simply unzip
> > the CakePHP files into my web root and rename that initial directory
> > anything (which I renamed to simply 'cake' instead of 'cake1.00etc.').
> > Sorry for such a stupid beginner question.

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



New Tree item parent_id is given 0 rather than NULL

2008-04-04 Thread acoustic_overdrive

I noticed that when I insert a new item into a tree using the
TreeBehaviour, if I leave the parent_id blank, the resulting insert
query sets parent_id to '' (an empty string). This causes MySQL to set
the field to 0 even if NULL is the default. So all newly created items
that don't have parents are given a parent of 0 rather than NULL.
Obviously it would be better to have cake insert NULL, but I suppose
this would mean modifying the TreeBehaviour which I'm not too keen on
as it's part of the core.

The strange thing is that when a previously inserted item is Edited
and saved without changing the data, NULL is set in the query,
correctly. Perhaps it's something in the database abstraction layer?
It must handle null values as empty strings when inserting and as NULL
when updating?

This was mentioned a few years ago here:
http://groups.google.com/group/cake-php/browse_thread/thread/a26e403207b8e053/37f13954b89407c4?lnk=gst&q=store+null#37f13954b89407c4

Any assistance would be great. I'm using a recent cake 1.2 nightly,
but it seems to happen with the beta too.

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



PHP easter eggs/ undocumented feature.

2008-04-04 Thread fr3nch13

hey cake guys, long time no talkie for me.

there is an undocumented feature in php that exposes itself.
i tested it on an install of cakephp and it showed itself.
** This is no direct effect from cakephp code, but of just php ***
Though you guys might want to know about it.

This doesn't have anything written on the page to seems like it would
be a security issue unless some of the names change with different
versions, then you may be able to determine the version of php.

Add this to the end of your urls for cakephp or any php project for
that matter:
?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C1

I shamelessly stole this from a digg comment.
http://digg.com/software/The_101_Coolest_Easter_Eggs_Hidden_in_Your_Software_DVDs_an?t=1418#c1418

http://phpsec.org/projects/phpsecinfo/tests/expose_php.html

http://php.net/manual/en/ini.core.php#ini.expose-php
--~--~-~--~~~---~--~~
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 component not hashing all passwords.

2008-04-04 Thread aranworld

Have you tried this out using a different name for the column holding
the password?

I call my password field "passwd", because I believe 'password' is a
reserved keyword in MySQL.

At any rate, I found that in order to perform data validation on the
submitted password, I had to manually hash the password like you do.

In the form, I collect the password in a field named "new_passwd":

$form->text('User.new_passwd',  array('type' => 'password', 'size'
=> '80') );

In my controller, I create a new data field called 'new_passwd_hash':
if( !empty( $this->data['User']['new_passwd']) ){
$this->data['User']['new_passwd_hash'] = $this->Auth-
>password( $this->data['User']['new_passwd'] );
}

In my model, all the validation rules are applied to the 'new_passwd'
field, but in my beforeSave() function of the User model, I do:
if( !empty( $this->data['User']['new_passwd_hash'] ) ){
$this->data['User']['passwd'] = $this->data['User']
['new_passwd_hash'];
}

If the validation rules pass, then the passwd field is set to the hash
value, which is the only value sent to the database.

You are right that it should automatically work like you are expecting
it to, but since the automatic hashing of the password prevents you
from doing any validation on the submitted password, it is probably
preferrable to do it manually anyways.  For example, a blank password
value will get hashed so that it looks like a real password.

Also, you might want to re-think using md5.  Although it is pretty
good, most hard core security experts consider it an outdated hashing
algorithm that is too insecure to be used anymore.

On Apr 4, 12:03 pm, Baz <[EMAIL PROTECTED]> wrote:
> Yes, that's what I meanthmmmph...well
>
> Do some code dumps in bin.cakephp.org I guess
>
> On Fri, Apr 4, 2008 at 1:53 PM, dw <[EMAIL PROTECTED]> wrote:
>
> > Do you mean in the controllers? I do call parent::beforeFilter() in
> > each of their beforeFilter().
>
> > On Apr 4, 11:32 am, Baz <[EMAIL PROTECTED]> wrote:
> > > In your other models, are you calling parent::beforeFilter() in
> > > beforeFilter?
>
> > > On Fri, Apr 4, 2008 at 1:07 PM, dw <[EMAIL PROTECTED]> wrote:
>
> > > > I have a User model, which has an admin_add function. The user's
> > > > password is being hashed just fine. I also have an admin_pw function,
> > > > with which an admin can change a user's password, and a change_pw
> > > > function, which lets the user change their own password. The Auth
> > > > component is not hashing passwords for the latter two functions. I
> > > > cannot see a difference in the views/functions and can't figure out
> > > > what is wrong. Does anyone have any ideas?
>
> > > > in app_controller:
>
> > > > function beforeFilter(){
> > > >   Security::setHash("md5");
> > > >$this->Auth->model = 'User';
> > > >$this->Auth->fields = array('username' => 'username',
> > > > 'password' => 'password');
> > > >$this->Auth->sessionKey = 'User';
> > > >$this->Auth->loginAction = array('controller' => 'users',
> > > > 'action' => 'login');
> > > >$this->Auth->loginRedirect = array('controller' => 'profiles',
> > > > 'action'=>'report_index');
> > > >$this->Auth->logoutRedirect = null;
> > > >$this->Auth->loginError = 'Invalid username / password
> > > > combination. Please try again';
> > > >$this->Auth->authorize = 'controller';
> > > >}
>
> > > > all three views use:
> > > > $form->password('User.password', array('size' => '30','label'=>false))
>
> > > > I do a straight $this->User->save($this->data) in all three functions,
> > > > but for the admin_pw and change_pw i need to do this first:
> > > > $this->data['User']['password'] = $this->Auth->password($this-
> > > > >data['User']['password']);
> > > > If i don't, the plain text password is saved to the db.
>
> > > > any ideas? thanks.
> > > > -d
--~--~-~--~~~---~--~~
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 theming question

2008-04-04 Thread Sam Sherlock
app_controller


var $view = null;
var $theme = null;

beforeRender


// also add a check for Auth.User later
if(in_array('admin', $this->params)){
$this->view = 'Theme';
$this->theme = 'admin';
}

then I have a themed directory in views and inside that an admin directory
with layout/default.ctp and also elements/nav/main.ctp etc


works fine for me. Refer to css admin.css with $html->css('admin'); it first
looks for admin.css in the css/ dir then in webroot/themed/(themname)/css/

that works for me.

On 04/04/2008, baal32 <[EMAIL PROTECTED]> wrote:
>
>
> Yeah actually - I read the sanisoft one, the pseudocoder one, and the
> manual page on views (the layouts section)
>
> The sansoft and pseudocoder tutorials don't address how to create a
> theme nor do they give an example.  The layouts page in the cake
> manual only has very minimal
> instructions.  If I want to theme my pages, what tokens do I need to
> include (other than the ones listed in my original question)?  How do
> I refer to my stylesheet?  (I know I can do this explicitly with a
> full path in the theme page, but the instructions seem to imply that I
> should place css in webroot/themed/themename/css and that Cake will
> automatically wire it up?
>
>
>
> On Apr 4, 3:37 am, grigri <[EMAIL PROTECTED]> wrote:
> > Have you read this tutorial?
> http://www.sanisoft.com/blog/2007/12/29/theming-your-cakephp-apps-v12/
> >
> > On Apr 4, 12:31 am, baal32 <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I'm very new to Cake and I've been trying to go through the
> > > documentation on theming.  The external tutorials I've read indicate
> > > that the theme is set in app/app_controller.php and the theme default
> > > file is in app/views/themed/(themename)/default.ctp - this part
> > > appears to be working for me.
> >
> > > However I'm having a hard time figuring out how to apply css and what
> > > tokens other than $title_for_layout and $content_for_layout are
> > > available.  I've placed style.css in /webroot/themed/(themename)/css
> > > yet it isnt being applied.  Do I reference it explicitly from
> > > default.ctp or is there some Cake magic that I can invoke?
> >
>
> > > Thanks for any guidance- 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: Cache in 1.2 (Cake and App dirs outside of webroot)

2008-04-04 Thread Sliv

I was puzzled until I got to this line:

"...the path information for Windows"

Then I wasn't puzzled anymore ;)

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



Add new user form contains username of current user

2008-04-04 Thread Tomka

Hello.

I have a model "User" which I use with the Auth-component for Login to
the admin-area.
I also hava an UserController with a admin_add-method for adding new
users.

My problem: In the form of the add-view the field username is always
preset with the username of the current user.
setting the option "value" => "" is no solution as the field should be
preset with the username if the form did not validate and is displayed
a second time.

Excerpt for my form-code:

echo $form->create("User");
echo $form->input("username", array("label" => "Benutzername"));
echo $form->end("Save new user");

I think the problem is that the current logged-in user is stored in
the session. But how can I distinguish between this setting and the
user-input?

Thanks in advance.

Tomka.
--~--~-~--~~~---~--~~
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 component not hashing all passwords.

2008-04-04 Thread Baz
Yes, that's what I meanthmmmph...well

Do some code dumps in bin.cakephp.org I guess

On Fri, Apr 4, 2008 at 1:53 PM, dw <[EMAIL PROTECTED]> wrote:

>
> Do you mean in the controllers? I do call parent::beforeFilter() in
> each of their beforeFilter().
>
> On Apr 4, 11:32 am, Baz <[EMAIL PROTECTED]> wrote:
> > In your other models, are you calling parent::beforeFilter() in
> > beforeFilter?
> >
> > On Fri, Apr 4, 2008 at 1:07 PM, dw <[EMAIL PROTECTED]> wrote:
> >
> > > I have a User model, which has an admin_add function. The user's
> > > password is being hashed just fine. I also have an admin_pw function,
> > > with which an admin can change a user's password, and a change_pw
> > > function, which lets the user change their own password. The Auth
> > > component is not hashing passwords for the latter two functions. I
> > > cannot see a difference in the views/functions and can't figure out
> > > what is wrong. Does anyone have any ideas?
> >
> > > in app_controller:
> >
> > > function beforeFilter(){
> > >   Security::setHash("md5");
> > >$this->Auth->model = 'User';
> > >$this->Auth->fields = array('username' => 'username',
> > > 'password' => 'password');
> > >$this->Auth->sessionKey = 'User';
> > >$this->Auth->loginAction = array('controller' => 'users',
> > > 'action' => 'login');
> > >$this->Auth->loginRedirect = array('controller' => 'profiles',
> > > 'action'=>'report_index');
> > >$this->Auth->logoutRedirect = null;
> > >$this->Auth->loginError = 'Invalid username / password
> > > combination. Please try again';
> > >$this->Auth->authorize = 'controller';
> > >}
> >
> > > all three views use:
> > > $form->password('User.password', array('size' => '30','label'=>false))
> >
> > > I do a straight $this->User->save($this->data) in all three functions,
> > > but for the admin_pw and change_pw i need to do this first:
> > > $this->data['User']['password'] = $this->Auth->password($this-
> > > >data['User']['password']);
> > > If i don't, the plain text password is saved to the db.
> >
> > > any ideas? thanks.
> > > -d
> >
>

--~--~-~--~~~---~--~~
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 trying to get through the CakePHP 'IBM' tutorial

2008-04-04 Thread Rusty

I believe that it is in your site setup that you would change it so
that the root of your website was at /localhost/cake.

I have mine on a shared hosting account, so setting the home page of
the site to be the /cake_install/app/webroot worked for me.

Hope that helps.
Rusty


On Apr 4, 9:57 am, Scott Ackerman <[EMAIL PROTECTED]> wrote:
> I am "trying" to get through the "Cook up Web sites fast with CakePHP"
> tutorial at IBM's website. I have created the initial database, the
> model, the view and the controller. I am at the part where I am
> testing it for the first time. I have the CakePHP install installed in
> a directory called "cake" in my webroot. So in the case of the example
> to test the registration I use 'localhost/cake/users/register' which
> takes me to the registration form. I then fill out the form and click
> the "register" button. But the controller returns me to 'localhost/
> users/register' which of course gives me a "page not found" error. I
> can see what the problem is but I am not sure what to do to fix it.
> The controller  looks like this:
>
> 
> class UsersController extends AppController {
>
>     function register() {
>         if (!empty($this->params['form'])) {
>             if ($this->User->save($this->params['form'])) {
>                 $this->flash('Your registration information was
> accepted.', '/users/register');
>                 }
>             else {
>                 $this->flash('There was a problem with your
> registration', '/users/register');
>                 }
>             }
>         }
>     }
>
> ?>
>
> Now I know that I could change the directories to '/cake/users/
> register', but it seems that there should be a way for Cake to pickup
> the directory that it is installed in and insert it (since it is
> already inserting the URL just to get to the 'users' subdirectory. Or
> is it assumed that you will always have everything that is in the
> initial install folder directly in the document root? I didn't find a
> config file that I could specify the initial directory for CakePHP. I
> hope I am making sense. My understanding was that I could simply unzip
> the CakePHP files into my web root and rename that initial directory
> anything (which I renamed to simply 'cake' instead of 'cake1.00etc.').
> Sorry for such a stupid beginner question.
--~--~-~--~~~---~--~~
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: Cache in 1.2 (Cake and App dirs outside of webroot)

2008-04-04 Thread Adam Friedman

Hi folks.  I just upgraded to 1.2 and found the same problem.  I've
discovered that it is, in fact, a bug of some kind, probably related
to a method in one of Cake's core configuration files.

What I did was trace this Cache::config() entry (found at the end of
[your_app]/config/core.php) and saw that it's default parameter was
'File', which I found out pointed to the file located at cake/libs/
cache/file.php.

I opened this up and scrolled to line 86 and ADDED the marked lines
below to test the issue of fwd- or back-slashes between directories:

function init($settings = array()) {
parent::init($settings);
$defaults = array('path' => CACHE, 'prefix'=> 'cake_', 'lock'=>
false, 'serialize'=> true);
$this->settings = array_merge($defaults, $this->settings,
$settings);
if(!isset($this->__File)) {
$this->__File =& new File($this->settings['path'] . DS 
. 'cake');
}
ADD--->echo ' before cd: '.$this->settings['path'];
ADD--->$this->settings['path'] = str_replace('/','\\',$this-
>settings['path']);
$this->settings['path'] = $this->__File->Folder->cd($this-
>settings['path']);
ADD--->echo ' after cd: '.$this->settings['path'];
if(empty($this->settings['path'])) {
return false;
}

return $this->__active();
}

Now, refresh the page on which you received the cache error.  It is
gone now.  This is because $this->__File->Folder->cd() does not honor
the proper slashing for finding directories and files.  Without the
str_replace() function I added in the second line, the cd() method
destroys the path information for Windows, causing this init() method
to return false and throwing the caching error.

I'll go report this to the powers that be.

Adam Friedman


On Mar 20, 1:25 am, markfm <[EMAIL PROTECTED]> wrote:
> index.php inside webroot
> define('ROOT', DS.'web'.DS.'xampp'.DS.'koekAPPS'.DS.'koekApp1');
> define('APP_DIR',dirname('koekApp1'));
> define('CAKE_CORE_INCLUDE_PATH', DS.'web'.DS.'xampp'.DS.'koek');
>
> Try this instead:
> define('ROOT', 'C:' . DS . 'web' . DS . 'xampp' . DS .
> 'koekAPPS'); // Start the path with 'C:' and take
> off the name of the app defined in the next line
> define('APP_DIR',dirname('koekApp1'));
> define('CAKE_CORE_INCLUDE_PATH', 'C:' . DS . 'web' . DS . 'xampp' .
> DS . 'koek');   // Again, start with 'C:'
>
> --Mark
>
> On Jan 29, 1:08 am, benstof <[EMAIL PROTECTED]> wrote:
>
> > I'm getting the following error for cache in 1.2.
>
> > Warning (512): Cache not configured properly.
> > Please check Cache::config(); in APP/config/core.php
> > [C:\web\xampp\koek\cake\libs\configure.php, line 630]
>
> > My setup is as follows.
>
> > /koekApps/
> > /koekApp1/
> > /config
> > /controllers
> > /models
> > /plugins
> > /tmp
> > /vendors
> > /views
> > .htaccess
> >  index.php
> > /koek/
> >  /cake
> >  /vendors
> > .htaccess
> >   index.php
>
> > /htdocs/   (webroot)
> >  /koekApp1
>
> > index.php inside webroot
> > define('ROOT', DS.'web'.DS.'xampp'.DS.'koekAPPS'.DS.'koekApp1');
> > define('APP_DIR',dirname('koekApp1'));
> > define('CAKE_CORE_INCLUDE_PATH', DS.'web'.DS.'xampp'.DS.'koek');
>
> > This setup has worked for me before, numerous times. Its only now in
> > 1.2 that the cache throws that error.
>
> > When I do pr(Cache::config) from C:\web\xampp\koekApps\koekApp1\views
> > \pages\home.ctp
> > I get and empty string.
> > When I do pr(Cache::settings) from C:\web\xampp\koekApps\koekApp1\views
> > \pages\home.ctp
> > I get an empty array.
>
> > So it seems to me, the config method in core.php never gets called for
> > Cache.
> > If anyone know the solution to this, please let me know.
>
> > Let me know if you need more info from my side.
>
> > Ben

--~--~-~--~~~---~--~~
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 component not hashing all passwords.

2008-04-04 Thread dw

Do you mean in the controllers? I do call parent::beforeFilter() in
each of their beforeFilter().

On Apr 4, 11:32 am, Baz <[EMAIL PROTECTED]> wrote:
> In your other models, are you calling parent::beforeFilter() in
> beforeFilter?
>
> On Fri, Apr 4, 2008 at 1:07 PM, dw <[EMAIL PROTECTED]> wrote:
>
> > I have a User model, which has an admin_add function. The user's
> > password is being hashed just fine. I also have an admin_pw function,
> > with which an admin can change a user's password, and a change_pw
> > function, which lets the user change their own password. The Auth
> > component is not hashing passwords for the latter two functions. I
> > cannot see a difference in the views/functions and can't figure out
> > what is wrong. Does anyone have any ideas?
>
> > in app_controller:
>
> > function beforeFilter(){
> >   Security::setHash("md5");
> >$this->Auth->model = 'User';
> >$this->Auth->fields = array('username' => 'username',
> > 'password' => 'password');
> >$this->Auth->sessionKey = 'User';
> >$this->Auth->loginAction = array('controller' => 'users',
> > 'action' => 'login');
> >$this->Auth->loginRedirect = array('controller' => 'profiles',
> > 'action'=>'report_index');
> >$this->Auth->logoutRedirect = null;
> >$this->Auth->loginError = 'Invalid username / password
> > combination. Please try again';
> >$this->Auth->authorize = 'controller';
> >}
>
> > all three views use:
> > $form->password('User.password', array('size' => '30','label'=>false))
>
> > I do a straight $this->User->save($this->data) in all three functions,
> > but for the admin_pw and change_pw i need to do this first:
> > $this->data['User']['password'] = $this->Auth->password($this-
> > >data['User']['password']);
> > If i don't, the plain text password is saved to the db.
>
> > any ideas? thanks.
> > -d
--~--~-~--~~~---~--~~
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: `useTable = false` and validation

2008-04-04 Thread Baz
You need to override the schema() function for the model.

nice example in here...
https://trac.cakephp.org/browser/branches/1.2.x.x/cake/tests/cases/libs/view/helpers/form.test.php?rev=6629


On Fri, Apr 4, 2008 at 1:24 AM, jamdown <[EMAIL PROTECTED]> wrote:

>
> The form comes up OK for me, but my fields seem to be always valid
> even when they shouldn't be. Did you have to do anything else to get
> the field to validate?
>
> >
>

--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread Baz
Just throwing in my two cents, but I've had frequent problems with
phpMyAdmin exceeding timeout limits (and once even memory limits) on a
shared hosts...

So, trying to compare phpMyAdmin with what you're trying to do isn't really
fair. All it does are imports and exports (in terms of large processes).

However, you *should* be fine with just pumping up both the allocated RAM
and exec. time for PHP, if you truly want to have this done through CakePHP.

But what you're describing is neither a limitation for CakePHP or PHP
itself. You just have a butt load of data to deal with and memory issues are
going to be a problem with a butt load of data.

--~--~-~--~~~---~--~~
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 component not hashing all passwords.

2008-04-04 Thread Baz
In your other models, are you calling parent::beforeFilter() in
beforeFilter?



On Fri, Apr 4, 2008 at 1:07 PM, dw <[EMAIL PROTECTED]> wrote:

>
> I have a User model, which has an admin_add function. The user's
> password is being hashed just fine. I also have an admin_pw function,
> with which an admin can change a user's password, and a change_pw
> function, which lets the user change their own password. The Auth
> component is not hashing passwords for the latter two functions. I
> cannot see a difference in the views/functions and can't figure out
> what is wrong. Does anyone have any ideas?
>
> in app_controller:
>
> function beforeFilter(){
>   Security::setHash("md5");
>$this->Auth->model = 'User';
>$this->Auth->fields = array('username' => 'username',
> 'password' => 'password');
>$this->Auth->sessionKey = 'User';
>$this->Auth->loginAction = array('controller' => 'users',
> 'action' => 'login');
>$this->Auth->loginRedirect = array('controller' => 'profiles',
> 'action'=>'report_index');
>$this->Auth->logoutRedirect = null;
>$this->Auth->loginError = 'Invalid username / password
> combination. Please try again';
>$this->Auth->authorize = 'controller';
>}
>
> all three views use:
> $form->password('User.password', array('size' => '30','label'=>false))
>
> I do a straight $this->User->save($this->data) in all three functions,
> but for the admin_pw and change_pw i need to do this first:
> $this->data['User']['password'] = $this->Auth->password($this-
> >data['User']['password']);
> If i don't, the plain text password is saved to the db.
>
> any ideas? thanks.
> -d
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Reliable Shared Host under $10?

2008-04-04 Thread Sliv

I have to take back my recommendation for Steadfast - I've been
wrestling for a couple days now with mod_rewrite and open_basedir not
working right - Tickets are ongoing back and forth - I have to include
generic simple tests to convince them otherwise they assume it's my
code or cake's problem.  They fixed open_basedir but it messed up
mod_rewrite - they figured out that setting full paths in rewrite
rules worked, but then doing that resulted in php throwing warnings on
includes on files that were accessed via rewrites.

not exactly a turnkey solution :/

On Apr 3, 8:24 am, Sliv <[EMAIL PROTECTED]> wrote:
> A note about steadfast shared hosting - if you want to run the cake
> core and your app (except for webroot) outside of the webroot in your
> home dir, you'll need to submit a support ticket to have them add your
> home dir to the open_basedir restrictions.  You'll also want to
> mention that you'd still like to use the hsphere panel to change web
> options without fear of the panel overwriting the open_basedir
> definition.
>
> This is the issue I ran into - fortunately I've found their support to
> be extremely fast and competent to date.
>
> On Mar 19, 7:33 pm, websurfshop <[EMAIL PROTECTED]> wrote:
>
> > Brand New to PHP and Cake.  I would like to put up a really
> > inexpensive webpage with zero traffic for all intents and purposes   /
> > *  unless I hit it big ;-/  */
>
> > Can someone recommend areliableHostfor under $10/month that would
> > be CakePHP friendly?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Auth component not hashing all passwords.

2008-04-04 Thread dw

I have a User model, which has an admin_add function. The user's
password is being hashed just fine. I also have an admin_pw function,
with which an admin can change a user's password, and a change_pw
function, which lets the user change their own password. The Auth
component is not hashing passwords for the latter two functions. I
cannot see a difference in the views/functions and can't figure out
what is wrong. Does anyone have any ideas?

in app_controller:

function beforeFilter(){
   Security::setHash("md5");
$this->Auth->model = 'User';
$this->Auth->fields = array('username' => 'username',
'password' => 'password');
$this->Auth->sessionKey = 'User';
$this->Auth->loginAction = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'profiles',
'action'=>'report_index');
$this->Auth->logoutRedirect = null;
$this->Auth->loginError = 'Invalid username / password
combination. Please try again';
$this->Auth->authorize = 'controller';
}

all three views use:
$form->password('User.password', array('size' => '30','label'=>false))

I do a straight $this->User->save($this->data) in all three functions,
but for the admin_pw and change_pw i need to do this first:
$this->data['User']['password'] = $this->Auth->password($this-
>data['User']['password']);
If i don't, the plain text password is saved to the db.

any ideas? thanks.
-d



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



Parameters ignored in paginator links

2008-04-04 Thread marten

One more thing regarding the Paginator's link generation in addition
to the two mentioned here:

http://groups.google.com/group/cake-php/browse_thread/thread/b1d6f45125d4916b

When having additional parameters in the url in the /key:val/ format
that are _not_ part of the pagination query, those are ignored when
the paginator builds the pagination links and it doesn't look like it
is possible to pass the, to the numbers() method.

/marten

--~--~-~--~~~---~--~~
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: Is it possible to create a true REST application yet?

2008-04-04 Thread gentleJuggernaut

Looking forward to seeing that...  Could not get the time off work,
sorry to have missed it.



On Apr 4, 1:01 pm, Gwoo <[EMAIL PROTECTED]> wrote:
> Nate did a REST talk at CakeFest. We just need to get the slides and
> video
--~--~-~--~~~---~--~~
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: Is it possible to create a true REST application yet?

2008-04-04 Thread gentleJuggernaut

Looking forward to seeing that...  Could not get the time off work,
sorry to have missed it.



On Apr 4, 1:01 pm, Gwoo <[EMAIL PROTECTED]> wrote:
> Nate did a REST talk at CakeFest. We just need to get the slides and
> video
--~--~-~--~~~---~--~~
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: Is it possible to create a true REST application yet?

2008-04-04 Thread gentleJuggernaut

Looking forward to seeing that...  Could not get the time off work,
sorry to have missed it.



On Apr 4, 1:01 pm, Gwoo <[EMAIL PROTECTED]> wrote:
> Nate did a REST talk at CakeFest. We just need to get the slides and
> video
--~--~-~--~~~---~--~~
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: gmail StartTLS problem

2008-04-04 Thread Huy

Bob,

I would search on the Swiftmailer forums on using Gmail smtp. They have 
very active and helpful people there.

Huy

bob wrote:
> I am running cake 1.2 on XAMPP on Windows XP. I am trying to test
> SwiftMailer integration with Cake using Gmail
>
> Here is my code
>
> $this->SwiftMailer->connection = 'smtp'; // default and thus you don't have
> to specify it
>
> $this->SwiftMailer->smtp_host = 'smtp.gmail.com';
>
> $this->SwiftMailer->smtp_type = 'tls';
>
> $this->SwiftMailer->smtp_port = '587'; //'587'; //'465';
>
>  $this->SwiftMailer->username = '[EMAIL PROTECTED]';
>
> $this->SwiftMailer->password = 'xxx';
>
> if($this->SwiftMailer->connect())
>
> {
>
> $this->SwiftMailer->addTo('from',"[EMAIL PROTECTED]","firstname lastname");
>
> $this->SwiftMailer->addTo('to',"[EMAIL PROTECTED]");
>
> $this->SwiftMailer->mailer->addPart("Plain Body");
>
> $this->SwiftMailer->mailer->addPart("Html Body", 'text/html');
>
> $this->SwiftMailer->send("Subject");
>
> }
>
> }
>
> However, the authenticate() method in SwiftMailer is return this:
>
>
> Expected response code(s) [250] but got response [530 5.7.0 Must issue a
> STARTTLS command first. l22sm10679700waf.10]
> Log Information ++ Log level changed to 3 << 220 mx.google.com ESMTP
> l22sm10679700waf.10>> EHLO [127.0.0.1] << 250-mx.google.com at your service,
> [75.43.217.110]250-SIZE 28311552 250-8BITMIME250-STARTTLS250
> ENHANCEDSTATUSCODES>> AUTH CRAM-MD5 >> RSET << 530 5.7.0 Must issue a
> STARTTLS command first. l22sm10679700waf.10 !! Expected response code(s)
> [250] but got response [530 5.7.0 Must issue a STARTTLS command first.
> l22sm10679700waf.10]
>
>
> How do I start STARTTLS? Is this an XAMPP, Cake, or SwiftMailer issue? I
> cannot seem to figure it out..
>
> Thanks 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
-~--~~~~--~~--~--~---



Re: Custom html helper

2008-04-04 Thread grigri

Looks like you're right!

https://trac.cakephp.org/changeset/6453

Nate sneaked it in without mentioning it. I'm going to play around
with this now...

On Apr 4, 5:37 pm, "Matias Lespiau" <[EMAIL PROTECTED]> wrote:
> I'm not sure but I think you can provide an alias to the helper this way:
>
> $helpers = array('CustomHtml' => 'Html');
>
> On Fri, Apr 4, 2008 at 11:32 AM, Greg Baker <[EMAIL PROTECTED]>
> wrote:
>
>
>
>
>
> > Very interesting fixexactly what I was looking for.  Thanks
>
> > On Apr 4, 12:26 pm, grigri <[EMAIL PROTECTED]> wrote:
> > > There should be an official solution sometime involving aliased
> > > helpers.
>
> > > In the meantime, check out my hack here:
>
> > >http://groups.google.com/group/cake-php/browse_thread/thread/1c1c3701...
>
> > > On Apr 4, 3:02 pm, Greg Baker <[EMAIL PROTECTED]> wrote:
>
> > > > I want to create a custom HTML helper that extends htmlhelper..
> > > > However because of the code I have already that I don't want to
> > > > change, I want to name this helper so that I can use $html->... in my
> > > > views.
>
> > > > Any way I can do this?
> > > > Normally if this was a new project I'd just create a new class and use
> > > > that in my views, but I have a lot of code changing to do in this one
> > > > if I do that.
>
> --
> Matias Lespiauhttp://www.gignus.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
-~--~~~~--~~--~--~---



Newbie trying to get through the CakePHP 'IBM' tutorial

2008-04-04 Thread Scott Ackerman

I am "trying" to get through the "Cook up Web sites fast with CakePHP"
tutorial at IBM's website. I have created the initial database, the
model, the view and the controller. I am at the part where I am
testing it for the first time. I have the CakePHP install installed in
a directory called "cake" in my webroot. So in the case of the example
to test the registration I use 'localhost/cake/users/register' which
takes me to the registration form. I then fill out the form and click
the "register" button. But the controller returns me to 'localhost/
users/register' which of course gives me a "page not found" error. I
can see what the problem is but I am not sure what to do to fix it.
The controller  looks like this:

params['form'])) {
if ($this->User->save($this->params['form'])) {
$this->flash('Your registration information was
accepted.', '/users/register');
}
else {
$this->flash('There was a problem with your
registration', '/users/register');
}
}
}
}

?>

Now I know that I could change the directories to '/cake/users/
register', but it seems that there should be a way for Cake to pickup
the directory that it is installed in and insert it (since it is
already inserting the URL just to get to the 'users' subdirectory. Or
is it assumed that you will always have everything that is in the
initial install folder directly in the document root? I didn't find a
config file that I could specify the initial directory for CakePHP. I
hope I am making sense. My understanding was that I could simply unzip
the CakePHP files into my web root and rename that initial directory
anything (which I renamed to simply 'cake' instead of 'cake1.00etc.').
Sorry for such a stupid beginner question.

--~--~-~--~~~---~--~~
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: Is it possible to create a true REST application yet?

2008-04-04 Thread Gwoo

Nate did a REST talk at CakeFest. We just need to get the slides and
video
--~--~-~--~~~---~--~~
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: Custom html helper

2008-04-04 Thread Matias Lespiau
I'm not sure but I think you can provide an alias to the helper this way:

$helpers = array('CustomHtml' => 'Html');

On Fri, Apr 4, 2008 at 11:32 AM, Greg Baker <[EMAIL PROTECTED]>
wrote:

>
> Very interesting fixexactly what I was looking for.  Thanks
>
> On Apr 4, 12:26 pm, grigri <[EMAIL PROTECTED]> wrote:
> > There should be an official solution sometime involving aliased
> > helpers.
> >
> > In the meantime, check out my hack here:
> >
> > http://groups.google.com/group/cake-php/browse_thread/thread/1c1c3701...
> >
> > On Apr 4, 3:02 pm, Greg Baker <[EMAIL PROTECTED]> wrote:
> >
> > > I want to create a custom HTML helper that extends htmlhelper..
> > > However because of the code I have already that I don't want to
> > > change, I want to name this helper so that I can use $html->... in my
> > > views.
> >
> > > Any way I can do this?
> > > Normally if this was a new project I'd just create a new class and use
> > > that in my views, but I have a lot of code changing to do in this one
> > > if I do that.
> >
>


-- 
Matias Lespiau
http://www.gignus.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: Model find() to return object; instead of array (?)

2008-04-04 Thread Chris Hartjes

On Fri, Apr 4, 2008 at 12:02 PM, R. Rajesh Jeba Anbiah
<[EMAIL PROTECTED]> wrote:
> I'm talking about  handling "exporting" module with CakePHP.
>  It's relevant when you develop a project/application for clients.
>

I understand, I just think that CakePHP is probably not suited to do
that sort of thing on the scale you require.  As good as CakePHP is,
there are some problems it cannot easily solve.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "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: Model find() to return object; instead of array (?)

2008-04-04 Thread R. Rajesh Jeba Anbiah

On Apr 4, 7:49 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 4, 2008 at 10:44 AM, jonknee <[EMAIL PROTECTED]> wrote:
>
> >  > > Either that or you'll have to run queries using LIMIT and OFFSET to
> >  > > grab what you need one chunk at a time.  I don't know any scripting
> >  > > language that handles sucking in 600,000 records via a web page.
>
> >  >   Think about phpMyAdmin?
>
> 1) phpMyAdmin is not a scripting language
> 2) Notice I've said "sucking in 600,000 records" not "searching
> through 600,000 records looking for something".  There is a huge
> difference in the two.  I use phpMyAdmin every day for work and I
> can't help notice that by default it limits the amount of data you can
> pull back.
> 3) This discussion is veering very far away from CakePHP.

I'm talking about  handling "exporting" module with CakePHP.
It's relevant when you develop a project/application for clients.

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



Re: Model find() to return object; instead of array (?)

2008-04-04 Thread R. Rajesh Jeba Anbiah

On Apr 4, 6:04 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Apr 4, 2:41 pm, "R. Rajesh Jeba Anbiah"
> <[EMAIL PROTECTED]> wrote:
> > On Apr 4, 4:51 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > > On Apr 4, 4:08 am, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > > > We have some large reports for our application - often involving ~250K
> > > > rows from 8 different tables.  The problem is, if your reporting needs
> > > > to do any kind of collating or comparison, as ours does, you really
> > > > can't avoid having all the data loaded somewhere.  You may be able to
> > > > do much of it in your database which should stop PHP from running out
> > > > of memory, but it'll have to be used somewhere.
>
> > > If you can get the db to do everything, everyone's a winner. 
> > > e.g.http://forums.mysql.com/read.php?79,11324,13062#msg-13062
>
> > > If you can't get the db to do everything (because the logic isn't all
> > > in the db, or it's too complex to do so, or because, because etc.), if
> > > you generate your output in chunks (standard batch processing afaic)
> > > and dump it into a temporary table - then you can do as above and
> > > again: everyone's a winner :).
>
> > > Then you only need to send the file to the user, or redirect the user
> > > to the right location. For a "standard" csv dump you can reduce your
> > > php processing time and memory requirements to practically 0 in this
> > > way.
>
> >   But, that gonna increase the disk space requirements:-( I
>
> Holy crap, it'll mean you'll need a keyboard to do this aswell! The
> list never ends :D
>
> ps: cache. deleting cache, temporary files, etc.

  LOL.

  BTW, for now, I have a temporary workaround. As per the
parseExtension(), only the csv needs the record by record iteration;
so passing the model object to csv view file and invoking find() with
limit and offset seems to handle the situation. But, obviously, it's
getting crazy for this export module.

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



Re: Newbie theming question

2008-04-04 Thread baal32

Yeah actually - I read the sanisoft one, the pseudocoder one, and the
manual page on views (the layouts section)

The sansoft and pseudocoder tutorials don't address how to create a
theme nor do they give an example.  The layouts page in the cake
manual only has very minimal
instructions.  If I want to theme my pages, what tokens do I need to
include (other than the ones listed in my original question)?  How do
I refer to my stylesheet?  (I know I can do this explicitly with a
full path in the theme page, but the instructions seem to imply that I
should place css in webroot/themed/themename/css and that Cake will
automatically wire it up?


On Apr 4, 3:37 am, grigri <[EMAIL PROTECTED]> wrote:
> Have you read this 
> tutorial?http://www.sanisoft.com/blog/2007/12/29/theming-your-cakephp-apps-v12/
>
> On Apr 4, 12:31 am, baal32 <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm very new to Cake and I've been trying to go through the
> > documentation on theming.  The external tutorials I've read indicate
> > that the theme is set in app/app_controller.php and the theme default
> > file is in app/views/themed/(themename)/default.ctp - this part
> > appears to be working for me.
>
> > However I'm having a hard time figuring out how to apply css and what
> > tokens other than $title_for_layout and $content_for_layout are
> > available.  I've placed style.css in /webroot/themed/(themename)/css
> > yet it isnt being applied.  Do I reference it explicitly from
> > default.ctp or is there some Cake magic that I can invoke?
>
> > Thanks for any guidance- 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: Sending two emails in one function

2008-04-04 Thread Kyle Decot

Thanks for the help. Worked like a charm.
--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread b logica

On Fri, Apr 4, 2008 at 10:49 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
>  On Fri, Apr 4, 2008 at 10:44 AM, jonknee <[EMAIL PROTECTED]> wrote:
>  >
>  >  > > Either that or you'll have to run queries using LIMIT and OFFSET to
>  >  > > grab what you need one chunk at a time.  I don't know any scripting
>  >  > > language that handles sucking in 600,000 records via a web page.
>  >  >
>  >  >   Think about phpMyAdmin?
>
>  1) phpMyAdmin is not a scripting language

In all fairness, the suggestion, I think, was that phpMyAdmin is an
example of an application written using a scripting language that ...

Getting back to the OP's question: use a regular query and iterate
over the result just like you would in a regular PHP script. You lose
a bunch of Cake's functionality but that's an easy trade-off in a
situation 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: Determine insert or update in beforeSave()

2008-04-04 Thread b logica

Well, you could query the DB for an existing record but, aside from
adding an unnecessary DB call, you'd need to have the ID in order to
do so.

What's wrong with checking for the ID in order to ascertain whether
it's an insert or an update? That seems like the most obvious action
to me.

On Fri, Apr 4, 2008 at 5:49 AM, Tomka <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
>  is there a better way to see whether model->beforeSave() is invoked
>  for an update or insert than to use
>
>  if (empty($this->id) && empty($this->data[$this->alias]['id'])){
>   // insert
>  } else {
>   // update
>  }
>
>  ?
>
>  Thanks for answers.
>  Tomka
>  >
>

--~--~-~--~~~---~--~~
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: JS and CSS selectors - WAS: How can I user jQuery insted of prototype?

2008-04-04 Thread b logica

Behaviour has similar functionality to jQuery. I'm not sure there'd be
any point in using them together.

On Thu, Apr 3, 2008 at 10:23 PM, Langdon Stevenson
<[EMAIL PROTECTED]> wrote:
>
>  Hi Martin
>
>
>  > I do not use any helper for jquery, myself. Since all my javascript,
>  > including ajax, is applied dynamically to css selectors I have no real
>  > need for a helper.
>
>  Do you use the Behaviour js library for this?
>
>http://www.bennolan.com/behaviour/
>
>  Or something else?
>
>  Regards,
>  Langdon
>
>  >
>

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



Re: How to manage different site instances...

2008-04-04 Thread b logica

So set a "state" field for the user.  Have your controller methods
render the views in the order you need them to be in and check the
state in each method and redirect if a user tries to hit an action out
of order.

On Thu, Apr 3, 2008 at 10:07 PM, John R <[EMAIL PROTECTED]> wrote:
>
>  Adam -
>
>  That's a good idea, except each stage will have a whole bunch of
>  functions and such, not just a single one for each.
>
>  b logica -
>
>  This entire area of the app runs through the contests controller, so
>  unless I am missing something, I don't think I could use other
>  controllers.
>
>  John
>
>
>
>
>
>  On Apr 3, 6:09 pm, Adam Royle <[EMAIL PROTECTED]> wrote:
>  > I would do something like this, where getCurrentStage() returns a
>  > string "submit" or "vote":
>  >
>  > function beforeFilter(){
>  > $currentStage = $this->Contest->getCurrentStage();
>  > if ($this->action != $currentStage){
>  > $this->setAction($currentStage);
>  > }
>  >
>  > }
>  >
>  > function submit() {
>  >
>  > }
>  >
>  > function vote() {
>  >
>  > }
>  >
>  > Hope that helps.
>  >
>  > Cheers,
>  > Adam
>  >
>  > On Apr 4, 5:15 am, John R <[EMAIL PROTECTED]> wrote:
>  >
>  > > My application is a series of "contests" with different stages
>  > > (submission, voting, awards, etc.)
>  >
>  > > For each stage, the site is going to function completely differently.
>  > > During Stage 1 (submission) for instance, you will be able to upload,
>  > > critique, etc. The front page will be a huge list of all submissions,
>  > > etc. During Stage 2 (voting), you will not be able to upload, only
>  > > vote on submissions from Stage 1. etc.etc.etc.etc.
>  >
>  > > I am having a hard time coming up with a good method for this. The
>  > > current stage is stored in the Contests table of the database.
>  > > Ideally, I would like to basically have a different controller for
>  > > each stage - so it would have it's own functions, views, etc. - but at
>  > > the end of the day - its just a part of the contests_controller. I
>  > > also thought of running a check for the current stage in
>  > > beforeRender() of the contests_controller and then redirecting or
>  > > pointing somewhere else, but I just dont know! Any feedback would be
>  > > great!
>  >
>

--~--~-~--~~~---~--~~
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: Sending two emails in one function

2008-04-04 Thread Samuel DeVore

On Fri, Apr 4, 2008 at 8:04 AM, Kyle Decot <[EMAIL PROTECTED]> wrote:
>
>  I have created a contact form that sends out both an email to me, and
>  a confirmation email to the person who filled out the form. The
>  problem that is when the confirmation email gets sent out, it contains
>  the information from the first email. How can I prevent this? Thank
>  you as always for any help.


Looks like the new manual is missing a section that I wrote when I
made the draft of the entry

You probably need to call $this->Email->reset(); after the first send.

http://cakeforge.org/plugins/wiki/index.php?EmailComponent&id=53&type=g

I'll submit some changes for the docs today or tonight

Sam D
>
>  // Code here
>
> $this->Email->send("$body");
>
>  // set new to, and subject here...
>
> $this->Email->send("$thank_you_body");
>
>  >
>



-- 
-- 
(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/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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



Sending two emails in one function

2008-04-04 Thread Kyle Decot

I have created a contact form that sends out both an email to me, and
a confirmation email to the person who filled out the form. The
problem that is when the confirmation email gets sent out, it contains
the information from the first email. How can I prevent this? Thank
you as always for any help.

// Code here

$this->Email->send("$body");

// set new to, and subject here...

$this->Email->send("$thank_you_body");

--~--~-~--~~~---~--~~
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: Is it possible to create a true REST application yet?

2008-04-04 Thread gentleJuggernaut

Do you know of a best practice for creating a REST application that
will accommodate browsers and still allow 'real' REST clients to
operate?

On Apr 4, 10:25 am, jonknee <[EMAIL PROTECTED]> wrote:
> > Are there really any truly REST compliant applications
> > yet?  or am I missing something major here?  Any help/opinions would
> > be greatly appreciated.
>
> Yes, but not web browsers. There are tons of applications that tie in
> with REST APIs and use all four verbs. It would be really nice if web
> browsers could do the same.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



CakePHP & WorkFlows

2008-04-04 Thread dft

Hello all,

Please has anyone succeeded in integrating a workflow engine with
CakePHP? I'm currently looking at the open source ezComponents
(http://ezcomponents.org) and the WorkFlow engine they have. Can't
seem
to be able to make head or tail of where to begin, even after going
through the introduction.
Usually, I would have applied the usual brute force and built a
generic
one, but I've decided to avoid reinventing the wheel where reasonable.

Pls any and all help is greatly appreciated

Femi


--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread Chris Hartjes

On Fri, Apr 4, 2008 at 10:44 AM, jonknee <[EMAIL PROTECTED]> wrote:
>
>  > > Either that or you'll have to run queries using LIMIT and OFFSET to
>  > > grab what you need one chunk at a time.  I don't know any scripting
>  > > language that handles sucking in 600,000 records via a web page.
>  >
>  >   Think about phpMyAdmin?

1) phpMyAdmin is not a scripting language
2) Notice I've said "sucking in 600,000 records" not "searching
through 600,000 records looking for something".  There is a huge
difference in the two.  I use phpMyAdmin every day for work and I
can't help notice that by default it limits the amount of data you can
pull back.
3) This discussion is veering very far away from CakePHP.


-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "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
-~--~~~~--~~--~--~---



External Link in Excel Doesn't Load Session

2008-04-04 Thread Spectacularium

I'm having a problem with a link to CakePHP from an Excel spreadsheet.
I log in to the web site. then click on the link in excel. When the
browser opens it presents me with the login page again. Once I log in
I'm redirected to the root instead of the page I requested.

If I paste the link in or click on any other links it works fine.

I was using OthAuth but decided to try Auth and the same thing
happens.

I have the following in configuration:

Session.cookie  = 'MASTER_CAKEPHP'
Session.timeout = 120
Session.start = true
Session.checkAgent = false
Security.level = 'low'
Security.salt = 'DEVelpomentMASter5y5t3/\\/\\'

I have the following in the app_controller:
[code]
function beforeFilter() {
$this->Auth->authenticate = $this;
}

function hashPasswords( $data ) {
if( isset( $data['User']['password'] ) ){
$data['User']['password'] = md5( 
$data['User']['password'] );
}
return $data;
}
[/code]

The log in function in the user controller is empty.


The only thing I've tracked down after several days of debugging is
that the session_id that is created on the first load of the page is
different to the one created when it redirects to the log in page.

Am I missing a setting or is this a bug? It's driving me nuts. If I
can get it to just redirect to the correct page I'll be happy. Any
help is appreciated.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Amazon s3 + CakePHP

2008-04-04 Thread John R

The next step of my uber fun app is getting Amazon s3 to play nice
with CakePHP. Sure, I can add the class to Vendors and do everything
manually - but what is the cooler way? Are there any components/
helpers built to orchestrate 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
-~--~~~~--~~--~--~---



CakePHP & Workflows

2008-04-04 Thread Femi Taiwo

Hello all,

Please has anyone succeeded in integrating a workflow engine with 
CakePHP? I'm currently looking at the open source ezComponents 
(http://ezcomponents.org) and the WorkFlow engine they have. Can't seem 
to be able to make head or tail of where to begin, even after going 
through the introduction.
Usually, I would have applied the usual brute force and built a generic 
one, but I've decided to avoid reinventing the wheel where reasonable.

Pls any and all help is greatly appreciated

Femi

--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread jonknee

> > Either that or you'll have to run queries using LIMIT and OFFSET to
> > grab what you need one chunk at a time.  I don't know any scripting
> > language that handles sucking in 600,000 records via a web page.
>
>       Think about phpMyAdmin?
>

PHPMyAdmin makes the DB do all the work. When you upload a .sql file
you are just uploading a file and then telling MySQL the location and
it does all the importing. Same thing with CSV exports. And I've had
plenty of timeouts even with that.

If your reports are really that heavy duty you're probably better off
doing them in batches or from another environment altogether (such is
have CakePHP trigger a report to be run by a Python script). That
said, you can probably heavily optimize your data in the DB, PHP
shouldn't have to deal with all the records in the first place.
--~--~-~--~~~---~--~~
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: Notice (8): Undefined index: in cakephp 1.2

2008-04-04 Thread jonknee

What's not clear about the error message? You have a high error
reporting level (which is why you are seeing notices) and there are
two problems in abc_controller.php. One is you're trying to access an
array with an invalid key. The other is you're trying to access a
variable that doesn't exist. It gives you the variable names, so it
should be a few seconds worth of looking to fix.
--~--~-~--~~~---~--~~
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: Check Unique in a model

2008-04-04 Thread jonknee

> In fact, it seems that this built-in rule doesn't work!
> Why is this not yet fixed? We allways need to check unicity of a field
> in all of our applications...

What's not working for you? It seems to be working for me. I had a
custom method until I was told about isUnique working through
validation and after updating my code it seemed to keep working.
--~--~-~--~~~---~--~~
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: Custom html helper

2008-04-04 Thread Greg Baker

Very interesting fixexactly what I was looking for.  Thanks

On Apr 4, 12:26 pm, grigri <[EMAIL PROTECTED]> wrote:
> There should be an official solution sometime involving aliased
> helpers.
>
> In the meantime, check out my hack here:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/1c1c3701...
>
> On Apr 4, 3:02 pm, Greg Baker <[EMAIL PROTECTED]> wrote:
>
> > I want to create a custom HTML helper that extends htmlhelper..
> > However because of the code I have already that I don't want to
> > change, I want to name this helper so that I can use $html->... in my
> > views.
>
> > Any way I can do this?
> > Normally if this was a new project I'd just create a new class and use
> > that in my views, but I have a lot of code changing to do in this one
> > if I do that.
--~--~-~--~~~---~--~~
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: Custom html helper

2008-04-04 Thread grigri

There should be an official solution sometime involving aliased
helpers.

In the meantime, check out my hack here:

http://groups.google.com/group/cake-php/browse_thread/thread/1c1c370160cb467f

On Apr 4, 3:02 pm, Greg Baker <[EMAIL PROTECTED]> wrote:
> I want to create a custom HTML helper that extends htmlhelper..
> However because of the code I have already that I don't want to
> change, I want to name this helper so that I can use $html->... in my
> views.
>
> Any way I can do this?
> Normally if this was a new project I'd just create a new class and use
> that in my views, but I have a lot of code changing to do in this one
> if I do that.
--~--~-~--~~~---~--~~
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: Is it possible to create a true REST application yet?

2008-04-04 Thread jonknee

> Are there really any truly REST compliant applications
> yet?  or am I missing something major here?  Any help/opinions would
> be greatly appreciated.
>

Yes, but not web browsers. There are tons of applications that tie in
with REST APIs and use all four verbs. It would be really nice if web
browsers could do the same.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Custom html helper

2008-04-04 Thread Greg Baker

I want to create a custom HTML helper that extends htmlhelper..
However because of the code I have already that I don't want to
change, I want to name this helper so that I can use $html->... in my
views.

Any way I can do this?
Normally if this was a new project I'd just create a new class and use
that in my views, but I have a lot of code changing to do in this one
if I do that.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Is it possible to create a true REST application yet?

2008-04-04 Thread gentleJuggernaut

I am currently rewriting an old application for a travel agency.  The
old application uses php and is a mess of spaghetti string
programming.  I am moving it to cakephp for obvious reasons (cake
rocks!)

I really would like to create a REST compliant server side that would
allow a number of different client 'front ends' to work with the
data.  What I have found is that PUT and DELETE are not yet supported
by browsers.

The solutions that I have run across all say to tunnel the PUT and
DELETE requests through POST using a '_method' parameter.

Does anyone have an opinion on this approach?  Is there a better
approach?  Are there really any truly REST compliant applications
yet?  or am I missing something major here?  Any help/opinions would
be greatly appreciated.

GJ
--~--~-~--~~~---~--~~
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: Notice (8): Undefined index: in cakephp 1.2

2008-04-04 Thread Samuel DeVore

not with that amount of information, perhaps some time spent actually
putting some useful information in your question you could get some
better help.  Like what array is is working on, what are some relevant
code lines around that error.

On Thu, Apr 3, 2008 at 11:50 PM, bhushan A <[EMAIL PROTECTED]> wrote:
>
>  Hi all,
>
>   I am upgrading my cakephp 1.1 application to cakephp 1.2 . But i
>  am getting error
>  "Notice (8): Undefined index:xyz  in app/controllers/
>  abc_controller.php"
>  "Notice (8): Undefined variable:xyz  in app/controllers/
>  abc_controller.php"
>
>  Can anybody tell me which changes i have to do and in which files.?
>  Reply.
>
>  Thanks
>  Bhushan
>  >
>



-- 
-- 
(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/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

--~--~-~--~~~---~--~~
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: Amazon AWS SimpleDB

2008-04-04 Thread Howard Lince

Thanks for the info.. I was hoping for a scalable solution for my
website, maybe Microsoft's competing product SSDS (headed to beta) may
give us more options.. http://www.microsoft.com/sql/dataservices/default.mspx

I have seen many articles claim it's already in beta however.. I can't
seem to find much information on it, Would you happen to know more?

On Apr 4, 12:29 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 4, 2008 at 4:04 AM, Howard Lince <[EMAIL PROTECTED]> wrote:
>
> >  Hello all, This is my first post in google groups, I was curious if
> >  anyone has attempted an amazon web services SimpleDB database model
> >  which could be incorporated into. I have been accepted into the beta
> >  and the service itself is decently priced, I was hoping to use it with
> >  cakePHP but have not found any leads yet
>
> Hey Howard,
>
> I had looked into creating one...until I dug around deeper and saw
> that there is no way to do joins on SimpleDB tables, which sort of
> defeats the purpose of using it in Cake.
>
> Check out this article for some more details about it
>
> http://developer.amazonwebservices.com/connect/entry.jspa?externalID=...
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "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: Check Unique in a model

2008-04-04 Thread Steve Verlinden

In fact, it seems that this built-in rule doesn't work!
Why is this not yet fixed? We allways need to check unicity of a field
in all of our applications...

On 3 avr, 16:07, jonknee <[EMAIL PROTECTED]> wrote:
> > I'm trying to make a correct validation for my model.
>
> You can also just use the built-in isUnique function right from
> validation. No need to roll your own on this one. (Just make the rule
> like so: 'rule' => 'isUnique')

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

2008-04-04 Thread Howard Lince

Thanks for the info.. I was hoping for a scalable solution for my
website, maybe Microsoft's competing product SSDS (headed to beta) may
give us more options.. http://www.microsoft.com/sql/dataservices/default.mspx

I have seen many articles claim it's already in beta however..
--~--~-~--~~~---~--~~
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: DarkAuth and HABTM Relationship

2008-04-04 Thread ModByChris

The DarkAuth component just calls your User->find() method,

I would suggest you double check your User model to ensure that your
associations are set correctly there.

ie. from the SQL I would say your User model has a single group
association rather than habtm.

ModByChris




On Apr 3, 3:36 am, lirc201 <[EMAIL PROTECTED]> wrote:
> Just when I thought I have CakePHP figured out, I get a curve ball.
> I'm trying to integrate DarkAuth into my site.
>
> I have a users table, group table both with "id" columns and then a
> join table (HABTM) with group_id, and user_id columns.  I don't
> understand why Cake believes I need to have a User.group_id column.
>
> Query: SELECT `User`.`id`, `User`.`username`, `User`.`passwd`,
> `User`.`firstname`, `User`.`lastname`, `User`.`email`,
> `User`.`last_visit`, `User`.`confirmation`, `User`.`active`,
> `User`.`created`, `User`.`modified`, `Group`.`id`, `Group`.`name`,
> `Group`.`level`, `Group`.`redirect`, `Group`.`perm_type`,
> `Group`.`created`, `Group`.`modified` FROM `users` AS `User` LEFT JOIN
> `groups` AS `Group` ON (`User`.`group_id` = `Group`.`id`) WHERE
> `user`.`email` = 'emmar0se' AND `user`.`passwd` =
> 'afb2d1ffbde69e9adce0adb33b092271' AND `user`.`active` = 1 LIMIT 1
> Warning: SQL Error: 1054: Unknown column 'User.group_id' in 'on
> clause' in D:\My Documents\websites\cake\cake\libs\model\datasources
> \dbo_source.php on line 440
>
> In dark_auth.php the HABTM variable is set to true
> var $HABTM = true; //set to false if you don use a HABTM group
> relationship.
>
> Brian

--~--~-~--~~~---~--~~
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: DarkAuth in home.ctp

2008-04-04 Thread ModByChris

The controller that your home.ctp view uses is the PagesController

The error is showing that your User model doesn't exist within your
Pages controller.

Did you set up your AppController to automatically include the Users
model to all controllers?
e.g. in your AppContoller definition you should have the code


var $uses = array ('User');  // this is the important one.
var $components = array('DarkAuth');

once the component is working correctly you can control content in the
veiw using the switch:

if ( !empty($DarkAuth_User) ) {
  echo "Some content for logged in people!";
} else {
  echo "Content for non-authenticated people";
}

Hope this helps.

On 15 Mar, 20:31, Stefano <[EMAIL PROTECTED]> wrote:
> [Xposted onhttp://bakery.cakephp.org/articles/view/darkauth-another-way]
>
> I'm trying to implement this auth system in one of my projects. Now I
> have a question: I'm trying to add authentication to my home page
> (that is home.ctp). Now, this page has no controller, so how can
> darkauth e aware of it?
>
> I'll try to describe my problem more in depth: I've successfully
> applied darkauth to a User model, so if I try to access /cake/users I
> get my login screen, and everything works fine.
> Now, if I want to go back to my site homepage, located in /cake, I get
> an error:
>
> Undefined property: PagesController::$User [APP/controllers/components/
> dark_auth.php, line 248]
>
> Line 248 says:
>
> $check = $this->controller->{$this->user_model_name}-
>
> >find($conditions);
>
> And I can understand the error, since home.ctp has no controller
> associated.
> home.ctp shows correctly if I logout from darkauth...
> What if I'd like to show a different content on the home page for
> logged/unlogged users? Is it possibile?
> Thanks in advance and sorry for the long post.

--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread AD7six



On Apr 4, 2:41 pm, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Apr 4, 4:51 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Apr 4, 4:08 am, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > > We have some large reports for our application - often involving ~250K
> > > rows from 8 different tables.  The problem is, if your reporting needs
> > > to do any kind of collating or comparison, as ours does, you really
> > > can't avoid having all the data loaded somewhere.  You may be able to
> > > do much of it in your database which should stop PHP from running out
> > > of memory, but it'll have to be used somewhere.
>
> > If you can get the db to do everything, everyone's a winner. 
> > e.g.http://forums.mysql.com/read.php?79,11324,13062#msg-13062
>
> > If you can't get the db to do everything (because the logic isn't all
> > in the db, or it's too complex to do so, or because, because etc.), if
> > you generate your output in chunks (standard batch processing afaic)
> > and dump it into a temporary table - then you can do as above and
> > again: everyone's a winner :).
>
> > Then you only need to send the file to the user, or redirect the user
> > to the right location. For a "standard" csv dump you can reduce your
> > php processing time and memory requirements to practically 0 in this
> > way.
>
>   But, that gonna increase the disk space requirements:-( I

Holy crap, it'll mean you'll need a keyboard to do this aswell! The
list never ends :D

ps: cache. deleting cache, temporary files, etc.
--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread R. Rajesh Jeba Anbiah

On Apr 4, 4:51 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Apr 4, 4:08 am, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > We have some large reports for our application - often involving ~250K
> > rows from 8 different tables.  The problem is, if your reporting needs
> > to do any kind of collating or comparison, as ours does, you really
> > can't avoid having all the data loaded somewhere.  You may be able to
> > do much of it in your database which should stop PHP from running out
> > of memory, but it'll have to be used somewhere.
>
> If you can get the db to do everything, everyone's a winner. 
> e.g.http://forums.mysql.com/read.php?79,11324,13062#msg-13062
>
> If you can't get the db to do everything (because the logic isn't all
> in the db, or it's too complex to do so, or because, because etc.), if
> you generate your output in chunks (standard batch processing afaic)
> and dump it into a temporary table - then you can do as above and
> again: everyone's a winner :).
>
> Then you only need to send the file to the user, or redirect the user
> to the right location. For a "standard" csv dump you can reduce your
> php processing time and memory requirements to practically 0 in this
> way.

  But, that gonna increase the disk space requirements:-( I
considered all known options; but record-by-record dumping is the only
workable approach as far as I see.

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



Re: SQL-log showing when layout does not have $cakeDebug; defined?

2008-04-04 Thread grigri

I override this my extending the datasource. I'm usually happy with
where it's displayed, but I like to syntax-hilight the SQL with geshi.
I also sometimes dump the SQL to a text log as well, which is handy if
there are lots of redirects or something.

http://openpaste.org/en/5941/

I'm sure you can change this to whatever you want.

On Apr 4, 1:23 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Wouldn't it be lovely if we could control where it gets dumped? In a
> little hover over popup bug or something for eaxmple. It would also be
> nice to be able to edit the 'view' used to display this debug table,
> and allow us to do things like display it as a JSON object. That would
> be particularly helpful for debugging ajax endpoints, since the sql
> could be browsed in firebug for example.
>
> Worth an RFE? Worth the dev time? You decide...
>
> Simonhttp://www.simonellistonball.com/
>
> On Apr 4, 1:15 pm, grigri <[EMAIL PROTECTED]> wrote:
>
> > The SQL log is generated and output independently of the $cakeDebug
> > variable, which contains the controller dump for debug level 3.
>
> > To get rid of the dump you need to be in debug level 0 or 1. There
> > might be another switch to turn it off specifically, but I don't know
> > it (especially not for 1.1)
>
> > On Apr 4, 12:48 pm, aka <[EMAIL PROTECTED]> wrote:
>
> > > Hi!
>
> > > I'm using the latest stable release (1.1.19.6305).
>
> > > I don't know if this is intended or not, nut when I make a following
> > > layout:
>
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
>
> > > The SQL-debug still shows on my page like i would have placed  > > echo $cakeDebug; ?> inside my layout.
>
> > > This really puzzles my mind :)
--~--~-~--~~~---~--~~
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: Amazon AWS SimpleDB

2008-04-04 Thread Chris Hartjes

On Fri, Apr 4, 2008 at 4:04 AM, Howard Lince <[EMAIL PROTECTED]> wrote:
>
>  Hello all, This is my first post in google groups, I was curious if
>  anyone has attempted an amazon web services SimpleDB database model
>  which could be incorporated into. I have been accepted into the beta
>  and the service itself is decently priced, I was hoping to use it with
>  cakePHP but have not found any leads yet

Hey Howard,

I had looked into creating one...until I dug around deeper and saw
that there is no way to do joins on SimpleDB tables, which sort of
defeats the purpose of using it in Cake.

Check out this article for some more details about it

http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1292

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "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: subdomain = client config

2008-04-04 Thread [EMAIL PROTECTED]

Currently, you can't really do it properly there was a post the other
day about this, and fool hardy me suggested I might spend some time
building a patch for the Router to enable you to use SERVER variables
in custom routes, which would let you do this by passing url info into
controller->params.

Watch this space... I will do it. Honest.

Simon
http://www.simonellistonball.com/

On Apr 4, 9:42 am, CakeHopeFull <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am a noob with cake,  and have read the turorials, manual, blog
> tutorial, and am excited about starting.  One question I have is this:
>
> I have a site with the following DB (this is dummied down):
> 
> {Table}clients-
> id
> name
> sitecolor
> created
> modified
>
> {Data} clients
> 1
> Test CO
> #CCC
>
> {Table}urls
> id
> client_id
> url
>
> {Data}urls
> 1
> 1
> subdomain.mysite.com
>
> So in PHP on my header file I would do:
>  $cleint = $_SERVER['HTTP_HOST'];
> $sql = "
> SELECT U.*, C.* FROM urls U
> left join clients C on U.client_id = C.id
> WHERE U.url='demo.test.com'
> LIMIT 1
> ";
>
> print "dsljadlkaljsdal";
> ?>
>
> How do I go about this with cake...
> Thanks
> Chris
--~--~-~--~~~---~--~~
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: SQL-log showing when layout does not have $cakeDebug; defined?

2008-04-04 Thread [EMAIL PROTECTED]

Wouldn't it be lovely if we could control where it gets dumped? In a
little hover over popup bug or something for eaxmple. It would also be
nice to be able to edit the 'view' used to display this debug table,
and allow us to do things like display it as a JSON object. That would
be particularly helpful for debugging ajax endpoints, since the sql
could be browsed in firebug for example.

Worth an RFE? Worth the dev time? You decide...

Simon
http://www.simonellistonball.com/

On Apr 4, 1:15 pm, grigri <[EMAIL PROTECTED]> wrote:
> The SQL log is generated and output independently of the $cakeDebug
> variable, which contains the controller dump for debug level 3.
>
> To get rid of the dump you need to be in debug level 0 or 1. There
> might be another switch to turn it off specifically, but I don't know
> it (especially not for 1.1)
>
> On Apr 4, 12:48 pm, aka <[EMAIL PROTECTED]> wrote:
>
> > Hi!
>
> > I'm using the latest stable release (1.1.19.6305).
>
> > I don't know if this is intended or not, nut when I make a following
> > layout:
>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
>
> > The SQL-debug still shows on my page like i would have placed  > echo $cakeDebug; ?> inside my layout.
>
> > This really puzzles my mind :)
--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread [EMAIL PROTECTED]

I suspect what you're looking for is the extremely un-Cake
DboSource::rawQuery, which will return you a resource depending on
your database connection type.

$conn = ConnectionManager::getDataSource('default');
$res = $conn->rawQuery($sql);

Or if you want a bit more help from cake, $conn->execute($sql);

mysql_fetch_row($res)... etc.

Take a look at cake/libs/model/datasources/dbo_source.php if you need
more info.

This is pretty much the most un Cake way you could possibly do
anything, as the other guys have already pointed out, but it should
sort of achieve what you're after. Bear in mind that Cake is not
hibernate, and can't really be, you will never get the sort of fancy
lazy fetching stuff that keeps memory usage down, but that doesn't
really matter, because it's a framework for making web pages - some
thing it does really well - and web pages tend not to require
gigabytes of memory, hence Cake very sensibly doesn't go through all
those other hoops that same an j2ee ORM would.

Simon
http://www.simonellistonball.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: SQL-log showing when layout does not have $cakeDebug; defined?

2008-04-04 Thread grigri

The SQL log is generated and output independently of the $cakeDebug
variable, which contains the controller dump for debug level 3.

To get rid of the dump you need to be in debug level 0 or 1. There
might be another switch to turn it off specifically, but I don't know
it (especially not for 1.1)

On Apr 4, 12:48 pm, aka <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I'm using the latest stable release (1.1.19.6305).
>
> I don't know if this is intended or not, nut when I make a following
> layout:
>
> 
> 
> 
> 
> 
> 
> 
>
> The SQL-debug still shows on my page like i would have placed  echo $cakeDebug; ?> inside my layout.
>
> This really puzzles my mind :)
--~--~-~--~~~---~--~~
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: Old Model layout accessed

2008-04-04 Thread Tomka

Argh!

I found my problem: In my development folder (the location where I
edit my files) the tmp-directory was not empty but contained a very
old model-cache!

Tomka.
--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread AD7six



On Apr 4, 4:08 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> We have some large reports for our application - often involving ~250K
> rows from 8 different tables.  The problem is, if your reporting needs
> to do any kind of collating or comparison, as ours does, you really
> can't avoid having all the data loaded somewhere.  You may be able to
> do much of it in your database which should stop PHP from running out
> of memory, but it'll have to be used somewhere.

If you can get the db to do everything, everyone's a winner. e.g.
http://forums.mysql.com/read.php?79,11324,13062#msg-13062

If you can't get the db to do everything (because the logic isn't all
in the db, or it's too complex to do so, or because, because etc.), if
you generate your output in chunks (standard batch processing afaic)
and dump it into a temporary table - then you can do as above and
again: everyone's a winner :).

Then you only need to send the file to the user, or redirect the user
to the right location. For a "standard" csv dump you can reduce your
php processing time and memory requirements to practically 0 in this
way.

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



SQL-log showing when layout does not have $cakeDebug; defined?

2008-04-04 Thread aka

Hi!

I'm using the latest stable release (1.1.19.6305).

I don't know if this is intended or not, nut when I make a following
layout:









The SQL-debug still shows on my page like i would have placed  inside my layout.

This really puzzles my mind :)
--~--~-~--~~~---~--~~
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: What to do if HABTM a relation is too heavy?

2008-04-04 Thread [EMAIL PROTECTED]

What you're after is a belongsTo relationship.

Purchase:
$belongsTo = array('Currency'=>array('className'='currency',foreignKey
= 'currency_id'));

Simon
http://www.simonellistonball.com/

On Apr 4, 7:57 am, yitzc <[EMAIL PROTECTED]> wrote:
> Hi,
> I am trying to make a relation between a purchase and a currency -
> that is, each purchase is a certain amount and is paid in a certain
> currency (dollars or pounds). I am doing this so that I will be able
> to add other currencies later.
> What I want to do is for the customer to be able to choose from a drop-
> down box which currency he will be paying in.
>
> Currently I am using a Purchase hasOne Currency - But for some reason
> it's when I do a findAll() to Purchases it says SQL Error: 1054:
> Unknown column 'Currency.purchase_id' in 'field list'. (There is a
> 'currency_id' field in the purchase table, but there is NOT a
> purchase_id field on the currency table, because I don't want a
> currency to be tied down to a certain purchase - hence the error).
>
> Now I know I could fix this with a HABTM relation, but I don't want
> the currency to haveMany Purchases - I don't need the extra overhead
> and table. Is there any belongsToMany relation?
>
> (And after I figure that out how do I map the currency name on the
> Purchase view to the currency_id field?)
>
> Thank you,
> yitzcv
--~--~-~--~~~---~--~~
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: input password into mysql under md5 form

2008-04-04 Thread [EMAIL PROTECTED]

You could always do beforeSave() on your model to apply md5() to the
password field in the data member.

However, if you're using the Cake Auth component it will do it for
you. The default is to produce sha1 hashes (actually a salted hash,
based on the Security.salt in the app/config/core.php). However, if
you were to call Security::setHash('md5') before the component was
run, you will get a salted md5 hash instead. Though in this scenario,
you're probably just as well off with sha1.

Simon
http://www.simonellistonball.com/

On Apr 4, 10:51 am, gaynhomgaynhach <[EMAIL PROTECTED]> wrote:
> hi all,
> are you help me the ways input password into mysql under md5 form.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



subdomain = client config

2008-04-04 Thread CakeHopeFull

Hello,

I am a noob with cake,  and have read the turorials, manual, blog
tutorial, and am excited about starting.  One question I have is this:

I have a site with the following DB (this is dummied down):

{Table}clients-
id
name
sitecolor
created
modified

{Data} clients
1
Test CO
#CCC


{Table}urls
id
client_id
url

{Data}urls
1
1
subdomain.mysite.com

So in PHP on my header file I would do:
dsljadlkaljsdal";
?>


How do I go about this with cake...
Thanks
Chris

--~--~-~--~~~---~--~~
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 Regarding Prototype Validation

2008-04-04 Thread meAgain

First Thank You Joel For answering,
i am using required1 because i have renamed the class since there is a
similar class in generic.css of cakephp.
as for the formCallback() i have copied paste it from the demo they
are using on the website.
Should i include  in the form onsubmit"return something something" or
it acts upon events .


On Apr 4, 9:26 am, Joel <[EMAIL PROTECTED]> wrote:
> 1) You should include the prototype/scriptaculous libraries _before_
> any additional scripts that require these libraries.
> 2)I believe the class is "required" and not "required1".
> 3)Also, what is in the formCallback() javascript method?
>
> -Joel.
>
> On Apr 4, 1:20 am, meAgain <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I need help in running prototype in using the validation found on 
> > :http://tetlaw.id.au/view/javascript/really-easy-field-validation
>
> > i have included in my layout  all the files I need :
> > link('validation/scriptaculous/
> > validation.js'); ?>
> > link('validation/scriptaculous/
> > fabtabulous.js'); ?>
> > link('validation/scriptaculous/lib/
> > prototype.js'); ?>
> > css('validation/style'); ?>
>
> > and in the form
> > i have put
> > 
> >  var valid = new Validation('test', {immediate : true,
> > onFormValidate : formCallback});
> > 
> > "  name="test"
> > id="test" method="post" >
>
> >  
> >   Title:  
> >   input('Note/
> > title',array('class'=>'required1','size'=>'40','title'=>'Enter your
> > name'));?>
> >   
>
> >   
> >   Body:
> >   textarea('Note/body') ?>
> >
> >   
>
> >   submit('Save') ?>
> > 
> > 
>
> > But unfortunately it is not running. When i run it i keep getting an
> > error and if whenever i check the view page source i get :
> >  > class="required1 form_error" size="40" title="Enter your name"
> > value="" type="text" id="NoteTitle" />   
>
> >   
> >   Body:
> >> class="form_error">
>
> > what am i missing and why am  i getting the class="required1
> > for_error"
>
Thank you 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
-~--~~~~--~~--~--~---



Re: How to submit a form in a selecttag

2008-04-04 Thread bibi

I have the solution : use directily prototype Ajax obcjet.

$javascriptchange = "new Ajax.Updater('colpanier','/photoweb//basket/
view/35', {asynchronous:true, evalScripts:true,
parameters:Form.serialize(Event.element(event).form), requestHeaders:
['X-Update', 'colbasket']})" ;


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



input password into mysql under md5 form

2008-04-04 Thread gaynhomgaynhach

hi all,
are you help me the ways input password into mysql under md5 form.

--~--~-~--~~~---~--~~
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 Regarding Prototype Validation

2008-04-04 Thread meAgain

Can any one tell me the steps i should follow to run prototype
validation.
using: http://tetlaw.id.au/view/javascript/really-easy-field-validation
Thank you

On Apr 4, 9:26 am, Joel <[EMAIL PROTECTED]> wrote:
> 1) You should include the prototype/scriptaculous libraries _before_
> any additional scripts that require these libraries.
> 2)I believe the class is "required" and not "required1".
> 3)Also, what is in the formCallback() javascript method?
>
> -Joel.
>
> On Apr 4, 1:20 am, meAgain <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I need help in running prototype in using the validation found on 
> > :http://tetlaw.id.au/view/javascript/really-easy-field-validation
>
> > i have included in my layout  all the files I need :
> > link('validation/scriptaculous/
> > validation.js'); ?>
> > link('validation/scriptaculous/
> > fabtabulous.js'); ?>
> > link('validation/scriptaculous/lib/
> > prototype.js'); ?>
> > css('validation/style'); ?>
>
> > and in the form
> > i have put
> > 
> >  var valid = new Validation('test', {immediate : true,
> > onFormValidate : formCallback});
> > 
> > "  name="test"
> > id="test" method="post" >
>
> >  
> >   Title:  
> >   input('Note/
> > title',array('class'=>'required1','size'=>'40','title'=>'Enter your
> > name'));?>
> >   
>
> >   
> >   Body:
> >   textarea('Note/body') ?>
> >
> >   
>
> >   submit('Save') ?>
> > 
> > 
>
> > But unfortunately it is not running. When i run it i keep getting an
> > error and if whenever i check the view page source i get :
> >  > class="required1 form_error" size="40" title="Enter your name"
> > value="" type="text" id="NoteTitle" />   
>
> >   
> >   Body:
> >> class="form_error">
>
> > what am i missing and why am  i getting the class="required1
> > for_error"
>
> > Thank you 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
-~--~~~~--~~--~--~---



What to do if HABTM a relation is too heavy?

2008-04-04 Thread yitzc

Hi,
I am trying to make a relation between a purchase and a currency -
that is, each purchase is a certain amount and is paid in a certain
currency (dollars or pounds). I am doing this so that I will be able
to add other currencies later.
What I want to do is for the customer to be able to choose from a drop-
down box which currency he will be paying in.

Currently I am using a Purchase hasOne Currency - But for some reason
it's when I do a findAll() to Purchases it says SQL Error: 1054:
Unknown column 'Currency.purchase_id' in 'field list'. (There is a
'currency_id' field in the purchase table, but there is NOT a
purchase_id field on the currency table, because I don't want a
currency to be tied down to a certain purchase - hence the error).

Now I know I could fix this with a HABTM relation, but I don't want
the currency to haveMany Purchases - I don't need the extra overhead
and table. Is there any belongsToMany relation?

(And after I figure that out how do I map the currency name on the
Purchase view to the currency_id field?)

Thank you,
yitzcv



--~--~-~--~~~---~--~~
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: tableless model validation

2008-04-04 Thread jamdown

i'm having the same problem, sis you manage to solve 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: `useTable = false` and validation

2008-04-04 Thread jamdown

The form comes up OK for me, but my fields seem to be always valid
even when they shouldn't be. Did you have to do anything else to get
the field to validate?

--~--~-~--~~~---~--~~
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: Old Model layout accessed

2008-04-04 Thread Tomka

Hello.

> The cache is only read in production mode, in debug mode it's
> refreshed every time, so it's not a problem for development.

Thanks for your answer. I found this cache-directory and my models are
cached there although I set

Configure::write('debug', 2);

in config/core.php

Is there another position to activate development-mode in 1.2?

Tomka
--~--~-~--~~~---~--~~
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 theming question

2008-04-04 Thread grigri

Have you read this tutorial? 
http://www.sanisoft.com/blog/2007/12/29/theming-your-cakephp-apps-v12/

On Apr 4, 12:31 am, baal32 <[EMAIL PROTECTED]> wrote:
> I'm very new to Cake and I've been trying to go through the
> documentation on theming.  The external tutorials I've read indicate
> that the theme is set in app/app_controller.php and the theme default
> file is in app/views/themed/(themename)/default.ctp - this part
> appears to be working for me.
>
> However I'm having a hard time figuring out how to apply css and what
> tokens other than $title_for_layout and $content_for_layout are
> available.  I've placed style.css in /webroot/themed/(themename)/css
> yet it isnt being applied.  Do I reference it explicitly from
> default.ctp or is there some Cake magic that I can invoke?
>
> Thanks for any guidance
--~--~-~--~~~---~--~~
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: Yet another HABTM problem with self-referencing model (var useTable)

2008-04-04 Thread grigri

You just need to change the alias :

class Tag extends AppModel {
  var $hasAndBelongsToMany = array(
'RelatedTag' => array('className' => 'Tag')
  );
}

In your resultset the `Tag` key will now refer to the "main" tag and
the `RelatedTag` will contain the related tags. Of course you can
change the alias to anything suitable.

On Apr 4, 11:17 am, dizz <[EMAIL PROTECTED]> wrote:
> I was just having the same problem, used your method and it's working
> fine now.
>
> On Mar 30, 9:36 pm, "ste.ve" <[EMAIL PROTECTED]> wrote:
>
> > To visualize it better, these are my example Model definitions
>
> > WORKS:
>
> > class Tag extends AppModel {
>
> > var $hasAndBelongsToMany = array(
> >  'Tag2' => array(
> > 'foreignKey' => 
> > 'tag_id',
>
> > 'associationForeignKey' => 'tag2_id', )
> > );
>
> > }
>
> > class Tag2 extends AppModel {
>
> > var $useTable = "tags";
>
> > var $hasAndBelongsToMany = array(
> >  'Tag' => array(
> >  'foreignKey' => 'tag2_id',
> >  'associationForeignKey' => 
> > 'tag_id',
> > ));
>
> > }
>
> > DOESN'T WORK (in the result set, all rows for Tag2 contain the value
> > from Tag - the number of results is correct, anyhow)
>
> > class Tag extends AppModel {
>
> > var $hasAndBelongsToMany = array('Tag2' );
>
> > }
>
> > class Tag2 extends AppModel {
>
> > var $useTable = "tags";
>
> > var $hasAndBelongsToMany = array( 'Tag' );
>
> > }
--~--~-~--~~~---~--~~
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: Old Model layout accessed

2008-04-04 Thread grigri

the model schemas are cached in app/tmp/cache/models - empty that
folder when you make changes to the schema.

The cache is only read in production mode, in debug mode it's
refreshed every time, so it's not a problem for development.

On Apr 4, 11:02 am, Tomka <[EMAIL PROTECTED]> wrote:
> Hello.
>
> For development I use a local Xampp-installation on WinXP. My app
> (cakePHP 1.2) is deployed on a linux webserver.
>
> The following problem only exists on my development machine:
> From time to time cake seems to access an old model-layout - I dont
> know where to cache it. I changed the table-layout for the user-table
> for example (deleting the column "person_id"). Now sometimes I get the
> error
>
> SQL Error: 1054: Unknown column 'User.person_id' in 'field list' [CORE
> \cake\libs\model\datasources\dbo_source.php, line 440]
>
> Usually this happens after I delete the app-directory in the htdocs-
> path of xampp and copy the new files to there from my development
> path.
> Reload the accessed page does not help. Accessing the same page two
> minutes later without doing anything at this time makes the error
> disapear.
>
> Where is the information cached and how can I disable this cache for
> development?
>
> Thanks in advance,
>
> Tomka.
--~--~-~--~~~---~--~~
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: Yet another HABTM problem with self-referencing model (var useTable)

2008-04-04 Thread dizz

I was just having the same problem, used your method and it's working
fine now.

On Mar 30, 9:36 pm, "ste.ve" <[EMAIL PROTECTED]> wrote:
> To visualize it better, these are my example Model definitions
>
> WORKS:
>
> class Tag extends AppModel {
>
>         var $hasAndBelongsToMany = array(
>                                  'Tag2' => array(
>                                                         'foreignKey' => 
> 'tag_id',
>
> 'associationForeignKey' => 'tag2_id', )
>                                 );
>
> }
>
> class Tag2 extends AppModel {
>
>         var $useTable = "tags";
>
>         var $hasAndBelongsToMany = array(
>                                  'Tag' => array(
>                                          'foreignKey' => 'tag2_id',
>                                          'associationForeignKey' => 'tag_id',
>                         ));
>
> }
>
> DOESN'T WORK (in the result set, all rows for Tag2 contain the value
> from Tag - the number of results is correct, anyhow)
>
> class Tag extends AppModel {
>
>         var $hasAndBelongsToMany = array('Tag2' );
>
> }
>
> class Tag2 extends AppModel {
>
>         var $useTable = "tags";
>
>         var $hasAndBelongsToMany = array( 'Tag' );
>
> }
--~--~-~--~~~---~--~~
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: InPlaceEditor

2008-04-04 Thread [EMAIL PROTECTED]

Thank you a lot every one for your fast and accurate answer.
It works perfectly with $this->params['form']['value']

I will certainly have a look a jQuery, because I see that lots of
people using cake prefer it over scriptaculous.
I've installed Firebug and it will certainly help me.

Great to have such a reactive community.
Thank you guys

Loic



On Apr 3, 10:35 pm, mbavio <[EMAIL PROTECTED]> wrote:
> Dude, uso jQuery, there is a plugin called jEditable, and it´s so easy
> to implement...
>
> http://cakebaker.42dh.com/2008/02/24/edit-in-place-with-jquery-and-ca...
>
> Cheers,
> mbavio
>
> On Apr 3, 1:28 pm, Joel <[EMAIL PROTECTED]> wrote:
>
> > Look in $this->params['form']['value'].
> > Use Firebug to debug AJAX/AHAH requests, otherwise you're going to be
> > pulling your hair out.
>
> > -Joel.
>
> > On Apr 3, 11:58 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > I use jQuery, so I'm not overly familiar with the $ajax methods. But I
> > > think you should be checking $this->params['queryString'] or
> > > $this->params['form']['your_field']
>
> > > At any rate, place a $this->log($this->params) at the top of your
> > > controller method to see what's in there.
>
> > > On Thu, Apr 3, 2008 at 6:09 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 
> > > wrote:
>
> > > >  I want to use the Ajax inPlaceEditor and I can't get it working :
>
> > > >  I have this in  index view: (It work fine)
>
> > > >  
> > > >  editor('edit', 'updateTitle' ); ?>
>
> > > >  Then in PostsController I have the function updateTitlte :
> > > >  function updateTitle($id){
> > > > $this->Post->id = $id;
> > > > $this->Topic->saveField('title', ???);   //Here is where my
> > > >  problems are
> > > > $this->set('postTitle', ???);
>
> > > > $this->layout = 'ajax';
> > > >  }
>
> > > >  And the view update_title.ctp
> > > >  
>
> > > >  My problem is that I don't know how to get the new value of title. I
> > > >  thought it would be in $this->data, but it's empty. Maybee I do
> > > >  something wrong and $this->data should'nt be empty or maybee the new
> > > >  value is somewhere else.
> > > >  I would be very happy if someone could give me some advices on this.
>
> > > >  Thank you 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
-~--~~~~--~~--~--~---



gmail StartTLS problem

2008-04-04 Thread bob
I am running cake 1.2 on XAMPP on Windows XP. I am trying to test
SwiftMailer integration with Cake using Gmail

Here is my code

$this->SwiftMailer->connection = 'smtp'; // default and thus you don't have
to specify it

$this->SwiftMailer->smtp_host = 'smtp.gmail.com';

$this->SwiftMailer->smtp_type = 'tls';

$this->SwiftMailer->smtp_port = '587'; //'587'; //'465';

 $this->SwiftMailer->username = '[EMAIL PROTECTED]';

$this->SwiftMailer->password = 'xxx';

if($this->SwiftMailer->connect())

{

$this->SwiftMailer->addTo('from',"[EMAIL PROTECTED]","firstname lastname");

$this->SwiftMailer->addTo('to',"[EMAIL PROTECTED]");

$this->SwiftMailer->mailer->addPart("Plain Body");

$this->SwiftMailer->mailer->addPart("Html Body", 'text/html');

$this->SwiftMailer->send("Subject");

}

}

However, the authenticate() method in SwiftMailer is return this:


Expected response code(s) [250] but got response [530 5.7.0 Must issue a
STARTTLS command first. l22sm10679700waf.10]
Log Information ++ Log level changed to 3 << 220 mx.google.com ESMTP
l22sm10679700waf.10>> EHLO [127.0.0.1] << 250-mx.google.com at your service,
[75.43.217.110]250-SIZE 28311552 250-8BITMIME250-STARTTLS250
ENHANCEDSTATUSCODES>> AUTH CRAM-MD5 >> RSET << 530 5.7.0 Must issue a
STARTTLS command first. l22sm10679700waf.10 !! Expected response code(s)
[250] but got response [530 5.7.0 Must issue a STARTTLS command first.
l22sm10679700waf.10]


How do I start STARTTLS? Is this an XAMPP, Cake, or SwiftMailer issue? I
cannot seem to figure it out..

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



Old Model layout accessed

2008-04-04 Thread Tomka

Hello.

For development I use a local Xampp-installation on WinXP. My app
(cakePHP 1.2) is deployed on a linux webserver.

The following problem only exists on my development machine:
>From time to time cake seems to access an old model-layout - I dont
know where to cache it. I changed the table-layout for the user-table
for example (deleting the column "person_id"). Now sometimes I get the
error

SQL Error: 1054: Unknown column 'User.person_id' in 'field list' [CORE
\cake\libs\model\datasources\dbo_source.php, line 440]

Usually this happens after I delete the app-directory in the htdocs-
path of xampp and copy the new files to there from my development
path.
Reload the accessed page does not help. Accessing the same page two
minutes later without doing anything at this time makes the error
disapear.

Where is the information cached and how can I disable this cache for
development?

Thanks in advance,

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



  1   2   >