Re: Newbie Question: conditions on a find('all') for hasMany?

2008-06-30 Thread majna

First question: maybe with Containable behaviour?

$this->Term->contain('Course' => array(
'conditions'=>array( 'Course.id' => 1),
'order' => 'year DESC',)
);

Damn, You can even be dirty  $this->Term->hasMany['Course']
['conditions'] =" Course.id =1;":)





On Jul 1, 6:49 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> The documentation you are referring to is misleading - a join is only
> used across a belongsTo association (and hasOne), never for hasMany.
>
> Basically, you can't have query conditions across a hasMany
> association.  You will have to either query the other way (as you saw,
> the Course belongsTo Term, so you can put Term conditions in the
> Course query), or do the filtering in PHP after retrieving all data.
> The Containable behaviour will not help with this - it really just
> does some tricky bind / unbind and sets the appropriate recursive for
> the  query, it won't help with conditions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



FPDF in cakephp 1.2

2008-06-30 Thread joselee

I have a cakephp 1.1 where i can generate pdf using fpdf, I am
currently shifiting the application to cakephp 1.2 I get
a Notice and an error

Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php,
line 148]

Code | Context
$orientation=   array()
$unit   =   "mm"
$format =   array(
595.28,
841.89
)
strtolower - [internal], line ??
FPDF::FPDF() - APP\vendors\fpdf\fpdf.php, line 148
View::_loadHelpers() - CORE\cake\libs\view\view.php, line 727
View::_render() - CORE\cake\libs\view\view.php, line 621
View::render() - CORE\cake\libs\view\view.php, line 368
Controller::render() - CORE\cake\libs\controller\controller.php, line
732
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 265
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 233
[main] - APP\webroot\index.php, line 84
FPDF error: Incorrect orientation: array
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Newbie Question: conditions on a find('all') for hasMany?

2008-06-30 Thread Grant Cox

The documentation you are referring to is misleading - a join is only
used across a belongsTo association (and hasOne), never for hasMany.

Basically, you can't have query conditions across a hasMany
association.  You will have to either query the other way (as you saw,
the Course belongsTo Term, so you can put Term conditions in the
Course query), or do the filtering in PHP after retrieving all data.
The Containable behaviour will not help with this - it really just
does some tricky bind / unbind and sets the appropriate recursive for
the query, it won't help with conditions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug with findAllThreaded in cake1.2 rc2 build 7296?

2008-06-30 Thread ray

Will do. Thanks Jonathan.

On Jun 30, 7:21 pm, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
> Post it to trac. If at all possible, including a test case and/or
> patch would be helpeful as well.
>
> On Mon, Jun 30, 2008 at 10:12 PM, ray <[EMAIL PROTECTED]> wrote:
>
> > Hi there... I tried the irc room but didn't get a response.
>
> > I believe there's a new bug that was introduced with the latest
> > version of cake1.2rc2 (build 7296)
>
> > Previously findAllThreaded would work for tables that didn't have a
> > primary key of 'id' but as of this build looks like it was refactored
> > and hard coded to look for id only.
>
> > Changing line 1997 to be:
>
> > $id = $result[$this->alias][$this->primaryKey];
>
> > Fixes the problem.
>
> > As I mentioned in irc this is the first time I'm coming across a bug
> > that hasn't been encountered below so I'm trying to follow protocol.
> > I'm not sure if somebody can just fix this or if I should log a bug in
> > trac?
>
> > Thanks all. And keep up the great work on Cake.
>
> > - Ray
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug with findAllThreaded in cake1.2 rc2 build 7296?

2008-06-30 Thread Jonathan Snook

Post it to trac. If at all possible, including a test case and/or
patch would be helpeful as well.

On Mon, Jun 30, 2008 at 10:12 PM, ray <[EMAIL PROTECTED]> wrote:
>
> Hi there... I tried the irc room but didn't get a response.
>
> I believe there's a new bug that was introduced with the latest
> version of cake1.2rc2 (build 7296)
>
> Previously findAllThreaded would work for tables that didn't have a
> primary key of 'id' but as of this build looks like it was refactored
> and hard coded to look for id only.
>
> Changing line 1997 to be:
>
> $id = $result[$this->alias][$this->primaryKey];
>
> Fixes the problem.
>
> As I mentioned in irc this is the first time I'm coming across a bug
> that hasn't been encountered below so I'm trying to follow protocol.
> I'm not sure if somebody can just fix this or if I should log a bug in
> trac?
>
> Thanks all. And keep up the great work on Cake.
>
> - Ray
> >
>

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



bug with findAllThreaded in cake1.2 rc2 build 7296?

2008-06-30 Thread ray

Hi there... I tried the irc room but didn't get a response.

I believe there's a new bug that was introduced with the latest
version of cake1.2rc2 (build 7296)

Previously findAllThreaded would work for tables that didn't have a
primary key of 'id' but as of this build looks like it was refactored
and hard coded to look for id only.

Changing line 1997 to be:

$id = $result[$this->alias][$this->primaryKey];

Fixes the problem.

As I mentioned in irc this is the first time I'm coming across a bug
that hasn't been encountered below so I'm trying to follow protocol.
I'm not sure if somebody can just fix this or if I should log a bug in
trac?

Thanks all. And keep up the great work on Cake.

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



Re: Newbie Question: conditions on a find('all') for hasMany?

2008-06-30 Thread floob

I'm not sure that either of these suggestions will help your problem, but ...

1) you should try using the latest CakePHP (revision 7296 last I
checked).  There have been a number of improvements and bug fixes
since 6311.
2) you've got an extra comma at the end of your find query
("'recursive' => 0,").  I don't see any reason why it would cause your
error, but it couldn't hurt to remove it.


On Mon, Jun 30, 2008 at 12:25 PM, Mike <[EMAIL PROTECTED]> wrote:
>
> Hello!
>
> I'm really sorry to post this, but I've looked around, and haven't
> been able to figure out how to do a find on a Model (named 'Term"),
> using conditions that restrict the results based on fields in another
> model (named "Course") that belongsTo the first model .  Term hasMany
> Course.
>
> In the manual (http://book.cakephp.org/view/66/models#retrieving-your-
> data-73), at the end of 3.7.4.2 ("Complex Find Conditions"), is says
> "These conditions are also infinitely nest-able. Let's say you had a
> hasMany/belongsTo relationship between Posts and Authors, which would
> result in a LEFT JOIN. Let's say you wanted to find all the posts that
> contained a certain keyword ("magic") or were created in the past two
> weeks, but you want to restrict your search to posts written by Bob",
> and has the example code of:
> "Author.name" => "Bob"
>
>
>
> So in my app, I want to have Terms (school terms - in the US,
> semesters, or maybe quarters, depending on the college), and Courses.
> I'd like to be able to ask for a list of all Terms, such that there's
> at least one course in that term.  I'd also like to figure out how to
> generally be able to filter my finds based on critieria :).  So to
> start, I figured that I'd just ask for all terms that have course #1
> in them (which should just be one term), in order to figure out how to
> use the find('all') conditions.
>
> (I've got all the code up at http://bin.cakephp.org/saved/34262, if
> it's more readable there)
>
> The problem is that if I try to do:
>
> $terms = $this->Term->find('all', array(
>  'conditions' => array('Course.id' => '1'),
>  'order' => 'year DESC',
>  'recursive' => 2,
>  )) ;
>
> The resulting SQL query looks like:
>
> SELECT `Term`.`id`, `Term`.`year`, `Term`.`quartername` FROM `terms`
> AS `Term` WHERE `Course`.`id` = 1 ORDER BY `year` DESC
>
> Which causes problems b/c it's only using the Term table, but my
> condition uses the Course field.  As far as I can tell, CakePHP will
> first query the terms table, then will separately query the Courses
> table, but it doesn't seem to be putting the 'Course.id' criteria on
> the right query.  Based on what I read in the manual, I would expect
> this to work, but it isn't.
>
> What's odd is that if I query the COURSE instead, like so:
>
> $terms = $this->Course->find('all', array(
>'conditions' => array('Term.id' => 1, 'Course.id' => 1),
>'order' => 'Term.year DESC',
>'recursive' => 0,
>)) ;
> $terms = Set::extract($terms, "{n}.Term"); // RC2: -> classicExtract
>
> Cake generates SQL kinda like:
> SELECT `Course`.`id`, `Course`.`term_id`, /*SNIP*/ `Term`.`id`,
> `Term`.`year`, `Term`.`quartername` FROM `courses` AS `Course` LEFT
> JOIN `terms` AS `Term` ON (`Course`.`term_id` = `Term`.`id`) WHERE
> `Term`.`id` = 1 AND `Course`.`id` = 1 ORDER BY `Term`.`year` DESC
>
> Since this query includes both tables, the condition works.  Using the
> Set::extract, I can then get back to my list of terms (which should
> work just fine, if my recursive level is high enough :) ).
>
>
> My first question: If Term hasMany Course, and I want a list of Terms
> (filtered, in part, based on Courses), shouldn't I be doing a find on
> Term (i.e., the first query)?
>
> Second question: If I wanted to get a list of Terms that have a non-
> empty sublist of Courses, can I do that by querying the Term?  The
> second query (i.e., the one on Course) does this for my by default),
> but it seems a tad bit odd.
>
>
> I'm trying to use the Cake 1.2.0.6311 (beta) distribution on XAMP, and
> I've tried it using both FireFox 3 and IE 7.0.5730.13, not that the
> client should matter.
>
>
>Quick Aside: I've looked at using the new ContainableBehavior, but
> as I understand it, I should be able to filter using the Find method.
> I _think_ that Containable will try to (un)bind models to restrict the
> query - I"m not sure if it'll actually put the conditions onto the
> query, or if it'll pull all the data back, then apply conditions in-
> memory.
>There's a note at the very end of the manual entry that says
> "Additional filtering can be performed by supplying the standard Model-
>>find() options" (http://book.cakephp.org/view/474/containable).  That
> said, if I'm wrong in my understanding of this, and Containable should
> be used here, please let me know!
>
> If anyone could help (or even just offer suggestions/hints), that
> would be great!
> Thanks!
> --Mike
> >
>

--~-

Re: Documentation

2008-06-30 Thread Gustavo Carreno

Hey John,

Ok, for me it's definitely ACL.
I've read most of the blog's articles about it. Read most of the GG
threads but it's still a big scary monster.
I understand the concept. I understand most of the configuration stuff
on the controller but the problem is that you have many types of
granularity all mixed up on those examples.
I would really appreciate a concise walk through, at least, 2 types of
ACL implementation: The simple flat hierarchy of admin, manager, user
that have all kinds of combinations on actions; The 2, 3 or more
layered hierarchy with all the cross fire between that and actions.

That would be amazing!!

-- 
Gustavo Carreno
--- http://batxman.wordpress.com
< If you know Red Hat you know Red Hat,
If you know Slackware you know Linux >

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



Re: Release: Some RC2 Sweetness

2008-06-30 Thread Gustavo Carreno

On Fri, Jun 27, 2008 at 10:43 AM, Gwoo <[EMAIL PROTECTED]> wrote:
>
> The release of CakePHP 1.2RC2 [1] with several bug fixes and
> optimizations brings more speed and stability to the 1.2 series.

Due to work impositions I'm now a ZF guy, well not a ZF guy since I'm
being dragged kickin' an screamin' CAKE!!!

I never loose track of the community and development and this is a
major step stone in the path to "World Domination".

I'm sure I'll be succesful with my Cake evangelising on this new job,
until then I want to give my utter support to the "guys" and a very
warm CONGRATS for this release!!

Please try and maintain the magic flowing and thank you for the,
spectacular, amount of it you guys have poured onto our heads already!

Cheers,
Gustavo Carreno
--- http://batxman.wordpress.com
< If you know Red Hat you know Red Hat,
If you know Slackware you know Linux >

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



Re: Email component won't send

2008-06-30 Thread Turnquist, Jonah

Ok, thanks for the help.  I'm not sure yet if I am going to switch or
not yet, as it does work kinda, just not all the way.  Probably will
later actually

Thanks,
Jonah

