Re: Organizing, Keeping straight, your Javascript collection

2007-04-06 Thread Kjell Bublitz

Creating your own utilities is a good thing. I have one like that for
prototype. There are some handy methods that were missing on elements.
I always try to be close to the library i use.

[off topic]
By the way: Most of the methods on the site you posted are all
included in prototype, btw.

- cssQuery is basicly $$
- inArray = include()
- inserAfter = Insertion.After
- getElementsByClass = same name
- Event.observe for event things.

I stopped creating my own utility library, 'cept for the custom
element methods said. Most stuff you'll probably ever need is covered
in all major libs already + you benifit of the ever-debuggin community
behind those functions. I avoid snippets most of the times. You never
know if they are properly tested and save.
[/off topic]

Crunching Javascript:
I am currently evaluating on the fly server-side packing of my
scripts. I said i have the .htaccess for the gzip compression. I went
a little further tho: The packer from Dean Edwards - which crunchs
javascript files to a minimum - exists as PHP class. I included that
one into the compression.php and it works like a charm.

You can work in the editor with the original source and when you
refresh your cakephp app the packer will crunch it (and gzip). I think
that covers everything you could possibly do to deliver your scripts
fast and small.

http://dean.edwards.name/packer/

Keeping it fresh:
Another trick is to read the file modification time and append it to
your js file links.
Should looks like this: src="js/myproject.js?20070402_2348"

The compression.php set the cachetime to 5 hours (or something..), but
we might want to force updates on the clientside. Preferbly when we
last edited the file of course.

Here is where the file modification time jumps in. If the sript src
changes due to date changed on the file (upload/save), the user
downloads the new source because it does not match with the filename
in his cache anymore. This only happens once of course. Then the
cachetime is in effect again.

Happy coding

