Re: What is the easiest way to update?

2008-06-26 Thread jonknee

On Jun 26, 10:55 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> No advice, really?

Work through the errors? PHP normally gives really easy to understand
errors. When you find one, do a search across your whole project and
fix 'em all. Most will probably be able to be search/replaced in one
batch.
--~--~-~--~~~---~--~~
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: Maintain subdomain in login redirect

2008-05-28 Thread jonknee

On May 28, 5:29 pm, John R <[EMAIL PROTECTED]> wrote:
> Hey folks .. OP here ..
>
> Curious if anyone has any insight on this problem that is still
> plaguing my app! Any assistance would be MUCH appreciated.
>
> John

Have you tried peeking at the session and seeing what (if any) address
is located at 'Auth.redirect'?
--~--~-~--~~~---~--~~
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: Using CakePHP to update a wordpress rss feed

2008-05-22 Thread jonknee

On May 22, 4:29 pm, Chez17 <[EMAIL PROTECTED]> wrote:
> Thats what I'm getting at. I want to make sure when I switch my site
> over from wordpress to CakePHP, I want all the readers who subscribe
> to my current wordpress rss feed to be automatically subscribed to the
> new CakePHP generated rss feed. I was wondering how I would do that.
>
> When you say 'duplicate the template', what do you mean by that. Isn't
> an rss feed a specific url? Wouldn't I need to get CakePHP to produce
> the same file at the same URL?

