Redirect Question

2016-04-06 Thread MikeK
I have used $this->redirect($url, null, TRUE) for years in cakephp 1.2 and 
1.3 when needing to cross a controller boundary.

I recently for the first time tried to use redirect with the 3rd parm set 
to FALSE so it will return to the calling controller for further 
processing, however for some reason when I set the 3rd parm to FALSE the 
target controller is not called at all.

I went into controller.php and traced the code and it indeed is attempting 
to set $this->header to the correct "Location: url" and the url looks 
perfect etc - however there is no actual redirection.

What am I missing? Is there something going on with route caching perhaps?

I am processing an array and redirecting to another controller for each 
element, and if I change the 3rd parm to TRUE, indicating I want the action 
stopped after the redirect completes the target controller is indeed 
called, but of course control does not return to my controller processing 
the array. Also the aforementioned trace looks identical when I set the 3rd 
parm to TRUE...

Any ideas would be greatly appreciated.

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow 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.
For more options, visit https://groups.google.com/d/optout.


Re: php requirements for 3.X

2016-03-22 Thread MikeK
Thanks for your eloquent reply - HOWEVER the latest stable release 
of php 5.5 is 5.5.31 - there is no 5.5.9 as the "requirements" call for. 
Does anyone really know what cakephp3 REALLY requires?


-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow 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.
For more options, visit https://groups.google.com/d/optout.


php requirements for 3.X

2016-03-19 Thread MikeK
Am migrating to 3.2 from cakephp 2.x, but my host only offers php 5.4 - I 
saw the install requirements want 5.5.9

Should I find another host or will 3.2 operate OK on 5.4?

Thanks in advance and sorry if this is a dup - could not find an answer by 
search.

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow 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.
For more options, visit https://groups.google.com/d/optout.


Re: 1.3 Migration Question re:NULL and Defaults

2014-12-30 Thread MikeK
Thanks again, yes this is what I am seeing and is consistent with the idea 
that the old code did not submit a NULL field.

As notated above the "save" statement in the controller has no parms other 
than $this->data - when the field has nothing assigned to it cakePHP 1.3.20 
sets it to NULL - although this exact same thing occurs under the old 1.2 
code, in 1.2 the field set to NULL is not part of the INSERT operation, 
whereas in 1.3 it is.

So the old app code that essentially has no parm validation on the form 
does not work in 1.3. Funny thing is I guess they were relying on mySQL to 
convert the NULL to the default when what they were really relying on was 
cakePHP recognizing the NULL and stripping that column from the INSERT 
request thus allowing the default in the DB to set the default value.

I guess what is now needed is to set your own default value - I wonder if 
there is an easy way to do this in the model somewhere?

-- 
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/d/optout.


Re: 1.3 Migration Question re:NULL and Defaults

2014-12-30 Thread MikeK
FYI the host is running MYSQL 5.0.96-log and PHP 5.3.24

-- 
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/d/optout.


Re: 1.3 Migration Question re:NULL and Defaults

2014-12-30 Thread MikeK
I also ran the legacy code with some SQL log dumping and it seems to me the 
old code did NOT attempt an INSERT with the values of the unset fields set 
to NULL - apparently it only attempted to INSERT the fields that were set, 
at least according to the lastQuery() dump.

-- 
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/d/optout.


Re: 1.3 Migration Question re:NULL and Defaults

2014-12-30 Thread MikeK

John-

Thank you for the reply. Yes indeed I am working on a copy of the DB - in 
fact I have cloned the entire domain including the DB etc, so I am able to 
compare things as well as test tweaks in the DB. Yes a default value of 
0.00 is specified for the 'column' . The column definitions are:

column=amount   decimal(6,2) Null=No Default=0.00 all other fields are 
blank (extra, collation, attributes, etc)

other columns are decimal(4,2) but otherwise the same.

I am not sure if under the 1.2.0.5875 prebeta the original project utilized 
whether CakePHP is performing an insert with a NULL for the unset field and 
MySQL is taking care of the conversion to the default, or whether CakePHP 
itself performs the conversion based on schema prior to insert request.

It has always been my understanding that MySQL should handle it.

I have also purged all relevant tmp files, cache files etc.

I do have the ability to operate a copy of the old code and the migrated 
code simultaneously on the copy of the DB for testing purposes.

I have confirmed that using the same backup DB and same version of MySQL 
(same server) that cakephp 1.3.20 and 1.2.0.5875 are having different 
results on the same save operation at the controller level.

-- 
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/d/optout.


1.3 Migration Question re:NULL and Defaults

2014-12-30 Thread MikeK
I am porting a 1.2.0.5875 app to 1.3 in preparation for moving to 2.X. I 
have several fields (tax, amount, fee) in an order record all with NULL set 
to "No", each is a decimal(6,2) field, and each has default value of 0.00

The following code worked fine and dandy in the 1.2 system and in the event 
nothing was specified by the user for tax, amount, or fee, they were 
properly set to 0.00 in the DB:

$this->cleanUpFields(); //WILL REMOVE AS THIS IS DEPRECATED
$this->Order->create();
if ($this->Order->save($this->data)) {

In my 1.3 migration build I am getting 'tax' cannot be NULL and I see in 
the SQL insert op that indeed it is being set to NULL, and thus MySQL 
chokes on it.

Why did it operate correctly in the old 1.2 system and what should I do to 
correct this? It is pervasive across numerous classes and I want to get it 
right the first time.

Is this perhaps a difference in the way the form helper is handling 
initialization of the fields? Or somewhere in the model? I did not need to 
specify validation for these fields as used back in 1.2 etc.

Thanks in advance!

-- 
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/d/optout.


1.3 Migration Question re:cleanupFields

2014-12-30 Thread MikeK
I am porting a 1.2.0.5875 app to 1.3 in preparation for moving to 2.X. I 
have several fields (tax, amount, fee) in an order record all with NULL set 
to "No", each is a decimal(6,2) field, and each has default value of 0.00

The following code worked fine and dandy in the 1.2 system and in the event 
nothing was specified by the user for tax, amount, or fee, they were 
properly set to 0.00 in the DB:

$this->cleanUpFields();
$this->Order->create();
if ($this->Order->save($this->data)) {

In my 1.3 migration build I am getting 'tax' cannot be NULL and I see in 
the SQL insert op that indeed it is being set to NULL, and thus MySQL 
chokes on it.

Why did it operate correctly in the old 1.2 system and what should I do to 
correct this? It is pervasive across numerous classes and I want to get it 
right the first time.

Is this perhaps a difference in the way the form helper is handling 
initialization of the fields? Or somewhere in the model? I did not need to 
specify validation for these fields as used back in 1.2 etc.

Thanks in advance!

-- 
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/d/optout.


Re: belongsTo proper usage to avoid 1052 ambiguity?

2014-09-19 Thread MikeK
I fugured it out - problem is the name should be "favorite_lure" without 
the space. For some reason old 1.2 didn't mind.

-- 
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/d/optout.


Re: debug level on ajax request

2011-08-18 Thread mikek
> Hello,
>
> could anybody explain this behavior? i set in my app controller
>
> if($this->RequestHandler->isAjax()) {
>   $this->layout = 'ajax';
>   $this->autoRender = false;
>   Configure::write('debug', 0);
> }
>
> but notices and errors are even so sent. only when i set in core.php
> the debug level to 0, no notices etc. occures.

if requesthandler is working, you can do

 if($this->params['isAjax']==1) {
$this->layout = 'ajax';
$this->autoRender = false;
Configure::write('debug', 0);
 }






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


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


Re: debug level on ajax request

2011-08-18 Thread mikek
> Hello,
>
> could anybody explain this behavior? i set in my app controller
>
> if($this->RequestHandler->isAjax()) {
>   $this->layout = 'ajax';
>   $this->autoRender = false;
>   Configure::write('debug', 0);
> }
>
> but notices and errors are even so sent. only when i set in core.php
> the debug level to 0, no notices etc. occures.

have you added the RequestHandler component to your controller?


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


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


Re: Subclassing one's own Controllers

2011-08-18 Thread mikek
> I'm a reasonably-experienced cake developer (several shipping apps
> over a few years), and I've now got a project with a well-developed
> Controller class that now requires several variations, all of which
> would still rely on the same model. My general OOP instinct is to
> subclass the controller class, but when I try that in cake (1.3) I get
> a class-not-found error. I've seen some discussion of using behaviors
> for this, but that seems contrary to this setup, where the main
> controller has a model, plenty of views, methods, etc.

if you are planning on sub classing the controller, why not write a
component that all controllers use? move your core functions into the
component and then set up other controllers that handle the variations and
use that component.

/2pence

>
> Advice?
>
> thanks
>
> -eric
>
> --
> 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
>
>


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


Re: TABS in CAKEPHP

2011-08-18 Thread mikek
> Could any one having full coding for Ajax Tab in Cake PhP

use jquery ui and you get tabs for free
http://jqueryui.com/demos/tabs/

HTH



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

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


Re: how to send data from controller to other controller

2011-08-16 Thread mikek
> $follow keep user_id of follower_id when leader_id upload file
> I need to find follower_id and send to dashboard of follower and tell
> leader have upload file
> if I follow you tell when leader upload
> I would have value of follower come from?

you pass the leader_id to your script_index via the redirect in your
add_script()

ie

$id = $leader_id;

$this->redirect(array('action' =>'script_index',$id));

as for what else you do once you have passed the id over is up to you.


mikek


>
> 2011/8/16  :
>>>  i make sure my code is correct
>>> but i have no idea how to send $follow  to show in dashboard
>>
>>
>> in your dashboard action use loadModel to load in your Follow model and
>> then you can get access to your $follow array.
>>
>>
>> function script_index($id){
>>
>> $this->loadModel('Follow');
>>
>> $follow =
>> $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id)));
>>
>> }
>>
>> http://book.cakephp.org/view/992/loadModel
>>
>>
>>
>>
>>
>>>
>>> 2011/8/16  :
>>>>> I try to create notification system
>>>>>
>>>>>    function add_script() {
>>>>>
>>>>>         if (!empty($this->data)) {
>>>>>             $this->Script->create();
>>>>>             $this->Ring->bindUp();
>>>>>            $this->data['Script']['script_catagories_id'] =
>>>>> $this->data['Script']['scriptCatagories'];
>>>>>             $this->data['Script']['user_id'] =
>>>>> $this->Auth->user('id');
>>>>>             if ($this->Script->save($this->data)) {
>>>>>                 $id = $this->Auth->user('id');
>>>>>                 $follow =
>>>>> $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id)));
>>>>>                 $this->Session->setFlash(__('The script has been
>>>>> saved',
>>>>> true));
>>>>>                  $this->redirect(array('action' => 'script_index'));
>>>>>             } else {
>>>>>                 $this->Session->setFlash(__('The script could not be
>>>>> saved. Please, try again.', true));
>>>>>             }
>>>>>         }
>>>>>
>>>>> when data save check follows table if have  leader_id read data and
>>>>> send to dashboard controller
>>>>> I don,t know how to send data controller to other controller if
>>>>> possible please guide me
>>>>
>>>> i'd do the following
>>>>
>>>>
>>>>>                  $this->redirect(array('action' =>
>>>>> 'script_index',$id));
>>>>
>>>> and in your script_index action, add the find
>>>>
>>>>                $follow =
>>>> $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id)));
>>>>
>>>> make sure your models are related or use a loadModel to get access to
>>>> the
>>>> follow model.
>>>>
>>>>
>>>>>
>>>>> best regard
>>>>> taqman
>>>>>
>>>>> --
>>>>> 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
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> 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