On 4/7/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
> Thanks for sharing how you do that, Kjell.
> That was definitely helpful.
>
> I know I will eventually decide on one of the major frameworks to
> adopt permanently.
>
> But sometimes, you're sitting lazily at the PC on a Sunday afternoon,
> reading blogs or whatever, and you come across a Javascript function
> that you want to add to some permanent library somewhere,  and this
> function isn't in whatever Framework I adopted, so I add it to a
> central generic utility JS file that grows and grows (and of course
> shrinks sometimes when I realize I've added junk to it as well.).
>
> What prompted my post originally is when I ran into this page:
> http://www.dustindiaz.com/top-ten-javascript/.  Even though it's over
> a year old, there's a couple of handy things in there, so keeping
> organized  allows one to, on the fly, add something useful that one
> runs into on a website.
>
>
> On Apr 6, 1:46 pm, "Kjell Bublitz" <[EMAIL PROTECTED]> wrote:
> > I put framework related files into one directory under /js/
> > Like jquery + all the plugins i use.
> >
> > I name the folder usually after the frameworks name: yui, prototype, etc..
> >
> > /js/jquery/jquery.core.js
> > /js/jquery/jquery.cookie.js
> > /js/jquery/jquery.tooltips.js
> >
> > So the top folder is usually empty, but i put there my .htacces for
> > handling all JS requests  and redirect them to my php script for gzip
> > compression and cache settings.
> >
> > There is only one javascript file on the app/webroot/js/ root,
> > and thats the one with my custom code.
> >
> > It is usually named after the projectname.
> >
> > /js/.htaccess
> > /js/compression.php
> > /js/myproject.js
> > /js/prototype/prototoype_version.js
> > /js/prototype/event-selectors.js
> > /js/prototype/datepicker.js
> >
> > For your described case of using js-files outside: I never work this
> > way. I put everything there that i need for the app. If i need it
> > outside, i just copy it.
> >
> > The other way around is: If there is a vendor-app that i include and
> > it has own javascript files i move them to the cake app/webroot/js
> > directory for consitency. But i never had it that way either.
> >
> > Lets say i have javascript functions that i only need on the profile
> > action of my users controller i simply extend the filename like so:
> >
> > /js/myproject-userprofile.js
> > /js/myproject-eventcalendar.js
> > etc..
> >
> > For me, this is perfect to manage.
> >
> > On 4/6/07, beetlecube <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > I know that many Cakephpers  use frameworks/libraries like  Prototype
> > > and JQuery.
> >
> > >  What about if you come across some general purpose Javascript
> > > functoin and you add those to a "common.js" file that you keep
> > > accumulating to ?
> >
> > > And I'm talking about a common.js type file that you might use even
> > > *outside* of your CakePHP websites.
> >
> > > If you keep this 

Re: Organizing, Keeping straight, your Javascript collection

2007-04-06 Thread Chris Lamb
"beetlecube" <[EMAIL PROTECTED]> wrote:

> If you keep this general purpose common.js file inside you app/js
> directory, but you also use *elsewhere*, then pretty soon they become
> un-Synchronized, like if you forget to make a copy of one to the other
> location after making changes to only one of them.
> 
> I think it's a common challenge some of us face -- or not.

Symbolic links help here. But do balance having them perfectly in sync
with the problem of confusing yourself by accidently breaking a site that
you haven't touched in a little while.

If you can think of a useful way in which a "CSS vendors" could be
included globally in Cake, please submit an enhancement ticket - it'll
reach the people that matter a lot easier.

Kind regards,

-- 
 Chris Lamb, Cambridgeshire, UK  GPG: 0x634F9A20


signature.asc
Description: PGP signature


Re: Organizing, Keeping straight, your Javascript collection

2007-04-06 Thread beetlecube

Thanks for sharing how you do that, Kjell.
That was definitely helpful.

I know I will eventually decide on one of the major frameworks to
adopt permanently.

But sometimes, you're sitting lazily at the PC on a Sunday afternoon,
reading blogs or whatever, and you come across a Javascript function
that you want to add to some permanent library somewhere,  and this
function isn't in whatever Framework I adopted, so I add it to a
central generic utility JS file that grows and grows (and of course
shrinks sometimes when I realize I've added junk to it as well.).

What prompted my post originally is when I ran into this page:
http://www.dustindiaz.com/top-ten-javascript/.  Even though it's over
a year old, there's a couple of handy things in there, so keeping
organized  allows one to, on the fly, add something useful that one
runs into on a website.


On Apr 6, 1:46 pm, "Kjell Bublitz" <[EMAIL PROTECTED]> wrote:
> I put framework related files into one directory under /js/
> Like jquery + all the plugins i use.
>
> I name the folder usually after the frameworks name: yui, prototype, etc..
>
> /js/jquery/jquery.core.js
> /js/jquery/jquery.cookie.js
> /js/jquery/jquery.tooltips.js
>
> So the top folder is usually empty, but i put there my .htacces for
> handling all JS requests  and redirect them to my php script for gzip
> compression and cache settings.
>
> There is only one javascript file on the app/webroot/js/ root,
> and thats the one with my custom code.
>
> It is usually named after the projectname.
>
> /js/.htaccess
> /js/compression.php
> /js/myproject.js
> /js/prototype/prototoype_version.js
> /js/prototype/event-selectors.js
> /js/prototype/datepicker.js
>
> For your described case of using js-files outside: I never work this
> way. I put everything there that i need for the app. If i need it
> outside, i just copy it.
>
> The other way around is: If there is a vendor-app that i include and
> it has own javascript files i move them to the cake app/webroot/js
> directory for consitency. But i never had it that way either.
>
> Lets say i have javascript functions that i only need on the profile
> action of my users controller i simply extend the filename like so:
>
> /js/myproject-userprofile.js
> /js/myproject-eventcalendar.js
> etc..
>
> For me, this is perfect to manage.
>
> On 4/6/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I know that many Cakephpers  use frameworks/libraries like  Prototype
> > and JQuery.
>
> >  What about if you come across some general purpose Javascript
> > functoin and you add those to a "common.js" file that you keep
> > accumulating to ?
>
> > And I'm talking about a common.js type file that you might use even
> > *outside* of your CakePHP websites.
>
> > If you keep this general purpose common.js file inside you app/js
> > directory, but you also use *elsewhere*, then pretty soon they become
> > un-Synchronized, like if you forget to make a copy of one to the other
> > location after making changes to only one of them.
>
> > I think it's a common challenge some of us face -- or not.
>
> > Wondering what you guys do.
>
> > Steve
>
> --
> Regards, Kjellwww.m3nt0r.de


--~--~-~--~~~---~--~~
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 execute OthAuth protected actions with a CRON job?

2007-04-06 Thread Bootstrapper

Excellent! Thanks CraZyLeGs!

Just to verify - I assume the PHP code you're talking about below goes
into the PHP file that the CRON job calls, right? This is basically
the code for logging someone directly through code, rather than
through the login form.

But isn't there a way to directly log someone in without knowing there
password? I also need my users to be able to link into their account
by email, so far the only methods I know for doing that require me to
keep their clear-text passwords, which is obviously not good.

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: Making REST Requests to a web-server like yahoo

2007-04-06 Thread Eric C Blount
After searching for a couple of minutes, I found the XML class Kjell is
speaking of:
http://keithdevens.com/software/phpxml

In case anyone else was as interested as I was...

HTH,
Eric


On 4/6/07, Kjell Bublitz <[EMAIL PROTECTED]> wrote:
>
>
> Chris, i think you switched something here.
>
> file_get_contents is available since PHP 4.3.0.
> It is file_put_contents which is only available in PHP5.
>
> I second that XML parsing sucks in PHP4. There is a wonderful class
> available i used in many projects already. It's a xml class from Keith
> Devens (google). But it is strictly for PHP4, because it uses a method
> which is deprecated in PHP5, so watch it.
>
> Hope this helps.
>
> On 4/6/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
> >
> > I second what Kjell said:  file_get_contents is your easiest solution
> > if using PHP 5, otherwise use the curl functions.  XML parsing sucks
> > in PHP 4, so I hope you can use PHP 5.
> >
> > Give me SimpleXML or give me death! :)
> >
> >
> > On 4/6/07, Tonyz <[EMAIL PROTECTED]> wrote:
> > >
> > > I read this article on yahoo developer network because I would like in
> > > my cake app to display search results from yahoo. The article is at
> > > http://developer.yahoo.com/php/howto-reqRestPhp.html
> > >
> > > There is some built in class of cake who can perform rest request to a
> > > webserver with curl or file_get_contents?
> > >
> > >
> > > >
> > >
> >
> >
> > --
> > Chris Hartjes
> >
> > My motto for 2007:  "Just build it, damnit!"
> >
> > rallyhat.com - digital photo scavenger hunt
> > @TheBallpark - http://www.littlehart.net/attheballpark
> > @TheKeyboard - http://www.littlehart.net/atthekeyboard
> >
> > >
> >
>
>
> --
> Regards, Kjell
> www.m3nt0r.de
>
> >
>

--~--~-~--~~~---~--~~
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: Making REST Requests to a web-server like yahoo

2007-04-06 Thread Chris Hartjes

My bad, you're absolutely right about file_get_contents.

The more I work with PHP 5 the more I grow to dislike having to do all
sorts of hacks and kludges to do the same thing in PHP 4.



On 4/6/07, Kjell Bublitz <[EMAIL PROTECTED]> wrote:
>
> Chris, i think you switched something here.
>
> file_get_contents is available since PHP 4.3.0.
> It is file_put_contents which is only available in PHP5.
>
> I second that XML parsing sucks in PHP4. There is a wonderful class
> available i used in many projects already. It's a xml class from Keith
> Devens (google). But it is strictly for PHP4, because it uses a method
> which is deprecated in PHP5, so watch it.
>
> Hope this helps.
>
> On 4/6/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
> >
> > I second what Kjell said:  file_get_contents is your easiest solution
> > if using PHP 5, otherwise use the curl functions.  XML parsing sucks
> > in PHP 4, so I hope you can use PHP 5.
> >
> > Give me SimpleXML or give me death! :)
> >
> >
> > On 4/6/07, Tonyz <[EMAIL PROTECTED]> wrote:
> > >
> > > I read this article on yahoo developer network because I would like in
> > > my cake app to display search results from yahoo. The article is at
> > > http://developer.yahoo.com/php/howto-reqRestPhp.html
> > >
> > > There is some built in class of cake who can perform rest request to a
> > > webserver with curl or file_get_contents?
> > >
> > >
> > > >
> > >
> >
> >
> > --
> > Chris Hartjes
> >
> > My motto for 2007:  "Just build it, damnit!"
> >
> > rallyhat.com - digital photo scavenger hunt
> > @TheBallpark - http://www.littlehart.net/attheballpark
> > @TheKeyboard - http://www.littlehart.net/atthekeyboard
> >
> > >
> >
>
>
> --
> Regards, Kjell
> www.m3nt0r.de
>
> >
>


