i18n shell validation msgs not being extracted

2013-09-17 Thread aka
I'm trying to generate the pot files from my site with cake's i18n shell 
useing cake 2.3. As mentioned in the cake docs the shell should 
automatically extract the validation msgs. However, none of the validation 
strings are added to my pot files. 

My validation array simply looks like: 
public $validate = array( 
'currency' = array(
'notempty' = array(
'rule' = array('notempty'),
'message' = 'Select a currency'
),
),
'title' = array(
'notempty' = array(
'rule' = array('notempty'),
'message' = 'Fill out a title'
),
)

... etc
)


What am i not seeing here?!

Thanks allot!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Pagination with i18n field condition (pagination + translation behavior error)

2013-09-10 Thread aka
Why is this no working (throws a column not found) :

$conditions = array('OR' = array( 'I18n__title.content LIKE' = 
'%'.$searchKey.'%'));

$this-paginate = array(
'conditions' = $conditions
);

$results = $this-paginate();

*Error: * SQLSTATE[42S22]: Column not found: 1054 Unknown column 
'I18n__title.content' in 'where clause'

While a normal find works fine: 
$this-MyModel-find('all',  array('conditions' = $conditions));



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Pagination with i18n field condition (pagination + translation behavior error)

2013-09-10 Thread aka
Sorry, a little typo in my example:

$conditions = array('OR' = array( 'I18n__title.content LIKE' = 
'%'.$searchKey.'%'));

should be 

$conditions = array('OR' = array( I18n__titleTranslation LIKE' = 
'%'.$searchKey.'%'));


That doesn't change the outcome though.. 


On Tuesday, September 10, 2013 12:30:53 PM UTC+2, aka wrote:

 Why is this no working (throws a column not found) :

 $conditions = array('OR' = array( 'I18n__title.content LIKE' = 
 '%'.$searchKey.'%'));

 $this-paginate = array(
 'conditions' = $conditions
 );

 $results = $this-paginate();

 *Error: * SQLSTATE[42S22]: Column not found: 1054 Unknown column 
 'I18n__title.content' in 'where clause'

 While a normal find works fine: 
 $this-MyModel-find('all',  array('conditions' = $conditions));





-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


i18n Search for string in multiple translations

2013-09-03 Thread aka
Hi there,

Im trying to set up a search function for a multilingual website. I'm using 
cake's (2.2) translation behavior and my translated fields are saved in a 
separate table (for example: I18n__titleTranslation)

Now i would like to search these records and their translations but the 
only way I seem to be able to do that is by looping through all the site 
languages (6 in my case) and setting $this-Model-locale = lang for 
every language before I do a find. To me this comes over as a bit expensive 
and in the process actually can result in duplicate results (keyword 'test' 
can be found on multiple translations). 

Does anyone have an idea of how to tackle this? 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Calling controller methods from an external php class.

2011-08-09 Thread Michael IV (aka SasMaster)
Hi to All Cakers .I have the following problem.I need to integrate a flash
application inside Cake based website.The flash app  communicates with cake
via a WebOrb PHP server (in AMF format to increase the speed of data
transfer).So basically inside Flash I call a method on a PHP service
deployed in the WebOrb which should call an action in one of cake's
controllers.How do I call a  thea seasoned PHP devs.

Thanks for help.


-- 
Michael Ivanov ,Senior Programmer
Neurotech Solutions Ltd.
www.neurotechresearch.com
http://blog.alladvanced.net
Tel:054-4962254
mich...@neurotech.co.il
t...@neurotech.co.il

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakeFest 2010, who is going?

2010-06-30 Thread Larry E. Masters aka PhpNut
Just want to start a thread and see how many people on the google group
would like to attend or are planning to attend CakeFest 2010? This is the
largest gathering of CakePHP developers and we plan to have most of the core
development team at the event this year.

http://cakefest.org/schedule

So who is coming or planning to come to the event?

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakeFest 2010, who is going?

2010-06-30 Thread Larry E. Masters aka PhpNut
Shaz,

Are you afraid to fly? :)

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/


On Wed, Jun 30, 2010 at 9:42 AM, Shaz shazam...@gmail.com wrote:

 I'd come if it wasn't so far away from London!

 On Jun 30, 3:38 pm, Larry E. Masters aka PhpNut php...@gmail.com
 wrote:
  Just want to start a thread and see how many people on the google group
  would like to attend or are planning to attend CakeFest 2010? This is the
  largest gathering of CakePHP developers and we plan to have most of the
 core
  development team at the event this year.
 
  http://cakefest.org/schedule
 
  So who is coming or planning to come to the event?
 
  --
  /**
  * @author Larry E. Masters
  * @var string $userName
  * @param string $realName
  * @returns string aka PhpNut
  * @access public
  */

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakeFest 2010, who is going?

2010-06-30 Thread Larry E. Masters aka PhpNut
Mike,

The site list the early bird prices now, soon the prices will be going up.
http://cakefest.org/ticket-info

We are checking with the hotel to make sure we have the room for expansion
because the response to the event is higher than anticipated this year.
Everyone wants a piece of the CakePHP :)

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/


On Wed, Jun 30, 2010 at 10:07 AM, Mike Karthauser
mi...@brightstorm.co.ukwrote:

 Hi Larry
 am thinking about it. Do you know what the early bird ticket prices are?
 we'll be coming up from bristol, UK.
 mikek



 On Wed, June 30, 2010 3:38 pm, Larry E. Masters aka PhpNut wrote:
  Just want to start a thread and see how many people on the google group
  would like to attend or are planning to attend CakeFest 2010? This is the
  largest gathering of CakePHP developers and we plan to have most of the
  core
  development team at the event this year.
 
  http://cakefest.org/schedule
 
  So who is coming or planning to come to the event?
 
  --
  /**
  * @author Larry E. Masters
  * @var string $userName
  * @param string $realName
  * @returns string aka PhpNut
  * @access public
  */
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
 others
  with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group
  at http://groups.google.com/group/cake-php?hl=en
 


 --
 Mike Karthauser
 Managing Director - Brightstorm Ltd

 Email: mi...@brightstorm.co.uk
 Web: http://www.brightstorm.co.uk
 Tel:  07939 252144 (mobile)
 Fax: 0870 1320560

 Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakeFest 2010, who is going?

2010-06-30 Thread Larry E. Masters aka PhpNut
Mike,

Great! Looking forward to seeing you there.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/


On Wed, Jun 30, 2010 at 10:23 AM, Mike Karthauser
mi...@brightstorm.co.ukwrote:


 On Wed, June 30, 2010 4:12 pm, Larry E. Masters aka PhpNut wrote:
  Mike,
 
  The site list the early bird prices now, soon the prices will be going
 up.
  http://cakefest.org/ticket-info

 aha.

 am planning on travelling out with my good friend who is last speaker on
 the 5th.

 looking forward to it.

 
  We are checking with the hotel to make sure we have the room for
 expansion
  because the response to the event is higher than anticipated this year.
  Everyone wants a piece of the CakePHP :)
 
  --
  /**
  * @author Larry E. Masters
  * @var string $userName
  * @param string $realName
  * @returns string aka PhpNut
  * @access public
  */
 
 
  On Wed, Jun 30, 2010 at 10:07 AM, Mike Karthauser
  mi...@brightstorm.co.ukwrote:
 
  Hi Larry
  am thinking about it. Do you know what the early bird ticket prices are?
  we'll be coming up from bristol, UK.
  mikek
 
 
 
  On Wed, June 30, 2010 3:38 pm, Larry E. Masters aka PhpNut wrote:
   Just want to start a thread and see how many people on the google
  group
   would like to attend or are planning to attend CakeFest 2010? This is
  the
   largest gathering of CakePHP developers and we plan to have most of
  the
   core
   development team at the event this year.
  
   http://cakefest.org/schedule
  
   So who is coming or planning to come to the event?
  
   --
   /**
   * @author Larry E. Masters
   * @var string $userName
   * @param string $realName
   * @returns string aka PhpNut
   * @access public
   */
  
   Check out the new CakePHP Questions site http://cakeqs.org and help
  others
   with their CakePHP related questions.
  
   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
   cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.comcake-php%252bunsubscr...@googlegroups.com
 For
  more options, visit this group
   at http://groups.google.com/group/cake-php?hl=en
  
 
 
  --
  Mike Karthauser
  Managing Director - Brightstorm Ltd
 
  Email: mi...@brightstorm.co.uk
  Web: http://www.brightstorm.co.uk
  Tel:  07939 252144 (mobile)
  Fax: 0870 1320560
 
  Address: 1 Brewery Court, North Street, Bristol, BS3 1JS
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
  others
  with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.comcake-php%252bunsubscr...@googlegroups.com
 For
  more options, visit this group at
  http://groups.google.com/group/cake-php?hl=en
 
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
 others
  with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group
  at http://groups.google.com/group/cake-php?hl=en
 


 --
 Mike Karthauser
 Managing Director - Brightstorm Ltd

 Email: mi...@brightstorm.co.uk
 Web: http://www.brightstorm.co.uk
 Tel:  07939 252144 (mobile)
 Fax: 0870 1320560

 Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cookies from CAKE and other branding

2010-06-29 Thread Larry E. Masters aka PhpNut
Sounds like you are not using the proper settings in core.php to set the
cookie name. Look @ the doc comments in the file they should explain how to
do this.

As for the branding override all of the templates from the core views,
simple enough, and you can even create your own bake templates to use in all
of your other projects so you are not cleaning out your installs every
time.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/


On Mon, Jun 28, 2010 at 10:01 PM, Vangel abhishek.duj...@gmail.com wrote:

 I am quite sick of cake doing tons of branding everywhere. (emails,
 cookies, css etc etc)
  Its starting to look like some other frameworks already.

 I have set cookies etc, but Cake still sets its own CAKEPHP cookie. I
 absolutely do not want to give any indication to snoopers and sniffers
 about what framework I am using. Anyone here has done any research
 into cleaning out cakes footprints please post some notes.
 I will post a few clean ups I found. I think I will be putting
 together a clean version of cake for all future projects. Cleaning it
 out every time is a giant waste of time .

 This can be used a topic to discuss on how to remove the default
 messages and other related branding so you are not caught unaware of
 your clients receiving emails from EmailComponent signed by Cakephp
 and similar things.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Removal of post

2010-06-04 Thread Larry E. Masters aka PhpNut
All post directly from you have been removed per your request.
If you have any further questions please direct them to google.

http://groups.google.com/support/bin/answer.py?hl=enanswer=46452


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/


On Fri, Jun 4, 2010 at 5:04 AM, Jayesh Wadhwani jwadhw...@gmail.com wrote:

 Hello,

 Per terms and conditions of Google groups please remove all postings
 related to me. My email is jwadhw...@gmail.com

 Thanks

 Jayesh Wadhwani

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Organizing controllers in folders

2010-02-05 Thread Larry E. Masters aka PhpNut
Yes all you need to do is create the directories and move your controllers.
CakePHP will find the files and cache the paths. Make sure you are
developing with debug  0 so the cache file will be refreshed as you move
your files around.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Fri, Feb 5, 2010 at 9:30 AM, Mandy Singh man...@gmail.com wrote:

 hi,

 is it possible to organize controllers under /app/controllers in sub-
 folders ?

 my module is growing huge and i would like to create sub directories
 under /app/controllers like components .

 let me know.

 i am on cakephp 1.2.

 thanks.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.3 on a production server?

2010-01-12 Thread Larry E. Masters aka PhpNut
Why would I be sarcastic? How you follow the CakePHP project for any length
of time? You will notice the alpha releases are more stable then most
projects stable versions.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/


On Tue, Jan 12, 2010 at 12:57 PM, DanielMedia danielmedi...@gmail.comwrote:

 Just checking if you were being sarcastic Larry?

 On Jan 11, 8:20 pm, Larry E. Masters aka PhpNut php...@gmail.com
 wrote:
  Yes all client work is on 1.3

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.3 on a production server?

2010-01-12 Thread Larry E. Masters aka PhpNut
s/How/Have/

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

Why would I be sarcastic? How you follow the CakePHP project for any length
 of time? You will notice the alpha releases are more stable then most
 projects stable versions.
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.3 on a production server?

2010-01-11 Thread Larry E. Masters aka PhpNut
Yes all client work is on 1.3


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Mon, Jan 11, 2010 at 9:17 PM, Jamie jamie@gmail.com wrote:

 Is anyone using 1.3 on their live, high traffic production servers?
 I'm not just talking about blogs, but websites for paying clients and
 that sort of thing (no offense to the 1.3 bloggers out there!). I'm
 considering upgrading some of the domains I manage at my work to 1.3,
 but since it's still in alpha I'm not convinced of its stability just
 yet.

 - Jamie

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Out of office reply

2010-01-01 Thread Larry E. Masters aka PhpNut
David,

I removed the account last night, 13 more days of that would drive me
insane.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/


On Fri, Jan 1, 2010 at 3:20 AM, David Roda davidcr...@gmail.com wrote:

 Wow... this is really getting annoying

 On 12/31/2009 10:40 PM, j...@citadelsecure.com wrote:
  Hi,
 
  I am out the office until the 14th of January.  If you require urgent
 assistance then please contact p...@citadelsecure.com or call him on 07890
 592198 - otherwise I will answer your email on my return.
 
  Regards
 
  Jim
 
 
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en
 

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Default __() parameters causes problems

2009-12-17 Thread Larry E. Masters aka PhpNut
I have plans to change the __*() functions to return by default it has not
been implemented yet


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Thu, Dec 17, 2009 at 12:31 PM, euromark dereurom...@googlemail.comwrote:

 i do agree that this is one of the few remaining inconsistencies
 remaining in cake1.2/1.3
 all other functions return by default
 e.g. in 1.3 the flash() messages now are returned by default, although
 scripts/css are inline by default (and therefore echod too).

 returning should be the default value in most cases
 but i dont think in the __() case this is going to happen :)
 at least it doesnt look like it

 using the ___() function might be a very neat way of fixing it for
 you, though
 the overhead is minimal

 you should then use the second param though!
 function ___($a, $return = true) { return __($a, $return); }
 to be more flexible


 On 17 Dez., 18:39, djogo djogopat...@gmail.com wrote:
  Our previous, cake1.1, code was internationalized using php's gettext
  library and the function _().
 
  Cake1.2 now uses __(), which is great, because doesn't require us to
  compile .po files anymore.
 
  However, the default behaviour of __() is to echo the translated
  string, instead of returning it, therefore I'm having a lot of heavy
  work going from _( $a )  to __( $a, true ). I have a regexp for
  translating _() to __(), but I couldn't figure out how to insert the
  ,end parameter in the end of the call.
 
  I though to create a patch in the __() function to change the default
  value, but I don't want to have my own version of cakephp.
 
  Or, I may create
 
  function ___($a) { return __($a,true); }
 
  I _really_ think cakephp designers should make the second parameters
  true by default, to turn the transition easy. However, I need my code
  functioning in CAKE 1.2. Do anybody have some tip?

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Javascript libraries with images/css inside Cake Plugins

2009-12-03 Thread Larry E. Masters aka PhpNut
http://code.cakephp.org/wiki/1.3/new-features/plugin-assets

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Thu, Dec 3, 2009 at 4:53 AM, peterchenadded peterchenad...@gmail.comwrote:

 Have a look at mediaview (http://book.cakephp.org/view/489/Media-
 Views).

 Basically, it will give you access to any file on your system
 including your plugins folder. If you name your controller and action
 properly you should be able to achieve what you want.

 Cheers.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: About multilingual websites