So either make a route that mirrors the WordPress feed address (so the
URL doesn't change) or put a redirect in place. A route is preferable.
Routes are covered well in the manual.

By duplicating the template, I just mean making an RSS feed with
CakePHP that is the same format that is being generated by WordPress.
There are several flavors of RSS/Atom, so to keep things simple you
can just use whatever is already in place.
--~--~-~--~~~---~--~~
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: ajax form validation

2008-05-22 Thread jonknee

On May 22, 1:34 pm, Oli <[EMAIL PROTECTED]> wrote:
> hey,
>
> can someone explain me howto validate a form using ajax?
> submission works fine but ive no clue how to validate the form
> correctly before saving the data
>

Validation occurs just the same as a normal request. I don't use the
AJAX helpers (mixing JS and HTML is a deal breaker for me), but it
might just be that you're not seeing the error messages. If your
controller is programmed properly you don't need to know if it's an
AJAX request or not--it's all HTTP POST.
--~--~-~--~~~---~--~~
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: Using CakePHP to update a wordpress rss feed

2008-05-22 Thread jonknee

On May 22, 12:50 pm, Chez17 <[EMAIL PROTECTED]> wrote:
> I am using they dynamically generated feed. Does that mean there is no
> way to get the new site to work with the old rss feed?

I'm not sure exactly what you mean about getting the new site to work
with old feed. Are you going to continue using WordPress?

The RSS feed for WP is just an XML template for the last X posts in
the WordPress database. There is nothing to add a post to other than
the database. You can easily duplicate the template in CakePHP and any
RSS subscribers will never notice the difference.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP and Subscription Based Billing

2008-05-22 Thread jonknee

On May 22, 12:28 pm, mydesignbuddy <[EMAIL PROTECTED]> wrote:
> PCI compliance is a must nowadays, its the law. Don't store or
> transmit your customers cc data unless you are compliant with PCI
> guidelines. The easiest recurring billing gateway service that I've
> used was Paypal's Payflow (pro or link). I'm sure they're other
> opinions out there but I don't know any off the top of my head. Do
> some research and here are some things to keep it mind when choosing a
> cc processor: do they have a good API, will their API work in PHP, how
> much is the initial setup cost, monthly cost, and per transaction
> cost.

Authorize.net also makes recurring billing easy, but I haven't
actually had to use it (just read over the APIs).

I just wrote PayFlow classes in PHP and Python. Amazingly they only
had built-in support for .NET and Java, everything else goes over
HTTPS and they provide no code to get started. Not a tough thing to
write, but it seemed pretty odd considering all the tools
Authorize.net gives out.
--~--~-~--~~~---~--~~
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: Using CakePHP to update a wordpress rss feed

2008-05-22 Thread jonknee

On May 22, 12:14 pm, Chez17 <[EMAIL PROTECTED]> wrote:
> As a project to learn CakePHP, I have been recreating my wordpress
> blog. My issue now is that I want to keep the same rss feed that was
> set up by wordpress and have my new site update that. I have no idea
> how to get started on this, I was hoping for a push in the right
> direction.
>
> Thanks for your time,
> Dave

Are you using the dynamically generated WordPress RSS feed or
something like FeedBurner? If it's dynamically generated, you can't
"add" to it, but you can easily create a feed through CakePHP that has
the same information. And if it's through FeedBurner, you would still
create a feed through CakePHP and then just change FeedBurner to point
to it instead of the WordPress feed.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP and Subscription Based Billing

2008-05-21 Thread jonknee

On May 21, 2:35 pm, mmayes <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Does anybody have any experience or recommendations on setting up a
> CakePHP app as a monthly subscription service (ala Basecamp, etc.)? I
> have a client that wants to do something like this, and I would very
> much like to bake it up. I've done a couple of the typical ecommerce
> sites using out of the box packages with SSL, so I'm familiar with the
> basics.

Your payment processor might be able to handle re-occurring billing
for you. That would be ideal so you don't have to have a table of
credit card info sitting around waiting to get hacked. As long as you
let your customers start and stop billing from your site it's easy to
keep track in the back end.
--~--~-~--~~~---~--~~
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: Vendor issue: Duplicate class name

2008-05-20 Thread jonknee

On May 20, 3:36 am, Matt Huggins <[EMAIL PROTECTED]> wrote:
> I'm trying to import a vendor class, but the class I'm importing in
> turn references another 3rd party class named "cache". Since there is
> already a CakePHP class named "Cache", I get an error message stating
> "Fatal Error: Cannot redeclare class cache in [filename]".
>
> Does anyone have any clue how I can work around this? I don't want to
> rename the vendor class since I'll need to perform future upgrades to
> the class, not to mention that the class name is referenced throughout
> much of the 3rd party code. I have no idea where to go from here.
> Please help!

This is why namespaces are being introduced into PHP (originally as
part of 6, but backported to 5.3)

http://us2.php.net/manual/en/language.namespaces.php

Unfortunately that's not going to help you now. You may be stuck
renaming manually (well at least with a regex).
--~--~-~--~~~---~--~~
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: Validating only specific fields within a model?

2008-05-19 Thread jonknee

> Does anyone have any insight on how to go about validating specific
> fields in a model for special circumstances like this?  Thanks!

We had a discussion that got into this topic recently:

http://groups.google.com/group/cake-php/browse_thread/thread/dc119a9b9cf4a89/5ef7b179de86f7a1#5ef7b179de86f7a1

There are a few ways to go, the easiest in your case is probably using
the 'on' key in your validation rules. You could also fetch the user's
data, modify it with the new password and then attempt to save the
whole thing back.

--~--~-~--~~~---~--~~
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: Issue with displaying image - trailing slash on url causes issue

2008-05-19 Thread jonknee

What does the generated HTML look like? Sounds like it's using a
relative path.
--~--~-~--~~~---~--~~
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: installing cakephp on a subdomain

2008-05-14 Thread jonknee

> Thanks but, this is my friend's server and I just talked to him on the
> phone. He said that he didn't want to give me total access (to Apache)
> because he didn't want me to break his server. I respect that and,
> will have to wait a couple of day to have all my domains and client's
> domains get transferred to my new box. In the meantime, he says the
> box IS configured for PHP correctly but, that I need to "hack" on it
> to get Cake to work properly.

He is incorrect. Correctly configured PHP will never (and I mean
never) offer up source code for a .php file. The problem most likely
lies in Apache, which is not putting the file through PHP, but it
falls under PHP configuration to make sure it's functioning through
the server environment.

And as has been said before, there is no real "installing" for
CakePHP. It's PHP so by nature is dynamically loaded on requests. You
just drop in the files and load the page. At most you have to set a
few paths. This method has some pros and cons, but it definitely makes
deployment easy. You'll find that out soon enough though, as soon as
PHP works for you it should be easy to get CakePHP rolling.
--~--~-~--~~~---~--~~
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: installing cakephp on a subdomain

2008-05-14 Thread jonknee

> Huh? If there has been Cake running on that (shared) box how is it not
> configured properly? There was a Cake install on one of my other
> domains when we (a friend and myself) decided Cake would solve the
> issues set out in front of us. Of course, he installed it as he's the
> developer. I'm trying to do this without just asking him to do it
> again. I'm trying to be somewhat self-sufficient although, I'm asking
> lots of questions, to you and him. Sorry for my indulgence here but, I
> need to learn for myself and, if I don't stumble and fall, I won't
> know what issues I'll encounter along the way in the future. Thanks
> very much.

Each virtual host on a server can have its own configuration. Because
PHP is working on one VH does not mean it's a sure bet on another. In
your case it's definitely not working. If PHP was working and CakePHP
was not, you would in the very worst case get an error message of some
kind or a blank screen. If PHP is working there is no way for it to
send out the source file unless you wrote a program to do do that
(that would be a huge security issue).

If you'd like to confirm this, remove the CakePHP stuff and replace
the index.php contents with . When PHP is working
you'll see a list of all its options and variables. Until you see that
page working, you will not be able to use CakePHP or any other PHP
code/library/framework.
--~--~-~--~~~---~--~~
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: possible bug? validation successful even though required fields are not empty

2008-05-14 Thread jonknee

> What if there was a case where you didn't want to save all of the
> fields again when you're updating a record?

There are a few ways to go, the easiest probably being
Model::saveField():

$this->User->id = 1
$this->User->saveField('username', 'new_username')

Or use some more complex validation to make use of the 'on' key
(http://book.cakephp.org/view/125/data-validation#on-131).

Or if you need to update a few fields, you could save some queries by
copying the data first, modifying the columns you want to change and
then saving the data.

But the current behavior is indeed correct. You simply cannot trust
that values that should be set in your form will be. If you get a
request that comes in missing a field, your validation routine needs
to pick that up. Otherwise, you'd need to do an isset() for each
required value after validation occurs.
--~--~-~--~~~---~--~~
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: installing cakephp on a subdomain

2008-05-14 Thread jonknee

> Anyway, I decided to delete the install and start from scratch. A
> friend said the files are supposed to be installed in httpdocs. They
> were (still are until I delete everything). When you go to the web
> page you're asked to download it instead of view 
> it.http://dev.miamiwebservers.com

You don't have your server properly configured. It's not a CakePHP
issue. Once you get PHP working, try rolling through the install
instructions again. You should be able to follow the instructions
exactly. You are doing a very basic setup and it's definitely covered
in the manual.
--~--~-~--~~~---~--~~
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: Common Dev Question

2008-05-13 Thread jonknee

> I think a good choice may be Submit user info using AJAX and if everything's
> OK, upload photo.

Hmm, that would probably work nicely. Another way (one that I
appreciate as a user) is to have a small sign up form and then let
users expand their profile. Just get the bare minimum and then once
they are registered you can have them fill out a profile and create an
avatar. That's what Twitter and Disqus do and I dig it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Common Dev Question

2008-05-13 Thread jonknee

> But what happens when Model does not validate, Insert is not done and there
> is no ID to use as filename?

If the registration form didn't validate, why would you bother doing
anything with the file? They are going to get an error and have to
resubmit the form (with a new photo).
--~--~-~--~~~---~--~~
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: installing cakephp on a subdomain

2008-05-13 Thread jonknee

There is no difference, subdomains aren't special (www or dev, it's
all the same code wise).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What is the difference in Model::getLastInsertID() and Model::getInsertID()

2008-05-13 Thread jonknee

> Out of curiosity what is Model::getLastInsertID() and
> Model::getInsertID() normally used for and is there a difference. The
> API has the same description for both methods.

There is no difference. Model:getLastInsertID() simply returns
Model:getInsertID(). As to why they are both there, no idea.
--~--~-~--~~~---~--~~
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: This is more of a general application design question than a CakePHP question...

2008-05-12 Thread jonknee

> So just have a process that checks the remote services every 30-60
> seconds or so, it'll be frequently enough and it'll make the whole
> local data thing so much easier.
>

That's waaay to frequent and could easily look like abuse. Even large
aggregators like Google Reader and Bloglines don't do that. And since
this is a tumble log it's much worse because it's all personalized
feeds (instead of a single RSS feed for CNN, you have an RSS feed for
each Flickr user). So instead of making a request every 30 seconds,
with just 100 users you are making 3 requests a second. That's
definitely going to be noticed.

I'd start at one or half hour intervals, perhaps with an option to
poll more frequently (15 minutes?).
--~--~-~--~~~---~--~~
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: Wordpress & CakePHP

2008-05-12 Thread jonknee

> Well this is what i am trying to achieve -> I am trying to build a
> system which has 80% similar functionalities of wordpress (like posts,
> comments on posts, monthly archives etc). But essentially each post
> would have dynamic form (similar to a poll) associated to
> it.Registered users of the system can complete and submit the form.

Sounds like it would be easier to write a WordPress plug-in honestly.
But if you wanted CakePHP, the easiest way would probably be to load
the form through AJAX (with the request call going to a CakePHP
address on your server).
--~--~-~--~~~---~--~~
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: hi guys

2008-05-08 Thread jonknee

> but when i point the browser to;http://localhost/posts/
> it shows: The requested URL /posts was not found on this server.
> any ideas what i could be doing wrong?

Is the error generated from CakePHP or Apache? If it's Apache you have
a problem with your.htaccess file (perhaps Apache is not looking for
them, which I have had happen on a few boxes before).
--~--~-~--~~~---~--~~
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: Warning message infecting thumbnail images occasionally

2008-05-07 Thread jonknee

Is there any reason you are generating thumbnails on the fly? This
sort of operation is much more efficient to do once (typically when
images are uploaded).
--~--~-~--~~~---~--~~
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: Database wont update fast enough

2008-05-07 Thread jonknee

> Whats not cakephp except the INSERT INTO.

You're ignoring the ORM. For simple queries like you are performing,
writing raw SQL isn't necessary (or even at all desirable).

Instead you would do something like this to lookup your users: $user =
$this->User->FindByEmail($email)

The other queries are also easily replaced by the ORM.
--~--~-~--~~~---~--~~
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: forced download

2008-05-07 Thread jonknee

> hi! i'm developing an application where the user uploads and downloads
> file. But during downloads, the files like jpegs, txt, those openable
> in the browser open in the browser itself. but i need them to come out
> as pop-ups or dialouge box with "save as" or a download manager/
> accelerator software to assist in download. how can this be done?
> thanks for the help!

You need to send a content-disposition header. Example in PHP:



The header() docs have more information: http://us.php.net/header

--~--~-~--~~~---~--~~
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: possible bug? validation successful even though required fields are not empty

2008-04-29 Thread jonknee

On Apr 29, 3:13 pm, MarcS <[EMAIL PROTECTED]> wrote:
> I don't think there's a bug in it.
>
> all I have is this
>
>         var $validate = array(
>                 'name' => VALID_NOT_EMPTY,
>                 'url' => array('rule' => 'url','message' => 'this field must 
> contain a valid url')
>         );

Not a bug per se, just not enough to tell CakePHP that the field is
required. VALID_NOT_EMPTY is a regex and will only be executed if a
value is passed. That's somewhat lame, but here's what you do if you
want it really to be required (just for the name field, you can get
the idea):

var $validate = array(
'name' => array('rule' => 'alphaNumeric', 'required' => true,
'message' => 'Required')
);

You have to set required=true.
--~--~-~--~~~---~--~~
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: possible bug? validation successful even though required fields are not empty

2008-04-29 Thread jonknee

> well my thinking is, if you wanted a field validated, you would have a
> form field present for it, at which point it would pass this field
> along for validation

You should never trust your validation to the form values that should
be coming in from the user (you should never trust *anything* from the
user). The user could easily not pass form fields and could also
easily pass values you don't expect.A model with a field marked as
required should always be required, no matter the circumstances.

Luckily, it appears CakePHP is doing just that. I just tried removing
a form field for a model that had a required validation and it
wouldn't save. I changed required=True to required=False and it saved
just fine.

I think the problem MarcS is having is simply a problem in his
validation routine. Can you post some code?


--~--~-~--~~~---~--~~
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: More of an SQL question ... having a hard time with this statement

2008-04-21 Thread jonknee


> I am not sure where to back up to.
>
> Without the asterisk, it doesn't grab the associated data.
>
> Insight on where to step back to?

The asterisk is the key to your problems, so you should dump it. In
its place you'll need the fields you want to use (the relational
data). You should be able to do this easily in the $fields array.

Something like this works fine:

SELECT users.id, users.first_name, users.last_name,
MAX(photo.revision_id) FROM photo LEFT JOIN users ON (photo.user_id =
users.id) GROUP BY photo.user_id

Since the database brings back the right data from that, I'm assuming
CakePHP can handle it 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: More of an SQL question ... having a hard time with this statement

2008-04-20 Thread jonknee

> So basically, it is adding the correct revision_id to the FIRST entry,
> which is where id=1 is coming from, that make sense?
>

Have you tried running the SQL that was generated and seeing if MySQL
is bringing back the right data? It might be forming an odd query that
brings back the data incorrectly.
--~--~-~--~~~---~--~~
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: Good cakephp developer

2008-04-20 Thread jonknee

> what is the general hourly charge of a cakephp developer. Can some one
> recomend a good way to hire one without being ripped off or getting
> poor quality work?

It depends on the developer. An experienced developer can get a
project done more quickly (while at the same time with a higher
quality) and should be rewarded as such. I usually bill out at around
$75-100/hr for contracting gigs. I don't factor something like CakePHP
in, I just use the tools that fit the job. If I have a little more
leeway I tend to charge less than if I am just following orders since
I get to do things my way and it's more enjoyable.
--~--~-~--~~~---~--~~
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: Function in view ....

2008-04-20 Thread jonknee

> So - where should I put the function and how can I call it? Any ideas?

Unless I'm missing something, that would ideally be a helper. You
could call it like any other helper myMethod($date); ?>.
--~--~-~--~~~---~--~~
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: More of an SQL question ... having a hard time with this statement

2008-04-18 Thread jonknee

> Any help?

SELECT user_id, MAX(revision_id) FROM your_table GROUP BY user_id

--~--~-~--~~~---~--~~
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: More of an SQL question ... having a hard time with this statement

2008-04-18 Thread jonknee

 > Any help?

SELECT user_id, MAX(revision_id) FROM ck GROUP BY user_id

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



Re: cakePHP or not?

2008-04-17 Thread jonknee

On Apr 17, 10:25 am, foongoos <[EMAIL PROTECTED]> wrote:
> I have a free lance developer that wants to do a job for me and he
> sounds very promising. The project is based on cake but I am afraid
> that I will not be able to tell the difference if he used another
> frameowork, maybe CMS or even bought a script. What are the sure signs
> that indicate that asite was build on cakephp? Some people say to
> check "view source" but that does not include any kind of code.
> Thanks.

The CakePHP libraries will have to be present, so that's a dead
giveaway. And the project should be organized like other cake projects
(controller, model, vendor, etc).

--~--~-~--~~~---~--~~
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: image from database as view is too slow

2008-04-13 Thread jonknee

On Apr 13, 6:28 am, schneimi <[EMAIL PROTECTED]> wrote:
> Ok thx jonknee, I understand the problem better now.
>
> The only reason I store them in db is that I have all data at one
> place and it's easy to handle for me, not the best reason I know.
>
> For now I will use the direct access to the db, thats fast enough.
> Here is the code I use now in the extra php to set up the db
> connection:

If you're going to be doing it that way, make sure you edit the
original script you posted... It has a glaring SQL injection hole:

> $result = mysql_query('SELECT thumbnail FROM covers WHERE album_id='. 
> $_GET['id']);

You're putting GET variables directly into a query... Might work nice
when id=1, but what about if someone makes id=1; DELETE FROM covers
WHERE 1? All of your cover images go away. Depending on the MySQL user
permissions they could do a lot worse.

In your case you could simply pass the GET id variable through
intval() to make sure it's just a number. Adding a LIMIT 1 wouldn't
hurt either in case any duplicates ever pop up in the DB.

So something like this:

$result = mysql_query('SELECT thumbnail FROM covers WHERE album_id='.
intval($_GET['id']) . ' LIMIT 1');


--~--~-~--~~~---~--~~
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: bug with default controller 1.x

2008-04-12 Thread jonknee

You probably don't want to name a controller
'controller' (redundant)... But beyond that, you'd have to name it
controller_controller.php.
--~--~-~--~~~---~--~~
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: image from database as view is too slow

2008-04-12 Thread jonknee

> Would view caching help in this circumstance?  Assuming that there is
> some good reason for the images to be in the database, then this should
> avoid most of the Cake overhead.  Just a thought ...
>

That might speed it up somewhat, but you're still executing thousands
of lines of code to serve a thumbnail. x20. The best view "cache" in
this instance is simply to never have the image in the db (it's
"cached" as a JPG on the file system and served directly).
--~--~-~--~~~---~--~~
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: image from database as view is too slow

2008-04-12 Thread jonknee

> But I would really like to do it the cake way, so my question is, what
> can I do to speed it up over controller/action? And if there is not
> much I can do, how could I at least include the cakePHP database
> connection into the extra php file?
>

The CakePHP way would be to not store the images in the database...
It's a pretty poor practice, especially in a case like yours with 20
different images. And especially when you are working through a
framework because of the additional overhead. Think about how browsers
work, there's one request for the page and then another request for
each file required (stylesheets, JS scripts and images). In your app
just one page load is like getting over 20 simultaneous hits. That
isn't terribly bad for static content like images because they get
served up really quickly, but CakePHP has a significant overhead and
won't be able to easily scale for what you're doing. Your server is
doing 20x the work that it should be doing.
--~--~-~--~~~---~--~~
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: |OT| What is your preferred URL structure?

2008-04-09 Thread jonknee

For one site recently that had a database of restaurants broken down
by neighborhood (and city) I went all keyword based. Worked well (city/
neighborhood are all variable keywords):

/browse/city
/browse/city/neighborhood
/restaurant/city/neighborhood/slug

It took some fairly complex routing to get it straight (there are
obviously more URL types than that), but well worth it in the end
because all the URLs are human-readable.
--~--~-~--~~~---~--~~
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: Model find() to return object; instead of array (?)

2008-04-04 Thread jonknee

> > Either that or you'll have to run queries using LIMIT and OFFSET to
> > grab what you need one chunk at a time.  I don't know any scripting
> > language that handles sucking in 600,000 records via a web page.
>
>       Think about phpMyAdmin?
>

PHPMyAdmin makes the DB do all the work. When you upload a .sql file
you are just uploading a file and then telling MySQL the location and
it does all the importing. Same thing with CSV exports. And I've had
plenty of timeouts even with that.

If your reports are really that heavy duty you're probably better off
doing them in batches or from another environment altogether (such is
have CakePHP trigger a report to be run by a Python script). That
said, you can probably heavily optimize your data in the DB, PHP
shouldn't have to deal with all the records in the first place.
--~--~-~--~~~---~--~~
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: Notice (8): Undefined index: in cakephp 1.2

2008-04-04 Thread jonknee

What's not clear about the error message? You have a high error
reporting level (which is why you are seeing notices) and there are
two problems in abc_controller.php. One is you're trying to access an
array with an invalid key. The other is you're trying to access a
variable that doesn't exist. It gives you the variable names, so it
should be a few seconds worth of looking to fix.
--~--~-~--~~~---~--~~
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: Check Unique in a model

2008-04-04 Thread jonknee

> In fact, it seems that this built-in rule doesn't work!
> Why is this not yet fixed? We allways need to check unicity of a field
> in all of our applications...

What's not working for you? It seems to be working for me. I had a
custom method until I was told about isUnique working through
validation and after updating my code it seemed to keep working.
--~--~-~--~~~---~--~~
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: Is it possible to create a true REST application yet?

2008-04-04 Thread jonknee

> Are there really any truly REST compliant applications
> yet?  or am I missing something major here?  Any help/opinions would
> be greatly appreciated.
>

Yes, but not web browsers. There are tons of applications that tie in
with REST APIs and use all four verbs. It would be really nice if web
browsers could do the same.
--~--~-~--~~~---~--~~
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: Check Unique in a model

2008-04-03 Thread jonknee

> I'm trying to make a correct validation for my model.

You can also just use the built-in isUnique function right from
validation. No need to roll your own on this one. (Just make the rule
like so: 'rule' => 'isUnique')

--~--~-~--~~~---~--~~
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: Application Index Controller

2008-04-02 Thread jonknee

Not a problem, it just needs a route set up in config/routes.php,
something like:

Router::connect('/', array('controller'=>'home', 'action'=>'index'));

That's for 1.2, the syntax is a bit different for previous versions
but the idea is the same. Route '/' to a controller and action.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: run cakephp app within an iframe

2008-03-31 Thread jonknee


> > Try [1]:
>
> ">
>

His CakePHP app is only inside the frame, so the HTML helper is not
available.
--~--~-~--~~~---~--~~
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: run cakephp app within an iframe

2008-03-31 Thread jonknee

> Is there a way to do this without an absolute URL?

Did you try with a leading /? With your original method it would only
work on the root directory.

Example:



--~--~-~--~~~---~--~~
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: Parsing a cakephp session Data row

2008-03-30 Thread jonknee

> Thanks for your repleys.  I got it working.
> This is how I got it to work. Comments welcome.

You're hugely over complicating things... If you use the
SessionComponent as previously suggested, all you'd need to do is:

$this->Session->read()

No crazy SQL, regular expressions, etc etc. Just a method call.
--~--~-~--~~~---~--~~
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: Catching MySQL errors

2008-03-28 Thread jonknee

> Dardo beat me to it...I was going to suggest the same thing:  a custom
> validation method to make sure you have a unique "slot name"

No need to make it custom, it's built into 1.2 Model::isUnique() and
can be accessed as a validation rule:

'rule' => 'isUnique'

It works great, I'm using it for usernames/email addresses.
--~--~-~--~~~---~--~~
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: Run query in background while showing "Please wait"

2008-03-27 Thread jonknee

> Now, here's where we stand...
>
> jonknee's query took about 25-27 seconds and returned 154 records.
>
> b logica's query took about 6 seconds and returned 24 records

Sounds about right, except for the difference in number of dupes. How
many are there in total?
--~--~-~--~~~---~--~~
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: Run query in background while showing "Please wait"

2008-03-27 Thread jonknee

> I may have not explained the setup properly. I don't actually have a
> "full_name" field in either table (import_contacts and contacts are
> the actual MySQL table names). Each of these tables have "fn" and "ln"
> fields, however. So the problem is that I need to somehow find all
> records in the contacts table which have the same values in the "fn"
> and "ln" fields as the import_contacts table.

That should still be able to be handled pretty easily with SQL. You
got me interested so I created a test DB formatted like you said
(first_name, last_name) and this query works fine. Only spits out the
dupes (when first and last names are the same, if one of the two is
different it doesn't show up):

SELECT * FROM contactImport WHERE first_name IN (SELECT first_name
FROM contact) AND last_name in (SELECT last_name FROM contact)

b logica's way would work too, so you could just check whatever is
faster. I don't have 30,000 records to test that out on :P.

--~--~-~--~~~---~--~~
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: Run query in background while showing "Please wait"

2008-03-26 Thread jonknee

> The reason I can't have the database do the searching for me is
> because the criteria I want to search against to find potential
> duplicates doesn't have a direct one-to-one correlation to the
> database table fields.

Hmm. Is there a way you could make them directly correlate? It's a
pretty fast DB query if you can get them to line up. If I'm
understanding it correctly, you just have a full name in the import
model and broken out first and last names in your contact model. This
can work, though you'll probably need some manual SQL. Instead of
CONCAT you want to use CONTACT_WS(' ', 'fn', 'ls) which will result in
a space between the first and last names.

SELECT * FROM contactImport WHERE full_name IN (SELECT CONCAT_WS(' ',
first_name, last_name) FROM contact)

That will match a record in contactImport with a full_name of "Joe
Blow" when there is a record in contact with a first name of "Joe" and
a last name of "Blow".

The beauty of doing the heavy lifting in SQL, even if you can't do it
in the ORM, is that you only have to bring the matches across the
wire. So instead of a minimum of 30,000 records coming out of the DB
(and each getting messed around with Cake's ORM) you get only the
dupes.
--~--~-~--~~~---~--~~
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: Advice about a Calendar

2008-03-26 Thread jonknee

> I was wondering if anyone has used a cake calendar in their apps -
> what they used and how well it worked, what sort of integration
> problems they encountered, etc.

Not sure exactly what you need, but Yahoo has a really nice calendar
solution inside its YUI platform. You'll recognize it from their apps
(Yahoo Travel especially).

http://developer.yahoo.com/yui/calendar/

I haven't used it with CakePHP, but and of these JavaScript solutions
should be pretty easy to integrate.
--~--~-~--~~~---~--~~
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: looking for a hosting company

2008-03-26 Thread jonknee

I have been enjoying LiquidWeb. I don't host any Cake stuff there at
the moment, but have had no problems with a shared account and have
been really impressed with a VPS (which hosts a fairly busy vBulletin
forum). They don't do crazy overselling like Dreamhost .
--~--~-~--~~~---~--~~
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: Run query in background while showing "Please wait"

2008-03-26 Thread jonknee

> I have a CakePHP CRM application with 30,000+ contact records. Each
> Contact hasMany Address records. One feature of my app is to allow my
> client to search for duplicate entries within the contacts table
> before importing new contacts. In short, I am querying the entire
> Contact table and LEFT JOINing with the Address table. I store the
> result set into an array and then use PHP's array functions to filter
> potential duplicates from a "pending contacts" table.

What exactly are you doing? It can probably be handled pretty quickly
by the database. You shouldn't have to manually fish out dupes.

I always thought the please wait while we search messages were either
a [poor] attempt to seem extra high-tech or a sign that they have a
really inefficient system. Google searches the whole web--not just a
day's commercial flights--and comes back in a flash.

I have used a PHP app with a valid reason for it, it was a mailing
list program and it accomplished sending large amounts of email out by
batching (the page would keep reloading with incrementing GET
variables, such as start=0&num=100). It wouldn't work in your case.
--~--~-~--~~~---~--~~
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: Include PHP code in view

2008-03-26 Thread jonknee

> Okay, sounds good. So where do I find this information on building my
> own helper? Please provide a link to some instructions if you can.

A helper is definitely what you want here. They are really easy:

http://manual.cakephp.org/chapter/helpers (Section 2, all the way at
the bottom)

Basically you create a file in the helpers directory called common.php
and then inside it define your class:



Now in your view you can call your function like myFunc($data); ?>. Just make sure you include the helper inside your
controller or AppController.
--~--~-~--~~~---~--~~
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: Moving data from a controller to a view after doing some queries

2008-03-25 Thread jonknee

You could also vastly simplify that controller if you had a field for
first_name and a field for last_name. No crazy foreach() loops and
what not, your entire controller could simply be:

data){
  $this->set('data', $this->Client-
>findAll(array('Client.first_name LIKE "%' . $this->data['Client']
['first_name'] . '%"', 'Client.last_name LIKE "%' . $this-
>data['Client']['last_name'] . '%"')));
}
}
?>

--~--~-~--~~~---~--~~
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: Form validation priorities

2008-03-25 Thread jonknee

> So, is there a bug here or am I the
> only one who thinks that on => create has to have more priority than
> the other lines?

What version are you using? From the code it seems like if the on rule
is set it shouldn't be executing anything more:

if (empty($validator['on']) || ($validator['on'] == 'create' && !
$exists) || ($validator['on'] == 'update' && $exists)) {
 //validation
}

In the case of an update it would be failing all three conditions and
not proceeding.

I have an almost identical validation rule set up for my users Model
and it works as expected.
--~--~-~--~~~---~--~~
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: Friendly-url for multi-language site

2008-03-25 Thread jonknee

> I need a multi language site with cakephp. Ok, this topic is discuss
> commonly. But I need a friendly-url solution, something's like:
>    http://mywebsite.com/lang/controller/view

Couldn't you just make a space for the language in your routes and
then deal with that variable in AppController::beforeFilter()? No need
to manually parse anything out.

Something like:

Router::connect('/:lang/:controller/:action');


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



Re: jsn imageshow for cake

2008-03-24 Thread jonknee

It's just a Flash slideshow, feed it some images and it will show
them. If anything it would be a Helper, not a component. You can feed
it images with a view that outputs in XML in this format:

http://www.joomlashine.com/modules/jsn_imageshow/xmldata105.xml?xml=xml11362390

There are plenty of Flash slideshow SWFs out there, so choose one you
like and then write a controller to give it data. You'll be good to
go.

On Mar 24, 9:01 pm, bob <[EMAIL PROTECTED]> wrote:
> does anybody know any cakephp components similar to JSN 
> ImageShow?http://extensions.joomla.org/component/option,com_mtree/task,viewlink...
>
> thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Modal / Lightbox?

2008-03-24 Thread jonknee

> That seems like an option to re-create flash(). So you would set a
> variable, the page reloads, and it shows the message. What I am trying
> to do is trigger a popup window without the page reloading.

If you want to do it without reloading the page then you must be
sending out an AJAX call of some sort, so your problem is just a JS
task. If I understand correctly, based on the response you get from
your AJAX call you want to show a message. Is that accurate? Can you
give an example of what you're trying to accomplish (e.g. what does
the user do to see these messages you want to send).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do you handle Guest Users?