On Jun 30, 3:07 pm, r0mk1n <[EMAIL PROTECTED]> wrote:
> no, you can use it anywhere you want ( with correct options of
> course )
>
> On Jul 1, 1:03 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > Question, will using SMTP as you suggested still work once I upload it
> > to dreamhost?
>
> > On Jun 30, 3:00 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > I can use mail() with localhost.  I set up the php.ini to do it and it
> > > works fine.  I also got it to work with the email component, but only
> > > if I don't contain < or > characters, that is my problem.
>
> > > On Jun 30, 2:55 pm, r0mk1n <[EMAIL PROTECTED]> wrote:
>
> > > > this string "$this->smtpOptions . " must be:
> > > > $this->Email->smtpOptions = array(  'port'=> 25, 'host' =>
> > > > 'yourSMTPServer', 'username'=>'yourUserName',
> > > > 'password'=>'yourSMTPPassword', 'timeout' => 30 );
>
> > > > Sorry :(
>
> > > > On Jul 1, 12:53 am, r0mk1n <[EMAIL PROTECTED]> wrote:
>
> > > > > you are trying to send via PHPs mail function ( default method in
> > > > > Email component ), but you can`t do it from localhost ;)
> > > > > better way - send via SMTP
>
> > > > > 1. you need to setup smtp delivery:
>
> > > > > $this->Email->delivery = 'smtp';
>
> > > > > 2. setup SMTP params:
>
> > > > > $this->smtpOptions = array(  'port'=> 25, 'host' => 'yourSMTPServer',
> > > > > 'username'=>'yourUserName', 'password'=>'yourSMTPPassword', 'timeout'
> > > > > => 30 );
>
> > > > > 3. Sending  ;)
>
> > > > > To get SMTP settings you need to get email relay information from your
> > > > > hosting support (server, username and password)
>
> > > > > P.S. with standart component you can`t send your emails via relay
> > > > > servers that using TLS or SSL connections ( like gmail.com ), to do
> > > > > this you need using some like ShiftMailer
>
> > > > > On Jun 30, 11:14 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Update:  I figured out I can get it to work if I remove all < and >
>
> > > > > > $this->Email->from = 'No Reply ';
> > > > > > $this->Email->replyTo = No Reply '';
> > > > > > $this->Email->return = No Reply '';
>
> > > > > > changed to this:
>
> > > > > > $this->Email->from = 'noreply@'.env('HTTP_HOST');
> > > > > > $this->Email->replyTo = 'noreply@'.env('HTTP_HOST');
> > > > > > $this->Email->return = 'noreply@'.env('HTTP_HOST');
>
> > > > > > Now it works, but of course now I can't supply a name.  Is there a
> > > > > > better solution?
>
> > > > > > On Jun 30, 12:09 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Ok, I went through the email component code and removed the '@' 
> > > > > > > sign
> > > > > > > from the mail function to show error messages, and so now it gives
> > > > > > > this error:
>
> > > > > > > Warning (2): mail() [function.mail]: SMTP server response: 550 
> > > > > > > 5.1.0
> > > > > > > <=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected after 
> > > > > > > '=?UTF-8?
> > > > > > > B??=' [CORE\cake\libs\controller\components\email.php, line 667]
>
> > > > > > > And this is what it ran (I put a little echo in it to see what it 
> > > > > > > was
> > > > > > > putting into the mail() function) to get the error:
> > > > > > > mail(poppitypopATgmailDOTcom, =?UTF-8?B?
> > > > > > > V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content stuff 
> > > > > > > here ,
> > > > > > > From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: 
> > > > > > > =?UTF-8?B??= X-
> > > > > > > Mailer: CakePHP Email Component Content-Type: text/plain;
> > > > > > > charset=UTF-8 Content-Transfer-Encoding: 7bit, )'
>
> > > > > > > So I conclude the problem is the ?UTF-8?B??.  Which is probably
> > > > > > > something I can not fix myself.  This is a bug.  Could someone 
> > > > > > > make a
> > > > > > > ticket for this?  hehe, I really have no idea how to use trac,
> > > > > > > otherwise I would do it myself...
>
> > > > > > > On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Note the "=?UTF-8?B??=" bits. There seems to be a lot of that 
> > > > > > > > going
> > > > > > > > on. I don't know if anyone's figured out the cause yet but I 
> > > > > > > > suggest
> > > > > > > > you check Trac.
>
> > > > > > > > On Fri, Jun 27, 2008 at 11:19 PM, Turnquist, Jonah <[EMAIL 
> > > > > > > > PROTECTED]> wrote:
>
> > > > > > > > > I am having a problem with the email component.  I am trying 
> > > > > > > > > to get it
> > > > > > > > > to send a simple text email.  I have set up the layouts and
> > > > > > > > > templates.  But for some reason it will not send.  nor will 
> > > > > > > > > it throw
> > > > > > > > > an error.  I am using WAMP, and set up the php.ini to send 
> > > > > > > > > email
> > > > > > > > > correctly as far as I can tell.  The funny thing is that the 
> > > > > > > > > php

Re: Email component won't send

2008-06-30 Thread r0mk1n

no, you can use it anywhere you want ( with correct options of
course )

On Jul 1, 1:03 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
> Question, will using SMTP as you suggested still work once I upload it
> to dreamhost?
>
> On Jun 30, 3:00 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > I can use mail() with localhost.  I set up the php.ini to do it and it
> > works fine.  I also got it to work with the email component, but only
> > if I don't contain < or > characters, that is my problem.
>
> > On Jun 30, 2:55 pm, r0mk1n <[EMAIL PROTECTED]> wrote:
>
> > > this string "$this->smtpOptions . " must be:
> > > $this->Email->smtpOptions = array(  'port'=> 25, 'host' =>
> > > 'yourSMTPServer', 'username'=>'yourUserName',
> > > 'password'=>'yourSMTPPassword', 'timeout' => 30 );
>
> > > Sorry :(
>
> > > On Jul 1, 12:53 am, r0mk1n <[EMAIL PROTECTED]> wrote:
>
> > > > you are trying to send via PHPs mail function ( default method in
> > > > Email component ), but you can`t do it from localhost ;)
> > > > better way - send via SMTP
>
> > > > 1. you need to setup smtp delivery:
>
> > > > $this->Email->delivery = 'smtp';
>
> > > > 2. setup SMTP params:
>
> > > > $this->smtpOptions = array(  'port'=> 25, 'host' => 'yourSMTPServer',
> > > > 'username'=>'yourUserName', 'password'=>'yourSMTPPassword', 'timeout'
> > > > => 30 );
>
> > > > 3. Sending  ;)
>
> > > > To get SMTP settings you need to get email relay information from your
> > > > hosting support (server, username and password)
>
> > > > P.S. with standart component you can`t send your emails via relay
> > > > servers that using TLS or SSL connections ( like gmail.com ), to do
> > > > this you need using some like ShiftMailer
>
> > > > On Jun 30, 11:14 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > > Update:  I figured out I can get it to work if I remove all < and >
>
> > > > > $this->Email->from = 'No Reply ';
> > > > > $this->Email->replyTo = No Reply '';
> > > > > $this->Email->return = No Reply '';
>
> > > > > changed to this:
>
> > > > > $this->Email->from = 'noreply@'.env('HTTP_HOST');
> > > > > $this->Email->replyTo = 'noreply@'.env('HTTP_HOST');
> > > > > $this->Email->return = 'noreply@'.env('HTTP_HOST');
>
> > > > > Now it works, but of course now I can't supply a name.  Is there a
> > > > > better solution?
>
> > > > > On Jun 30, 12:09 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Ok, I went through the email component code and removed the '@' sign
> > > > > > from the mail function to show error messages, and so now it gives
> > > > > > this error:
>
> > > > > > Warning (2): mail() [function.mail]: SMTP server response: 550 5.1.0
> > > > > > <=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected after 
> > > > > > '=?UTF-8?
> > > > > > B??=' [CORE\cake\libs\controller\components\email.php, line 667]
>
> > > > > > And this is what it ran (I put a little echo in it to see what it 
> > > > > > was
> > > > > > putting into the mail() function) to get the error:
> > > > > > mail(poppitypopATgmailDOTcom, =?UTF-8?B?
> > > > > > V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content stuff here ,
> > > > > > From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: =?UTF-8?B??= 
> > > > > > X-
> > > > > > Mailer: CakePHP Email Component Content-Type: text/plain;
> > > > > > charset=UTF-8 Content-Transfer-Encoding: 7bit, )'
>
> > > > > > So I conclude the problem is the ?UTF-8?B??.  Which is probably
> > > > > > something I can not fix myself.  This is a bug.  Could someone make 
> > > > > > a
> > > > > > ticket for this?  hehe, I really have no idea how to use trac,
> > > > > > otherwise I would do it myself...
>
> > > > > > On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Note the "=?UTF-8?B??=" bits. There seems to be a lot of that 
> > > > > > > going
> > > > > > > on. I don't know if anyone's figured out the cause yet but I 
> > > > > > > suggest
> > > > > > > you check Trac.
>
> > > > > > > On Fri, Jun 27, 2008 at 11:19 PM, Turnquist, Jonah <[EMAIL 
> > > > > > > PROTECTED]> wrote:
>
> > > > > > > > I am having a problem with the email component.  I am trying to 
> > > > > > > > get it
> > > > > > > > to send a simple text email.  I have set up the layouts and
> > > > > > > > templates.  But for some reason it will not send.  nor will it 
> > > > > > > > throw
> > > > > > > > an error.  I am using WAMP, and set up the php.ini to send email
> > > > > > > > correctly as far as I can tell.  The funny thing is that the php
> > > > > > > > mail() function DOES work, just not the email component.
> > > > > > > > Here is the code in the 
> > > > > > > > controller:http://bin.cakephp.org/view/2104639841
> > > > > > > > could somone glance at it?
>
> > > > > > > > Thanks,
> > > > > > > > Jonah
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googl

Re: Email component won't send

2008-06-30 Thread Turnquist, Jonah

Question, will using SMTP as you suggested still work once I upload it
to dreamhost?

On Jun 30, 3:00 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
> I can use mail() with localhost.  I set up the php.ini to do it and it
> works fine.  I also got it to work with the email component, but only
> if I don't contain < or > characters, that is my problem.
>
> On Jun 30, 2:55 pm, r0mk1n <[EMAIL PROTECTED]> wrote:
>
> > this string "$this->smtpOptions . " must be:
> > $this->Email->smtpOptions = array(  'port'=> 25, 'host' =>
> > 'yourSMTPServer', 'username'=>'yourUserName',
> > 'password'=>'yourSMTPPassword', 'timeout' => 30 );
>
> > Sorry :(
>
> > On Jul 1, 12:53 am, r0mk1n <[EMAIL PROTECTED]> wrote:
>
> > > you are trying to send via PHPs mail function ( default method in
> > > Email component ), but you can`t do it from localhost ;)
> > > better way - send via SMTP
>
> > > 1. you need to setup smtp delivery:
>
> > > $this->Email->delivery = 'smtp';
>
> > > 2. setup SMTP params:
>
> > > $this->smtpOptions = array(  'port'=> 25, 'host' => 'yourSMTPServer',
> > > 'username'=>'yourUserName', 'password'=>'yourSMTPPassword', 'timeout'
> > > => 30 );
>
> > > 3. Sending  ;)
>
> > > To get SMTP settings you need to get email relay information from your
> > > hosting support (server, username and password)
>
> > > P.S. with standart component you can`t send your emails via relay
> > > servers that using TLS or SSL connections ( like gmail.com ), to do
> > > this you need using some like ShiftMailer
>
> > > On Jun 30, 11:14 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > Update:  I figured out I can get it to work if I remove all < and >
>
> > > > $this->Email->from = 'No Reply ';
> > > > $this->Email->replyTo = No Reply '';
> > > > $this->Email->return = No Reply '';
>
> > > > changed to this:
>
> > > > $this->Email->from = 'noreply@'.env('HTTP_HOST');
> > > > $this->Email->replyTo = 'noreply@'.env('HTTP_HOST');
> > > > $this->Email->return = 'noreply@'.env('HTTP_HOST');
>
> > > > Now it works, but of course now I can't supply a name.  Is there a
> > > > better solution?
>
> > > > On Jun 30, 12:09 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > > Ok, I went through the email component code and removed the '@' sign
> > > > > from the mail function to show error messages, and so now it gives
> > > > > this error:
>
> > > > > Warning (2): mail() [function.mail]: SMTP server response: 550 5.1.0
> > > > > <=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected after '=?UTF-8?
> > > > > B??=' [CORE\cake\libs\controller\components\email.php, line 667]
>
> > > > > And this is what it ran (I put a little echo in it to see what it was
> > > > > putting into the mail() function) to get the error:
> > > > > mail(poppitypopATgmailDOTcom, =?UTF-8?B?
> > > > > V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content stuff here ,
> > > > > From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: =?UTF-8?B??= X-
> > > > > Mailer: CakePHP Email Component Content-Type: text/plain;
> > > > > charset=UTF-8 Content-Transfer-Encoding: 7bit, )'
>
> > > > > So I conclude the problem is the ?UTF-8?B??.  Which is probably
> > > > > something I can not fix myself.  This is a bug.  Could someone make a
> > > > > ticket for this?  hehe, I really have no idea how to use trac,
> > > > > otherwise I would do it myself...
>
> > > > > On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Note the "=?UTF-8?B??=" bits. There seems to be a lot of that going
> > > > > > on. I don't know if anyone's figured out the cause yet but I suggest
> > > > > > you check Trac.
>
> > > > > > On Fri, Jun 27, 2008 at 11:19 PM, Turnquist, Jonah <[EMAIL 
> > > > > > PROTECTED]> wrote:
>
> > > > > > > I am having a problem with the email component.  I am trying to 
> > > > > > > get it
> > > > > > > to send a simple text email.  I have set up the layouts and
> > > > > > > templates.  But for some reason it will not send.  nor will it 
> > > > > > > throw
> > > > > > > an error.  I am using WAMP, and set up the php.ini to send email
> > > > > > > correctly as far as I can tell.  The funny thing is that the php
> > > > > > > mail() function DOES work, just not the email component.
> > > > > > > Here is the code in the 
> > > > > > > controller:http://bin.cakephp.org/view/2104639841
> > > > > > > could somone glance at it?
>
> > > > > > > Thanks,
> > > > > > > Jonah
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Email component won't send

2008-06-30 Thread Turnquist, Jonah

I can use mail() with localhost.  I set up the php.ini to do it and it
works fine.  I also got it to work with the email component, but only
if I don't contain < or > characters, that is my problem.

On Jun 30, 2:55 pm, r0mk1n <[EMAIL PROTECTED]> wrote:
> this string "$this->smtpOptions . " must be:
> $this->Email->smtpOptions = array(  'port'=> 25, 'host' =>
> 'yourSMTPServer', 'username'=>'yourUserName',
> 'password'=>'yourSMTPPassword', 'timeout' => 30 );
>
> Sorry :(
>
> On Jul 1, 12:53 am, r0mk1n <[EMAIL PROTECTED]> wrote:
>
> > you are trying to send via PHPs mail function ( default method in
> > Email component ), but you can`t do it from localhost ;)
> > better way - send via SMTP
>
> > 1. you need to setup smtp delivery:
>
> > $this->Email->delivery = 'smtp';
>
> > 2. setup SMTP params:
>
> > $this->smtpOptions = array(  'port'=> 25, 'host' => 'yourSMTPServer',
> > 'username'=>'yourUserName', 'password'=>'yourSMTPPassword', 'timeout'
> > => 30 );
>
> > 3. Sending  ;)
>
> > To get SMTP settings you need to get email relay information from your
> > hosting support (server, username and password)
>
> > P.S. with standart component you can`t send your emails via relay
> > servers that using TLS or SSL connections ( like gmail.com ), to do
> > this you need using some like ShiftMailer
>
> > On Jun 30, 11:14 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > Update:  I figured out I can get it to work if I remove all < and >
>
> > > $this->Email->from = 'No Reply ';
> > > $this->Email->replyTo = No Reply '';
> > > $this->Email->return = No Reply '';
>
> > > changed to this:
>
> > > $this->Email->from = 'noreply@'.env('HTTP_HOST');
> > > $this->Email->replyTo = 'noreply@'.env('HTTP_HOST');
> > > $this->Email->return = 'noreply@'.env('HTTP_HOST');
>
> > > Now it works, but of course now I can't supply a name.  Is there a
> > > better solution?
>
> > > On Jun 30, 12:09 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > > Ok, I went through the email component code and removed the '@' sign
> > > > from the mail function to show error messages, and so now it gives
> > > > this error:
>
> > > > Warning (2): mail() [function.mail]: SMTP server response: 550 5.1.0
> > > > <=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected after '=?UTF-8?
> > > > B??=' [CORE\cake\libs\controller\components\email.php, line 667]
>
> > > > And this is what it ran (I put a little echo in it to see what it was
> > > > putting into the mail() function) to get the error:
> > > > mail(poppitypopATgmailDOTcom, =?UTF-8?B?
> > > > V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content stuff here ,
> > > > From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: =?UTF-8?B??= X-
> > > > Mailer: CakePHP Email Component Content-Type: text/plain;
> > > > charset=UTF-8 Content-Transfer-Encoding: 7bit, )'
>
> > > > So I conclude the problem is the ?UTF-8?B??.  Which is probably
> > > > something I can not fix myself.  This is a bug.  Could someone make a
> > > > ticket for this?  hehe, I really have no idea how to use trac,
> > > > otherwise I would do it myself...
>
> > > > On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > > > Note the "=?UTF-8?B??=" bits. There seems to be a lot of that going
> > > > > on. I don't know if anyone's figured out the cause yet but I suggest
> > > > > you check Trac.
>
> > > > > On Fri, Jun 27, 2008 at 11:19 PM, Turnquist, Jonah <[EMAIL 
> > > > > PROTECTED]> wrote:
>
> > > > > > I am having a problem with the email component.  I am trying to get 
> > > > > > it
> > > > > > to send a simple text email.  I have set up the layouts and
> > > > > > templates.  But for some reason it will not send.  nor will it throw
> > > > > > an error.  I am using WAMP, and set up the php.ini to send email
> > > > > > correctly as far as I can tell.  The funny thing is that the php
> > > > > > mail() function DOES work, just not the email component.
> > > > > > Here is the code in the 
> > > > > > controller:http://bin.cakephp.org/view/2104639841
> > > > > > could somone glance at it?
>
> > > > > > Thanks,
> > > > > > Jonah
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Email component won't send

2008-06-30 Thread r0mk1n

this string "$this->smtpOptions . " must be:
$this->Email->smtpOptions = array(  'port'=> 25, 'host' =>
'yourSMTPServer', 'username'=>'yourUserName',
'password'=>'yourSMTPPassword', 'timeout' => 30 );

Sorry :(

On Jul 1, 12:53 am, r0mk1n <[EMAIL PROTECTED]> wrote:
> you are trying to send via PHPs mail function ( default method in
> Email component ), but you can`t do it from localhost ;)
> better way - send via SMTP
>
> 1. you need to setup smtp delivery:
>
> $this->Email->delivery = 'smtp';
>
> 2. setup SMTP params:
>
> $this->smtpOptions = array(  'port'=> 25, 'host' => 'yourSMTPServer',
> 'username'=>'yourUserName', 'password'=>'yourSMTPPassword', 'timeout'
> => 30 );
>
> 3. Sending  ;)
>
> To get SMTP settings you need to get email relay information from your
> hosting support (server, username and password)
>
> P.S. with standart component you can`t send your emails via relay
> servers that using TLS or SSL connections ( like gmail.com ), to do
> this you need using some like ShiftMailer
>
> On Jun 30, 11:14 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > Update:  I figured out I can get it to work if I remove all < and >
>
> > $this->Email->from = 'No Reply ';
> > $this->Email->replyTo = No Reply '';
> > $this->Email->return = No Reply '';
>
> > changed to this:
>
> > $this->Email->from = 'noreply@'.env('HTTP_HOST');
> > $this->Email->replyTo = 'noreply@'.env('HTTP_HOST');
> > $this->Email->return = 'noreply@'.env('HTTP_HOST');
>
> > Now it works, but of course now I can't supply a name.  Is there a
> > better solution?
>
> > On Jun 30, 12:09 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > > Ok, I went through the email component code and removed the '@' sign
> > > from the mail function to show error messages, and so now it gives
> > > this error:
>
> > > Warning (2): mail() [function.mail]: SMTP server response: 550 5.1.0
> > > <=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected after '=?UTF-8?
> > > B??=' [CORE\cake\libs\controller\components\email.php, line 667]
>
> > > And this is what it ran (I put a little echo in it to see what it was
> > > putting into the mail() function) to get the error:
> > > mail(poppitypopATgmailDOTcom, =?UTF-8?B?
> > > V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content stuff here ,
> > > From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: =?UTF-8?B??= X-
> > > Mailer: CakePHP Email Component Content-Type: text/plain;
> > > charset=UTF-8 Content-Transfer-Encoding: 7bit, )'
>
> > > So I conclude the problem is the ?UTF-8?B??.  Which is probably
> > > something I can not fix myself.  This is a bug.  Could someone make a
> > > ticket for this?  hehe, I really have no idea how to use trac,
> > > otherwise I would do it myself...
>
> > > On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > > Note the "=?UTF-8?B??=" bits. There seems to be a lot of that going
> > > > on. I don't know if anyone's figured out the cause yet but I suggest
> > > > you check Trac.
>
> > > > On Fri, Jun 27, 2008 at 11:19 PM, Turnquist, Jonah <[EMAIL PROTECTED]> 
> > > > wrote:
>
> > > > > I am having a problem with the email component.  I am trying to get it
> > > > > to send a simple text email.  I have set up the layouts and
> > > > > templates.  But for some reason it will not send.  nor will it throw
> > > > > an error.  I am using WAMP, and set up the php.ini to send email
> > > > > correctly as far as I can tell.  The funny thing is that the php
> > > > > mail() function DOES work, just not the email component.
> > > > > Here is the code in the 
> > > > > controller:http://bin.cakephp.org/view/2104639841
> > > > > could somone glance at it?
>
> > > > > Thanks,
> > > > > Jonah
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Email component won't send

2008-06-30 Thread r0mk1n

you are trying to send via PHPs mail function ( default method in
Email component ), but you can`t do it from localhost ;)
better way - send via SMTP

1. you need to setup smtp delivery:

$this->Email->delivery = 'smtp';

2. setup SMTP params:

$this->smtpOptions = array(  'port'=> 25, 'host' => 'yourSMTPServer',
'username'=>'yourUserName', 'password'=>'yourSMTPPassword', 'timeout'
=> 30 );

3. Sending  ;)

To get SMTP settings you need to get email relay information from your
hosting support (server, username and password)

P.S. with standart component you can`t send your emails via relay
servers that using TLS or SSL connections ( like gmail.com ), to do
this you need using some like ShiftMailer


On Jun 30, 11:14 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
> Update:  I figured out I can get it to work if I remove all < and >
>
> $this->Email->from = 'No Reply ';
> $this->Email->replyTo = No Reply '';
> $this->Email->return = No Reply '';
>
> changed to this:
>
> $this->Email->from = 'noreply@'.env('HTTP_HOST');
> $this->Email->replyTo = 'noreply@'.env('HTTP_HOST');
> $this->Email->return = 'noreply@'.env('HTTP_HOST');
>
> Now it works, but of course now I can't supply a name.  Is there a
> better solution?
>
> On Jun 30, 12:09 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
>
> > Ok, I went through the email component code and removed the '@' sign
> > from the mail function to show error messages, and so now it gives
> > this error:
>
> > Warning (2): mail() [function.mail]: SMTP server response: 550 5.1.0
> > <=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected after '=?UTF-8?
> > B??=' [CORE\cake\libs\controller\components\email.php, line 667]
>
> > And this is what it ran (I put a little echo in it to see what it was
> > putting into the mail() function) to get the error:
> > mail(poppitypopATgmailDOTcom, =?UTF-8?B?
> > V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content stuff here ,
> > From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: =?UTF-8?B??= X-
> > Mailer: CakePHP Email Component Content-Type: text/plain;
> > charset=UTF-8 Content-Transfer-Encoding: 7bit, )'
>
> > So I conclude the problem is the ?UTF-8?B??.  Which is probably
> > something I can not fix myself.  This is a bug.  Could someone make a
> > ticket for this?  hehe, I really have no idea how to use trac,
> > otherwise I would do it myself...
>
> > On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > Note the "=?UTF-8?B??=" bits. There seems to be a lot of that going
> > > on. I don't know if anyone's figured out the cause yet but I suggest
> > > you check Trac.
>
> > > On Fri, Jun 27, 2008 at 11:19 PM, Turnquist, Jonah <[EMAIL PROTECTED]> 
> > > wrote:
>
> > > > I am having a problem with the email component.  I am trying to get it
> > > > to send a simple text email.  I have set up the layouts and
> > > > templates.  But for some reason it will not send.  nor will it throw
> > > > an error.  I am using WAMP, and set up the php.ini to send email
> > > > correctly as far as I can tell.  The funny thing is that the php
> > > > mail() function DOES work, just not the email component.
> > > > Here is the code in the 
> > > > controller:http://bin.cakephp.org/view/2104639841
> > > > could somone glance at it?
>
> > > > Thanks,
> > > > Jonah
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: Database save status issue

2008-06-30 Thread Christian Winther
save should return array in 1.2  - are you on 1.1?

 

From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Nirav 
Mehta
Sent: 30. juni 2008 22:38
To: cake-php@googlegroups.com
Subject: Database save status issue

 

Hi,

I seem to have a problem with handling errors on saving to the database. I am 
using PostGre. 

When I try to save some data that is incorrect, the Model->save method returns 
true, indicating that the method was successful, but PHP exists with errors 
from the database pg_query() method. So is CakePHP not reflecting the status of 
the query execution correctly, or am I doing something wrong?

-- Nirav


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



Re: Use model inside helper

2008-06-30 Thread Mike

I've got a quick question about this -

Let's say I have a Model for User, which has a firstname and
lastname.  Let's say that I want a method that will take data for an
instance of hte model, and produce a full name (i.e., return
$data['User']['firstname'] .' '. $data['User']['lastname'];, more-or-
less).

It seems like it makes sense to put the FullName method on the Model
(i.e., in the User class), even if I want to make use of it in an
AppHelper (or some other view).   I don't want to query/modify/delete
anything in the DB, I just want to get access to this helper method.

Is this 'MVC kosher'? Is there a better way to do this?

Thanks!
--Mike

On May 13, 1:23 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> If Iuse& ClassRegistry::getInstance(); in thehelperthemodelis
> present.
> If Iuse$Model=& ClassRegistry::getObject('ModelName'); I get that
> $Model=null
>
> On 13 Mag, 10:17, grigri <[EMAIL PROTECTED]> wrote:
>
>
>
> > > Only it works for somemodeland for other it doesn't work.
> > > Why?
>
> > It will only work for models that are already loaded and registered.
> > If you need amodelthat hasn't been loaded, you'll have touse
> > App::import() to load it first.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Database save status issue

2008-06-30 Thread Nirav Mehta
Hi,

I seem to have a problem with handling errors on saving to the database. I
am using PostGre.

When I try to save some data that is incorrect, the Model->save method
returns *true*, indicating that the method was successful, but PHP exists
with errors from the database pg_query() method. So is CakePHP not
reflecting the status of the query execution correctly, or am I doing
something wrong?

-- Nirav

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



Re: Session problem with phpcaptcha component in Cake 1.1

2008-06-30 Thread skoggins

I figured it out.  I needed to exclude 'users/captcha' from my
__validateLoginStatus method, that's all.

On Jun 26, 11:23 am, skoggins <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I am trying to use the phpcaptcha component with Cake 1.1. and I find
> that it works fine when a user is logged in but the image does not
> appear when no one is logged into the site.  THis makes me think it is
> an issue with phpcaptcha needing a Session to be started before it can
> appear but I have tried starting and stopping Sessions to no avail.
>
> Anyone have any ideas?  Here is are my default option in php-
> captcha.inc.php"
>
>   / Default Options **/
>
>// start a PHP session - this class uses sessions to store the
> generated
>// code. Comment out if you are calling already from your
> application
>
> //session_start();
>
>// class defaults - change to effect globally
>
>define('CAPTCHA_SESSION_ID', 'php_captcha');
>define('CAPTCHA_WIDTH', 200); // max 500
>define('CAPTCHA_HEIGHT', 50); // max 200
>define('CAPTCHA_NUM_CHARS', 5);
>define('CAPTCHA_NUM_LINES', 70);
>define('CAPTCHA_CHAR_SHADOW', false);
>define('CAPTCHA_OWNER_TEXT', '');
>define('CAPTCHA_CHAR_SET', ''); // defaults to A-Z
>define('CAPTCHA_CASE_INSENSITIVE', true);
>define('CAPTCHA_BACKGROUND_IMAGES', '');
>define('CAPTCHA_MIN_FONT_SIZE', 16);
>define('CAPTCHA_MAX_FONT_SIZE', 25);
>define('CAPTCHA_USE_COLOUR', true);
>define('CAPTCHA_FILE_TYPE', 'jpeg');
>define('CAPTCHA_FLITE_PATH', '/usr/bin/flite');
>define('CAPTCHA_AUDIO_PATH', '/tmp/'); // must be writeable by PHP
> process
>
> and here is my image fcn from captcha.php:
>
> function image(){
> //$imagesPath = realpath(VENDORS . 'phpcaptcha').'/fonts/';
> $imagesPath = APP . 'vendors' . DS . 'phpcaptcha'.'/fonts/';
> $aFonts = array(
> $imagesPath.'VeraBd.ttf',
> $imagesPath.'VeraIt.ttf',
> $imagesPath.'Vera.ttf'
> );
>
> $oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60);
> $oVisualCaptcha->UseColour(false);
> //$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL);
> $oVisualCaptcha->SetNumChars(6);
> $oVisualCaptcha->Create();
> }
>
> Other than that I haven't changed anything from the code provided in
> the bakery.
>
> Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Email component won't send

2008-06-30 Thread Turnquist, Jonah

Update:  I figured out I can get it to work if I remove all < and >

$this->Email->from = 'No Reply ';
$this->Email->replyTo = No Reply '';
$this->Email->return = No Reply '';

changed to this:

$this->Email->from = 'noreply@'.env('HTTP_HOST');
$this->Email->replyTo = 'noreply@'.env('HTTP_HOST');
$this->Email->return = 'noreply@'.env('HTTP_HOST');

Now it works, but of course now I can't supply a name.  Is there a
better solution?

On Jun 30, 12:09 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote:
> Ok, I went through the email component code and removed the '@' sign
> from the mail function to show error messages, and so now it gives
> this error:
>
> Warning (2): mail() [function.mail]: SMTP server response: 550 5.1.0
> <=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected after '=?UTF-8?
> B??=' [CORE\cake\libs\controller\components\email.php, line 667]
>
> And this is what it ran (I put a little echo in it to see what it was
> putting into the mail() function) to get the error:
> mail(poppitypopATgmailDOTcom, =?UTF-8?B?
> V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content stuff here ,
> From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: =?UTF-8?B??= X-
> Mailer: CakePHP Email Component Content-Type: text/plain;
> charset=UTF-8 Content-Transfer-Encoding: 7bit, )'
>
> So I conclude the problem is the ?UTF-8?B??.  Which is probably
> something I can not fix myself.  This is a bug.  Could someone make a
> ticket for this?  hehe, I really have no idea how to use trac,
> otherwise I would do it myself...
>
> On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > Note the "=?UTF-8?B??=" bits. There seems to be a lot of that going
> > on. I don't know if anyone's figured out the cause yet but I suggest
> > you check Trac.
>
> > On Fri, Jun 27, 2008 at 11:19 PM, Turnquist, Jonah <[EMAIL PROTECTED]> 
> > wrote:
>
> > > I am having a problem with the email component.  I am trying to get it
> > > to send a simple text email.  I have set up the layouts and
> > > templates.  But for some reason it will not send.  nor will it throw
> > > an error.  I am using WAMP, and set up the php.ini to send email
> > > correctly as far as I can tell.  The funny thing is that the php
> > > mail() function DOES work, just not the email component.
> > > Here is the code in the controller:http://bin.cakephp.org/view/2104639841
> > > could somone glance at it?
>
> > > Thanks,
> > > Jonah
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Firefox 3 Cookies & Auth

2008-06-30 Thread Tony Thomas

I spent a long time on this so I thought I'd share it with the
community. I was wracking my brain trying to get Auth to work properly
on a site I'm testing locally in Firefox 3. No matter what I did, the
application locked me out with a message stating "You are not
authorized...". I read several blog posts about Auth and the entry in
the manual over and over.

Then on a whim I tested the same site in Safari and got totally
different results. Today I looked at my Firefox cookies and noticed
that there were two CakePHP cookies. One current (presumably from just
having logged in) and one expired. I deleted the expired cookie and
the application worked.

Here are the specifics:

Cake 1.2.0.7125 RC1
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9) Gecko/
2008061004 Firefox/3.0

I'm not sure if this is a fluke, a Firefox bug or a CakePHP bug. I
just thought I'd share what I found in case anyone else is
troubleshooting Auth and is having trouble.

The upside to this story is that I learned an awful lot about CakePHP
Auth in the process.

Here a list of articles I found helpful:

http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/
http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/
http://bakery.cakephp.org/articles/view/simple-form-authentication-in-1-2-x-x
http://lemoncake.wordpress.com/2007/07/19/using-authcomponent-and-acl-in-cakephp-12/
http://realm3.com/articles/setting_up_users_groups_withacl_and_auth_in_cake_1.2.php

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



how to use sql sum, avg, count function in Model Class Reference?

2008-06-30 Thread kknd

how to use sql sum, avg, count function in Model Class Reference?

$this->Payment->findAll("","SUM(payment) as payment")

not working, y?

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



Re: Testing for empty field only

2008-06-30 Thread marikka

Thanks! That's the first thing that occured to me, but I was wondering
if there was a better way.
Finally I ended up writing a validator function in AppModel

function notEmpty($data)
{
return (current($data) != '');
}


On 30 kesä, 14:24, grigri <[EMAIL PROTECTED]> wrote:
> Just add a dummy rule; if the 'allowEmpty' fails then the rule won't
> be checked anyway:
>
> array(
>   'empty' => array('allowEmpty' => false, 'rule' => '/.*/', ...),
>   'format' => ...
> ),
>
> On Jun 30, 10:27 am, marikka <[EMAIL PROTECTED]> wrote:
>
> > Hi!
>
> > I want to be able to validate my model so that first I get an error if
> > a field is empty, and only then, if the field is invalid in another
> > way.
>
> > For example,this doesn't work, because my 'rule' for 'empty' is not
> > set.
>
> > var $validate = array(
> >                 'myField' => array(
> >                         'empty' => array('allowEmpty' => false, 'message' 
> > => 'field_empty',
> > 'last' => true),
> >                         'format' => array('rule' => VALID_FORMAT, 'message' 
> > =>
> > 'invalid_format')
> >                 )
> > );
>
> > I could use the allowEmpty property with the latter format rule, but
> > then I would only get one error message. The validator has the rule
> > 'blank', but I really want the inverse: notBlank. Should I write my
> > own validator function for something this trivial or is there a better
> > way?
>
> > Thanks in advance!
>
> > -M

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



Re: Question about findAll and limits

2008-06-30 Thread Jonathan Snook

When using two numbers, the first number defines the OFFSET, the
second number is the LIMIT.

In a findAll query, look to the PAGE parameter:

findAll(string $conditions, array $fields, string $order, int $limit,
int $page, int $recursive);

The page will automatically set the offset to $page * $limit. In other
words, if you have a limit of 10 items per page, and you're on page 3,
then the offset would be 30. That'd be the same as "LIMIT 30, 10"
using your syntax.


On Mon, Jun 30, 2008 at 2:56 PM, Margarittka <[EMAIL PROTECTED]> wrote:
>
> Hello!
>
> Does anybody know, how can i realize mysql-request like "SELECT * FROM
> products WHERE Product.active = 1 LIMITS  30, 5; " ? i want to know
> how to do such request with two limits using  function findAll.
> Please, help me if you know how to do it!! Thank for any help

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



Newbie Question: conditions on a find('all') for hasMany?

2008-06-30 Thread Mike

Hello!

I'm really sorry to post this, but I've looked around, and haven't
been able to figure out how to do a find on a Model (named 'Term"),
using conditions that restrict the results based on fields in another
model (named "Course") that belongsTo the first model .  Term hasMany
Course.

In the manual (http://book.cakephp.org/view/66/models#retrieving-your-
data-73), at the end of 3.7.4.2 ("Complex Find Conditions"), is says
"These conditions are also infinitely nest-able. Let's say you had a
hasMany/belongsTo relationship between Posts and Authors, which would
result in a LEFT JOIN. Let's say you wanted to find all the posts that
contained a certain keyword (“magic”) or were created in the past two
weeks, but you want to restrict your search to posts written by Bob",
and has the example code of:
"Author.name" => "Bob"



So in my app, I want to have Terms (school terms - in the US,
semesters, or maybe quarters, depending on the college), and Courses.
I'd like to be able to ask for a list of all Terms, such that there's
at least one course in that term.  I'd also like to figure out how to
generally be able to filter my finds based on critieria :).  So to
start, I figured that I'd just ask for all terms that have course #1
in them (which should just be one term), in order to figure out how to
use the find('all') conditions.

(I've got all the code up at http://bin.cakephp.org/saved/34262, if
it's more readable there)

The problem is that if I try to do:

$terms = $this->Term->find('all', array(
  'conditions' => array('Course.id' => '1'),
  'order' => 'year DESC',
  'recursive' => 2,
  )) ;

The resulting SQL query looks like:

SELECT `Term`.`id`, `Term`.`year`, `Term`.`quartername` FROM `terms`
AS `Term` WHERE `Course`.`id` = 1 ORDER BY `year` DESC

Which causes problems b/c it's only using the Term table, but my
condition uses the Course field.  As far as I can tell, CakePHP will
first query the terms table, then will separately query the Courses
table, but it doesn't seem to be putting the 'Course.id' criteria on
the right query.  Based on what I read in the manual, I would expect
this to work, but it isn't.

What's odd is that if I query the COURSE instead, like so:

$terms = $this->Course->find('all', array(
'conditions' => array('Term.id' => 1, 'Course.id' => 1),
'order' => 'Term.year DESC',
'recursive' => 0,
)) ;
$terms = Set::extract($terms, "{n}.Term"); // RC2: -> classicExtract

Cake generates SQL kinda like:
SELECT `Course`.`id`, `Course`.`term_id`, /*SNIP*/ `Term`.`id`,
`Term`.`year`, `Term`.`quartername` FROM `courses` AS `Course` LEFT
JOIN `terms` AS `Term` ON (`Course`.`term_id` = `Term`.`id`) WHERE
`Term`.`id` = 1 AND `Course`.`id` = 1 ORDER BY `Term`.`year` DESC

Since this query includes both tables, the condition works.  Using the
Set::extract, I can then get back to my list of terms (which should
work just fine, if my recursive level is high enough :) ).


My first question: If Term hasMany Course, and I want a list of Terms
(filtered, in part, based on Courses), shouldn't I be doing a find on
Term (i.e., the first query)?

Second question: If I wanted to get a list of Terms that have a non-
empty sublist of Courses, can I do that by querying the Term?  The
second query (i.e., the one on Course) does this for my by default),
but it seems a tad bit odd.


I'm trying to use the Cake 1.2.0.6311 (beta) distribution on XAMP, and
I've tried it using both FireFox 3 and IE 7.0.5730.13, not that the
client should matter.


Quick Aside: I've looked at using the new ContainableBehavior, but
as I understand it, I should be able to filter using the Find method.
I _think_ that Containable will try to (un)bind models to restrict the
query - I"m not sure if it'll actually put the conditions onto the
query, or if it'll pull all the data back, then apply conditions in-
memory.
There's a note at the very end of the manual entry that says
"Additional filtering can be performed by supplying the standard Model-
>find() options" (http://book.cakephp.org/view/474/containable).  That
said, if I'm wrong in my understanding of this, and Containable should
be used here, please let me know!

If anyone could help (or even just offer suggestions/hints), that
would be great!
Thanks!
--Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Question about findAll and limits

2008-06-30 Thread Margarittka

Hello!

Does anybody know, how can i realize mysql-request like "SELECT * FROM
products WHERE Product.active = 1 LIMITS  30, 5; " ? i want to know
how to do such request with two limits using  function findAll.
Please, help me if you know how to do it!! Thank for any help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



phpThumb Component causing weird redirects

2008-06-30 Thread Kyle Decot

I am using the phpThumb Component on my photos controller. whenever I
navigate to a page that has a route applied to it, for example
localhost/admin/delete-photo.php, i get redirected to localhost/admin/
photos/delete. The weird thing is that the photos controller delete()
doesn't even do anything with phpThumb. The only function I have that
does anything with it is my upload function. I know that it is the
phpThumb component because if I remove it, then everything begins to
work fine again. Does anyone know what could be the cause of this? I
am completely baffled by this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: vendor vs app:import call the constructor...

2008-06-30 Thread Alessio

someone was able to use example of fpdf in cakebaker.
but using php5 and rc2...
I don't know why in the helper cakephp pass an array to the class of
Fpdf...
In 1.1 it look likes regular...

On 30 Giu, 17:54, Alessio <[EMAIL PROTECTED]> wrote:
> I notice that using app::import in the helper file or in the
> controller, it will call the constructor of the class...
> So all the old code doesnt work...
> FOr example the fpdf example...doesn't work..
> It call two time the constructor, and the var $orientation becomes an
> array...
> I want call the constructor in the setup of helper ...
> But it triggers 2 times...
> How can I say to app::import that I don't want to call the
> constructor?...
>
>     App::import("Vendor", "FPDF", array( "file" =>
> "fpdf/fpdf.php" ) );
>
> USing RC2 of cakephp
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Flux RSS

2008-06-30 Thread leo

I think you might need an atom feed for Google.

$rss->addNs("atom", "http://www.w3.org/2005/Atom";);
echo 'http://yourFeedUrl/index.rss"; rel="self"
type="application/rss+xml" />';


Validate the feed at http://validator.w3.org/feed/

Nayosis ha escrit:
> Hi,
>
> I have a problem with my RSS.
> That's my code :
>
> // View
> http://purl.org/dc/elements/1.1/";>
> 
>   site.com : news
>   http://www.site.com/
>   All my news !
>   fr
>pubDate>
>   CakePHP
>   [EMAIL PROTECTED]
>   
>   
>?> title>
>utf8_encode(strip_tags(html_entity_decode($article['Article']
> ['chapeau']))); ?>
>   http://www.site.com/articles/view/ ['id']; ?>/
>   http://www.site.com/articles/view/ ['id']; ?>/
>   nice($time->gmt($article['Article']
> ['datePublication'])) . ' GMT'; ?>
>   
>   
> 
> 
>
>
> // Controller
> function rss($articles){
>   $this->layout = 'xml';
>
>   $conditions['and'] = array(
>   'Article.datePublication ' => '<= CURRENT_DATE',
>   'Article.article_id' => '>= 0'
>   );
>   $fields = array('Article.id','Article.title', 'Article.slug',
> 'Article.datePublication', 'Article.chapeau', 'Sphere.title',
> 'Sphere.id', 'Sphere.slug');
>   $this->set('articles', $this->Article->findAll($conditions, 
> $fields,
> 'Article.datePublication DESC', 10));
> }
>
> This work on the firefox rss page. But doesn't work on google reader
> or an other.
> If I'm not explicit. Tell me.
>
> Thanks for all.
> Nayo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Slow page loads, max execution time out

2008-06-30 Thread amfriedman


James K - I did research Containable behavior and have replaced
'restrict' with
'contain'.  The model errors are gone now.  Thanks for that one.

** However, the performance problem continues. **

I was also thinking about app_controller.  I let my laziness get the
best of me and loaded it up with 12 helpers, which are used by
different controllers around the site.  I also have 5 components
initialized in app_controller.  Perhaps I'm getting the performance
hit here.  What do folks think?

On Jun 26, 11:48 am, amfriedman <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I'm developing a social networking app.  Performance-wise, the app is
> working decently well on the live server, but as I've coded and coded
> over the past few months, it has become increasingly slow on my local
> development PC.  I'm running WAMP on Windows Vista.
>
> My only hunch right now is that there are too many DB queries.  But to
> bring the app to its knees?  It still doesn't seem like enough to me.
>
> I've disabled CSS, I've disabled JS, still no change in performance.
> It has to be server-side, since I'm getting "maxexecution" timeouts
> regularly now -- even with debug set to 0.
>
> My coding practices:
>
> - I have tried to meticulously follow Cake's coding conventions.
> - I've read through GoogleGroups on slow load and, yes, made sure my /
> tmp/ folder has the necessary sub-folders intact.
> -  I almost always use 'restrict' in my find() calls to severely limit
> the number of tables a query will need, especially when I'm recursing
> to 3 levels.
>
> Here's the specs:
>
> 10 controllers
> 25 models
> 40 view files (incl elements)
> 10 custom helpers
> 12 custom components
> 2 vendors, of 2K LOC
> 5 includes, in /files/ in webroot, of 5K LOC
> Avg. total image data on each page: 170K size
> Avg number of models in $uses array in each controller: 6.
>
> One odd thing I noticed was that, once I upgraded to Cake v1.2.0.7125
> (RC1), in debug mode, my pages are now littered with 20-30 of these,
> echoing out from god-knows-where in the core:
>
> Query: __resetAssociations
>
> And, always, several of these as well:
>
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near '__resetAssociations' at line 1 [C:\Users
> \Staples2\Documents\Tensegrity\cake_core\cake\libs\model\datasources
> \dbo_source.php, line 501]
>
> So this __resetAssociations is a bad query being sent to the database.
>
> In debug mode of 2 on a user profile page, I run 116 queries that
> total 634ms.  The biggest hits on the MySQL side come from the
> DESCRIBE queries on my tables, each of which take between 17 and
> 47ms.  All of my actual SELECT queries only take between 1 and 3ms on
> average.  Then those __resetAssociations queries which eat up 1 to 9ms
> each.
>
> I planted timestamps around my own files and the core files to find
> bottlenecks, and here's what I found out:
>
> In cake/core/bootstrap.php it takes 8-10 seconds to complete this
> line: App::import('Dispatcher') .
>
> There is also a 15-20 second period in running time between the
> inclusion of the app_controller.php class file and the actualexecutionof the 
> beforeFilter() method for my first page render in
> app_controller.
>
> I know these initial benchmarks are probably pretty superficial.  I
> just don't know enough about the core to try to guess where I should
> be looking for bottlenecks.
>
> Anything I'm missing??

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



Flux RSS

2008-06-30 Thread Nayosis

Hi,

I have a problem with my RSS.
That's my code :

// View
http://purl.org/dc/elements/1.1/";>

site.com : news
http://www.site.com/
All my news !
fr

CakePHP
[EMAIL PROTECTED]




http://www.site.com/articles/view//
http://www.site.com/articles/view//
nice($time->gmt($article['Article']
['datePublication'])) . ' GMT'; ?>






// Controller
function rss($articles){
$this->layout = 'xml';

$conditions['and'] = array(
'Article.datePublication ' => '<= CURRENT_DATE',
'Article.article_id' => '>= 0'
);
$fields = array('Article.id','Article.title', 'Article.slug',
'Article.datePublication', 'Article.chapeau', 'Sphere.title',
'Sphere.id', 'Sphere.slug');
$this->set('articles', $this->Article->findAll($conditions, 
$fields,
'Article.datePublication DESC', 10));
}

This work on the firefox rss page. But doesn't work on google reader
or an other.
If I'm not explicit. Tell me.

Thanks for all.
Nayo

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



vendor vs app:import call the constructor...

2008-06-30 Thread Alessio

I notice that using app::import in the helper file or in the
controller, it will call the constructor of the class...
So all the old code doesnt work...
FOr example the fpdf example...doesn't work..
It call two time the constructor, and the var $orientation becomes an
array...
I want call the constructor in the setup of helper ...
But it triggers 2 times...
How can I say to app::import that I don't want to call the
constructor?...

App::import("Vendor", "FPDF", array( "file" =>
"fpdf/fpdf.php" ) );

USing RC2 of cakephp

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



Re: Question about locales and their correct way of using

2008-06-30 Thread Joel Perras

How is this different from what the CakePHP book ( http://tinyurl.com/67za2h
) describes?  You can set whatever you want for a msgid.

-Joel.

On Jun 28, 4:03 pm, "Mark (germany)" <[EMAIL PROTECTED]>
wrote:
> I started to translate some of the
> "hello, nice to have you back" oder "This is the Page about Mosquitos"
> into GERMAN, etc.
>
> now..
> first of all, some of the translations can get pretty long - and have
> to be in the source code
> wouldn't it be more logic, to set short names like MESSAGE_HELLO etc
> (like its done with constants in some cms oder oscommerce etc) and
> referring to the .po file - where the complete message is?
>
> __(Configure::load() - %s.php not found)
> and
> msgid "Configure::load() - %s.php not found"
>
> would be
> __(CONFIG_NOTFOUND)
> and
> msgid "Configure::load() - %s.php not found"
>
> this way the content of the transcription can slidly change in the
> original language (eng), without having to adapt it to the other
> languages
> the pages and templates should become smaller - and the .po file stays
> the same.
>
> so if you change
> __(Configure::load() - %s.php not found) to __(Configure::load() -
> %s.php cannot be found)
> you usually have to change ALL other language files
>
> with my idea you probably stick to this one change in one language
>
> what i want to say is that it might be useful to stick to short and
> clear placeholder, so to speak.
> what do you say about that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp for Commercial application development

2008-06-30 Thread Jaime

> We are planning to build a new eCommerce application in cakephp...

There is an interesting e-Commerce project driven by CakePHP in which
I have participated: Bakesale (http://bakesalehq.com). They are
planning to release version 1.2 these days. I love it and it's very
well designed. Maybe you can both start there and also contribute some
of your code to this interesting project...

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



Re: find() puts dynamic "fields" in strange places.

2008-06-30 Thread grigri

Easiest way by far is to extend the datasource.

Here's the code you need:

http://i-love-cake.pastebin.com/f78d0639a

(you only need the 1st function - the `fields` is for something else,
but is handy too)

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



Re: Model: only validate field 'A' if field 'B' was filled in

2008-06-30 Thread DaveMahon

You'll probably want to just go ahead and unset those fields - not
just because that will eliminate validation, but also because it will
prevent your app from overwriting people's passwords.

On Jun 29, 10:37 am, Colmar <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm trying to accomplish a user profile page where the user has the
> possibility to edit his / her details:
> - nick name
> - e-mail address
> - newsletter
>
> - old password
> - new password
> - new password 2x
>
> It works awesome however I don't want the Model to validate the three
> latter fields when the 'new password' field is empty. How do I tell
> the Model to do this? I have 3 rules for these each fields (there is a
> plus validation for 'old password' to check whether it matches with
> the one in the database and also there is a validation for the two new
> password fields to check whether they match or not).
>
> I was thinking of the beforeValidate() function but don't have a clue
> what to declare there.
>
> Thank you for your help in advance.
>
> Regards,
>
> Colmar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp for Commercial application development

2008-06-30 Thread James K

CakePHP is only a framework. It offers a structure, a set of
conventions and some helpful shortcuts out of the box, but beyond that
you're going to have to build the rest yourself. There are an endless
number of ways you could implement a dynamic module system, for
instance. There's nothing out of the box that will make you an admin
panel and give you the ability to turn things on and off.

On Jun 30, 9:18 am, Binu <[EMAIL PROTECTED]> wrote:
> Thanks for the replies. Still some doubts..
> Q:2.
> I will try to make this more clear. Since, it is a product, we have
> different
> modules (can be tell as functionality) and are depends upon the
> client.
> Some clients may want some modules and others may not. The superadmin
> (not site admin)
> should be able to install the modules as per clients requirement. I
> know the basic
> functionality of elements. But that is suitable here. The superadmin
> should able to
> add / remove this modules from the super admin section. How can I
> implement this ?
> Q:3.
> Ya, this can be done with layouts. I asked how can I implement this
> easily. Suppose
> if the user wants to create a new template, he has to create the files
> in separate
> directories. Hope this can be done with by changing the path
> constants.
>
> Q:4. First part I understood. I did not get a solution for my second
> question in that ->
> Which will be good to track the user sessions (files or database) ?
>
> On Jun 30, 5:33 pm, James K <[EMAIL PROTECTED]> wrote:
>
> > > 1. Hope cakephp is suitable for building this kind of application ?
> > > Here we are going to use the latest version of cakephp (RC2). We will
> > > migrate to the stable version once it is released.How difficult it
> > > will be ?
>
> > I would consider this largely a non-issue. The cakephp team is
> > generally very good about not breaking code compatibility from the
> > previous version. Especially considering that you will be using a
> > release candidate version, the risk of anything major changing is very
> > small.
>
> > > 2.In our product, there will be different modules and we want to
> > > customize the modules as much as possible. For example, like in
> > > oscommerce the admin should be able to add and remove the modules (ex:
> > > paypal module from payment section, fedex module from shipping section
> > > etc). And these modules should be independent (but these can use some
> > > common code).  How can be implemented this feature ?
>
> > If I were doing something like this, I'd likely code these modules as
> > elements (app/views/elements). These are self-contained blocks of code
> > that accept parameters from a view. It's easy to pre-render them, or
> > pop them right into a layout.
>
> > > 3.How can I switch to different template layouts (as like in joomla) ?
> > > In cake, we are placing the image files, css etc in separate folders,
> > > so how can I create a template layout easily without placing the files
> > > in separate folders ?
>
> > In your app/views/layouts directory, you can build as many templates
> > as you'd like. To call a specific layout, in your controller, you'd
> > just set $this->layout to the name of the layout file. You can
> > reference different image and css files in the layouts.
>
> > > 4.There will be different user groups and users will be in multiple
> > > groups. And the admin should be do assign some permissions to those
> > > groups.(For example like in Joomla the articles can be assigned to
> > > some user groups with add / edit / publish etc permissions). Is there
> > > a similar functionality in cake ? And which will be good to track the
> > > user sessions (files or database) ?
>
> > CakePHP offers a fully generic ACL implementation, or several built-in
> > ACL structures. These only provide the ability to check for CRUD
> > (create, read, update, delete) on a request object - it's up to you to
> > write code to send and respond to the checks.
>
> > > 5. Hope cake 1.2 supports internationalization by default. How can I
> > > implement this to different modules and templates ? For example if the
> > > admin change the language, the whole site should be changed to that
> > > language.
>
> > Cake is fully internationalized out of the box.
>
> > > 6. Where can I write common code ? For example, two controllers are
> > > using the same code for saving the records into the database (here all
> > > fields are same only table name is different). Can I use requestAction
> > > for this by writing the code in one controller and calling it from
> > > another controller ? Or should I use components for this ?
>
> > It depends on the nature of the code. Common code for views would
> > exist as a Helper, common code for controllers would exist as a
> > Component. Also Cake is fully object-oriented so if you wanted to
> > extend a base class, you could do that too.
>
> > As for code samples and examples, the Bakery (http://
> > bakery.cakephp.org) is your best bet. Tons of helpful tutorials and
>

Re: Is there a CakePHP API/Manual mirror?

2008-06-30 Thread leo

I, too, occasionally experience 'down' or 'v. slow' problems.

My solution was to copy the book-in-a-page 
http://book.cakephp.org/complete/3/the-manual
to your local machine (and refresh it regularly to catch updates).

There is a nice API here which you can download :
http://www.tig12.net/pages/if/cake/apidocs/cake_apidocs/index.html but
I don't know how current it is kept. The author seems to have his
fingers in several pieshe makes some quite nice telescopes. I
don't use this API much as the real one has to be more definitive.

Leo

On 30 Juny, 15:10, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Jun 30, 2008 at 4:02 AM, marikka <[EMAIL PROTECTED]> wrote:
>
> > Hi!
>
> > Does a mirror of the API and the Manual exist? I need to work on my
> > Cake app, but the whole cakephp.org seems to be down.. pings fine, but
> > doesn't answer to http, not the first time either.
>
> Works fine for me, maybe it's just a local issue for you.
>
> --
> 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 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: AuthComponent sessions not working in firefox or ie7

2008-06-30 Thread leo

Or alternatively, I found that Chris's method was sometimes unreliable
for me - this is a very configuration dependent component - so I RE-
declare the auth component:

class UsersController extends AppController
{
var $components = array('Auth','Cookie');

...

}

The addition of 'Cookie' is because something changed between beta &
RC1and it's needed if you use cookies to remember a user.

Leo


On 30 Juny, 15:09, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Sun, Jun 29, 2008 at 5:36 PM, peele <[EMAIL PROTECTED]> wrote:
>
> > I've searching this group and other resources for a day and half,
> > tried multiple combinations of things, looked for whitespace. I'm
> > familiar with php but new to cake. Thank you for your help.
>
> You are missing a beforeFilter() method in your user controller:
>
> beforeFilter() {
>      parent::beforeFilter();
>
> }
>
> Without that, the user controller does not know that you are trying to
> use Auth.  At least, that has been my experience.
>
> --
> 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 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp for Commercial application development

2008-06-30 Thread Binu

Thanks for the replies. Still some doubts..
Q:2.
I will try to make this more clear. Since, it is a product, we have
different
modules (can be tell as functionality) and are depends upon the
client.
Some clients may want some modules and others may not. The superadmin
(not site admin)
should be able to install the modules as per clients requirement. I
know the basic
functionality of elements. But that is suitable here. The superadmin
should able to
add / remove this modules from the super admin section. How can I
implement this ?
Q:3.
Ya, this can be done with layouts. I asked how can I implement this
easily. Suppose
if the user wants to create a new template, he has to create the files
in separate
directories. Hope this can be done with by changing the path
constants.

Q:4. First part I understood. I did not get a solution for my second
question in that ->
Which will be good to track the user sessions (files or database) ?


On Jun 30, 5:33 pm, James K <[EMAIL PROTECTED]> wrote:
> > 1. Hope cakephp is suitable for building this kind of application ?
> > Here we are going to use the latest version of cakephp (RC2). We will
> > migrate to the stable version once it is released.How difficult it
> > will be ?
>
> I would consider this largely a non-issue. The cakephp team is
> generally very good about not breaking code compatibility from the
> previous version. Especially considering that you will be using a
> release candidate version, the risk of anything major changing is very
> small.
>
> > 2.In our product, there will be different modules and we want to
> > customize the modules as much as possible. For example, like in
> > oscommerce the admin should be able to add and remove the modules (ex:
> > paypal module from payment section, fedex module from shipping section
> > etc). And these modules should be independent (but these can use some
> > common code).  How can be implemented this feature ?
>
> If I were doing something like this, I'd likely code these modules as
> elements (app/views/elements). These are self-contained blocks of code
> that accept parameters from a view. It's easy to pre-render them, or
> pop them right into a layout.
>
> > 3.How can I switch to different template layouts (as like in joomla) ?
> > In cake, we are placing the image files, css etc in separate folders,
> > so how can I create a template layout easily without placing the files
> > in separate folders ?
>
> In your app/views/layouts directory, you can build as many templates
> as you'd like. To call a specific layout, in your controller, you'd
> just set $this->layout to the name of the layout file. You can
> reference different image and css files in the layouts.
>
> > 4.There will be different user groups and users will be in multiple
> > groups. And the admin should be do assign some permissions to those
> > groups.(For example like in Joomla the articles can be assigned to
> > some user groups with add / edit / publish etc permissions). Is there
> > a similar functionality in cake ? And which will be good to track the
> > user sessions (files or database) ?
>
> CakePHP offers a fully generic ACL implementation, or several built-in
> ACL structures. These only provide the ability to check for CRUD
> (create, read, update, delete) on a request object - it's up to you to
> write code to send and respond to the checks.
>
> > 5. Hope cake 1.2 supports internationalization by default. How can I
> > implement this to different modules and templates ? For example if the
> > admin change the language, the whole site should be changed to that
> > language.
>
> Cake is fully internationalized out of the box.
>
> > 6. Where can I write common code ? For example, two controllers are
> > using the same code for saving the records into the database (here all
> > fields are same only table name is different). Can I use requestAction
> > for this by writing the code in one controller and calling it from
> > another controller ? Or should I use components for this ?
>
> It depends on the nature of the code. Common code for views would
> exist as a Helper, common code for controllers would exist as a
> Component. Also Cake is fully object-oriented so if you wanted to
> extend a base class, you could do that too.
>
> As for code samples and examples, the Bakery (http://
> bakery.cakephp.org) is your best bet. Tons of helpful tutorials and
> information there.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is there a CakePHP API/Manual mirror?

2008-06-30 Thread Chris Hartjes

On Mon, Jun 30, 2008 at 4:02 AM, marikka <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> Does a mirror of the API and the Manual exist? I need to work on my
> Cake app, but the whole cakephp.org seems to be down.. pings fine, but
> doesn't answer to http, not the first time either.

Works fine for me, maybe it's just a local issue for you.

-- 
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 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: AuthComponent sessions not working in firefox or ie7

2008-06-30 Thread Chris Hartjes

On Sun, Jun 29, 2008 at 5:36 PM, peele <[EMAIL PROTECTED]> wrote:
>
> I've searching this group and other resources for a day and half,
> tried multiple combinations of things, looked for whitespace. I'm
> familiar with php but new to cake. Thank you for your help.
>

You are missing a beforeFilter() method in your user controller:

beforeFilter() {
 parent::beforeFilter();
}

Without that, the user controller does not know that you are trying to
use Auth.  At least, that has been my experience.

-- 
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 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp for Commercial application development

2008-06-30 Thread Dr. Tarique Sani
On Mon, Jun 30, 2008 at 1:40 PM, Binu <[EMAIL PROTECTED]> wrote:

>
> Hi All,
>
> We are planning to build a new eCommerce application in cakephp from
> scratch. I know that, it will take time to build a fully customizable
> and functioning product.



DIE MAGENTO DIE!!

- best of luck :)

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 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp for Commercial application development

2008-06-30 Thread James K


> 1. Hope cakephp is suitable for building this kind of application ?
> Here we are going to use the latest version of cakephp (RC2). We will
> migrate to the stable version once it is released.How difficult it
> will be ?

I would consider this largely a non-issue. The cakephp team is
generally very good about not breaking code compatibility from the
previous version. Especially considering that you will be using a
release candidate version, the risk of anything major changing is very
small.


> 2.In our product, there will be different modules and we want to
> customize the modules as much as possible. For example, like in
> oscommerce the admin should be able to add and remove the modules (ex:
> paypal module from payment section, fedex module from shipping section
> etc). And these modules should be independent (but these can use some
> common code).  How can be implemented this feature ?

If I were doing something like this, I'd likely code these modules as
elements (app/views/elements). These are self-contained blocks of code
that accept parameters from a view. It's easy to pre-render them, or
pop them right into a layout.

> 3.How can I switch to different template layouts (as like in joomla) ?
> In cake, we are placing the image files, css etc in separate folders,
> so how can I create a template layout easily without placing the files
> in separate folders ?

In your app/views/layouts directory, you can build as many templates
as you'd like. To call a specific layout, in your controller, you'd
just set $this->layout to the name of the layout file. You can
reference different image and css files in the layouts.

> 4.There will be different user groups and users will be in multiple
> groups. And the admin should be do assign some permissions to those
> groups.(For example like in Joomla the articles can be assigned to
> some user groups with add / edit / publish etc permissions). Is there
> a similar functionality in cake ? And which will be good to track the
> user sessions (files or database) ?

CakePHP offers a fully generic ACL implementation, or several built-in
ACL structures. These only provide the ability to check for CRUD
(create, read, update, delete) on a request object - it's up to you to
write code to send and respond to the checks.

> 5. Hope cake 1.2 supports internationalization by default. How can I
> implement this to different modules and templates ? For example if the
> admin change the language, the whole site should be changed to that
> language.

Cake is fully internationalized out of the box.

> 6. Where can I write common code ? For example, two controllers are
> using the same code for saving the records into the database (here all
> fields are same only table name is different). Can I use requestAction
> for this by writing the code in one controller and calling it from
> another controller ? Or should I use components for this ?

It depends on the nature of the code. Common code for views would
exist as a Helper, common code for controllers would exist as a
Component. Also Cake is fully object-oriented so if you wanted to
extend a base class, you could do that too.

As for code samples and examples, the Bakery (http://
bakery.cakephp.org) is your best bet. Tons of helpful tutorials and
information there.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Download location

2008-06-30 Thread grigri

> Tried /app/webroot/files/download/file.zip but it doesnt work.

Erm... yes it does, I use it all the time.

Put the file in /app/webroot/files/something.zip

Set a link to /files/something.zip (or type in the address bar)

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



Re: find() puts dynamic "fields" in strange places.

2008-06-30 Thread [EMAIL PROTECTED]


Thanks grigri. That explains it.
Then I will either live with them belonging to table 0 or try to do
things another way.

/Maritn


On Jun 30, 1:15 pm, grigri <[EMAIL PROTECTED]> wrote:
> As-is, this is not supported in CakePHP. Well, not for MySQL.
>
> Divvying up the resultset into chunks (as you would expect [and works
> fine] for joins) is not as easy as it sounds, and depends greatly on
> the underlying database. MySQL supports the concept of the
> "originating table" for each returned field, so it's easy. Except when
> it's a dynamic field; which does not have an originating table, so it
> goes into spot '0' (see the `resultSet` function in cake/libs/model/
> datasources/dbo/dbo_mysql.php).
>
> For databases* which do not support the "originating table", cake
> simulates it by pre-pending the required table name to each field,
> plus a double-underscore (see the resultSet function in
> dbo_postgres.php). So for postgres, you can do:
>
> 'fields' => 'SOMETHING(a.gfdg+b.sdfdf) AS Bacon__Eggs'
>
> and this will be parsed into the Bacon model. But not for MySQL.
>
> There are quite a few model behaviors around to manage this. I wrote a
> proof-of-concept one a while ago; there is a better one somewhere
> around.
>
> (searching for links...)
>
> My code :http://openpaste.org/en/3929/
> Discussion:http://groups.google.com/group/cake-php/browse_thread/thread/eb0422c6...
> Autofield/Truefield 
> :http://cakeexplorer.wordpress.com/2007/09/10/autofield-behavior-or-ho...
>
> It might also be possible to override/extend the datasource. I
> generally do this anyway, for various reasons (syntax-hilighting SQL
> logs, mainly) - it might not be too hard to provide a custom
> implementation of resultSet().
>
> hth
> grigri
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate problems RC1

2008-06-30 Thread leo

Well, trying to get my head round nested AND & OR queries when they
are specified as arrays is just too much for the goat cheese inside my
cranium.

There are so many instances like this where documentation is poor and
the universal answer is: "Well, read the API" or as Mario said at the
beginning of this thread, "Please read the release notes". I would if
they existed. Nobody has succeeded in pointing to them yet. Changelogs
and API's, yes but Release Notes, no.

This said, your explanation is very clear and helpful, but I stand by
my intuitivity-failure statement ;)

On 30 Juny, 13:07, NOSLOW <[EMAIL PROTECTED]> wrote:
> leo, I hear what you're saying but I disagree in this case. The array-
> based syntax for creating complex where conditions is the bomb! Sure,
> the "LIKE" clause is a little unique, but once you learn it, it's no
> big deal. I particularly like that you can avoid writing "IN" clauses
> by doing this:
>
> $array_of_user_ids = array(1,3,5,7,8,9,10);
> $conditions = array('User.id' => $array_of_user_ids);
>
> Of course if you prefer, Cake allows you to just write your conditions
> as string fragments:
>
> $conditions = 'User.id IN(1,3,5,7,8,9,10);
>
> But if your list of Id's is already in an array, you have to do this:
>
> $conditions = 'User.id IN(' . implode(',',$array_of_user_ids) . ')';
>
> The fact that you can mix and match formats is awesome, too:
>
> $conditions[] = array('User.id' => $array_of_user_ids);
> $conditions[] = 'User.email LIKE [EMAIL PROTECTED]';
>
> By default, the conditions will be "AND'ed" together. If you prefer to
> be more explicit about that for readability, do it like this:
>
> $conditions = array('AND'=>$conditions);
>
> Or you could "OR" them together in the same fashion.
>
> How can you complain about all this goodness?
>
> On Jun 30, 4:36 am, leo <[EMAIL PROTECTED]> wrote:
>
> > Seems to me that there are times when frameworks just make things more
> > complicated and open to error. If a core developer can get it wrong,
> > what chance do mere mortals stand? The whole array/SQL segment is not
> > what I would describe as intuitive.
>
> > On 29 Juny, 18:44, NOSLOW <[EMAIL PROTECTED]> wrote:
>
> > > Just for the record (and to possibly save others from grief if they're
> > > trying to do a LIKE in 1.2 RCx based on this example), it should be:
>
> > > $conditions = array("or"=>(array(
> > >         'edifici LIKE ?' => "%$searchText%",
> > >         'adreca LIKE ?' => "%$searchText%"
> > > )));
>
> > > I'm sure Mariano just typed this off the cuff, as he's a core
> > > developer and really knows his stuff ;)
>
> > > The other way yields a SQL statement with single quotes around the
> > > search term insided the percent signs (e.g. " LIKE %'my search
> > > phrase'% "), which generates a SQL error.
>
> > > BTW, checking the test cases in the core is very helpful in finding
> > > examples to go by.
>
> > > On Jun 16, 11:19 am, Mariano Iglesias <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Please read the release notes regardingLIKEand other SQL operators.
> > > > That should be:
>
> > > > $conditions= array("or"=>(array(
> > > >         'edificiLIKE%?%' => $searchText,
> > > >         'adrecaLIKE%?%' => $searchText
> > > > )));
>
> > > > On Mon, 2008-06-16 at 03:07 -0700, leo wrote:
> > > > > Call me a misery, but I seem to be having more problems with RC1 than
> > > > > I had with Beta.
>
> > > > > The following works as expected in Beta but invariably returns an
> > > > > empty set in RC1:
>
> > > > > $conditions= array("or"=>(array('edifici' => 'LIKE%'.
> > > > > $searchText.'%', 'adreca' => 'LIKE%'.$searchText.'%')));
> > > > > $this->set('immobles', $this->paginate('Immoble',$conditions));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Corporate Identity Colorpalette

2008-06-30 Thread Nate

We have a palette that's available with most of those colors, which
you can find in cake.generic.css, which ships with the framework.
That's about it though.

On Jun 30, 7:48 am, powtac <[EMAIL PROTECTED]> wrote:
> Is there a CakePHP (PS) colorpalette to use for cake applications? To
> get this "green" look and feel?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CakePHP Corporate Identity Colorpalette

2008-06-30 Thread powtac

Is there a CakePHP (PS) colorpalette to use for cake applications? To
get this "green" look and feel?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Editing model's primary key in forms

2008-06-30 Thread Jonathan Snook

On Sun, Jun 29, 2008 at 6:19 AM, Mr. Matt <[EMAIL PROTECTED]> wrote:
>
> I believe this should work:
>
> input('Player/id', array('type' => 'text')); ?>

Just to clarify, it's Player.id (notice the . instead of the /)

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



Re: CSS and images disappear when accessing actions

2008-06-30 Thread Jonathan Snook

In your layout (which is global and applies to all pages), make sure
the path is absolute (ie: starts with a /).



Dardo mentioned using the HtmlHelper because it'll automatically link
up CSS files to the right path (important if you're working of a local
server where the web folder may not be web root.

css('mycssfile'); ?>

On Sat, Jun 28, 2008 at 3:35 PM, dlite922 <[EMAIL PROTECTED]> wrote:
>
> why do I have to link the CSS for all actions other than index?
>
> I'm using a layout and a global CSS for the entire site. This CSS is
> included in the global.
>
> Do I have to include CSS in every action?
>
> That doesn't seem right.
>
> What about images? Those have nothing to do with CSS?

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



Re: Testing for empty field only

2008-06-30 Thread grigri

Just add a dummy rule; if the 'allowEmpty' fails then the rule won't
be checked anyway:

array(
  'empty' => array('allowEmpty' => false, 'rule' => '/.*/', ...),
  'format' => ...
),

On Jun 30, 10:27 am, marikka <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I want to be able to validate my model so that first I get an error if
> a field is empty, and only then, if the field is invalid in another
> way.
>
> For example,this doesn't work, because my 'rule' for 'empty' is not
> set.
>
> var $validate = array(
>                 'myField' => array(
>                         'empty' => array('allowEmpty' => false, 'message' => 
> 'field_empty',
> 'last' => true),
>                         'format' => array('rule' => VALID_FORMAT, 'message' =>
> 'invalid_format')
>                 )
> );
>
> I could use the allowEmpty property with the latter format rule, but
> then I would only get one error message. The validator has the rule
> 'blank', but I really want the inverse: notBlank. Should I write my
> own validator function for something this trivial or is there a better
> way?
>
> Thanks in advance!
>
> -M
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Testing for empty field only

2008-06-30 Thread marikka

Hi!

I want to be able to validate my model so that first I get an error if
a field is empty, and only then, if the field is invalid in another
way.

For example,this doesn't work, because my 'rule' for 'empty' is not
set.

var $validate = array(
'myField' => array(
'empty' => array('allowEmpty' => false, 'message' => 
'field_empty',
'last' => true),
'format' => array('rule' => VALID_FORMAT, 'message' =>
'invalid_format')
)
);

I could use the allowEmpty property with the latter format rule, but
then I would only get one error message. The validator has the rule
'blank', but I really want the inverse: notBlank. Should I write my
own validator function for something this trivial or is there a better
way?

Thanks in advance!

-M



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



Re: find() puts dynamic "fields" in strange places.

2008-06-30 Thread grigri

As-is, this is not supported in CakePHP. Well, not for MySQL.

Divvying up the resultset into chunks (as you would expect [and works
fine] for joins) is not as easy as it sounds, and depends greatly on
the underlying database. MySQL supports the concept of the
"originating table" for each returned field, so it's easy. Except when
it's a dynamic field; which does not have an originating table, so it
goes into spot '0' (see the `resultSet` function in cake/libs/model/
datasources/dbo/dbo_mysql.php).

For databases* which do not support the "originating table", cake
simulates it by pre-pending the required table name to each field,
plus a double-underscore (see the resultSet function in
dbo_postgres.php). So for postgres, you can do:

'fields' => 'SOMETHING(a.gfdg+b.sdfdf) AS Bacon__Eggs'

and this will be parsed into the Bacon model. But not for MySQL.

There are quite a few model behaviors around to manage this. I wrote a
proof-of-concept one a while ago; there is a better one somewhere
around.

(searching for links...)

My code : http://openpaste.org/en/3929/
Discussion: 
http://groups.google.com/group/cake-php/browse_thread/thread/eb0422c6f3243f3d
Autofield/Truefield :
http://cakeexplorer.wordpress.com/2007/09/10/autofield-behavior-or-how-to-add-additional-columns-to-your-models/

It might also be possible to override/extend the datasource. I
generally do this anyway, for various reasons (syntax-hilighting SQL
logs, mainly) - it might not be too hard to provide a custom
implementation of resultSet().

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



Re: complex findAll()

2008-06-30 Thread Fahad

it worked!!! :D
thanks a lot!

On Jun 30, 5:00 pm, grigri <[EMAIL PROTECTED]> wrote:
> Solved (for me) by doubling the parentheses:
>
>     $tmp = $this->Cookie->find('all', array(
>       'conditions' => array(),
>       'recursive' => -1,
>       'order' => array('((Cookie.rating<=1)) DESC', 'Cookie.rating
> DESC')
>     ));
>
> Generates SQL:
>
> SELECT [...] FROM `cookies` AS `Cookie` WHERE 1 = 1 ORDER BY
> ((`Cookie`.`rating`<=1)) DESC, `Cookie`.`rating` DESC
>
> (rev. 7145)
>
> hth
> grigri
>
> On Jun 29, 10:49 pm, Fahad <[EMAIL PROTECTED]> wrote:
>
> > its the multiple ordering of a single field. this is what cake1.2
> > lacks i guess.
> > when cake generates the SQL code for getting the model's data, there
> > is an error in the code.
>
> > this is what it generates currently (with an error):
> > .. ORDER BY User`.`id` >= 2 DESC, `User`.`id` ASC
> > note that, there is a ` missing before User (right after ORDER BY)
>
> > it should be like this (correct one):
> > .. ORDER BY `User`.`id` >= 2 DESC, `User`.`id` ASC
>
> > how do i overcome this problem?
>
> > On Jun 30, 3:20 am, Fahad <[EMAIL PROTECTED]> wrote:
>
> > > your SQL idea is absolutely correct grigri. but whenever i apply it on
> > > cakephp1.2RC1, i get SQL errors.
> > > i have tried everything, but still cake will just not allow me to
> > > execute that ordering command.
>
> > > this is the code that i used on phpMyAdmin to get my desired output:
> > > =
> > >  SELECT *
> > > FROM `users`
> > > ORDER BY id >=2 DESC , id ASC
> > > LIMIT 0 , 30
>
> > > works fine on phpMyAdmin
> > > =
>
> > > i have tried it on cake:
> > > ===
> > > $users_list = $this->User->find('all', array('order' =>"(User.id>=2)
> > > DESC, User.id ASC"));
>
> > > and i get this error:
> > > SQL Error: 1064: You have an error in your SQL syntax; check the
> > > manual that corresponds to your MySQL server version for the right
> > > syntax to use near 'User`.`id`>=2)` DESC,  `User`.`id` ASC' at line 1
> > > [CORE\cake\libs\model\datasources\dbo_source.php, line 501]
> > > ===
>
> > > On Jun 20, 9:49 pm, grigri <[EMAIL PROTECTED]> wrote:
>
> > > > > Please don't do that directly. SQL (even in a limited form) sprinkled
> > > > > throughout the app is never good.
>
> > > > > I do think that is a neat solution. However, the right way to 
> > > > > implement
> > > > > it would be to define a custom model method called 'findAllSliced()' 
> > > > > or
> > > > > something similar, so you can change the behavior in the future 
> > > > > without
> > > > > grepping and replacing sprinkles of code all over.
>
> > > > Good point. If this is to be used in a lot of places, then yes, it
> > > > should be generalized (in some way).
>
> > > > If it's only used once, it's not worth it from any point of view.
>
> > > > I always apply the 3rd strike rule to messy hacks / exceptions, and so
> > > > far it's never let me down.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate problems RC1

2008-06-30 Thread NOSLOW

leo, I hear what you're saying but I disagree in this case. The array-
based syntax for creating complex where conditions is the bomb! Sure,
the "LIKE" clause is a little unique, but once you learn it, it's no
big deal. I particularly like that you can avoid writing "IN" clauses
by doing this:

$array_of_user_ids = array(1,3,5,7,8,9,10);
$conditions = array('User.id' => $array_of_user_ids);

Of course if you prefer, Cake allows you to just write your conditions
as string fragments:

$conditions = 'User.id IN(1,3,5,7,8,9,10);

But if your list of Id's is already in an array, you have to do this:

$conditions = 'User.id IN(' . implode(',',$array_of_user_ids) . ')';

The fact that you can mix and match formats is awesome, too:

$conditions[] = array('User.id' => $array_of_user_ids);
$conditions[] = 'User.email LIKE [EMAIL PROTECTED]';

By default, the conditions will be "AND'ed" together. If you prefer to
be more explicit about that for readability, do it like this:

$conditions = array('AND'=>$conditions);

Or you could "OR" them together in the same fashion.

How can you complain about all this goodness?


On Jun 30, 4:36 am, leo <[EMAIL PROTECTED]> wrote:
> Seems to me that there are times when frameworks just make things more
> complicated and open to error. If a core developer can get it wrong,
> what chance do mere mortals stand? The whole array/SQL segment is not
> what I would describe as intuitive.
>
> On 29 Juny, 18:44, NOSLOW <[EMAIL PROTECTED]> wrote:
>
> > Just for the record (and to possibly save others from grief if they're
> > trying to do a LIKE in 1.2 RCx based on this example), it should be:
>
> > $conditions = array("or"=>(array(
> >         'edifici LIKE ?' => "%$searchText%",
> >         'adreca LIKE ?' => "%$searchText%"
> > )));
>
> > I'm sure Mariano just typed this off the cuff, as he's a core
> > developer and really knows his stuff ;)
>
> > The other way yields a SQL statement with single quotes around the
> > search term insided the percent signs (e.g. " LIKE %'my search
> > phrase'% "), which generates a SQL error.
>
> > BTW, checking the test cases in the core is very helpful in finding
> > examples to go by.
>
> > On Jun 16, 11:19 am, Mariano Iglesias <[EMAIL PROTECTED]>
> > wrote:
>
> > > Please read the release notes regardingLIKEand other SQL operators.
> > > That should be:
>
> > > $conditions= array("or"=>(array(
> > >         'edificiLIKE%?%' => $searchText,
> > >         'adrecaLIKE%?%' => $searchText
> > > )));
>
> > > On Mon, 2008-06-16 at 03:07 -0700, leo wrote:
> > > > Call me a misery, but I seem to be having more problems with RC1 than
> > > > I had with Beta.
>
> > > > The following works as expected in Beta but invariably returns an
> > > > empty set in RC1:
>
> > > > $conditions= array("or"=>(array('edifici' => 'LIKE%'.
> > > > $searchText.'%', 'adreca' => 'LIKE%'.$searchText.'%')));
> > > > $this->set('immobles', $this->paginate('Immoble',$conditions));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple ordering of a field in cake1.2

2008-06-30 Thread grigri

Solved (for me) by doubling the parentheses:

$tmp = $this->Cookie->find('all', array(
  'conditions' => array(),
  'recursive' => -1,
  'order' => array('((Cookie.rating<=1)) DESC', 'Cookie.rating
DESC')
));

Generates SQL:

SELECT [...] FROM `cookies` AS `Cookie` WHERE 1 = 1 ORDER BY
((`Cookie`.`rating`<=1)) DESC, `Cookie`.`rating` DESC

(rev. 7145)

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



Re: complex findAll()

2008-06-30 Thread grigri

Solved (for me) by doubling the parentheses:

$tmp = $this->Cookie->find('all', array(
  'conditions' => array(),
  'recursive' => -1,
  'order' => array('((Cookie.rating<=1)) DESC', 'Cookie.rating
DESC')
));

Generates SQL:

SELECT [...] FROM `cookies` AS `Cookie` WHERE 1 = 1 ORDER BY
((`Cookie`.`rating`<=1)) DESC, `Cookie`.`rating` DESC

(rev. 7145)

hth
grigri

On Jun 29, 10:49 pm, Fahad <[EMAIL PROTECTED]> wrote:
> its the multiple ordering of a single field. this is what cake1.2
> lacks i guess.
> when cake generates the SQL code for getting the model's data, there
> is an error in the code.
>
> this is what it generates currently (with an error):
> .. ORDER BY User`.`id` >= 2 DESC, `User`.`id` ASC
> note that, there is a ` missing before User (right after ORDER BY)
>
> it should be like this (correct one):
> .. ORDER BY `User`.`id` >= 2 DESC, `User`.`id` ASC
>
> how do i overcome this problem?
>
> On Jun 30, 3:20 am, Fahad <[EMAIL PROTECTED]> wrote:
>
> > your SQL idea is absolutely correct grigri. but whenever i apply it on
> > cakephp1.2RC1, i get SQL errors.
> > i have tried everything, but still cake will just not allow me to
> > execute that ordering command.
>
> > this is the code that i used on phpMyAdmin to get my desired output:
> > =
> >  SELECT *
> > FROM `users`
> > ORDER BY id >=2 DESC , id ASC
> > LIMIT 0 , 30
>
> > works fine on phpMyAdmin
> > =
>
> > i have tried it on cake:
> > ===
> > $users_list = $this->User->find('all', array('order' =>"(User.id>=2)
> > DESC, User.id ASC"));
>
> > and i get this error:
> > SQL Error: 1064: You have an error in your SQL syntax; check the
> > manual that corresponds to your MySQL server version for the right
> > syntax to use near 'User`.`id`>=2)` DESC,  `User`.`id` ASC' at line 1
> > [CORE\cake\libs\model\datasources\dbo_source.php, line 501]
> > ===
>
> > On Jun 20, 9:49 pm, grigri <[EMAIL PROTECTED]> wrote:
>
> > > > Please don't do that directly. SQL (even in a limited form) sprinkled
> > > > throughout the app is never good.
>
> > > > I do think that is a neat solution. However, the right way to implement
> > > > it would be to define a custom model method called 'findAllSliced()' or
> > > > something similar, so you can change the behavior in the future without
> > > > grepping and replacing sprinkles of code all over.
>
> > > Good point. If this is to be used in a lot of places, then yes, it
> > > should be generalized (in some way).
>
> > > If it's only used once, it's not worth it from any point of view.
>
> > > I always apply the 3rd strike rule to messy hacks / exceptions, and so
> > > far it's never let me down.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



find() puts dynamic "fields" in strange places.

2008-06-30 Thread [EMAIL PROTECTED]


Hi,
I am trying to return calculated data from MySQL in a find. I am not
sure if this kind of thing is supposed to work at all. I may have to
resort to qustom queries.

Here is my little find statement:

$this->Post->find('all', array(
'fields'=>array(
'*',
'DATE(Post.created) AS post_date'
)
));

As you can see this first attempt is to just get the datetime from
created truncated to the date only. My plans are to be able to use
several different functions when the need arises. I am not sure what I
will gain from this but lopping the resulting array in php is usually
pretty slow compared to letting MySQL do some types of calculations.

The results are returned but they end un in their own model called 0.

I have also tried to rename  "AS post_date" to "AS 'Post.post_date' "
but this data still ends up as its own model and the field gets the
full name including Post.

Is this not at all supported by CakePHP or am I just doing something
wrong?

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



Multiple ordering of a field in cake1.2

2008-06-30 Thread Fahad

the main SQL code (from phpMyAdmin - works fine)
SELECT *
FROM `users`
ORDER BY id >=2 DESC , id ASC
LIMIT 0 , 30

cakified (gives an error)
$users_list = $this->User->find('all', array('order' =>"(User.id>=2)
DESC, User.id ASC"));

Error shown:
SQL Error: 1064: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'User`.`id`>=2)` DESC,  `User`.`id` ASC' at line 1
[CORE\cake\libs\model\datasources\dbo_source.php, line 501]

as far as it seems to me, the problem is in the SQL code generated by
cake.
this is what it generates currently (with an error):
.. ORDER BY User`.`id` >= 2 DESC, `User`.`id` ASC
note that, there is a ` missing before User (right after ORDER BY)

it should be like this (correct one):
.. ORDER BY `User`.`id` >= 2 DESC, `User`.`id` ASC

now how do i get it done in cake? :S

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



Re: dompdf in CakePHP

2008-06-30 Thread Marcin Domanski

Hey,
you are aware that the dompdf standalone script has a security vulnerability  ?

apart from that - maybe try tcpdf ? it works for me without problems
greets,

On Mon, Jun 30, 2008 at 12:02 PM, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I was the author of that blog article. Thanks for reading :-)
>
> I've been meaning to get back and update it as I eventually ran into
> some problems with it later in the project (works fine on Windows,
> fails on Linux - didn't have enough time to work out why).
>
> In the end. I installed the stand alone dompdf script in the web root
> and then pass the URL of the page to render to the dompdf script.
>
> On Jun 29, 9:22 am, roby <[EMAIL PROTECTED]> wrote:
>> Hi, everyone. I've a question about dompdf. Maybe one of you ever have
>> the same problem like me and would like to share the solution.
>>
>> I want to generate a PDF file but unfortunately, it seems didn't work
>> at all in my cake project. I've searched the internet and found this
>> link:http://blog.futurate.com/2008/02/getting-dompdf-working-inside-cakeph...
>> and I still not getting it along.
>>
>> I've extracted the dompdf library to app/vendors and make a function
>> in controller, so it looks like this:
>>
>> function test()
>> {
>> $htm = "";
>> $htm .= "Test";
>> $htm .= "Sample";
>> $htm .= "";
>> $dompdf = new DOMPDF();
>> $dompdf->load_html( $htm );
>> $dompdf->render();
>> $dompdf->stream( "sample.pdf" );
>> print_r( $dompdf );
>> }
>>
>> Anyone can help me? Thanks in advance.
> >
>



-- 
Marcin Domanski
http://kabturek.info

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



Re: dompdf in CakePHP

2008-06-30 Thread RichardAtHome

Hi

I was the author of that blog article. Thanks for reading :-)

I've been meaning to get back and update it as I eventually ran into
some problems with it later in the project (works fine on Windows,
fails on Linux - didn't have enough time to work out why).

In the end. I installed the stand alone dompdf script in the web root
and then pass the URL of the page to render to the dompdf script.

On Jun 29, 9:22 am, roby <[EMAIL PROTECTED]> wrote:
> Hi, everyone. I've a question about dompdf. Maybe one of you ever have
> the same problem like me and would like to share the solution.
>
> I want to generate a PDF file but unfortunately, it seems didn't work
> at all in my cake project. I've searched the internet and found this
> link:http://blog.futurate.com/2008/02/getting-dompdf-working-inside-cakeph...
> and I still not getting it along.
>
> I've extracted the dompdf library to app/vendors and make a function
> in controller, so it looks like this:
>
> function test()
>     {
>         $htm = "";
>         $htm .= "Test";
>         $htm .= "Sample";
>         $htm .= "";
>         $dompdf = new DOMPDF();
>         $dompdf->load_html( $htm );
>         $dompdf->render();
>         $dompdf->stream( "sample.pdf" );
>         print_r( $dompdf );
>     }
>
> Anyone can help me? Thanks in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth sessions not working in firefox or ie7

2008-06-30 Thread dr. Hannibal Lecter

Is Firefox/IE set to accept cookies? And keep them until they expire?

On Jun 29, 10:02 pm, peele <[EMAIL PROTECTED]> wrote:
> I'm using the AuthComponent and experimenting with cake and making a
> simple user system. I thought I had things working but the session
> isn't maintained using firefox or ie7, works with safari (all on
> windows, using wamp).
>
> I've tried using security low, medium and high, php sessions and cake,
> all with the same result. After logging in on firefox or ie7 it
> redirects back to the login page with no flash message, also creates 4
> sessions, 5 if trying to directly access home. Safari logs in,
> redirects appropriately with only creating one session.
>
> app_controller.php
> class AppController extends Controller {
>
>         var $components = array('Auth');
>
>         function beforeFilter() {
>                 $this->Auth->loginAction = array('controller' => 'users',
> 'action' => 'login');
>                 $this->Auth->loginRedirect = array('controller' => 'pages',
> 'action' => 'display', 'home');
>                 $this->Auth->deny('*');
>                 $this->Auth->authorize = array('model' => 'User');
>                 $this->Auth->autoRedirect = true;
>         }
>
> }
>
> ?>
>
> users_controller.php
>  class UsersController extends AppController {
>
>         var $name = 'Users';
>
>         function login() {
>
>         }
>
>         function logout() {
>                 $this->Session->setFlash('Logout');
>                 $this->redirect($this->Auth->logout());
>         }
>
> }
>
> ?>
>
> user.php
>  class User extends AppModel {
>
>         var $name = 'User';
>
>         function isAuthorized($user, $controller, $action) {
>                 return true;
>         }
>
> }
>
> ?>
>
> Sorry for being long winded. Its my first time using cake, I've spent
> the last day and a half searching this group, and other resources.
> Thank you for your help. If anything else would help I'll post it as
> soon as I know whats needed.
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Preparing for the Digg Effect

2008-06-30 Thread Dr. Tarique Sani
On Mon, Jun 30, 2008 at 3:11 PM, RichardAtHome <[EMAIL PROTECTED]>
wrote:

>
> Does anyone have any tips, techniques or experience about best
> practices for managing a potentially large visitor spike without the
> box catching fire?



Cache! cache!! and more cache!!! that is provided you have done everything
else to optimize your app.

The meltdown usually occurs because of the PHP <- > MySQL pipe getting
choked

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 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Preparing for the Digg Effect

2008-06-30 Thread RichardAtHome

Hi everyone.

We are about to start developing a web application (flash/php) that is
quite likely to attract the Digg/Reddit crowd.

The CakePHP side of things is pretty minimal (5-10 static pages, 5-10
dynamic pages, 4 or 5 database tables, basic authentication and
sessions).

Does anyone have any tips, techniques or experience about best
practices for managing a potentially large visitor spike without the
box catching fire?

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



Re: Cakephp for Commercial application development

2008-06-30 Thread Erik Gyepes

It would be also nice if some answers will appear here in this thread  
(at least for other newbies ;-))

On 30.6.2008, at 10:57, dezpo wrote:

>
> I can help you with all of this, you can contact me at
> [EMAIL PROTECTED]
>
> On Jun 30, 9:10 am, Binu <[EMAIL PROTECTED]> wrote:
>> Hi All,
>>
>> We are planning to build a new eCommerce application in cakephp from
>> scratch. I know that, it will take time to build a fully customizable
>> and functioning product. My first aim is to create a strong  
>> foundation
>> for this project. I have did one small project in cakephp (1.1.*). I
>> have not not gone through advanced techniques like plug-ins, ARO,
>> locale etc. I have some general questions. Please guide me.
>>
>> 1. Hope cakephp is suitable for building this kind of application ?
>> Here we are going to use the latest version of cakephp (RC2). We will
>> migrate to the stable version once it is released.How difficult it
>> will be ?
>>
>> 2.In our product, there will be different modules and we want to
>> customize the modules as much as possible. For example, like in
>> oscommerce the admin should be able to add and remove the modules  
>> (ex:
>> paypal module from payment section, fedex module from shipping  
>> section
>> etc). And these modules should be independent (but these can use some
>> common code).  How can be implemented this feature ?
>>
>> 3.How can I switch to different template layouts (as like in  
>> joomla) ?
>> In cake, we are placing the image files, css etc in separate folders,
>> so how can I create a template layout easily without placing the  
>> files
>> in separate folders ?
>>
>> 4.There will be different user groups and users will be in multiple
>> groups. And the admin should be do assign some permissions to those
>> groups.(For example like in Joomla the articles can be assigned to
>> some user groups with add / edit / publish etc permissions). Is there
>> a similar functionality in cake ? And which will be good to track the
>> user sessions (files or database) ?
>>
>> 5. Hope cake 1.2 supports internationalization by default. How can I
>> implement this to different modules and templates ? For example if  
>> the
>> admin change the language, the whole site should be changed to that
>> language.
>>
>> 6. Where can I write common code ? For example, two controllers are
>> using the same code for saving the records into the database (here  
>> all
>> fields are same only table name is different). Can I use  
>> requestAction
>> for this by writing the code in one controller and calling it from
>> another controller ? Or should I use components for this ?
>>
>> Sorry for my bad English. Please guide me with your suggestions/some
>> links/sample code.
>>
>> Thanks in advance.
> >


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



Auth sessions not working in firefox or ie7

2008-06-30 Thread peele

I'm using the AuthComponent and experimenting with cake and making a
simple user system. I thought I had things working but the session
isn't maintained using firefox or ie7, works with safari (all on
windows, using wamp).

I've tried using security low, medium and high, php sessions and cake,
all with the same result. After logging in on firefox or ie7 it
redirects back to the login page with no flash message, also creates 4
sessions, 5 if trying to directly access home. Safari logs in,
redirects appropriately with only creating one session.

app_controller.php
class AppController extends Controller {

var $components = array('Auth');

function beforeFilter() {
$this->Auth->loginAction = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'pages',
'action' => 'display', 'home');
$this->Auth->deny('*');
$this->Auth->authorize = array('model' => 'User');
$this->Auth->autoRedirect = true;
}

}
?>

users_controller.php
Session->setFlash('Logout');
$this->redirect($this->Auth->logout());
}

}
?>

user.php


Sorry for being long winded. Its my first time using cake, I've spent
the last day and a half searching this group, and other resources.
Thank you for your help. If anything else would help I'll post it as
soon as I know whats needed.

Thanks

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



Re: Editing model's primary key in forms

2008-06-30 Thread Mr. Matt

I believe this should work:

input('Player/id', array('type' => 'text')); ?>

On Jun 27, 5:54 pm, Bryan D <[EMAIL PROTECTED]> wrote:
> I would like to allow a model's primary key field (named id) to be
> editable, at least upon creation of a new object. I noticed that using
> syntax like:
>  input('Player/id') ?>
> doesn't work because CakePHP converts it to a hidden field
> automatically.  Is there some way I can override this?
>
> I worked around the problem when creating new objects by using raw
> html.  However, I'm not sure how to access the value of the model
> object's ID field in my edit form.  In fact, how do I access any of
> the object's data?  In most views I use $data['Modelname'] etc., but
> that doesn't work in the add/edit views.
>
> Thanks,
> Bryan

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



Re: $loginRedirect in the Auth component does not work?

2008-06-30 Thread wil

I was having this problem and then set debug = 3 and which seems to
have resolved it.  Maybe a cache issue?


On Jun 24, 4:03 pm, deltawing <[EMAIL PROTECTED]> wrote:
> I tried setting $loginRedirectin theAuthcomponent but it doesn't
> seem to work. No matter what I set the variable to, Cake will always
> redirect to the last page that I was at prior to logging in.
>
> Anyone have any ideas on why?

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



Re: Slow page loads, max execution time out

2008-06-30 Thread amfriedman

UPDATE:

Thanks James K!

I did research Containable behavior and have replaced 'restrict' with
'contain'.  The model errors are gone now.

* However, the performance problem continues. *

I was also thinking about app_controller.  I let my laziness get the
best of me and loaded it up with 12 helpers, which are used by
different controllers around the site.  I also have 5 components
initialized in app_controller.  Perhaps I'm getting the performance
hit here.  What do folks think?


On Jun 26, 11:48 am, amfriedman <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I'm developing a social networking app.  Performance-wise, the app is
> working decently well on the live server, but as I've coded and coded
> over the past few months, it has become increasingly slow on my local
> development PC.  I'm running WAMP on Windows Vista.
>
> My only hunch right now is that there are too many DB queries.  But to
> bring the app to its knees?  It still doesn't seem like enough to me.
>
> I've disabled CSS, I've disabled JS, still no change in performance.
> It has to be server-side, since I'm getting "max execution" timeouts
> regularly now -- even with debug set to 0.
>
> My coding practices:
>
> - I have tried to meticulously follow Cake's coding conventions.
> - I've read through GoogleGroups on slow load and, yes, made sure my /
> tmp/ folder has the necessary sub-folders intact.
> -  I almost always use 'restrict' in my find() calls to severely limit
> the number of tables a query will need, especially when I'm recursing
> to 3 levels.
>
> Here's the specs:
>
> 10 controllers
> 25 models
> 40 view files (incl elements)
> 10 custom helpers
> 12 custom components
> 2 vendors, of 2K LOC
> 5 includes, in /files/ in webroot, of 5K LOC
> Avg. total image data on each page: 170K size
> Avg number of models in $uses array in each controller: 6.
>
> One odd thing I noticed was that, once I upgraded to Cake v1.2.0.7125
> (RC1), in debug mode, my pages are now littered with 20-30 of these,
> echoing out from god-knows-where in the core:
>
> Query: __resetAssociations
>
> And, always, several of these as well:
>
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near '__resetAssociations' at line 1 [C:\Users
> \Staples2\Documents\Tensegrity\cake_core\cake\libs\model\datasources
> \dbo_source.php, line 501]
>
> So this __resetAssociations is a bad query being sent to the database.
>
> In debug mode of 2 on a user profile page, I run 116 queries that
> total 634ms.  The biggest hits on the MySQL side come from the
> DESCRIBE queries on my tables, each of which take between 17 and
> 47ms.  All of my actual SELECT queries only take between 1 and 3ms on
> average.  Then those __resetAssociations queries which eat up 1 to 9ms
> each.
>
> I planted timestamps around my own files and the core files to find
> bottlenecks, and here's what I found out:
>
> In cake/core/bootstrap.php it takes 8-10 seconds to complete this
> line: App::import('Dispatcher') .
>
> There is also a 15-20 second period in running time between the
> inclusion of the app_controller.php class file and the actual
> execution of the beforeFilter() method for my first page render in
> app_controller.
>
> I know these initial benchmarks are probably pretty superficial.  I
> just don't know enough about the core to try to guess where I should
> be looking for bottlenecks.
>
> Anything I'm missing??

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



Is there a CakePHP API/Manual mirror?

2008-06-30 Thread marikka

Hi!

Does a mirror of the API and the Manual exist? I need to work on my
Cake app, but the whole cakephp.org seems to be down.. pings fine, but
doesn't answer to http, not the first time either.

Thanks for RC2!
-M

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



AuthComponent sessions not working in firefox or ie7

2008-06-30 Thread peele

This is my first time using cake and I'm starting out with trying to
make a simple user system (no acl, yet). I'm developing on windows
(wamp, apache 2.2.8, php 5.2.5, mysql 5.0.51a) using firefox, ie7 and
safari on windows, cake_1.2.0.7296-rc2. The install went smoothly and
the homepage said everything was running.

I've tried security on high, medium and low; cake and php sessions,
all with same results:
- firefox and ie7 create 5 sessions when accessing / and 4 when
accessing users/login directly after logging in
- after logging in, redirected back to login
- flash messages only show not authorized message

safari works, creates only one session, redirects properly

app_controller.php
Auth->loginAction = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'pages',
'action' => 'display', 'home');
$this->Auth->deny('*');
$this->Auth->authorize = array('model' => 'User');
$this->Auth->autoRedirect = true;
}

}
?>

users_controller.php
Session->setFlash('Logout');
$this->redirect($this->Auth->logout());
}

}
?>