2009-11-26 Thread Larry E. Masters aka PhpNut


 5) Change the extension of the result file from .pot to .po so that
 you can open it with Poedit.


You do not change the extension to .po.

Poedit will open this as a template file using the settings for the specific
language you are translating to.

Look for: File  New catalog from POT file...

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP performance 1.2 - is future any better?

2009-11-24 Thread Larry E. Masters aka PhpNut
On Tue, Nov 24, 2009 at 9:07 AM, Martin Westin
martin.westin...@gmail.comwrote:

 Maybe someone should answer the original question: Will future
 versions improve performance?


Yes



 1.3 - most likely not too much.


Yes 1.3 already has improvements and more are being found and implemented.


 2.0 - this will likely see some more significant improvements since
 php4 is dropped.


There are other improvements that are not related specifically to dropping
php 4, these changes will be back ported to 1.x series of the code to help
improve performance.



 Any advancements after 2.0 are also likely to offer improvements as
 more and more code is php5 optimized.


Yes


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

--

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




Re: CakePHP performance 1.2 - is future any better?

2009-11-24 Thread Larry E. Masters aka PhpNut
 Straight from the source. Thanks Larry, I was mostly guessing that 2.0
 would see the bigger improvements. :)


Martin you are welcome.

Here is a list of some features that are planned in 2.0
http://code.cakephp.org/cakephp2/wiki


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: About multilingual websites

2009-11-23 Thread Larry E. Masters aka PhpNut
Ignore this section in the manual it in incorrect:

Remember that po files are useful for short messages, if you find you want
to translate long paragraphs, or even whole pages - you should consider
implementing a different solution. e.g.:

http://cakedc.com/ uses entire paragraphs.

http://cakeqs.org/ is another example, the cakeqs.pot for it is located
here: http://groups.google.com/group/cake-php/files you can open that file
in an editor and around line 1735 see a msgid for an entire paragraph. the
cakeqs-*.po files are the actual files we use in the app.

One of the most important settings in the .po file is Plural-Forms:, if it
is incorrect, your plural translations will not look right. Let me know if
you need help with this, I am working to get the old
translations.cakephp.org domain setup again and it will list all the
different plural form expressions:

Example (There are 16 forms of plurals, 2 listed below):

#English, French, etc
nplurals=2; plural=n1;

#Japanese etc
nplurals=1; plural=0;

You can also dig through the test case app in the core that has all the
plural forms in cake/tests/test_app/local/*

Another piece of advice you may already know.

Using the console you can extract these string with the following command.

cake i18n extract

This will create the pot file that you would use to create the .po files
using a tool like www.poedit.net

/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Mon, Nov 23, 2009 at 5:35 AM, thomaus thomas.ausse...@gmail.com wrote:

 Hi there,

 One month ago, I did a multilanguage website using CakePHP but putting
 all the multilangual content in my dB.

 From what I read today, this was the right way to display short
 messages in various languages with CakePHP :
 http://book.cakephp.org/view/162/Internationalizing-Your-Application

 From what I read too, po files are useful for short messages, if you
 find you want to translate long paragraphs, or even whole pages - you
 should consider implementing a different solution.

 Then my question is : is there a standard way to translate dynamically
 long paragraphs?

 Thanks,

 --

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.


--

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




Re: Where can I get The Chaw?

2009-11-21 Thread Larry E. Masters aka PhpNut
It never was open sourced.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Nov 21, 2009 at 8:13 PM, itsnotvalid itsnotva...@gmail.com wrote:

 Just searched a few websites and there is no indication of a git repo.
 Wonder if this project is still open source.

 --

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.




--

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




Re: best merge port with po translation

2009-11-19 Thread Larry E. Masters aka PhpNut
poedit.net

Choose: Catalog  Update from POT file...


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Thu, Nov 19, 2009 at 8:06 AM, andrzejborkow...@gmail.com 
andrzejborkow...@gmail.com wrote:

 how is best solutions for merge exist po translation (stay translated
 msgid) with new extract pot file (empty msgstr)  ?

 --

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.




--

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




Re: cookie data corrupted

2009-11-13 Thread Larry E. Masters aka PhpNut
I am curious if you are using Suhosin php extension?

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Fri, Nov 13, 2009 at 12:25 PM, Quess miroslaw.niepo...@gmail.com wrote:

 I have exactly the same problem. On developing server everything works
 like a charm but on production encrypted cookies return values quite
 different than has been written.
 Any help would be very appreciate. :)

 Cheers,
 Quess

 On Nov 2, 1:17 pm, tobi_one tobias.h...@gmail.com wrote:
  Hi,
 
  I played around with this a little more. It turned out that the
  problem is tied to the standard encryption of the cookie.
  If I turn encryption off, it works. I didn't notice that in the first
  place, because the old cookies were not deleted...
 
  I encrypt the values now myself, as a work-around, but still
  interested in finding out what causes this problem in the first place!
 
  Cheers,
  tobi_one
 
  On 2 Nov., 08:59, tobi_one tobias.h...@gmail.com wrote:
 
 
 
   Hi John,
 
   thanks for your response!
 
   I tried just a single key and it does not work either. I tried various
   cookie settings, but none of them seem to have an influence on this
   issue. The current cookie settings I'm using is just
 
   $this-Cookie-name = 'somename';
   $this-Cookie-time = '2 weeks'; // or '1 hour'
 
   Maybe something on the serverside that could lead to this strange
   behaviour?
 
   Cheers,tobi_one
 
   On 30 Okt., 21:18, John Andersen j.andersen...@gmail.com wrote:
 
How is the cookie settings?
Have you tried with a simple test, using not Auth.User, but another
key?
Enjoy,
   John
 
On Oct 30, 6:32 pm,tobi_onetobias.h...@gmail.com wrote:
 
 Hi,
 
 I try to get cookies to work. I try to store data the usual way
 
 $cookie['username'] = $this-data['User']['username'];
 $cookie['password'] = $this-data['User']['password'];
 $this-Cookie-write('Auth.User',$cookie,true, '+2 weeks');
 
 when I retrieve the cookie data with
 
 $cookie = $this-Cookie-read('Auth.User');
 debug($cookie);
 
 the data is always corrupted.
 
 Array
 (
 [Auth] = Array
 (
 [User] =
 )
 
 )
 
 There is no difference whether I switch off encryption of the
 cookie
 data, by setting the third value of Cookie-write to false. Any
 ideas,
 what I am missing?
 
 Cheers,
tobi_one- 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-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.




--

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




Re: I now have an iPhone (was: CakeFest IV - America - Help us pick a location!)

2009-11-13 Thread Larry E. Masters aka PhpNut
Chris,

Thanks for breaking the thread :)

Everyone please reply to the email/thread titled:

CakeFest IV - America - Help us pick a location!

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Fri, Nov 13, 2009 at 6:54 PM, Scott Dahl scottmd...@gmail.com wrote:

 I vote Seattle!!!


 On Fri, Nov 13, 2009 at 4:46 PM, Walker Hamilton signalf...@gmail.comwrote:

 How about centrally located (St. Louis or Chicago)?

 --

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.



  --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.


--

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




CakeFest IV - America - Help us pick a location!

2009-11-13 Thread Larry E. Masters aka PhpNut
Trying to set this back to original thread in google.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Fri, Nov 13, 2009 at 6:59 PM, Larry E. Masters aka PhpNut 
php...@gmail.com wrote:

 Chris,

 Thanks for breaking the thread :)

 Everyone please reply to the email/thread titled:

 CakeFest IV - America - Help us pick a location!

 --
 /**
 * @author Larry E. Masters
 * @var string $userName
 * @param string $realName
 * @returns string aka PhpNut
 * @access  public
 */


 On Fri, Nov 13, 2009 at 6:54 PM, Scott Dahl scottmd...@gmail.com wrote:

 I vote Seattle!!!


 On Fri, Nov 13, 2009 at 4:46 PM, Walker Hamilton signalf...@gmail.comwrote:

 How about centrally located (St. Louis or Chicago)?

 --

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.



  --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.





--

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




Re: CakeFest IV - America - Help us pick a location!

2009-11-13 Thread Larry E. Masters aka PhpNut
Nashville Tn. since I live in Tn now and it would be easier for me to deal
with the venues.

Chicago like Walker Hamilton suggested, that is my old home town and would
be nice to visit.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Fri, Nov 13, 2009 at 6:55 PM, Jose myaccou...@savant.be wrote:

 NEW YORK

 -savant

 On Nov 12, 10:43 pm, Graham Weldon gra...@grahamweldon.com wrote:
  Hi all,
 
  The CakePHP team has been considering the location for the next
  upcoming CakeFest.
  We've decided to bring it back home to the United Sates of America.
  Thus far we haven't chosen a location for the event, but to ensure we
  reach as many people as possible, we'd like your opinion on where we
  should host the event.
 
  Essentially, our choices are:
  - USA East Coast
  - USA West Coast
  - USA Central
 
  If I have missed another location that you feel might be more popular
  or accessible to interested attendees, feel free to suggest it.
  We're keen to hear peoples thoughts on it.
 
  Cheers,
 
  Graham Weldon (AKA: Predominant)
 
  e. gra...@grahamweldon.com
  w.http://grahamweldon.com

 --

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-...@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=.



--

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




CakePHP Questions - Now out of beta!

2009-11-10 Thread Larry E. Masters aka PhpNut
CakePHP Questions http://cakeqs.org has just come out of beta testing and
registration is open to all users of CakePHP. This is the first step in
unifying the community applications that are currently available. We will
continue to keep everyone informed over the next few weeks as more of the
sites are updated and content monitoring of these sites put in the the hands
of our user base. We have listened to your feedback and think you should
have more control over what you find useful.

CakePHP Questions is a multilingual site and if you are interested in
helping us translate the static content of the site please contact us:
cak...@cakephp.org

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

--

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




Re: cakephp.org hacked?

2009-11-03 Thread Larry E. Masters aka PhpNut
Wow people relax... We are a group of developers that enjoy releasing this
framework and also like to have a little fun after all the talk of this
project dying. This was a great in your face We are still here statement.

Thanks for all your support...

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Nov 3, 2009 at 11:17 PM, Josh K joshkrae...@gmail.com wrote:


 I agree. This theme has me worried.  Halloween is past anyway.

 On Nov 3, 2:50 pm, on24 on2...@gmail.com wrote:
  Hmmm, I just don't like this funny theme. My first thought was
  CakePHP gone?! Too bad. Let's check Code Igniter then. Serious
  things like frameworks should not try to be funny. I really can't
  promote a halloween framework to my colleagues.
 


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find __() function parameters in /app and update *.po - automated

2009-10-14 Thread Larry E. Masters aka PhpNut
Toby,
It sounds like you are trying to use translations as a way to also change
text.

Examples (forgive me in advance if google did not translate these properly):

Welcome to the home page of CakePHP the best PHP framework for rapidly
building applications.

Translated to German this would be:

Willkommen auf der Homepage von CakePHP den besten Rahmen für PHP schnell
die Erstellung von Anwendungen.

Anything else would not be a translation:

Example:

Herzlich Willkommen auf meiner Homepage der Anwendungen habe ich mit Hilfe
meiner CakePHP Rahmen der Wahl.

Which means:

Welcome to my home page of the applications I have built using CakePHP my
framework of choice.