2008-03-24 Thread jonknee

> I believe that's the default behavior in AclComponent for protected
> pages.

I meant AuthComponent :).

> Another question: where do you set if a page requires a user or admin?

That belongs under the ACL component, Auth just shows they are indeed
logged in. ACL says what they can do. In my setup I only use ACL for
admin functions. I wrote a few methods in app_controller that checks
the current user against a Aro, so I can say $this-
>requireAro('admin') to assure that the user is an admin.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do you handle Guest Users?

2008-03-24 Thread jonknee

> Cool. That´s what I wanna know. But now I have a new question,
> regarding to Auth:

I believe that's the default behavior in AclComponent for protected
pages. So if the user doesn't have access to a page and are not logged
in they will automatically be shown a login form. Along with a flash
containing the value of AuthComponent::authError.

This page can help you set it up to easily manage permissions on a per
method basis:

http://myeasyscripts.com/loudbaking/how-to-use-authcomponent-in-cakephp/

I found it quite useful.


--~--~-~--~~~---~--~~
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: Edit a form that contains an image

2008-03-24 Thread jonknee

> is there a way to not overwrite the field
> unless a new image is uploaded.  essentially only activate the file
> upload if somebody adds a file otherwise it remains as it was?

It looks like all your controller does is manage the upload, so you
could simply check to see if that field is populated before saving it.
Otherwise (if there are more fields being updated, such as a whole
user profile) you can check if there is an image and if not unset()
that field.