user.php


I've searching this group and other resources for a day and half,
tried multiple combinations of things, looked for whitespace. I'm
familiar with php but new to cake. Thank you for your help.

Thanks.



p.s. If this ends up getting posted more then one time I'm really
sorry but it doesn't seem to show up, hours later.

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



Model: only validate field 'A' if field 'B' was filled in

2008-06-30 Thread Colmar

Hello everyone,

I'm trying to accomplish a user profile page where the user has the
possibility to edit his / her details:
- nick name
- e-mail address
- newsletter

- old password
- new password
- new password 2x

It works awesome however I don't want the Model to validate the three
latter fields when the 'new password' field is empty. How do I tell
the Model to do this? I have 3 rules for these each fields (there is a
plus validation for 'old password' to check whether it matches with
the one in the database and also there is a validation for the two new
password fields to check whether they match or not).

I was thinking of the beforeValidate() function but don't have a clue
what to declare there.

Thank you for your help in advance.

Regards,

Colmar

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



Multiple findallthreaded queries optimization.

2008-06-30 Thread ACNet

Hi,

I'm posting this message because i'm a beginner with cakephp, i've
succeeded to make something i wanted to do but i'm wondering if
there's a better way because this one take a lottt of time to
achieve.

I'm trying to make a search query on a tree. The search result must
show found items and their children.