-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digital photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Making REST Requests to a web-server like yahoo

2007-04-06 Thread Kjell Bublitz

Chris, i think you switched something here.

file_get_contents is available since PHP 4.3.0.
It is file_put_contents which is only available in PHP5.

I second that XML parsing sucks in PHP4. There is a wonderful class
available i used in many projects already. It's a xml class from Keith
Devens (google). But it is strictly for PHP4, because it uses a method
which is deprecated in PHP5, so watch it.

Hope this helps.

On 4/6/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
> I second what Kjell said:  file_get_contents is your easiest solution
> if using PHP 5, otherwise use the curl functions.  XML parsing sucks
> in PHP 4, so I hope you can use PHP 5.
>
> Give me SimpleXML or give me death! :)
>
>
> On 4/6/07, Tonyz <[EMAIL PROTECTED]> wrote:
> >
> > I read this article on yahoo developer network because I would like in
> > my cake app to display search results from yahoo. The article is at
> > http://developer.yahoo.com/php/howto-reqRestPhp.html
> >
> > There is some built in class of cake who can perform rest request to a
> > webserver with curl or file_get_contents?
> >
> >
> > >
> >
>
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> rallyhat.com - digital photo scavenger hunt
> @TheBallpark - http://www.littlehart.net/attheballpark
> @TheKeyboard - http://www.littlehart.net/atthekeyboard
>
> >
>