This is not translating text, and it not what I18n is to be used for.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Wed, Oct 14, 2009 at 9:15 AM, Toby Ashley lowpi...@gmail.com wrote:

 While this discussion is going on, I thought I'd raise / ask something...

 In a recent project, I needed to make it easy for administrators to be able
 to edit the text used throughout the site. The site itself runs in 12
 languages, and as a result I have 12 *.po files, one per territory. The
 administrators for each language are fairly non-technical, and so the system
 needed to be easy.

 I built a simple system which would do the following:

 -- Provide a 'download existing website text' button to the administrator -
 the controller action would then read through the appropriate *.po file and
 generate a CSV with two columns, the identifier (i'm also using descriptive
 slugs, as mentioned by Miles) and the current string for that identifier

 -- The administrator can then make the necessary amendments before
 re-importing the CSV. When re-importing, the system backs up the existing
 *.po file and creates a new one, manually writing the msgid and msgstr
 values from the data in the CSV. Finally, when this is done, the system
 removes any relevant cache files and  hey presto - the website text is
 updated.

 -- There's also tools to revert to previous backup, in case they make an
 almighty mess of everything.

 This system worked fine for the project, and the administrators of the site
 are maintaining the different languages with success, but I'm wondering if
 there's a better / simpler / more recommend way of achieving the same
 functionality. I guess it's kind of like a friendly, web-based interface for
 editing these *.po files

 Any suggestions?

 Cheers,
 toby




 On Wed, Oct 14, 2009 at 2:05 AM, Larry E. Masters aka PhpNut 
 php...@gmail.com wrote:

 Cool, let me know if you have any questions.
 --
 /**
 * @author Larry E. Masters
 * @var string $userName
 * @param string $realName
 * @returns string aka PhpNut
 * @access  public
 */

 On Tue, Oct 13, 2009 at 7:46 PM, Miles J mileswjohn...@gmail.com wrote:


 Well see now a lot of it makes sense. The guide is pretty vague on
 i18n/l10n and how it works / is used.

 Will give this a try.

 On Oct 13, 5:39 pm, Larry E. Masters aka PhpNut php...@gmail.com
 wrote:
  Incorrect, the file that is created using the i18n extract creates a
 .pot
  file which is a template file and can be opened in any po editor or
 text
  editor. The template is not language specific. There is no reason to
 create
  these files by hand. Write your code and output using the sentences you
  would normally use just wrap the string in __() function. Run the
 extractor
  and you are done.
  Easiest tool to edit translations I have recently found is
 poedit.www.poedit.net
 
  I uploaded current core extracted pot file.
 
  http://cake-php.googlegroups.com/web/default.pot
 
  Download it and open in poedit.
 
  The nice thing about these pot file is you can create a new version
 with
  changes in your application, reopen the template in poedit, and it will
  merge changes highlighting the strings that have changed.
 
  Not sure if you are aware how the other translation functions work in
 the
  core, but when it comes to handling plurals in a sentence, your slugs
 will
  become more confusing.
 
  for($number = 0; $i  100; $number++) {
  sprintf(__n('There is %d apple in the fruit bowl', 'There are %d apples
 in
  the fruit bowl', $number), $number);
 
  }
 
  msgid There is %d apple in the fruit bowl
  msgid_plural There are %d apples in the fruit bowl
  msgstr[0] 
  msgstr[1] 
  msgstr[2] 
  msgstr[3] 
  msgstr[4] 
  msgstr[5] 
  msgstr[6] 
 
  There are 16 plural rules that range from 1 form of plural to 6 forms
 of
  plural depending on the value of $number. It all depends and the
 language
  the content is being translated to. The above example be based on the
 header
  in the po file, which poedit allows you to set based on the language
 you are
  using.
 
  Only 1 form of plural.
  Plural-Forms: nplurals=1; plural=0;\n
 
  6 forms of plural.
  Plural-Forms: nplurals=4; plural=n==1 ? 0 : n==2 ? 1 : n==0 || (n=3
 
  n=10) ? 2 : 3;\n

Re: find __() function parameters in /app and update *.po - automated

2009-10-14 Thread Larry E. Masters aka PhpNut
Miles,

It is not a suggestion it is the correct way the code should be used.

As I stated in the previous email the pot file is reopened, using poedit for
example, and you merge the changes from your code. Your .po and .mo files
will have the correct msgid and your translators will be able to open the
file and know that it has been altered because the fields are marked as
fuzzy translation.

When I originally wrote this code I used gettext, which is a commonly used
implementation, as a model to build it for CakePHP.

http://en.wikipedia.org/wiki/GNU_gettext
http://www.gnu.org/software/gettext/
http://gnuwin32.sourceforge.net/packages/gettext.htm

There are many other examples you can find on the internet showing proper
way to use gettext.

Look at the site setup for translating GNU and other projects:
http://translationproject.org/

I doubt you will find a project out of the 160+ on that site using slugs
like you suggest.

You can use the code however you like though.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Wed, Oct 14, 2009 at 11:21 AM, Miles J mileswjohn...@gmail.com wrote:


 Additionally on the subject of PhpNut's suggestion. What if we change
 the text string in the view (english one) and then the translated ones
 wont match anymore because the msgid has changed. And if we generate
 new po files then we would have to translate them all over again.
 Thats primarily my reason for using slugs.

 On Oct 14, 7:15 am, Toby Ashley lowpi...@gmail.com wrote:
  While this discussion is going on, I thought I'd raise / ask something...
 
  In a recent project, I needed to make it easy for administrators to be
 able
  to edit the text used throughout the site. The site itself runs in 12
  languages, and as a result I have 12 *.po files, one per territory. The
  administrators for each language are fairly non-technical, and so the
 system
  needed to be easy.
 
  I built a simple system which would do the following:
 
  -- Provide a 'download existing website text' button to the administrator
 -
  the controller action would then read through the appropriate *.po file
 and
  generate a CSV with two columns, the identifier (i'm also using
 descriptive
  slugs, as mentioned by Miles) and the current string for that identifier
 
  -- The administrator can then make the necessary amendments before
  re-importing the CSV. When re-importing, the system backs up the existing
  *.po file and creates a new one, manually writing the msgid and msgstr
  values from the data in the CSV. Finally, when this is done, the system
  removes any relevant cache files and  hey presto - the website text is
  updated.
 
  -- There's also tools to revert to previous backup, in case they make an
  almighty mess of everything.
 
  This system worked fine for the project, and the administrators of the
 site
  are maintaining the different languages with success, but I'm wondering
 if
  there's a better / simpler / more recommend way of achieving the same
  functionality. I guess it's kind of like a friendly, web-based interface
 for
  editing these *.po files
 
  Any suggestions?
 
  Cheers,
  toby
 
  On Wed, Oct 14, 2009 at 2:05 AM, Larry E. Masters aka PhpNut 
 
  php...@gmail.com wrote:
   Cool, let me know if you have any questions.
   --
   /**
   * @author Larry E. Masters
   * @var string $userName
   * @param string $realName
   * @returns string aka PhpNut
   * @access  public
   */
 
   On Tue, Oct 13, 2009 at 7:46 PM, Miles J mileswjohn...@gmail.com
 wrote:
 
   Well see now a lot of it makes sense. The guide is pretty vague on
   i18n/l10n and how it works / is used.
 
   Will give this a try.
 
   On Oct 13, 5:39 pm, Larry E. Masters aka PhpNut php...@gmail.com
   wrote:
Incorrect, the file that is created using the i18n extract creates a
   .pot
file which is a template file and can be opened in any po editor or
 text
editor. The template is not language specific. There is no reason to
   create
these files by hand. Write your code and output using the sentences
 you
would normally use just wrap the string in __() function. Run the
   extractor
and you are done.
Easiest tool to edit translations I have recently found is
   poedit.www.poedit.net
 
I uploaded current core extracted pot file.
 
   http://cake-php.googlegroups.com/web/default.pot
 
Download it and open in poedit.
 
The nice thing about these pot file is you can create a new version
 with
changes in your application, reopen the template in poedit, and it
 will
merge changes highlighting the strings that have changed.
 
Not sure if you are aware how the other translation functions work
 in
   the
core, but when it comes to handling plurals in a sentence, your
 slugs
   will
become more confusing.
 
for($number = 0; $i  100; $number++) {
sprintf(__n('There is %d apple in the fruit bowl', 'There are %d

Re: gwoo Leaving CakePHP??

2009-10-14 Thread Larry E. Masters aka PhpNut
Adam,

Since being informed by gwoo that he was leaving the project a couple weeks
ago, I have stepped back into a more active role in the project.
At this time I have not selected a new project manager but you can be
assured the project will go on. The lead developers are as active as ever on
the current codebase, and work on it is increasing rapidly. A change in the
project manager position for the CakePHP project at this juncture will allow
us to realign the team to the development roadmap, and better achieve our
goals in terms of development and release moving forward.

Look forward to what is in store with the 1.3 and 2.0 releases, more to be
announced on these later :).

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/
On Wed, Oct 14, 2009 at 5:18 PM, Adam adam.pars...@pearson.com wrote:


 [gwoo] resigned from the Cake Software Foundation and cakephp
 project. Thank you all for 4 great years. Best of luck to the team and
 community.

 https://www.ohloh.net/accounts/gwoo/messages

 Is this true? Any reason behind this decision? Who will step up and
 manage this great project?

 In the event it is true, Garrett you did a fantastic job! I love
 CakePHP and thank you for your time and dedication.

 


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find __() function parameters in /app and update *.po - automated

2009-10-13 Thread Larry E. Masters aka PhpNut
There is a shell script to do this. If the cake console is in your
environment path, this command will work.
cake i18n extract


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Oct 13, 2009 at 9:13 AM, Rob rob...@catchit.pl wrote:


 Any1 thought about creating little snippet which could speed up
 hardcoded localization process.
 Here is the simple scenerio:
 1) find strings within __('...') __('...',true) string patterns in /
 app folder
 2) build arrays from default locale *.po files containing locale keys
 3) append to end of these files missing id keys in form:
 msgid _register_disclaimer
 msgstr TOODOO


 i create many multilang apps and i believe it could be major speed
 boost for ppl like me.
 we dont need to update these files manually every time we use __(). we
 just run script when app is ready or changed and just update TOODOO
 strings or send them to translators.

 If some1 came up with idea how this could be easly done i would
 apreciate this.

 regular expressions? if so, how to build fault free one?
 


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find __() function parameters in /app and update *.po - automated

2009-10-13 Thread Larry E. Masters aka PhpNut
Another thing I forgot to mention. You should be using full strings you want
translated for the msgid.Example:

msgid By registering on this web site you are...

This is the way the core was designed to handle translations. You will also
find it much easier for people to translate your application if they have
everything they need in the 1 .po file vs looking for the text related to a
place holder.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Oct 13, 2009 at 9:13 AM, Rob rob...@catchit.pl wrote:


 Any1 thought about creating little snippet which could speed up
 hardcoded localization process.
 Here is the simple scenerio:
 1) find strings within __('...') __('...',true) string patterns in /
 app folder
 2) build arrays from default locale *.po files containing locale keys
 3) append to end of these files missing id keys in form:
 msgid _register_disclaimer
 msgstr TOODOO


 i create many multilang apps and i believe it could be major speed
 boost for ppl like me.
 we dont need to update these files manually every time we use __(). we
 just run script when app is ready or changed and just update TOODOO
 strings or send them to translators.

 If some1 came up with idea how this could be easly done i would
 apreciate this.

 regular expressions? if so, how to build fault free one?
 


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find __() function parameters in /app and update *.po - automated

2009-10-13 Thread Larry E. Masters aka PhpNut
What does the length of the sentences have to do with the way it should be
used? You are duplicating your effort by creating a slug to represent a full
sentence. Keep in mind the .po file is only needed for translations not the
default language.

So in English this:

__('Why duplicate your effort');

would not even have a po file.

But in German you would have a po file with (Used google to translate this):

msgid Why duplicate your effort
msgid Warum doppelte Ihre Bemühungen

Just advising you on the way I wrote the code to work. You can use it anyway
you like I guess, but from a maintenance side distributing your .po files to
a group of translators where they can open them in the editor and see the
exact string that needs to be translated vs trying to find the meaning of
your slug is a plus.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Oct 13, 2009 at 11:12 AM, Miles J mileswjohn...@gmail.com wrote:


 I am personal extremely against naming your ids the full sentence,
 what purpose does that serve? Its longer in both the .po and .ctp file
 and its a lot easier to reference slugs. To each his own I guess.

 On Oct 13, 7:42 am, Larry E. Masters aka PhpNut php...@gmail.com
 wrote:
  Another thing I forgot to mention. You should be using full strings you
 want
  translated for the msgid.Example:
 
  msgid By registering on this web site you are...
 
  This is the way the core was designed to handle translations. You will
 also
  find it much easier for people to translate your application if they have
  everything they need in the 1 .po file vs looking for the text related to
 a
  place holder.
 
  --
  /**
  * @author Larry E. Masters
  * @var string $userName
  * @param string $realName
  * @returns string aka PhpNut
  * @access  public
  */
 
  On Tue, Oct 13, 2009 at 9:13 AM, Rob rob...@catchit.pl wrote:
 
   Any1 thought about creating little snippet which could speed up
   hardcoded localization process.
   Here is the simple scenerio:
   1) find strings within __('...') __('...',true) string patterns in /
   app folder
   2) build arrays from default locale *.po files containing locale keys
   3) append to end of these files missing id keys in form:
   msgid _register_disclaimer
   msgstr TOODOO
 
   i create many multilang apps and i believe it could be major speed
   boost for ppl like me.
   we dont need to update these files manually every time we use __(). we
   just run script when app is ready or changed and just update TOODOO
   strings or send them to translators.
 
   If some1 came up with idea how this could be easly done i would
   apreciate this.
 
   regular expressions? if so, how to build fault free one?
 


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find __() function parameters in /app and update *.po - automated

2009-10-13 Thread Larry E. Masters aka PhpNut
So you are basically using these as defines?
-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Oct 13, 2009 at 2:19 PM, euromark (munich) 
dereurom...@googlemail.com wrote:


 i agree with miles

 they should be slugged, short and precise
 and explained in both the english and foreign .po file

 like

 regMessageSuccess
 and
 You have been successfully registered
 Sie sind nun erfolgreich angemeldet


 or
 valErrorRecordNameExists
 for
 A record with this name already exists

 this way you can easily change the original language text (here:
 english) without having to change all the x places in the script as
 well

 maybe it is now supposed to be
 You cannot have two records with the same name


 but the short slugged term has still the same basic meaning and
 therefore remains the same


 On 13 Okt., 18:12, Miles J mileswjohn...@gmail.com wrote:
  I am personal extremely against naming your ids the full sentence,
  what purpose does that serve? Its longer in both the .po and .ctp file
  and its a lot easier to reference slugs. To each his own I guess.
 
  On Oct 13, 7:42 am, Larry E. Masters aka PhpNut php...@gmail.com
  wrote:
 
   Another thing I forgot to mention. You should be using full strings you
 want
   translated for the msgid.Example:
 
   msgid By registering on this web site you are...
 
   This is the way the core was designed to handle translations. You will
 also
   find it much easier for people to translate your application if they
 have
   everything they need in the 1 .po file vs looking for the text related
 to a
   place holder.
 
   --
   /**
   * @author Larry E. Masters
   * @var string $userName
   * @param string $realName
   * @returns string aka PhpNut
   * @access  public
   */
 
   On Tue, Oct 13, 2009 at 9:13 AM, Rob rob...@catchit.pl wrote:
 
Any1 thought about creating little snippet which could speed up
hardcoded localization process.
Here is the simple scenerio:
1) find strings within __('...') __('...',true) string patterns in /
app folder
2) build arrays from default locale *.po files containing locale keys
3) append to end of these files missing id keys in form:
msgid _register_disclaimer
msgstr TOODOO
 
i create many multilang apps and i believe it could be major speed
boost for ppl like me.
we dont need to update these files manually every time we use __().
 we
just run script when app is ready or changed and just update TOODOO
strings or send them to translators.
 
If some1 came up with idea how this could be easly done i would
apreciate this.
 
regular expressions? if so, how to build fault free one?
 


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find __() function parameters in /app and update *.po - automated

2009-10-13 Thread Larry E. Masters aka PhpNut
Incorrect, the file that is created using the i18n extract creates a .pot
file which is a template file and can be opened in any po editor or text
editor. The template is not language specific. There is no reason to create
these files by hand. Write your code and output using the sentences you
would normally use just wrap the string in __() function. Run the extractor
and you are done.
Easiest tool to edit translations I have recently found is poedit.
www.poedit.net

I uploaded current core extracted pot file.

http://cake-php.googlegroups.com/web/default.pot

Download it and open in poedit.

The nice thing about these pot file is you can create a new version with
changes in your application, reopen the template in poedit, and it will
merge changes highlighting the strings that have changed.

Not sure if you are aware how the other translation functions work in the
core, but when it comes to handling plurals in a sentence, your slugs will
become more confusing.

for($number = 0; $i  100; $number++) {
sprintf(__n('There is %d apple in the fruit bowl', 'There are %d apples in
the fruit bowl', $number), $number);
}

msgid There is %d apple in the fruit bowl
msgid_plural There are %d apples in the fruit bowl
msgstr[0] 
msgstr[1] 
msgstr[2] 
msgstr[3] 
msgstr[4] 
msgstr[5] 
msgstr[6] 

There are 16 plural rules that range from 1 form of plural to 6 forms of
plural depending on the value of $number. It all depends and the language
the content is being translated to. The above example be based on the header
in the po file, which poedit allows you to set based on the language you are
using.

Only 1 form of plural.
Plural-Forms: nplurals=1; plural=0;\n

6 forms of plural.
Plural-Forms: nplurals=4; plural=n==1 ? 0 : n==2 ? 1 : n==0 || (n=3 
n=10) ? 2 : 3;\n

14 other forms or plural are available. These will be added to the
translation site I had online for the project before. This will be coming
back online in the next few weeks. They will also be added to the book, with
corrections on the proper use of these functions soon. If you need the
correct plural form before then, let me know and I can reply with it.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Oct 13, 2009 at 6:50 PM, Miles J mileswjohn...@gmail.com wrote:


 But you would need to make the english po file anyways if you are
 going to distribute it and have it translated.

 On Oct 13, 12:58 pm, Larry E. Masters aka PhpNut php...@gmail.com
 wrote:
  So you are basically using these as defines?
  --
  /**
  * @author Larry E. Masters
  * @var string $userName
  * @param string $realName
  * @returns string aka PhpNut
  * @access  public
  */
 
  On Tue, Oct 13, 2009 at 2:19 PM, euromark (munich) 
 
  dereurom...@googlemail.com wrote:
 
   i agree with miles
 
   they should be slugged, short and precise
   and explained in both the english and foreign .po file
 
   like
 
   regMessageSuccess
   and
   You have been successfully registered
   Sie sind nun erfolgreich angemeldet
 
   or
   valErrorRecordNameExists
   for
   A record with this name already exists
 
   this way you can easily change the original language text (here:
   english) without having to change all the x places in the script as
   well
 
   maybe it is now supposed to be
   You cannot have two records with the same name
 
   but the short slugged term has still the same basic meaning and
   therefore remains the same
 
   On 13 Okt., 18:12, Miles J mileswjohn...@gmail.com wrote:
I am personal extremely against naming your ids the full sentence,
what purpose does that serve? Its longer in both the .po and .ctp
 file
and its a lot easier to reference slugs. To each his own I guess.
 
On Oct 13, 7:42 am, Larry E. Masters aka PhpNut php...@gmail.com
wrote:
 
 Another thing I forgot to mention. You should be using full strings
 you
   want
 translated for the msgid.Example:
 
 msgid By registering on this web site you are...
 
 This is the way the core was designed to handle translations. You
 will
   also
 find it much easier for people to translate your application if
 they
   have
 everything they need in the 1 .po file vs looking for the text
 related
   to a
 place holder.
 
 --
 /**
 * @author Larry E. Masters
 * @var string $userName
 * @param string $realName
 * @returns string aka PhpNut
 * @access  public
 */
 
 On Tue, Oct 13, 2009 at 9:13 AM, Rob rob...@catchit.pl wrote:
 
  Any1 thought about creating little snippet which could speed up
  hardcoded localization process.
  Here is the simple scenerio:
  1) find strings within __('...') __('...',true) string patterns
 in /
  app folder
  2) build arrays from default locale *.po files containing locale
 keys
  3) append to end of these files missing id keys in form:
  msgid _register_disclaimer
  msgstr TOODOO

