Re: Setting arrays for a complicated HABTM relationship

2010-03-21 Thread WebbedIT
What have you tried so far?  I would say you could do this using GROUP
BY and/or Set::combine to structure your data array as required.

But I do not have this relationship setup anywhere with data so much
better if you show us what you have tried as that gives us something
to work with.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Setting arrays for a complicated HABTM relationship

2010-03-21 Thread WebbedIT
P.S. defining the hasMany, belongsTo relationship rather than a HABTM
was the right decision.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Better way to handle this model association

2010-03-21 Thread WebbedIT
I'm slightly confused, why do you have to massage the data array?
What part of your save process is not working, I'm guessing your
saying it is not autosaving the HABTM data.

If so, what does your submitted data array and save action look like?

HTH

Paul

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Need help with Custom paginate and paginator methods

2010-03-21 Thread anju
thanks for ur reply...i got this issue solved by using and additional
parameter '$extra' array in the custom paginate function!!..
but still it didnt worked fine.so i tried with non modified paginate
and additional model binding in the controller .
Also i had to do assign the ' find' result of newly binded model to
the result of paginate function.
Thanks
Anju

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Caching Elements

2010-03-21 Thread leafchild book
I have same issue.

I don't think  cake:nocache is working at all.



On Wed, Feb 10, 2010 at 6:56 PM, Jeremy mayt...@gmail.com wrote:

 OK... I have a follow-up question.

 How do I prevent caching in certain cases?  In the element that I am
 working on, it is possible for the external service to fail.  If that
 happens, I trap the error and create some HTML to notify the user that
 the service is unavailable.  The problem is that I don't really want
 to cache the error message.  I'd rather that it retry and only cache
 if the result was successful.

 I tried ecapsulating the error HTML in cake:nocache, but that does
 not seem to work.  Reloading the page will not cause the page to re-
 attempt to render the external service results.

 I have pasted the full code to my element here:
 http://bin.cakephp.org/view/11698566


 On Feb 10, 8:35 am, Jeremy mayt...@gmail.com wrote:
  Yes, correct.  My bad.
 
  On Feb 10, 2:51 am, majna majna...@gmail.com wrote:
 
 
 
   I think it's /tmp/cache/views, not  /tmp/cache/element
 
   On Feb 10, 1:53 am, Jeremy mayt...@gmail.com wrote:
 
With some help... I figured out the problem.  I was using the file
cache option and although the /tmp/cache directory was writable I was
missing a necessary directory.  Since I was trying to cache an
 element
the /tmp/cache/element directory needs to exist and it must be
writeable.  My problem was that the element directory was missing.
Once I added it... everything started working as expected.
 
On Feb 9, 10:13 am, Jeremy mayt...@gmail.com wrote:
 
 Hi all.  I have created an element that will interact with an
 external
 webservice.  The webservice presents weather forecast data in XML
 and
 I am using my element code to parse the XML and render it on my
 site.
 The weather forecast service never updates their data more
 frequently
 than 1 hour, so I would like to cache the rendered element HTML for
 1
 hour globally for all users.  Right now, each refresh of the page
 than
 contains this weather element code will cause a hit to the weather
 forecast webservice and the XML will get reparsed even if it hasn't
 changed.
 
 I have tried to follow the instructions on how to turn on caching,
 but
 it does not seem to be working.
 
 Here's what I have done so far:
 1) Turned this on in the config Configure::write('Cache.check',
 true);
 2) I am calling the element with this code: ?php echo $this-
 
 element('weather', array('cache'=array('time'='+1 hour'))); ?-
 Hide quoted text -
 
 - Show quoted text -- Hide quoted text -
 
   - Show quoted text -- Hide quoted text -
 
  - Show quoted text -

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

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


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

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Auth login with email or mobile

2010-03-21 Thread Signified
I have an app where the user must be able to login with either their
email address or mobile (cell) phone number. I'm using CakePHP 1.3
with Auth component for authentication and all is well. I even have
the desired functionality working with the below code in the
beforeFilter() of my accounts controller (my users table is called
accounts).

app/controllers/accounts_controller.php