Such as:

if(isset($this->data['Pic']['file']) && $this->data['Pic']['file'] ==
"") {
unset($this->data['Pic']['file']);
}


--~--~-~--~~~---~--~~
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: counterfile dataspource

2008-03-24 Thread jonknee

> I am interested to know what other (more experienced) bakers think of it.
> Is it usable? Any suggestions?

It seems like overkill... What do you need a counter for?
--~--~-~--~~~---~--~~
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: Modal / Lightbox?

2008-03-24 Thread jonknee

> Ok .. I understand you can call it from the view .. but if you look 4
> posts above, my goal is to call it inside a controller, like you would
> a flash():

Just set() a variable and have the layout look for said variable and
create the div for it.

In controller:

$this->set('modal', array('Success!', 'This is valid'));

In view:


--~--~-~--~~~---~--~~
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: Suppressing UTF-8 BOM output

2008-03-24 Thread jonknee

> Ah, but I downloaded the homepage for the site using curl and it has
> the same prefix, so it's not just for XLS generation - that's just the
> one that seems to break as a result. The HTML files have the same
> problem, but browsers ignore it. So whichever file it is, it appears
> to be one that's being used for every page in my Cake app.

I had a similar problem with a symbol (I forget which, perhaps a ?)
showing up on every page. Turns out it was present in a file, I think
appController after the PHP. So I would make sure there is nothing,
whitespace included, in outside of  in your included files
(app_controller.php, app_model.php, any vendors, components, helpers,
etc).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do you handle Guest Users?