Re: find __() function parameters in /app and update *.po - automated

2009-10-13 Thread Larry E. Masters aka PhpNut
Cool, let me know if you have any questions.
-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Oct 13, 2009 at 7:46 PM, Miles J mileswjohn...@gmail.com wrote:


 Well see now a lot of it makes sense. The guide is pretty vague on
 i18n/l10n and how it works / is used.

 Will give this a try.

 On Oct 13, 5:39 pm, Larry E. Masters aka PhpNut php...@gmail.com
 wrote:
  Incorrect, the file that is created using the i18n extract creates a .pot
  file which is a template file and can be opened in any po editor or text
  editor. The template is not language specific. There is no reason to
 create
  these files by hand. Write your code and output using the sentences you
  would normally use just wrap the string in __() function. Run the
 extractor
  and you are done.
  Easiest tool to edit translations I have recently found is
 poedit.www.poedit.net
 
  I uploaded current core extracted pot file.
 
  http://cake-php.googlegroups.com/web/default.pot
 
  Download it and open in poedit.
 
  The nice thing about these pot file is you can create a new version with
  changes in your application, reopen the template in poedit, and it will
  merge changes highlighting the strings that have changed.
 
  Not sure if you are aware how the other translation functions work in the
  core, but when it comes to handling plurals in a sentence, your slugs
 will
  become more confusing.
 
  for($number = 0; $i  100; $number++) {
  sprintf(__n('There is %d apple in the fruit bowl', 'There are %d apples
 in
  the fruit bowl', $number), $number);
 
  }
 
  msgid There is %d apple in the fruit bowl
  msgid_plural There are %d apples in the fruit bowl
  msgstr[0] 
  msgstr[1] 
  msgstr[2] 
  msgstr[3] 
  msgstr[4] 
  msgstr[5] 
  msgstr[6] 
 
  There are 16 plural rules that range from 1 form of plural to 6 forms of
  plural depending on the value of $number. It all depends and the language
  the content is being translated to. The above example be based on the
 header
  in the po file, which poedit allows you to set based on the language you
 are
  using.
 
  Only 1 form of plural.
  Plural-Forms: nplurals=1; plural=0;\n
 
  6 forms of plural.
  Plural-Forms: nplurals=4; plural=n==1 ? 0 : n==2 ? 1 : n==0 || (n=3 
  n=10) ? 2 : 3;\n
 
  14 other forms or plural are available. These will be added to the
  translation site I had online for the project before. This will be coming
  back online in the next few weeks. They will also be added to the book,
 with
  corrections on the proper use of these functions soon. If you need the
  correct plural form before then, let me know and I can reply with it.
 
  --
  /**
  * @author Larry E. Masters
  * @var string $userName
  * @param string $realName
  * @returns string aka PhpNut
  * @access  public
  */
 
  On Tue, Oct 13, 2009 at 6:50 PM, Miles J mileswjohn...@gmail.com
 wrote:
 
   But you would need to make the english po file anyways if you are
   going to distribute it and have it translated.
 
   On Oct 13, 12:58 pm, Larry E. Masters aka PhpNut php...@gmail.com
   wrote:
So you are basically using these as defines?
--
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/
 
On Tue, Oct 13, 2009 at 2:19 PM, euromark (munich) 
 
dereurom...@googlemail.com wrote:
 
 i agree with miles
 
 they should be slugged, short and precise
 and explained in both the english and foreign .po file
 
 like
 
 regMessageSuccess
 and
 You have been successfully registered
 Sie sind nun erfolgreich angemeldet
 
 or
 valErrorRecordNameExists
 for
 A record with this name already exists
 
 this way you can easily change the original language text (here:
 english) without having to change all the x places in the script as
 well
 
 maybe it is now supposed to be
 You cannot have two records with the same name
 
 but the short slugged term has still the same basic meaning and
 therefore remains the same
 
 On 13 Okt., 18:12, Miles J mileswjohn...@gmail.com wrote:
  I am personal extremely against naming your ids the full
 sentence,
  what purpose does that serve? Its longer in both the .po and .ctp
   file
  and its a lot easier to reference slugs. To each his own I guess.
 
  On Oct 13, 7:42 am, Larry E. Masters aka PhpNut 
 php...@gmail.com
  wrote:
 
   Another thing I forgot to mention. You should be using full
 strings
   you
 want
   translated for the msgid.Example:
 
   msgid By registering on this web site you are...
 
   This is the way the core was designed to handle translations.
 You
   will
 also
   find it much easier for people to translate your application if
   they
 have
   everything they need in the 1 .po file vs looking for the text
   related

Re: Release: CakePHP 1.2.5

2009-10-01 Thread Larry E. Masters aka PhpNut
I do not, so that is why I no longer reply :)

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Thu, Oct 1, 2009 at 11:02 PM, Robert Popplewell r0b...@gmail.com wrote:

 I wonder if every other member of the CakePHP development team takes the
 time to reply to remarks made by all other end-users with such wit.

 2009/10/2 mark_story mark.st...@gmail.com


 George,

 Sorry to hear you're miffed, but I made a mistake in packaging 1.2.5
 so the version number printed when running shells reads 1.2.4.8284.
 While the VERSION.txt reads 1.2.5.  So if you want to be mad at
 someone be mad at me.  As for other things missing, there is nothing
 that I'm aware of.  As the version number changes are the last changes
 made before packaging. I'll try to do better in the future, sorry for
 all the confusion and anguish this has caused you.

 -Mark


 On Oct 1, 9:07 pm, George H acher...@gmail.com wrote:
  I'm a little miffed that there's no word from any developers about the
  issue above -- either through here, twitter or CakePHP Bakery.
 
  My main concern is that the release notes for this version state that
  a change has been made (the version number for example) but the
  download package doesn't have that change applied – if this particular
  change hasn't been delivered, what else is missing from this version?
  I know it's just a version number but it makes me think what else is
  missing from 1.2.5 that should be there according to the release
  notes.
 
  On Sep 15, 10:46 am, euromark (munich) dereurom...@googlemail.com
  wrote:
 
 
 
   the nightly build does not have the date problems
   so i guess this was an error on building the official release
 
   the version number is still 1.2.4 in the nightly as well though
 
   On 15 Sep., 01:45, frsp forpo...@gmail.com wrote:
 
Yes, it is a bit strange
 
 * @version   $Revision$
 * @modifiedby$LastChangedBy$
 * @lastmodified  $Date$
 
and return $config['Cake.version'] = '1.2.4.8284'; for cake 1.2.5
 
Any comments from developers?
 
On Sep 10, 5:53 am, George H acher...@gmail.com wrote:
 
 Good going with the release of 1.2.5! I've already downloaded and
 installed it.
 
 However, I noticed that the version reported is still 1.2.4.8284.
 Are
 you sure this is a clean commit to the code base? Commit
 [e693e881e05dba168f49d14ab657dbff2b2f9c88] in the changelog says
 that
 the version number was updated, but this doesn't seem to be the
 case
 for me. Also, the $ macros in each PHP script in the top comments
 (stuff like $Id$ and $Revision$) are all blank / default, and not
 the
 actual data that should be in there.
 
 FWIW, I downloaded the .tar.bz2 distribution from here:
 http://cakeforge.org/frs/download.php/733/cake_1.2.5.tar.bz2



 


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Enterprise Level App using cakephp

2009-09-24 Thread Larry E. Masters aka PhpNut

 Is anybody use cakephp for developing an Enterprise Level
 Application?


Yes.


 and What Kind of App was developed?


A big one.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Internationalization

2009-08-17 Thread Larry E. Masters aka PhpNut
It is __(); notice the double underscore.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Mon, Aug 17, 2009 at 3:52 PM, RhythmicDevil rhythmicde...@gmail.comwrote:


 Hi,
 I am trying to understand how to get internationalization to work in
 CakePHP. After reading the docs and searching around, looking at
 Teknoid and some other place this is what I am left with.

 CakePHP has a class I18n that handles the loading of the correct
 string from a .po file based upon the language locale setting.

 CakePHP has a console app that supposedly will read all the strings in
 your view files and create language files for you.

 I wrap my string ids in _() which will return the msg for that id.

 I can use POEdit to create my files.


 Given that. I created one message and placed it in the default.po file
 for English. I then used the translator function for the heading on my
 login page. However when I start the app it simply fails and tells me
 that _()  is an undefined function.

 Here is the content of my controller:

 class SubscribersController extends Controller
 {
public $helpers = array ('Form', 'Html', 'Javascript');
public $components = array ('DataPrep');

public $SubscriberId = null;

public function login()
{
$this-pageTitle = 'Please Login';
$this-layout = 'login';
$this-SubscriberId = $this-params['data']['Subscriber']
 ['SubscriberId'];
$this-log('Login attempt with SubscriberId: '.$this-
 SubscriberId, Configure::read('APP_LOG'));
$subscriber = $this-Subscriber-QuerySub($this-
 SubscriberId);
if ($subscriber-resultCode == 0)
{
$this-Session-write('Subscriber', $subscriber-
 querySubRsp);
//debug($this-Session-read('Subscriber'));
$this-redirect( array ('controller'='subscribers',
 'action'='basics'));
}

}
 

 Here is the content of my View file:

 div class=grid_6nbsp;/div
div class=grid_4 style=margin-top:200px; background:#FFF;
div style=text-align:center; font-weight:bold;?php
 _(Please
 Login); ?/div
div style=padding:20px;

?php
echo $form-create($options = array('action' =
 'login'));
echo $form-input('Subscriber.SubscriberId');
echo $form-button('Login', array('type'='submit',
 'class'='button'));
echo $form-end();
?
/div
/div
 div class=grid_6nbsp;/div


 Here is the content of my default.po file that is in the directory /
 app/locale/eng/LC_MESSAGES/

 msgid 
 msgstr 
 Project-Id-Version: \n
 POT-Creation-Date: \n
 PO-Revision-Date: \n
 Last-Translator: Steven Wright swri...@etisoftware.com\n
 Language-Team: \n
 MIME-Version: 1.0\n
 Content-Type: text/plain; charset=iso-8859-1\n
 Content-Transfer-Encoding: 8bit\n

 msgid Please Login
 msgstr Please Login



 1) I am assuming I need to tell Cake to use I18n. But how? Is it a
 component, a helper?
 2) Does my .po file look correct?
 3) Am I on the right path?

 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: nightly build failed

2009-08-08 Thread Larry E. Masters aka PhpNut
Should be working now, I have not had time to replace the SSL cert on the
server after it expired so the nightly build would fail with the svn export.
-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Aug 8, 2009 at 8:59 AM, Benjamin Moses Lieb r...@pixelearth.netwrote:


 Same here

 On Aug 4, 5:07 pm, Marcelo Andrade mfandr...@gmail.com wrote:
  Hi all,
 
  I'm trying to download today's CakePHP 1.2nightlybuild
  fromhttp://cakephp.org/downloads/nightly/1.2.x.xand
  getting an empty folder on decompressing it.  The file size
  is about only 20 bytes.
 
  Best regards.
 
  --
  MARCELO DE F. ANDRADE
  Belem, PA, Amazonia, Brazil
  Linux User #221105
 
  http://mfandrade.wordpress.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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Tinyints cause big problems

2009-06-01 Thread Larry E. Masters aka PhpNut
I know this is documented and it is part of the CakePHP conventions.
Maybe it is time to upgrade your 1.44 floppy to something like a zip drive?

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Mon, Jun 1, 2009 at 5:49 PM, adallas alastair.dal...@gmail.com wrote:


 I just tracked a bug through Cake's Model code (specifically, model/
 datasources/dbo_source.php). I was shocked at how small the scope of
 the problem turned out to be.

 My find('all'...) included a condition, Model.fld = 3. The results
 were wrong and after some wasted time, I saw that the generated SQL
 included Model.fld = 1. Cake wasn't just adding some identity
 condition; or if it was, it was throwing my condition away. It's a
 complicated model (Model, in this case, has 9 associations). I assumed
 it had something to do with that, but it did not.

 Cake thinks that Tinyints are booleans. Cake parses and reconstructs
 your conditional phrases. Put those two facts together, and you see
 that Model.fld = 0 will work. Model.fld = 1 will work.  Model.fld = 2
 will morph into Model.fld = 3.

 One solution is to use ints instead of tinyints. Ints take 4 bytes per
 record, tinyints take 1. I can't bring myself to waste the space
 without a good reason. I suppose that's the Cake way--if you'll be
 treating the field like an ordinary int, use an ordinary int type.

 The solution I used was the result of carefully plodding through the
 dbo_source code--I override Model::getColumnType(). You can force any
 type for a given key. The code is:

public function getColumnType($key)
{
if ($key == 'MyModel.fld') {
return 'integer';   // not 'int'
}
return parent::getColumnType($key);
}

 I hope it helps someone avoid some debugging.

 /alastair/

 

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Tinyints cause big problems

2009-06-01 Thread Larry E. Masters aka PhpNut
 Ok. Trying to save some bytes is old school. But I know this is
 documented? Why waste the time typing it if you can't cite a source?
 Where is it documented, and for that matter where are these imaginary
 CakePHP conventions documented?



http://book.cakephp.org/view/68/Creating-Database-Tables

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/




 The cookbook mentions tinyint only the context of forms. The api is
 silent. Golding (Beginning CakePHP) and Chan/Omokore (Practical
 CakePHP Projects) don't have tinyint in their indexes.

 You might have been referring to trac ticket #1253, which described
 the bug I ran into. It was written up three years ago, in some detail,
 but was promptly closed by Nate, who wrote Cake interprets MySQL
 tinyint(1) fields as virtual boolean fields, which can only have a
 value of 0 or 1 (true or false). Use a different column type if you
 don't want this behavior. In March 2008, another user tripped on the
 same problem and wrote ticket #3903. Nate closed that, too. Google
 'cakephp tinyint'--4,120 hits, many of them developer blogs trying to
 help others over this speed bump.

 I'm fairly new to Cake. Do I need to comb through the set of things
 that real users thought were bugs to find the pearls of wisdom by
 which the Cake developers explained their disinterest in fixing them?
 Seriously, is this what you meant when you said you knew this was
 documented?

 Thanks, Mark and Larry, for welcoming me to Cake land.

 /alastair/

 On Jun 1, 4:09 pm, Larry E. Masters aka PhpNut php...@gmail.com
 wrote:
  I know this is documented and it is part of the CakePHP conventions.
  Maybe it is time to upgrade your 1.44 floppy to something like a zip
 drive?
 
  --
  /**
  * @author Larry E. Masters
  * @var string $userName
  * @param string $realName
  * @returns string aka PhpNut
  * @access  public
  */
 
  On Mon, Jun 1, 2009 at 5:49 PM, adallas alastair.dal...@gmail.com
 wrote:
 
   I just tracked a bug through Cake's Model code (specifically, model/
   datasources/dbo_source.php). I was shocked at how small the scope of
   the problem turned out to be.
 
   My find('all'...) included a condition, Model.fld = 3. The results
   were wrong and after some wasted time, I saw that the generated SQL
   included Model.fld = 1. Cake wasn't just adding some identity
   condition; or if it was, it was throwing my condition away. It's a
   complicated model (Model, in this case, has 9 associations). I assumed
   it had something to do with that, but it did not.
 
   Cake thinks that Tinyints are booleans. Cake parses and reconstructs
   your conditional phrases. Put those two facts together, and you see
   that Model.fld = 0 will work. Model.fld = 1 will work.  Model.fld = 2
   will morph into Model.fld = 3.
 
   One solution is to use ints instead of tinyints. Ints take 4 bytes per
   record, tinyints take 1. I can't bring myself to waste the space
   without a good reason. I suppose that's the Cake way--if you'll be
   treating the field like an ordinary int, use an ordinary int type.
 
   The solution I used was the result of carefully plodding through the
   dbo_source code--I override Model::getColumnType(). You can force any
   type for a given key. The code is:
 
  public function getColumnType($key)
  {
  if ($key == 'MyModel.fld') {
  return 'integer';   // not 'int'
  }
  return parent::getColumnType($key);
  }
 
   I hope it helps someone avoid some debugging.
 
   /alastair/
 

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