Re: how to send data from controller to other controller

2011-08-16 Thread mikek
>  i make sure my code is correct
> but i have no idea how to send $follow  to show in dashboard


in your dashboard action use loadModel to load in your Follow model and
then you can get access to your $follow array.


function script_index($id){

$this->loadModel('Follow');

$follow =
$this->Follow->find('all',array('conditions'=>array('leader_id'=>$id)));

}

http://book.cakephp.org/view/992/loadModel





>
> 2011/8/16  :
>>> I try to create notification system
>>>
>>>    function add_script() {
>>>
>>>         if (!empty($this->data)) {
>>>             $this->Script->create();
>>>             $this->Ring->bindUp();
>>>            $this->data['Script']['script_catagories_id'] =
>>> $this->data['Script']['scriptCatagories'];
>>>             $this->data['Script']['user_id'] = $this->Auth->user('id');
>>>             if ($this->Script->save($this->data)) {
>>>                 $id = $this->Auth->user('id');
>>>                 $follow =
>>> $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id)));
>>>                 $this->Session->setFlash(__('The script has been
>>> saved',
>>> true));
>>>                  $this->redirect(array('action' => 'script_index'));
>>>             } else {
>>>                 $this->Session->setFlash(__('The script could not be
>>> saved. Please, try again.', true));
>>>             }
>>>         }
>>>
>>> when data save check follows table if have  leader_id read data and
>>> send to dashboard controller
>>> I don,t know how to send data controller to other controller if
>>> possible please guide me
>>
>> i'd do the following
>>
>>
>>>                  $this->redirect(array('action' =>
>>> 'script_index',$id));
>>
>> and in your script_index action, add the find
>>
>>                $follow =
>> $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id)));
>>
>> make sure your models are related or use a loadModel to get access to
>> the
>> follow model.
>>
>>
>>>
>>> best regard
>>> taqman
>>>
>>> --
>>> 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
>>>
>>>
>>
>>
>> --
>> 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
>>
>
> --
> 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
>
>


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


Re: how to send data from controller to other controller

2011-08-16 Thread mikek
> I try to create notification system
>
>function add_script() {
>
> if (!empty($this->data)) {
> $this->Script->create();
> $this->Ring->bindUp();
>$this->data['Script']['script_catagories_id'] =
> $this->data['Script']['scriptCatagories'];
> $this->data['Script']['user_id'] = $this->Auth->user('id');
> if ($this->Script->save($this->data)) {
> $id = $this->Auth->user('id');
> $follow =
> $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id)));
> $this->Session->setFlash(__('The script has been saved',
> true));
>  $this->redirect(array('action' => 'script_index'));
> } else {
> $this->Session->setFlash(__('The script could not be
> saved. Please, try again.', true));
> }
> }
>
> when data save check follows table if have  leader_id read data and
> send to dashboard controller
> I don,t know how to send data controller to other controller if
> possible please guide me

i'd do the following


>  $this->redirect(array('action' => 'script_index',$id));

and in your script_index action, add the find

$follow =
$this->Follow->find('all',array('conditions'=>array('leader_id'=>$id)));

make sure your models are related or use a loadModel to get access to the
follow model.


>
> best regard
> taqman
>
> --
> 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
>
>


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


Re: Where can i save custom images?

2011-07-06 Thread mikek
> Hello People.
>
> I've a website where users can save their own profile picture. I'm
> storing those pics in /app/webroot/img/uploads (chown to that
> uploads).
>
> The problem is that every time i want to update the site to a newer
> version, i've to move the entire uploads folder.

you should store your app folder outside of your cake directory.

mine sits something like this

/project/cake/
/project/app/
/project/webroot/

you just need to point your host file to serve from /project/webroot/ and
then define paths for ROOT, APP_DIR and CAKE_CORE_INCLUDE_PATH inside
webroot/index.php





>
> Where can i store them to avoid this situation?
>
> Thanks.
>
> --
> Santiago Basulto.-
>
> --
> 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
>
>


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


Re: CakeFest?

2011-06-29 Thread mikek
larry

> Prices are early bird, they will be increasing soon after we publish the
> schedule.

according to the cakefest website, early bird prices apply till the end of
july. based on your comment above, is that still the case?

cheers
mikek


>
> --
> Larry E. Masters
>
> On Wed, Jun 29, 2011 at 7:56 AM, Jeremy Burns | Class Outfit <
> jeremybu...@classoutfit.com> wrote:
>
>> Thanks Larry. Can I reset my password?
>>
>> Are the prices on the site the early birds or the full amounts?
>> Whichever
>> they are, what are the others?
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com
>>
>> On 29 Jun 2011, at 13:52, Larry E. Masters wrote:
>>
>> According to http://cakefest.org/speak June 30 is last day to submit
>> talks. We will be posting the schedule soon after all talks have been
>> reviewed and selected. What questions have been raised and with who?
>> Since
>> we have not received any other reports of a password problem and many
>> have
>> signed up for the conference and others have done the same to submit
>> talks I
>> think you may be using the wrong password. I will remove your account
>> and
>> you can register again.
>>
>> For a faster response use the contact form on the site
>> http://cakefest.org/contact
>>
>> And follow the CakePHP twitter account http://twitter.com/cakephp it is
>> updated often with information
>>
>> --
>> Larry E. Masters
>>
>> On Wed, Jun 29, 2011 at 6:03 AM, Jeremy Burns
>> > > wrote:
>>
>>> What's the latest with CakeFest (64 days to go)? There are no schedule
>>> details, no news items since first posting on 14th May, no sponsors,
>>> there were some (unanswered) questions raised over pricing and I can't
>>> login with my details. Without these things I can't decide if I want
>>> to go or not.
>>>
>>> --
>>> 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
>>>
>>
>> --
>> Larry E. Masters
>>
>> --
>> 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
>>
>>
>>  --
>> 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
>>
>
> --
> Larry E. Masters
>
> --
> 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
>


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


Re: how to change layout in some action

2011-06-24 Thread mikek
> how to switch layout in some action
> when i use index page use green.ctp
> when i use view page use red.ctp


funnily enough, there is a whole section of the cake book that covers
layouts.

http://book.cakephp.org/view/96/Layouts



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


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


Re: Want help in using InPlaceEditor And Auto Complete together | CakePHP 1.3.8 Version

2011-06-08 Thread mikek
> Well Sir, I have tried to ... do the inPlaceEditor & autoComplete
> Both separately & have successfully done that too .. and dont noe how and
> where to proceed with ... to put both of them together.

The way you found
http://clockinfo.com/posts/32

seems to be pretty straightforward. i suggest you give that a try.

you'll need to adapt it for your needs, which you might need to think
about. expecting someone to pull a solution out of the bag for you which
you wont need to do anything to is naive.



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

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


Re: Want help in using InPlaceEditor And Auto Complete together | CakePHP 1.3.8 Version

2011-06-08 Thread mikek
> Still Waiting.

you'll never going to get someone to help you if you bump your post like
that.

ask a question showing some effort that you've at least made some attempt
at solving the topic and i'll be able to help.




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


Re: web music player for cake php 1.3

2011-06-08 Thread mikek
> Hi guys,
>
> I wanna know abt good music player for my new web site, it should be
> worked
> with cake php 1.38 and it should be capable of playing list of song names
> from DB and those are saved in different directories. its better easy
> loading simple player and it should be view play list!
>
> any suggestions

http://www.jplayer.org/

btw google is very useful for this sort of thing.


>
> --
> Ganganath Hettiarachchi
>
> --
> 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
>


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


Re: "7447-40-7" this value is not storing in database

2011-06-02 Thread mikek
> I want store this "7447-40-7" value in database. now its storing only
> 7447 only.
> Please help.

you are no doubt trying to save this in an int field which wont work.

if you need it in that format, change field type to VARCHAR otherwise
consider saving your number as 7447407 and then reformatting it in the
view to add the -.



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

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


Re: Static Username

2011-05-31 Thread mikek
> I am attempting to create a login.ctp page that takes the username and
> password from global environment variables and automatically performs
> a login. I can't seem to figure out how to make an input form accept
> "static text" rather than creating an input box.
>
> Login
>  $user = getenv('user');
> $pass = getenv('pass');
> echo $form->create('User', array('url' =>
> array('controller' => 'users', 'action' =>'login')));
> echo $form->input('User.username', array($user));
> echo $form->input('User.password', array($pass));
> echo $form->end('Login');
> ?>
>

try setting the value:

echo $form->input('User.username', array('value'=>$user));
echo $form->input('User.password', array('value'=>$pass));

TBH unless you are using javascript to automatically submit this form, you
would be better off having a controller action that reads in the username
and password and then redirects to the login action.





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

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


Re: Integration with osCommerce

2011-05-17 Thread mikek
> Hi,
> Did anyone made integration with shop  like osCommerce or virtuemart ?
> Or is there simple way to create cart with paypal?

look at the paypal ipn plugin which will make it easy to push to paypal
http://bakery.cakephp.org/articles/webtechnick/2009/08/11/paypal-ipn-instant-payment-notification-plugin-complete-with-paypalhelper

i've also just discovered kaching which also looks like a worthy contender

https://github.com/mfriesen/kaching-php

YMMV

mikek



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

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


Re: CakeFest 2011 - The CakePHP Conference

2011-05-16 Thread mikek
> $950.00 for all 4 days?
>
> Holy crap. I assume that is as the price includes a hotel room? What
> about people that live 5 minutes away from Venue?
>
> Is there any education discount, or just an entrance only price?

that is the entrance only price. fortunately works out pretty good for uk
attendees, good as in not having to fly.

mikek

>
> t.
>
>
>
> On May 16, 2:44 am, Graham Weldon  wrote:
>> Hey all,
>>
>> I'm thrilled to announce that CakeFest 2011 will be held on September
>> 1st through 4th in Manchester, UK!
>>
>> We've got a dual-stream planned for both the Conference and the
>> Workshops, and we've got some interesting talks lined up!
>> Talks will cover a whole range of topics, and the workshops are aimed
>> at serving beginners, intermediate and advanced users alike.
>> Those attending the workshops this year will be receiving a Cake
>> Software Foundation, Inc. issue training certificate. A great way to
>> show employers that you've received some training, and to set you
>> apart from other developers!
>>
>> The website is online now athttp://cakefest.org
>>
>> Call for papers is up athttp://cakefest.org/speak
>>
>> Drop me a line here or via the contact pagehttp://cakefest.org/contact
>> if you need any more information!
>>
>> Cheers,
>> Graham Weldon
>> (AKA: Predominant)
>
> --
> 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
>
>


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


Re: how can I set my home page

2011-05-05 Thread mikek


> Yes I'm using the Auth component, and yes I've added the Auth
> component in my AppController.
>  I'm new to CakePhp so this might sound like a stupid question
>
> I added the home action on $this->Auth-
>>allow('index','view','recover','verify','home');
> I thought this would solve the problem but its still asking me to log
> in. Please advice.


if you are using the pages controller to display your home.ctp then you'll
need to allow the 'display' action rather than the page you are trying to
display.





> this is my Appcontroller:
>
> class AppController extends Controller {
>   var $components = array('Auth','Session','Email');
>   //var $helpers = array('Time');
>
>
>   function beforeFilter(){
>   $this->Auth->allow('index','view','recover','verify','home');
>   $this->Auth->userModel = 'Practitioner';
>   $this->Auth->fields = array('username' => 'email', 'password' =>
> 'password');
>   $this->Auth->authError = 'To login please enter your email and
> password!';
>   $this->Auth->loginError = 'Incorect Email or password 
> combination.';
>   $this->Session->write('Auth.redirect', null);
>   $this->Auth->loginRedirect = array('controller' => 
> 'Practitioners',
> 'action' => 'index');
>   $this->Auth->logoutRedirect = 
> array(Configure::read('Routing.admin')
> => false, 'controller' => 'Practitioners', 'action' => 'logout');
>   $this->Model->authUserId = $this->Auth->user('id');
>   }
> }
>
> Thanks in advance
>
> On May 4, 10:56 am, Ryan Schmidt  wrote:
>> On May 3, 2011, at 17:07, mthabisi mlunjwa wrote:
>>
>> > I'm trying to set home.ctp as my home page/landing page. But no matter
>> > how I try I'm redirected to a different page(http://domain.com/
>> > practitioners/login).
>>
>> Sounds like you've added the Auth component (possibly to your
>> AppController). Is that possible? If so, that's what's asking you to log
>> in here.
>>
>> http://book.cakephp.org/view/1250/Authentication
>>
>> If you don't want users to have to log in to see your home page, then
>> you need to tell the Auth component that, for example by allowing the
>> display action. (This will allow all URLs handled by the Pages
>> controller (not just the home page) to be displayed.)
>>
>> http://book.cakephp.org/view/1656/allowedActions
>
> --
> 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
>
>


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


