Re: how would you scale a cake app?

2006-12-24 Thread Dr. Tarique Sani


On 12/24/06, bgmill <[EMAIL PROTECTED]> wrote:

I'm running a cake app on 3 webservers (round robin dns) and 1 mysql
server right now, traffic yesterday was around 200,000 uniques and
400,000 page views.


What kind of hardware are you using?

Not to sound like a prick but 400,000 page views are not much for a
typical 3+1 configuration. Given your estimate of higher performance
you say you will reach about 1.2 million page views on the same setup
which again makes me want to know your hardware configuration.

To put things from my perspective - we have conventional php
application which manages 12 to 15 million page views on a 4+2
cluster. Yes the hardware on this is awesome!

However this is a conventional php application which started life
about 4 years ago,  now maintaining it is an daunting task - adding
functionality to it gives best of my programmers shivers  :) and that
is where a framework comes in...

Looking forward to hear from you

Thanks and merry Christmas

Tarique


--
=
PHP Applications for E-Biz: http://www.sanisoft.com
Coppermine Picture Gallery: http://coppermine.sf.net
=

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



Re: Insert Multiple recors at once (desesperate help)

2006-12-24 Thread Kevin Uni


Is $data['id'] existing or not an empty value?


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



Re: debugging documentation for cake internals

2006-12-24 Thread Dr. Tarique Sani


On 12/24/06, keymaster <[EMAIL PROTECTED]> wrote:

Is there any developer documentation on the internals of cake?


http://api.cakephp.org/ ?

HTH

Tarique

--
=
PHP Applications for E-Biz: http://www.sanisoft.com
Coppermine Picture Gallery: http://coppermine.sf.net
=

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



Re: findBy issue

2006-12-24 Thread Olexandr Melnyk

2006/12/25, Adrian Godong <[EMAIL PROTECTED]>:


I usually set up a default value just in case the user does not supply a
parameter. But I think your solution will be useful.


Do you think this is a CakePHP bug? Worth a report?

--
Olexandr Melnyk,
http://omelnyk.net/

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



Re: Update on translations.

2006-12-24 Thread Shunro Dozono


Hello, translators:

FYI:
If you are using FireFox, you can view other translations of
"translation.cakephp.org".

For example (Windows platform), download

1) Locale-Switcher Extension for Firefox and Thunderbird
http://benjamin.smedbergs.us/switch-locales/
(All you have to do is just click the files and accept it.)

2) Language Packs
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/2.0/win32/xpi/

Then, after choosing a language, restart FireFox. And visit
http://translation.cakephp.org

You can see other languages!

Shunro Dozono
http://www.cba-japan.com

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



RE: findBy issue

2006-12-24 Thread Adrian Godong

Pardon me. I got it now.



I usually set up a default value just in case the user does not supply a 
parameter. But I think your solution will be useful.



From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Olexandr 
Melnyk
Sent: 25 Desember 2006 8:09
To: cake-php@googlegroups.com
Subject: Re: findBy issue



2006/12/25, Adrian Godong <[EMAIL PROTECTED]>:


I'm assuming that you don't want any 'User' added on the query?


What do you mean?

The problem is that there is no value on the right side of the comparison operator in the where clause. 



--
Olexandr Melnyk,
http://omelnyk.net/




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



Re: how would you scale a cake app?

2006-12-24 Thread Olexandr Melnyk

Also, check if Cake doesn't get more than you need, and consider dynamic
unbinding where you don't need as much info as you get using default models'
options.

--
Olexandr Melnyk,
http://omelnyk.net/

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



Re: how would you scale a cake app?

2006-12-24 Thread the_woodsman


Caching, and lots of it, and DB clustering/replication are definitely
the quickest fixes.

One minor point is to avoid using Cake's multi join SQL, which (I
believe) can literally add thousands of queries when a single one would
do.

In such cases, don't be afraid to use query() instead of findAll -
although examining your DB for low performance or often repeated
queries is great for deciding if the benefits are relly worth the
effort.

And remember, hardware is less expensive than development time, so
don't sacrifice code maintainability and clarity for tiny performance
increases, as you'll pay a lot more in the long run.


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



Re: Update on translations.

2006-12-24 Thread ERic ZoU