imap_open causes Debugger Error

2009-05-12 Thread Brad V. aka iBspoof

When trying to use imap_open() command with CakePHP either r8120 or
r8166 when debug is set to 1 or 2 I get the following error:

Fatal error: Class 'Debugger' not found in ../cake/libs/debugger.php
on line 169
#   TimeMemory  FunctionLocation
1   0.1322  1828636 Debugger-handleError( )../debugger.php:0

The same issue happens if I suppress errors on imap_open ala @imap_open
().  Anyone have any suggestions?

I checked Trac and found and old bug (https://trac.cakephp.org/ticket/
3057) that was updated 2 years ago, but nothing mentioning a specific
conflict with imap_open().

Best,
Brad

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cake 1.2 Auth component not logging in

2009-03-03 Thread aka

Thing is that it does seem to work when my salt is empty... As
mentioned before this is a new installation of both cake and the db.
Really maddening!!


On 27 feb, 17:00, Xoubaman xouba...@gmail.com wrote:
 User table got username and password?

 Beforefilter ir correct?

 Do you allow the public actions in your controller?

 Auth is tricky, but following the tutorial step by step should work.

 On Feb 27, 4:40 pm, aka marcelgre...@gmail.com wrote:

  I keep running in to this problem over and over again.

  Whenever I implement the cakephp 1.2 Auth component I can'tlogin(and
  yes, I'm sure thelogincredentials are right). The password is saved
  with the sha1 algorithm and the salt value has been changed. New cake
  installation + a new database (workflow: setting up the db + tables,
  using the cake console to bake the necessary m/c/v's ) But when ever I
  try to log in I get the 'Loginfailed. Invalid username or password.'
  message.

  Really hope someone can help me out here!
  Thanx
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



cake 1.2 Auth component not logging in

2009-02-27 Thread aka

I keep running in to this problem over and over again.

Whenever I implement the cakephp 1.2 Auth component I can't login (and
yes, I'm sure the login credentials are right). The password is saved
with the sha1 algorithm and the salt value has been changed. New cake
installation + a new database (workflow: setting up the db + tables,
using the cake console to bake the necessary m/c/v's ) But when ever I
try to log in I get the 'Login failed. Invalid username or password.'
message.

Really hope someone can help me out here!
Thanx
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Are we using the slowest PHP framework there is?

2009-02-19 Thread Rafael Bandeira aka rafaelbandeira3

We can't forget that even not using $uses, when loading a Model it
will construct all its links, and its link will construct all of their
links, and so forth...
So, anyway, you are most probably going to load each and every model
by just loading a single one - even though they might have nothing to
do with the request.

On Feb 18, 11:15 am, mark_story mark.st...@gmail.com wrote:
 On Feb 17, 8:35 pm, Motin fredrik.mo...@gmail.com wrote:



  CakePHP does have some issues with aggressive loading, and have
  terrible performance in a lot of areas, but that benchmark, doesn't
  really measure anything regarding to Yii. Because of Yii's lazy
  loading, practically none of the commonly used objects/classes are
  loaded in the test application. This makes it practically the same as
  barebones PHP. However, in a real application, when the helpers and
  models are actually used (and thus loaded), I think the results would
  look much different.

  Also, CakePHP is meant to be run with a non-file-based cache engine +
  a php accelerator.

  Still, I believe that Yii is much faster for slimmed down
  applications, and I really hope that CakePHP can learn something from
  the lazy loading parts (why on earth does Cake load _all_ models in
  $uses on each request - instead of when they are actually used? for
  instance).

 Well PHP4 is one reason.  Lazy loading doesn't work so well in PHP4,
 also using $uses is known to cause performance issues as you end up
 loading far too many models.  You ask about why cake doesn't lazy
 load, but by using $uses you are doing the opposite of lazy loading.
 $uses is probably the most aggressive loading strategy you can
 implement.  Using Controller::loadModel() or ClassRegistry::init() is
 a more _lazy_ approach.

 -Mark
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: implementing keyboard shortcuts

2009-01-29 Thread Brad V. aka iBspoof

MichTex-

I have used this before with great success: http://code.google.com/p/js-hotkeys/

Works with jQuery.

Brad

On Jan 29, 12:18 pm, MichTex bill.cav...@gmail.com wrote:
 Has anyone implemented keyboard shortcuts (hotkeys) for CakePHP
 applications? I'm looking for real, single-key shortcuts, such as
 Gmail and Google Reader provide, and not the multi-key shortcuts
 (i.e., using the Alt or control keys) which the HTML accesskey
 attribute gives you.

 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Loading models within the controller action

2009-01-10 Thread Brad V. aka iBspoof

Miles-

Try -

App::import('Model', _insert_model_name);

Brad

On Jan 10, 6:08 pm, Miles J mileswjohn...@gmail.com wrote:
 In one of my controllers, I use nearly 10-15 models. The problem is
 that I dont need all these models, each model is respective to a
 certain action and loading all these models seems like it would be
 heavy and load slowly.

 So I tried doing many variations of this in the action:

 $this-uses = 'Friend';
 $this-uses[] = 'Friend';
 $this-uses = array('Friend');

 But none of that works, but im guessing its because models are loaded
 before the action. Now all I ask is if there is a way to load certain
 models depending on different actions, instead of loading them all.

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Issue when saving HABTM form on RC4

2008-12-19 Thread Larry E. Masters aka PhpNut
Martin,
Join tables do not, and should not require a separate primary key (id)
unless you are storing additional data on the table, which in this case it
is no longer just a join table. I fixed the bug related to that issue
https://trac.cakephp.org/changeset/7918

tekcomp,

You need to write a test case and diff against core model.test.php and open
a ticket http://book.cakephp.org/view/759/Bugreport

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Fri, Dec 19, 2008 at 8:48 AM, Martin Westin
martin.westin...@gmail.comwrote:


 Hi,
 Looks like you have fallen victim to the same thing I did (when RC3
 came along)... thinking that Cake would continue to work with join-
 tables that have a composite pk. It was made clear to me in no
 uncertain terms that a join-table must now have a separate primary key
 (id).

 Martin



 On Dec 19, 11:08 am, tekomp btisch...@gmail.com wrote:
  I left out the full debug of the warning by mistake.  Here is that:
 
  Warning (2): Cannot modify header information - headers already sent
  by (output started at /www/example.com/cake/basics.php:111) [CORE/cake/
  libs/controller/controller.php, line 615]
 
  Code | Context
 
  $status =   Location:http://example.com/websites;
 
  header - [internal], line ??
  Controller::header() - CORE/cake/libs/controller/controller.php, line
  615
  Controller::redirect() - CORE/cake/libs/controller/controller.php,
  line 596
  PaysitesController::add() - APP/controllers/websites_controller.php,
  line 29
  Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
  Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
  Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
  [main] - APP/webroot/index.php, line 88
 


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can a model belong to and habtm one model?

2008-12-12 Thread Rafael Bandeira aka rafaelbandeira3

yes you can, just assign different aliases like 'Owner' and
'OwnerFriends'

eagerterrier wrote:
 I have a facebook type app that I need to build for a client (don't we
 all?) and in it I have a model that ideally needs to be owned by one
 user, and also habtm other users (the owners friends)

 Before I go too far, I want to know if this approach is possible, or
 should I just stick another field in the habtm join table that is
 something along the lines of is_owner (boolean)

 Is this crossing the streams in Ghostbusters, or is it something very
 run of the mill that I just haven't done yet (8 cake sites under my
 belt and counting...)
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: REgarding using Mysql functions like NOW(), CURDATE() etc

2008-11-29 Thread Rafael Bandeira aka rafaelbandeira3

 Finally if you are hopping that cake allow you to make mysql function calls
 inside a query you should read thishttps://trac.cakephp.org/ticket/5345as 
 stateted that it would actually
 make SQL injection a *feature


Notice that every user input should be properly sanitized and escaped
if you plan to use it as a SQL expression with DboSource::expression
().
So, as you can see in my article, you can use SQL functions like this:
// inside the model scope
$db = $this-getDataSource();
$this-data[$this-alias]['signedup'] = $db-expression('CURDATE()');

but be aware that expressions won't be automatically escaped so you
need to it manually with DboSource::value() :
$db = $this-getDataSource();
$expression = sprintf(CONCAT('[', %s, ']'), $db-value($userInput));
$this-data[$this-alias]['signedup'] = $db-expression($expression);

hope it's somewhat clarifying

Rafael Bandeira rafaelbandeira3
rafaelbandeira3.wordpress.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: multiple [controllerName].po files + normal core.po?

2008-11-28 Thread Rafael Bandeira aka rafaelbandeira3

 PS a controller should itself have very few __ calls (only flash messages) ...

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



Re: What you people use: Browser based automated tests or Cake's Inbuilt lib?

2008-11-27 Thread Rafael Bandeira aka rafaelbandeira3

 BTW, I did tested Daniel's code before, It was not of much help, as it
 didn't worked out with latest versions. And I think no one is using it
 right now.

are you sure? He just pushed SeleniumHelper to github

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



Re: What you people use: Browser based automated tests or Cake's Inbuilt lib?

2008-11-27 Thread Rafael Bandeira aka rafaelbandeira3

... forgot the last paragraph:

and he is always giving support over cakebaker.42dh.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: HABTM pagination

2008-11-27 Thread Rafael Bandeira aka rafaelbandeira3


 $this-set('filters',$this-Listing-Cuisine-find('all',array
 ('conditions'=array('Cuisine.id'=$searchby))), $this-paginate());

what is it supposed to do?

I think that what you really want to do is:

// in the controller
$this-set('filter', $this-paginate());

--~--~-~--~~~---~--~~
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: HABTM pagination

2008-11-27 Thread Rafael Bandeira aka rafaelbandeira3



grigri wrote:
 @Markus and Rafael

Oh come on... I wasn't asking, I was answering... the code supplied by
the thread author is invalid, and I pointed it out. Every method
presented since then is just 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: JQuery and AjaxHelper

2008-11-27 Thread Rafael Bandeira aka rafaelbandeira3

 I was wondering if there is anyway in order to still use the Ajax
 helper (I don't really want to write all the code to implement it
 everytime) while using JQuery instead of Prototype and Scriptaculous?

No. There's no way of doing this. AjaxHelper only spits code based on
Prototype and Scriptaculous, it does nothing more than this. If you
want something to spit code based on JQuery, you need either code your
own helper or search google for existing ones - there are some.
In my opinion:
- Javascript should be coded as such, so, why not to write the code on
a proper file and load it?
- If you still want it to be done on PHP - with a helper - do not go
for one. Write your own.
--~--~-~--~~~---~--~~
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: calling exit() after redirect STILL redirects

2008-11-27 Thread Rafael Bandeira aka rafaelbandeira3

 Deleting this key solved the problem.

instead of deleting the session key, why don't you set the right url
on AuthComponent::$loginRedirect?

$this-Auth-loginRedirect = array('controller' = 'user', 'action' =
'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: Agregating multiple databases

2008-11-26 Thread Rafael Bandeira aka rafaelbandeira3


For sure that's a way to do that.

 Can I create a model that will show me a list of all users in Ohio and
 Kentucky?


Are both dbs on same host and can they be accessed by same app's db
client and therefore be used in a same sql query?

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

2008-11-23 Thread Rafael Bandeira aka rafaelbandeira3

 On the front-page of my application I want to be able to display
 numerous other views. For example I may want to display a view of my
 pages controller (for example a welcome message), and a view from my
 calendar controller.

 How would I do this?

use View::element(), as such:

$this-element('../controller_name/view_name');
--~--~-~--~~~---~--~~
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 auth help (for a cake newbir)

2008-11-20 Thread Rafael Bandeira aka rafaelbandeira3

the easiest way to get you on the path to the success is: quit CI and
all other non-logic based framework out there.
you little heretic man...
;-)
--~--~-~--~~~---~--~~
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 auth help (for a cake newbir)

2008-11-20 Thread Rafael Bandeira aka rafaelbandeira3

It's important to know what's out there!
Totally agreed, I've done it before. The conclusion: almost every
other framework is a) ugly and/or b) unlogical and/or c) useless and/
or d) too complex for it's too unsensible featurity.
And yes. CI is totally unlogical and bloated with lots of crap
features and outstanded comunity members that think they own the php
market just because they are sponsored by a huge corp.

It's not that I'm a cake fan. Ok, I might be, but not for it's name or
features. Cake glues all the pieces in a logical, flexible, elegant
and tangible way. The code talks by itself.
--~--~-~--~~~---~--~~
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: Named parameters VS $_GET

2008-11-20 Thread Rafael Bandeira aka rafaelbandeira3

Although I think you just specified and went deeper on what I roughly
said, I think you said it very well a very elegant explanation. 5
stars for you

On 20 nov, 15:29, Smelly_Eddie [EMAIL PROTECTED] wrote:
 I think there is a little more to it than that.

 Most search engines ignore anything after ? (query string)

 This can be useful or detrimental depending on your situation.

 If you are passing around trivial data like session ids or something
 that doesn't physically alter the page, I would stick with query
 strings. This prevents engines like Google from seeing 'duplicate'
 content which lowers your page rank.

 If you used
 /posts/view/trivial:875783
 Google would see each different number as a unique page, but notice
 the exact same content.

 If you use
 /posts/view/?trivial=894894
 Google will treat all as the base url - /posts/view/, and only index
 it as 1 page.

 So if your passing in a search word, you might want to use named
 variables since a search for cats should be very different that a
 search for dogs.

 If you passing in encrypted data or something that has no direct
 impact on the pages content, you might instead choose query strings.

 Hope that helps,
 EW

 On Nov 19, 4:55 am, Rafael Bandeira aka rafaelbandeira3

 [EMAIL PROTECTED] wrote:
  Query strings are evil for seo. That's 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: Named parameters VS $_GET

2008-11-19 Thread Rafael Bandeira aka rafaelbandeira3

Query strings are evil for seo. That's 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: Mambo on CakePHP brainstorm

2008-11-19 Thread Rafael Bandeira aka rafaelbandeira3

What I see a lot is people looking for a admin backend that actually
works.
A CMS just for the MS.
I think that a fashion way of delivering data to views, and a good UI
work on admin end is what people really seek.
Modularity and extensibility are huge pluses - but not strictly
necessary.
--~--~-~--~~~---~--~~
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: Fatal error: Maximum execution time of 30 seconds exceeded