At the moment it works like this :


In my model :

function findAllThreaded($root,$conditions = null, $fields = null,
$sort = null,$recursive=null) {
return $this->__doThread(Model::findAll($conditions, $fields,
$sort,null,null,$recursive), $root);}


In my controller :



$resultitem=$this->Item->findAll($conditions);

 foreach($resultitem as $key=>$result){

$resulttree[$key]['children']=$this->Item-
>findAllThreaded($result["Item"]
["id"],"Item.active='1'",null,'parent_id,Item.id ASC');

}


The way it works is simple : for each found result it retrieves the
result and its children.


The big problem is the following : Some children might have already
been retrieved. (if one of the resultitems is the child of another
one) . As i can get a lot of results, it easily becomes a huge cpu
time consumer..

My question is, is there a way to do this on a more optimized way ?


I'vre thought about :
Making a test on the item level (if the item level in the tree is
higher than a previous one i don't try to retrieve the result >of
course..it wasn't successful, because there are many branches in the
tree...so i don't really know if the item is in the same branch)

Retrieving the complete tree, then using the interesting branches of
the tree   < my tree is too big . (something like 10.000 results)

Does anybody got an idea ?

Thanks a lot
(Sorry for my bad english)

Stephane.

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



Redirect according the request source

2008-06-30 Thread depi

Hello,

I have and *Edit link* in 'index' and 'detail' view. I would like to
do a redirect after saving the data from edit form to one of that
views according from where the user access the edit form.
I'm trying it with using $this->referer() and saving it to session,
but it always redirect me to the 'index' view.

Sample code:
function edit($id = null) {
if (!$this->Session->check('redirectTo')) {
$this->Session->write('redirectTo', $this->referer());
}

$this->Theme->id = $id;
if (empty($this->data)) {
$this->data = $this->Theme->read();
}
else {
if ($this->Theme->save($this->data['Theme'])) {

$this->redirect($this->Session->read('redirectTo'));
$this->Session->del('redirectTo');
}
}
}

Probably I'm doing something bad :) Maybe there is be a better
solution, or some bult-in solution in Cake.

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



Re: CSS and images disappear when accessing actions

2008-06-30 Thread dlite922

why do I have to link the CSS for all actions other than index?

I'm using a layout and a global CSS for the entire site. This CSS is
included in the global.

Do I have to include CSS in every action?

That doesn't seem right.

What about images? Those have nothing to do with CSS?



On Jun 28, 8:56 am, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> How are you linking the css? are you using the HtmlHelper?
>
> On Sat, Jun 28, 2008 at 6:13 AM, dlite922 <[EMAIL PROTECTED]> wrote:
>
> > when I access an action (even the index action) the CSS and Images
> > don't display.
>
> > THis is on a WAMP (XP, Apache 2.2, PHP and MySQL 5.5)
>
> > Mod Rewrite is on?
>
> > I'm using virtual host.
>
> > I've explicitly created a directory tag to the problem directory in
> > Apache Vhost.conf and added AllowOverride All to it.
>
> > but still same problem.
>
> > A dir structure is not changed.
>
> > I'm not using models as its all statis by saying $uses = array() at
> > the top.
>
> > The pages display fine, I just can't access any actions. /controller
> > works but /controller/index or /controller/myAction does not display
> > any CSS
>
> > Help!!
>
> > Dan

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



Re: Documentation

2008-06-30 Thread nastya

I can't get through with ACL and i18n... Cookbook is definitely not
clear enough on those subjects. Now i need to creat an admin for
multilingual site with easy add/delete language in admin and I can't
find any explanation of how to do it... Can anybody help me please?
Would you have some examples?

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



Issue getting cake blog tutorial working with easyphp

2008-06-30 Thread Latoune

Hi all,
I cannot make a simple application (posts) working.

I have set up EasyPhp 2.0.0.0 and it works fine.I am able to get
everything working. I created a database postdb and created a table as
specified in the tutorial (see below).

I have now set up CakePHP under a folder www/cake. I have updated the
database.php config file;

class DATABASE_CONFIG
 'mysql',
'connect' => 
'mysql_pconnect',
'host' => 'localhost',
'login' => 'root',
'password' => 'root',
'database' => 'postdb',
'prefix' => '');
}
?>