Re: Help! CakePHP runs great in localhost but doesn't even shows up in remote Server ...

2011-05-04 Thread mikek
> did anybody open a ticket for that yet?
> why it is not ROOT by default? because that would make sense after
> all :)

but it is..

from a fresh 1.3.7

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}

not sure why yours isnt.


>
>
> On 4 Mai, 15:25, jjw  wrote:
>> I've had this problem before. Look at webroot/index.php and look for a
>> path to your local installation, something like:
>>
>> define('CAKE_CORE_INCLUDE_PATH', 'C:' . DS . 'wamp' . DS . 'www' .
>> DS . 'myapp');
>>
>> I have to replace it with:
>>
>> define('CAKE_CORE_INCLUDE_PATH', ROOT .'');
>>
>> When I bake the project, it puts this path in there that is hard coded
>> for my localhost.
>
> --
> 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
>
>


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


Re: Route problem with PHP 5.3

2011-05-03 Thread mikek
> I've put an phpinfo() file into webroot folder and it was accessible with
> http://localhost/projectname/app/webroot/teste.php

your url shouldnt look like that if you have set up your httpd conf
correctly.

http://localhost/projectname/app/webroot/teste.php

should be

http://localhost/projectname/teste.php

or better

http://localhost/teste.php


hosts should look like


ServerName servername
DocumentRoot /data/projectname/app/webroot/

AllowOverride All
Order allow,deny
Allow from all




also check you've set correct paths in webroot/index.php

whist this doesnt affect the php issue, it should make the routing behave
better.

HTH


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


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


Re: UPDATE table

2011-04-21 Thread mikek
> I think you are missing some apostrophes and full stops...
>
> $this->User->query('UPDATE fociki_quests SET guest_id = ' .
> $this->user['id'] . ' WHERE id = ' . $user['User']['id']);
>
> I'd stick the SQL into a variable first and debug it to screen to check
> its syntax.

or use a cake syntax

$this->User->FokitiGuest->id= $user['User']['id'];
$result = $this->User->FokitiGuest->saveField('guest_id',$this->user['id']);

which is far cleaner.

HTH
mikek