Thanks Larry.
The chinese version is working great. Either UTF-8 or zh_cn. They are
all display correctly.

Happy Baking!


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



Re: findBy issue

2006-12-24 Thread Olexandr Melnyk

2006/12/25, Adrian Godong <[EMAIL PROTECTED]>:



I'm assuming that you don't want any 'User' added on the query?



What do you mean?

The problem is that there is no value on the right side of the comparison
operator in the where clause.

--
Olexandr Melnyk,
http://omelnyk.net/

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



RE: findBy issue

2006-12-24 Thread Adrian Godong


I'm assuming that you don't want any 'User' added on the query?

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Kynlem
Sent: 25 Desember 2006 5:24
To: Cake PHP
Subject: findBy issue


Hello,

I've been having some problems with a findBy function.

When I've called the method with a not empty string as argument, it
worked fine, but when I've passed an empty string, Cake generated the
query with the WHERE clause like:

WHERE (`User`.`username` = )

I've spent a bit of time searching for the problem cause in Cake
sources (a great benefit of open source software, you can explore it
yourself), and came up changing dbo_source.php line #1380 from:

if ($match['2'] != '' && !is_numeric($match['2'])) {

to:

if (!is_numeric($match['2']))

What solved the problem. Have anyone had a similar problem before?

I have commented all relations inside my model declaration. I'm running
PHP 5.2.0, MySQL 5.0.27 and CakePHP 1.1.11.4064.

--
Olexandr Melnyk,
http://omelnyk.net/




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



Re: how would you scale a cake app?

2006-12-24 Thread Langdon Stevenson


Hi bgmill

Sounds like you have a good system/site there.  Can you tell me what 
sort of hardware it is running on?


Regards,
Langdon


I'm running a cake app on 3 webservers (round robin dns) and 1 mysql
server right now, traffic yesterday was around 200,000 uniques and
400,000 page views.

Caching is being used on some of the heavier hit controllers but all in
all, load is minimal across the board -- we could easily handle 2 or 3
times the traffic on the current setup. Scaling up in terms of adding
webservers and db servers when required will be easy to accomplish.


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



Re: how would you scale a cake app?

2006-12-24 Thread bgmill


I may well write an article for the bakery after the holiday season -
are there any other high traffic sites known to be using cake?


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



findBy issue

2006-12-24 Thread Kynlem


Hello,

I've been having some problems with a findBy function.

When I've called the method with a not empty string as argument, it
worked fine, but when I've passed an empty string, Cake generated the
query with the WHERE clause like:

WHERE (`User`.`username` = )

I've spent a bit of time searching for the problem cause in Cake
sources (a great benefit of open source software, you can explore it
yourself), and came up changing dbo_source.php line #1380 from:

if ($match['2'] != '' && !is_numeric($match['2'])) {

to:

if (!is_numeric($match['2']))

What solved the problem. Have anyone had a similar problem before?

I have commented all relations inside my model declaration. I'm running
PHP 5.2.0, MySQL 5.0.27 and CakePHP 1.1.11.4064.

--
Olexandr Melnyk,
http://omelnyk.net/


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



Re: Rendering non-ajax view after calling action with ajax call

2006-12-24 Thread igor


That's not what I was looking for, but thanks anyway...
Guess my language is not quite good in explaining.. :)

Anyway, I solved what I wanted...
I wanted to submit this form to a new page.
But I had some other AJAX calls in the same form that updates this form
(I am transfering some serialized data w/ this calls). So, I wanted
this button NOT to get back w/ AJAX, but as non-ajax return. So.. What
I did? I just added it as plain-ol' submit button, and added onclick
event:
onclick="$('my_form_id').submit()"

neat, isn't it?

sometime the simplest solution is the best :)

Thanks, Mariano for your help & effort!


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



RE: Rendering non-ajax view after calling action with ajax call

2006-12-24 Thread Mariano Iglesias


So by "normal response when called by AJAX" you mean that the whole layout
should be returned? Then it's just a matter of setting your layout
accordingly, isn't it?

Or do you mean more like handling the action redirect?

If you are redirecting within the same controller then use setAction passing
along your parameters:

return $this->setAction('/controller/action', $parameters);

If you want the result of the AJAX call to be a full site redirect instead,
then on your index.html have something like:

div('updateableDiv'); ?>

onsubmit="return false;"> 
... 
   submit(' Publish selected ', array( 
   'update' => 'updateableDiv', 
   'id' => "publish_button", 
   'name' => "data[Button][publish]", 
   'url' => "/editors/topics_publishing" 
 )); ?> 
... 



codeBlock('window.location = "' .
$url . '";'); ?>

divEnd('updateableDiv'); ?>

Then on your editors controller add RequestHandler as a component and do:

function topics_publishing() 
{ 
	if ($this->RequestHandler->isAjax())

{
$this->set('url', '/newurl');
}
else
{
return $this->redirect('/newurl');
}
}

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 


BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de igor
Enviado el: Domingo, 24 de Diciembre de 2006 12:30 p.m.
Para: Cake PHP
Asunto: Re: Rendering non-ajax view after calling action with ajax call

Thanks for answer, but I wasn't asking for that. I used Ajax.Updater
before and what You have described I already used.

I will try to explain differently:

If I call my action like usual (ie. non-ajax):
http://myserver/mycontroller/myaction/
I get "normal" response. OK?

I want to have that normal response even If I call this action with
Ajax.Request (using cake's $ajax->submit() or plain Prototype's
Ajax.Request)

So... I HAVE that Ajax.Request working. But, I need response to
redirect my browser to action I called and with params I sent).

Any better now? :)


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



RE: how would you scale a cake app?

2006-12-24 Thread Mariano Iglesias


I am talking about what the CakePHP framework offers you in terms of
scalability, things like:

1. View caching: you can cache views as a whole or even specify which parts
of a view should not be cached: http://manual.cakephp.org/chapter/view_cache

2. Model/Object caching: cache model queries or even complex objects
returned by components,
http://rossoft.wordpress.com/2006/03/15/cache-objects-component/

3. Database optimization: it is easy, if you need it, to have a DB engine
running your updates and another DB engine (that replicates previous record
updates) to be used only for querying:
http://groups-beta.google.com/group/cake-php/browse_thread/thread/58ea010f93
0fab6c

MVC helps maintain your code, but a powerful framework can also help you
boost performance by making code optimizations that are transparent to your
application logic. That is one of the things CakePHP is great at.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 


BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de keymaster
Enviado el: Domingo, 24 de Diciembre de 2006 01:21 p.m.
Para: Cake PHP
Asunto: Re: how would you scale a cake app?

I understand how the MVC separation and strict coding conventions make
maintainability easier as the application gets larger (in terms of
lines of code). This I know cake is outstanding at.

But you seem to be alluding to a feature of cake I have not yet
digested (pardon the pun), which is an aspect of cake which "allows you
to easily develop your application thinking about scalability all the
way". If you were referring to scalability from a traffic perspective,
together with the associated underlying system architectural changes
needed, can you please elaborate for us what you meant, Mariano ?


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



RE: how would you scale a cake app?

2006-12-24 Thread Mariano Iglesias


Your situation sounds like a great source for a potential bakery article,
mainly for:

1. Understanding how CakePHP is behaving on a high-traffic/clustered server.

2. Giving a short tutorial on how you managed to add new servers and how it
impacted on your application.

Just a thought :)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 


BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de bgmill
Enviado el: Domingo, 24 de Diciembre de 2006 01:29 p.m.
Para: Cake PHP
Asunto: Re: how would you scale a cake app?

I'm running a cake app on 3 webservers (round robin dns) and 1 mysql
server right now, traffic yesterday was around 200,000 uniques and
400,000 page views.


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



Re: IDE of choice?

2006-12-24 Thread joelmedia


I use both phpeclipse and Macromedia Homesite. I prefer eclipse for the
coding long hauls, and home site for quick and dirty editing.

One thing I did that helped a lot was to associate the .thtml extension
with php in the file preferrences of my editors. Bingo bango bongo,
this turned on the native php highlighting and tips for the .thtml
view files.


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



Re: how would you scale a cake app?

2006-12-24 Thread keymaster


On Dec 24, 4:01 pm, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:


CakePHP is a framework that allows you to
easily develop your application thinking about scalability all the way, so
take advantage of that.


I understand how the MVC separation and strict coding conventions make
maintainability easier as the application gets larger (in terms of
lines of code). This I know cake is outstanding at.