when I try to see if CakePHP framwork is working I do http://localhost/cake/
and I get a rendered page starting with:

CakePHP Rapid Development
Your database configuration file is present.
Cake is able to connect to the database.
http://manual.cakephp.org/view/326/the-cake-blog-tutorial

... etc.

so it works fine.

I then tried to set up the sample available at:
http://manual.cakephp.org/view/326/the-cake-blog-tutorial

I therefore created 3 files:

one in C:\Program Files\EasyPHP 2.0b1\app\models\post.php :


then in C:\Program Files\EasyPHP 2.0b1\www\cake\app\controllers
\posts_controller.php
set('posts', $this->Post->findAll());
}
}
?>

then in C:\Program Files\EasyPHP 2.0b1\www\cake\app\views\index.thtml
Blog posts


Id
Title
Created


   





link($post['Post']['title'], "/posts/
view/".$post['Post']['id']); ?>







When I go in my web browser and I try to fetch the URL:
http://localhost/cake/posts/index
or http://localhost/cake/posts/
or http://localhost/cake/posts

i always get a 404 Not Found error
Not Found
The requested URL /cake/posts/index was not found on this server.

I have tried to put the framework at the root level too (i.e.
directories \app \cake \vendors \docs) but the result is the same.

Can someone let me knwo what I can do to make this framework work with
an application that I am creating?

thanks

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



Newbie question about multiple databases

2008-06-30 Thread rfflower

I'm a newbie trying to understand CAKE, and so far so good. I've
understood the 'blog' tutorial.
I am trying to make an app where users login and then use the app to
add their data to their own copy of a database. There would be lots of
databases (all same structure) each solely for that user.
I think I see how the useDbConfig bit works, but I'm a bit foggy about
how to go about it and how CAKE would expect the controllers, model,
views to be arranged, for all the different users.
If this isn't too trivial a question, can anyone point me in the right
direction?
Thanks in advance

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



AuthComponent sessions not working in firefox or ie7

2008-06-30 Thread peele

This is my first time using cake and I'm starting out with trying to
make a simple user system (no acl, yet). I'm developing on windows
(wamp, apache 2.2.8, php 5.2.5, mysql 5.0.51a) using firefox, ie7 and
safari on windows, cake_1.2.0.7296-rc2. The install went smoothly and
the homepage said everything was running.

I've tried security on high, medium and low; cake and php sessions,
all with same results:
- firefox and ie7 create 5 sessions when accessing / and 4 when
accessing users/login directly after logging in
- after logging in, redirected back to login
- flash messages only show not authorized message

safari works, creates only one session, redirects properly

app_controller.php
Auth->loginAction = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'pages',
'action' => 'display', 'home');
$this->Auth->deny('*');
$this->Auth->authorize = array('model' => 'User');
$this->Auth->autoRedirect = true;
}

}
?>

