Re: recursive = 3

2007-11-21 Thread wluigi

are you sure you define correctly the relationships ?
did you try from the third model to find the sencond and the first ?

didn t you set recursive to your seconde model ?

On Nov 21, 3:58 am, rtconner <[EMAIL PROTECTED]> wrote:
> Uhm..
>
> Creata Model
> Create a second model and HABTM relate them
> Then create a Third mode and HABTM relate it to the second one.
>
> On the first model, set recursive = 3 and do a find. Note how data
> from the third model is not there.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ajax multiple div update

2007-11-13 Thread wluigi

I try this old (nate's) code :

// test.thtml

link('Update 2 Div\'s', '/controller/test', array('update'
=>
array('first', 'second'))); ?>

div('first'); ?>
This is the first div, it has the current time:

divEnd('first'); ?>

div('second'); ?>
This is the second div, it shows server variables:

divEnd('second'); ?>



but it doesn't seem to work anymore.

Wath's the new way ?


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



Re: How to run a background process in CakePhp

2007-10-18 Thread wluigi

yes you can do this ;

create an additional action : "backgroundscript" that call your exec
("/usr/bin/php yourscript.php" >/dev/null &");

in your main real action use curl to call your "backgroundscript"
action with the appropriates options : curl_setopt($ch,CURLOPT_TIMEOUT,
1) curl_setopt($ch,CURLOPT_NOBODY,true)
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true) ...

this will wait just 1 second.

All this isn't pretty at all but it works fine

> On Oct 18, 1:41 am, McFadly <[EMAIL PROTECTED]> wrote:
> Also if you're using cakephp 1.2 look into the console.  cakebaker has
> a good starting 
> point:http://cakebaker.42dh.com/2007/05/07/writing-a-custom-cakephp-console...
>
> On Oct 17, 1:50 pm, fr3nch13 <[EMAIL PROTECTED]> wrote:
>
> > hint - search this group for 'cron jobs'
>
> > On Oct 17, 1:58 pm, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
>
> > > You might want to check out this extension if you you need things like 
> > > this:
>
> > >http://www.vl-srm.net/doc/
>
> > > However, you find it easier to have a queue table that is processed by a
> > > cron executed script for your background processing needs.
>
> > > -- Felix
> > > --
> > > My Blog:http://www.thinkingphp.org
> > > My Business:http://www.fg-webdesign.de
>
> > > Baz wrote:
> > > > This isn't a very CakePHP question.
>
> > > > It's straight PHP. The short answer is no. Anything you execute in PHP
> > > > is going to be done in a blocking call.
> > > > --
> > > > Baz L
> > > > Web Development 2.0
> > > >http://WebDevelopment2.com/
>
> > > > On 10/17/07, *regent* <[EMAIL PROTECTED] >
> > > > wrote:
>
> > > > I need to run a php script in the background.  I have figured out I
> > > > can run it like this:
>
> > > > exec ("/usr/bin/php yourscript.php" >/dev/null &");
>
> > > > I have 2 questions concerning this:
>
> > > > 1) Can I run a php script within the CakePhp framework?  I've been
> > > > able to run it outside the framework, I just put the script under
> > > > webroot.  But can i run it within the framework so I can take
> > > > advantage of CakePhp's extra functionality?  To be more clear, I 
> > > > want
> > > > the script to reside in one of my views folders, so I can still take
> > > > advantage of Cake's functions.
>
> > > > 2) How do I pass arguments to the script?  I need the exact syntax.
> > > > I've searched google and could not find a clear example of how to do
> > > > this.
>
> > > > 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: Eclipse code completion in Views

2007-10-11 Thread wluigi

That's great.

So in the controller, you can use

if(false) {
$this->Model = new Model();
}

but you've to add this in every action of every controller.

How to add it to one and only one place ?