-- 
Regards, Kjell
www.m3nt0r.de

--~--~-~--~~~---~--~~
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: Making REST Requests to a web-server like yahoo

2007-04-06 Thread Chris Hartjes

I second what Kjell said:  file_get_contents is your easiest solution
if using PHP 5, otherwise use the curl functions.  XML parsing sucks
in PHP 4, so I hope you can use PHP 5.

Give me SimpleXML or give me death! :)


On 4/6/07, Tonyz <[EMAIL PROTECTED]> wrote:
>
> I read this article on yahoo developer network because I would like in
> my cake app to display search results from yahoo. The article is at
> http://developer.yahoo.com/php/howto-reqRestPhp.html
>
> There is some built in class of cake who can perform rest request to a
> webserver with curl or file_get_contents?
>
>
> >
>


-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digital photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Making REST Requests to a web-server like yahoo

2007-04-06 Thread Kjell Bublitz

There might be some class you could add thru vendor to ease using CURL.

Using file_get_contents is as direct as using echo. Besides creating a
shortcut there is not much to make it easier using cake or anything
else for that matter.

$xml = file_get_contents( http://api ... );

If you can choose, then use CURL, because it has features like
request-timeouts etc. Pretty much like using sockets for
server-to-server communication.

Hope this helps.

On 4/6/07, Tonyz <[EMAIL PROTECTED]> wrote:
>
> I read this article on yahoo developer network because I would like in
> my cake app to display search results from yahoo. The article is at
> http://developer.yahoo.com/php/howto-reqRestPhp.html
>
> There is some built in class of cake who can perform rest request to a
> webserver with curl or file_get_contents?
>
>
> >
>


-- 
Regards, Kjell
www.m3nt0r.de

--~--~-~--~~~---~--~~
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: Organizing, Keeping straight, your Javascript collection

2007-04-06 Thread Kjell Bublitz

I put framework related files into one directory under /js/
Like jquery + all the plugins i use.

I name the folder usually after the frameworks name: yui, prototype, etc..

/js/jquery/jquery.core.js
/js/jquery/jquery.cookie.js
/js/jquery/jquery.tooltips.js

So the top folder is usually empty, but i put there my .htacces for
handling all JS requests  and redirect them to my php script for gzip
compression and cache settings.

There is only one javascript file on the app/webroot/js/ root,
and thats the one with my custom code.

It is usually named after the projectname.

/js/.htaccess
/js/compression.php
/js/myproject.js
/js/prototype/prototoype_version.js
/js/prototype/event-selectors.js
/js/prototype/datepicker.js

For your described case of using js-files outside: I never work this
way. I put everything there that i need for the app. If i need it
outside, i just copy it.

The other way around is: If there is a vendor-app that i include and
it has own javascript files i move them to the cake app/webroot/js
directory for consitency. But i never had it that way either.

Lets say i have javascript functions that i only need on the profile
action of my users controller i simply extend the filename like so:

/js/myproject-userprofile.js
/js/myproject-eventcalendar.js
etc..

For me, this is perfect to manage.

On 4/6/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
> I know that many Cakephpers  use frameworks/libraries like  Prototype
> and JQuery.
>
>  What about if you come across some general purpose Javascript
> functoin and you add those to a "common.js" file that you keep
> accumulating to ?
>
> And I'm talking about a common.js type file that you might use even
> *outside* of your CakePHP websites.
>
> If you keep this general purpose common.js file inside you app/js
> directory, but you also use *elsewhere*, then pretty soon they become
> un-Synchronized, like if you forget to make a copy of one to the other
> location after making changes to only one of them.
>
> I think it's a common challenge some of us face -- or not.
>
> Wondering what you guys do.
>
> Steve
>
>
> >
>


-- 
Regards, Kjell
www.m3nt0r.de

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



Directories for running 1.x and 1.2.x Simultaneously

2007-04-06 Thread [EMAIL PROTECTED]

I dont know if anyone else has done this (or even needs to) but i
found it nice to have.

I was trying to set up two cake installs - one for 1.x and the other
for 1.2x

There are several places within the cake core that have direct defines
to the cake/ directory itself

After directly modifying
   bootstrap.php
   paths.php
   and the 1.2x app/index.php
 require CORE_PATH . 'cake2' . DS . 'bootstrap.php';

for my cake2/ directory I was able to get both installations running
simultaneously

However I noticed that configure::version() was still returning 1.x
even though my app was running in the 1.2x folder.

I found another 'Hard Coded' reference to the initial cake/ dir in the
Configure class itself

I modified the 1.2x Configure::version() as well
require(CAKE . 'config' . DS . 'config.php');

Now I have 1.x and 1.2x versions for development - and they both
report correct Configure::version() as well

Just thought someone might find it interesting


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



Organizing, Keeping straight, your Javascript collection

2007-04-06 Thread beetlecube

I know that many Cakephpers  use frameworks/libraries like  Prototype
and JQuery.

 What about if you come across some general purpose Javascript
functoin and you add those to a "common.js" file that you keep
accumulating to ?

And I'm talking about a common.js type file that you might use even
*outside* of your CakePHP websites.

If you keep this general purpose common.js file inside you app/js
directory, but you also use *elsewhere*, then pretty soon they become
un-Synchronized, like if you forget to make a copy of one to the other
location after making changes to only one of them.

I think it's a common challenge some of us face -- or not.

Wondering what you guys do.

Steve


--~--~-~--~~~---~--~~
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 restrict cakephp to certain sections of your site?

2007-04-06 Thread BlenderStyle

I don't mean to keep beating this issue, but I want to try approaching
this subject again. Ignore what I've said previously and let's start
over. There's two scenarios I'd like to try for multiple Cake
applications on one web server. One, every Cake application is in a
directory underneath htdocs. Two, the primary Cake application is at
the root of htdocs with Cake/non-Cake applications underneath that.
The thing I'm most concerned about is how the URLs look. Let's explore
these two scenarios.

One, every Cake application in a directory underneath htdocs:
htdocs/app1
htdocs/app2
htdocs/app3
htdocs/non-cake-website

With this setup, I'm assuming there'd have to be an htaccess file in
htdocs that would redirect requests for the root of the site to the
primary Cake app. I'm not sure how this would look or how it would
work with the other apps being accessed.

Two, primary Cake application at the root of htdocs, with Cake
applications underneath that:
htdocs/app
htdocs/cake
htdocs/docs
htdocs/vendors
htdocs/htaccess
htdocs/index.php
htdocs/app2
htdocs/app3
htdocs/non-cake-website

As AD7 said before, I could put everything in webroot, but when you
browse to http://somedomain.com/app2/Users/add, the URLs end up
looking like http://somedomain.com/app/webroot/app2/Users/add. If
there is away to override this behavior, that would be awesome.

Basically, I'm pretty damn clueless on how to approach this. If
someone tells me to go screw myself and figure out mod_rewrite, I
guess that's what I'll do, but hopefully someone has run into this
problem before. Thanks, CakePHP Google Group.

Matt


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



How to reset a form when using an AJAX helper?

2007-04-06 Thread Andres Monroy-Hernandez

I have a form with a textarea and a submit button generated with the
AJAX helper. When clicking on the submit button I want to send the
request to the server, update the corresponding HTML element *and*
clear the textarea.

The onClick event is already defined in the helper method as "return
false;", what is the best way to reset the form?

This is the code that generates the ajaxified submit button:
$ajax->submit('Add', array("condition"=>"checkLogin()",
"class"=>"button","url"=>"/projects/$urlname/$pid/comment",
"update"=>"project_comment_list") )


--~--~-~--~~~---~--~~
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: new auth component in cake 1.2

2007-04-06 Thread gar

Would it be possible for me to take a stab at making a doc on how to
use this functionality?  If someone provides me with some source code
on the usage I will try to figure it out and write up a pseudo startup
doc on it.

The reason why I want to dive into this auth method instead of OthAuth
is that I feel going forward, this authentication method will be
integrated tightly into the whole cake framework.  So with each cake
update if auth needs to be updated they will do so.  If the auth is
part of the cake framework I would rather spend the extra time to
figure out how to use it now rather than to convert the auth system to
this one later.  I could be wrong about this tight integration and if
i am please let me know.

My question is.  Does anyone have any scripts that is utilizing the
AuthComponent now?  Any starting point beside from scratch will be
fine.  If so can I get a copy of it and how the db looks like also?
If not I will try to figure it out from the auth.php class file.  Dont
know how far I will get with that way =(.

gar

On Apr 5, 10:53 pm, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Apr 6, 1:38 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
>
> > On 4/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > how can i find manual, trytourial about new auth coponent+acl  in cake
> > > 1.2 ?
>
> > I guess you could write it ;)  I am not sure there is anything out there 
> > yet.
>
> There is indeed an Auth component  trunk/cake/1.2.x.x/cake/libs/controller/components/auth.php> in 1.2.
>
> I too was interested in this component and when asked in IRC,
> PhpNut informed me that, we have to write many stuffs and can use the
> methods found in the Auth component. So, I'd thought of settling in
> othAuth for now.
>
>HTH.
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


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



Re: WithCake.com ideas (Was Re: WithCake.com relaunched)

2007-04-06 Thread jonathan.snook

> Kind of developer and company rankings would be cool. Especially
> cake is lacking some good documentations; so probably add some field
> stating how many articles were published by that developer (this is
> also good to Cake itself) or so... something like:

That's not a bad idea. The biggest problem is how the system works:
the profiles are transitory. Once they're gone, they're gone. The site
acts more like a job site than it does a directory of companies and
developers where rankings might be more relevant or useful. However,
maybe creating a "directory" portion to the site would be advantageous
allowing for rankings. I'll definitely keep the idea in mind.

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: SwiftMailer Component

2007-04-06 Thread CraZyLeGs

However if you really need it I pasted it here: 
http://bin.cakephp.org/view/1053105011
Usage is the same ( nearly ), put SwiftMailer 3 in vendors.


--~--~-~--~~~---~--~~
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: SwiftMailer Component

2007-04-06 Thread CraZyLeGs

>> It's not ideal, but I found it a lot easier to use than the components 
>> floating around.

O'Really ?

How's a bunch of line of codes *easier*  than one line ?

It also is about abstraction, reusability and whatnot, what if you
send mail elsewhere in your application you're gonna create a method
in your AppController you say ? oh wait! you're gonna create a
component for it ? yet another component ?

Anthony:

The SwiftMailer component works only for version 2, not compatible
with version 3, because the api 3 changed a lot of stuff. Though I'm
working on updating the component for version 3, in fact it's already
done, I just need to update the tutorial at bakery and upload the
component. swift mailer 2 is available for download at sourceforge
IIRC.

However you really need it




On Apr 6, 6:37 am, "Aidan Lister" <[EMAIL PROTECTED]> wrote:
> Hi Anthony,
>
> I found it a lot easier just to use Swift as a vendor package.
>
> Place it in your vendor folder, call your $this->render inside an
> output buffer, and pass this to Swift.
>
> It's not ideal, but I found it a lot easier to use than the components
> floating around.
>
>  // Load in the components
> vendor('Swift');
> vendor('Swift/Connection/SMTP');
>
> // Instantiate swift
> $connection = new Swift_Connection_SMTP();
> $swift = new Swift($connection);
>
> // Grab the email contents
> ob_start();
> $this->set('event', $event);
> $this->render('emails/studenteventinfo', 'email');
> $message = ob_get_contents();
> ob_end_clean();
>
> // Send the email
> $swift->send($studentemails, $from, $subject, $message);
>
> // Show any errors
> if ($swift->hasFailed()) {
> $this->set('errors', $swift->getErrors());}
>
> ?>
>
> On 06/04/07, Anthony <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, I'm using the SwiftMailer Component for CakePHP found here:
> >http://bakery.cakephp.org/articles/view/193
>
> > However, the newest version of SwiftMailer is 3, while the component
> > is designed for 2 and no longer works "out of the box". Is there a
> > version out there for version 3? Or does anybody know where I can find
> > an old version 2 download of SwiftMailer?
>
> > Thanks,
>
> > Anthony


--~--~-~--~~~---~--~~
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: R: Two Applications sharing Models

2007-04-06 Thread rtconner

Felix you are right. I guess this question has been asked before.
There are a bit in bootstrap.php of how to do this. Nice find.

I simply added the next two lines of code into my bookstrap.php and it
suddenly inherited all of the models from the other application (in
the folder 'app'). Works great, thanks.

$APP1 = ROOT.DS.'app';
$modelPaths = array($APP1.DS.'models'.DS);


On Apr 6, 8:08 am, <[EMAIL PROTECTED]> wrote:
> The simplest method to have a portable system to share source code with php
> is to include a file inside another.
>
> Example if you want model.php and model1.php with the same source code
> inside:
> Every changes on model.php is reflected on model1.php.
>
> file: model1.php
> 
> 
>
> Better of symlink


--~--~-~--~~~---~--~~
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: WithCake.com ideas (Was Re: WithCake.com relaunched)

2007-04-06 Thread rtconner

Maybe the ablity to give your aproval to another developer. Something
simple and only positive, like advogato maybe.

Other than that I'd say just get gwoo or phpnut to get a link to it on
the main cakephp site.

On Apr 6, 8:23 am, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Apr 6, 1:06 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > On 4/6/07, R.RajeshJebaAnbiah<[EMAIL PROTECTED]> wrote:
>
> > > Kind of developer and company rankings would be cool. Especially
> > > cake is lacking some good documentations; so probably add some field
> > > stating how many articles were published by that developer (this is
> > > also good to Cake itself) or so... something like:
>
> > As far as business goes  the assumption Good writer === Good developer
> > is very misleading :)
>
> LOL. But, that could be at least be beneficial to cake inturn
> (docs is the one of the scary thing for cake)
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


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