2008-03-24 Thread jonknee

> There has to be better ways. Any idea?

I don't have anything set up for guests and it works well. If a page
requires a user or admin and there is no valid user session, it gets
denied. No database hit required.
--~--~-~--~~~---~--~~
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: Edit a form that contains an image

2008-03-24 Thread jonknee

> However, when i click edit it will only populate the input
> fields not the file field, and if i update it like that it creates a
> new entry and leaves the file field null.  Is there something I am
> missing?

File fields cannot be pre-populated as a security measure so files
don't get accidently uploaded (you could theoretically load a path to
a file that the user doesn't want to share and if they submit the form
you suddenly have data they didn't want to give you).

Also you might want to optimize this bit of code to only hit the
database once:

> $this->Pic->id = $id;
> $this->set('pic', $this->Pic->read());
> $this->data = $this->Pic->read();

I'm not sure why you need the same data in your view as $pic and $this-
>data, so you can probably do without the $pic set. If you're using
the formHelper you just need it in $this->data to have everything pre-
populated.  And you can do without setting the ID by just using one of
the other Model methods.

Such as: $this->Pic->find(array('id'=>$id));

Or the magic method way, $this->Pic->FindById($id);

Or probably what I would do is to define a method in PicModel to
lookup by ID and show an error if the ID was invalid. That way you
can't try and edit a record that doesn't exist.
--~--~-~--~~~---~--~~
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: Different flash layout for public and admin ?