>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>
> On 21 Apr 2011, at 10:52, chris...@yahoo.com wrote:
>
>> $this->User->query('UPDATE fociki_quests SET guest_id = ' $this-
>>> user['id'] WHERE id = ' . $user['User']['id']);
>
> --
> 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
>
>


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


Re: Problem with radio labels

2011-04-12 Thread mikek
> Hey,
>
> I am having a problem with my radio inputs and the corresponding
> labels.
> My code looks like this:
>   echo $form->radio('Model.0.fieldName', array('1' => 'Value1', '2' =>
> 'Value2', '3' => 'Value3'));
> ?>
>
> What I get as a result is
>  for="Model0FieldName">Value1
>  for="Model0FieldName">Value2
>  for="Model0FieldName">Value3
>
> What I am expecting to get is rather "Model0FieldName1" as "id" and
> "for" attribute (with the value added) so I could click on each label
> to select the radio button.
>
> Does anyone have an idea what I am doing wrong? Since the code is
> quite simple I don't know where else to look for the error.

you just need to loose the .0.

radio('Model.fieldName', array('1' => 'Value1', '2' =>
'Value2', '3' => 'Value3'));
?>

which produces

FieldNameValue1Value2Value3

which is what you are after.








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


Re: How to use a function of a controller from another controller

2011-04-11 Thread mikek
> Yeah. I tried taking the function in the model. And then, I added User in
> the $uses array of photos controller and it worked.

>From the book:

"It's bad practice to just add all the models your controller uses to the
$uses array. Check here and here to see how to properly access associated
and unassociated models respectively."

http://book.cakephp.org/view/961/components-helpers-and-uses

mikek

>
> Rishab
> Sent from BlackBerryŽ on Airtel
>
> -Original Message-
> From: Jeremy Burns | Class Outfit 
> Sender: cake-php@googlegroups.com
> Date: Mon, 11 Apr 2011 15:15:51
> To: 
> Reply-To: cake-php@googlegroups.com
> Subject: Re: How to use a function of a controller from another controller
>
> I would make those model functions (it looks like they are query type
> functions anyway) and then - so long as the User model is related in some
> way to the Photo model - you can access it like this: $users =
> $this->Photo->User->getAllUsers();  If the Photo model is not directly
> related to the User model (perhaps they are linked by a Photographer
> model) then daisy chain the models: $users =
> $this->Photo->Photographer->User->getAllusers();  You get the idea...
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>
> On 11 Apr 2011, at 15:10, Rishab Jain wrote:
>
>> Hi all,
>>
>> There's a controller:
>>
>> class PhotosController extends AppController {
>>var $name = 'Photos';
>>
>>   function index()
>>   {
>>  // I need to call the method getAllUsers() of the Users
>> Controller here.
>>   }
>> }
>>
>> 
>> And, there's another controller.
>>
>> class UsersController extends AppController {
>>var $name = 'Users';
>>
>>   function index()
>>   {
>>
>>   }
>>
>>   function getAllUsers($userid)
>>   {
>>// get the array for all the users from the database
>> and return the same.
>>   }
>> }
>>
>> ===
>>
>> Can anybody tell me how can this be done. I tried searching on the
>> internet, where people say that there are 2 ways of doing this.
>>
>> ===
>> 1.  App::import('Controller', 'Posts');
>>
>>  class CommentsController extends AppController {
>>//Instantiation
>>$Posts = new PostsController;
>>//Load model, components...
>>$Posts->constructClasses();
>>
>>function index($passArray = array(1,2,3)) {
>>  //Call a method from PostsController with parameter
>>  $Posts->doSomething($passArray);
>>}
>>  }
>> ===
>> 2. Making it a model.
>>
>> ===
>>
>> I get an error trying the first alternative. And I dont want to make
>> the function in the model. Let me know how can we do this.
>>
>> regards,
>> Rishab
>>
>> --
>> 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
>
> --
> 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
>
> --
> 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
>
>


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


Re: Print

2011-04-05 Thread mikek
> what anyone knows how to create scripts for the print button in
> CakePHP? please help

i suspect you are trying to invoke your browsers print function which
you'll need to do in javascript

http://www.quackit.com/javascript/javascript_print.cfm



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


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


Re: i'm newbie

2011-03-22 Thread mikek
> Hi I'm also a Newbie can someone please expain how the function pages
> work iv scene other peoples code and they have a file with all
> function for the index page and all the pages can someone please
> explain how this works thanks

you might want to look at the cake book.

http://book.cakephp.org/view/66/Models#!/view/4/Beginning-With-CakePHP

>
> On Mar 22, 3:34 pm, Stephen  wrote:
>> *Create:*
>> /app/views/pages/helloworld*.ctp* (not .html)
>>
>> *Visit:*http://localhost/pages/helloworld
>>
>> On 22 March 2011 02:11, aji ipank  wrote:
>>
>>
>>
>>
>>
>> > Hello all.. I want to learn about cakephp.. i've installed cakephp and
>> > no problem at all.. but now, i have one problem. i make hello world
>> > html file and i put it into app/views/pages. then i load it via
>> > localhost, but no hello world in my browser. can you help me? what was
>> > wrong? reply please..
>>
>> > --
>> > Our newest site for the community: CakePHP Video Tutorials
>> >http://tv.cakephp.org
>> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
>> > athttp://groups.google.com/group/cake-php
>>
>> --
>> Kind Regards
>>  Stephen
>>
>>  http://www.ninjacodermonkey.co.uk
>
> --
> 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
>
>


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


Re: Lock a page that is being edited by another user

2011-03-14 Thread mikek
> Ok. I guess I am looking for Optimistic Locking,
>
> has this been implemented on CakePHP? Anyone?

I'd add a field in your article table called editor_id and fill with the
user id when you begin to edit. then remove the id when you save.

obviously this will cause all sorts of locking hell if your user fails to
save the article which is going to bite you on whatever way you do it.

mikek

>
> Thanks
>
> On Mar 14, 2:50 pm, Sarpidon  wrote:
>> Hi, I tried searching for it but I cannot find anything useful. I am
>> trying to lock a page that is being edited by another user. In our
>> site there could be many admins editing the frontpage (choosing main
>> articles and so on), I want to be able to restrict the page to be
>> edited by a single user every time (and display a message to users
>> that are trying to edit the particular page . e.g. - This page is
>> being edited by user  please try again later).
>>
>> Is there a preferable approach to something like this?
>>
>> I guess I could store a cookie when the page is "open" and "closed"
>> but I am not sure how many things I have to take into consideration.
>>
>> Any help will be appreciated.
>
> --
> 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
>
>


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


Re: $this->Html->link with javascript back()

2011-02-25 Thread mikek
> can't find out how to resolve:
>
> go back
>
> with:
>
> $this->Html->link


you can do

echo $this->Html->link('go back',"javascript:history.back()");


i think its much better to add

$this->set('referer',$this->referer());

to your beforeRender();

and

$this->Html->link('back',$referer);

to  your view.

one less reliance on js is a win in my book.




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

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


Re: Using containable to limit my query

2011-02-21 Thread mikek
> HI Guys,
>
> I need your help guys.,, I'm getting confuse about using containable
> behavior, my problem is, I want to limit the output of [parseditem]
> have you seen below there are 3 feeds items I want to display only
> one.. what are the possible solution to achieve this.
>
> Here is my Controller code:
>
> $this->Feed->Behaviors->attach('Containable');
> $this->paginate = array('Category' => array('recursive'
> =>2,'contain'=>array('Feed','Parseditem' => array('limit' => 2;
>
> But it is not yet working, like what I have expected.
>
> Here is the data structure.
>
> [0] => Array
> (
> [Category] => Array
> (
> [id] => 1
> [name] => asian food
> [slug] => asian-food
> )
>
> [Feed] => Array
> (
> [0] => Array
> (
> [id] => 1
> [feed_url] =>
> http://steamykitchen.com/blog/feed
> [title] =>
> [popularity] => 7
> [error] => 0
> [Parseditem] => Array
> (
> [0] => Array
> (
> [id] => 796
> [feed_id] => 1
> [datetime] => 2011-01-28
> 11:12:42
> [permalink] =>
> http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
> [title] => Smoky Sweet
> Spicy Chipotle Cinnamon Wings
> [excerpt] =>
> )
>
> [1] => Array
> (
> [id] => 121
> [feed_id] => 1
> [datetime] => 2011-01-28
> 11:12:42
> [permalink] =>
> http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
> [title] => Smoky Sweet
> Spicy Chipotle Cinnamon Wings
> [excerpt] =>
> )
>
> [2] => Array
> (
> [id] => 366
> [feed_id] => 1
> [datetime] => 2011-01-28
> 11:12:42
> [permalink] =>
> http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
> [title] => Smoky Sweet
> Spicy Chipotle Cinnamon Wings
> [excerpt] =>
> )
>
> [3] => Array
> (
> [id] => 581
> [feed_id] => 1
> [datetime] => 2011-01-28
> 11:12:42
> [permalink] =>
> http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
> [title] => Smoky Sweet
> Spicy Chipotle Cinnamon Wings
> [excerpt] =>
> )
>
> )
>
> )
>
> Thank you in advance guys for your favorable response.

you need to add your limit to parsed item via Feed

$this->paginate = array('Category' =>
array('recursive'=>2,'contain'=>array('Feed'=>array('Parseditem' =>
array('limit' => 2);

you shouldnt also need to use recursive and contain - one or the other.



>
> Joseph P. Buarao
> Web Developer
> Azure Web Design.com
>
> --
> 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
>
>


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

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread mikek
It looks like theres a missing single quote in your
Configure::write('company', 'xxx)

which will cause the error you are getting.


> Some more info would help us help you. Can you show the actual error?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>
> On 15 Feb 2011, at 15:14, sanjib dhar wrote:
>
>> Hi!
>> I got unfinished class declaration  error.
>>
>> On Tue, Feb 15, 2011 at 8:10 PM, Stephen
>>  wrote:
>> What error message do you get? Configure is usually the way to go.
>>
>> On 15 February 2011 13:52, sanjibdhar...@gmail.com
>>  wrote:
>> I tried Configure::write('company', 'xxx);  in bootstrap.php and to
>> access the constant I wrote
>> var $company = Configure::read('company'); in AppController but it
>> gives syntax error.Can somebody tell me how to access the constant or
>> there is another way of to define a global constant through whole app.
>>
>> --
>> 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
>>
>>
>>
>> --
>> Kind Regards
>>  Stephen @ NinjaCoderMonkey
>>
>>  www.ninjacodermonkey.co.uk
>>
>>
>>
>> --
>> 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
>>
>>
>> --
>> 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
>
> --
> 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
>


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


Re: Is there a way to make all view context available in a helper's method? --psybear

2011-01-28 Thread mikek
> Oh, but another question: I'd like to make use of the elements()
> method within my helper. This doesn't seem to be possible...?

make a new function within the helper that contains what your element has
got in it. you can then share that between helpers.



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

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


Re: Changing the layout and appearance

2011-01-25 Thread mikek
> Hello, I'm new to cake php but i know a bit bout basic php.. I
> understand the MVC concept i think^^, i need to change the whole
> appearance and layout of a site powered by cakePhp..where can i find
> the file that controls the structure and appearance of the pages and
> how?? Sorry for my noobness.. tq all^^


look at http://book.cakephp.org/view/1080/Layouts

in relation to the changing view templates and layouts.

get familiar with the book as it has all your answers.

cheers
mikek

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


Re: ApiGenerator plugin: Exclude plugins directory... and some other questions. --psybear

2011-01-17 Thread mikek
> Isn't there anybody using ApiGenerator?

there is.

to exclude various stuff. make sure you have an [exclude] added to your
api_config.ini in api_generator/config/

mine is below:

[exclude]
properties = private
methods = private
directories = webroot, tmp, static, locale, vendors, .svn, plugins
files = index.php, empty

I dont know the answers to your other questions.

regards
mikek




> On Thu, Jan 13, 2011 at 11:28 AM, Joshua Muheim 
> wrote:
>> Another one:
>>
>> I have constants in my classes like so:
>>
>>  /**
>>   * Grenze, nach welchem Lebensjahr der Zivi höchstens noch 26
>> Diensttage pro Folgejahr bis Dienstende aufweisen darf.
>>   *
>>   * @var int
>>   */
>>  const AUFRAEUM_ALTER_IN_JAHREN = 27;
>>
>> But they don't seem to be considered in the documentation. Is this
>> normal? Aren't constants added to the API documentation?
>>
>> On Thu, Jan 13, 2011 at 10:22 AM, Joshua Muheim 
>> wrote:
>>> And another question:
>>>
>>> I'd like to have code examples in my method descriptions. I know that
>>> I can put them into back ticks for inline code, but it seems I can't
>>> create blocks of code using 4 spaces?!
>>>
>>>  /**
>>>   * Constructor.
>>>   *
>>>   *    This should be code
>>>   */
>>>
>>> Thanks for informations.
>>>
>>> On Thu, Jan 13, 2011 at 9:32 AM, psybear83  wrote:
>>>> Hey everybody
>>>>
>>>> I'm trying to get the ApiGenerator plugin to do what I want. I have
>>>> placed it in myapp/app/plugins, and built the index using
>>>>
>>>> cake api_index update
>>>>
>>>> Now I have some problems...
>>>>
>>>> 1) I don't want the ApiGenerator to generate the API for the myapp/
>>>> plugins directory, because in there is the ApiGenerator itself, and I
>>>> don't want my generated API to be cluttered up with ApiGenerator's
>>>> API. I tried moving the plugin to myapp/plugins, but then when running
>>>>
>>>> cake api_index update
>>>>
>>>> it doesn't find the database configuration anymore. I guess I haven't
>>>> really understood how myapp/plugins and myapp/app/plugins differ in
>>>> what they really are meant to be...?
>>>>
>>>> 2) I'm writing a custom library in OOP PHP5 that is placed in myapp/
>>>> app/libs. Some of these files are found by ApiGenerator, but others
>>>> aren't, and I'm not able to find the reason.
>>>>
>>>> For example, Einsatz class is found:
>>>>
>>>> myapp/app/libs/einsatz.php
>>>> >>> /**
>>>>  * Einsatz File.
>>>>  *
>>>>  * PHP version 5
>>>>  * CakePHP version 1.3
>>>>  *
>>>>  * @package    zivisim
>>>>  * @subpackage zivisim.libs
>>>>  */
>>>>
>>>> /**
>>>>  * Included libs
>>>>  */
>>>> App::import('Lib', array('OptionsSetter'));
>>>>
>>>> /**
>>>>  * Einsatz Class.
>>>>  *
>>>>  * @package    zivisim
>>>>  * @subpackage zivisim.libs
>>>>  */
>>>> class Einsatz extends OptionsSetter {
>>>>  ...
>>>> }
>>>> ?>
>>>>
>>>> But DiensttageCalculator isn't:
>>>> myapp/app/libs/diensttage_calculator.php
>>>> >>> /**
>>>>  * DiensttageCalculator File.
>>>>  *
>>>>  * PHP version 5
>>>>  * CakePHP version 1.3
>>>>  *
>>>>  * @package    zivisim
>>>>  * @subpackage zivisim.libs
>>>>  */
>>>>
>>>> /**
>>>>  * Included libs
>>>>  */
>>>> App::import('Lib', array('OptionsSetter'));
>>>>
>>>> /**
>>>>  * DiensttageCalculator Class.
>>>>  *
>>>>  * @package    zivisim
>>>>  * @subpackage zivisim.libs
>>>>  */
>>>> abstract class DiensttageCalculator extends OptionsSetter {
>>>>  ...
>>>> }
>>>> ?>
>>>>
>>>> I can't see any significant difference between the two files and their
>>>> content. Maybe someone of you can point me into the right direction?
>>>>
>>>> Thanks
>>>> Josh
>>>>
>>>> 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
>>>>
>>>
>>
>
> 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
>
>


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: Documenting a small CakePHP project: Best practices? --psybear

2011-01-04 Thread mikek
hi josh

> Thanks, I will take a look at your API generator.

i cant take any credit for the api_generator. its the one used to make
api.cakephp.org

a joy to use.

> On Tue, Jan 4, 2011 at 4:12 PM,   wrote:
>>> Hey everybody
>>>
>>> I have to start a small CakePHP application from scratch. I want to do
>>> this in a highly professional way, which also means that I want to
>>> properly document the project.
>>>
>>> Besides documenting the sources properly, I'm wondering how to
>>> document other stuff centrally, e.g. business rules, requirements,
>>> purpose of the project etc.? Should this all be put into the README
>>> file? Or should I write Word documents and put them somewhere in the
>>> project (e.g. app/docs/)?
>>>
>>> Indeed, it would be very nice to be able to document everything within
>>> the sources and then compiling PHPDoc and having a complete
>>> documentation of the whole project. But though I basically know how to
>>> use PHPDoc, I don't know how to use it best or to what extent it can/
>>> should be used.
>>>
>>> Maybe there's a good project somewhere in a SVN/GIT repository that I
>>> could take a look at and apply its documenting principles to my
>>> project? Or a best practices blog post about this topic?
>>
>> Having recently implemented api_generator i'd suggest a look at.
>> https://github.com/cakephp/api_generator
>>
>> You'll also benefit from looking at PHPDoc syntax. If you use textmate
>> you'll get a PHPDoc bundle to work from.
>>
>> HTH
>> mikek
>>
>>
>>> Thanks a lot for help
>>> Josh
>>>
>>> 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
>>>
>>>
>>
>>
>> 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
>>
>
> 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
>
>


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: Documenting a small CakePHP project: Best practices? --psybear

2011-01-04 Thread mikek
> Hey everybody
>
> I have to start a small CakePHP application from scratch. I want to do
> this in a highly professional way, which also means that I want to
> properly document the project.
>
> Besides documenting the sources properly, I'm wondering how to
> document other stuff centrally, e.g. business rules, requirements,
> purpose of the project etc.? Should this all be put into the README
> file? Or should I write Word documents and put them somewhere in the
> project (e.g. app/docs/)?
>
> Indeed, it would be very nice to be able to document everything within
> the sources and then compiling PHPDoc and having a complete
> documentation of the whole project. But though I basically know how to
> use PHPDoc, I don't know how to use it best or to what extent it can/
> should be used.
>
> Maybe there's a good project somewhere in a SVN/GIT repository that I
> could take a look at and apply its documenting principles to my
> project? Or a best practices blog post about this topic?

Having recently implemented api_generator i'd suggest a look at.
https://github.com/cakephp/api_generator

You'll also benefit from looking at PHPDoc syntax. If you use textmate
you'll get a PHPDoc bundle to work from.

HTH
mikek


> Thanks a lot for help
> Josh
>
> 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
>
>


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


1.26 Stable and Pagination

2010-03-08 Thread MikeK
IWe're working on an upgrade to 1.26 stable and are finding a lot of
references to issues in the pagination helper in which parameter #2 to
array_merge is not an array. var_dump shows they are indeed arrays,
and this is usually on the url parameter.

See refs to url lines 258 and 344 in the paginator helper code.

The error is flagged when using paginator helper methods where url is
set using syntax such as
$options = array( 'url' => $somevar);

Casting the refs in the paginator code to be (array) makes everything
work properly.
344 org: $url = array_merge(array('page' => $paging['page'] + ($which
== 'Prev' ? $step * -1 : $step)), $url);
344 fix: $url = array_merge(array('page' => $paging['page'] + ($which
== 'Prev' ? $step * -1 : $step)), (array)$url);

So does changing the input in the view to
$options = array(array( 'url' => $somevar));

Looking at the spec for the options in those functions it does not
appear that urls must be an array within the options array, but is
this stated elsewhere?

Just trying to get it right before hitting a bunch of pagination code
for updates. I noticed in an older release that in internal function
in the paginator helper called am() used to be used and it did some
manipulation which made our original syntax work. Should we input a PR
into the system or are all our input references actually wrong?

Other than plugging in a new cake core behind our 10,000 lines of cake
code how would we know this type of change was out there? Is there a
summary list that shows API changes and functions deprecated across
releases to ease forward migration of large code bases? Bashing
through the migration like this is quite painful :(

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: Do I need Ajax?

2010-03-05 Thread MikeK
Well I have pagination working both with and without ajax. And I do
use elements for the two different tables.

The problem is URLs and figuring out what to render - this can't be
impossible with Cake 1.2 - too many websites do this very simple
thing.

I build an action "showall" in controller Tasks, and the action runs
paginate on both Tasks and People and passes the results to the view.

The view sequentially renders each element:

renderElement('taskselement'); ?>





renderElement('peopleelement'); ?>


Each element then draws the table and puts out pagination options next
and prev with "url" => passedArgs.

Invoication of http://www.mysite.com/people/showall shows the tables
but the pagination options are incorrect on one of the tables (the
count is wrong in pagination->numbers) and the links in both tables
point to /people/showall

I've tried it with Ajax but cannot seem to get the links right or the
routing.

What I want is when a user clicks a link in the People table is for an
ajax request to go to my server and we return the next People page,
and when the user clicks a link in the Tasks table only the Tasks
table is updated. I have other actions that do nothing but get a
people page or get a task page but cannot figure how to hook them up
in this puzzle.

I'm cold against the wall at this point. Perhaps this will require
Ajax and some more complex JScript to make the right thing happen?

If some CakePHP guru has done this already I'm willing to pay for it
at this point.

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


Do I need Ajax?

2010-03-05 Thread MikeK
I think I may finally need to go AJAX, just looking for some
confirmation.

I have 2 controllers, models, views, etc called People and Tasks.

I already have all the individual vews put together and working fine
but I would like to be able to put up a single web page that shows the
People table on the left and the Tasks table on the right.

Each table has it's own pagination links at the bottom of the table
and I need for the user to be able to individually page each table.

For example user may be on page 3 of People table and on page 7 of
Tasks table.

Is this what Ajax is all about getting done?

Also which controller would I pull these requests together in? A 3rd
controller that makes requests to the People and Tasks controllers for
them to render the appropriate action?

Can this sort of display be done (albeit kludgy) without Ajax too?

I apologize in advance if this is abvious.

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


deprecation and forward migration question

2010-02-05 Thread MikeK
We are working on moving a giant app foward from 1.2.5875 pre-beta to
the latest stable 1.2. When we last scoped this out a year ago ago to
assess the effort all findAll calls etc were triggering the
deprecation error code. When we downloaded the latest stable cake we
noticed the deprecation trigger errors are commented out. Was this a
decision not to actually force migration forward and allow the old API
to continue forward?

Thanks in advance - we're moving forward we just want to do it right
while obviously not changing things that are no longer really
deprecated.

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


Problem with Scripts_In_Layout in earlier version of cake 1.2

2010-02-02 Thread MikeK
We have an application that was written with an earlier version of
Cake 1.2 (5875 prebeta) - we will be upgrading to the latest release
in a couple of weeks but we ran across an issue with a single action
that is blowing away the $this->__scripts var that is the basis of
$scripts_in_layouts. As a result the page does not work without it's
scripts.

$scripts_in_layouts works fine for just about every other action in
this substantial application except for this single action. What makes
this action different that all the others is its use of $this-
>requestAction to pull formatted data together. If we remove all
invokations of requestAction the $scrripts_in_layouts variable remains
intact and all is fine. The minute we let one of the requestAction
requests invoke another action which returns it's rendered output it
seems the $scripts_in_layouts var is getting boffed.

We know we have to upgrade and are allocating 2 weeks next month to do
it - much has changed since the very early 1.2 releases and beta
releases but this is a deployed application with over 250 Cake files
that have to be scrubbed for usage of deprecated and modified
functionality. Anyone who can finger what we are running up against
would definitely qualify as a supra-genius and make our day ;)
Something in the back my little mind tells me along the way someone
fixed a memory leak, corruption, or stack issue that we are running
into. We are running php5.

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: Search Engine Bots Generating Strange Queries

2008-11-05 Thread MikeK

Thank you Matthew - I log it everytime before throwing the 404 and I
figured whatever was creating these things would stop - but it
continues. I'm so dadgum anal obsessive it just kills me - hard to
ignore...

It is not coming from any 'known' bot either...
--~--~-~--~~~---~--~~
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: Search Engine Bots Generating Strange Queries

2008-10-31 Thread MikeK

So you're saying the search bots are just walking all my actions as if
they are subdirs on a site? Not sure about this.

Maybe I should disallow those specific requests with robots.txt? Any
other cakers have an opinion on this? If I disallow

www.mydomain.com/controller/action/ wont the bots stop walking all the
actions?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Search Engine Bots Generating Strange Queries

2008-10-29 Thread MikeK

In a general CMS app written in CakePHP I am noticing in my logs
invalid queries being generated by various search engine bots
including Google, Inktomi, and Yahoo.

What I'm wondering is WHY?

For example they are requesting

http://mysite.com/controller/view instead of the correct

http://mysite.com/controller/view/34 (ex: id 34)

Nowhere on my site do I publish any links to /controllers/view without
an id parm

This is driving me slightly nuts. Why would a bot request a URI it has
never seen?

My validation code that checks for valid requests logs these
occurences and every day I puzzle over my logs and examine the emitted
web page source wondering where or why they are requesting these
invalid URIs. I've been dumping $_SERVER and no clues there either.
The referer is always '/'.


--~--~-~--~~~---~--~~
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: Trailing Slash URI madness

2008-10-06 Thread MikeK

One more piece of info. When I do not use the trailing slash the URL
is set to
http://mydomain.com/app/webroot/x/

If I do include the trailing slash on my request the URLs do not have
app/webroot in them. Is this something I can correct with a route or
my htaccess? mod_rewrite is enabled, and the default htaccess rules
that came with cake are in place.

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



Trailing Slash URI madness

2008-10-06 Thread MikeK

I've read a zillion posts about trailing slash and am not sure what my
deal is.

I have a php hello world app in webroot/x named index.php

It is a standard cake install where app and cake dirs are in
public_html

If I browse to www.mydomain.com/x/ everything looks fine and it
invokes the code in folder x file index.php - all URL is 
http://www.mydomain.com/x/
in the browser - notice the trailing slash is present.

HOWEVER If I browse to www.mydomain.com/x WITHOUT the trailing slash
my URLS switch to just http://mydomain.com/x/ in the browser although
the code runs fine.

Any idea why I am seeing this behavior? It's definitely the cake
router or dispatcher doing something I'm not understanding. .htaccess
has the standard stuff that come in the distribution.
--~--~-~--~~~---~--~~
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: Trailing Slash URI madness

2008-10-06 Thread MikeK

This coming and going of the www. is causing me major headaches in
some cookie code with other modules I have bridged to my app.
--~--~-~--~~~---~--~~
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: Moved my CakePHP directory - How to Redirect?

2008-09-20 Thread MikeK

Thanks Willis - I finally came up with the same thing - I appreciate
the confirmation. I had to add the second rule to pick up requests to
the 'home or default' page for the site without the trailing slash as
well.

RewriteRule  ^myappdirams/(.*)$  /$1  [R=301,L]
RewriteRule  ^myappdir  /  [R=301,L]

To the guys that live and breath mod_rewrite and regexp We Salute You!
--~--~-~--~~~---~--~~
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: Moved my CakePHP directory - How to Redirect?

2008-09-19 Thread MikeK

Thanks for the ref to the video - it'a another nifty way of
reorganizing things but I have the thing working properly without
'myappdir' in the picture. I'm just trying to set it up so that folks
who come into the site using the old link structure get properly and
transparently mapped to the new structure without the 'myappdir'
business.

I have tried doing this with a route such as:
Router::connect('/myappdir/:controller/:action/*', array('controller'
=> ':controller', 'action' => ':action'));

and it works, somewhat. The problem is any links I created with
$html->link('Name', array('controler'=> 'controllername', 'action' =>
'actionname'))

now show up with myappdir within them!

If I specify a link as in
$html->link('Name', array('/controllername/actionname''))

then myappdir is NOT in the generated link. It appears the URL
function generates different results based on how I pass in the SAME
parameters (array vs path) when that route rule is in effect.

There's gotta be an easy way to specify this in the .htaccess - it's
just killing me!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Moved my CakePHP directory - How to Redirect?

2008-09-19 Thread MikeK

My Cake app used to be at www.mydomain.com/ams. The app and cake
subdirs lived there and the default .htaccess files were funneling
things to webroot. Most web requests looked like:

www.mydomain.com/mycakedir/controller/action/parms

Now I have moved things to remove mycakedir completely. the app and
cake subdirs now live in public_html of my site and everything works
fine once I setup the htaccess so all request now work with:

www.mydomain.com/controller/action/parms

The problem I have been putting dents in my head with is how to
redirect the old requests to the new location. I have tried using
htaccess redirect 301, I have tried doing 301 redirects with mod-
rewrite since we have it available and I cant seem to figure out how
to do:

www.mydomain.com/mycakedir/controller/action/parms =>
www.mydomain.com/controller/action/parms

The simplest solution I am thinking must be at the apache htaccess
level. Can someone give me some htaccess syntax that works or some
good advise on a different method for redirect?

Everything that comes into www.mydomain.com at the root level is
intercepted by the cake router. Is there a way for me to interpret
these requests, remove the 'mycakedir' from the request and redirect
properly? Also I think it needs to have a 301 header as well (or does
it?).

Any help is much appreciated.


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



Right way to handle 'errant' attempts to browse my content when it changes?

2008-09-18 Thread MikeK

I suspect I am making google very angry. I have a general content
management application.

In my actions I validate all the input to make sure all is cpoacetic.
However what is the 'proper' action I should take when ggogle for
example comes along and requests a page that has been deleted?

For example www.mysite.com/myapp/action/view/134 might be fine and
dandy on Monday, but on Wednesday the user deletes something and now
record 134 no longer exists.

I detect in the view action (for example) that the requested id is no
longer around but what should I throw up there for the entity that
requested the web page?

Right now I do the following when I detect these requests for deleted
data pages:

$this->cakeError('error404',array(array('url'=> 'http://' .
MY_SERVER_NAME . $_SERVER['REDIRECT_URL'])));
$this->Session->setFlash($this->action . ': Invalid  ID.');
$this->redirect(array('action'=>'index'), null, true);  // GO TO A
KNOWN GOOD PAGE

Is there a better approach?


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



READ and SAVE SIDE EFFECT QUESTION

2008-08-25 Thread MikeK

I was debugging some filter code and came across some side effects I
never noticed before and wanted to confirm them and whether or not
these effects should be assumed by code or not.

I noticed that invoking $this->model->read() always sets $this->data
to the results. Never knew this before, always figured I needed to set
it myself. Can/Should I rely on this?

I also noticed (I think) that invoking $this->model->save() also sets
$this->data to the updated record contents. Once again can/should I
rely on this?

I noticed this in some filters where I was looking at $this-
>model[model][id] to determine if I was in a create or edit mode, and
had some code to update some dependent fields in other models. When I
invoked code in other models I noticed $this->data was cleared on the
invokation. When the other model code did a read it instantiated $this-
>data, and further if the other model called save $this->data
immediately reflected the updated values even though I had not set it
explicitly.

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



Re: Question about install dir, .htaccess, and routes

2008-05-23 Thread MikeK

I responded to your email. I like you am asking for help. I suggest
you post your issue on another thread and perhaps someone with more
knowledge than I can help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question about install dir, .htaccess, and routes

2008-05-23 Thread MikeK

OMG I found the answer to the last question - in function baseURL in
the dispatcher it actually doctors up the URLs if you are using the
default app name of 'app' and webroot name of 'webroot' - this type of
HACK tells me all I need to know on the original question -- I think
I'll just move the subdir!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question about install dir, .htaccess, and routes

2008-05-23 Thread MikeK

One final question to add. WHen I take the 'app' subdir and place it
in public_html with everything in webroot/index.php configured as
default, I NEVER see 'app' in any paths generated by the link helpers.
However the moment I rename app to anything else (in index.php), all
of a sudden the APP_DIR name starts appearing in the links. Why is
'app' treated differently than others as an APP_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
-~--~~~~--~~--~--~---



Question about install dir, .htaccess, and routes

2008-05-23 Thread MikeK

I am attempting to clean up my URLs just a hair and have a question
for those that have more experience with tweaking how cake and my app
are installed, and usage of .htaccess and routes.

I apologize in advance to the gods of cake if this question is not to
your liking ;) But I appreciate any advise you can offer. I have
researched this quite a bit and prototyped to my wit (yes singular
wit) end.

Currently in public_html, the root of my site is a subdir named 'ams',
and inside it is the std cake distribution with my application
installed in 'app' and cake in 'cake' within the 'ams' dir. In
public_html is an index.html (or jscript or php) that redirects a
request to www.mysite.com to www.mysite.com/ams, at which point the
std .htaccess that came with cake rewrites the request and sends
things along to 'app/webroot' and ultimately the home page via a route
in my config. From that point on every link and request is of format
www.mysite.com/ams/controller/action etc.

What I would like to do is remove the 'ams' from all URLs and links
completely, so that a request to www.mysite.com goes directly to the
home page, and I would like the ams bit out of every link and URL.

So far the only way I have gotten this to work is to move the app and
cake subdirs within 'ams' up to public_html, and add the bit for
rewriting requests from the .htaccess in the 'ams' subdir' into
the .htaccess in public_html, and removing my redirection from
index.html.

While this works fine I was wondering whether I could use rewrite
rules in combination with modifying the default paths in webroot/
index.php to get the same effect without actually doing away with the
ams subdir and leaving the directory structure intact. My attempts to
do away with the 'ams' in paths without moving the app subdir up to
public_html have been fruitless. I have tried putting a rewrite rul to
ship requests to public_html to ams/app/webroot, and while this has
the desired effect my attempts to adjust ROOT and APP_DIR  etc have
not worked. What's the 'right' way to get this done?
--~--~-~--~~~---~--~~
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 Validation Question

2008-05-14 Thread MikeK

I have read the posts extensively on this topic and believe I finally
have this working the way I need it to. Just wondering if the gurus
(yes that's you Nate!) could confirm I got it done the right way. I am
quite excited by the richness of the 1.2 validation feature -- I'm
removing all the ugliness I created in the controller making
validation what I needed in the past and am trying to do it the
'right' way in the model only.

I have a user model in which a subset of the fields are required - the
caveat is that only a portion of the required fields are required
during registration (on create) and the balance are required on
updates (my activation and user profile edit actions in which the user
inputs the rest of the required data or edits it).

Not to bore you with repetitive stuff but here's how I handled my zip
code field. Zip is not required on the create operation (Registration)
but is later required on Updates (Activation, Edit, etc).

Apologies in advance for the formatting if it is bad:

 var $validate = array(
'zip' => array(
'zip' => array(
'rule' => array('postal', null, 'us'),
'message' => 'Must be a valid zip code.',
'required' => true,'allowEmpty' => true,
'on' => 'create',
),
'zip2' => array(
'rule' => array('postal', null, 'us'),
'message' => 'Must be a valid zip code.',
'required' => true,'allowEmpty' => false,
'on' => 'update',
),
) // END OF ZIP VALIDATION
);

This seems to have the desired results -- is there a more efficient
encoding of these arrays? Does it really matter what I call the array
indices (zip and zip2)? Thanks in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: One more 5875->6311 migration question

2008-05-07 Thread MikeK

Forgot to ask - please point me to the documentation of namedArgs and
passedArgs ;)

--~--~-~--~~~---~--~~
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: One more 5875->6311 migration question

2008-05-07 Thread MikeK



thanks guys - first I've heard of passArgs and namedArgs -- it's not
like there's a DOCUMENT, and theres tons of code here and around the
web that does use params['pass']! I haven't been asleep and have read
all thats available. THanks again!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



One more 5875->6311 migration question

2008-05-07 Thread MikeK

Came across another migration issue - I see parameters which were
previously passed in params['pass'] are now in params['named'] - is
there an easier way to figure out when stuff is changing beneath me
rather than getting broken when trying an upgrade?

I read the changelog and although it says 'named' was added it doesn't
detail that the old interface would go away - and the way parms are
passed IS an interface.

At this point I am seriously questioning whether I should upgrade from
5875 at this time-- if APIs and interfaces continually change it
seriously discourages a developer from upgrading at all. I am not
interested in chasing an ever-evolving specification -- I have to
deliver code that works for an enterprise. When mgmt sees us spending
precious cycles in this manner they question our decisions on
technology choices.

This is not a throw down on the cakePHP team -- it is a fine framework
and your efforts are to be commended. However it is a serious request
for consideration. As an OS developer of 25 years this is not how you
win the hearts and minds of developers that build serious applications
and code bases.
--~--~-~--~~~---~--~~
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: ARGHH - why is geneateList deprecated

2008-05-07 Thread MikeK

LOL, thanks fellas -- I only let my closest friends call me
snowflake ;)

Just curious -- does the find("list") and set::combine apis work on
the 5875 code base too?
--~--~-~--~~~---~--~~
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: ARGHH - why is geneateList deprecated

2008-05-07 Thread MikeK

Thanks for the response, especially yours Nate. It's not a simple find
and replace as the syntax of the additional calls must be massaged for
each one and is different for various forms and models. Yes my editor
has search and replace and your tone SUCKS. It says I should consider
myself LUCKY such a BRILLIANT mind as yours deigns to provide such
wonderfule FUNCTIONALITY.

Where is the documentation on the new and 'beautiful' find("list") ?
It's not in the API and it appears the old manual has been gutted.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ARGHH - why is geneateList deprecated

2008-05-07 Thread MikeK

Talk about frustrating -- tried moving from 5875 to 6311 code today
and was quite frustrated by this. I only have like 50 different calls
to generateList across 10 files that will need manual recoding.

Is there an easier way? I mean what was wrong with this API? I'll stay
on 5875 until I have time to do unproductive API chasing -- I have too
much real work that needs to be done and 5875 is stable for me.

Flame off ;)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Sessions Weirdness

2008-05-03 Thread MikeK

We used to have our cake app running in a subdir off our public_html
called "foo". So all cake paths were
http://mysite.com/foo/controller/action/

We moved the app to the root directory and restructured the site to
let everything else hang from the cake app's webroot. We just noticed
suddenly some code that uses session vars is inexplicably no longer
working. We have no hard-coded paths whatsoever.

For example a controller sets a session var to remember the refering
webpage. It is still instantiated in the view which is a form. WHen
the form is submitted and we run back through the controller the
session var of the original referring page is caput! ALso our email
functions which pass set vars to templates stopped working.

Can;t imagine what we did to make it mad - any advise is greatly
appreciated. Dents in my head I have to call it a night.

--~--~-~--~~~---~--~~
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: Route Redirect question

2008-05-03 Thread MikeK

The specific route to fix our payment gateway issue for payments
initiated before we restructured the site appears to work. The other
bit I am wondering if we need something in .htaccess to generally
rewrite these requests? And if that's the better place to do it, how?
the rewrite rules are something we've never quite mastered.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Route Redirect question

2008-05-03 Thread MikeK

We used to have our cake app running in a subdir off our public_html
called "foo". SO all cake paths were
http://mysite.com/foo/controller/action/

We moved the app to the root sirectory and restructured the site to
let everything else hang from the cake app's webroot. As a result we
have some users with old links that will 404 - one of these users is a
payment gateway that has been missing us (oops).

I put in a route for the payment gateway routine specifically:
Router::connect('/foo/user/paid', array('controller' => 'user',
'action' => 'paid'));

How can I make that route or another generall route all the old
requests to our site with foo in the path work properly? IE translate:
http://mysite.com/foo/controller/action/p1/p2/

into
http://mysite.com/controller/action/p1/p2/

For any controller with any number of arguments?

Thanks in advance!


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



Re: Argument passed By Reference From Controller to Model

2008-04-29 Thread MikeK

Dang just checked the manual - I guess overloading breaks references
in php5 also - see http://www.php.net/language.oop5.overloading

--~--~-~--~~~---~--~~
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: Argument passed By Reference From Controller to Model

2008-04-29 Thread MikeK

Thanks but it happens on both 4.4.7 and 5.2.4 - frustrating!

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



Argument passed By Reference From Controller to Model

2008-04-29 Thread MikeK

This issue cropped up in a CakePHP app but I think our problem is more
related to something we don't understand about PHP. It seems
invocation ofvia $this of a method in an associated class does not
properly handle arguments by reference.

In a Bait controller class (BaitsController) a function foo from the
Bait model class is invoked - $this is properly instantiated:
function test()
{
Bait::foo($xxx); // works correctly
$this->Bait->foo($xxx); // does not work
}

In Bait model function foo() takes the parm by ref and sets it's
value:

function foo(&$msg)
{
$msg = "HOWDY DOODY";
}

ERROR is Undefined variable:  xxx ...

If you put function foo within the Bait controller class $this->foo()
works fine. However if you put it in the model Class using the $this-
>Bait->foo() invocation syntax seems to ignore the parameter by
reference although it does call the function. What's up with that?
Does PHP not pick up the call by reference declaration for a dynamic
call? Does this violate a data hiding tenet of object orientation?
--~--~-~--~~~---~--~~
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: Call by reference weirdness across Classes

2008-04-28 Thread MikeK

Cmon guys help me out. Why does this not work in 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: Call by reference weirdness across Classes

2008-04-28 Thread MikeK

One other bit of data we are running php 4.4.7
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Call by reference weirdness across Classes

2008-04-28 Thread MikeK

This may be more of a PHP issue than Cake but ya'll gurus probably
know why this is a problem.

In a controller for Bait function foo

function test()
{
Bait::foo($xxx); // works correctly
$this->Bait->foo($xxx); // does not work
}

In Bait model function foo() takes the parm by ref and sets it's
value:

function foo(&$msg)
{
$msg = "HOWDY DOODY";
}

ERROR is
Notice (8): Undefined variable:  xxx [CORE/app/controllers/
baits_controller.php, line 71]

If I put function foo within the Bait controller class $this->foo()
works fine. However when I put it in the model using the $this->Bait-
>foo() invocation syntax seems to ignore the parameter by reference.

What am I missing here? BTW this is a dramatically pared down sample
from a real application.

Thanks in advance,
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
-~--~~~~--~~--~--~---



Can I use Session::setFlash from model?

2008-01-05 Thread MikeK

I moved some code from a controller to the model, and the code set
some flash error msgs using the session component setFlash call.

I didn't realize it wasn't working until someone triggered the error
today -- is there any way to make that work or do I need to
restructure the interface to the routine?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Cake Site Deployed - THANKS To All Cakers On the Board!

2007-12-10 Thread MikeK

I just wanted to take a breath and say MAJOR THANKS to all who have
answered questions, posted great answers, and generally helped to make
CakePHP such a great technology. We have finally deployed our site
after months of development, alphas, and betas. We are extremely
pleased with the productivity CakePHP has given us, as we are
primarily old operating systems hackers and not much of web
application coders.

Feel free to take a peek - it's at www.onlinefishingtournaments.com.
It includes a simple bridge to phpBB that enables site-wide single
login, authentication, and ACL through phpBB, and exercises most of
Cake 1.2's features.

The UI is still a WIP, the functionality continues to evolve, and we
are moving to phpBB3 when it is finally golden, but the basic
functionality is working.

Thanks again Cakers!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



cake + php5 = bad performance?

2007-11-29 Thread MikeK

I have recently taken our server running php 4.4.7, MySQL4, and Apache
1.3 and moved it to php 5.2.4

While everything was fine from a compatibility standpoint, the
performance of our exact same cake application was from 30-50% slower
on a per action basis, as well as the memory usage being about 20%
higher. The ONLY thing different was php5, and we dialed in a
comprable php config, although we had to bump the memory up since php5
seems fatter.

php5 was installed as an apache module, not as a cgi. We did the
benchmarking twice just to make sure -- we were using the time
generated on each page for data (at the bottom of webroot/index.php
where it is calculated with debug=1).

Has anyone else experienced this? We are very happy with our
performance under 4.4.7, and even happier with eaccelerator making
things even better under 4.4.7, but we are being dragged to php5 by
another application that will require it next month.

I know there were early php5 perf issues, even in the supposedly
"better" object model which cake uses extensively, but everything I've
read says the 5.2 release has fixed these perf issues and that php5 on
equivalent hardware should be faster -- unfortunately we are not
seeing that.

Is there a dependency for php5 that it works better with apache2
rather than apache1? Or MySQL5 rather than MySQL4? Has anyone else
actually benchmarked their cake code on identical systems to get a
true read of php5's impact on cake apps?

Thanks in advance, Mike
--~--~-~--~~~---~--~~
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: To error404 or not?

2007-11-13 Thread MikeK

oops, wrong key - as I was saying...

function action($id = null)
{
if (!$id)
{
flash an error msg
redirect etc
}

Should those type of requests be rejected with a 404? I have numerous
bots generating bad requests for links that were up for mere moments
during debugging, and am now into bigtime parm validation, not just
checking for existence of parms but making sure they are valid
indices, etc. While I have been logging them I am wondering how to
make these bots stop requesting these bad requests, now that I am no
longer publishing "incorrect links". I don't want to keep them away
completely via robots.txt -- should I just throw 404 errors when these
incorrect requests come along? Will that ultimately make them stop?


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



To error404 or not?

2007-11-13 Thread MikeK

In all the cake sample code I see things like:

function action($id = null)
{


--~--~-~--~~~---~--~~
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: Why use formhelpers?

2007-11-12 Thread MikeK

Thanks for the replies guys -- I'll read those references. Like I
said, no disrespect intended, and I'm not asking for changes nor
claiming any of this is a bug. Generally I am "picky" about how things
look, and anyone building a production site should be "picky" -- it's
either the way it should look or it's not ;) Technology should be an
enabler, not something you find yourself spending time to "go around".
It's just one of those little areas that for me has turned into the
less than 5% of the CakePHP architecture that falls into "go around"
rather than enabling.

Are you sure you don't want to share your CSS guru? lol UI code is
such an art in itself, it just kills me to dedicate such effort to
look and feel rather than function, but as my UI gurus point out it
either looks as good as it can or it doesn't!


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



Why use formhelpers?

2007-11-12 Thread MikeK

Ths is not meant to be disrespectful in anyway -- I love cake and it
has been a productivity boon, and I respect all that contribute to it.
However as I continue to develop cake code I have found myself
wondering why I am using the form helpers at all. It has been moving
through various CSS templates that has brought me to this point.

I find myself spending lots of time reading form helper code to figure
out what it wants, and looking at emitted code to figure out what it
did. When I could have just coded the html myself with far less
trouble. Furthermore it's not particularly more readable code as a
result of using helpers. (the only thing that I hate more is messing
with CSS).

Half the time I am writing code to make the helpers NOT emit a div
where I don't want one. Other times it is to specify css classes where
necessary in html anchors to go with a css style -- or to redefine the
emitted div for a label to be what I need to to be. Generally I'm of
the opinion that these helpers shouldn't emit ANY divs -- it's very
uncakelike to force a view/css structureon a developer -- seems to me
they should be completely independent.

Is it me or is there truly diminishing returns here? For example:

input('boat', array('error' => 'Boat is required',
'div' => '', 'class' => 'field', 'label' => array('class' => 'left',
'text' => 'Boat:')));?>

input('favorite lure', array('div' => '', 'class' =>
'field', 'label' => array('class' => 'left', 'text' => 'Favorite
Lure:')));?>

submit('Update', array('div' => false, 'class' =>
'button', 'id' => 'submit'));?>


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



Google Bots geenrating weird queries

2007-11-07 Thread MikeK

I am tracking some strange errors that showed in my logs and in the
process have stumbled onto some weird requests by google bots of my
cake app. They are throwing all kinds of urls together with invalid
parameters that aren't even links on my published pages. What's their
deal?


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



Re: What does findAll return when there is a DB error?

2007-11-07 Thread MikeK

And its a paginate call, not a findAll if that makes any difference...


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



Re: What does findAll return when there is a DB error?

2007-11-07 Thread MikeK

I am asking because on a query that has an ambiguity warning logged
into my error.log, there is always a subsequent log entry at the same
time as if my view operated on the output of findAll/paginate as if it
were not false. For example:

$records = $this->findAll()...
$this->set('records', $records)

and in the view

foreach($records as $record) generates another entry in the error.log
saying "invalid argumanet foreach..."

I am using mysql, 1.2 pre beta, php 4.4.7, mysql4, apache 1.3

when the query is properly formed and it matches no records the
foreach loop has no problems -- but when the query gags with an
ambiguity warning it seems to be returning something, I just don't
know what.

BTW I cannot reproduce this error -- I am chasing a ghost error I
discovered in my log files in a complex routine that paginates the
heck uot of a pile of classes.

I have set log traps all over the place in hopes it happens again,
even in the dbosource code for the moment...


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



What does findAll return when there is a DB error?

2007-11-07 Thread MikeK

Can someone please tell me what findAll returns when there is a mysql
db error as a result of malformed query?

It returns nothing when it finds nothing, but what does it return on
error?


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



need to write error.log in ShowQuery or LogQuery dbosource.php

2007-11-07 Thread MikeK

I need some guru help -- if there's an easier way please tell me. I
have a MySQL ambiguity bug in a query -- I thought I had nailed all
these issues but I saw one in my error log and need to pinpoint the
query that is actually causing it. It has to do with something in some
convoluted pagination stuff I'm doing and I just can't see the error
nor reproduce it.

So what I want to do is make cake write the whole query to the error
log when it happens -- not to the screen as we are running DBEUG=1 at
the moment and this occured on a production site (can't goto debug=2
becuase all the extraneous output users will see).

So I see in dbosource.php where in the execute function it calls
logQuery on error to pitch the query to the screen, and calls
showQuery which ends up (DEBUG=1) sending the SQL error msg to my
error.log.

I seriously doubt I can use $this->log in this context to pitch the
entire sql query into the error log -- what is the easiest way to make
this happen? trigger_error is sending my output to the error log --
where is this setup and why does this output end up in my error.log
file instead of onscreen?

This is driving me insane. I fully specify model.field in all my
queries, I know exactly which query is generating the problem, just
not in what context or circumstances and I have been unable to
reproduce it. Logging the errors as well as some of the parms around
the call I'm hoping it happens again and I have enough evidence to
track the real problem down.


/**
 * Log given SQL query.
 *
 * @param string $sql SQL statement
 * @todo: Add hook to log errors instead of returning false
 */
function logQuery($sql) {
$this->_queriesCnt++;
$this->_queriesTime += $this->took;
$this->_queriesLog[] = array('query' => $sql,
'error' => $this->error,
'affected'  => $this->affected,
'numRows'   => $this->numRows,
'took'  => $this->took
);
if (count($this->_queriesLog) > $this->_queriesLogMax) {
array_pop($this->_queriesLog);
}
if ($this->error) {
return false;
}
}
/**
 * Output information about an SQL query. The SQL statement, number of
rows in resultset,
 * and execution time in microseconds. If the query fails, an error is
output instead.
 *
 * @param string $sql Query to show information on.
 */
function showQuery($sql) {
$error = $this->error;
if (strlen($sql) > 200 && !$this->fullDebug && 
Configure::read() >
1) {
$sql = substr($sql, 0, 200) . '[...]';
}

if (($this->debug || $error) && Configure::read() > 0) {
e("Query: {$sql} 
");
if ($error) {
trigger_error("SQL
Error: {$this->error}", E_USER_WARNING);
} else {
e("[Aff:{$this->affected} 
Num:{$this->numRows} Took:{$this-
>took}ms]");
}
print ('');
}
}


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



Zend Optimizer Impact

2007-10-31 Thread MikeK

We are currently running stock PHP 4.4.7 but are considering adding
the zend optimizer. Does it offer any performance benefits to CakePHP
apps? Is it truly transparent and seamless? Any advice is appreciated.


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



class.paths.php updated when debug=0

2007-10-31 Thread MikeK

I was under the impression that class-paths.php was only read from not
written to when debug was off. However I am observing that it is
written, and fFrom what I see in the code this file is written all the
time even with debugging off -- I saw a post from Grant previously
that this was not the case -- have things changed?

Also, just curious, if your cache/persistent subdir was not writeable
and the attempts to write kept failing would cake continue to work?


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



Email Component Minor Fix in 1.2

2007-10-30 Thread MikeK

I use the email component and it was driving me nuts inserting a
newline in the front of every email (any 1.2 version including pre
beta). I finally traced it to this:

file cake/lib/controller/component/email.php on or around line 477:
$this->__header .= 'Content-Transfer-Encoding: 7bit' . $this-
>_newLine;

This is the final line in the __createHeader routine and the linefeed
here causes every email to have a linefeed at the top. I tried to
write a ticket but didn't have permission in Trac.

WHat do I need to do to be able to submit prs?


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



Nice Job on 1.2.5875 Pre-beta

2007-10-29 Thread MikeK

I upgraded today from 1.2 alpha level and everything is hunky dunky --
nice job!


--~--~-~--~~~---~--~~
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: Couple Of Cache Questions - View caching and model caching

2007-10-28 Thread MikeK

And to continue my conversation with myself, Cake does indeed
invalidate cached views if the "related model" is UPDATED etc. However
I have a situation where an action "Catches" is using a model via the
"uses" statement named "Katch" not Catch" -- a mod I had to make for
php5 keyword conflich on Catch.

So throughout the Catches controller you see $this->Katch->save etc --
these are not detected by the invalidation code I am guessing because
the URI doesn't match the action? So in that specific situation I have
to issue the proper invalidate line in the Katch model to remove the
view cache entry with name "Catch". WHat fun!


--~--~-~--~~~---~--~~
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: Couple Of Cache Questions - View caching and model caching

2007-10-28 Thread MikeK

And 1 more thing. Related to #1 above, if the page to be cached is an
action named "index", you must specify "index" not "controller/index".
Weird!


--~--~-~--~~~---~--~~
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: Couple Of Cache Questions - View caching and model caching

2007-10-28 Thread MikeK

One more question -- is the layout cached with the view? I noticed
cache got called called twice -- once for the view and once for the
layout. How are the layouts handled?


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



Couple Of Cache Questions - View caching and model caching

2007-10-28 Thread MikeK

Just a a couple cache questions -- I have read all I can find about
caching here and oin the bakery and now in the code. I am running the
alpha 1.2 code (I'll update to the pre beta this week). Hopefully
these questions are up to par.

1) I have been interested in the coarse granularity view caching and
to that end was mystified that I couldn't get anything but pages/
actions named "index" to cache. After reading the code I found that
specifying:

var $cacheAction = array('myaction' => 86400) or var $cacheAction =
array('myaction/' => 86400);

will not work - you MUST specify the controller name as well -- this
only works for "index".

var $cacheAction = array('mycontroller/myaction' => 86400) WORKS FINE

Perhaps this has something to do with routes? I have not defined
anything in config/routes other than a single route to connect users
up to my landing page when they specify my cake app without a specific
controller/action. I traced the code in helper/cache.php to determine
the right syntax.

2) I also have a question about the MODELS subdir in tmp/cache. It
seems to me the names of the files are driven my controller file names
not model names -- can someone confirm this? And how often are these
updated? In my app it appears the timestamps of these files is touched
every request although the contents is not changed. Perhaps this is
because of something I have done? How can I track the access to these
files and determine why they are constantly being updated every
request?

3) I read in the manual that "First, you should be aware that Cake
will automatically clear the cache if a database change has been made.
For example, if one of your views uses information from your Post
model, and there has been an INSERT, UPDATE, or DELETE made to a Post,
Cake will clear the cache for that view." When I tested this and
essentially had cake cache a simple "index" view of some simple
records, even after I added a new record when I went back to the index
view I kept getting the cached view -- it never invalidated the cached
view when the add operation occured. I understand how to do this
myself in afterSave but I thought cake did this "automatically"? What
am I missing here?

4) Finally after my reading here and in the bakery since my app shows
different data in a single view, and sometimes different views
altogether based on the level of user authentication (guests, reg
users, admins) that I will have to implement some finer control of
what gets cached -- otherwise folks with lower privilege may get
served up a cached view with data they are not supposed to see. Will I
also have to manage the invalidation of cached items when exercising
that finer control? I'm just not clear on when/how cake goes and
invalidates contents of the cache based on a DB update.

Thanks in advance and CAKE 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
-~--~~~~--~~--~--~---



  1   2   >