Re: Simple Blog using Cake

2007-04-06 Thread Daniel Hofstetter

Have a look at MiBlog: http://www.noswad.me.uk/Demos

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


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



Making REST Requests to a web-server like yahoo

2007-04-06 Thread Tonyz

I read this article on yahoo developer network because I would like in
my cake app to display search results from yahoo. The article is at
http://developer.yahoo.com/php/howto-reqRestPhp.html

There is some built in class of cake who can perform rest request to a
webserver with curl or file_get_contents?


--~--~-~--~~~---~--~~
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: find session entries / force session _gc / (de)serialization

2007-04-06 Thread jyrgen

> Preventing multiple logins is not an easy task to solve without a

please don't make me afraid :-) i assumed this being rather
easy, as soon as i have access to the session table (and the
data, s.above)

i wonder, if there is already an auth system providing the prevention
of multiple logins. this would help me a lot to get started.
maybe othauth has such a feature, i'll have a look at it...

jyrgen


--~--~-~--~~~---~--~~
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: find session entries / force session _gc / (de)serialization

2007-04-06 Thread jyrgen

> Ah, I understand.  Perhaps the easiest way to solve this problem is to
> create a custom session handler that uses the login ID as the key for
> the session.  You can't have more than one session with the same login
> ID that way, so that stops multiple logins.