2008-03-23 Thread jonknee

You could go a couple different ways... Since you have a different
layout you probably also have a different stylesheet. If that's the
case, just modify the message style in it and you're good to go. If
you're using a shared stylesheet you can modify the call to
sessionComponent::setFlash() and set a custom layout (its the second
parameter).

On Mar 23, 2:55 pm, Neveldo <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've ever a different layout for the website and the administration by
> using $this->layout in app_controller.php.
>
> But, is it possible to do the same thing for the flash layout ? In
> fact, I want to use a different layout for the flashes on the website
> and the flashes on the admin.
>
> Thank !
>
> Cordially,
> Neveldo -http://www.neveldo.fr
--~--~-~--~~~---~--~~
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: One component for every element? Is this right?

2008-03-05 Thread jonknee

That seems pretty reasonable if you want to keep things really
modular. I say go for it.

On Mar 4, 8:46 pm, Chris <[EMAIL PROTECTED]> wrote:
> At my office, we are working to completely rebuild our existing 
> site,www.sportingnews.com.  We have mocked up a rough example of a 
> page,www.sportingnews.com/nflusing cakephp and we are now ready move on to
> building a full fledged cms/blog/forum system.
>
> My main question is this.  We have elements that can be used anywhere
> on the site (new clips, recent posts, headlines, etc, etc, the list
> goes on for hundreds).  Our editors will have the ability to add
> elements to pages, move them around etc.
>
> I would like to know what the cakephp community thinks is the best way
> to load all the data needed to power each element.
>
> Currently, we have one component for every element.  That component
> operates completely independent from the controller that is calling
> it.  This allows the element/component to be used by any controller/
> view.  The component then builds a data set that we set in the
> controller and hand off to the view/element.
>
> This seems to work, but would like to know if there is a better way of
> doing this.
>
> Thanks,
> Chris
--~--~-~--~~~---~--~~
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: Which CakePHP version should I use?

2008-03-04 Thread jonknee

I'd definitely go for 1.2 using PHP 5.

On Mar 4, 3:32 am, Reza Muhammad <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I was just reading about CakePHP, and I was thinking to use CakePHP
> for my web applications, as it looks fun and easy to code.  What I
> would like to know is, which version should I use? I know the latest
> stable version is still 1.1, yet alot of articles / tutorials I found
> on bakery are for CakePHP 1.2.  I also notice that some helpers are
> changed in 1.2 (for example, to create a form, 1.1 use $html helper,
> but 1.2 uses $form helper).
>
> If I chose to use 1.1, would updating to CakePHP 1.2 be a steep
> process? (In terms maintaining existing codes that are already written
> in 1.1).  Also, is it safe to use CakePHP 1.2 these days?  And this
> might be annoying to ask, but I couldn't find it on CakePHP's website,
> so here goes, When should we be expecting 1.2 to release?
>
> Thanks for the help

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