users_controller.php
Session->setFlash('Logout');
$this->redirect($this->Auth->logout());
}

}
?>

user.php


I've searching this group and other resources for a day and half,
tried multiple combinations of things, looked for whitespace. I'm
familiar with php but new to cake. Thank you for your help.

Thanks.

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



Re: Cant't change Columns or View

2008-06-30 Thread skyrocket777

I commented the $scaffold line and downloaded the most recent version
of CakePhp and the problem persist. Nothing happends if i removed the
line of code that is supposed to show or removed the columns i want.
In fact i created the MCV interactively. Thanks for your help

On 25 jun, 09:37, Marc MENDEZ <[EMAIL PROTECTED]> wrote:
> Hi,
>
> It remembers me one of my mistake last week. As you created MVC
> interactively, check in the controllers generated if you don't have the
> following line :
>
> var $scaffold;
>
> If yes, comment it and check again
>
> Let me know if it helps you !
>
> skyrocket777 a écrit :
>
> > Hi guys!!! fist of all thanks if you can help me!!! I have just
> > started discovering CakePhp an find it very nice!!! I decided to
> > create the Controllers, Models, then the Views interactively, but now
> > that i have the code done, i have some columns in teh view that i dont
> > want to be shown on the listing, i erased them but nothing happens. I
> > removed the colums from the thml files, but nothing Can u help me?
> > thanks

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