what do you mean exactly by custom session handler ? wouldn't it
suffice
to declare a session model in this fashion

class mySession extends AppModel {

var $name = 'mySession';
}

now i can access the sessions table. but still unsolved: un-
serialization.
it's mysterious, how the core lib handles this. also i'd love to
figure
out, why the php command (un)serialize fails with the cake session
data
field.

see this thread

http://groups.google.ch/group/cake-php/browse_thread/thread/706a27f513ea1a1c/

where i posted a pretty ugly function which (de)serializes the session
data field.
seems like this field is stored in a non-standard way.

hmmm. guess i need to have a closer look to the session lib.

j.



>
> I hope that makes sense, and I'm sure the people smarter than me
> around here (for there are many) will correct me.
>
> Preventing multiple logins is not an easy task to solve without a
> central location that is keeping track of who is logged in.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> rallyhat.com - digital photo scavenger hunt
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


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



R: Two Applications sharing Models

2007-04-06 Thread m.sbragi

The simplest method to have a portable system to share source code with php
is to include a file inside another.

Example if you want model.php and model1.php with the same source code
inside:
Every changes on model.php is reflected on model1.php.

file: model1.php



Better of symlink


--~--~-~--~~~---~--~~
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: WithCake.com ideas (Was Re: WithCake.com relaunched)