On Oct 10, 9:34 pm, Stu <[EMAIL PROTECTED]> wrote:
> That is brilliant, and worked flawlessly first time, and just makes
> something awesome even more awesome.
>
> Thanks very much
>
> Stu
>
> On Oct 10, 7:14 pm, schneimi <[EMAIL PROTECTED]> wrote:
>
> > You can put it in the index.php and it works for every view. :-)
>
> > schneimi schrieb:
>
> > > I just tested this code in a view:
>
> > > if(false) {
> > >   $html = new HtmlHelper();
> > > }
>
> > > Not that beautiful, but it will never be executed and Eclipse does the
> > > completion anyway. Maybe that helps.
>
> > > Michael
>
> > > Not very beautiful but will never run and
> > > voidstate schrieb:
> > > > But the names are standardised. Could you perhaps put some kind of
> > > > alias for the helper objects in the app during development using those
> > > > names then remove them for production?
>
> > > > On Oct 8, 9:53 pm, schneimi <[EMAIL PROTECTED]> wrote:
> > > > > Yes that would be nice, but i think it's not possible, because these
> > > > > variables are handled by cake.
>
> > > > > Stu schrieb:
>
> > > > > > Well, I unfortunately can't get code completion on methods in 
> > > > > > $form->,
> > > > > > or $html-> in a view (*.ctp file).
>
> > > > > > It's no big deal, but it would be very nice.
>
> > > > > > On Oct 8, 1:58 pm, schneimi <[EMAIL PROTECTED]> wrote:
> > > > > > > Yes, you are right, the second step is not necessary.
>
> > > > > > > Stu schrieb:
>
> > > > > > > > Ah ok, I'd done the first step but not the second step. I'm at 
> > > > > > > > work at
> > > > > > > > the moment, but I'll do the second step when I get home.
>
> > > > > > > > Thanks
>
> > > > > > > > On Oct 7, 5:28 pm, schneimi <[EMAIL PROTECTED]> wrote:
> > > > > > > > > Hi,
>
> > > > > > > > > You have to do two steps:
>
> > > > > > > > > - Add *.thtml to Preferences->General->Content Types->PHP 
> > > > > > > > > Content
> > > > > > > > > Type
> > > > > > > > > - Add *.thtml and assign the PHP-Editor in 
> > > > > > > > > Preferences->General-
>
> > > > > > > > > >Editors->File Associations
>
> > > > > > > > > regards,
>
> > > > > > > > > Michael
>
> > > > > > > > > Stu schrieb:
>
> > > > > > > > > > Hi Bakers,
>
> > > > > > > > > > Does anyone know if it is possible to get code completion 
> > > > > > > > > > working for
> > > > > > > > > > Views in eclipse? I've got it working for Models in a 
> > > > > > > > > > controller, but
> > > > > > > > > > can't seem to get any code completion when in a View, and 
> > > > > > > > > > do something
> > > > > > > > > > like  I'm just wondering if 
> > > > > > > > > > there is some
> > > > > > > > > > configuration option I'm missing or something like that.
>
> > > > > > > > > > Any help would be appreciated,
>
> > > > > > > > > > thanks
>
> > > > > > > > > > Stu


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



Re: how to cache all the view in call ?

2007-07-07 Thread wluigi

My first message was for asking.

My last for explaining because nobody answer me before I solve it, and
because it wasn t that easy.

On 6 juil, 21:58, "Pablo Viojo" <[EMAIL PROTECTED]> wrote:
> I don't understand...you're asking or trying to explain it?
>
> Using that piece of code, you can set a cron task.
>
> Regards,
> Pablo
>
> On 7/6/07, wluigi <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > @keaten patel : it doesn t solve the problem for the first user how
> > must regenerate the view
>
> > @Rajesh : yes that is it but the main problem was to call every
> > action.
>
> > So I use Curl :
>
> > foreach($controllerActionList as $myControllerAction){
>
> > if(!$ch = curl_init('http://localhost/donnees/index/'.
> > $domaine['Domaine']['name'].'/'.$period)){
> > echo ' curl init erreur';
>
> > 
> > }elseif(!curl_setopt($ch,CURLOPT_RETURNTRANSFER,true)){
> > echo 'curl_setopt
> > CURLOPT_RETURNTRANSFER erreur';
>
> > 
> > }elseif(!curl_setopt($ch,CURLOPT_NOBODY,true)){
> > echo 'curl_setopt
> > CURLOPT_NOBODY erreur';
> > }elseif(!curl_exec($ch)){
> > echo ' curl exec erreur';
> >     }else{
> > curl_close($ch);
> > //echo ' ok:';
> > }
>
> > }
>
> > On 5 juil, 17:23, "R. Rajesh Jeba Anbiah"
> > <[EMAIL PROTECTED]> wrote:
> > > On Jul 5, 2:45 pm, wluigi <[EMAIL PROTECTED]> wrote:> the question was
> > not how to use cache but how to generate de cached
> > > > contente for every action of my site every morning, so that the first
> > > > people how use the site can take benefits of the cached view.
>
> > >
>
> > >Set up cron to delete cache folders every morning?
>
> > > --
> > >   
> > > Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]://pviojo.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 to cache all the view in call ?

2007-07-06 Thread wluigi

@keaten patel : it doesn t solve the problem for the first user how
must regenerate the view

@Rajesh : yes that is it but the main problem was to call every
action.


So I use Curl :

foreach($controllerActionList as $myControllerAction){

if(!$ch = curl_init('http://localhost/donnees/index/'.
$domaine['Domaine']['name'].'/'.$period)){
echo ' curl init erreur';

}elseif(!curl_setopt($ch,CURLOPT_RETURNTRANSFER,true)){
echo 'curl_setopt 
CURLOPT_RETURNTRANSFER erreur';

}elseif(!curl_setopt($ch,CURLOPT_NOBODY,true)){
echo 'curl_setopt 
CURLOPT_NOBODY erreur';
}elseif(!curl_exec($ch)){
echo ' curl exec erreur';
}else{
curl_close($ch);
//echo ' ok:';
}

}