2008-11-14 Thread Rafael Bandeira aka rafaelbandeira3

Tópicos em português devem ser postados no fórum pt-br.
ok?
--~--~-~--~~~---~--~~
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 Validation - 'blank' rule triggered without beeing set

2008-11-13 Thread Rafael Bandeira aka rafaelbandeira3


 triggered? And how can i avoid it without changing the cakecore?

set the 'rule' key on $validate for each field, and specify the rule
you want it to follow, when a validation
scheme is set on $validate but no rule is specified, the 'blank' rule
is assumed.
Please refer to the cookbook for more information on validation, we
got lots of information there.
btw, your TRUE shouldn't be enclosed in an array, it should be 
'required' = true .

 $this-exists();
 What effect does this call have in this context? As far as i see, the
 call returns a boolean to the void o_O ?

Model::exists() caches the returned value in a private var - Model::
$__exists - and that's the used in the rest of the method to test the
record existence.
--~--~-~--~~~---~--~~
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: How to dynamically load controller based on field in database.

2008-11-13 Thread Rafael Bandeira aka rafaelbandeira3



On 13 nov, 03:53, Nick [EMAIL PROTECTED] wrote:
 Basically I am using wildflower cms which is built on cakephp.
 It routes are setup so that / goes to the pages controller.
 I am building a product catalog and could simply have the urls be /
 products/category/product-name
 however I do not want to prepend the controller name in this scenario.
 Right now I have it so that the product controller from the admin side
 will insert rows into the pages table as products are created in the
 products table.  Also I created a field in the pages table called
 controller. By default it is blank however what I want to do is if
 it isn't blank and for example has Products in it then I want to
 load the Products controller from within the Pages controller so that
 it can handle pulling the product images, pricing, etc...

 I want the controller to be dynamically called.

That's a terrible idea, would cost you so much in performance,
maitainability and logic.
I think you should re-think your design principles, trying to keep it
a little more simple and tided to a rule.
Maybe moving some logic to the model side - Fat Model, Skinny
Controller - you could dynamically load a Model class,
wich would make much more sense and would be much lighter. You'd only
have to create a pattern for your models so that they
could be easily used by the same controller - like an interface.
--~--~-~--~~~---~--~~
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: HABTM Model::save() or Model::__saveMulti() seems to be broken :-/

2008-11-12 Thread Rafael Bandeira aka rafaelbandeira3

 Model.[0].[key]='a'
 Model.[0].[key]='b'
 Model.[0].[key]='c'

what is it?
the structure should be like this:

$data['HABTMModel']['HABTMModel'] = array(
array('HABTMAssociationForeignKey' = 1),
array('HABTMAssociationForeignKey' = 2),
array('HABTMAssociationForeignKey' = 3)
);

and if you need to include more fields, you can then include them.

--~--~-~--~~~---~--~~
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: HABTM Model::save() or Model::__saveMulti() seems to be broken :-/

2008-11-11 Thread Rafael Bandeira aka rafaelbandeira3

Model::__saveMulti() was changed in the last few days due to a bug,
new tests were added, and everything seems to be working just as
expected.
The problem is that the data format you are using is only supported by
numeric ids and uuids, being processed only if it's values are 36 char
long or numerical.
Refer to the api on Model::__saveMulti() to see where it breaks the
save process and to test cases to see usage cases, and consider using
common data sets, remember that primary keys shouldn't be used as
informative fields, so try to stick to auto incremental integers or 36
chars uuids.
--~--~-~--~~~---~--~~
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: HABTM Model::save() or Model::__saveMulti() seems to be broken :-/

2008-11-11 Thread Rafael Bandeira aka rafaelbandeira3

Forgot to mention, if you just want to keep your tables as they are,
refer to #5722¹ to see the correct data set format to use.
¹ - https://trac.cakephp.org/ticket/5722#comment:2
--~--~-~--~~~---~--~~
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: Fatal error Call to undefined method Controller Html()