2007-04-06 Thread R. Rajesh Jeba Anbiah

On Apr 6, 1:06 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 4/6/07, R.RajeshJebaAnbiah<[EMAIL PROTECTED]> wrote:
>
> > Kind of developer and company rankings would be cool. Especially
> > cake is lacking some good documentations; so probably add some field
> > stating how many articles were published by that developer (this is
> > also good to Cake itself) or so... something like:
>
> As far as business goes  the assumption Good writer === Good developer
> is very misleading :)

LOL. But, that could be at least be beneficial to cake inturn
(docs is the one of the scary thing for cake)

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: Cache?

2007-04-06 Thread jonatha

I have had the same problem on an hosted server.
My solution was to disable caching on webserver via meta headers.

On Apr 6, 2:19 pm, "Davide" <[EMAIL PROTECTED]> wrote:
> I've released a site based on CakePHP. I've tested it with the 1.1.13 and
> 1.1.14 but the same problem seems to remain. I'm using Firefox as web
> browsers.
>
> I forestall that I don't think it's a cake problem but I prefer to hear
> different advices.
>
> On development and test environments (WinXP, php 4.4.0, Apache/2.0.54) I
> have no problems, after login, edit and everything else, it will be
> presented to me the right results. Both environments are on my pc, the
> same of the developing.
>
> In production environment (Debian, php 5.2.0-8, Apache/2.2.3), often as
> response I get the previous page. For example, after login I will be
> redirected to a page and a greeting message with setFlash() is presented.
> It happens that often I will be redirected to the page but the message
> doesn't appear. A simple refresh and I see the message.
>
> What do you think I could check?
>
> Thanks a lot
> Davide


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