function beforeFilter()
{
parent::beforeFilter();
$this-Auth-allow('login', 'logout');
if ($this-action == 'login') {
if (!empty($this-data)) {
if (strpos($this-data['Account']['email'], '@') ===
false) {
$this-data['Account']['mobile'] = preg_replace('/
[^0-9]/', '', $this-data['Account']['email']);
unset($this-data['Account']['email']);
$this-Auth-fields = array('username' = 'mobile',
'password' = 'password');
} else {
$this-Auth-fields = array('username' = 'email',
'password' = 'password');
}
$this-Auth-login($this-data);
}
}
}

And here's the form:

app/views/accounts/login.ctp

?php
echo $form-create('Account', array('action' = 'login'));
echo $form-input('email', array('label' = 'Email Address or Mobile
Phone Number'));
echo $form-input('password');
echo $form-end('Sign In');
?

As I said, this works fine. I can login with an emaill address or
mobile phone number. However, if I submit the login form with empty
values (enter nothing and hit submit), I get a blank screen (instead
of the login form with an authMessage).

Any ideas?

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Bake Screencast not Working?

2010-03-21 Thread Sam Sherlock
a page on cakephp.org *should* display screencasts in addition to slideshare
stuff

Ideally marking each piece of content with the version it applies to

Video content *should* be either onn youtube or vimeo etc

- S



On 20 March 2010 07:57, Johnny Ferguson hyperfle...@gmail.com wrote:

 I got this same problem, and after viewing the file directly, I am
 extremely disappointed that I had to go through the hassle of filling
 my comp with garbage like QuickTime just to have some guy show me how
 to update my PATH variable. *facepalm*

 Why this isn't on a youtube video is beyond me.

 On Mar 12, 4:33 pm, mailman nmail...@shaw.ca wrote:
  Hey all. Thehttp://cakephp.org/screencasts/view/6isn't working in
  any of my browsers.
 
  Anyone have a good tute on how to set up bake on Vista (I know...sorry
  Vista haters). ;)

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

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

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Caching a view for all/any user

2010-03-21 Thread cakephpro...@googlemail.com
Hi there,

I have a site which has an article on the home page which is changed
weekly. As i understand it, the caching system in Cake works on a per
user basis so if user a enters the site for the first time the view
they see will not be the cached view until the second time they call
on that view. What I'm looking for is a scenario where user a enters
the site and is served a cached view of the home page article
regardless of whether they have visited the page previously.

Also, the documentation talks about setting the cache for +1 minute,
+1 hour e.t.c. Is it possible to set this to be a finite time , e.g.
next Sunday 12 p.m. ?

Thanks in advance,

Roger

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Caching a view for all/any user

2010-03-21 Thread Pablo Viojo
AFAIK, Cake built-in cache for views is not related to the user viewing the
content.

Best regards,

Pablo Viojo
pvi...@gmail.com | http://pviojo.net

http://twitter.com/tiopaul (@tiopaul) | LinkedIn profile:
http://cl.linkedin.com/in/pviojo

¿Que necesitas?
http://www.needish.com


On Sun, Mar 21, 2010 at 9:37 AM, cakephpro...@googlemail.com 
cakephpro...@googlemail.com wrote:

 Hi there,

 I have a site which has an article on the home page which is changed
 weekly. As i understand it, the caching system in Cake works on a per
 user basis so if user a enters the site for the first time the view
 they see will not be the cached view until the second time they call
 on that view. What I'm looking for is a scenario where user a enters
 the site and is served a cached view of the home page article
 regardless of whether they have visited the page previously.

 Also, the documentation talks about setting the cache for +1 minute,
 +1 hour e.t.c. Is it possible to set this to be a finite time , e.g.
 next Sunday 12 p.m. ?

 Thanks in advance,

 Roger

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

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

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Basic Auth REST = Blackhole

2010-03-21 Thread SonnyBurnette
I am trying to add a few light restful API methods to my app. In order
to secure this, I plan to use basic auth with SSL. The problem I have
now is the security component wants to blackhole the POSTed data since
I enabled the security component for basic auth.

What do I need to do to keep these methods secure and allow the data
from a remote client to be added?



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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Model::saveField emptying my data array

2010-03-21 Thread WebbedIT
Hi,

My experience with behaviours goes as far as using the core ones or
those kindly made available by the community.  One of those that I use
is counter_cache_habtm

http://bakery.cakephp.org/articles/view/counter-cache-behavior-for-habtm-relations

Within the behaviour's afterSave method it checks to see if the
model's database includes a count field and if so fetches the updated
count and saves it with the following command:

$model-saveField($field, $count, array('validate' = false,
'callbacks' = false));

My problem is that after the above command runs it clears $model-
data, which I need for my afterSave method in the controller.  How do
I update the count field without blanking my data array?

Thanks,

Paul

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Model::saveField emptying my data array

2010-03-21 Thread WebbedIT
Think I resolved it, but happy for someone to confirm if this is a
good solution.  When searching for issues surrounding Model::save
blanking the data array I came across a blog post on debuggable from
2007:

http://debuggable.com/posts/modelsave-now-returns-an-array:480f4dd6-0a7c-4026-ad5a-49c8cbdd56cb

Armed with the fact that I now knew Model::save returns Model-data I
changed the save function to the following:

$count = $joinModel-find('count', array(
  'fields'=$assocData['associationForeignKey'],
  'conditions'=array($assocData['foreignKey'] = $model-id)
));
$model-set($field, $count);
$model-data = $model-save($model-data, array('validate' = false,
'callbacks' = false));

By changing saveField() to save() and adding $model-data = in front
of the save call I retain my data array.

Paul

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Setting arrays for a complicated HABTM relationship

2010-03-21 Thread paws_galuten
Thanks for the help.
Yes, Set::combine did the trick for me, but there's a complication
that leads me to another question. I did:

$moods = $this-Moods-find('all');
$this-set('moods',
Set::combine($moods,'{n}.Moods.woman_id','{n}.Moods.mood','{n}.Moods.time_id'));

That way in the view, I get an array that is grouped by the times, and
then lists the women's moods.

Like this:

Array
(
[1] = Array
(
[1] = Happy   --- time 1, woman 1
[2] = Annoyed   --- time 1, woman 2
[3] = Indifferent   etc.
 )

[2] = Array
(
[1] = Angry
[2] = Emotional
[3] = Silly
)
)

This works as long as there is only one attribute in the moods table
that I want to fetch. The question is... Let's say I have more that
one attribute in the moods table. Instead of just mood, say it was
inner_feeling and displayed_mood for example. How, using
Set::combine (or some other way), can I get each of those moods to be
an array?

I'd like the data to look like this:

Array
(
[1] = Array
(
[1] = Array
(
[inner_feelings] = Happy
[displayed_mood] = Calm
)
[2] = Array
(
[inner_feelings] = Annoyed
[displayed_mood] = Tolerant
)
[3] = Array
(
[inner_feelings] = Indifferent
[displayed_mood] = Supportive
)
 )

[2] = Array
(
 etc...
)
)

Any ideas? Thanks so much...

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Implementing uploadify - File upload issue - param definitions issue

2010-03-21 Thread abocanegra
Correction - However, problems still not fixed

 upload function had a typo, fixed it but still not
uploading file
function upload()
{
 if (isset($this-params['form']['Filedata']))
{
//Derived from the uploadify.php file - does not work
$tempFile = $this-params['form']['Filedata']['name'];
$targetPath = 'http://www.whatartist.com/uploads/temp';
$targetFile =  str_replace('//','/',$targetPath) . $this-
params['form']['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);

$image_path = $this-params['form']['Filedata']['name'];

if(isset($image_path))
{

$this-Photo-saveField('image',$image_path);
//Put success message and redirect here
}else{
//Put error message here
}
}
}

Also, I beleive the multiple posting - beyond 2 entries - was a
session issue. I deleted all sessions in the phptmpdir and it fixed
that issue.
I still cannot upload the file though.

On Mar 20, 9:40 pm, abocanegra aaronbocane...@gmail.com wrote:
 Alright, ahead of time thanks for any help on this. I have been
 researching for far longer than I care to admit. I am attempting to
 get uploadify 2.1 to work with cakePHP 1.3. I have read up a great
 deal on other formats as well, such as swfupload.

 Controller name = photos_controller.php
           relevant functions = upload  addmult
 Model Name = photo.php
 views= addmult.ctp (upload.ctp is just the function being called from
 addmult)

 Sucesses - I have been able to get the browse and upload working (on
 the surface). It appears to handle a multi-upload, or at least goes
 through the paces. Also I am able to trigger the upload function from
 the controller and add either the name using $this-params['form']
 ['Filedata']['name'].

 Problems -
  I cannot get the file uploaded to my uploads/temp directory (it is
 777 and works well with my single image upload script). I have tried
 every variation including absolute paths to get to it
 .
 There does not seem to be any error messages, I have tried adding a
 few from the various forums, none have done anything.

 When I trigger the multiple uploads it goes through the paces, but
 only adds one entry into the database.
 Also It appears the database tends to only accept 2 entries, though I
 haven't thoroughly tested that problem.

 Goal -
 I am hoping to implement this function so that I can utilize it with
 image.php which i have altered to create the files in the manner I
 need. To do this I will need to be able to send the file to image.php
 for scale changes, multifolder organization and name changes. After
 which it will redirect to a page to add the additional info (title,
 client, etc) needed.

 Any advice on any of the issues would be appreciated.

 Code Snippets:

 Controller:
 #
 class PhotosController extends AppController {

         var $name = 'Photos';
         var $components = array(Image);
         var $helpers = array('Html', 'Javascript', 'Form');

         function beforeFilter() {
         if ($this-action == 'upload') {
             $this-Session-id($this-params['pass'][0]);
             $this-Session-start();
         }
         parent::beforeFilter();
     }

         function upload()
         {
          if (isset($this-params['form']['Filedata']))
                 {
         //Derived from the uploadify.php file - does not work
         //$tempFile = $this-params['form']['Filedata']['tmp_name'];
         //      $targetPath = 'http://www.whatartist.coms/uploads/temp';
         //      $targetFile =  str_replace('//','/',$targetPath) . 
 $this-params['form']['Filedata']['name'];

                 //move_uploaded_file($tempFile,$targetFile);

                 $image_path = $this-params['form']['Filedata']['name'];

                                 if(isset($image_path))
                                 {
                                         
 $this-Photo-saveField('image',$image_path);
                                         //Put success message and redirect 
 here
                                 }else{
                                         //Put error message here
                                 }
                 }
         }

  // Handle multiple incoming uploads.
         function addmulti() {
            //Left empty because it was providing no functionality
           // I did try posting to this instead of upload function but
 didn't work so cleared it
         }

         function upload()
         {
          if (isset($this-params['form']['Filedata']))
                 {

 //Derived from the uploadify.php file - does not work
         

Re: Setting arrays for a complicated HABTM relationship

2010-03-21 Thread paws_galuten
Ha! I figured it out... I can just change this:

$this-set('moods',
Set::combine($moods,'{n}.Moods.woman_id','{n}.Moods.mood','{n}.Moods.time_i
d'));

to this:

$this-set('moods',
Set::combine($moods,'{n}.Moods.woman_id','{n}.Moods','{n}.Moods.time_i
d'));


By changing '{n}.Moods.mood' to just '{n}.Moods' I get the whole array
instead of just the moods field.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Problem creating elements with BAKE

2010-03-21 Thread marcoR-IT
Ok, I have erased and installed again php-cli (php5-cli doesn't
exist, at least in the repositories I have preconfigured)
But the same problem persists.

I have also revised my php.in file and didn't found any entry about
the CLI.

Formerly, I has able to  run the BAKE command without problems, but
after some attempts to update my PHP installation to release 5.3.2,
something broke!
Now my applications still work correctly with cakePHP BUT the BAKE
command fails.

On 19 mar, 02:42, Sam Sherlock sam.sherl...@gmail.com wrote:
 from command line I can run the following (which shows the location of my
 ini file being used):

 php --ini

 - S

 On 19 March 2010 04:47, Zaky Katalan-Ezra procsh...@gmail.com wrote:

  Maybe you need to install php5-cli

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


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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


help needed to install vamcart CakePHP on GoDaddy

2010-03-21 Thread vkosta
Help Needed!!!

I've read previous post but I still got some problems with installing
CakePHP vamcart (http://vamcart.com) on GoDaddy.

1 -  .htaccess on root directory of CakePHP app

AddDefaultCharset utf-8

 IfModule mod_rewrite.c
   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]
 /IfModule

2 -  .htaccess on app directory of CakePHP app

 IfModule mod_rewrite.c
RewriteEngine on
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 /IfModule

3 -  .htaccess on webroot directory of CakePHP app

 IfModule mod_rewrite.c
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
 /IfModule

 IfModule mod_deflate.c
AddOutputFilterByType DEFLATE text/html text/plain text/css text/
javascript application/x-javascript
 /IfModule

 IfModule mod_expires.c
  ExpiresActive On
  ExpiresByType text/css access plus 10 years
  ExpiresByType text/js access plus 10 years
  ExpiresByType text/javascript access plus 10 years
  ExpiresByType application/x-javascript access plus 10 years
  ExpiresByType application/javascript access plus 10 years
  ExpiresByType image/png access plus 10 years
  ExpiresByType image/gif access plus 10 years
  ExpiresByType image/jpeg access plus 10 years
 /IfModule

FileETag none

Tried to change it to

 IfModule mod_rewrite.c
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
/IfModule

but without success

Please, give some advise

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Dynamic Form Data

2010-03-21 Thread CrotchFrog
I finally gave in and decided to give Cake a shot so please pardon my
ignorance to what may seem obvious to you. The majority of my sites
are Ajax heavy so I decided this would be as good a place as any to
start so I set to work on a (what should be simple) form that creates
itself dynamically according to user input.

1. The static part of the form was obviously a breeze to set up - no
problems there.
2. Created a Select input and populated it with data from db - seemed
easy enough, no probs.
3. My next field depended on the input of the Select I just created
and I was a little unsure of how to approach this so I ended up using
$ajax-observeField() and surprisinglyenough it generated my new
form field with seemingly no issues.

The problem I'm running into is that I need to use the data from my
newly created form field and create yet another field based on that
data. The new form field doesn't trigger the Ajax I set up for it nor
does it interact with the action I specified. When I view source on
the page all of the data that was generated dynamically with Ajax is
not showing in the source even though data is plainly visible when
physically viewing the page.

I can't quite figure this one out.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Don't rewrite an existing directory

2010-03-21 Thread mattmemo
Hello,
So here's my problem:
I have a CakePHP installation in my server root (/www).  What I would
like is for CakePHP to NOT rewrite URL's for directories/files that
exist.  For example, I am making a project manager with my main
CakePHP installation.  In my server root, I have the following:
app/
cake/
projects/ (not a Cake folder)
vendors/
.htaccess
index.php

I would like to be able to navigate to the projects folder, where I
have other project folders (some are installations of CakePHP, some
are just plain HTML sites).  To be more specific, I'd like to be able
to go to http://localhost/ and see my CakePHP project manager.  When I
got to http://localhost/projects/project1 (or project2, etc.), I would
like to see that particular project.  Instead, my CakePHP project
manager is rewriting http://localhost/projects/project1 and I get the
Projects Controller not found error.
Perhaps I made my explanation overly complicated, but I wanted to make
sure that my problem is understood correctly.
Is this possible?  Any help is greatly appreciated.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Weird Validation Question

2010-03-21 Thread Dave
This might be odd but i have user email and profile email. 
User email is not published on the site (used for account, login, forgot
stuff like that) profile email is published on the site so for security i
figured that its best to use a separate email.
 
So when a user wants to edit either of the emails i need to make sure they
are not the same so both cant be myn...@somewhere.com.
 
How would i validate 1 field based on 2 different models using Auth-id
since the email is directly related to the logged in user?
 
I figured query the opposite table to see if this users email is the same as
this profile email (or vice versa depending onwhichis being changed) but how
do i use the auth id in this?
 
validation rule:
array(
'rule' = array('notSameAsUser', 'email'),
'message' = 'Your public email address can not be the same as your
account email.',
'last' = true)
 
function:
 
function notSameAsUser( $data ) {
 
  $valid = false;
  
  $params = array(
   'conditions' = array('Profile.id' = $id),//how do i get the id from
Auth in the model?
   'fields' = array('User.email')
   'contain' = array(
'User' = array(
 'fields' = array(
  'User.email';
  
  $data $this-find('first', $params);

if (  $data['User']['email'] !=  $data['Profile']['email'] ) {
$valid = true;
  
}

return $valid;
}
 
 
Dave

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


find if exists any hasmany relationship

2010-03-21 Thread stefano
Hello

I have a question about find('all') i need get all the records that
have any relation in the database for example

polls hasmany sections
sections hasmany questions

i need all the polls that have any sections and this section have any
questions

any idea how do that using the cake's way?

s.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Fata error: non-object ?

2010-03-21 Thread redcat
I have a database table called users_details
I have a model file called UserDetail.php with the following lines:

?php
class UserDetail extends AppModel {
   var $name='UserDetail';
   var $useTable='users_details';
   }
?



I have a controller file called users_details_controller.php with the
following lines:
?php
class UsersDetailsController extends AppController {
 var $name = 'Users_Details';
 function listusers() {
 $this-set('users_details', $this-UserDetail-
find('all'));
 }
}
?

When I go to /app/user_details/listusers I get the following error:

Fatal error: Call to a member function find() on a non-object in /
cakephp/app/controllers/users_details_controller.php on line 5


Notice (8): Undefined property: UsersDetailsController::$UserDetail
[APP/controllers/users_details_controller.php, line 5]

Now UserDetail model is there - I have even tried to use the variable
useTable as you can see above.. yet why do I get this error of
UserDetail being a non-object???

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Fata error: non-object ?

2010-03-21 Thread Ed Propsner
Wouldn't it be

var $uses = 'users_details';

??

On Sun, Mar 21, 2010 at 8:24 PM, redcat la6...@gmail.com wrote:

 I have a database table called users_details
 I have a model file called UserDetail.php with the following lines:

 ?php
 class UserDetail extends AppModel {
   var $name='UserDetail';
   var $useTable='users_details';
   }
 ?



 I have a controller file called users_details_controller.php with the
 following lines:
 ?php
 class UsersDetailsController extends AppController {
 var $name = 'Users_Details';
 function listusers() {
 $this-set('users_details', $this-UserDetail-
 find('all'));
 }
 }
 ?

 When I go to /app/user_details/listusers I get the following error:

 Fatal error: Call to a member function find() on a non-object in /
 cakephp/app/controllers/users_details_controller.php on line 5


 Notice (8): Undefined property: UsersDetailsController::$UserDetail
 [APP/controllers/users_details_controller.php, line 5]

 Now UserDetail model is there - I have even tried to use the variable
 useTable as you can see above.. yet why do I get this error of
 UserDetail being a non-object???

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

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

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.




-- 
Please visit http://freecupidreport.com

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Fata error: non-object ?

2010-03-21 Thread Alexander Khromov
Try rename UsersDetails To UserDetails. :)

On Mon, Mar 22, 2010 at 6:24 AM, redcat la6...@gmail.com wrote:

 I have a database table called users_details
 I have a model file called UserDetail.php with the following lines:

 ?php
 class UserDetail extends AppModel {
   var $name='UserDetail';
   var $useTable='users_details';
   }
 ?



 I have a controller file called users_details_controller.php with the
 following lines:
 ?php
 class UsersDetailsController extends AppController {
 var $name = 'Users_Details';
 function listusers() {
 $this-set('users_details', $this-UserDetail-
 find('all'));
 }
 }
 ?

 When I go to /app/user_details/listusers I get the following error:

 Fatal error: Call to a member function find() on a non-object in /
 cakephp/app/controllers/users_details_controller.php on line 5


 Notice (8): Undefined property: UsersDetailsController::$UserDetail
 [APP/controllers/users_details_controller.php, line 5]

 Now UserDetail model is there - I have even tried to use the variable
 useTable as you can see above.. yet why do I get this error of
 UserDetail being a non-object???

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

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

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.