But you seem to be alluding to a feature of cake I have not yet
digested (pardon the pun), which is an aspect of cake which "allows you
to easily develop your application thinking about scalability all the
way". If you were referring to scalability from a traffic perspective,
together with the associated underlying system architectural changes
needed, can you please elaborate for us what you meant, Mariano ?

Thanks.


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



Re: how would you scale a cake app?

2006-12-24 Thread bgmill


I'm running a cake app on 3 webservers (round robin dns) and 1 mysql
server right now, traffic yesterday was around 200,000 uniques and
400,000 page views.

Caching is being used on some of the heavier hit controllers but all in
all, load is minimal across the board -- we could easily handle 2 or 3
times the traffic on the current setup. Scaling up in terms of adding
webservers and db servers when required will be easy to accomplish.


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



Re: Update on translations.

2006-12-24 Thread Bruno Baudry


Yes we're close, but Santa's calling, so we'll have to deliver the file 
tomorow...


merry christmas to all of you.



Olivier Percebois-Garve a  crit :

You'll receive the french version pretty soon I think,
we are debating some points and then Bruno Baudry should send you the file.

Larry E. Masters aka PhpNut wrote:

Below is a list of the files we currently have and need translated still.

core.po files need to be translated:
Danish 
(https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/dan/LC_MESSAGES/ 
)
French 
(https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/fre/LC_MESSAGES/)
Japanese (partial by Shunro Dozono) ( 
https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/jpn/LC_MESSAGES/)
Russian ( 
https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/rus/LC_MESSAGES/)
Portuguese (partial by RoadHouse on irc) 
(https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/por/LC_MESSAGES/ 
) 
(I think DJ Spark is completing it)


Thanks to those who have completed the translations of the core.
Completed:
Dutch (Dieter Plaetinck)
Chinese (ERic ZoU)
German (Daniel Hofstetter)
Italian (Claudio Poli)
Spanish (Mariano Iglesias)

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



Re: Update on translations.

2006-12-24 Thread Claudio Poli 


Larry E. Masters aka PhpNut ha scritto:


Claudio,

Updated can you check the site again?


Larry,
everything is ok.


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



Re: Rendering non-ajax view after calling action with ajax call

2006-12-24 Thread igor


Thanks for answer, but I wasn't asking for that. I used Ajax.Updater
before and what You have described I already used.

I will try to explain differently:

If I call my action like usual (ie. non-ajax):
http://myserver/mycontroller/myaction/
I get "normal" response. OK?

I want to have that normal response even If I call this action with
Ajax.Request (using cake's $ajax->submit() or plain Prototype's
Ajax.Request)

So... I HAVE that Ajax.Request working. But, I need response to
redirect my browser to action I called and with params I sent).

Any better now? :)


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



RE: Rendering non-ajax view after calling action with ajax call

2006-12-24 Thread Mariano Iglesias


But you are just asking for a normal AJAX update, why are you trying to do
it by yourslef? DRY baby ;) Try this:

index.thtml:

div('updateableDiv'); ?>


...
   submit(' Publish selected ', array(
'update' => 'updateableDiv',
'id' => "publish_button",
'name' => "data[Button][publish]",
'url' => "/editors/topics_publishing"
 )); ?>
...


divEnd('updateableDiv'); ?>

editors controller:

function topics_publishing()
{
$this->set('data', $this->data);

$this->layout = 'editors';
}

views/editors/topics_publishing.thtml:



-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 


BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de igor
Enviado el: Domingo, 24 de Diciembre de 2006 10:54 a.m.
Para: Cake PHP
Asunto: Rendering non-ajax view after calling action with ajax call

I have this index.thtml where I have XMLHTTPRequest call to my
/editors/topics_publishing action. This call is working - i get the
data in /editors/topics_publishing action.


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



Re: how would you scale a cake app?

2006-12-24 Thread Olivier Percebois-Garve


A simple way to let a webapp scale is to moved session's and db's data 
to cookies as much as possible.


olivvv


Nimrod A. Abing wrote:


On 12/24/06, keymaster <[EMAIL PROTECTED]> wrote:


.. just dreaming, but..