Re: How to load helpers for elements?

2008-03-04 Thread jonknee

For common elements (stuff that would be in the sidebar or whatever)
app_controller is your best bet. For less common ones just include the
helper in the controller that the elements are being used in. Unless
you have a huge number of controllers it should be pretty simple.

On Mar 4, 5:51 pm, Mech7 <[EMAIL PROTECTED]> wrote:
> I am currently doing it in the app_controller but the list is growing
> hehe.. is there a more efficient way to load them in specific elements?

--~--~-~--~~~---~--~~
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: Multiple instances of components

2008-03-04 Thread jonknee

This should work:

EmailTwo = new EmailComponent(); ?>

Just make sure you have the component listed in the
Controller::components array.

On Mar 4, 4:25 pm, Danomite <[EMAIL PROTECTED]> wrote:
> I need a way to have one controller have multiple instances of a
> component.  Is there a way to do this?

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



Re: how to update a profile in cakephp

2008-01-30 Thread jonknee

I would just set the ID first since you want it in both conditions (if
there is form data and if there is form data).

function edit($id) {
$this->product->id = $id;


But there should also be some validation that the user really does
have access to edit that profile. I'm assuming this is a function for
your users to update their own profiles... It would probably be better
to get the user_id from the session and not a hidden variable (which
can easily be changed client side).

-Jon


On Jan 30, 8:05 am, "Matias Lespiau" <[EMAIL PROTECTED]> wrote:
> I think you will have to set your model's id  manually like this:
>
> function edit($id){
>        if (empty($this->data)) {
>                $this->product->id = $id;
>        $this->data = $this->product->read();
>        }else{
>                $this->product->id = $this->data['product']['id'];
>                if($this->product->save($this->data['product'])){
>
> >                        $this->Session->setFlash('Updated Sucessfully');
> >                        $this->redirect('/product/account_settings');
>
> >                }else{
> >                        $this->Session->setFlash('Please correct the
> > errors');
> >                }
> >        }
>
> >  }
>
> That should fix it.
>
> Cheers,
>
> --
> Matias Lespiauhttp://www.gignus.com/

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



Re: Simple 1.2 Beta Form Example?

2008-01-29 Thread jonknee

I would probably add the length limits to the form as well, I find it
frustrating when I fill out a form and get back errors that were for
limitations I didn't know about.

I didn't see it listed anywhere, but I went ahead and documented what
can be in the $form->input() $options array:

before
between
after
type
multiple
maxlength
div
label
error
selected
empty
timeFormat
dateFormat

I'd use one of before/between/after to put a note up about field
restrictions and probably go ahead and add the maxlength in.

--~--~-~--~~~---~--~~
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: Business Benifit?

2008-01-25 Thread jonknee

If I was trying to sell CakePHP to a boss, here's the route I'd take:

* Rapid development which means more projects can be completed with
the same staff (and a higher per hour billing rate)
* Using a framework keeps code organized which means it's
significantly easier to maintain and bring new people on board
* No special server requirements or configuration, unlike popular
frameworks in Ruby and Python
* Open source so if there is something missing or broken it can be
fixed

CakePHP isn't a perfect match for every project, but it's a great
tool. Short of a really nice in house framework, it's probably worth a
try. If for nothing else you'll see that it's possible to have a well
organized and secure PHP app. And if you already know PHP you should
be able to get up to speed with Cake in a few days. Even more quickly
if you've used another MVC framework in the past.

On Jan 24, 4:36 pm, "Doug @ Straw Dogs" <[EMAIL PROTECTED]>
wrote:
> I'm a developer by heart and know I'd love to code in CakePHP.
> However, I'm failing to see any solid business benifit in using it
> that can help me sell it to the directors.
>
> The site states features - but not benifits and certainly not business
> benifits.
>
> Imagine there's a small company with 2 developers.  One knows Cake and
> the other doesn't.  The preferred development method is 'quick and
> dirty' with no desire to learn new methods.
>
> How do you sell a new framework like Cake in that instance?
>
> Help me out - please? :)
>
> P.S.
>
> In answer (devils advocate) to the sites sales pitch:
> "No Configuration" - Way too vague.
> "Extremely Simple" - One developer doesn't know how to use it.  Time
> is money and no matter how simple it is, it will still require time to
> learn.
> "Active, Friendly Community" - So what?  Why do I care?  I can do it
> in PHP - that has a huge community too.
> "Best Practices" - We've not used best practices before and its
> worked.  So why change now?
> "OO" - As above.  Nothing more than a buzzword.  Whats the point.
> Yada yada yada.
>
> This is what I'm up against

--~--~-~--~~~---~--~~
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: Debugger stuck in a loop

2008-01-24 Thread jonknee

It is a bit odd. Unfortunately the Debugger class is new in 1.2 so
there is nothing to look back on. I'm not familiar enough with the
inner workings to fix it fully, but there is definitely some more work
to be done in the class. As you mentioned, $recursion doesn't seem to
be doing anything (one of my ideas was that it was missing from
__object() which is why it never gets out of the loop, but then I saw
$recursion is never checked anywhere).

Anyway, I appreciate your help. If I figure it all out I'll post back
and put a patch up.

-Jon

On Jan 23, 7:21 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I haven't yet had the time to look into it in much detail so I'm
> afraid I'm not much help. I think you are absolutely right though. I
> also think it's odd that the $recursion variable that keeps getting
> counted down whenever exportVar() is called (except when it is called
> from __object()) and is never used.  $recursion seems to be
> deincremented and that's it, it is never used for anything else.
> Perhaps it was meant to break when $recursion reached some value but
> the code was never implemented? I'll have to compare to 1.1's code and
> see if I can make sense of what they are trying to do.
>
> Dave
>
> On Jan 23, 3:22 pm, jonknee <[EMAIL PROTECTED]> wrote:
>
> > Great, thanks for the tip. This is almost certainly a bug since the
> > debugger should never get stuck in an infinite loop. If I take the
> > __object() call out of the 'object' case, everything works fine (even
> > with get_class() intact). I just wonder what the intended behavior is,
> > the documentation isn't there.
>
> > I did some digging and here's what I found:
>
> > __object() is getting called infinitely from that object case, I added
> > a counter and it counts as long as I let it. So here's what I think is
> > going on, Debugger::exportVar() is called and when it gets to the
> > object case it calls Debugger::__object(). Debugger::__object()
> > executes and in turn calls Debugger::exportVar(). Which calls
> > Debugger::__object(), rinse and repeat.
>
> > I'm not sure what the intended data is, so I can't write up a patch.
> > Any ideas?
>
> > On Jan 23, 4:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > actually, after re-reading my post I think you're seeing problems with
> > > the same function that I am (the __object($var) function, not the
> > > get_class() function as I stated above) try commenting out the same
> > > lines of code from my earlier post:
>
> > >                       //causes some sort of overflow
> > >                         //case 'object':
> > >                         //      return get_class($var) . "\n" . $_this-
>
> > > >__object($var);
>
> > > on line 364. It's the only place in the debugger that __object($var)
> > > is called so I bet it will fix it.
>
> > > Dave
>
> > > On Jan 23, 2:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > here is my previous 
> > > > post:http://groups.google.com/group/cake-php/browse_thread/thread/48c6a57a...
>
> > > > On Jan 23, 2:40 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > I was having a similar problem with the cake debugger running out of
> > > > > memory on an error (in this case it was an undefined variable in the
> > > > > view). I just commented out the offending lines of code in /cake/libs/
> > > > > debugger.php. The problem was a call to the get_class() function and
> > > > > it looks like it's happening with you on line 414 as well. I'd try
> > > > > commenting out the following:
>
> > > > > //if(in_array($serialized, $history, true)) {
> > > > > //       $value = ife(is_object($value), "*RECURSION* -> " .
> > > > > get_class($value), "*RECURSION*");
> > > > > //}
>
> > > > > and see if it starts behaving.
>
> > > > > Dave
>
> > > > > On Jan 23, 1:54 pm, jonknee <[EMAIL PROTECTED]> wrote:
>
> > > > > > I recently upgraded to v1.2 and have been playing around to get 
> > > > > > Smarty
> > > > > > working (which is how I was using Cake 1.1). It's going fine except
> > > > > > when I call a variable that doesn't exist... Smarty throws the
&g