On 5 juil, 17:23, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Jul 5, 2:45 pm, wluigi <[EMAIL PROTECTED]> wrote:> the question was not 
> how to use cache but how to generate de cached
> > contente for every action of my site every morning, so that the first
> > people how use the site can take benefits of the cached view.
>
>
>
>Set up cron to delete cache folders every morning?
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


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



Re: how to cache all the view in call ?

2007-07-05 Thread wluigi

the question was not how to use cache but how to generate de cached
contente for every action of my site every morning, so that the first
people how use the site can take benefits of the cached view.

On 1 juil, 18:49, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> gwoo:  it'shttp://manual.cakephp.org/chapter/view_cacheI think
>
> On 7/1/07, gwoo <[EMAIL PROTECTED]> wrote:
>
>
>
> >http://manual.cakephp.org/chapters/caching
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


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



Re: how to cache all the view in call ?

2007-07-01 Thread wluigi

for information I use curl to call all action

On 18 juin, 11:05, wluigi <[EMAIL PROTECTED]> wrote:
> no one know how to handle this ?
>
> On 15 juin, 14:31, wluigi <[EMAIL PROTECTED]> wrote:
>
> > I want to do this in only 1 call
>
> > On 15 juin, 14:27, wluigi <[EMAIL PROTECTED]> wrote:
>
> > > I try differents ways but no one is perfect.
>
> > > I just want every morning to call a controller action or a batch that
> > > write the cached file for all my couple od /controller/action/param1/
> > > param2/...


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



Re: how to cache all the view in call ?

2007-06-18 Thread wluigi

no one know how to handle this ?

On 15 juin, 14:31, wluigi <[EMAIL PROTECTED]> wrote:
> I want to do this in only 1 call
>
> On 15 juin, 14:27, wluigi <[EMAIL PROTECTED]> wrote:
>
> > I try differents ways but no one is perfect.
>
> > I just want every morning to call a controller action or a batch that
> > write the cached file for all my couple od /controller/action/param1/
> > param2/...


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



Re: how to cache all the view in call ?

2007-06-15 Thread wluigi

I want to do this in only 1 call

On 15 juin, 14:27, wluigi <[EMAIL PROTECTED]> wrote:
> I try differents ways but no one is perfect.
>
> I just want every morning to call a controller action or a batch that
> write the cached file for all my couple od /controller/action/param1/
> param2/...


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



how to cache all the view in call ?

2007-06-15 Thread wluigi

I try differents ways but no one is perfect.

I just want every morning to call a controller action or a batch that
write the cached file for all my couple od /controller/action/param1/
param2/...


--~--~-~--~~~---~--~~
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: so many queries--intentional??

2007-05-29 Thread wluigi

The most important is that you only ask for what you need and make a
good use of $conditions,$fields,$recursive,$limit and bindModel()
unbindModel();

On May 29, 9:32 am, AD7six <[EMAIL PROTECTED]> wrote:
> On 29 mayo, 09:10, "R. Rajesh Jeba Anbiah"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > On May 28, 6:29 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:> On 5/28/07, 
> > R.RajeshJebaAnbiah<[EMAIL PROTECTED]> wrote:
> > > > I'm getting so many queries in index action of controller, say for a
> > > > typical blog project with categories, comments and tags, I'm getting
> > > > so many queries in blogs/index which is having
> > > > $this->Blog->recursive = 0;
> > > > $this->set('blogs', $this->paginate());
>
> > > This is normal behaviour, and is required for Cake's Models to do
> > > their associative data mapping magic.
>
> >   
>
> >FWIW, I do not question the need to run the queries. But, my
> > question is that why it can't be optimized. With the better join
> > query, we can have a single query that serves the purpose, instead of
> > about 60 queries.
>
> Consider what would happen if you had some of your blogs are
> associated with a large number (relative to your limit) of tags/
> categories/comments. You can't apply a limit to the number of
> associated items, but also you can't even know how many results from
> your primary table will be returned.
>
> hth,
>
> AD


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



Re: how to build a search helper ?

2007-05-09 Thread wluigi


Thanks it answers all my question.

I will look to the code in few days.

Thanks again

On 9 mai, 13:35, AD7six <[EMAIL PROTECTED]> wrote:
> On 7 mayo, 11:09, wluigi <[EMAIL PROTECTED]> wrote:
>
> > I want to build a serch helper that can be used in index action like
> > paginator.
>
> > This helper should be able to use form data to generate a nice url
> > like with paginator.
>
> > PS : perhaps the solution isn't a helper.
>
> > I can't see how to handle this
>
> I put an example of that in the pagination demo see the PRG/complex
> code herehttp://cakeforge.org/frs/?group_id=152
>
> Uses and understands urls such 
> ashttp://www.noswad.me.uk/Pagination/PRG/Complex/Title:cont-the/Id:cont...
>
> where
> cont = contains
> gt = greater than
> etc.
>
> hth,
>
> AD


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



how to build a search helper ?

2007-05-07 Thread wluigi

I want to build a serch helper that can be used in index action like
paginator.

This helper should be able to use form data to generate a nice url
like with paginator.

PS : perhaps the solution isn't a helper.

I can't see how to handle this


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