Simple Blog using Cake

2007-04-06 Thread [EMAIL PROTECTED]

I am looking for simple blog made with CakePHP that I can modify for a
project I am doing for school.
One that had multiple blogs would be good, but not necessary,  So far
I have checked out rdBlogger in cakeForge. Any other suggestions from
cakeForge would be great.
Thanks
Ted


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



Cache?

2007-04-06 Thread Davide

I've released a site based on CakePHP. I've tested it with the 1.1.13 and
1.1.14 but the same problem seems to remain. I'm using Firefox as web
browsers.

I forestall that I don't think it's a cake problem but I prefer to hear
different advices.

On development and test environments (WinXP, php 4.4.0, Apache/2.0.54) I
have no problems, after login, edit and everything else, it will be
presented to me the right results. Both environments are on my pc, the
same of the developing.

In production environment (Debian, php 5.2.0-8, Apache/2.2.3), often as
response I get the previous page. For example, after login I will be
redirected to a page and a greeting message with setFlash() is presented.
It happens that often I will be redirected to the page but the message
doesn't appear. A simple refresh and I see the message.

What do you think I could check?

Thanks a lot
Davide




--~--~-~--~~~---~--~~
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: problem when i include javascript files

2007-04-06 Thread Dia

1st, sorry for mistakes I made in my last posts yesterday, was tired
cause of work :p

2nd, I'm learning CakePHP for a week, can't yet imagine an action
using 2 components (1 included in AppController and 1 in
ThingsController) to be sure of what I'm testing

but if you have the answer, I'm interrested in

logically, this can't work cause variable is re-defined

// AppController
var $helpers = array('Html', 'Form', 'Javascript');
// ThingsController
var $helpers = array('Text');

but for following code, dunno, may be, answer ?? :)

// AppController
var $helpers = array('Html', 'Form', 'Javascript');
// ThingsController
$helpers[] = 'Text';

guess it's the same behaviour for $helpers and $components... ?


--~--~-~--~~~---~--~~
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: WithCake.com ideas (Was Re: WithCake.com relaunched)

2007-04-06 Thread Dr. Tarique Sani

On 4/6/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote:
> Kind of developer and company rankings would be cool. Especially
> cake is lacking some good documentations; so probably add some field
> stating how many articles were published by that developer (this is
> also good to Cake itself) or so... something like:

As far as business goes  the assumption Good writer === Good developer
is very misleading :)

If Jhonathan says it is feature complete - I am happy with it.

Cheers
Tarique

=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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