If one wanted to use cake to build an app which is scalable to the
extreme, ie. flickr.com or yourtube.com or myspace.com, how would you
do it?


http://www.onjava.com/pub/a/onjava/2003/10/15/php_scalability.html

http://www.oreillynet.com/onlamp/blog/2006/04/digg_phps_scalability_and_perf.html 




Would you just separate out the db server and replicate the rest on
identical nodes in a cluster? Would you break up the app into view
servers, controller servers, and model servers?


That depends. Scalability is a difficult issue to handle if it is not
considered during the initial application design stage. If you want to
be able to scale up your application, you might as well decide on a
strategy *now*.



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



Rendering non-ajax view after calling action with ajax call

2006-12-24 Thread igor


Hi all,

I have this index.thtml where I have XMLHTTPRequest call to my
/editors/topics_publishing action. This call is working - i get the
data in /editors/topics_publishing action.

What I want now is, after calling this action, to render this view like
a new page, not like xmlhttp Respond.

What I've done is here: http://bin.cakephp.org/view/1663476691

What I get now is my action /editor/topic_publishing rendered but
nowhere (I see it got rendered through Firebug Console view).

any help?
thx


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



RE: how would you scale a cake app?

2006-12-24 Thread Mariano Iglesias


Check this out, it's not that high of an explanation but provides some
useful tips on how to improve PHP performance:

http://talks.php.net/show/hpp

For some reason the creators of that presentation decided that they don't
support IE so you'll need to use FF or something else to view it.

In regards to your question I also think that scalability should be on the
table right from the get-go. CakePHP is a framework that allows you to
easily develop your application thinking about scalability all the way, so
take advantage of that.

I believe that in time, as your traffic hits high numbers, the first
optimization you'll need is to allow the DB to be on its own clustered
servers, so will your webserver, having giga connection amongst the two.
Also if you are using MySQL as your backend server move CakePHP towards
using mysqli extension instead of mysql, as it is faster. Also don't neglect
the connectivity your server has to the outside world, some people improve
their application performance and forget about the backbones where their
application is running.

Separating Models / Controllers: oh well I don't think you'll need such a
thing. I would have DB on one side, CakePHP application on another side,
work my way to PHP optimization on the CakePHP side and enable caching to
places where it can be used.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 


BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Langdon Stevenson
Enviado el: Domingo, 24 de Diciembre de 2006 05:33 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: how would you scale a cake app?

I would be very interested to hear anyone else's thoughts on this too. 
Does the development team have any recommendations about the best 
approach to scaling up a site?



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



RE: Merry Chirstmas

2006-12-24 Thread Mariano Iglesias


Merry Chirstmas, Happy Hanukkah, and a Wonderful New Year for all CakePHP
bakers.

May this year be the one where CakePHP establishes itself as the greatest
framework of all times ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 


BAKE ON!



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



Re: Update on translations.

2006-12-24 Thread Olivier Percebois-Garve

You'll receive the french version pretty soon I think,
we are debating some points and then Bruno Baudry should send you the file.

Larry E. Masters aka PhpNut wrote:

Below is a list of the files we currently have and need translated still.

core.po files need to be translated:
Danish 
(https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/dan/LC_MESSAGES/ 
)
French 
(https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/fre/LC_MESSAGES/)
Japanese (partial by Shunro Dozono) ( 
https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/jpn/LC_MESSAGES/)
Russian ( 
https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/rus/LC_MESSAGES/)
Portuguese (partial by RoadHouse on irc) 
(https://svn.cakephp.org/repo/branches/1.2.x.x/cake/locale/por/LC_MESSAGES/ 
) 
(I think DJ Spark is completing it)


Thanks to those who have completed the translations of the core.
Completed:
Dutch (Dieter Plaetinck)
Chinese (ERic ZoU)
German (Daniel Hofstetter)
Italian (Claudio Poli)
Spanish (Mariano Iglesias)

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



Re: Merry Chirstmas

2006-12-24 Thread purepear


Merry Christmas! :)


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



Re: how would you scale a cake app?

2006-12-24 Thread Chris Lamb

Langdon Stevenson <[EMAIL PROTECTED]> wrote:
> I think that I would likely just replicate the entire application
> across multiple web servers, and hand out the requests in a round
> robin to the web servers.

Or maybe FastCGI's load balancing?

