Re: Loading Classes

2011-10-11 Thread Miles J
That really is weird. Would of been useful to zip up and send to the
Cake devs :p

On Oct 11, 11:15 am, Ed Propsner  wrote:
> oops ... was ready another thread ... I meant @Miles ;)
>
>
>
>
>
>
>
> On Tue, Oct 11, 2011 at 2:14 PM, Ed Propsner  wrote:
> > @Mark
>
> > > That doesn't make sense. Including a file *anywhere* in the
> > > application imports it into the scope, this is part of PHP, not
> > > CakePHP.
>
> > I couldn't agree more.
>
> > An absolute path include resulted in the same thing, the class was
> > available in the bootstrap only. Stranger yet, I discovered that "ANYTHING"
> > contained in the AppController was only available in that controller ...
> > STRANGER YET not even $this->set() would pass data out of the AppController.
>
> > Ok, something is REALLY wrong here.
>
> > I scrapped the 2.0 RC2 and replaced with RC3 core and presto, problem
> > solved. Everything works as expected from the AppController (no need for the
> > bootstrap).
>
> > I have another app running flawlessly off the same RC2 core so I'm a bit
> > clueless as to what the cause of the problem could have been. My best guess
> > is that something somewhere got corrupted ... story of my life :)
>
> > Thanks for the help,
> > - Ed
>
> > On Tue, Oct 11, 2011 at 1:37 PM, Miles J  wrote:
>
> >> That doesn't make sense. Including a file *anywhere* in the
> >> application imports it into the scope, this is part of PHP, not
> >> CakePHP.
>
> >> Try doing an absolute path include to the SDK from within your
> >> bootstrap.php.
>
> >> Also this: $this->facebook = new Facebook(); Should be done in the
> >> controllers beforeFilter().
>
> >> On Oct 11, 5:44 am, Ed Propsner  wrote:
> >> > Thanks for the response Carlo,
>
> >> > Loading the class in the bootstrap has the same effect as in the
> >> > AppController ... the class is only available in the bootstrap and not
> >> the
> >> > rest of the controllers or views. This seems strange to me and I'm
> >> starting
> >> > to think I might be missing some other underlying problem. Short of
> >> > importing the file into every controller and every view where I need to
> >> make
> >> > a call to it, I cannot get it to work as expected.
>
> >> > As I stated earlier ... in 1.3 it was as simple as:
>
> >> > > App::import('Vendor', 'facebook)
>
> >> > > function __construct(){
> >> > >         parent::__construct();
>
> >> > >         $this->facebook = new Facebook(array(
> >> > >                     'appId' => $this->__api_key,
> >> > >                     'secret' => $this->__app_secret ));
> >> > >     }
>
> >> > No problems, the class was accessible using $this->facebook->etc->etc
> >> >  throughout my entire app.
>
> >> > Was I doing it wrong then or am I doing it wrong now? Frankly, I'm
> >> ignorant
> >> > enough in this area to not know the difference.
> >> > Does 2.0 handle this differently and I'm just not understanding it?
>
> >> > - Ed
>
> >> > On Tue, Oct 11, 2011 at 12:15 AM, Carlo Cruz 
> >> wrote:
> >> > > You could always use a 'require_once' in bootstrap.
>
> >> > > On Oct 11, 12:24 pm, Ed Propsner  wrote:
> >> > > > I'm trying to load Facebook's php sdk. I'm currently using
> >> App::import.
> >> > > > I'm loading it into the App Controller but the problem I'm having
> >> now is
> >> > > > that the class is only available within that controller and not
> >> > > accessible
> >> > > > to the rest of my controllers.
>
> >> > > > - Ed
>
> >> > > > On Mon, Oct 10, 2011 at 9:12 PM, Miles J 
> >> > > wrote:
> >> > > > > If its for models, use ClassRegistry::init().
>
> >> > > > > If you are including files, use App::import().
>
> >> > > > > If you are adding a file to the lookup, use App::uses().
>
> >>https://github.com/cakephp/cakephp/blob/2.0/lib/Cake/Core/App.php#L549
>
> >> > > > > On Oct 10, 9:20 am, CrotchFrog  wrote:
> >> > > > > > I'm still trying to figure out how to get function __
> >>

Re: Loading Classes

2011-10-11 Thread Miles J
That doesn't make sense. Including a file *anywhere* in the
application imports it into the scope, this is part of PHP, not
CakePHP.

Try doing an absolute path include to the SDK from within your
bootstrap.php.

Also this: $this->facebook = new Facebook(); Should be done in the
controllers beforeFilter().

On Oct 11, 5:44 am, Ed Propsner  wrote:
> Thanks for the response Carlo,
>
> Loading the class in the bootstrap has the same effect as in the
> AppController ... the class is only available in the bootstrap and not the
> rest of the controllers or views. This seems strange to me and I'm starting
> to think I might be missing some other underlying problem. Short of
> importing the file into every controller and every view where I need to make
> a call to it, I cannot get it to work as expected.
>
> As I stated earlier ... in 1.3 it was as simple as:
>
> > App::import('Vendor', 'facebook)
>
> > function __construct(){
> >         parent::__construct();
>
> >         $this->facebook = new Facebook(array(
> >                     'appId' => $this->__api_key,
> >                     'secret' => $this->__app_secret ));
> >     }
>
> No problems, the class was accessible using $this->facebook->etc->etc
>  throughout my entire app.
>
> Was I doing it wrong then or am I doing it wrong now? Frankly, I'm ignorant
> enough in this area to not know the difference.
> Does 2.0 handle this differently and I'm just not understanding it?
>
> - Ed
>
>
>
>
>
>
>
> On Tue, Oct 11, 2011 at 12:15 AM, Carlo Cruz  wrote:
> > You could always use a 'require_once' in bootstrap.
>
> > On Oct 11, 12:24 pm, Ed Propsner  wrote:
> > > I'm trying to load Facebook's php sdk. I'm currently using App::import.
> > > I'm loading it into the App Controller but the problem I'm having now is
> > > that the class is only available within that controller and not
> > accessible
> > > to the rest of my controllers.
>
> > > - Ed
>
> > > On Mon, Oct 10, 2011 at 9:12 PM, Miles J 
> > wrote:
> > > > If its for models, use ClassRegistry::init().
>
> > > > If you are including files, use App::import().
>
> > > > If you are adding a file to the lookup, use App::uses().
>
> > > >https://github.com/cakephp/cakephp/blob/2.0/lib/Cake/Core/App.php#L549
>
> > > > On Oct 10, 9:20 am, CrotchFrog  wrote:
> > > > > I'm still trying to figure out how to get function __ construct() to
> > > > > work properly for me, it throws errors when used the way I
> > > > > traditionally used it. I'm also still unsure whether I should be
> > using
> > > > > App::import() or App::uses(). I would tend to think App::import() but
> > > > > like I said I'm a little fuzzy in this area.
>
> > > > > Thanks,
>
> > > > > - Ed
>
> > > > > On Oct 9, 6:09 am, CrotchFrog  wrote:
>
> > > > > > I'm a bit confused in the proper use of App::import() vs.
> > App::uses()
> > > > > > in migrating to 2.0.
>
> > > > > > I'm try to load the Facebook php sdk from the Vendor folder as I
> > used
> > > > > > to in 1.3.
>
> > > > > > In 1.3 what worked for me was :
>
> > > > > > App::import('Vendor', 'facebook)
>
> > > > > > function __construct(){
> > > > > >         parent::__construct();
>
> > > > > >         $this->facebook = new Facebook(array(
> > > > > >                     'appId' => $this->__api_key,
> > > > > >                     'secret' => $this->__app_secret ));
> > > > > >     }
>
> > > > > > How should I be using the Constructor with App::uses()?
> > > > > > I've been through the Migration Guide to 2.0 and can see there has
> > > > > > been obvious changes but I suppose I don't have a clear enough
> > > > > > understanding to work out what I should be doing differently here.
>
> > > > > > - Ed
>
> > > > --
> > > > Our newest site for the community: CakePHP Video Tutorials
> > > >http://tv.cakephp.org
> > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > > others with their CakePHP related questions.
>
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this
> > group
> > > > athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Loading Classes

2011-10-10 Thread Miles J
If its for models, use ClassRegistry::init().

If you are including files, use App::import().

If you are adding a file to the lookup, use App::uses().

https://github.com/cakephp/cakephp/blob/2.0/lib/Cake/Core/App.php#L549

On Oct 10, 9:20 am, CrotchFrog  wrote:
> I'm still trying to figure out how to get function __ construct() to
> work properly for me, it throws errors when used the way I
> traditionally used it. I'm also still unsure whether I should be using
> App::import() or App::uses(). I would tend to think App::import() but
> like I said I'm a little fuzzy in this area.
>
> Thanks,
>
> - Ed
>
> On Oct 9, 6:09 am, CrotchFrog  wrote:
>
>
>
>
>
>
>
> > I'm a bit confused in the proper use of App::import() vs. App::uses()
> > in migrating to 2.0.
>
> > I'm try to load the Facebook php sdk from the Vendor folder as I used
> > to in 1.3.
>
> > In 1.3 what worked for me was :
>
> > App::import('Vendor', 'facebook)
>
> > function __construct(){
> >         parent::__construct();
>
> >         $this->facebook = new Facebook(array(
> >                     'appId' => $this->__api_key,
> >                     'secret' => $this->__app_secret ));
> >     }
>
> > How should I be using the Constructor with App::uses()?
> > I've been through the Migration Guide to 2.0 and can see there has
> > been obvious changes but I suppose I don't have a clear enough
> > understanding to work out what I should be doing differently here.
>
> > - Ed

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: what do you use to test your application's front end?

2011-10-05 Thread Miles J
Myself.

On Oct 5, 9:28 am, Saransh Sharma  wrote:
> yeah selenium
>
>
>
>
>
>
>
> On Wednesday, October 5, 2011, iphone5 wrote:
> > Do you guys use Selenium or something similar for testing front end?
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com  For more options,
> > visit this group athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cupcake Forum with CKEditor

2011-10-04 Thread Miles J
Well, 2.0 isn't backwards compatible with 1.9 at all :/

I would suggest doing a fresh 2.0 install, but if you already data in
your old forum, it may be problematic.

On Oct 4, 4:51 am, WhyNotSmile  wrote:
> Brilliant, thank you!  I really appreciate the Cupcake Forum, by the
> way - it works really well.
>
> Are there any advantages in upgrading to version 2.0?  How much work
> would it be?  And is it stable?  I thought I'd downloaded the latest
> stable version when I got it last week, but may have been looking in
> the wrong place or something.
>
> Thanks again for all your work on it.
>
> Sharon
>
> On Oct 3, 6:23 pm, Miles J  wrote:
>
>
>
>
>
>
>
> > No that should do it. I was just stripping HTML since it was BB code
> > only.
>
> > @Webbed - Yeah, my site is a bit outdated :/
>
> > On Oct 3, 3:06 am, WhyNotSmile  wrote:
>
> > > I'm using version 1.9.
>
> > > I think I've figured it out though - I removed the 'strip_tags' from a
> > > few lines, and that has let the CK editor output go through ok.
>
> > > Is there anything I need to add in to replace that, for security etc?
>
> > > Sharon
>
> > > On Oct 2, 3:24 am, Miles J  wrote:
>
> > > > Well technically wrong, I released 2.0 Beta a month ago.
>
> > > >https://github.com/milesj/cake-forum
>
> > > > Secondly, what version are you using? 1.9 or 2.0? As they are vastly
> > > > different.
>
> > > > On Sep 30, 11:59 pm, WebbedIT  wrote:
>
> > > > > MilesJ would be the best person, but not sure if he has much time to
> > > > > support it nowadays.
>
> > > > > It has not had an update since March 2010 so will probably need
> > > > > various changes to work in Cake 1.3 too.
>
> > > > > HTH, Paul.
>
> > > > > On Sep 30, 5:34 pm, WhyNotSmile  wrote:
>
> > > > > > I've integrated the excellent Cupcake Forum into my CakePHP app, and
> > > > > > now I'd like to use CK editor for the posts, rather than BB Code.
>
> > > > > > I've searched online, but I can't find any way to do this.
>
> > > > > > I have integrated CK editor. and that's fine, but something in 
> > > > > > Cupcake
> > > > > > is stripping out the formatting before saving the content, so I end 
> > > > > > up
> > > > > > with just plain text.  Can anyone point me in the right direction 
> > > > > > for
> > > > > > preventing it from removing HTML?
>
> > > > > > Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cupcake Forum with CKEditor

2011-10-03 Thread Miles J
No that should do it. I was just stripping HTML since it was BB code
only.

@Webbed - Yeah, my site is a bit outdated :/

On Oct 3, 3:06 am, WhyNotSmile  wrote:
> I'm using version 1.9.
>
> I think I've figured it out though - I removed the 'strip_tags' from a
> few lines, and that has let the CK editor output go through ok.
>
> Is there anything I need to add in to replace that, for security etc?
>
> Sharon
>
> On Oct 2, 3:24 am, Miles J  wrote:
>
>
>
>
>
>
>
> > Well technically wrong, I released 2.0 Beta a month ago.
>
> >https://github.com/milesj/cake-forum
>
> > Secondly, what version are you using? 1.9 or 2.0? As they are vastly
> > different.
>
> > On Sep 30, 11:59 pm, WebbedIT  wrote:
>
> > > MilesJ would be the best person, but not sure if he has much time to
> > > support it nowadays.
>
> > > It has not had an update since March 2010 so will probably need
> > > various changes to work in Cake 1.3 too.
>
> > > HTH, Paul.
>
> > > On Sep 30, 5:34 pm, WhyNotSmile  wrote:
>
> > > > I've integrated the excellent Cupcake Forum into my CakePHP app, and
> > > > now I'd like to use CK editor for the posts, rather than BB Code.
>
> > > > I've searched online, but I can't find any way to do this.
>
> > > > I have integrated CK editor. and that's fine, but something in Cupcake
> > > > is stripping out the formatting before saving the content, so I end up
> > > > with just plain text.  Can anyone point me in the right direction for
> > > > preventing it from removing HTML?
>
> > > > Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cupcake Forum with CKEditor

2011-10-01 Thread Miles J
Well technically wrong, I released 2.0 Beta a month ago.

https://github.com/milesj/cake-forum

Secondly, what version are you using? 1.9 or 2.0? As they are vastly
different.

On Sep 30, 11:59 pm, WebbedIT  wrote:
> MilesJ would be the best person, but not sure if he has much time to
> support it nowadays.
>
> It has not had an update since March 2010 so will probably need
> various changes to work in Cake 1.3 too.
>
> HTH, Paul.
>
> On Sep 30, 5:34 pm, WhyNotSmile  wrote:
>
>
>
>
>
>
>
> > I've integrated the excellent Cupcake Forum into my CakePHP app, and
> > now I'd like to use CK editor for the posts, rather than BB Code.
>
> > I've searched online, but I can't find any way to do this.
>
> > I have integrated CK editor. and that's fine, but something in Cupcake
> > is stripping out the formatting before saving the content, so I end up
> > with just plain text.  Can anyone point me in the right direction for
> > preventing it from removing HTML?
>
> > Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: uploading large file fails

2011-09-30 Thread Miles J
At that point, I would use a Java/flash uploader and hook it up to a
CDN.

On Sep 30, 10:34 am, Sam Sherlock  wrote:
> @miles
> for an interface for something like yousendit.com
>
> for users who are not techie enough for other options
>
> @aortizhi I think your issues with server limitations (outside of php)
>
> On 30 September 2011 18:14, Miles J  wrote:
>
>
>
>
>
>
>
> > Why are you even uploading a 58MB file?
>
> > On Sep 29, 1:21 pm, aortizhi  wrote:
> > > i already have changed to post_max_size=800M and upload_max_filesize =
> > > 800M, and still don't work, am i doing something wrong?
> > > On Sep 29, 3:06 pm, Ryan Schmidt  wrote:
>
> > > > On Sep 29, 2011, at 15:01, aortizhi wrote:
>
> > > > > When i select a file that
> > > > > is not that big, it uploads ok, but when i am trying to upload a file
> > > > > that is at least 58 MB it fails uploading and the file won't be the
> > > > > same at server side.
>
> > > >http://php.net/upload-max-filesize
>
> > > > The default max is 2MB in PHP 5.3.8.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: uploading large file fails

2011-09-30 Thread Miles J
Why are you even uploading a 58MB file?

On Sep 29, 1:21 pm, aortizhi  wrote:
> i already have changed to post_max_size=800M and upload_max_filesize =
> 800M, and still don't work, am i doing something wrong?
> On Sep 29, 3:06 pm, Ryan Schmidt  wrote:
>
>
>
>
>
>
>
> > On Sep 29, 2011, at 15:01, aortizhi wrote:
>
> > > When i select a file that
> > > is not that big, it uploads ok, but when i am trying to upload a file
> > > that is at least 58 MB it fails uploading and the file won't be the
> > > same at server side.
>
> >http://php.net/upload-max-filesize
>
> > The default max is 2MB in PHP 5.3.8.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: confimation message

2011-09-30 Thread Miles J
Use a session flash.

$this->Session->setFlash('Message');

And in the view:

echo $this->Session->flash();

On Sep 30, 8:18 am, aortizhi  wrote:
> Hi everyone, can you tell me, how can i use a confirmation message box
> in my controller. I can't do it from my view becase this message
> should appear after have been made some calculations inside my
> controller. Thank you very much.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Disable loggin, nice way?

2011-09-21 Thread Miles J
Why do you need to disable logging?

Logging is handled through a PHP function, not Cake. Cake just defines
the handler.

On Sep 21, 9:40 am, Hugo M  wrote:
> I tried to disable debug.log and error.log logging but I couldn't. I've
> tried putting debug in 0 and log in 0 in core.php but that didn't work. I've
> tried this:
>
> class CakeLog {
> /**
>  * Writes given message to a log file in the logs directory.
>  *
>  * @param string $type Type of log, becomes part of the log's filename
>  * @param string $msg  Message to log
>  * @return boolean Success
>  * @access public
>  * @static
>  */
> function write($type, $msg) {
> *                //Added by me*
> *                if (Configure::read('log') == 0)*
> *                    return;*
>
> if (!defined('LOG_ERROR')) {
>  define('LOG_ERROR', 2);}
>
> if (!defined('LOG_ERR')) {
>  define('LOG_ERR', LOG_ERROR);
>
> }
>
> But that didn't work either! Even putting a return in debugger.php didn't
> work :D
>
> Help?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Undefined property Component::$Session

2011-09-20 Thread Miles J
debug($this) on the component or controller to see if the Session
object is being attached.

On Sep 19, 11:54 pm, heohni 
wrote:
> I uploaded all to my webserver and have the same problem...
>
> Anyone any idea?
> I am really lost here
>
> On 20 Sep., 08:25, Thomas Ploch  wrote:
>
>
>
>
>
>
>
> > Well, for cake 1.3 it's completely legitimate to use the PHP4 syntax
> > taken that the other classes are using the PHP4 syntax as well.
>
> > Kind regards
> > Thomas
>
> > Am Montag, den 19.09.2011, 10:11 -0700 schrieb Miles J:
>
> > > Which Cake version are you using?
>
> > > Also on a side note, stop using PHP4 syntax.
>
> > > On Sep 19, 8:33 am, heohni 
> > > wrote:
> > > > Oh that's cool!
> > > > I didn't know this bin...
>
> > > > translator componenthttp://bin.cakephp.org/view/666573507
>
> > > > On 19 Sep., 15:17, Thomas Ploch  wrote:
>
> > > > > Please bin your TranslatorComponent code 
> > > > > to:http://bin.cakephp.organdposttheurl to the group so we can check
> > > > > what's going wrong.
>
> > > > > Kind regards
> > > > > Thomas
>
> > > > > Am 19.09.2011 14:14, schrieb heohni:
>
> > > > > > No, it wasn't.
> > > > > > I added this line
>
> > > > > > class TranslatorComponent extends Object{
> > > > > >      var $components = array('Session');
>
> > > > > > But still the same error message ...
>
> > > > > > it drives me mad :-(
>
> > > > > > On 19 Sep., 14:10, Thomas Ploch  wrote:
> > > > > >> Is the SessionComponent loaded in the TranslatorComponent?
>
> > > > > >>http://book.cakephp.org/view/996/Creating-Components#Including-Compon...
>
> > > > > >> Kind regards
> > > > > >> Thomas
>
> > > > > >> Am 19.09.2011 14:07, schrieb heohni:
>
> > > > > >>> Hi,
>
> > > > > >>> even with this in app_controller:
> > > > > >>> var $components = array('Session', 'P28n', 'Translator',
> > > > > >>> 'RequestHandler', 'Email', 'MathCaptcha');
> > > > > >>> it's not changing the error message.
>
> > > > > >>> On 19 Sep., 14:00, Thomas Ploch    
> > > > > >>> wrote:
> > > > > >>>> Load the SessionComponent as the first component in the
> > > > > >>>> AppController::$components array, since the other components 
> > > > > >>>> (obviously)
> > > > > >>>> depend on the SessionComponent.
>
> > > > > >>>> Kind regards
> > > > > >>>> Thomas
>
> > > > > >>>> Am 19.09.2011 13:58, schrieb heohni:
>
> > > > > >>>>> Hi,
>
> > > > > >>>>> I struggle now for 2 days on this problem:
>
> > > > > >>>>> app_controller:
> > > > > >>>>> var $components = array('P28n', 'Translator', 'RequestHandler',
> > > > > >>>>> 'Session', 'Email', 'MathCaptcha');
>
> > > > > >>>>> my controller:
> > > > > >>>>> class SprachenController extends AppController{
> > > > > >>>>> var $components = array('Session', 'Translator');
>
> > > > > >>>>> my component:
> > > > > >>>>> class TranslatorComponent extends Object{
> > > > > >>>>> where I get at this point an error message:
> > > > > >>>>> debug($this->Session->read());
>
> > > > > >>>>> The error sounds like
> > > > > >>>>> Undefined property: TranslatorComponent::$Session 
> > > > > >>>>> [APP\controllers
> > > > > >>>>> \components\translator.php, line 8]
> > > > > >>>>> Fatal error: Call to a member function read() on a non-object
>
> > > > > >>>>> I have really no idea how to solve this, I goggled so many 
> > > > > >>>>> hours to
> > > > > >>>>> find an example where the same problem happend, but never found
> > > > > >>>>> something helpful...
>
> > > > > >>>>> Is there anybody out there who can see what I am doing wrong?
>
> > > > > >>>>> Thanks
> > > > > >>>>> heohni

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: use of javascript focus()

2011-09-20 Thread Miles J
Unnecessary to use Cake/PHP to render a simple HTML tag.

On Sep 20, 3:50 am, WebbedIT  wrote:
> In your view any blocks of script that you want to be echoed into the
> layout for that page you add to $scripts_for_layout by calling:
>
> $this->Javascript->codeBlock("
> // enter your raw jscript here
> ", array('inline'=>false, 'safe'=>false));
>
> On Sep 20, 7:08 am, nkoss  wrote:
>
>
>
>
>
>
>
> > Thanks, Vinicius, but I looked at that function and I'm afraid I have
> > no idea how to use it.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Undefined property Component::$Session

2011-09-19 Thread Miles J
Which Cake version are you using?

Also on a side note, stop using PHP4 syntax.

On Sep 19, 8:33 am, heohni 
wrote:
> Oh that's cool!
> I didn't know this bin...
>
> translator componenthttp://bin.cakephp.org/view/666573507
>
> On 19 Sep., 15:17, Thomas Ploch  wrote:
>
>
>
>
>
>
>
> > Please bin your TranslatorComponent code to:http://bin.cakephp.organdpost 
> > the url to the group so we can check
> > what's going wrong.
>
> > Kind regards
> > Thomas
>
> > Am 19.09.2011 14:14, schrieb heohni:
>
> > > No, it wasn't.
> > > I added this line
>
> > > class TranslatorComponent extends Object{
> > >      var $components = array('Session');
>
> > > But still the same error message ...
>
> > > it drives me mad :-(
>
> > > On 19 Sep., 14:10, Thomas Ploch  wrote:
> > >> Is the SessionComponent loaded in the TranslatorComponent?
>
> > >>http://book.cakephp.org/view/996/Creating-Components#Including-Compon...
>
> > >> Kind regards
> > >> Thomas
>
> > >> Am 19.09.2011 14:07, schrieb heohni:
>
> > >>> Hi,
>
> > >>> even with this in app_controller:
> > >>> var $components = array('Session', 'P28n', 'Translator',
> > >>> 'RequestHandler', 'Email', 'MathCaptcha');
> > >>> it's not changing the error message.
>
> > >>> On 19 Sep., 14:00, Thomas Ploch    wrote:
> >  Load the SessionComponent as the first component in the
> >  AppController::$components array, since the other components 
> >  (obviously)
> >  depend on the SessionComponent.
>
> >  Kind regards
> >  Thomas
>
> >  Am 19.09.2011 13:58, schrieb heohni:
>
> > > Hi,
>
> > > I struggle now for 2 days on this problem:
>
> > > app_controller:
> > > var $components = array('P28n', 'Translator', 'RequestHandler',
> > > 'Session', 'Email', 'MathCaptcha');
>
> > > my controller:
> > > class SprachenController extends AppController{
> > > var $components = array('Session', 'Translator');
>
> > > my component:
> > > class TranslatorComponent extends Object{
> > > where I get at this point an error message:
> > > debug($this->Session->read());
>
> > > The error sounds like
> > > Undefined property: TranslatorComponent::$Session [APP\controllers
> > > \components\translator.php, line 8]
> > > Fatal error: Call to a member function read() on a non-object
>
> > > I have really no idea how to solve this, I goggled so many hours to
> > > find an example where the same problem happend, but never found
> > > something helpful...
>
> > > Is there anybody out there who can see what I am doing wrong?
>
> > > Thanks
> > > heohni

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Need Data from DATABASE_CONFIG in Template

2011-09-14 Thread Miles J
The old school way of course.

$db = new DATABASE_CONFIG();
$db->ldap['domain'];

Don't worry, it won't actually cause any problems.

On Sep 14, 3:43 am, gloop  wrote:
> Hello,
>
> i program a LDAP login. We have several domains and its pretty when i
> have only one location for the ldap data.
>
> var $ldap = array(
>         'datasource' => 'ldap',
>         'host' => 'xx.xx',
>         'port' => xx,
>         'base_dn' => 'dc=xx,dc=xx,dc=xx',
>         'domain' => array('Domain1', 'Domain2', 'Domain3')
> );
>
> Is it possible to get the array 'domain' in my login template?
>
> Big thanks.
>
> gloop

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Why is this better?

2011-09-11 Thread Miles J
I actually posted a blog post about this:

http://milesj.me/blog/read/end-html-helper

On Sep 11, 1:28 am, elija  wrote:
> Thank you. That makes sense and now I don't have to learn it the hard
> way.
>
> On Sep 11, 8:30 am, Ryan Schmidt  wrote:
>
>
>
>
>
>
>
> > On Sep 11, 2011, at 02:29, elija wrote:
>
> > > Yes it is readable and concise but a simple  is even
> > > easier to read and doesn't use PHP to generate a link.  What I was
> > > actually wondering was is there any advantage in CakePHP to using the
> > > HTML Helper rather than just writing HTML in a view?
>
> > The advantage of using PHP to generate the links is that if you change how 
> > your routes are arranged, you don't then also have to update all your links 
> > in your views.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Singleton instance of controller

2011-09-06 Thread Miles J
This approach is incorrect. Place that functionality in the model or a
component, or even the AppController.

On Sep 6, 12:12 am, ajaxboy  wrote:
> If would be nice if you add a singleton method to get an instance of
> the controller in case need to load stuff outside of a user
> controller, that way you don't need to create a new controller object
> which would build everything again

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: implementing i18n in a non cakephp app

2011-09-02 Thread Miles J
__() wont work in a non-cake app, it's cake functionality.

__() is just a custom function cake wrote that extends their i18n
class. The i18n class deals with the loading of .po files and the
extraction of message strings using gettext (I believe).

On Aug 30, 1:09 pm, dole doug  wrote:
> hi there
>
> I have an old webapp on which i have to add i18n support. At this
> moment I've added a __() around my messages which i need to be
> translated and changed in my interface.
>
> I don't have great experience with cake or programming in OO but I'll
> like to know the logic by which cakephp can offer i18n. I can do a
> parser to extract all the strings which have to be translated(those
> with __()).
>
> What do I have to do from that point?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: HTML ENTITIES

2011-08-31 Thread Miles J
Then just strip_tags() before each insert.

Database size is irrelevant IMO.

On Aug 27, 11:42 pm, Prabha vathi  wrote:
> I am never going to use html. Then why should i increase database size?
>
>
>
>
>
>
>
>
>
> On Sun, Aug 28, 2011 at 10:09 AM, Miles J  wrote:
> > So whats your reasoning for not wanting HTML in the database?
>
> > Not like it can really break anything.
>
> > On Aug 27, 2:31 pm, Ryan Schmidt  wrote:
> > > On Aug 27, 2011, at 03:46, Prabha vathi wrote:
>
> > > > echo $html->link(
> > > >                 Sanitize::html($post_array['content'], array('remove'
> > => true)),
> > > >                 array(
> > > >                     'controller' => 'posts',
> > > >                     'action' => 'view',
> > > >                     'id' => $post_array['id'],
> > > >                     'quotes' =>
> > $this->Link->makeSeoUrl(Sanitize::html($post_array['content'],
> > array('remove' => true)))
> > > >                 ),
> > > >                 array('title' =>
> > substr(Sanitize::html($post_array['content'], array('remove' =>
> > true)),0,20)." ... Quotes of the day", 'class' => 'agrizlink')
> > > >             );
>
> > > > Now db has text like this - you're - but it is displayed like this -
> > you're in view.
> > > > But if there is no link, then it is working correctly. What is the
> > problem?
>
> > > Sanitize::html is escaping it once. Then $html->link is escaping it a
> > second time.
>
> > > Tell $html->link not to escape it that second time by passing false in
> > the $escapeTitle parameter.
>
> > >http://book.cakephp.org/view/1363/link
>
> > > Note, by the way, that "$html" is old CakePHP 1.2 syntax. For CakePHP
> > 1.3, you want to use "$this->Html" instead.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php
>
> --
> --
> Prabhavathihttp://www.indiapublicforum.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: HTML ENTITIES

2011-08-27 Thread Miles J
So whats your reasoning for not wanting HTML in the database?

Not like it can really break anything.

On Aug 27, 2:31 pm, Ryan Schmidt  wrote:
> On Aug 27, 2011, at 03:46, Prabha vathi wrote:
>
> > echo $html->link(
> >                 Sanitize::html($post_array['content'], array('remove' => 
> > true)),
> >                 array(
> >                     'controller' => 'posts',
> >                     'action' => 'view',
> >                     'id' => $post_array['id'],
> >                     'quotes' => 
> > $this->Link->makeSeoUrl(Sanitize::html($post_array['content'], 
> > array('remove' => true)))
> >                 ),
> >                 array('title' => 
> > substr(Sanitize::html($post_array['content'], array('remove' => 
> > true)),0,20)." ... Quotes of the day", 'class' => 'agrizlink')
> >             );
>
> > Now db has text like this - you're - but it is displayed like this - 
> > you're in view.
> > But if there is no link, then it is working correctly. What is the problem?
>
> Sanitize::html is escaping it once. Then $html->link is escaping it a second 
> time.
>
> Tell $html->link not to escape it that second time by passing false in the 
> $escapeTitle parameter.
>
> http://book.cakephp.org/view/1363/link
>
> Note, by the way, that "$html" is old CakePHP 1.2 syntax. For CakePHP 1.3, 
> you want to use "$this->Html" instead.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: HTML ENTITIES

2011-08-26 Thread Miles J
If you want to remove HTML, use strip_tags. Regardless, you should
just store the HTML version in the database and escape it on the front-
end so it cant be rendered. The only thing you need to do is SQL
injection protection, which cake does automatically.

On Aug 26, 2:47 pm, Ryan Schmidt  wrote:
> On Aug 26, 2011, at 15:39, Prabha vathi wrote:
>
> > It seems i read some wrong tutorial. :(
> > I have added few hundred of data in database. Is there anyway to fix it?
>
> Sure, but it's outside the scope of what CakePHP does. I'd dump the data to a 
> text file, search for all occurrences of the regular expression &[^;]+; and 
> then fix those database entries by hand. If there are many, I might write a 
> one-time script or set of UPDATE statements to fix things. Of course I'd 
> first fix the code and deploy it, so that no new bad entries get into the 
> database.
>
> > When i send the data to database, how do i strip the html tags? Should i 
> > use strip_tags?
>
> I'm not certain what the recommended way to do that in CakePHP is.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Where to place code meant to be universally accessible?

2011-08-12 Thread Miles J
That's not what models are for. Models are meant to represent an
entity of data from a datasource (database or rest), not to convene
helper methods. Cake creates even more confusion because their model
system isn't a true model system, it's simply a DAO (database access
object).

On Aug 11, 3:42 pm, Stephen Latham  wrote:
> I agree the model is a good place.  I recently wrote these type of global 
> actions in the app controller rather than bootstrap.php but found after 
> thought and discussion the model made more sense.
>
> On 11 Aug 2011, at 22:09, euromark  wrote:
>
>
>
>
>
>
>
> > usually in the model
> > since controllers can easily access models
>
> > but that depends on your situation
> > maybe a lib, maybe a behavior, maybe some boostrap code
>
> > without knowing more details, i go for model code
>
> > On 11 Aug., 22:30, BurningFuses  wrote:
> >> In my app I have a bunch of time related routines that I want to be
> >> able to call from my controllers and models. I could turn them into a
> >> component so they could be accessible on all my controllers, but they
> >> wouldn't be (in a trivial way or recommended way) be accessible from
> >> my models. Where should I put them? Is there a recommended cake
> >> guideline for such a thing?
> >> Thank you,
> >> Burningfuses
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Where to place code meant to be universally accessible?

2011-08-11 Thread Miles J
Create a static class and place it in libs or vendors.

On Aug 11, 2:09 pm, euromark  wrote:
> usually in the model
> since controllers can easily access models
>
> but that depends on your situation
> maybe a lib, maybe a behavior, maybe some boostrap code
>
> without knowing more details, i go for model code
>
> On 11 Aug., 22:30, BurningFuses  wrote:
>
>
>
>
>
>
>
> > In my app I have a bunch of time related routines that I want to be
> > able to call from my controllers and models. I could turn them into a
> > component so they could be accessible on all my controllers, but they
> > wouldn't be (in a trivial way or recommended way) be accessible from
> > my models. Where should I put them? Is there a recommended cake
> > guideline for such a thing?
> > Thank you,
> > Burningfuses

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Formatting arrays returned using Find('all')

2011-08-04 Thread Miles J
Is there a reason you need to condense it?

Isn't that much work.

foreach ($items as $item) {
echo $item['Industry']['id'];
}

On Aug 4, 5:48 am, spongs101  wrote:
> Perhaps using Set::Format or another method.  Can anyone describe an
> efficient way of converting the following array.  In reality the array
> is much longer and I was a foreach loop to re-create the array but
> this was very time consuming - maybe there is a way to get it
> formatted when querying the database:
>
> Array
> (
>     [0] => Array
>         (
>             [Industry] => Array
>                 (
>                     [id] => 1
>                     [industry] => Basic Materials
>                     [ShowInLists] => 1
>                 )
>
>         )
>
>     [1] => Array
>         (
>             [Industry] => Array
>                 (
>                     [id] => 2
>                     [industry] => Consumer Goods & Services
>                     [ShowInLists] => 1
>                 )
>
>         )
>
> to this:
>
> Array
> (
>     [0] => Array
>         (
>             [id] => 1
>             [industry] => Basic Materials
>             [ShowInLists] => 1
>         )
>
>     [1] => Array
>         (
>             [id] => 2
>             [industry] => Consumer Goods & Services
>             [ShowInLists] => 1
>         )...
>
> Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Custom controller name

2011-08-01 Thread Miles J
Like euromark said, just call it CalController, it *doesnt* have to be
plural.

On Jul 31, 1:58 am, euromark  wrote:
> but almost as easy:
> CalController extends ...
> var $name = 'CalController';
>
> and make sure you post all forms to themselves (which is the default
> thing for cake2 anyway!)
>
> On 31 Jul., 02:58, Roland Pish  wrote:
>
>
>
>
>
>
>
> > Thank you Sam!
> > I'll use the route.
>
> > Cheers
>
> > On 30 jul, 17:42, Sam Sherlock  wrote:
>
> > > For an easier life I would stick with conventions and set the route cal to
> > > route to the CalsController
>
> > > Router::connect('/cal', array(
> > >         'controller' => 'cals',
> > >         'action' => 'index'));
>
> > > but you can have the model useTable an 'some_unconventional_name'
> > > with the following in the model
> > >     public $useTable = 'cal';
>
> > >  - S
>
> > > On 30 July 2011 23:43, Roland Pish  wrote:
>
> > > > I have a model named "Cal". I wanted its table name to "cal" (not
> > > > "cals").
>
> > > > Now, I would like that its controller could be accessed as: mysite.com/
> > > > cal/*   (and avoid being accessed as
> > > > mysite.com/cals/*).
>
> > > > A plus would be that I can declare the controller as: class
> > > > CalController extends...
>
> > > > Is this possible?
>
> > > > Thanks in advance.
>
> > > > --
> > > > Our newest site for the community: CakePHP Video Tutorials
> > > >http://tv.cakephp.org
> > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > > others with their CakePHP related questions.
>
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 1.3.10 to 1.3.11

2011-08-01 Thread Miles J
Also, check for a migration guide if anything has changed (which I
dont think it has).

On Aug 1, 10:18 am, Prabha vathi  wrote:
> Hi,
>
> How to update cakephp 1.3.10 to 1.3.11?
> If i update, should i need to modify my script?
>
> Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 1.3.10 to 1.3.11

2011-08-01 Thread Miles J
Just copy the whole "cake" folder from 1.3.11 and overwrite the 1.3.10
"cake" folder.

On Aug 1, 10:18 am, Prabha vathi  wrote:
> Hi,
>
> How to update cakephp 1.3.10 to 1.3.11?
> If i update, should i need to modify my script?
>
> Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Html Helper Tables :: Pure Curiosity

2011-07-15 Thread Miles J
Its to generate rows using a helper, not really meant for generation
within the view.

On Jul 15, 7:28 am, DragonFlyEye  wrote:
> Does anybody know a reason that the Html Helper contains a method to output
> table cells and headers, but not a method to output tables? Like, at least
> tableStart and tableEnd?
>
> It just looks sloppy to echo '' when everything else is done via the
> helper.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Lazy load for Model and PHP4 problem

2011-07-07 Thread Miles J
And if you are running PHP4, upgrade immediately.

On Jul 7, 3:32 am, Tilen Majerle  wrote:
> cake2.0 does not support PHP4
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2011/7/7 datgs 
>
>
>
>
>
>
>
> > Hi Team,
>
> > As I can see. There was so many discussions about the lazy load
> > mechanism of CakePHP model is not good defined. How it is resolved in
> > CakePHP 2.0?
>
> > Another problem is PHP4, is it eliminated (sorry because I haven't
> > tried 2.0 version of Cake yet)?
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Retrograde counterCache

2011-07-06 Thread Miles J
In that case, just create a shell that loops over everything, runs
count queries, and then saves the counter cache value.

On Jul 6, 1:11 pm, Jeremy Burns | Class Outfit
 wrote:
> I think he's adding it to existing tables, so it won't start from zero. He 
> needs to do a find count group by and update the new counterCache field.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 6 Jul 2011, at 20:21, Miles J wrote:
>
>
>
>
>
>
>
> > Well, do you need to populate it right off the bat?
>
> > Cake will automatically insert the correct counter value the next time
> > a save or delete is made (all it does is a findCount()).
>
> > On Jul 6, 10:38 am, Thomas Ploch  wrote:
> >> Wouldn't a simple find('all') saveAll() script do the trick?
>
> >> Am Mittwoch, den 06.07.2011, 18:29 +0100 schrieb Jeremy Burns | Class
> >> Outfit:
>
> >>> Doesn't his question relate to populating the counterCache fields with
> >>> the right values on creation, rather than maintaining it?
>
> >>> Jeremy Burns
> >>> Class Outfit
>
> >>>http://www.classoutfit.com
>
> >>> On 6 Jul 2011, at 17:17, euromark wrote:
>
> >>>> there are already several different counterCache solutions available
> >>>> one in the core
> >>>> see the cookbook or
> >>>>http://stackoverflow.com/questions/1351823/countercache-in-cake-php
>
> >>>> and several als plugins etc
> >>>> depends on what exactly you need
>
> >>>>http://bakery.cakephp.org/articles/danaki/2009/05/29/counter-cache-be...
> >>>>http://bakery.cakephp.org/articles/dericknwq/2007/05/02/countercache-...
> >>>>http://www.neilcrookes.com/2010/01/09/cakephp-treecountercachebehavio...
> >>>> and probably some more
>
> >>>> On 6 Jul., 17:46, Jeremy Burns | Class Outfit
> >>>>  wrote:
> >>>>> In my experience you need to do it with a simple SQL query at the
> >>>>> db level. I am not aware of any Cake magic. If it's a continuous
> >>>>> problem worthy of some dev time you could write a simple behaviour
> >>>>> to do it.
>
> >>>>> Jeremy Burns
> >>>>> Class Outfit
>
> >>>>>http://www.classoutfit.com
>
> >>>>> On 6 Jul 2011, at 16:43, wiseguysonly wrote:
>
> >>>>>> One of my early CakePHP sites has come back to haunt me. I need
> >>>>>> to add
> >>>>>> a counterCache to a pre-existing hasMany relationship.
>
> >>>>>> Does there exist a method to set up the counterCache with
> >>>>>> current
> >>>>>> counts field once I have have created it?
>
> >>>>>> Thanks in advance,
>
> >>>>>> Tim
>
> >>>>>> --
> >>>>>> Our newest site for the community: CakePHP Video
> >>>>>> Tutorialshttp://tv.cakephp.org
> >>>>>> Check out the new CakePHP Questions
> >>>>>> sitehttp://ask.cakephp.organdhelpothers with their CakePHP
> >>>>>> related questions.
>
> >>>>>> To unsubscribe from this group, send email to
> >>>>>> cake-php+unsubscr...@googlegroups.com For more options, visit
> >>>>>> this group athttp://groups.google.com/group/cake-php
>
> >>>> --
> >>>> Our newest site for the community: CakePHP Video Tutorials
> >>>>http://tv.cakephp.org
> >>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd
> >>>> help others with their CakePHP related questions.
>
> >>>> To unsubscribe from this group, send email to
> >>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
> >>>> group athttp://groups.google.com/group/cake-php
>
> >>> --
> >>> Our newest site for the community: CakePHP Video Tutorials
> >>>http://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd
> >>> help others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this
> >>> group athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Retrograde counterCache

2011-07-06 Thread Miles J
Well, do you need to populate it right off the bat?

Cake will automatically insert the correct counter value the next time
a save or delete is made (all it does is a findCount()).

On Jul 6, 10:38 am, Thomas Ploch  wrote:
> Wouldn't a simple find('all') saveAll() script do the trick?
>
> Am Mittwoch, den 06.07.2011, 18:29 +0100 schrieb Jeremy Burns | Class
> Outfit:
>
>
>
>
>
>
>
> > Doesn't his question relate to populating the counterCache fields with
> > the right values on creation, rather than maintaining it?
>
> > Jeremy Burns
> > Class Outfit
>
> >http://www.classoutfit.com
>
> > On 6 Jul 2011, at 17:17, euromark wrote:
>
> > > there are already several different counterCache solutions available
> > > one in the core
> > > see the cookbook or
> > >http://stackoverflow.com/questions/1351823/countercache-in-cake-php
>
> > > and several als plugins etc
> > > depends on what exactly you need
>
> > >http://bakery.cakephp.org/articles/danaki/2009/05/29/counter-cache-be...
> > >http://bakery.cakephp.org/articles/dericknwq/2007/05/02/countercache-...
> > >http://www.neilcrookes.com/2010/01/09/cakephp-treecountercachebehavio...
> > > and probably some more
>
> > > On 6 Jul., 17:46, Jeremy Burns | Class Outfit
> > >  wrote:
> > > > In my experience you need to do it with a simple SQL query at the
> > > > db level. I am not aware of any Cake magic. If it's a continuous
> > > > problem worthy of some dev time you could write a simple behaviour
> > > > to do it.
>
> > > > Jeremy Burns
> > > > Class Outfit
>
> > > >http://www.classoutfit.com
>
> > > > On 6 Jul 2011, at 16:43, wiseguysonly wrote:
>
> > > > > One of my early CakePHP sites has come back to haunt me. I need
> > > > > to add
> > > > > a counterCache to a pre-existing hasMany relationship.
>
> > > > > Does there exist a method to set up the counterCache with
> > > > > current
> > > > > counts field once I have have created it?
>
> > > > > Thanks in advance,
>
> > > > > Tim
>
> > > > > --
> > > > > Our newest site for the community: CakePHP Video
> > > > > Tutorialshttp://tv.cakephp.org
> > > > > Check out the new CakePHP Questions
> > > > > sitehttp://ask.cakephp.organdhelp others with their CakePHP
> > > > > related questions.
>
> > > > > To unsubscribe from this group, send email to
> > > > > cake-php+unsubscr...@googlegroups.com For more options, visit
> > > > > this group athttp://groups.google.com/group/cake-php
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd
> > > help others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this
> > > group athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd
> > help others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this
> > group athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Retrieving objects from the DB instead of arrays

2011-07-06 Thread Miles J
True, forgot that Cake uses Set a lot.

On Jul 6, 10:06 am, mark_story  wrote:
> ArrayAccess and real arrays are very different things, so this won't
> work.  Try using Set on an object graph that implements ArrayAccess.
> It will go pretty poorly.  If it were that simple it would have been
> done by now.
>
> -Mark
>
> On Jul 5, 4:24 pm, Miles J  wrote:
>
>
>
>
>
>
>
> > Couldn't we just have the DB call return a "QueryResponse" object that
> > maps all the values together and associated models (also as
> > QueryResponse objects). Then give it ArrayAccess functionality for
> > backwards compatibility?
>
> > (I haven't thought much into it, just throwing it out there.)
>
> > On Jul 5, 11:06 am, stephenrs  wrote:
>
> > > Thanks for your reply, Mark. I'd just chime in by agreeing that it is hard
> > > to build an ORM...but since this wheel has already been invented..and
> > > reinvented, it's hard to justify why a new ORM would need to be built for
> > > Cake. There are already several mature PHP-based ORM systems (Doctrine and
> > > Propel leading the pack) that are ripe for straightforward integration 
> > > into
> > > larger systems.
>
> > > So, rather than a backwards-compatibility-killing overhaul of Cake's model
> > > system, perhaps a better approach would be to start by offering Cake
> > > developers a choice by allowing the data access layer to be toggled 
> > > between
> > > returning the traditional arrays and returning objects via an existing ORM
> > > that has been plugged in. Maybe this toggle could even be set application-
> > > or controller-wide via the configuration system, or at run time for more
> > > granular control. Doctrine offers this toggle out of the box, for example.
>
> > > This way, developers have a choice to migrate all, some, or none of an
> > > existing application to an object oriented model system. Maybe there's
> > > something about Cake's design that would make even this kind of 
> > > architecture
> > > unfeasibly difficult, but based on my (admittedly rusty) understanding of
> > > Cake's internals, it shouldn't be too bad. Core system components could
> > > transparently continue to use the array access method as long as they 
> > > needed
> > > to, and userland code could break free of arrays if it wanted to.
>
> > > Having been away for a few years, I'm actually a bit amazed (and
> > > disappointed) that the 2.0 release isn't being used as an opportunity to
> > > bring Cake more fully into the world of OOP. I'm not one to complain about
> > > open source software though...I have much to be thankful for.
>
> > > -SS

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Retrieving objects from the DB instead of arrays

2011-07-05 Thread Miles J
Couldn't we just have the DB call return a "QueryResponse" object that
maps all the values together and associated models (also as
QueryResponse objects). Then give it ArrayAccess functionality for
backwards compatibility?

(I haven't thought much into it, just throwing it out there.)

On Jul 5, 11:06 am, stephenrs  wrote:
> Thanks for your reply, Mark. I'd just chime in by agreeing that it is hard
> to build an ORM...but since this wheel has already been invented..and
> reinvented, it's hard to justify why a new ORM would need to be built for
> Cake. There are already several mature PHP-based ORM systems (Doctrine and
> Propel leading the pack) that are ripe for straightforward integration into
> larger systems.
>
> So, rather than a backwards-compatibility-killing overhaul of Cake's model
> system, perhaps a better approach would be to start by offering Cake
> developers a choice by allowing the data access layer to be toggled between
> returning the traditional arrays and returning objects via an existing ORM
> that has been plugged in. Maybe this toggle could even be set application-
> or controller-wide via the configuration system, or at run time for more
> granular control. Doctrine offers this toggle out of the box, for example.
>
> This way, developers have a choice to migrate all, some, or none of an
> existing application to an object oriented model system. Maybe there's
> something about Cake's design that would make even this kind of architecture
> unfeasibly difficult, but based on my (admittedly rusty) understanding of
> Cake's internals, it shouldn't be too bad. Core system components could
> transparently continue to use the array access method as long as they needed
> to, and userland code could break free of arrays if it wanted to.
>
> Having been away for a few years, I'm actually a bit amazed (and
> disappointed) that the 2.0 release isn't being used as an opportunity to
> bring Cake more fully into the world of OOP. I'm not one to complain about
> open source software though...I have much to be thankful for.
>
> -SS

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Single Quotes

2011-07-02 Thread Miles J
I stand corrected!

On Jul 1, 2:07 am, euromark  wrote:
> i knew it :)
>
> On 1 Jul., 04:02, mark_story  wrote:
>
>
>
>
>
>
>
> > h() isn't being deprecated or removed.  neither is am().  Both
> > actually provide some utility above and beyond simple aliasing.
> > However, methods like r(), up(), e() and low() have already been
> > removed from 2.0.  h() however will stick around.
>
> > -Mark
>
> > On Jun 30, 5:12 pm, Miles J  wrote:
>
> > > They are being removed because they are slower than the original
> > > counter-parts. But like you said, you can place them yourselves if
> > > they get removed :P
>
> > > On Jun 30, 1:44 pm, euromark  wrote:
>
> > > > some convenience functions do make sense to get rid of
> > > > but not h()
> > > > -1 from me
>
> > > > On 30 Jun., 22:32, Miles J  wrote:
>
> > > > > I think it was supposed to be 1.3, but most likely 2.0 now. Any of
> > > > > these convenience functions like h() or r() are removed.
>
> > > > > On Jun 30, 12:43 pm, Ryan Schmidt  wrote:
>
> > > > > > On Jun 30, 2011, at 14:13, Miles J wrote:
>
> > > > > > > h() is being deprecated in later versions
>
> > > > > > Oh? By "later versions" I assume you mean CakePHP 2? If so, what 
> > > > > > are we being recommended to use instead?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Single Quotes

2011-06-30 Thread Miles J
They are being removed because they are slower than the original
counter-parts. But like you said, you can place them yourselves if
they get removed :P

On Jun 30, 1:44 pm, euromark  wrote:
> some convenience functions do make sense to get rid of
> but not h()
> -1 from me
>
> On 30 Jun., 22:32, Miles J  wrote:
>
>
>
>
>
>
>
> > I think it was supposed to be 1.3, but most likely 2.0 now. Any of
> > these convenience functions like h() or r() are removed.
>
> > On Jun 30, 12:43 pm, Ryan Schmidt  wrote:
>
> > > On Jun 30, 2011, at 14:13, Miles J wrote:
>
> > > > h() is being deprecated in later versions
>
> > > Oh? By "later versions" I assume you mean CakePHP 2? If so, what are we 
> > > being recommended to use instead?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Single Quotes

2011-06-30 Thread Miles J
I think it was supposed to be 1.3, but most likely 2.0 now. Any of
these convenience functions like h() or r() are removed.

On Jun 30, 12:43 pm, Ryan Schmidt  wrote:
> On Jun 30, 2011, at 14:13, Miles J wrote:
>
> > h() is being deprecated in later versions
>
> Oh? By "later versions" I assume you mean CakePHP 2? If so, what are we being 
> recommended to use instead?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Single Quotes

2011-06-30 Thread Miles J
h() is being deprecated in later versions, so create a helper method
for html escaping.

On Jun 30, 2:55 am, euromark  wrote:
> everything :)
> you dont have to do anything
> cake takes care of that for you
>
> simply use h() in the views to display your data safely
>
> On 30 Jun., 10:24, Prabha Vathi  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > addslashes(Sanitize::html($this->data['Post']['content'],array('remove' =>
> > true)));
>
> > This is the line I have before saving the record. But single quotes becomes
> > '
> > What have i done wrongly?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Access method of another controller

2011-06-25 Thread Miles J
Place it in your AppController and make sure your other controllers
extend it.

On Jun 25, 4:59 am, Dominik Gajewski 
wrote:
> Hi
>
> I would like to ask about getting access to method from another contoller
>
> I have DocumentsController where I have method _getError($error) (of
> course this method has no direct access). I would like to use this
> method in another controller.
> Is It possible?? If yes, how should I do that??
>
> --
> Dominik Gajewski

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Where should i contact right people in CakePHP.org because this security critical problem

2011-06-23 Thread Miles J
What a helpful member of the CakePHP community you are.

The consensus seems to be against you on this one.

On Jun 23, 11:47 am, AD7six  wrote:
> On Jun 23, 7:41 pm, Miles J  wrote:
>
> > What are you talking about, stop trolling. I know that was incorrect,
> > but that's my point. How are developers supposed to know *which* is
> > the correct way until they encounter the problem? Its not stated in
> > the docs, and a new Cake developer isn't going to know any better.
> > Database credentials, regardless of who's fault it is, should *never*
> > be displayed in plain text, who's smart idea was that?
>
> yours

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Where should i contact right people in CakePHP.org because this security critical problem

2011-06-23 Thread Miles J
What are you talking about, stop trolling. I know that was incorrect,
but that's my point. How are developers supposed to know *which* is
the correct way until they encounter the problem? Its not stated in
the docs, and a new Cake developer isn't going to know any better.
Database credentials, regardless of who's fault it is, should *never*
be displayed in plain text, who's smart idea was that?

Get off your high "I know everything" horse.

On Jun 23, 1:00 am, AD7six  wrote:
> On Jun 22, 11:35 pm, Miles J  wrote:
>
> > Thats my point, no?
>
> No. The point is you don't use debug in production _ever_.
>
> You implemented default-allow with your debug setting - it boggles the
> mind you still think you did nothing (immensely) wrong.
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Where should i contact right people in CakePHP.org because this security critical problem

2011-06-22 Thread Miles J
Thats my point, no? How is a developer supposed to know which step
core.php is loaded in the bootstrap process, in that it will cause
problems. No ones going to know this unless they dig into the core
files and discover it.

On Jun 22, 12:17 pm, AD7six  wrote:
> On Jun 22, 7:20 pm, Miles J  wrote:
>
> > The problem is, its unclear when this error is thrown. I developed in
> > Cake for over a year and still had this debug show in production.
>
> From your blog post:
>
> "debug in core.php was set to 2, and then disabled to 0 in
> bootstrap.php"
>
> with hindsight you can see the problem with that - but it should be
> obvious: That means any thing which happens generating a warning/error/
> notice inbetween loading core.php, and bootstrap.php will be sent to
> users - and failing to connect to the db is one of those things in
> cake 1.2/3.
>
> IMO what you describe in your blog post is a manufactured problem
> _purely_ because you are sharing the same core.php file on your local
> machine and your deployed site - don't do that.
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Where should i contact right people in CakePHP.org because this security critical problem

2011-06-22 Thread Miles J
The problem is, its unclear when this error is thrown. I developed in
Cake for over a year and still had this debug show in production. Its
not a problem of being a good developer, it was a problem of debug
being enabled at a certain point in the dispatch cycle and then turned
off at another point, but the error being thrown while debug was still
on. It was a problem with the order of operation, and the only way a
good developer will know this process is when it happens to them, and
that just might happen in prod. No developer will know about this
unless they reverse engineered the whole dispatch cycle to see how and
when this error is thrown.

http://milesj.me/blog/read/debug-off-prod-again

On Jun 22, 10:08 am, majna  wrote:
> How about to output debugger "Context" only for 127.0.0.1 ?
>
> On Jun 22, 7:02 pm, mark_story  wrote:
>
>
>
>
>
>
>
> > It is the developer's fault, for deploying a system in a way it should
> > never be deployed.
>
> > Since, I was working under the pre-tense that any developer who
> > actually cared about these kinds of things wouldn't make a stupid
> > mistake like this. And combined with the fact that removing the
> > passwords is a non-trivial problem, I punted on the issue.  The place
> > where this error gets displayed from is inside Debugger, and its more
> > than non-trivial to filter through the various parts of output,
> > looking for things that follow password, and cutting them out.  While
> > this is probably doable it will affect all the messages that Debugger
> > will create.
>
> > I guess I underestimated the ability of people to screw up basic
> > deployment.  If someone want's to prepare a patch, I'd be happy to
> > apply it so people who can't be bothered to properly deploy their
> > applications, can sleep better at night.
>
> > -Mark
>
> > On Jun 21, 10:22 am, Miles J  wrote:
>
> > > I have brought this problem up before. Last time, the Cake devs said
> > > it was the developers fault and it will stay in.
>
> > > -_-
>
> > > On Jun 21, 8:23 am, looklook look  wrote:
>
> > > > Now you got my point ;)
>
> > > > I have tried with google query to show database connection on Drupal,
> > > > Codeigniter, Wordpress and many else.
> > > > But yes, they can handle this database error carefully.
>
> > > > So, i think this is critical issue that should fixed immediatelly.
>
> > > > Thanks
>
> > > > Yodihttp://yoodey.com
>
> > > > On Tue, Jun 21, 2011 at 9:36 PM, Thomas Ploch 
> > > > wrote:
>
> > > > > OMG,
>
> > > > > I certainly could connect to __several__ mysql servers found with this
> > > > > google query.
>
> > > > > Although I agree that this is a developer's mistake, I am sure that
> > > > > there are a lot of unskilled developers that are doing this because 
> > > > > they
> > > > > just dont know it better. So removing those values from the output 
> > > > > would
> > > > > be a +1 from me.
>
> > > > > Regards,
> > > > > Thomas
>
> > > > > Am Dienstag, den 21.06.2011, 06:02 -0700 schrieb chris:
> > > > > > I'm intrigued by this issue.
>
> > > > > > Can someone explain what situations would the whole config var be
> > > > > > output? Is it only when an error occurs, and only when at a certain
> > > > > > debug level? I've never seen it displayed at all whilst developing
> > > > > > with cakePHP.
>
> > > > > > Out of interested I googled the first part of the output, i.e.
>
> > > > > > $config = array( "persistent" => false,
>
> > > > > > and it certaintly suprised me how many sites this brings back with
> > > > > > passwords on show.
>
> > > > > > On Jun 21, 12:46 pm, yodi  wrote:
> > > > > > > Sorry, it was on random site build by CakePHP.
>
> > > > > > > To Euromark, i found more than 100 website affected with this 
> > > > > > > problem
> > > > > > > and i don't have much time to email them all.
>
> > > > > > > I think, whether it debug > 0, Cakephp should'nt throw real 
> > > > > > > password
> > > > > > > into CONTEXT.
>
> > > > > > > I try searching another CMS and Framework. Using same method, i 
> > &g

Re: Where should i contact right people in CakePHP.org because this security critical problem

2011-06-21 Thread Miles J
I have brought this problem up before. Last time, the Cake devs said
it was the developers fault and it will stay in.

-_-

On Jun 21, 8:23 am, looklook look  wrote:
> Now you got my point ;)
>
> I have tried with google query to show database connection on Drupal,
> Codeigniter, Wordpress and many else.
> But yes, they can handle this database error carefully.
>
> So, i think this is critical issue that should fixed immediatelly.
>
> Thanks
>
> Yodihttp://yoodey.com
>
> On Tue, Jun 21, 2011 at 9:36 PM, Thomas Ploch 
> wrote:
>
>
>
>
>
>
>
> > OMG,
>
> > I certainly could connect to __several__ mysql servers found with this
> > google query.
>
> > Although I agree that this is a developer's mistake, I am sure that
> > there are a lot of unskilled developers that are doing this because they
> > just dont know it better. So removing those values from the output would
> > be a +1 from me.
>
> > Regards,
> > Thomas
>
> > Am Dienstag, den 21.06.2011, 06:02 -0700 schrieb chris:
> > > I'm intrigued by this issue.
>
> > > Can someone explain what situations would the whole config var be
> > > output? Is it only when an error occurs, and only when at a certain
> > > debug level? I've never seen it displayed at all whilst developing
> > > with cakePHP.
>
> > > Out of interested I googled the first part of the output, i.e.
>
> > > $config = array( "persistent" => false,
>
> > > and it certaintly suprised me how many sites this brings back with
> > > passwords on show.
>
> > > On Jun 21, 12:46 pm, yodi  wrote:
> > > > Sorry, it was on random site build by CakePHP.
>
> > > > To Euromark, i found more than 100 website affected with this problem
> > > > and i don't have much time to email them all.
>
> > > > I think, whether it debug > 0, Cakephp should'nt throw real password
> > > > into CONTEXT.
>
> > > > I try searching another CMS and Framework. Using same method, i found
> > > > nothing of them show real password where database error connection
> > > > occured.
>
> > > > Yes, this is security issued for me. Which there are many developer
> > > > using CakePHP.
>
> > > > To Larry, i can send you some message to show how much it's affected.
> > It
> > > > can be consideration.
>
> > > > Thanks
>
> > > > On Tue, 2011-06-21 at 06:13 -0500, Larry E. Masters wrote:
> > > > > Are you saying this was on the CakePHP website or a random site you
> > > > > where visiting?
>
> > > > > --
> > > > > Larry E. Masters
>
> > > > > On Mon, Jun 20, 2011 at 2:18 PM, yoodey  wrote:
> > > > >         Hello all,
>
> > > > >         I'm randomly browsing and get a website with Database error
> > > > >         connection.
> > > > >         It gave me error page : Warning (2): mysql_connect()
> > > > >         [function.mysql-
> > > > >         connect]: Access denied for user ...
>
> > > > >         So i click on Context option and got this information.
>
> > > > >         $config =       array(
> > > > >                "persistent" => false,
> > > > >                "host" => "xxx",
> > > > >                "login" => "dbx",
> > > > >                "password" => "dbtxxx",
> > > > >                "database" => "dbx",
> > > > >                "port" => "3306",
> > > > >                "driver" => "mysql",
> > > > >                "prefix" => "",
> > > > >                "encoding" => "UTF8"
> > > > >         )
>
> > > > >         To avoid other people doing bad thing, i'm not showing real
> > > > >         error
> > > > >         information.
>
> > > > >         I'm doing mysql command based on that information and guest
> > > > >         what? I
> > > > >         got full access!
> > > > >         Curious with this error, i'm doing little research and found
> > > > >         more than
> > > > >         1000 website mysql root access. (there many others, but i too
> > > > >         tired to
> > > > >         check it one by one ).
>
> > > > >         This is very dangerous things which i'm big fans of CakePHP.
> > I
> > > > >         working
> > > > >         on 50K/day visitors website powered by CakePHP which i don't
> > > > >         wanna
> > > > >         this thing happen to me.
>
> > > > >         So, please tell me, which people in cakephp.org should be
> > > > >         contacted
> > > > >         because this issue. Opening ticket will leaked real
> > > > >         information for
> > > > >         the victim website.
>
> > > > >         Thanks
>
> > > > >         Yoodey
>
> > > > >         --
> > > > >         Our newest site for the community: CakePHP Video Tutorials
> > > > >        http://tv.cakephp.org
> > > > >         Check out the new CakePHP Questions site
> > > > >        http://ask.cakephp.organdhelp others with their CakePHP
> > > > >         related questions.
>
> > > > >         To unsubscribe from this group, send email to
> > > > >         cake-php+unsubscr...@googlegroups.com For more options,
> > visit
> > > > >         this group athttp://groups.google.com/group/cake-php
>
> > > > > --
>

Re: App_controller function to obtain default.pot file ( i18n extract )

2011-06-18 Thread Miles J
Yeah you can easily set it up using a cron job. Just use the same
command you use in the CLI in the cron.

On Jun 18, 10:14 am, krisspnet  wrote:
> Well, we have different persons in charge of the translations.
> However, those persons don't know what is a terminal actually.
> Because we often add new functions and views in our website, we all also add
> new _('to be translated',true) tags in the code.
>
> We just want it to be easy, with a simple 'button' on the website, the
> persons who translate can have the last items that need to be translated
> without asking us every time.
> In this context, they feel free to translate the last version of the
> website, when they want.
>
> I asked this question because we use 
> thehttp://book.cakephp.org/view/647/An-Automated-tool-for-creating-ACOs
> build_acl  function, which was first a shell command.
>
> Might it be possible to run the i18n extract command in a background
> terminal?
>
> --
> View this message in 
> context:http://cakephp.1045679.n5.nabble.com/App-controller-function-to-obtai...
> Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: App_controller function to obtain default.pot file ( i18n extract )

2011-06-17 Thread Miles J
It should be done in the command line as attempting to do it in the
browser will be really slow and most likely consume a lot of memory.

Any specific reason you want it in the AppController?

On Jun 16, 9:35 am, krisspnet  wrote:
> Hi everyone,
>
> I am a new user of the cakephp framework and I find it really amazing for
> those who have few knowledge of website construction.
>
> My colleagues and I are working on a project that has to be shown each month
> into different languages.
> Therefore, we have started to build a multilingual interface with cake i18n
> extract shell command.
>
> Thanks to this page 
> :http://cakephp.1045679.n5.nabble.com/create-po-file-from-database-tab...
> create-po-file-from-database-table-multilingual-l10n-I18n  , we have build a
> simple interface to facilitate the life of our translators.
>
> However, our website is changing month after month, with the need to
> translate the new __('text to be translated',true).
>
> Hence, we have to re-construct the default.pot file each time.
>
> My question :
>
> Is there an App_controller function that can do the shell command : cake
> i18n extract shell
> If not, does anyone have an idea of how should it be written ?
>
> Thanks in advance.
>
> --
> View this message in 
> context:http://cakephp.1045679.n5.nabble.com/App-controller-function-to-obtai...
> Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: setFlash doesn't appears using $ajax->submit

2011-06-16 Thread Miles J
setFlash() requires the whole page to reload to work, you cant fire
off an AJAX call and expect some random flash message to appear in the
page.

On Jun 16, 7:48 pm, Cruisine  wrote:
> hi guys,recently i've been using ajax submit to save the data into
> database...but whenever i use $ajax->submit(), setFlash doesn't appear
> on my page.i'm so curious what's wrong with the setFlash...and
> it'll terrible since i can't show to the user whether the data have
> already saved or not
> need ur help soon..thanks...

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem when trying to upload zip/rar files with the milesjohnson's upload plugin

2011-06-08 Thread Miles J
So what is the value of $data['name']?

Because on this line:

$this->data['Publicacione']['link_referencia'] = $data['name'];

You are setting the value, but it seems like $data['name'] is an
array.

On Jun 8, 2:28 pm, axell9641  wrote:
> Miles J wrote:
>
> > Does it work with regular files?
>
> Yes, it certainly does. It works wonders with regular files
>
> Miles J wrote:
>
> > Also, can you paste the whole error, the image is cutting it off.
>
> Ok, there you go:
> -Notice (8): Array to string conversion
> [CORE\cake\libs\model\datasources\dbo_source.php, line 749]
>
> -Warning (512): SQL Error: 1054: Unknown column 'Array' in 'field list'
> [CORE\cake\libs\model\datasources\dbo_source.php, line 684]
>
> -Query: INSERT INTO `publicaciones` (`vigencia`, `tipo`, `titulo`,
> `descripcion`, `fecha_publicacion`, `fecha_caducidad`, `link_referencia`,
> `modified`, `created`) VALUES (1, 'c', 'If you ,if you could return', '
> Cause she's so high...high above me, she's so lovely', '2011-06-01',
> '2011-06-10', Array, '2011-06-08 15:42:22', '2011-06-08 15:42:22')
>
> Miles J wrote:
>
> > And lastly, make sure you are using the latest version.
> >https://github.com/milesj/cake-uploader/downloads
>
> Yes, I did that too, but I keep getting the same error
>
> --
> View this message in 
> context:http://cakephp.1045679.n5.nabble.com/Problem-when-trying-to-upload-zi...
> Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem when trying to upload zip/rar files with the milesjohnson's upload plugin

2011-06-08 Thread Miles J
Does it work with regular files?

Also, can you paste the whole error, the image is cutting it off.

And lastly, make sure you are using the latest version.

https://github.com/milesj/cake-uploader/downloads

On Jun 8, 11:21 am, axell9641  wrote:
> any ideas???
>
> --
> View this message in 
> context:http://cakephp.1045679.n5.nabble.com/Problem-when-trying-to-upload-zi...
> Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Future of CakePHP

2011-06-06 Thread Miles J
Well put :P

On Jun 6, 6:20 pm, "Larry E. Masters"  wrote:
> Thats old old news, CakePHP isn't going anywhere.
>
>
>
> Miles,
>
> Sure it is :) we are moving forward!
>
> --
> Larry E. Masters

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Future of CakePHP

2011-06-06 Thread Miles J
Thats old old news, CakePHP isn't going anywhere.

On Jun 6, 4:13 pm, Junior Grossi  wrote:
> Hi all,
>
> I'm new here and I am starting using cakePHP for a new web app (we are
> between Zend and Cake). I've listening about the future of Cake, that
> some people leaved the project and start another, the Lithium
> Framework (that will be the Cake3).
>
> The CakePHP project will really stop? Or can I start using Cake 1.3
> (or soon Cake 2.0)???
>
> I am afraid to use CakePHP and the project stops.
>
> Thanks...
>
> Junior Grossi

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: add extra function to model but cakephp thinks it's query???

2011-06-06 Thread Miles J
@Ryan - It turns them into SQL statements because Cakes model uses
magic __get methods for findByColumn() calls, but it triggers on
anything.

@OP - Your model isn't being loaded, the AppModel is. Your conventions
are off.

On Jun 5, 4:17 pm, Ryan Schmidt  wrote:
> On Jun 5, 2011, at 04:45, cake-learner wrote:
>
>
>
>
>
>
>
>
>
> > I just add an function to model and call that function from another
> > controller.
> > but what i get is the following error. What happen?
>
> > In Model( department.php ),
>
> > class Department extends AppModel {
> >   var $useDbConfig = 'default_account';
> >   function get_child_dep( $dep_id, $child ){
> >   }
> > }
>
> > In Controll( orgmap_controller.php ),
>
> > $this -> loadModel( 'Department' );
> > $this -> Department -> get_child_dep( 1 )
>
> > error message 
> > Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> > check the manual that corresponds to your MySQL server version for the
> > right syntax to use near 'get_child_dep' at line 1 [CORE/cake/libs/
> > model/datasources/dbo_source.php, line 535]
>
> CakePHP turns unknown methods into SQL statements. I don't know why that's a 
> useful feature, but apparently it is. So it means that your model file is not 
> actually being used (and CakePHP is generating its own default model, which 
> doesn't have that function you made). Looking at your code I'm not sure 
> however why this is happening. Are you sure the model file is in the models 
> directory and has the right name (department.php)?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Integrating SimpleMachines Forum into cake

2011-06-06 Thread Miles J
Just don't include the Session component.

On Jun 3, 8:57 pm, poots  wrote:
> Hello,
> I'm trying to disable cakephp sessions as outlined here:
>
> http://bakery.cakephp.org/articles/dirhauge/2007/10/31/cakephp-smf
>
> However, I think the post is so outdated that the code where he says
> to disable cakephp sessions doesn't exist any longer.  So how do I
> disable cakephp sessions?
>
> Also, after pasting in that new init function, I get this error:
>
> Fatal error: Call to undefined method Component::__loadComponents()
> in /home/username/public_html/cake/libs/controller/component.php on
> line 75
>
> Does anybody know of any updated posts regarding smf and cakephp
> integration?
>
> Any help would be appreciated.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: why i use before save for save datetime in filed created and modified

2011-06-03 Thread Miles J
Do nothing, modified/created will automatically be added without you
doing anything.

On Jun 3, 6:25 pm, taqman filler  wrote:
> I follow in cake manual
> I'm newbie .what should I do
>
> 2011/6/4 Miles J 
>
>
>
>
>
>
>
> > Like euromark said, Cake will automatically set the created/modified
> > timestamps for you.
>
> > On Jun 3, 9:46 am, euromark  wrote:
> > > you shouldnt be messing with created and modified in the first place
> > > cake will take care of that for you.
>
> > > On 3 Jun., 16:59, taq  wrote:
>
> > > > the two field have same value
>
> > > > function beforeSave() {
> > > >         if (!empty($this->data['Myprofile']['created']) && !
> > > > empty($this->data['Myprofile']['modified'])) {
> > > >             $this->data['Myprofile']['created'] =
> > $this->dateFormatBeforeSave($this->data['Myprofile']['created']);
>
> > > >             $this->data['Myprofile']['modified'] =
> > $this->dateFormatBeforeSave($this->data['Myprofile']['modified']);
>
> > > >         }
> > > >         return true;
> > > >     }
>
> > > >http://upic.me/show/24867380
>
> > > > thank
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: why i use before save for save datetime in filed created and modified

2011-06-03 Thread Miles J
Like euromark said, Cake will automatically set the created/modified
timestamps for you.

On Jun 3, 9:46 am, euromark  wrote:
> you shouldnt be messing with created and modified in the first place
> cake will take care of that for you.
>
> On 3 Jun., 16:59, taq  wrote:
>
>
>
>
>
>
>
> > the two field have same value
>
> > function beforeSave() {
> >         if (!empty($this->data['Myprofile']['created']) && !
> > empty($this->data['Myprofile']['modified'])) {
> >             $this->data['Myprofile']['created'] = 
> > $this->dateFormatBeforeSave($this->data['Myprofile']['created']);
>
> >             $this->data['Myprofile']['modified'] = 
> > $this->dateFormatBeforeSave($this->data['Myprofile']['modified']);
>
> >         }
> >         return true;
> >     }
>
> >http://upic.me/show/24867380
>
> > thank

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Caching

2011-05-31 Thread Miles J
Why not just cache your data instead of the view? Caching the view is
pretty much just stepping in its place.

On May 31, 10:24 am, dreamingmind  wrote:
> Jeremy,
>
> Yes, another layer... seems a bit crazy. It looks like their may be
> more bits and pieces of unique code sprinkled into your pages than I
> imagined. None the less, a couple more thoughts?
>
> - A new route could override the basic controller/action/params
> pattern and funnel everything to your accumulator controller/action
> while still passing along the controller/action/params that are needed
> to fully inform the process.
> - Or maybe your component just needs to be extended a bit to do the
> necessary additional portioning-out of tasks
>
> Either way seems in line with cake philosophy.
>
> - I've had some success with shipping html into php's XML/DOM
> manipulators 
> (http://us.php.net/manual/en/refs.xml.phphttp://us.php.net/manual/en/domdocument.loadhtml.php)
>  and that has
> sometimes made it very easy to swap an entire div in or out of a page.
> It's also given me ways of walking through the DOM in php to make all
> sorts of fussy page tweaks. This just moves the javascripty way
> manipulating pages into your component, action or helper.
> - Possibly a final helper could be fed the cached and dynamic chunks
> for assembly into your final cach-namic page. That would be a pretty
> cake-y way to go.
>
> I'm excited about this plan! Especially since I don't have to write
> it!
>
> Don
>
> On May 31, 8:54 am, Jeremy Burns | Class Outfit
>
>
>
>
>
>
>
>  wrote:
> > Hmmm...nice thinking and I appreciate your reply, but it sounds like it's 
> > derailing Cake somehow. This happens on every page view so I'd effectively 
> > be putting another layer in there.
>
> > A bit more background...
>
> > The component scans $this->params and takes into account a number of 
> > factors like is the user logged in, are they an administrator, do they 
> > perform some other sort of role, where are they in the system, what menu 
> > items should have the 'selected' class and so on. It produces a keyed array 
> > (e.g. main, sub-1, sub-2, user [log in/log out/logged in as etc] and so 
> > on). The array is passed to the view as a variable. The default.ctp layout 
> > contains an element that parses each key and renders output.
>
> > Currently it's called in app_controller/beforeRender() but this is now 
> > being bypassed when the view is cached. It is, by it's nature, very 
> > dynamic. It can't easily be created in full in advance and placed in 
> > session because, for example, a user could log in and then log out.
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.com
> > (t) +44 (0) 208 123 3822
> > (m) +44 (0) 7973 481949
> > Skype: jeremy_burnshttp://www.classoutfit.com
>
> > On 31 May 2011, at 15:58, dreamingmind wrote:
>
> > > Jeremy,
>
> > > I don't know details of how to accomplish this, but it seems like
> > > you're going to have to call another non-cached action instead of the
> > > action you want. It will:
>
> > > - call the navigation engine to get an html fragment of your menus
> > > - call the desired action and get the page rendering
> > > - plug the menus into the page and send it to the browser
>
> > > or
>
> > > - send the menu out as a string that javascript can insert in the page
> > > once it loads
>
> > > Does this seem possible?
>
> > > Regards,
> > > Don
>
> > > On May 31, 5:44 am, Jeremy Burns  wrote:
> > >> I've raised a similar question before but got no responses, so I'll
> > >> try something more specific.
>
> > >> I have an application that is pretty dynamic. With no caching turned
> > >> on there is a lag of around 2 seconds before anything happens, and
> > >> then it all zips in really quickly. If I blanket enable view caching
> > >> (enabling cache in core.php, adding the Cache helper to app_controller
> > >> and setting cacheAction to +1hour) the lag disappears, response is
> > >> fantastic but the results are (understandably) terrible as nothing is
> > >> dynamic.
>
> > >> If I move the cache setting from app_controller into specific actions
> > >> I start to get better results. It's a pretty big app, so that's going
> > >> to take a lot of time and testing to do correctly. However, I have a
> > >> particular problem that I need to solve before I put in the effort.
>
> > >> I have a navigation component that reads $this->params, sets up some
> > >> variables that are passed through the controller and rendered in an
> > >> element (that also has a nested element):
>
> > >> function beforeRender() {
> > >>             $this->set('menus', $this->Navigation->menus($this->params));
>
> > >> I have placed  blocks in the elements.
>
> > >> Reading the Cake on line book:
> > >> "It should be noted that once an action is cached, the controller
> > >> method for the action will not be called - otherwise what would be the
> > >> point of caching the page. Therefore, it is not possible to wrap
> > >>   around var

Re: Error: Database table acos for model Aco was not found.

2011-05-31 Thread Miles J
Uncomment out the Configure ACL calls in core.php.

On May 30, 9:12 pm, 8vius  wrote:
> ShadowCross your solution worked, I seem to have forgotten those
> permissions to the DB user and now it all works. Thank you
>
> On May 30, 7:01 pm, ShadowCross  wrote:
>
>
>
>
>
>
>
> > One of the troubleshooting steps I take whenever I have this error on
> > a project is to log onto the database using the same connection info
> > as in my database.php file.  The screen shot of MySQLWorkbench
> > indicates a connection using 'root', which can see all the tables in
> > all the databases; the screen shot of the PHPMyAdmin session seems to
> > also be from the 'root' user perspective.  It might be as simple as
> > granting user fonyk_db insert/update/delete privileges to the acos
> > table in the fonyk_db schema.
>
> > On May 26, 9:11 pm, 8vius  wrote:
>
> > > Hey all, I'm new to CakePHP and I'm using it at work. I have a Mac
> > > running Mac OS X Leopard at work as well as at home and a PC at work
> > > as well.
>
> > > I have the project I'm currently working on set up on all 3, it works
> > > fine at my work computers but on my home Mac I get the error in the
> > > title. The project is on SVN so I just checked it out ran the SQL
> > > script for my DB schema and set up the same user I have in my work DB
> > > and it will not work still.
>
> > > I also cleared out the cache folders as suggested in other posts with
> > > a similar problem and it still won't work.
>
> > > Obviously I have checked the database table and it is present in my
> > > DB. Anyone have any other clues as to what might be happening?
>
> > > SCREENSHOTS:
>
> > > Error Screen:http://yfrog.com/hsefg1p
>
> > > CakePHP database.php:http://yfrog.com/h3l1t4p
>
> > > DB tables:http://yfrog.com/h0v3ajp
>
> > > DB privileges:http://yfrog.com/h0eu71p

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


MySQL errors within error.log

2011-05-21 Thread Miles J
So lately I have been getting quite a few MySQL errors in my tmp/
error.log. I went through a lot of my code and made sure I wasn't
doing anything wrong, still happening. Most of the errors are the
following:

2011-05-19 22:57:42 Warning: Warning (2): mysqli_query() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 115]

2011-05-19 22:57:42 Warning: Warning (2): mysqli_errno() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 214]

2011-05-19 22:57:42 Warning: Warning (2): array_keys() expects
parameter 1 to be array, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo_source.php, line 1953]

2011-05-19 22:57:42 Warning: Warning (2): Invalid argument supplied
for foreach() in [/var/www/cake/cake/libs/model/datasources/dbo/
dbo_mysql.php, line 127]

And here are lines 115 and 214 from dbo_mysqli.php

115: return mysqli_query($this->connection, $sql);
214: if (mysqli_errno($this->connection)) {

Now, does anybody know why $this->connection would actually be a
boolean instead of the MySQLi object? I am a bit lost on why that is
happening.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Load model or component under a different name

2011-05-20 Thread Miles J
Instantiate them separately, while one uses the controller property.

$model = ClassRegistry::init('Email');

or

$email = new EmailComponent();

On May 20, 8:32 am, dreamingmind  wrote:
> I think you could do this with the Model alias 
> property:http://api13.cakephp.org/class/model
>
> But that would let you use a different name for your model rather than
> the component.
>
> Don
>
> On May 20, 8:17 am, Matthias 
> wrote:
>
>
>
>
>
>
>
> > Hi,
> > I am about to use the email component, which is then accessible in the
> > controller through $this->Email. For validating the form I created a
> > model with the same name "Email", so it will also be accessed as 
> > $this->Email. I like both names, so I would like to keep them. Is there a
>
> > way to load one of these (preferably the component) under a different
> > name? So I could access the comp. e.g. via $this->EmailComponent?
>
> > Or how do you validate your emails?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake vs other frameworks benchmarks

2011-05-20 Thread Miles J
The automagic is the slow part in my opinion.

On May 19, 1:08 am, "Bogdan I. Bursuc" 
wrote:
> Plus there is the features a framework can offer. If a framework has 3 classes
> don't think it helps u that much. But a framework like Cake which has a lot of
> automagic which if you understand is very usefull. Might speed things up.
>
> --
> Thanks,
> Bogdan Bursuc!
>
>
>
>
>
>
>
> > I also just read the summary:
>
> > Final Advice: There is more to consider than speed when selecting a PHP
> > framework; other factors such as security, ease of installation and
> > database support have to be examined as well. Other frameworks may be
> > slower but have greater and wider community support, in case you have some
> > trouble with the framework there are lots of users that could help who
> > have working experience with that framework. This is true with CakePHP,
> > Symfony and Zend framework, all of which are very popular among PHP
> > developers.
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.com
> >http://www.classoutfit.com
>
> > On 19 May 2011, at 08:56, Jeremy Burns | Class Outfit wrote:
> > > Put Michael Schumacher at the wheel of a Skoda and I bet he could beat me
> > > in Ferarri. Benchmarks are mildy interesting, at best.
>
> > > Jeremy Burns
> > > Class Outfit
>
> > > jeremybu...@classoutfit.com
> > >http://www.classoutfit.com
>
> > > On 19 May 2011, at 08:53, Bogdan I. Bursuc wrote:
> > >> I've been using Cake 2.0 since 2.0-dev and I say that we should wait for
> > >> the final release and then see the benchmarks. It's way faster than
> > >> 1.3. And with so many new cool features.
>
> > >> --
> > >> Thanks,
> > >> Bogdan Bursuc!
>
> > >>> On May 19, 7:30 am, mutabor  wrote:
> >  Hi guys,
>
> >  Lately, I came across another benchmark of popular PHP frameworks:
>
> > http://www.devshed.com/c/a/PHP/7-PHP-Frameworks-Tested-For-Speed/2/
>
> >  This is approx. 3rd or 4th benchmark of this type that I came across
> >  during last couple of month and in every benchmark Cake shows pretty
> >  poor results.
>
> >  As a head of a company that specializes in CakePHP, I am very worried
> >  about Cake's future. Because even all of these benchmarks are wrong /
> >  have incorrect results, our customers still trust them and I start
> >  hearing "Anything, but not Cake, please, look at this
> >  benchmark seems it's not a good piece of software" from our
> >  customers.
>
> > >>> The usual problem with these benchmarks - is they don't set cake up
> > >>> correctly in the first place (they use it out of the box; cake ships
> > >>> in debug mode, with the session enabled etc.). And correcting that is
> > >>> in the hands of the person publishing their "results".
>
> > >>> But: How many of your clients use hello world apps?
>
> >  Something should be done, even if there is no opportunity to increase
> >  the speed, I guess Cake should apply some kind of PR actions :)
>
> > >>> The best thing that could be done in your eyes is for someone to
> > >>> dedicate a bit of time making cake faster - if only you had a few
> > >>> developers you could call upon to do that ... :)
>
> > >>> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Am I Violating MVC?

2011-05-18 Thread Miles J
I suppose the only upside of a helper is not having to place it
everywhere its needed in the controllers, just call the helper :P

On May 18, 1:01 pm, Jeremy Burns | Class Outfit
 wrote:
> Doesn't that just move it? If it's that static (e.g. 'm' => 'Male', 'f' => 
> 'Female') putting it in an array variable seems fine to me.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 18 May 2011, at 20:41, Miles J wrote:
>
>
>
>
>
>
>
> > I guess it depends what the options array is used for? If it is never
> > associated with a model, than you can create a helper.
>
> > $this->Helper->getOptions();
>
> > On May 18, 11:46 am, Jason Mitchell 
> > wrote:
> >> I have in a controller an array containing data used on the view to 
> >> populate
> >> a drop down. I put it on the controller, so the array could be used by
> >> multiple views associated with that controller (create, edit). 
> >> Additionally,
> >> it means that if I do ever have to change it, I just have to change it once
> >> (yup, lazy).
>
> >> Because the data is relatively static, and is used in only isolated
> >> instances, it didn't seem to be worth the effort of creating a model for
> >> that data, and establishing a relationship between models. And, putting it
> >> on the controller, worked.
>
> >> Admittedly, I'm new to MVC, but this really doesn't seem to jive 
> >> definition.
> >> Am I doing something wrong?  If so, how would one but this on the model,
> >> short of some sort of association with another model?
>
> >> --
> >> J. Mitchell
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Am I Violating MVC?

2011-05-18 Thread Miles J
I guess it depends what the options array is used for? If it is never
associated with a model, than you can create a helper.

$this->Helper->getOptions();

On May 18, 11:46 am, Jason Mitchell 
wrote:
> I have in a controller an array containing data used on the view to populate
> a drop down. I put it on the controller, so the array could be used by
> multiple views associated with that controller (create, edit). Additionally,
> it means that if I do ever have to change it, I just have to change it once
> (yup, lazy).
>
> Because the data is relatively static, and is used in only isolated
> instances, it didn't seem to be worth the effort of creating a model for
> that data, and establishing a relationship between models. And, putting it
> on the controller, worked.
>
> Admittedly, I'm new to MVC, but this really doesn't seem to jive definition.
> Am I doing something wrong?  If so, how would one but this on the model,
> short of some sort of association with another model?
>
> --
> J. Mitchell

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: MultiUpload

2011-05-17 Thread Miles J
My plugin supports multiple file uploads as well as a rollback feature
incase one fails.

https://github.com/milesj/cake-uploader/blob/master/controllers/components/uploader.php#L1150

On May 17, 2:51 pm, dreamingmind  wrote:
> Juliano,
>
> Though I didn't research deeply, a quick test the other day showed a
> file field in my browser won't allow multiple selections. So if that's
> what you want, it may be a problem.
>
> This 
> thread:http://groups.google.com/group/cake-php/browse_thread/thread/f9f3b327...
>
> has some discussion of an ajax approach that might work for you. One
> response deals specifically with uploading images.
>
> Regards,
> Don
>
> On May 17, 11:09 am, Juliano Bordignon  wrote:
>
>
>
>
>
>
>
> > Good afternoon
>
> > I need a multiupload component (i working with img) for a site I'm
> > developing, but looked much on the web at Bakey, and found nothing.
>
> > anyone have a link to any one component that does that.
>
> > thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: HTML native or CakePHP elements?

2011-05-17 Thread Miles J
HTML > CakePHP.

There are only a few instances where you use the HtmlHelper or
FormHelper.

1 - To generate forms.
2 - To create anchor links.
3 - To build HTML elements within helpers.

On May 17, 7:29 am, Tilen Majerle  wrote:
> It's true, that if you use cake's HtmlHelper::tag method is slower than
>  but i prefer to use cake's htmlhelper...like u said...nice
> for eyes :)
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2011/5/17 Flávio Ricardo 
>
>
>
>
>
>
>
> > Sometimes I think about the right way or the best way to put HTML elements
> > on screen. The normal way is use native HTML elements like some
> > text and I think this is more than faster use  > $html->tag('legend', 'some text'); ?>.
>
> > But, for patterns use just elements generated by CakePHP is nice for our
> > eyes. :-D So, my question is: whats the best way?
>
> > Sorry for my poor english. Best regards.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: query inside model

2011-05-14 Thread Miles J
You are getting that error because it seems like your model is not
found. Its using the AppModel in its place. Try debugging it.

debug($this->Workpiece);

On May 14, 7:13 pm, dreamingmind  wrote:
> erikober,
>
> I wonder if there is a syntax error higher up in the code. Getting
> your function name returned as bad SQL is weird... but not unusual.
> I've definitely seen it more than once in my pages.
>
> Anyhoo... this is such a simple query, GO NATIVE! In you're Model,
> try:
>
> $this->find('all', array(
>   'conditions' => array('WorkPiece.work_id' => 3),
>   'order' => 'adorder'
> );
>
> Regards,
> Don
>
> On May 14, 7:09 am, erikober  wrote:
>
>
>
>
>
>
>
> > Bogdan, thanks for the reply.
>
> > I agree...
> > Probably should rethink all of it to avoid any custom queries.
> > Still curious why it isn't working.
>
> > Here is more info:
>
> > $sql    =       "returnAdvertising"
> > $error  =       "1064: You have an error in your SQL syntax; check the 
> > manual
> > that corresponds to your MySQL server version for the right syntax to
> > use near 'returnAdvertising' at line 1"
> > $out    =       null
>
> > [CORE/cake/libs/model/datasources/dbo_source.php, line 681]
>
> > thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: localization and cache

2011-05-12 Thread Miles J
I dont know for sure, but a cache is created for the language you are
currently browsing on. If I switch from english to german, it will
cache another set for the german strings if german hasn't been cached
yet.

On May 12, 6:02 am, Lorenzo Bettini  wrote:
> Hi
>
> I started to localize my application adding a new language (I've always
> used _( )) in my code.
>
> If cache is enabled, and the language is changed, those strings are not
> translated again, am I right?
>
> What is then the right way to make language switch in the presence of
> localization?
>
> many thanks in advance
>         Lorenzo
>
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Security::cipher not compatible cross operating systems

2011-05-12 Thread Miles J
Do you have suhosin installed? I ran into problems with that.

http://milesj.me/blog/read/security-cipher-suhosin

On May 11, 11:33 pm, Simon Males  wrote:
> Hello,
>
> I'm migrating some infrastructure from 32bit CentOS PHP 5.2 to 64bit
> Ubuntu PHP 5.3.
>
> Unfortunately I've discovered a cipher encrypted by the Ubuntu systems
> cannot decrypted by the CentOS systems.
>
> Is there a work around for this?
>
> --
> Simon Males

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Joining on something other than _id

2011-05-12 Thread Miles J
Why would profile be related to a post? The relationship is the user.

On May 12, 9:09 am, dreamingmind  wrote:
> With the setup you have, wouldn't the profile come along for the ride
> on your finds? I would expect to be able to get a returned array like
> this:
>
> array(
> [0]
>   Post => post fields
>   User => user fields
>                 Profile => profile fields
> [1]
>   Post => post fields
>   User => user fields
>                 Profile => profile fields
>
> Regards,
> Don
>
> On May 12, 8:57 am, amiable_indian  wrote:
>
>
>
>
>
>
>
> > I am having tough time trying to join two table which are not connected
> > directly. For example:
>
> > User hasOne Profile
> > User hasMany Post
>
> > I want to join Post and Profile (based on user_id which is common) and tried
> > doing couple of things but none worked.
>
> > * Firstly, I tried $hasOne in Post model with ( 'foriegnKey' => false,
> > 'condition' => 'Post.user_id = Profile.user_id' ). That didn't worked.
> > * Secondly, I tried using putting 'joins' in $conditions for
> > $this->Post->find(...). That didn't worked either.
>
> > Last option would be use raw_query, but I am trying to avoid using that.
>
> > Any suggestions?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to control the content (text) to display in a $form->input ?

2011-05-11 Thread Miles J
Theres some magic that happens. If you have an ID field (user_id), it
will usually be a select. If you set a variable called $users to the
view, that input field will populate with that data.

You can overwrite that by just placing array('type' => 'text') as the
second argument of the input method.

On May 11, 10:54 am, Alonso  wrote:
> Hi, folks.
> I'm starting with CakePHP and after reviewing this tutorial 
> (http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
> )  and also after having  used the "cake bake" command to generate my
> models,
> controllers and views , everything is fine, but when I visit the
> Post's add view (views \ posts
> \ add.php), I find that instead of showing a input text for the
> username, it shows a select with all the usernames.
>
> this is the line in  the Post's add view that show the select.
>
>     echo $this->Form->input('user_id');
>
> Although I know how to display only the username of the currently
> logged-in user,  I don't know how to control the content to show in
> $this->Form->input()  because if I use a variable that is not part of
> the "Post" model , it's shown , but as the label for the input.
>
> Have you any idea how to solve this??

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake Coding Standards from old trac wiki?

2011-05-03 Thread Miles J
Theres this: http://book.cakephp.org/view/901/CakePHP-Conventions

On May 3, 6:08 pm, Simon Males  wrote:
> Hi
>
> There was a really good document on the trac wiki, are they archived 
> somewhere?
>
> Cake Coding Standards 
> :https://trac.cakephp.org/wiki/Developement/CodingStandards
>
> --
> Simon Males

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Standard

2011-05-02 Thread Miles J
$this->Auth is an object, you can't have that return the users login
data.

On May 2, 3:29 am, AD7six  wrote:
> On May 2, 12:21 pm, Ryan Snowden  wrote:
>
> > ^
> > True.
>
> > Small gripe:
> > Although I admire Sessions, can CakePHP pick one method? Preferably
> > shorthand ie. $this->Auth. I know, I know...
>
> I don't, what do you mean

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validate from within a model

2011-04-28 Thread Miles J
You can also create the folders and make the writable before hand,
that way the file will always upload.

On Apr 28, 12:55 pm, cricket  wrote:
> On Thu, Apr 28, 2011 at 2:17 PM, func0der  wrote:
> > Can you explain that a bit more precise.
>
> http://php.net/manual/en/function.is-dir.phphttp://www.php.net/manual/en/function.is-writable.php
>
> I usually handle uploads on the controller/component side. Save your
> model record, get the new ID, save the file, update the record. You
> can leave out the initial save in some cases but you said that you're
> using the id for the file name so you'd need 2 saves.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validate from within a model

2011-04-28 Thread Miles J
Why don't you just validate that the destination folder exists and is
writable?

On Apr 28, 2:57 am, func0der  wrote:
> Okay.
>
> I'm doing it like this.
>
> I'm havin a new file uploaded.
> The file data, like mime type, name etc. will be saved in the db under
> the file id.
> I'm using that id as a filename for the files in my filesystem.
> So i need to first create a db record to use the id.
>
> Afterwards i'm trying to save the file.
> If for example the folder for the upload is not writable or i don't
> have the permission or any other case i can't figure out now happens,
> then i want to cancel the upload and delete the db record so i won't
> have 2 or more of the same file in the database.
>
> This user is getting an error message that something fails during the
> file upload and also i want to let the users know what they are
> supposed to do next.
>
> This is my intention.
>
> And i would never validate file uploads with javascripts because of 2
> reasons:
> First, i don't know how
> Second, i know enough to know that this kind of validation wouldn't be
> save enough ^^
>
> Nothing against you, but js alone isn't the key.
>
> On 27 Apr., 23:54, Miles J  wrote:
>
>
>
>
>
>
>
> > You dont need to use validates(), just set an error manually.
>
> > $this->invalidate('fields', 'Error message.');
>
> > Also, your approach is still wrong IMO. You should be doing all error
> > checking before any save functionality is triggered. In what scenario
> > will the image NOT copy/transfer? I have yet to ever run into that
> > problem.
>
> > On Apr 27, 12:31 pm, func0der  wrote:
>
> > > okay...i think i got it.
>
> > > It is part of the MVC pattern, isn't it?
>
> > > The model is NOT connected to the view or the helpers. These two are
> > > getting their data or the invalid error messages by the controller.
>
> > > Am i right here?
>
> > > On 27 Apr., 21:00, func0der  wrote:
>
> > > > I can re-save and delete, so why i shouldn't be able to revalidate?
>
> > > > The error message is also in the "validationErrors" variable but while
> > > > the output of the form there is no error message.
> > > > But why?
>
> > > > On 27 Apr., 20:38, Miles J  wrote:
>
> > > > > You can't validates() something after the model save has already
> > > > > happened. Use a behavior for validation or use my plugin.
>
> > > > >https://github.com/milesj/cake-uploader
>
> > > > > And an example model on how to use it.
>
> > > > >https://github.com/milesj/cake-uploader/blob/master/tests/models/uplo...
>
> > > > > On Apr 27, 11:18 am, func0der  wrote:
>
> > > > > > Hey guys,
>
> > > > > > i'm having a file upload here.
> > > > > > I'm using "afterSave" to place the uploaded file in the filesystem.
>
> > > > > >         function afterSave($created){
> > > > > >                 //get the entry id
> > > > > >                 $this->data['DataFile']['id'] = 
> > > > > > $this->getInsertId();
> > > > > >                 if(!$this->saveDataFile($this->data)){
> > > > > >                         
> > > > > > $this->delete($this->data['DataFile']['id']);
> > > > > >                         $this->data['DataFile']['data_file'] = 
> > > > > > array();
> > > > > >                         $this->validates();
> > > > > >                 }
> > > > > >         }
>
> > > > > > "saveDataFile" is a function which tries to places the uploaded file
> > > > > > in the file system and returns false in case of copy fails.
>
> > > > > > If the copy should fail i delete the record from the database and 
> > > > > > set
> > > > > > the "data_file" index which normally cotains the uploaded file
> > > > > > information to an empty array. This is because i want the validation
> > > > > > to fail so the file upload field gets an error message while
> > > > > > rendering.
>
> > > > > > The problem now is that the upload form does NOT! contain the
> > > > > > validation error message for that particular field.
>
> > > > > > Do you know what i am doing wrong?
>
> > > > > > Greetings
> > > > > > func0der

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validate from within a model

2011-04-27 Thread Miles J
You dont need to use validates(), just set an error manually.

$this->invalidate('fields', 'Error message.');

Also, your approach is still wrong IMO. You should be doing all error
checking before any save functionality is triggered. In what scenario
will the image NOT copy/transfer? I have yet to ever run into that
problem.

On Apr 27, 12:31 pm, func0der  wrote:
> okay...i think i got it.
>
> It is part of the MVC pattern, isn't it?
>
> The model is NOT connected to the view or the helpers. These two are
> getting their data or the invalid error messages by the controller.
>
> Am i right here?
>
> On 27 Apr., 21:00, func0der  wrote:
>
>
>
>
>
>
>
> > I can re-save and delete, so why i shouldn't be able to revalidate?
>
> > The error message is also in the "validationErrors" variable but while
> > the output of the form there is no error message.
> > But why?
>
> > On 27 Apr., 20:38, Miles J  wrote:
>
> > > You can't validates() something after the model save has already
> > > happened. Use a behavior for validation or use my plugin.
>
> > >https://github.com/milesj/cake-uploader
>
> > > And an example model on how to use it.
>
> > >https://github.com/milesj/cake-uploader/blob/master/tests/models/uplo...
>
> > > On Apr 27, 11:18 am, func0der  wrote:
>
> > > > Hey guys,
>
> > > > i'm having a file upload here.
> > > > I'm using "afterSave" to place the uploaded file in the filesystem.
>
> > > >         function afterSave($created){
> > > >                 //get the entry id
> > > >                 $this->data['DataFile']['id'] = $this->getInsertId();
> > > >                 if(!$this->saveDataFile($this->data)){
> > > >                         $this->delete($this->data['DataFile']['id']);
> > > >                         $this->data['DataFile']['data_file'] = array();
> > > >                         $this->validates();
> > > >                 }
> > > >         }
>
> > > > "saveDataFile" is a function which tries to places the uploaded file
> > > > in the file system and returns false in case of copy fails.
>
> > > > If the copy should fail i delete the record from the database and set
> > > > the "data_file" index which normally cotains the uploaded file
> > > > information to an empty array. This is because i want the validation
> > > > to fail so the file upload field gets an error message while
> > > > rendering.
>
> > > > The problem now is that the upload form does NOT! contain the
> > > > validation error message for that particular field.
>
> > > > Do you know what i am doing wrong?
>
> > > > Greetings
> > > > func0der

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validate from within a model

2011-04-27 Thread Miles J
You can't validates() something after the model save has already
happened. Use a behavior for validation or use my plugin.

https://github.com/milesj/cake-uploader

And an example model on how to use it.

https://github.com/milesj/cake-uploader/blob/master/tests/models/upload.php

On Apr 27, 11:18 am, func0der  wrote:
> Hey guys,
>
> i'm having a file upload here.
> I'm using "afterSave" to place the uploaded file in the filesystem.
>
>         function afterSave($created){
>                 //get the entry id
>                 $this->data['DataFile']['id'] = $this->getInsertId();
>                 if(!$this->saveDataFile($this->data)){
>                         $this->delete($this->data['DataFile']['id']);
>                         $this->data['DataFile']['data_file'] = array();
>                         $this->validates();
>                 }
>         }
>
> "saveDataFile" is a function which tries to places the uploaded file
> in the file system and returns false in case of copy fails.
>
> If the copy should fail i delete the record from the database and set
> the "data_file" index which normally cotains the uploaded file
> information to an empty array. This is because i want the validation
> to fail so the file upload field gets an error message while
> rendering.
>
> The problem now is that the upload form does NOT! contain the
> validation error message for that particular field.
>
> Do you know what i am doing wrong?
>
> Greetings
> func0der

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Socket Server

2011-04-26 Thread Miles J
What do you mean by socket server. Something like a REST system?

On Apr 26, 3:07 am, Dominik Gajewski 
wrote:
> Hi
> Yes, it is possible use sockets in cake, here you are cake socket api
>
> http://api.cakephp.org/class/http-socket
>
> I hope that will help you to solve your problem
>
> 2011/4/25 carlosrg :
>
>
>
>
>
>
>
>
>
> > It's possible to create a server socket with CakePHP?
>
> > I know about HttpSocket but I don't know the way to create a server
> > socket with this calss.
>
> > I'm developing a web where two different users give a answer and i
> > need to check the response to each other.
>
> > Thanks a lot!
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php
>
> --
> Pozdrawiam
> Dominik Gajewski

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: if/else vs. try/catch

2011-04-22 Thread Miles J
They are completely different in funtionality.

if/else determines which blocks of code to execute according to
specific conditions, while a try/catch monitors to see if an error
occurred and to exit out of the current execution block.

On Apr 22, 9:51 am, cricket  wrote:
> On Fri, Apr 22, 2011 at 11:06 AM, brandon buster  
> wrote:
> > Not sure if this is a dumb question or not, but it seems to me these
> > two techniques could be used interchangeably to test for and handle
> > errors.
>
> > Are there any benefits of using one over the other, or scenarios in
> > which one should be used over the other?
>
> They're not interchangeable. You can't catch an error in an else block.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: return Json values cakephp 1.3.8

2011-04-22 Thread Miles J
This:

$this->set('provinces', $this->City->Province->find('list',
array('conditions' =>
 array('province.country_id' =>
$this->params['url']['countryId']),
'recursive' => -1)));
echo json_encode($provinces);
}

Should be:

echo json_encode($this->City->Province->find('list',
array('conditions' => array('province.country_id' => $this-
>params['url']['countryId']),'recursive' => -1)));

On Apr 22, 9:55 am, cricket  wrote:
> On Fri, Apr 22, 2011 at 2:17 AM, pedro sastre  wrote:
> > I have included the json_encode echo ($ provinces) and the action continues
> > without returning kos edit json values. Add action in l if I return the
> > values.
>
> > my controller
>
> > 
> > class CitiesController extends AppController {
>
> >     var $name = 'Cities';
> >     var $components = array('RequestHandler');
>
> >     public function obtener_provincias() {
> >     if (!empty($this->data['City']['province_id'])){
> >   $this->data = "";
> >  if ($this->RequestHandler->isAjax()) {
> >     $this->set('provinces', $this->City->Province->find('list',
> >     array('conditions' =>
> >  array('province.country_id' =>
> > $this->params['url']['countryId']),
> >     'recursive' => -1)));
> >     echo json_encode($provinces);
>
> $provinces does not exist. You're setting a view var named $province.
> But this isn't the view. Either assign the value of find('list') to
> $provinces instead of calling set() or take out the echo and create a
> view template and use an AJAX layout.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: return Json values cakephp 1.3.8

2011-04-21 Thread Miles J
Just echo the json in the action.

http://milesj.me/blog/read/63/Doing-AJAX-Calls-In-CakePHP-Part-2-_-The-Controller

On Apr 21, 8:57 am, pedrosas  wrote:
> I need help, I have a script for dependent selects, type country,
> state, city. In the view of add, works perfectly, but in the edit
> view, the same code does not work. Firebug seen, does not return JSON
> data.
> The only difference I see is in the Data variable in the edit view has
> values
> Anyone have the same problem?
> That solution can be?
>
> Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Caching

2011-04-11 Thread Miles J
Do you have an example of how this model would work?

It seems that this point you shouldn't be using models/relations and
should use some sort of API.

On Apr 11, 10:59 am, Jeremy Burns | Class Outfit
 wrote:
> Correct. This is a question about CakePHP specific caching mechanisms and how 
> best to deploy them in a model where the data is quite fluid.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 11 Apr 2011, at 18:06, Miles J wrote:
>
>
>
>
>
>
>
> > I am guessing you are talking about model caches and not data caches,
> > correct?
>
> > On Apr 11, 7:55 am, Jeremy Burns  wrote:
> >> Any takers on this?
>
> >> On Mar 28, 11:01 am, Jeremy Burns  wrote:
>
> >>> I'm working on a site that is very data intensive, has hardly any
> >>> images and is light on static content. Its key functionality is close
> >>> to a that of a search engine where customers can run searches against
> >>> a business database. I'm struggling to get my head round a 
> >>> sensiblecachingpolicy- a change in one model can impact many others as 
> >>> there
> >>> are a lot of model relationships. Does anyone have any good resources
> >>> I can check for deciding the rightcachingstrategy - if indeed one is
> >>> needed?
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Caching

2011-04-11 Thread Miles J
I am guessing you are talking about model caches and not data caches,
correct?

On Apr 11, 7:55 am, Jeremy Burns  wrote:
> Any takers on this?
>
> On Mar 28, 11:01 am, Jeremy Burns  wrote:
>
>
>
>
>
>
>
> > I'm working on a site that is very data intensive, has hardly any
> > images and is light on static content. Its key functionality is close
> > to a that of a search engine where customers can run searches against
> > a business database. I'm struggling to get my head round a 
> > sensiblecachingpolicy- a change in one model can impact many others as there
> > are a lot of model relationships. Does anyone have any good resources
> > I can check for deciding the rightcachingstrategy - if indeed one is
> > needed?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how can i find out cakephp cache work fine?

2011-04-11 Thread Miles J
If those cache files exist, then yes cache is working.

On Apr 11, 12:58 am, hoss7  wrote:
> thanks
> i am see this folder(tmp\cache\persistent) i have many files
> for example in cake_code.dir_map
> i have this:
> 1302508471
> a:8:{s:44:"D:xampphtdocsHOOSBITv3cakephpcake\\\
> \libs";a:25:{i:0;s:44:"D:xampphtdocsHOOSBITv3\\\
> \cakephpcakelibs";i:1;s:50:"D:xampphtdocsHOOSBIT\\\
> \v3cakephpcakelibscache";i:2;s:55:"D:xampp\\\
> \htdocsHOOSBITv3cakephpcakelibscontroller";i:
> 3;s:66:"D:xampphtdocsHOOSBITv3cakephpcake\\\
> \libscontrollercomponents";i:4;s:48:"D:xampphtdocs\\\
> \HOOSBITv3cakephpcakelibslog";i:5;s:50:"D:xampp
> htdocsHOOSBITv3cakephpcakelibsmodel";i:6;s:
> 60:"D:xampphtdocsHOOSBITv3cakephpcakelibs\\
> \\modelbehaviors";i:7;s:62:"D:xampphtdocsHOOSBITv3\
> \\\cakephpcakelibsmodeldatasources";i:8;s:66:"D:\\\
> \xampphtdocsHOOSBITv3cakephpcakelibsmodel\\
> \\datasourcesdbo";i:9;s:49:"D:xampphtdocsHOOSBITv3\
> \\\cakephpcakelibsview";i:10;s:58:"D:xampphtdocs\\\
> \HOOSBITv3cakephpcakelibsviewelements";i:11;s:
> 64:"D:xampphtdocsHOOSBITv3cakephpcakelibs\\
> \\viewelementsemail";i:12;s:69:"D:xampphtdocs\\\
> \HOOSBITv3cakephpcakelibsviewelementsemail\
> \\\html";i:13;s:69:"D:xampphtdocsHOOSBITv3cakephp\\
> \\cakelibsviewelementsemailtext";i:14;s:56:"D:\\\
> \xampphtdocsHOOSBITv3cakephpcakelibsview\\\
> \errors";i:15;s:57:"D:xampphtdocsHOOSBITv3cakephp\\
> \\cakelibsviewhelpers";i:16;s:57:"D:xampphtdocs\\\
> \HOOSBITv3cakephpcakelibsviewlayouts";i:17;s:
> 63:"D:xampphtdocsHOOSBITv3cakephpcakelibs\\
> \\viewlayoutsemail";i:18;s:68:"D:xampphtdocsHOOSBIT
> v3cakephpcakelibsviewlayoutsemail\\\
> \html";i:19;s:68:"D:xampphtdocsHOOSBITv3cakephp\\\
> \cakelibsviewlayoutsemailtext";i:20;s:60:"D:\\\
> \xampphtdocsHOOSBITv3cakephpcakelibsview\\\
> \layoutsjs";i:21;s:61:"D:xampphtdocsHOOSBITv3\\\
> \cakephpcakelibsviewlayoutsrss";i:22;s:61:"D:\\\
> \xampphtdocsHOOSBITv3cakephpcakelibsview\\\
> \layoutsxml";i:23;s:55:"D:xampphtdocsHOOSBITv3\\\
> \cakephpcakelibsviewpages";i:24;s:59:"D:xampp\\\
> \htdocsHOOSBITv3cakephpcakelibsview\\\
> \scaffolds";}s:50:"D:xampphtdocsHOOSBITv3cakephp\\\
> \appcontrollers";a:2:{i:0;s:50:"D:xampphtdocsHOOSBIT\\\
> \v3cakephpappcontrollers";i:1;s:61:"D:xampphtdocs\\
> \\HOOSBITv3cakephpappcontrollerscomponents";}s:
> 44:"D:xampphtdocsHOOSBITv3cakephpapp\\\
> \views";a:16:{i:0;s:44:"D:xampphtdocsHOOSBITv3\\\
> \cakephpappviews";i:1;s:53:"D:xampphtdocsHOOSBIT\\\
> \v3cakephpappviewselements";i:2;s:59:"D:xampp\\\
> \htdocsHOOSBITv3cakephpappviewselements\\\
> \email";i:3;s:64:"D:xampphtdocsHOOSBITv3cakephp\\\
> \appviewselementsemailhtml";i:4;s:64:"D:xampp\\\
> \htdocsHOOSBITv3cakephpappviewselements\\\
> \emailtext";i:5;s:51:"D:xampphtdocsHOOSBITv3\\\
> \cakephpappviewserrors";i:6;s:52:"D:xampphtdocs\\\
> \HOOSBITv3cakephpappviewshelpers";i:7;s:52:"D:\\\
> \xampphtdocsHOOSBITv3cakephpappviews\\\
> \layouts";i:8;s:58:"D:xampphtdocsHOOSBITv3cakephp\\
> \\appviewslayoutsemail";i:9;s:63:"D:xampphtdocs\\\
> \HOOSBITv3cakephpappviewslayoutsemail\\\
> \html";i:10;s:63:"D:xampphtdocsHOOSBITv3cakephp\\\
> \appviewslayoutsemailtext";i:11;s:55:"D:xampp\\\
> \htdocsHOOSBITv3cakephpappviewslayouts\\\
> \js";i:12;s:56:"D:xampphtdocsHOOSBITv3cakephp\\\
> \appviewslayoutsrss";i:13;s:56:"D:xampphtdocs\\\
> \HOOSBITv3cakephpappviewslayoutsxml";i:14;s:
> 50:"D:xampphtdocsHOOSBITv3cakephpappviews\\
> \\pages";i:15;s:54:"D:xampphtdocsHOOSBITv3cakephp\\
> \\appviewsscaffolds";}s:49:"D:xampphtdocsHOOSBIT\\\
> \v3cakephpcakelibsview";a:16:{i:0;s:49:"D:xampp\\\
> \htdocsHOOSBITv3cakeph

Re: Problem with importing a controller

2011-04-07 Thread Miles J
What is your reasoning for importing another controller? You should
never need to do this.

On Apr 7, 3:30 am, Jeremy Burns | Class Outfit
 wrote:
> Are you doing this inside a function? Can we see some code?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 7 Apr 2011, at 11:29, Shashank wrote:
>
>
>
>
>
>
>
> > Hey Guys,
> > I am trying to import a controller into my another controller.
>
> > Say i am importing controller1 into my controller2 like ds:
>
> > App::import('Controller', 'Users');
>
> > after that when i am trying to instantiate it i am getting an error:
>
> > Parse error: syntax error, unexpected T_VARIABLE, expecting
> > T_FUNCTION
>
> > i am trying to instantiate it like ds:
>
> > $Users = new UsersController();
>
> > Can i know wat i am doing wrong??
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Memory Leak in Model::Save()

2011-04-07 Thread Miles J
@Alex - Yes you can have memory leaks in PHP.

http://www.google.com/search?q=memory+leaks+in+php&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

On Apr 7, 3:59 am, Alex Ciobanu  wrote:
> On 4/4/2011 6:38 PM, ProFire wrote:> I was very careful not to have any 
> memory leak.
>
> You don't control memory in PHP, you can't have memory 
> leaks.http://goo.gl/nm6OZ

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake core might benefit from some more developers helping out

2011-04-07 Thread Miles J
@keymaster - What exactly are you expecting Cake to become? Cake
pretty much already has a stable framework and feature list. I don't
see them putting in any new features in the future.

Most, if not all of their time is spent on bug fixing, patching and
preparing for Cake 2.0.

On Apr 7, 4:23 am, Jeremy Burns | Class Outfit
 wrote:
> I'm the same. I don't really feel experienced/qualified enough to go meddling 
> with the framework, but want to help if I can.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 7 Apr 2011, at 12:21, huoxito wrote:
>
>
>
>
>
>
>
> > I dont think cake development is based on the free time of one single 
> > person, for what i can see on github. But yes cake and every other 
> > framework might improve a lot with more developers joining the core team. I 
> > really wish i will fully understand how the framework work so i can begin 
> > to help as well.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: What's the deep difference between App::import and ClassRegistry::init?

2011-04-06 Thread Miles J
App::import() is basically a glorified file includer.

ClassRegistry::init() is a registry class and only works with models.
It internally calls App::import().

On Apr 6, 5:08 pm, adam_g2000  wrote:
> Hi Guys,
>
> Before continuing, I have a basic understanding of what they do (and
> their syntax), but have hit upon something I find strange, and
> worrying.
>
> I needed to import a foreign model into a controller and initially
> tried this:
>
> App::import('Model','Category');
> $cat = new Category();
> $cats = $cat->find('all', array('conditions' =>
> array('Category.status' => '1')));
> $this->set('categories', $cats);
>
> What I discovered when I tried to access the data in a view (and
> debugging) was that $categories['Category']['title'] did not work, it
> failed. Debugging showed me that in fact it was being returned in
> lowercase, so I'd have to use $categories['category']['title'] (note
> lowercase c). This wasn't acceptable as I wanted to reuse an *element*
> I'd created for the original Category controller set and views.
>
> So after some searching I discovered and tried this:
>
> $cat = ClassRegistry::init('Category');
> $cats = $cat->find('all', array('conditions' =>
> array('Category.status' => '1')));
> $this->set('categories', $cats);
>
> ...which worked perfectly, however I'm using Cake 1.3 and the entry
> for this indicates (though I'm not 100% sure on this) that App::import
> is preferred, and that ClassRegistry may be deprecated.
>
> So have I screwed up App::import? Can I get a sanity check on the
> code?
>
> Should I be concerned about using ClassRegistry::init?
>
> Thanks in advance for any pointers,
>
> Adam.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: You favorite IDE/ Dev Setup?

2011-04-06 Thread Miles J
nginx
php 5.3
netbeans
firefox
putty
git (tortoisegit)
notepad++
xampp

On Apr 6, 1:08 pm, Raul Mangolin  wrote:
> Slackware 13.1
> VIM
> GIT
> Apache/MySql
>
>
>
>
>
>
>
> On Wed, Mar 30, 2011 at 4:49 PM, Chris  wrote:
> > How do you develop for CakePHP? OS, Editor, control system, etc.?
> > Ubuntu 10.10
> > Geany
> > GIT
> > Apache/MySql
> > Bunch of Shell scripts
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake core might benefit from some more developers helping out

2011-04-06 Thread Miles J
Like Jose said, the community is welcome to fork the repo and patch
bugs themselves and submit them for approval.

Also, a lot of Cake work is going into 2.0, just watch the Github
stream.

On Apr 6, 3:17 pm, José Lorenzo  wrote:
> What do you have in mind to solve this? Would you like to jump into
> some tickets and start helping us out? :)
>
> On Apr 6, 12:51 pm, keymaster  wrote:
>
>
>
>
>
>
>
> > Judging from the lower activity in core development these last few months
> > (totally understandable given  family obligations), me thinks the cake
> > leadership might benefit from actively solicitating additional help.
>
> > Have a look at 
> > this:http://framework.zend.com/wiki/display/ZFDEV2/Component+Maintainers
>
> > It is the Zend framework's component maintainer's list. Each component has a
> > lead developer, as well as several developers/maintainers to assist. There
> > are over 50 developers contributing.
>
> > It is a similiar situation with Symfony2. Half of the updates in the last
> > couple of months were distributed by around a dozen people (fabien's
> > contribution was equal to the sum of all of their put together).
>
> > Unlike the other frameworks (Symfony, Zend), cake does not have the luxury
> > of a large company financially supporting and evolving the framework
> > development with full time developers. I would think this strengthens the
> > case for actively soliciting and recruiting community developers to build
> > the framework even stronger.
>
> > Mark Story is literally super-human, extra-terrestrial, and is doing an
> > incredible job. We all should be more grateful to him then we know.
>
> > But one or two people part-time on a large framework like this is not ideal,
> > I don't think.
>
> > None of this should be taken as criticism of a great team, and the great
> > work our core developers do. Rather, it is only because they have created
> > the most RAD framework API in the industry,  that cake is the most popular
> > framework and  they have generated this need for more developers to fuel the
> > engine.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP, jQuery & JSON

2011-03-18 Thread Miles J
I wrote some blog posts about this.

http://milesj.me/blog/read/62/Doing-AJAX-Calls-In-CakePHP%3A-Part-1-_-The-Front_end

On Mar 18, 7:12 am, cronet  wrote:
> That works very well... Thank you guys !
>
> On 18 Mrz., 12:28, LipeDjow  wrote:
>
> > Yes.
>
> > Instead returning the value in action, you can set it to view and load a
> > general element for JSON.
> > Like this (using Taffarel's example):
>
> > function json(){
> >     //bring some data in database
> >      $json = $this->Test->find('all');
> >      $this->set('json', $json);
> >      $this->render('../elements/json.ctp');
>
> > }
>
> > // views/elements/json.ctp
> > 
>
> > then in my view I use the method getJson
>
> > $.getJSON('Html->url(array('controller'=>'tests',
> > 'action'=>'json'))?>', function(data){
> >       $("div").append(data);
>
> > });
>
> > I think this will not break MVC.
>
> > HTH
> > LipeDjow

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Corrupted app/tmp/cache/views/ Files

2011-03-15 Thread Miles J
I have had a similar problem, a few questions?

Are you using Dreamhost?
I am assuming you are using filesystem cache, have you tried Memcache
or APC?
What OS is your server running?

On Mar 15, 12:57 pm, Dwayne  wrote:
> I've run into the following problem sporadically on different sites we
> have running on top of Cake: A client will report in that some page or
> other isn't loading, when it's examined the page will be a blank
> screen. Turning on debug will give a PHP syntax error in the cached
> file in app/tmp/cache/views/. It appears that the file was not
> completely written to disk, and therefore is invalid. Deleting that
> file fixes the problem.
>
> I'm not sure how these files are becoming corrupted, though. The
> problem seems mostly random, but it is tied in to server load. When
> the server is heavily loaded this will happen more frequently. Today a
> client reported a problem again. The cached file had been created at
> 2:25AM, but there were records in the DB created closer to noon that
> couldn't have been created if that page were broken.
>
> Some additional details: the sites that have this problem are running
> a custom CMS we've written on top of Cake. This makes use of a
> modified version requestAction() to load parts of a page. I'm not sure
> if that could have an effect or not. The cache files generated are
> enormous as well, so scanning through them to see how they work hasn't
> done me much good. I don't know if that's typical of Cake or specific
> to our CMS.
>
> Has anyone else experienced a problem like this? Searching for
> "corrupted cache" in this group doesn't return anything that seems
> directly related, nor does searching for "cakephp corrupted cache" in
> google. I'm still a bit unclear on exactly how Cake's caching works
> under the hood, but at a surface level the caching works except for
> when the files themselves are busted.
>
> Any ideas on how to prevent or detect this? Ideally I'd rather this
> didn't happen, but if I can at least prevent things from needing a
> user to contact our client that a page is down and then have the
> client contact me that would be a significant improvement.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to Hide Model name from URL of Search Result Pages

2011-03-14 Thread Miles J
What are you using to generate the named params?

On Mar 14, 2:15 pm, Adael  wrote:
> You can do the following:http://pastebin.com/JAup00Hn
>
> On 14 mar, 20:00, "Mr.Jayesh"  wrote:
>
> > Hello Everyone,
> > Hope things Great..
>
> > Anyone please advice me a quick solution from which i can hide model
> > name from my URL created out of search string.
>
> > currently my url looks 
> > like:http://my.website.com/medical/results/Medicine.search:cancer/Medicine...
>
> > I wanted it to be like 
> > this:http://my.website.com/medical/results/search:cancer/author_id:5
>
> > Thanks in advance.
> > Regards.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP License

2011-03-13 Thread Miles J
CakePHP is a free open source framework.

For consulting or development work, check out Cake DC. http://cakedc.com/

On Mar 12, 7:47 am, Chris DB  wrote:
> If I use CakePHP framework to my simple commercially project proposed,
> lets say online registration,  do I pay a license fee for CakePHP
> framework and how much is the cost. Cost for support and consultation.
>
> Chris DB.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Unobtrusive Javascript validation

2011-03-11 Thread Miles J
Cake doesn't have any JS validation, so I am a bit confused here.

On Mar 11, 8:48 am, AD7six  wrote:
> On Mar 11, 5:27 pm, Karl Oakes  wrote:
>
> >  If I were handcoding a site I would normally create my own js validation
> > script or use a jQuery validate plugin. I have just come from an ASP.net MVC
> > 3 learning curve that provides unobtrusive js by default. I was just
> > surprised that CakePHP still produced inline js nastiness for validation.
>
> What js are you referring to?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: "Keep me logged in" feature - how to do this?

2011-03-11 Thread Miles J
https://github.com/milesj/cake-auto_login

On Mar 11, 2:53 pm, Alejandro Gómez Fernández 
wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Depends on your requirements, you can do this simply with a cookie, or
> implement something more secure, using for example, a dyndns client,
> some data stored in your database, time to live stored in the cookie,
> some hash stored in the cookie and the database ...  Posibly you need to
> check or force the connection by ssl. There are many posibilities ...
>
> Please, tell us what are you needed and we maybe can provide some ideas.
>
> Regards,
>
> Alejandro G mez.
>
> El 11/03/2011 16:13, DigitalDude escribi :
>
>
>
> > Hey,
>
> > I'm going to need a function called "Keep me logged in" in my app, and
> > I'm not sure how to do this. You've all probably seen such a feature,
> > I'm assuming it means that a cookie or sth else is stored on the
> > user's machine that will tell the browser or the cake app that a user
> > is still logged in with his/her data.
>
> > I know some users delete all cookies when they close their browsers
> > (as I do) and this feature will have no effect for them, but for all
> > other users I want this feature to work.
>
> > Does any one of you ever coded such a feature or has any idea where to
> > get information on this?
>
> > Regards,
>
> > DD
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (MingW32)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJNeqfkAAoJEHQn9CmeN9DJAusH/1BBaIwv74hsBJgL9LWmezaq
> k7+k5jSKY+dF12Oyk2nNF36sbRQ0M0JtS3k3k2SHdVfCuKjiFcqFIyMjl3PWwgaj
> DbNDTJY6Lle7zqy4RYdoza1yIFVTkgpJ4IPtw1LpU9H8pw40Ep+nEOTK8NGaQP+i
> e+vIvkM3Y9zQmlNIAPINuBkzVIjD054iCgEe3YVt7GV4TMmXuu9oDc1U8O+J/1Lf
> 1tUD4uxR8ZI+aWbDuFX7ENrcBnTKav6ldpGfQJtkglEUW16D48DTgR8g7P/QLuiP
> b8uqdjYWKmkqBcGOokldbwpd+mtb9v+qEl9KA5uJOmo2M1FAcPu79YE1745DRgc=
> =KIWV
> -END PGP SIGNATURE-

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Miles Johnson Uploader - Resize Group Issue.

2011-03-01 Thread Miles J
What version of the uploader are you using?

On Mar 1, 12:56 am, Stephen  wrote:
> It states it's image/jpeg
>
> On 1 March 2011 00:35, Miles J  wrote:
>
>
>
> > Yeah that's quite weird, it should be assigned as an image.
>
> > What does php say the mimetype is after the upload process?
>
> > On Feb 28, 4:17 pm, Stephen  wrote:
> > > Hi Miles
>
> > > I tried image/jpeg and gif.
>
> > > Various images, not had the chance to test online rather than in EasyPHP.
>
> > > image/jpeg should pass no?
>
> > > Anyhow, on a slightly different note, I really love the simplicity of
> > your
> > > component - besides the strange error (still convinced it's EasyPHP),
> > it's
> > > working perfectly.
>
> > > On 28 February 2011 22:19, Miles J  wrote:
>
> > > > What type of file are you uploading?
>
> > > > You can add more mimetypes to the supported mimetype array to allow
> > > > your type to pass, instead of hacking in conditions.
>
> > > > On Feb 28, 12:17 pm, Stephen  wrote:
> > > > > I managed to get around this issue by checking for both image and
> > > > > application from an array (at all instances).
>
> > > > > This obviously is bad practise, I am sure this will be because of
> > > > EasyPHP,
> > > > > possibly something to do with the way CakePHP handles tmp_name?
>
> > > > > If anybody has any insight on this I would love to hear.
>
> > > > > Thanks in advanced -
> > > > > <http://www.ninjacodermonkey.co.uk>
> > > > >  Stephen
>
> > > > --
> > > > Our newest site for the community: CakePHP Video Tutorials
> > > >http://tv.cakephp.org
> > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > > others with their CakePHP related questions.
>
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this
> > group
> > > > athttp://groups.google.com/group/cake-php
>
> > > --
> > > Kind Regards
> > >  Stephen
>
> > >  http://www.ninjacodermonkey.co.uk
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php
>
> --
> Kind Regards
>  Stephen
>
>  http://www.ninjacodermonkey.co.uk

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Multiple "controllers" on a single page

2011-03-01 Thread Miles J
It would be a single action, all you do is grab data from all sources
and set them into the page.

public function index() {
$this->set('users', $this->User->find('all'));
$this->set('files', $this->File->find('all'));
$this->set('posts', $this->Post->find('all'));
}

On Mar 1, 9:35 am, cricket  wrote:
> On Mon, Feb 28, 2011 at 10:34 PM, mlaw  wrote:
> > Just wondering what the Cake PHP approach would be if one were
> > creating a single page that presented: a user list, recent posting
> > list and recent file upload list.  Right now I have separate
> > controllers for each so I can view each item on its own page.  How
> > would I use Cake PHP to present all of this data on one page?  Would
> > one make a master controller that makes use of the other three or
> > break the controllers into components?  And how could / can the views
> > for each item be re-used in such a situation?
>
> There are several approaches.What's best depends on your situation. Is
> this an admin page? For regular users? Google "cakephp dashboard" for
> ideas.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Miles Johnson Uploader - Resize Group Issue.

2011-02-28 Thread Miles J
Yeah that's quite weird, it should be assigned as an image.

What does php say the mimetype is after the upload process?

On Feb 28, 4:17 pm, Stephen  wrote:
> Hi Miles
>
> I tried image/jpeg and gif.
>
> Various images, not had the chance to test online rather than in EasyPHP.
>
> image/jpeg should pass no?
>
> Anyhow, on a slightly different note, I really love the simplicity of your
> component - besides the strange error (still convinced it's EasyPHP), it's
> working perfectly.
>
> On 28 February 2011 22:19, Miles J  wrote:
>
>
>
> > What type of file are you uploading?
>
> > You can add more mimetypes to the supported mimetype array to allow
> > your type to pass, instead of hacking in conditions.
>
> > On Feb 28, 12:17 pm, Stephen  wrote:
> > > I managed to get around this issue by checking for both image and
> > > application from an array (at all instances).
>
> > > This obviously is bad practise, I am sure this will be because of
> > EasyPHP,
> > > possibly something to do with the way CakePHP handles tmp_name?
>
> > > If anybody has any insight on this I would love to hear.
>
> > > Thanks in advanced -
> > > <http://www.ninjacodermonkey.co.uk>
> > >  Stephen
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php
>
> --
> Kind Regards
>  Stephen
>
>  http://www.ninjacodermonkey.co.uk

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Miles Johnson Uploader - Resize Group Issue.

2011-02-28 Thread Miles J
What type of file are you uploading?

You can add more mimetypes to the supported mimetype array to allow
your type to pass, instead of hacking in conditions.

On Feb 28, 12:17 pm, Stephen  wrote:
> I managed to get around this issue by checking for both image and
> application from an array (at all instances).
>
> This obviously is bad practise, I am sure this will be because of EasyPHP,
> possibly something to do with the way CakePHP handles tmp_name?
>
> If anybody has any insight on this I would love to hear.
>
> Thanks in advanced -
> 
>  Stephen

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Admin Route or Admin Password

2011-02-28 Thread Miles J
I wrote a tutorial on how to use the Auth component. Its over 2 years
old but should still apply.

http://milesj.me/blog/read/5/Using-CakePHP%27s-Auth-Component

On Feb 27, 3:59 am, AD7six  wrote:
> On 26 feb, 20:53, amarradi  wrote:
>
> > i added an password from login into the mysql db and now i'm ready for
> > login
>
> > But where i set the hashing algorithm i dont know
>
> You don't need to think about that unless you need to change it.
>
> Assuming you haven't written a user registration function etc. yet I'd
> suggest:
>
> set debug to 2
> try logging in with whatever username and password you want
> look at the sql log
> insert/edit a user in the db matching the query that cake generated.
>
> thereafter you want to be looking at isAuthorized probably (check the
> book)
>  e.g.https://github.com/AD7six/skel/blob/master/app_controller.php#L223
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how images stored in database

2011-02-28 Thread Miles J
My file upload behavior allows you to save metadata to the database:

https://github.com/milesj/cake-uploader/blob/master/tests/upload.php

On Feb 26, 6:02 am, Elvis Nguyen  wrote:
> I love this way because it is very simple and easy. When browsing the
> images, the application saves the path to database. However, we have
> app/webroot/img folder contains all images of the application.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: any way to omit app/webroot when request image file or directory inside it

2011-02-25 Thread Miles J
Is there a primary reason you are scared of users figuring out that
you are using cake? To the point you disregard the frameworks
conventions?

On Feb 25, 5:42 am, mohammad Al-Ani  wrote:
> thanks for all but i stile looking for some settings or code to solve that
>
> On 25 February 2011 16:40, mohammad Al-Ani  wrote:
>
>
>
> > thanks Miles J
>
> > But on top of that, anyone can see that you are sing Cake by checking
> >> your form structure, or that you are using named params.
>
> > I already get over that by using $this->params['form'] to get the data from
> > users
>
> > On 24 February 2011 21:30, Miles J  wrote:
>
> >> You can try setting up some apache mod_rewrite rules.
>
> >> But on top of that, anyone can see that you are sing Cake by checking
> >> your form structure, or that you are using named params.
>
> >> On Feb 24, 9:52 am, mohammad Al-Ani  wrote:
> >> > hi all..
>
> >> > hope you do well
>
> >> > I use cakephp from along and I faced a problem that I think it's a
> >> security
> >> > issue
>
> >> > when I request any file or directory that settle inside webroot
> >> directory.
> >> > The URL automatically show the app/wedroot slug
>
> >> > ex:
>
> >> > request
>
> >> >    * *www.mydomian.com/css/main.css
>
> >> > change in browser to
>
> >> >    www.mydomian.com/*app/webroot*/css/main.css
>
> >> > I thing this shows up that I used cakephp. and I find it unprofessional
> >> way
> >> > to leave such behavior
>
> >> > any suggestions, idea...
>
> >> > thanks for your time : )
>
> >> --
> >> Our newest site for the community: CakePHP Video Tutorials
> >>http://tv.cakephp.org
> >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> >> others with their CakePHP related questions.
>
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> >> athttp://groups.google.com/group/cake-php
>
> > --
> > محمد العاني
>
> --
> محمد العاني

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


<    1   2   3   4   5   6   7   8   9   10   >