2008-10-31 Thread Rafael Bandeira aka rafaelbandeira3

 ?php echo $html-link('Activate  account',
 array('controller'='users', 'action' = 'activate', $userid); ?
 
^
it's missing a close bracket here -^

anyway:

 Is there a way the above can be used to print out an absolute url ?

$html-link('Activate  account', $html-
url(array('controller'='users', 'action' = 'activate', $userid),
true));
or
$html-link('Activate  account',
Helper::url(array('controller'='users', 'action' = 'activate',
$userid), true));
or
$html-link('Activate  account',
Router::url(array('controller'='users', 'action' = 'activate',
$userid), true));

-the boring explanation:
  you can use Router::url/Helper::url passing true as the second param
to get the full route out of the url you passed in the first param.
  in case you ever extend Helper::url on AppHelper, use $html-url()
to use the overrided method.

LAST BUT CERTAINLY NOT LEAST,
CakePHP has documentation and API specifications that cover this
feature, please refer to http://api.cakephp.org and http://manual.cakephp.org
as often as possible to get in touch with all the features, power and
might and magic of CakePHP.

--~--~-~--~~~---~--~~
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: internazionalization | gettext not working on production server: any idea?

2008-10-15 Thread Larry E. Masters aka PhpNut
Unless you are using an old version of CakePHP this should have been
corrected months ago.
-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Wed, Oct 15, 2008 at 4:14 PM, cakeFreak [EMAIL PROTECTED] wrote:


 I finally got it:

 the production servers where 64bits servers, while the development
 were 32bits.

 Therefore, here we go: https://trac.cakephp.org/changeset/6149

 A small bug that caused the failure in loading the .mo files on 64bits
 machines!

 I'm really glad I found the problem, and I hope my post can help
 somebody else!

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



Ldap_source Addition

2008-10-13 Thread Brad V. aka iBspoof

I noticed there wasn't the ability to limit the fields in a hasMany,
hasOne, or belongsTo association in  LdapSource so I added one.  Below
is the code to replace generateAssociationQuery().  Make sure your
foreign key is within your limited fields if used.

function generateAssociationQuery( $model,  $linkModel, $type,
$association = null, $assocData = array (),  $queryData, $external =
false,  $resultSet) {
$this-__scrubQueryData($queryData);

switch ($type) {
case 'hasOne' :
$id = 
$resultSet[$model-name][$model-primaryKey];
$queryData['conditions'] = 
trim($assocData['foreignKey']) . '=' .
trim($id);
$queryData['targetDn'] = $linkModel-useTable;
$queryData['type'] = 'search';
if 
(!empty($linkModel-hasOne[$model-name]['fields'])) {
$queryData['fields'] = 
$linkModel-hasOne[$model-name]
['fields'];
}
$queryData['limit'] = 1;

return $queryData;

case 'belongsTo' :
$id = 
$resultSet[$model-name][$assocData['foreignKey']];
$queryData['conditions'] = trim($linkModel-
primaryKey).'='.trim($id);
$queryData['targetDn'] = $linkModel-useTable;
$queryData['type'] = 'search';
$queryData['limit'] = 1;
if 
(!empty($linkModel-hasMany[$model-name]['fields'])) {
$queryData['fields'] = 
$linkModel-hasMany[$model-name]
['fields'];
}
return $queryData;

case 'hasMany' :
$id = 
$resultSet[$model-name][strtolower($model-primaryKey)];
$queryData['conditions'] = 
trim($assocData['foreignKey']) . '=' .
trim($id);
$queryData['targetDn'] = $linkModel-useTable;
$queryData['type'] = 'search';
$queryData['limit'] = $assocData['limit'];
if 
(!empty($linkModel-belongsTo[$model-name]['fields'])) {
$queryData['fields'] = 
$linkModel-belongsTo[$model-name]
['fields'];
}
return $queryData;

case 'hasAndBelongsToMany' :
return null;
}
return null;
}

--~--~-~--~~~---~--~~
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: HABTM Belongs_To Together?

2008-10-11 Thread Larry E. Masters aka PhpNut
Helps to read the manual:

http://manual.cakephp.org/view/79/Relationship-Types
...however, aliases must be unique both within a single model and on both
sides of a belongsTo/hasMany or a belongTo/hasOne relationship. Choosing
non-unique names for model aliases can cause unexpected behavior.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Oct 11, 2008 at 6:59 PM, [EMAIL PROTECTED] wrote:


 Ok yea i am not sure abt the first part but David was right the
 debuging is impossible.

 On 10/11/2008, David C. Zentgraf [EMAIL PROTECTED] wrote:
 
  A HABTM relationship will fetch data differently then a belongsTo
  relationship.
  HABTM will get you an array with multiple results, belongsTo just a
  flat array.
  $habtm = array(
[0] = array(['id'] =, ...),
[1] = array(['id'] =, ...)
  )
  $belongsTo = array(['id'] =, ...)
 
  When you specify multiple associations, you'll have to specify unique
  names for them.
  var $belongsTo = array(
'Owner' = array(...)
  );
  var $hasAndBelongsToMany = array(
'Users' = array(...)
  );
 
  You shouldn't/can't mix different associations under the same name.
  Your output is screwed up because you're mixing the flat array with
  the multi array. You can either fix that manually (also see Set
  Class) or just keep it simple and name your associations properly.
  BTW, your debug output is virtually impossible to read, use
  debug($array) or pr($array) to spot these kinda things a lot easier.
 
  On 11 Oct 2008, at 23:58, Keith wrote:
 
 
  Hi Villas,
 
  I tried clearing out the cache and that didn't fix it unfortunately.
 
  I have the max debug level set.  The code appears to be operating as
  programmed.
 
  I tried a simple habtm with belongs_to in a scenario where I only had
  those two models and still got the same results.
 
  I think it's a problem with how CakePHP is creating the array.  The
  first element in the array has no numeric identifier.  If you look
  back at the screenshot in the initial post you'll see that the first
  entry in the array is not [0] but rather is called [id] as it would be
  when there is a belongs_to and not a HABTM as well.
 
  Unless I can figure something out I'm going to go ahead and just
  report it to cakePHP as a bug because there are legit reasons, like
  the one I'm building, where you'd want a habtm with a belongs_to in
  the same model.
 
  - Keith
 
  On Oct 11, 8:14 am, villas [EMAIL PROTECTED] wrote:
  Hi Keith
 
  Thanks for the extra info although it still isn't very clear to me
  from that what's going on.  However,  I would mention:
  1. Are you clearing your cache?  You might have old data hanging
  around.
  2. Did you try to set a higher debug level to get more info?
  3. Did you try to experiment with Bake?  You can try different
  scenarios which you should be able to get working without too much
  sweat.
 
  Best regards.
 
  On Oct 11, 6:31 am, Keith [EMAIL PROTECTED] wrote:
 
  Just as a clarification on why I have it set up this way...
 
  The belongs_to is there because the users that creates the project
  becomes the owner.
  The has_and_belongs_to_many is there so that if a user wants someone
  outside their department to access it they can manually add them.
 
  The problem looks like it's stemming from how cakePHP is handling
  the
  array...
 
  for the belongs_to the array keys are based on field names like
  [id] 
  [first_name], etc.
  for the HABTM array the array keys are sequential as the related
  users foreach loop expects.
 
  - Keith
 
  On Oct 11, 1:18 am, Keith [EMAIL PROTECTED] wrote:
 
  It looks to me like this is what is happening, but it's very
  strange...
 
  Even when no users are associated I'm getting 8 blank associated
  users
  which is exactly how many elements are in the array...
 
  So...
 
  It looks like it's taking the first character from each part of the
  first entry in the array and putting it there...
  K = Keith = First Name
  M = Medlin = Last Name
  etc. for each of the fields.
 
  So...I'm totally confused why the following code would produce
  that:
 
  SQL Query:
  SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`,
  `User`.`email`, `User`.`date_created`, `User`.`last_login`,
  `User`.`username`, `User`.`password`, `ProjectsUser`.`user_id`,
  `ProjectsUser`.`project_id` FROM `users` AS `User` JOIN
  `projects_users` AS `ProjectsUser` ON
  (`ProjectsUser`.`project_id` = 1
  AND `ProjectsUser`.`user_id` = `User`.`id`) WHERE 1 = 1
 
  Which returns a normal looking data set in SQL...
 
  Relevant View Code:
  ?php
  $i = 0;
  foreach ($project['User'] as $user):
  $class = null;
  if ($i++ % 2 == 0) {
  $class = ' class=altrow';
  }
  ?
  tr?php echo $class

Re: HABTM Belongs_To Together?

2008-10-11 Thread Larry E. Masters aka PhpNut
Keith,
Bin you models and send the link to the bin in your email, I will show you
how to fix it.
http://bin.cakephp.org/add/Keith

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Oct 11, 2008 at 8:45 PM, Keith [EMAIL PROTECTED] wrote:


 So then...

 Does that mean that my problem is that I need to make my user_id in
 the projects table something like owner_id so that it won't get
 grouped in with the traditional habtm relationship that already exists
 with the user model?

 Thanks for the assistance.

 - Keith

 On Oct 11, 9:17 pm, Larry E. Masters aka PhpNut [EMAIL PROTECTED]
 wrote:
  Helps to read the manual:
 
  http://manual.cakephp.org/view/79/Relationship-Types
  ...however, aliases must be unique both within a single model and on
 both
  sides of a belongsTo/hasMany or a belongTo/hasOne relationship. Choosing
  non-unique names for model aliases can cause unexpected behavior.
 
  --
  /**
  * @author Larry E. Masters
  * @var string $userName
  * @param string $realName
  * @returns string aka PhpNut
  * @access  public
  */
 
  On Sat, Oct 11, 2008 at 6:59 PM, [EMAIL PROTECTED] wrote:
 
   Ok yea i am not sure abt the first part but David was right the
   debuging is impossible.
 
   On 10/11/2008, David C. Zentgraf [EMAIL PROTECTED] wrote:
 
A HABTM relationship will fetch data differently then a belongsTo
relationship.
HABTM will get you an array with multiple results, belongsTo just a
flat array.
$habtm = array(
  [0] = array(['id'] =, ...),
  [1] = array(['id'] =, ...)
)
$belongsTo = array(['id'] =, ...)
 
When you specify multiple associations, you'll have to specify unique
names for them.
var $belongsTo = array(
  'Owner' = array(...)
);
var $hasAndBelongsToMany = array(
  'Users' = array(...)
);
 
You shouldn't/can't mix different associations under the same name.
Your output is screwed up because you're mixing the flat array with
the multi array. You can either fix that manually (also see Set
Class) or just keep it simple and name your associations properly.
BTW, your debug output is virtually impossible to read, use
debug($array) or pr($array) to spot these kinda things a lot easier.
 
On 11 Oct 2008, at 23:58, Keith wrote:
 
Hi Villas,
 
I tried clearing out the cache and that didn't fix it unfortunately.
 
I have the max debug level set.  The code appears to be operating as
programmed.
 
I tried a simple habtm with belongs_to in a scenario where I only
 had
those two models and still got the same results.
 
I think it's a problem with how CakePHP is creating the array.  The
first element in the array has no numeric identifier.  If you look
back at the screenshot in the initial post you'll see that the first
entry in the array is not [0] but rather is called [id] as it would
 be
when there is a belongs_to and not a HABTM as well.
 
Unless I can figure something out I'm going to go ahead and just
report it to cakePHP as a bug because there are legit reasons, like
the one I'm building, where you'd want a habtm with a belongs_to in
the same model.
 
- Keith
 
On Oct 11, 8:14 am, villas [EMAIL PROTECTED] wrote:
Hi Keith
 
Thanks for the extra info although it still isn't very clear to me
from that what's going on.  However,  I would mention:
1. Are you clearing your cache?  You might have old data hanging
around.
2. Did you try to set a higher debug level to get more info?
3. Did you try to experiment with Bake?  You can try different
scenarios which you should be able to get working without too much
sweat.
 
Best regards.
 
On Oct 11, 6:31 am, Keith [EMAIL PROTECTED] wrote:
 
Just as a clarification on why I have it set up this way...
 
The belongs_to is there because the users that creates the project
becomes the owner.
The has_and_belongs_to_many is there so that if a user wants
 someone
outside their department to access it they can manually add them.
 
The problem looks like it's stemming from how cakePHP is handling
the
array...
 
for the belongs_to the array keys are based on field names like
[id] 
[first_name], etc.
for the HABTM array the array keys are sequential as the related
users foreach loop expects.
 
- Keith
 
On Oct 11, 1:18 am, Keith [EMAIL PROTECTED] wrote:
 
It looks to me like this is what is happening, but it's very
strange...
 
Even when no users are associated I'm getting 8 blank associated
users
which is exactly how many elements are in the array...
 
So...
 
It looks like it's taking the first character from each part of
 the
first entry in the array and putting it there...
K = Keith = First Name
M = Medlin = Last Name
etc. for each of the fields

Re: In controller using too many models hit the performance?

2008-10-11 Thread Larry E. Masters aka PhpNut
http://groups.google.com/group/cake-php/browse_thread/thread/93560397e44819e6/e69f61828e527664


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Oct 11, 2008 at 9:42 PM, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:


 Hi there,

 My controller includes eight models as follows,
 var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');

 When loading a view for the controller, it always DESCRIBE the above
 eight TABLES (models) even the action (view) has nothing to do with
 these tables. From the cakephp log on view, it is a big performance
 hit for me.

 Q:
 1. is this by design?
 2. how to reduce these queries?

 I didn't get much helpful info from internet and cakephp official
 site. I'd appreciate it if any help (or article link).

 Thanks,
 Bo
 

--~--~-~--~~~---~--~~
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: In controller using too many models hit the performance?

2008-10-11 Thread Larry E. Masters aka PhpNut
Should have added, refresh your page within 10 seconds and you should see
the caching does work.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Oct 11, 2008 at 9:42 PM, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:


 Hi there,

 My controller includes eight models as follows,
 var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');

 When loading a view for the controller, it always DESCRIBE the above
 eight TABLES (models) even the action (view) has nothing to do with
 these tables. From the cakephp log on view, it is a big performance
 hit for me.

 Q:
 1. is this by design?
 2. how to reduce these queries?

 I didn't get much helpful info from internet and cakephp official
 site. I'd appreciate it if any help (or article link).

 Thanks,
 Bo
 



-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

--~--~-~--~~~---~--~~
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: AppController being ignored

2008-10-10 Thread Larry E. Masters aka PhpNut
class EventsController extends Controller {
should be:

class EventsController extends AppController {


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Fri, Oct 10, 2008 at 10:09 AM, Fabricio Leonardo Sodano Pascazi 
[EMAIL PROTECTED] wrote:

 Thanks for the reply, here's my events controller

 ?php

 class EventsController extends Controller {

 var $name = Events;
 var $components = array('Upload','ImageRetriever');

 function admin_index(){

 $data = $this-Event-findAll();
 $this-set('data',$data);
 }

 function admin_list(){
 $data = $this-Event-find('list',
 array( 'fields' = array('name'), 'order' = 'name ASC',
 'recursive'='0' )
 );

 //print_r($x);
 return $data;
 }

 function admin_view( $id ){
 $this-Event-id = $id;
 $data = $this-Event-read();
 $this-set( 'data', $data );
 }

 function admin_search( $name = null ){

 if( !$name ){
 $name = $this-data['Event']['name'];
 }

 $data = $this-Event-findAll(Event.name LIKE '%$name%'
 COLLATE latin1_swedish_ci );

 $this-set( 'data', $data );
 $this-set( 'name', $name );
 }

 function admin_add(){
 if( $this-data ){
 if( $this-Event-save( $this-data ) ){

 $destination = realpath('../webroot/img/uploads/') .
 '/';
 $file = $this-data['Event']['image'];
 unset($this-data['Event']['image']);

 if( !$file['error'] ){
 $result = $this-Upload-upload(
 $file,
 $destination,
 'event_' . $this-Event-id .
 $this-ImageRetriever-getImageType($file)
 );

 if($this-Upload-errors){

 $this-Session-setError($this-Upload-errors);
 $this-redirect('/admin/events/edit/' . $id);
 exit();
 }
 }

 $this-redirect('/admin/events/');
 }

 }else{

 $this-set('places',$this-requestAction('/admin/places/list'));
 }
 }

 function admin_edit( $id ){
 $this-Event-id = $id;

 if( $this-data ){
 $destination = realpath('../webroot/img/uploads/') . '/';
 $file = $this-data['Event']['image'];
 unset($this-data['Event']['image']);

 if( !$file['error'] ){
 $result = $this-Upload-upload(
 $file,
 $destination,
 'event_' . $this-Event-id .
 $this-ImageRetriever-getImageType($file)
 );

 if($this-Upload-errors){
 $this-Session-setError($this-Upload-errors);
 $this-redirect('/admin/events/edit/' . $id);
 exit();
 }
 }

 if( $this-Event-save( $this-data ) ){
 $this-redirect('/admin/events/view/' . $id);
 }
 }else{
 $this-data = $this-Event-read();

 $this-set('places',$this-requestAction('/admin/places/list'));
 }
 }

 function admin_delete( $id ){
 $this-Event-del($id);
 $this-redirect('/admin/events');
 }

 }

 ?


 On Thu, Oct 9, 2008 at 9:37 PM, David C. Zentgraf [EMAIL PROTECTED]wrote:


 Paste your EventsController too...


 On 10 Oct 2008, at 00:06, Fibra wrote:

 
  Hello Everyone, how are you?
 
  I've read this issue in other posts but most of the solutions are
  becouse they've updated to a newer version.
 
  Since I just downloaded the latest stable version on cake,
  cake_1.2.0.7692-rc3.tar.bz2 I must ask for help.
 
  Here's the thing:
 
  I have my routing.admin turned on, and placed my app_controller.php
  under /app
 
  here's the code:
 
  ?php
class AppController extends Controller {
function __construct(){
die('wtf');
}
 
function beforeFilter(){
echo 'ok';
if (isset($this-params['admin'])) {
$this-layout = 'admin';
}
}
 
}
  ?
 
  Neither 'ok' or 'wtf' get printed once I access /admin/events, however
  they DO get printed when I access /admin, but that's becouse I forced
  to have the admin_layout like this:
 
  Router::connect('/admin', array('controller' = 'pages','layout' =
  'admin', 'action

Mozilla's Laura Thomson on The Show

2008-10-06 Thread Jeff Loiselle aka phishy

For those of you that missed Laura Thomson's presentation at CakeFest,
or left wanting to know more, we are pleased to announce that on
Wednesday October 22, 2008 6:00 UTC-4 she will be joining us on The
Show (http://live.cakephp.org). Laura has been working at Mozilla for
over a year now, and has been leveraging the CakePHP framework in many
high-visibility Mozilla projects, such as the Firefox Add-Ons portal,
and their new single sign-on initiative. Laura is a prolific speaker
and writer, as well as an active member of the Open Source community.
She has co-written the top selling PHP/MySQL book in the world, PHP 
MySQL Web Development (Sams, 4th Edition).  Mozilla has the largest
known installation of the CakePHP in the world.

Come join us to find out what Laura is all about, and to see what
insight she can offer from facing such scaling challenges as Firefox
Download Day.

We are taking questions in advance via Google Moderator.

http://moderator.appspot.com/#e%253Dagltb2RlcmF0b3JyDgsSBlNlcmllcxiz1QEM%252Bt%253Dagltb2RlcmF0b3JyDQsSBVRvcGljGI7UAQw%252Bv%253D0

We have also created a new Google Group to host show-specific
discourse. You may use this forum to suggest new topics or comment on
past shows.

http://groups.google.com/group/cakephp-live

Also feel free to join us on #cakephp-live on Freenode during the
broadcast to chat, however, if you would like to post a question,
please use to Google Moderator interface.

Regards,

Nate Abele (_nate_)  Jeff Loiselle (phishy)
The Governing Group of Awesomeness Responsible For The Show for
CakePHP
http://live.cakephp.org

Note: Special thanks go out to Christian Winther (Jippi) for providing
us with the most excellent Shoutcast servers that deliver the sweet
audio ambrosia that is The Show.
--~--~-~--~~~---~--~~
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 1.1, AJAX and forms not doing anything.

2008-09-30 Thread aka

Hi!

I have a controller, which fetches other controllers data through
requestAction().

The first element contains a form in which there is an $ajax-
submit(...);

the problem here is that the form does nothing. The form doesen't even
send XHR request.

However, the $ajax-link's works just fine and when I click one of the
links, resultin an update to the that element and then return back to
the original element the form starts to work.

Am I missing something? becouse this seems very odd.
--~--~-~--~~~---~--~~
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 1.1, AJAX and forms not doing anything.

2008-09-30 Thread aka

Yes Sorry clemos, was alittle tired on this afternoon.

Here is the question completely rewritten :)

1. Download the latest stable release of CakePHP (1.1.19.6305)
1.1 Set it up and running.

2. Download the prototype.js library and copy it to your fresh cake
installation js -folder.

3. Lets create the controller we need
3.1 create users_controller.php, source is here: 
http://bin.cakephp.org/view/228475902
3.2 create settings controller.php, source here: 
http://bin.cakephp.org/view/1561727948

4. Now we need some models too...
4.1 Let's create the user.php, source can be found here:
http://bin.cakephp.org/view/1560512038
4.2 Next we need the setting.php, get the source here:
http://bin.cakephp.org/view/325085541

5. We need three views as well... V for Views!
5.1 /users/index.thtml, source: http://bin.cakephp.org/view/227887042
5.2 /users/edit.thtml, source: http://bin.cakephp.org/view/1754502406
5.3 /settings/index.thtml, source: http://bin.cakephp.org/view/1797653162
view:settings/index

6. Let's modify the default layout a little (include the prototype
library and what not)
6.1 download this layout and save it under /views/layouts/test.thtml
(http://bin.cakephp.org/view/1757453857)

7. Now we are ready to begin testing...
7.1 browse to localhost/your/new/cake/installation/settings/
7.2 try to type something to the text field and press submit...
nothing happens. The browser doesen't send any XHR request.
7.3 click the link that says click me, this invokes an AJAX call
(which works BTW)
7.4 Click the link on that window again. That load the same view, that
we used in 7.1 and now the AJAX submit button works..

-Antti


prototype.js
--~--~-~--~~~---~--~~
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: To model or not to model

2008-09-25 Thread Rafael Bandeira aka rafaelbandeira3

  Still thinks that executing queries is needed?

 Yes. Sometimes You have uncommon database design, and You can't
 EFFECTIVELY receive data just by using standard, even magic, model

Definetly correct, my sentence wasn't much happy. I meant for the
cases he presented.
Anyway, keep in mind that you should - as a good design principle -
encapsulate hand made sql queries in Model methods,
so you'll avoid having data fetching logic in your Controller. And
take a good look at the built-in query structure, it covers lots of
usages
I got pretty complex queries for data reporting and they're all using
cake's query structure.

rafaelbandeira3
http://rafaelbandeira3.wordpress.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: class 'Routes' not found

2008-09-25 Thread Rafael Bandeira aka rafaelbandeira3

 class 'Routes' not found

You are mispelling Router somewhere in your application, probably on
app/config/routes.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: To model or not to model

2008-09-24 Thread Rafael Bandeira aka rafaelbandeira3

First of all people: what Rule? It's not made of rules, it's a pattern
to follow - but follow as you want.
Second, no, it doesn't break the Rule it only makes your code uglier
and hard to read - see above - but the thing is,
why to use a hand made query when you can easily/prettier/readablier
use Model built-in methods to accomplish the same?

About performing custom find methods, with default/mandatory/pre-
defined params you should read:

  
 http://rafaelbandeira3.wordpress.com/2008/08/28/the-new-way-to-define-find-methods/
  
 http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/

About the rules:
Even being annoying, executing hand made queries on the controller
still leaves all the data transaction and structuration on the Model
side,
and it lets the pattern intended to be followed intact, but it's not
the best practice. If even following the links presented - and links
cited inside them, you
still not find the solution for a more complex and featured query, try
to implement it inside a model method to make your controller cleaner:

$this-Model-find(where id=xyz)
becomes
$this-Model-find('axis', array('id' = 'xyz')); // following those
links
or
$this-Model-getByAxis($axis);

But in the specific case you presented, you could easily use Model
methods overload by calling $this-Model-findById($id), $this-Model-
findByFieldName($fieldValue);

Still thinks that executing queries is needed?

rafaelbandeira3
http://rafaelbandeira3.wordpress.com

 but i heared if you direct query in controller will violate the MVC
 rule

 i.e if you use $this-Model-query(select * from models);

 the above query will violate the MVC rule.

 i heared the queries shouldnotbe written in controller it should be
 inmodeli.e in urmodel.php

 even i am alsonotabsolute on this part

 On Sep 23, 2:33 pm, forrestgump [EMAIL PROTECTED] wrote:

  Hey guys,
   Considering the fact that CakePhp follows the MVC architecture, id
  like to know...y we dont make function calls such as $this-find(where 
  id=xyz) from function blocks typed out in Models rather

  than controllersim sure there is a logical reason to it...but
  someone asked me this question and i couldnotgive her a good enuf
  answerdoes making function calls to queries like find(), save()
  work better in models or controllers?.and is it good practice to
  pass conditions in your function call while using it in a controller?
  eg find(where id=1) ;

  Does using $this-find() in controller violate the MVC architecture in
  any manner?

  Can someone please clarify these question for us?

  Thanks in advance,
  forrestgump
--~--~-~--~~~---~--~~
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: bulk load data into CakePHP?

2008-09-24 Thread Rafael Bandeira aka rafaelbandeira3

Mike, I think it's not how much data is Cake intended to deal with
is how much data your app is intended to deal with,
thousands of records is not something that should be dealed by php,
the database does it much faster and safer.
Having lots of data in database doesn't mean you have to deal with
them always - I would say ever - because you would rarely want users
stumbling their heads on to a 800+ rows report,  I would say that
using a  30+ limit in a report/index is already annoying.
Now how do you intend to support thousands of records include in the
app database if not with a file upload? there's no way to make a user
fill more than three forms at once... And as the database can handle
files, al you have to do is parse the file if needed.

Cake loves you and will do lots of things for you, but it's still php
and still uses memory, relies on cpu process and all this stuff.

rafaelbandeira3
http://rafaelbandeira3.wordpress.com

On 24 set, 03:25, Mike [EMAIL PROTECTED] wrote:
 Thanks for the tip!  In the previous, non-Cake version of the app, I
 did that exactly, so it shouldn't be too too tough to get it up and
 running again.  I was kinda avoiding SQL b/c it seemed like the Cake
 way should be to push it through the Cake layer  let CakePHP make it
 automagically happen.  Hearing that raw SQL is actually the right way
 is actually really helpful :)

 If you don't mind my asking a couple more questions -  how does one
 know where the boundary should be?  I mean, aside from exceeding
 max_execution time and/or running out of memory - how would I know
 where to draw the boundary between 'small enough for Cake' vs. 'needs
 raw SQL' when designing my app?  (And what does a normal app do if a
 user happens to show up with an unexpectedly huge data set?)

 Also, what sort of data sets is Cake intended to support?  I'm writing
 the app to support my teaching, so having 30 people in a class, with
 10-20 homeworks/exercise sets to hand in (each of which might have 2-3
 versions stored), so it's conceivable that Cake might auto-magically
 pull 600-1,200 records (even if fairly few / none of them are used in
 any given view).  One of the things I really liked about Cake was that
 I could set recursive = 2 (or 3), and have it magically pull
 everything I needed out of the DB (in my raw PHP app, I figured it was
 time to look at a framework when I started to move towards an OOP-y
 iterator approach for dealing with all my lists of data :)  )

 Thanks again for the quick reply - I appreciate the 'ok' from someone
 who knows more about this than I do! :)
 --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
-~--~~~~--~~--~--~---



Re: To model or not to model

2008-09-24 Thread Rafael Bandeira aka rafaelbandeira3


 Rule of thumb perhaps? :)


If you really mean it: Let's say rule of thumb isn't exactly a rule.
Now, if you were being ironic: Yay right, that's the kind of rule that
can be applied to a pattern!
--~--~-~--~~~---~--~~
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: bulk load data into CakePHP?

2008-09-24 Thread Rafael Bandeira aka rafaelbandeira3

Well, again, it's not a matter of can or can't, the thing is, there's
no why... even wanting a full featured view, with whole lots of data
of all sorts of associations and purposes, what you have to keep in
mind is, why? : where does it fits in your app design? and if you
ever planned it or just come with a quick answer then you can jump to
how?.
Cake is just fine for every kind of app with any amount of data to be
pulled out and in the database.
Why bother about something that you actually not even figured out? If
you want a profile like interface, where the user can have access to
lots of lists and tables of lessons, events, homeworks, available
jobs, or anything else, you should ask, does it has to be loaded all
up to the bottom at once? because all-in-one-single-page web apps
don't do that, you have to rely on JS/JSON/XML/AJAX to fill some
tasks, or else you will end up in a bloody mess with a could-be-so-
light app turned into a fat old lady that tries to display more than
300 sources of data at once.
You have to keep in mind that dynamic apps rely in much more concepts
and methods than just in the strong framework it was built on top of,
and it's not a matter of knowing framework's features - I could point
lots of them wich you are missing (pagination, cache, alt type content
delivery...) - it's about having a well planned goal.

Must read: 
http://www.littlehart.net/atthekeyboard/2007/01/02/just-build-it-damnit/

So my tip is:
Abuse of JS if you want dynamicity, and pages bundled with lots of
data, try to keep things as simple as possible, remember that a view
for a index action should be an index of data, anything extra to
show becomes a VIEW feature.

On 24 set, 13:47, Mike [EMAIL PROTECTED] wrote:
 Thanks for the response - the idea of 'minimizing data that PHP
 processes' as a design pattern for PHP web apps is an insight that I
 had totally missed, and appreciate your pointing it out.  It also
 helps to explain why there isn't a whole lot on the internet about
 perf tuning/profiling CakePHP apps :)

 I think I may have mis-architected my program.  What I wanted to do is
 have a student visit a single page, where everything is available.
 Using the HTML fieldsets as visual panels, I wanted to have a panel
 that would let the student upload their homework (which requires a
 list of homeworks for the current course), another panel with a set of
 links to work that they'd previously uploaded (so they can see that it
 was submitted, and so that they can re-download it later), etc, etc.
 My hope was that I could ask Cake to get the user information for the
 current student, set recursive = 3, and then have Cake prune away any
 data that didn't pertain to the current student.  After which, it's
 quick-and-easy to render all the stuff that I'm looking for :)

 I think that because of the way I've got my tables set up, recursive=3
 and doing a find on the user account didn't quite go deep enough (I'm
 not quite sure if this is a bug in PHP, or my code, or what)(almost
 certainly my code, but I haven't debugged it enough to get beyond the
 initial stage of This _should_ work :)  )

 So I'm worried about scalability not because of trying to display 800
 rows at once, but because I think that I'm mis-using Cake to get too
 much info  pruning it back once it's all in memory.

 Actually, if you don't mind - what sort of capacity should Cake/PHP
 have for pulling stuff into memory?
 I assume that anything less than 100 rows of data should be fine -
 what about 200?  300?  500?  I don't know if anyone's done any sort of
 measurements about CPU X, with memory Y GB, Cake can draw Z records
 into memory in A milliseconds, but it would be fascinating to see :)

 Thanks again for the quick, really helpful response!
 (And, for what it's worth, I'm loving Cake right back! :)  )
 --Mike

 On Sep 24, 8:17 am, Rafael Bandeira aka rafaelbandeira3

 [EMAIL PROTECTED] wrote:
  Mike, I think it's not how much data is Cake intended to deal with
  is how much data your app is intended to deal with,
  thousands of records is not something that should be dealed by php,
  the database does it much faster and safer.
  Having lots of data in database doesn't mean you have to deal with
  them always - I would say ever - because you would rarely want users
  stumbling their heads on to a 800+ rows report,  I would say that
  using a  30+ limit in a report/index is already annoying.
  Now how do you intend to support thousands of records include in the
  app database if not with a file upload? there's no way to make a user
  fill more than three forms at once... And as the database can handle
  files, al you have to do is parse the file if needed.

  Cake loves you and will do lots of things for you, but it's still php
  and still uses memory, relies on cpu process and all this stuff.

  rafaelbandeira3http://rafaelbandeira3.wordpress.com

  On 24 set, 03:25, Mike [EMAIL PROTECTED] wrote:

   Thanks for the tip!  In the previous

Re: Weird behavior with characters

2008-09-24 Thread Rafael Bandeira aka rafaelbandeira3

tried to set your source code files encoding to UTF-8? The default of
many IDEs is to set them as ISO-8859-1, wich messes up with accented
chars, make sure you are rendering your content in UTF-8 too. But
anyway, I would like to point that it's not a good idea, accented
chars are generally a pain the back to handle in source code, and they
are not even allowed in HTML, so your views are probably going to
render in quirks mode, or you are just messing with your code
validation.
You are better off using l10n in  views to display them with accented
chars.

On 24 set, 14:46, Luiz Poleto [EMAIL PROTECTED] wrote:
 Hello guys,
 I'm having a strange behavior from cakePHP, which i'll try to explain. I
 have the following scenario:

 - I have two environments: one is my local machine (actually, two machines
 for developing), where i actually do the development, and the second one is
 the server where i send the application. Both are the same, except that the
 server i have Linux running, and one development machine runs windows XP and
 the other runs Linux;
 - My database and all its tables are set up to charset UTF-8. They are the
 same in the server and in the development machines;
 - I have some table fields filled with accented characters;

 Now, the problem is:
 In the development machines, when i try to edit a record in any table, and
 this record is accented in any part, it's ok, no big deal. But, in the
 server, if i try to edit this same record, the fields which have an accented
 character is not filled in the form. It's just blank!

 Things i have checked:
 - I already checked the HTML source, and the value is empty.
 - In the controller, after reading the record to edit, i write the
 $this-data to a log file, and the records with accented characters are
 there.
 - If i set a variable like $this-set('tmpClient', $this-data); and echo
 the $tmpClient in the view, i can see the fields which have accented
 characters.

 Well, i'm still searching for a solution for this problem, but if anybody
 have a clue, i would love to hear it!!!

 Let me know if i didn't make myself clear!

 Best regards,
 Luiz Poleto
--~--~-~--~~~---~--~~
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: Models: Why not more Object Oriented??

2008-09-23 Thread Rafael Bandeira aka rafaelbandeira3

I don't really get it... you can easily handle your data in Model
side, even more now since [7640] - wich actually encourages you to do
so.
Ok, but lets focus on the iterating more than once problem. After
all isn't it what you actually do in every MVC based app? i.e:
db (iteration over table data) - data source (iteration over result
set) - model ([depending on find type]iteration over data structure) -
 view (iteration over data structure)
only find('all') return data as it comes from the data source, so if
you want a find('calculated') you just have to build the iteration you
want to deal with it - view links at the bottom.

Dealing with objects would turn dynamic iterations heavier, uglier and
painfull.
The structure you suggest would turn deeper relations much harder to
deal with.
How would it be more anything than actually having a proper algorithm
to deal with the whole data structure - wich is surely pretty logical,
maintainable, light...?

The whole thing on having related data on the same level, is that it's
structure represents the data set and it's properties and related data
isn't it's properties, in the case you specified, WebpageType is like
a MySQL ENUM field, it only has to display it's own display field, and
that's all you want, so why don't you deal with that? Something like a
EnumBehavior, or even easier, always deal with it in your afterFind()
callback. It wouldn't be very logical to have Profile as a property of
a User.

Now, I was wondering what is it that Nate suggested devs are planning
on... hope that has nothing to do with this 
http://twitter.com/nateabele/statuses/932176581

Links:
http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/
http://rafaelbandeira3.wordpress.com/2008/08/28/the-new-way-to-define-find-methods/

On 23 set, 20:54, Brenton B [EMAIL PROTECTED] wrote:
 Sorry, not meaning to be annoying, just grasping for understanding.

 Thanks to all :)

 On Sep 23, 5:42 pm, Nate [EMAIL PROTECTED] wrote:

  Yah.  We know.  We'll get to it.


--~--~-~--~~~---~--~~
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: bulk load data into CakePHP?

2008-09-23 Thread Rafael Bandeira aka rafaelbandeira3

Hey Mike, it's totally not a matter of performance here.
First of all, there's no reason on use this approach for a that huge
amout of data, you should probably import it to your db.
But if you want to do this in the app layer, maybe it's a feature - I
don't know, you should definetly build INSERT sql statements and use
Model::execute(), because there are lot's of things happening behind
the scenes on Model::save() and Model::saveAll(), it's really hard
not to run out of mem while executing them thousand times.

A step-by-step, merge some and you'll get a prettier code:

function saveAllThousands($CSVfile) {

$blacklist = array($this-primaryKey); // what columns not to save
$columns = array_keys($this-schemaI()); // get table column names
$whitelist = array_diff($fields, $blacklist);

$fields = join(',', $whitelist);
$sql = INSERT INTO {$this-useTable} ({$fields}) VALUES ;
foreach($CSVfile as $line) {
// here you can perform any action with the incoming data -
escaping, glueing...
$vals = join(',', $line);
$values[] = ({$vals});
}
$sql .= join(',', $values);
return $this-execute($values); // execute in plan old MySQL

}

Not much different than in plan old php, but I assure it's the safest
way - in php, in the app layer - executing on db is much quicker;
Last but not least, comparing raw php access to mysql interaction with
cakephp's data source is madness, of course it's much faster.

rafaelbandeira3
http://rafaelbandeira3.wordpress.com

On 23 set, 22:19, Mike [EMAIL PROTECTED] wrote:
 Hello!

 I'm trying to load a bunch of rows into a table - on the order of
 1,000 or so.  This isn't huge, but I'm having problems when I try to
 do it using CakePHP.  My basic approach is to upload a .CSV file,
 which i then pull apart, and use to repeatedly save() new rows into
 the appropriate model.  I'm uploading  parsing the .CSV file just
 fine (according to the debug output), but the process dies before
 completion.

 Initially, PHP timed out (it took more than 30 seconds to process),
 and when I reset the max_execution (in PHP.ini) to 300 seconds, it
 then ran out of memory.

 My questions:

 1) Are there any obvious things to look for / avoid in my code?
 Adding 1K of new records seems like it ought to be fine (and was fine,
 when I used an earlier version of my web app that was written in raw
 PHP/MySQL)

 2) How do I begin trying to solve this problem?  How does one identify
 what's going wrong here, and then fix it?

 3) Does anyone have any good suggestions for perf-tuning CakePHP apps?

 Sorry for not doing more digging myself - the first N Google results
 weren't promising, so I figured that I'd go for help now, since I'm in
 a bit of a rush :(

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



Re: Simply aligning form-input fields and labels nicely....

2008-09-22 Thread Rafael Bandeira aka rafaelbandeira3

You can use an array to specify label's tag attributes:

$form-input('Schedule.expected_check_in', array('label' =
array('class' = 'input-label', 'text' = 'Expected Arrival', 'title'
= 'When are you expecting to arrive at the place?')));

The 'text' key is the one to be used as the text, so the output would
be:

div class=input text
label for=ScheduleExpectedCheckIn class=input-label
title=When are you expecting to arrive at the place?Expected
Arrival/label
[...]


--~--~-~--~~~---~--~~
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: .po files look weird

2008-09-22 Thread Larry E. Masters aka PhpNut
More standard?
The file format is THE standard.

Do a little research on gettext.

http://www.google.com/search?q=gettext

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/

On Mon, Sep 22, 2008 at 9:00 AM, toby78 [EMAIL PROTECTED] wrote:


 Those .po files used for l8n look weird

 is there a way to use something like Java property files instead? This
 would be better for re-using existing files and a more standard way
 of doing things.

 Is there maybe already some plugin for cakephp to use such property
 files?

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



cake 1.2 custom route

2008-09-03 Thread aka

Ok, i've been breaking my head over this.

I'm trying to change the routing of my app so that (for my base
controller, lets say 'posts') it will be hidden in the url. That is to
say that i can use url's like www.mysite.com/view/1 instead of
www.mysite.com/posts/view/1. Effectively just hiding (or re-routing)
the controller. Now I know this is possible since this method is used
on the cakephp website itself
(i.e. http://book.cakephp.org/view/542).

Any ideas how the routes for this situation should be set up?

Thanx!
--~--~-~--~~~---~--~~
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: cake 1.2 custom route

2008-09-03 Thread aka

Hey thats great, thanx works like a charm!

Can someone also tell me what is happening here...?!

On 3 sep, 20:39, Nate [EMAIL PROTECTED] wrote:
 Router::connect(
     /view/:id,
     array(controller = posts, action = view),
     array('id' = '[0-9]+', 'pass' = array('id'))
 );

 On Sep 3, 1:37 pm, aka [EMAIL PROTECTED] wrote:

  Ok, i've been breaking my head over this.

  I'm trying to change the routing of my app so that (for my base
  controller, lets say 'posts') it will be hidden in the url. That is to
  say that i can use url's 
  likewww.mysite.com/view/1insteadofwww.mysite.com/posts/view/1. Effectively 
  just hiding (or re-routing)
  the controller. Now I know this is possible since this method is used
  on the cakephp website itself
  (i.e.http://book.cakephp.org/view/542).

  Any ideas how the routes for this situation should be set up?

  Thanx!
--~--~-~--~~~---~--~~
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: cannot get ibm tutorial part 2 var belongto work ! anyone done this tutoral before ??

2008-08-30 Thread Rafael Bandeira aka rafaelbandeira3

 ?php
 class Product extends AppModel
 {
 var $name = 'Product';
 var $belongsTo = array (
 'Dealer' = array(
 'className' = 'Dealer',

 'foreignKey'='dealer_id'
 )
 );}

are you sure your code is just it?
--~--~-~--~~~---~--~~
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: method find using regex

2008-08-30 Thread Rafael Bandeira aka rafaelbandeira3

 athttp://book.cakephp.org/view/73/retrieving-your-data, is some info
 about usind find with regex (at conditions param). I can't find one
 example of usage and there is nothing at the docs. Someone can give a
 example of usage?

I actually didn't understand what you want but if you want to use
REGEXP in your query:

$this-Project-find('all', array(
'conditions' = array(
'Project.title REGEXP' = '^ui'
)
))

Always when using operators in find conditions use them in  the
field's side, to avoid sql injections
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   3   4   5   >