> I would be very interested to hear anyone else's thoughts on this
> too.

Good use of caching would help prolong the time before having to scale
up, as well as reducing hardware requirements. Cake's own caching is
really neat, as are things like lighttpd's mod_cml or traditional
options like squid. Remember that web servers are *extremely* good at
serving static content!

I should really add the general warning against premature optimisation
here, but I'm sure you've heard it before.


Best wishes,

-- 
 Chris Lamb, Cambridgeshire, UKGPG: 0x634F9A20


signature.asc
Description: PGP signature


Multi users for one project!

2006-12-24 Thread uae2k


I have found many great examples for associations but I haven't find
and example for multi users relate to one project with different title
for each user

I have table
users
with the fields
( id, username, password, email, name)

and table
projects
with fields
( id, team_id, project_title, status)

and table
teams
with fields
(id,manager, vice, member, supervisor)


the project have one team ... and user can be manager or vice or member
or supervisor but he can't fill more than one title in each team

in MySQL lang ... projects one2one teams ... and teams one2many users

I can't define which association function in cakephp is many2many or
one2many or one2one

also ... $hasAndBelongsToMany wont works ... as I have understand ...
cakephp have specific needs for HABTM relationship to work ... which I
need a table with the name  (users_projects) and have 2 fields only
(user_id, and project_id)
but I need more information to include in the relationship !!

I have tried to do this ... projects [belongsto] teams ...  teams
[hasOne] projects ... and users [hasMany] teams ... but scaffold
doesn't show me what suppose to be

How I can make custom mySQL query to define the relationship and how to
use it in controller !  .. and is there any who telll me what to do to
have the perfect relationship !


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



Re: how would you scale a cake app?

2006-12-24 Thread Nimrod A. Abing


On 12/24/06, keymaster <[EMAIL PROTECTED]> wrote:


.. just dreaming, but..

If one wanted to use cake to build an app which is scalable to the
extreme, ie. flickr.com or yourtube.com or myspace.com, how would you
do it?


http://www.onjava.com/pub/a/onjava/2003/10/15/php_scalability.html

http://www.oreillynet.com/onlamp/blog/2006/04/digg_phps_scalability_and_perf.html


Would you just separate out the db server and replicate the rest on
identical nodes in a cluster? Would you break up the app into view
servers, controller servers, and model servers?


That depends. Scalability is a difficult issue to handle if it is not
considered during the initial application design stage. If you want to
be able to scale up your application, you might as well decide on a
strategy *now*.
--
_nimrod_a_abing_

[?] http://abing.gotdns.com

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



Merry Chirstmas

2006-12-24 Thread 杨苏立 Yang Su Li

Hi Guys,

Merry Chirstmas~!

Wish you good luck in the coming year :)



--
此致
   敬礼!
 杨苏立

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



Re: how would you scale a cake app?

2006-12-24 Thread Langdon Stevenson


It's an interesting question.  I am working on an application that (if 
it works out for the client) may grow to support thousands of users with 
requirements for high availability.


If it ever grows that far, then I expect that we will need to redevelop 
at least some parts of the application .


For me, the first step (to a small cluster) would be to hive off the 
database onto a cluster of three to five servers.  DB access on this 
system is heavy, so that will be the likely first bottleneck.


After that, I am not sure.  I think that I would likely just replicate 
the entire application across multiple web servers, and hand out the 
requests in a round robin to the web servers.


I would be very interested to hear anyone else's thoughts on this too. 
Does the development team have any recommendations about the best 
approach to scaling up a site?


Regards,
Langdon


keymaster wrote:


.. just dreaming, but..

If one wanted to use cake to build an app which is scalable to the
extreme, ie. flickr.com or yourtube.com or myspace.com, how would you
do it?

Would you just separate out the db server and replicate the rest on
identical nodes in a cluster? Would you break up the app into view
servers, controller servers, and model servers?

Imagine you were tasked with building one of these systems, what system
architecture would you have?


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



Re: 中文cakephp讨论组(cakephp discuss grp for guys who use Chinese)

2006-12-24 Thread Daniel Hofstetter


There exist already a Chinese group:
http://groups.google.com/group/cakephp-cn

--
Daniel Hofstetter
http://cakebaker.42dh.com


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