Re: Redirect leaves old URL

2008-01-24 Thread jonknee

Hmm. It probably is a FaceBook thing like David said, see here:

http://facebook-developer.net/2007/11/27/implementing-a-simple-facebook-redirect-with-cakephp/

"In Facebook, redirecting the end user cannot be performed with a
standard redirect call as in the above example. Trying to do so will
instead redirect the Facebook Platform itself, having it search for
FBML output at whatever URL is specified in the redirect call. The end
user will still end up at the same page without being redirected,
being served the FBML output that your application sends to the
Platform."

It provides a solution. I'd give that a shot.

-Jon

On Jan 23, 6:52 pm, Daniel Moore <[EMAIL PROTECTED]> wrote:
> Hey,
>   I'm moderately new with CakePHP, but I have this issue where my
> redirect leaves the old URL in the browser.
>
> [code]
> //messages_controller.php
> function post() {
>     // ... Some Stuff
>
>     // Redirect back to McGriff messages
>     $this->redirect("/");}
>
> [/code]
>
> Yet the browser still shows:http://apps.facebook.com/mcgriff/messages/post/
> instead of:http://apps.facebook.com/mcgriff/
>
> Any suggestions?

--~--~-~--~~~---~--~~
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: Debugger stuck in a loop

2008-01-23 Thread jonknee

Great, thanks for the tip. This is almost certainly a bug since the
debugger should never get stuck in an infinite loop. If I take the
__object() call out of the 'object' case, everything works fine (even
with get_class() intact). I just wonder what the intended behavior is,
the documentation isn't there.

I did some digging and here's what I found:

__object() is getting called infinitely from that object case, I added
a counter and it counts as long as I let it. So here's what I think is
going on, Debugger::exportVar() is called and when it gets to the
object case it calls Debugger::__object(). Debugger::__object()
executes and in turn calls Debugger::exportVar(). Which calls
Debugger::__object(), rinse and repeat.

I'm not sure what the intended data is, so I can't write up a patch.
Any ideas?

On Jan 23, 4:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> actually, after re-reading my post I think you're seeing problems with
> the same function that I am (the __object($var) function, not the
> get_class() function as I stated above) try commenting out the same
> lines of code from my earlier post:
>
>                       //causes some sort of overflow
>                         //case 'object':
>                         //      return get_class($var) . "\n" . $_this-
>
> >__object($var);
>
> on line 364. It's the only place in the debugger that __object($var)
> is called so I bet it will fix it.
>
> Dave
>
> On Jan 23, 2:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > here is my previous 
> > post:http://groups.google.com/group/cake-php/browse_thread/thread/48c6a57a...
>
> > On Jan 23, 2:40 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > I was having a similar problem with the cake debugger running out of
> > > memory on an error (in this case it was an undefined variable in the
> > > view). I just commented out the offending lines of code in /cake/libs/
> > > debugger.php. The problem was a call to the get_class() function and
> > > it looks like it's happening with you on line 414 as well. I'd try
> > > commenting out the following:
>
> > > //if(in_array($serialized, $history, true)) {
> > > //       $value = ife(is_object($value), "*RECURSION* -> " .
> > > get_class($value), "*RECURSION*");
> > > //}
>
> > > and see if it starts behaving.
>
> > > Dave
>
> > > On Jan 23, 1:54 pm, jonknee <[EMAIL PROTECTED]> wrote:
>
> > > > I recently upgraded to v1.2 and have been playing around to get Smarty
> > > > working (which is how I was using Cake 1.1). It's going fine except
> > > > when I call a variable that doesn't exist... Smarty throws the
> > > > 'Undefined index' error that should be no problem (and in most cases
> > > > not be seen), but Cake's debugger takes over and gets stuck in a loop.
> > > > The httpd process takes 100% of the CPU and 30 seconds later I see a
> > > > message that the script was halted because the maximum execution time
> > > > was exceeded.
>
> > > > > [error] PHP Fatal error:  Maximum execution time of 30 seconds 
> > > > > exceeded in /Library/WebServer/cake/cake/libs/debugger.php on line 414
>
> > > > Any ideas on how I could either see what the code is choking on or how
> > > > to let Smarty opt-out of the Cake error sequence?
>
> > > > The compiled Smarty code that's causing this comes out looking like:
>
> > > > _tpl_vars['variable_name']; ?>
>
> > > > If $this->_tpl_vars['variable_name'] isn't defined the whole thing
> > > > goes into the endless loop and I have to kill the process or wait it
> > > > out.

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



Debugger stuck in a loop

2008-01-23 Thread jonknee

I recently upgraded to v1.2 and have been playing around to get Smarty
working (which is how I was using Cake 1.1). It's going fine except
when I call a variable that doesn't exist... Smarty throws the
'Undefined index' error that should be no problem (and in most cases
not be seen), but Cake's debugger takes over and gets stuck in a loop.
The httpd process takes 100% of the CPU and 30 seconds later I see a
message that the script was halted because the maximum execution time
was exceeded.

> [error] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in 
> /Library/WebServer/cake/cake/libs/debugger.php on line 414

Any ideas on how I could either see what the code is choking on or how
to let Smarty opt-out of the Cake error sequence?

The compiled Smarty code that's causing this comes out looking like:

_tpl_vars['variable_name']; ?>

If $this->_tpl_vars['variable_name'] isn't defined the whole thing
goes into the endless loop and I have to kill the process or wait it
out.

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