dompdf in CakePHP

2008-06-30 Thread roby

Hi, everyone. I've a question about dompdf. Maybe one of you ever have
the same problem like me and would like to share the solution.

I want to generate a PDF file but unfortunately, it seems didn't work
at all in my cake project. I've searched the internet and found this
link: 
http://blog.futurate.com/2008/02/getting-dompdf-working-inside-cakephp.html
and I still not getting it along.

I've extracted the dompdf library to app/vendors and make a function
in controller, so it looks like this:

function test()
{
$htm = "";
$htm .= "Test";
$htm .= "Sample";
$htm .= "";
$dompdf = new DOMPDF();
$dompdf->load_html( $htm );
$dompdf->render();
$dompdf->stream( "sample.pdf" );
print_r( $dompdf );
}

Anyone can help me? Thanks in advance.

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



Re: Release: Some RC2 Sweetness

2008-06-30 Thread RoVo

Great work!
Kudos to the hole team!
...and many, many thanks...!!!

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



Re: Validation problems

2008-06-30 Thread garry

Anyone have any ideas?

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



Question about locales and their correct way of using

2008-06-30 Thread Mark (germany)

I started to translate some of the
"hello, nice to have you back" oder "This is the Page about Mosquitos"
into GERMAN, etc.

now..
first of all, some of the translations can get pretty long - and have
to be in the source code
wouldn't it be more logic, to set short names like MESSAGE_HELLO etc
(like its done with constants in some cms oder oscommerce etc) and
referring to the .po file - where the complete message is?

__(Configure::load() - %s.php not found)
and
msgid "Configure::load() - %s.php not found"

would be
__(CONFIG_NOTFOUND)
and
msgid "Configure::load() - %s.php not found"


this way the content of the transcription can slidly change in the
original language (eng), without having to adapt it to the other
languages
the pages and templates should become smaller - and the .po file stays
the same.

so if you change
__(Configure::load() - %s.php not found) to __(Configure::load() -
%s.php cannot be found)
you usually have to change ALL other language files

with my idea you probably stick to this one change in one language

what i want to say is that it might be useful to stick to short and
clear placeholder, so to speak.
what do you say about that?

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



Re: Cant't change Columns or View

2008-06-30 Thread skyrocket777

Thanks for reading!!!

I have the most recent version of CakePHP, and in fact i make the MVC
interactively, but if i comment the var $scaffold; then on the index
it shows me "You are seeing this error because the action index is not
defined in controller XController". As you notice i am new on this.
also if i change the columns of the view nothing happens

On 25 jun, 02:37, Marc MENDEZ <[EMAIL PROTECTED]> wrote:
> Hi,
>
> It remembers me one of my mistake last week. As you created MVC
> interactively, check in the controllers generated if you don't have the
> following line :
>
> var $scaffold;
>
> If yes, comment it and check again
>
> Let me know if it helps you !
>
> skyrocket777 a écrit :
>
> > Hi guys!!! fist of all thanks if you can help me!!! I have just
> > started discovering CakePhp an find it very nice!!! I decided to
> > create the Controllers, Models, then the Views interactively, but now
> > that i have the code done, i have some columns in teh view that i dont
> > want to be shown on the listing, i erased them but nothing happens. I
> > removed the colums from the thml files, but nothing Can u help me?
> > thanks

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



Email Problem

2008-06-30 Thread Nam

I am using the CakePHP email component to send activation email, but
it seems like it can be only sent to gmail accounts.

By the way, I am using a private ubuntu server set up by my friend.

Does anyone know about the issue, or have the same problem?

Thank you in advance!

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



Newbie saveField error?

2008-06-30 Thread [EMAIL PROTECTED]

Please excuse this cake newbie here, I know I must have done something
wrong but I simply cannot figure out what I did wrong. I have a model
called Guild that is using Sluggable, Containable and Transaction
Behaviors.
I added a convenience function, called createNewGuild, that is
supposed to create a new guild record and update the guild_id and
guild_rank fields in a character record. The code is listed here:

function createNewGuild($character_id, $guild_name) {
$guild = array('leader_id' => $character_id, 'name' => $guild_name);

// Begin Transaction
$this->begin();

$this->create();
if ($this->save($guild)) {
// Set character's guild_id
$this->Leader->id = $character_id;
if ($this->Leader->saveField('guild_id', $this->id)) {
// Set character's guild_rank to Leader (2)
if ($this->Leader->saveField('guild_rank', '2')) {
// All records have been updated properly.
// Commit this Transaction
$this->commit();
return true;
}
}
}

// To reach this point, something must have gone wrong...
// Rollback Transaction
$this->rollback();
return false;
}

However when I call this function from a controller in debug mode, the
field guild_rank is never updated and I can't see what I have done
wrong. The debug output gives me the following series of sql
statements and as you can see, there isn't any UPDATE statement for
guild_rank :
SET autocommit=0
begin
SELECT `Guild`.`id`, `Guild`.`slug` FROM `guilds` AS `Guild` WHERE
`Guild`.`slug` = 'LIKE test-guild%'
INSERT INTO `guilds` (`leader_id`,`name`,`slug`,`id`) VALUES
('48438309-8914-4238-b830-0071077a7f0f','Test Guild','test-
guild','48689f9c-1664-49e9-82fc-00a2077a7f0f')
SELECT COUNT(*) AS `count` FROM `characters` AS `Leader` WHERE
`Leader`.`id` = '48438309-8914-4238-b830-0071077a7f0f'
UPDATE `characters` SET `guild_id` =
'48689f9c-1664-49e9-82fc-00a2077a7f0f' WHERE `characters`.`id` =
'48438309-8914-4238-b830-0071077a7f0f'
SELECT COUNT(*) AS `count` FROM `characters` AS `Leader` WHERE
`Leader`.`id` = '48438309-8914-4238-b830-0071077a7f0f'
commit
SET autocommit=1

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



Re: Cakephp for Commercial application development

2008-06-30 Thread Marc MENDEZ

Binu a écrit :

I'm a newbee too, but I think I could answer to some of your questions :

> 3.How can I switch to different template layouts (as like in joomla) ?
> In cake, we are placing the image files, css etc in separate folders,
> so how can I create a template layout easily without placing the files
> in separate folders ?
>   
That's not really a problem. If you write your own template (css and 
layouts), there will have to follow common rules.
For instance, you will decide where to store all the images (in the same 
directory )
Of course, if you plan to use any templates, you can't wait for them 
they work at first time !
I found one day a piece of code to change the layout "on the fly". So it 
must not be too hard.
> 4.There will be different user groups and users will be in multiple
> groups. And the admin should be do assign some permissions to those
> groups.(For example like in Joomla the articles can be assigned to
> some user groups with add / edit / publish etc permissions). Is there
> a similar functionality in cake ? And which will be good to track the
> user sessions (files or database) ?
>   
You can use ACL ou Auth component. But, before, you must define what you 
want to do exactly. How the rights will be dispatched between the users 
and the groups ?. Then, you'll be able to compare it with what these 
modules (or others) offer you.

> 5. Hope cake 1.2 supports internationalization by default. How can I
> implement this to different modules and templates ? For example if the
> admin change the language, the whole site should be changed to that
> language.
>   
It depends on how you handle this ! First, the differents translation 
for a sentence are stored in files and Cake choose the right one 
according to the language the user use.
The language is stored in the configuration. Of course, if you store in 
the core.php the language, it will be the same for all the users.
However, if you detect or store a "preferred" language in a profile for 
each user, you can change it by using :

Configure::write('Config.languages', $languages);
Configure::write('Config.language', $language);
Configure::write('Config.langCode', $langCode);

The change is made only in memory, no in the core.php file.
> 6. Where can I write common code ? For example, two controllers are
> using the same code for saving the records into the database (here all
> fields are same only table name is different). Can I use requestAction
> for this by writing the code in one controller and calling it from
> another controller ? Or should I use components for this ?
>   
You say that "all fields are same only table name is different". Maybe, 
but I think that is just "luck". That's two different tables, so two 
models, controllers
I'm not sure it's worth sharing the code for this example, but I may be 
wrong. Anyway, you can still write your own library and shared code as 
you did before with PHP. Then, depending on the purpose of this code, 
you can decide to use it for all the controllers, models or the whole 
application (including a "use/require" statement in app_controller.php, 
app_model.php or bootstrap.php)



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



Re: Cakephp for Commercial application development

2008-06-30 Thread dezpo

I can help you with all of this, you can contact me at
[EMAIL PROTECTED]

On Jun 30, 9:10 am, Binu <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> We are planning to build a new eCommerce application in cakephp from
> scratch. I know that, it will take time to build a fully customizable
> and functioning product. My first aim is to create a strong foundation
> for this project. I have did one small project in cakephp (1.1.*). I
> have not not gone through advanced techniques like plug-ins, ARO,
> locale etc. I have some general questions. Please guide me.
>
> 1. Hope cakephp is suitable for building this kind of application ?
> Here we are going to use the latest version of cakephp (RC2). We will
> migrate to the stable version once it is released.How difficult it
> will be ?
>
> 2.In our product, there will be different modules and we want to
> customize the modules as much as possible. For example, like in
> oscommerce the admin should be able to add and remove the modules (ex:
> paypal module from payment section, fedex module from shipping section
> etc). And these modules should be independent (but these can use some
> common code).  How can be implemented this feature ?
>
> 3.How can I switch to different template layouts (as like in joomla) ?
> In cake, we are placing the image files, css etc in separate folders,
> so how can I create a template layout easily without placing the files
> in separate folders ?
>
> 4.There will be different user groups and users will be in multiple
> groups. And the admin should be do assign some permissions to those
> groups.(For example like in Joomla the articles can be assigned to
> some user groups with add / edit / publish etc permissions). Is there
> a similar functionality in cake ? And which will be good to track the
> user sessions (files or database) ?
>
> 5. Hope cake 1.2 supports internationalization by default. How can I
> implement this to different modules and templates ? For example if the
> admin change the language, the whole site should be changed to that
> language.
>
> 6. Where can I write common code ? For example, two controllers are
> using the same code for saving the records into the database (here all
> fields are same only table name is different). Can I use requestAction
> for this by writing the code in one controller and calling it from
> another controller ? Or should I use components for this ?
>
> Sorry for my bad English. Please guide me with your suggestions/some
> links/sample code.
>
> Thanks in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate problems RC1

2008-06-30 Thread leo

Seems to me that there are times when frameworks just make things more
complicated and open to error. If a core developer can get it wrong,
what chance do mere mortals stand? The whole array/SQL segment is not
what I would describe as intuitive.

On 29 Juny, 18:44, NOSLOW <[EMAIL PROTECTED]> wrote:
> Just for the record (and to possibly save others from grief if they're
> trying to do a LIKE in 1.2 RCx based on this example), it should be:
>
> $conditions = array("or"=>(array(
>         'edifici LIKE ?' => "%$searchText%",
>         'adreca LIKE ?' => "%$searchText%"
> )));
>
> I'm sure Mariano just typed this off the cuff, as he's a core
> developer and really knows his stuff ;)
>
> The other way yields a SQL statement with single quotes around the
> search term insided the percent signs (e.g. " LIKE %'my search
> phrase'% "), which generates a SQL error.
>
> BTW, checking the test cases in the core is very helpful in finding
> examples to go by.
>
> On Jun 16, 11:19 am, Mariano Iglesias <[EMAIL PROTECTED]>
> wrote:
>
> > Please read the release notes regardingLIKEand other SQL operators.
> > That should be:
>
> > $conditions= array("or"=>(array(
> >         'edificiLIKE%?%' => $searchText,
> >         'adrecaLIKE%?%' => $searchText
> > )));
>
> > On Mon, 2008-06-16 at 03:07 -0700, leo wrote:
> > > Call me a misery, but I seem to be having more problems with RC1 than
> > > I had with Beta.
>
> > > The following works as expected in Beta but invariably returns an
> > > empty set in RC1:
>
> > > $conditions= array("or"=>(array('edifici' => 'LIKE%'.
> > > $searchText.'%', 'adreca' => 'LIKE%'.$searchText.'%')));
> > > $this->set('immobles', $this->paginate('Immoble',$conditions));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Download location

2008-06-30 Thread Unite

Hi. Where or how can I make a download location within the cakePHP
structure where users can download a file via http?

Tried /app/webroot/files/download/file.zip but it doesnt work.

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



Cakephp for Commercial application development

2008-06-30 Thread Binu

Hi All,

We are planning to build a new eCommerce application in cakephp from
scratch. I know that, it will take time to build a fully customizable
and functioning product. My first aim is to create a strong foundation
for this project. I have did one small project in cakephp (1.1.*). I
have not not gone through advanced techniques like plug-ins, ARO,
locale etc. I have some general questions. Please guide me.

1. Hope cakephp is suitable for building this kind of application ?
Here we are going to use the latest version of cakephp (RC2). We will
migrate to the stable version once it is released.How difficult it
will be ?

2.In our product, there will be different modules and we want to
customize the modules as much as possible. For example, like in
oscommerce the admin should be able to add and remove the modules (ex:
paypal module from payment section, fedex module from shipping section
etc). And these modules should be independent (but these can use some
common code).  How can be implemented this feature ?

3.How can I switch to different template layouts (as like in joomla) ?
In cake, we are placing the image files, css etc in separate folders,
so how can I create a template layout easily without placing the files
in separate folders ?

4.There will be different user groups and users will be in multiple
groups. And the admin should be do assign some permissions to those
groups.(For example like in Joomla the articles can be assigned to
some user groups with add / edit / publish etc permissions). Is there
a similar functionality in cake ? And which will be good to track the
user sessions (files or database) ?

5. Hope cake 1.2 supports internationalization by default. How can I
implement this to different modules and templates ? For example if the
admin change the language, the whole site should be changed to that
language.

6. Where can I write common code ? For example, two controllers are
using the same code for saving the records into the database (here all
fields are same only table name is different). Can I use requestAction
for this by writing the code in one controller and calling it from
another controller ? Or should I use components for this ?

Sorry for my bad English. Please guide me with your suggestions/some
links/sample code.

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



Re: Email component won't send

2008-06-30 Thread Turnquist, Jonah

Ok, I went through the email component code and removed the '@' sign
from the mail function to show error messages, and so now it gives
this error:

Warning (2): mail() [function.mail]: SMTP server response: 550 5.1.0
<=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected after '=?UTF-8?
B??=' [CORE\cake\libs\controller\components\email.php, line 667]

And this is what it ran (I put a little echo in it to see what it was
putting into the mail() function) to get the error:
mail(poppitypopATgmailDOTcom, =?UTF-8?B?
V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content stuff here ,
From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: =?UTF-8?B??= X-
Mailer: CakePHP Email Component Content-Type: text/plain;
charset=UTF-8 Content-Transfer-Encoding: 7bit, )'

So I conclude the problem is the ?UTF-8?B??.  Which is probably
something I can not fix myself.  This is a bug.  Could someone make a
ticket for this?  hehe, I really have no idea how to use trac,
otherwise I would do it myself...


On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote:
> Note the "=?UTF-8?B??=" bits. There seems to be a lot of that going
> on. I don't know if anyone's figured out the cause yet but I suggest
> you check Trac.
>
> On Fri, Jun 27, 2008 at 11:19 PM, Turnquist, Jonah <[EMAIL PROTECTED]> wrote:
>
> > I am having a problem with the email component.  I am trying to get it
> > to send a simple text email.  I have set up the layouts and
> > templates.  But for some reason it will not send.  nor will it throw
> > an error.  I am using WAMP, and set up the php.ini to send email
> > correctly as far as I can tell.  The funny thing is that the php
> > mail() function DOES work, just not the email component.
> > Here is the code in the controller:http://bin.cakephp.org/view/2104639841
> > could somone glance at it?
>
> > Thanks,
> > Jonah
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---