Re: order by for hasMany

2011-09-06 Thread Dr. Tarique Sani
>From  http://book.cakephp.org/view/1043/hasMany

 array(
'className' => 'Comment',
'foreignKey'=> 'user_id',
'conditions'=> array('Comment.status' => '1'),
'order'=> 'Comment.created DESC',
'limit'=> '5',
'dependent'=> true
)
);
}
?>

Does that help?

Tarique

On Wed, Sep 7, 2011 at 12:14 PM, Miqdad Ali  wrote:

> i have a post and comments table post have hasmany comments ..  i am taking
> post order_by post.post_date desc , i want to get all comments also with
> orderby comments.post_date desc
>
> how can i get this please reply .
>
>
>
>
>
>
> -
>
>
> Miqdad Ali K
> +919995258790
> http://www.miqdadalik.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
>



-- 
=
PHP for E-Biz: http://sanisoft.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: tree_utility

2011-09-06 Thread Greg Skerman
Start by reading the book - you'll find most of what you need right there.

you create:
1) a database table which complies with what the tree behavior expects
2) a model for that table which acts as a tree
3) You surface that data in your view
4) you write some code in your view to convert the tree into an unordered
list or definition list or whatever you like/need (you may even like to
write this as a helper for reuse later on)
5) you use some javascript to convert that list into the menu that you want
(alternatively you could use a control, like jsTree or something if you want
an actual tree list - in this case your view is probably going to be an XML
view returning data to the tree control)

if you need further explanation, I'm going to need to know more about what
specifically you are trying to build.


On Wed, Sep 7, 2011 at 1:01 PM, Richardus Ari P
wrote:

> i need tutorial Mr.Greg
>
> On 7 Sep, 09:26, Greg Skerman  wrote:
> > using the tree behavior (core behavior, read the manual) , you can pull
> out
> > a nicely structured tree of data.
> >
> > you can then wrap some / tags around it to make a HTML list...
> >
> > most javascript/jquery menu's I've seen take these tags and build you a
> nice
> > menu based on data stored in your db...
> >
> > that what you need?
> >
> > On Wed, Sep 7, 2011 at 12:05 PM, Richardus Ari P
> > wrote:
> >
> >
> >
> >
> >
> >
> >
> > > please give me tutorial about helper tree_utility.
> > > i am make menus in web but i have not idea..
> >
> > > On 6 Sep, 18:58, AD7six  wrote:
> > > > On Sep 6, 11:52 am, Richardus Ari P 
> wrote:
> >
> > > > > can give me some example helper tree_utility in cakephp
> >
> > > > yes
> >
> > > --
> > > 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
>

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


order by for hasMany

2011-09-06 Thread Miqdad Ali
i have a post and comments table post have hasmany comments ..  i am taking
post order_by post.post_date desc , i want to get all comments also with
orderby comments.post_date desc

how can i get this please reply .






-


Miqdad Ali K
+919995258790
http://www.miqdadalik.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: The evil of Cache.check = true

2011-09-06 Thread jodator
@ mark_story
Thanks for pointing it out. I do have many small cached elements - I
forgot about that.
I thinking about reorginizing my view caching.

@Teddy Zenny
That's a good idea. I haven't heard of RabbitMQ before.

@ O.J. Tibi
I hope so as soon as possible (but that requires more income from my
webpage; ;) ).
I think that solution could help. thanks!

On Sep 7, 3:53 am, "O.J. Tibi"  wrote:
> Looks like my suggestion will not fit your situation, but I still want to
> ask if you have any plans to go dedicated? If you're working with a large
> number of small temporary files in your cache directory, then maybe you
> could place your app/tmp directory on an EXT4 or BTRFS partition? I heard
> that these have improvements on file seeks.
>
> Sorry if I'm not much of a 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: cakephp 2.0 Email - Passing variables to templates

2011-09-06 Thread #2Will
oh yeah.  doh.  thanks!

its also in the docs i was attempting to read:
http://book2.cakephp.org/en/core-utility-libraries/email.html

will

On Sep 7, 2:20 pm, "Dr. Tarique Sani"  wrote:
> CakeEmail::viewVars()
>
> Seehttps://github.com/cakephp/docs/blob/master/en/core-utility-libraries...
> for more
>
> Tarique
>
> On Wed, Sep 7, 2011 at 4:40 AM, #2Will  wrote:
> > Hello,
>
> > When using the new email Utility library with cake 2.0, what is the
> > procedure for passing variables?
>
> --
> =
> PHP for E-Biz:http://sanisoft.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


Cake 2 - What is the simplest way to change layout for errors?

2011-09-06 Thread Dr. Tarique Sani
What would be the simplest way to change the layout for *all* errors
and exceptions in Cake 2.0 RC?

As a QnD solution I copied the core CakeErrorController to
app/Controllers and wrote a line there

Any simpler / better / more correct way to do this?

IOW - I am looking to just Configure::write it somewhere ;-)

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.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: cakephp 2.0 Email - Passing variables to templates

2011-09-06 Thread Dr. Tarique Sani
CakeEmail::viewVars()

See 
https://github.com/cakephp/docs/blob/master/en/core-utility-libraries/email.rst
for more

Tarique

On Wed, Sep 7, 2011 at 4:40 AM, #2Will  wrote:
> Hello,
>
> When using the new email Utility library with cake 2.0, what is the
> procedure for passing variables?
>
>

-- 
=
PHP for E-Biz: http://sanisoft.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


CakeFest 2011

2011-09-06 Thread bwilt
I didn't make it but was wondering when the streams or episodes might
be available on tv.cakephp.org ?

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

2011-09-06 Thread Richardus Ari P
i need tutorial Mr.Greg

On 7 Sep, 09:26, Greg Skerman  wrote:
> using the tree behavior (core behavior, read the manual) , you can pull out
> a nicely structured tree of data.
>
> you can then wrap some / tags around it to make a HTML list...
>
> most javascript/jquery menu's I've seen take these tags and build you a nice
> menu based on data stored in your db...
>
> that what you need?
>
> On Wed, Sep 7, 2011 at 12:05 PM, Richardus Ari P
> wrote:
>
>
>
>
>
>
>
> > please give me tutorial about helper tree_utility.
> > i am make menus in web but i have not idea..
>
> > On 6 Sep, 18:58, AD7six  wrote:
> > > On Sep 6, 11:52 am, Richardus Ari P  wrote:
>
> > > > can give me some example helper tree_utility in cakephp
>
> > > yes
>
> > --
> > 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: tree_utility

2011-09-06 Thread Greg Skerman
using the tree behavior (core behavior, read the manual) , you can pull out
a nicely structured tree of data.

you can then wrap some / tags around it to make a HTML list...

most javascript/jquery menu's I've seen take these tags and build you a nice
menu based on data stored in your db...

that what you need?



On Wed, Sep 7, 2011 at 12:05 PM, Richardus Ari P
wrote:

> please give me tutorial about helper tree_utility.
> i am make menus in web but i have not idea..
>
>
> On 6 Sep, 18:58, AD7six  wrote:
> > On Sep 6, 11:52 am, Richardus Ari P  wrote:
> >
> > > can give me some example helper tree_utility in cakephp
> >
> > yes
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: tree_utility

2011-09-06 Thread Richardus Ari P
please give me tutorial about helper tree_utility.
i am make menus in web but i have not idea..


On 6 Sep, 18:58, AD7six  wrote:
> On Sep 6, 11:52 am, Richardus Ari P  wrote:
>
> > can give me some example helper tree_utility in cakephp
>
> yes

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

2011-09-06 Thread Richardus Ari P
i need helper tree for make menus in web but i have no idea
can you give me tutorial about it??

On 6 Sep, 17:19, WebbedIT  wrote:
> Need more information, what helper have you tried to use and what
> happened?
>
> HTH, Paul
> @phpMagpie
>
> On Sep 6, 10:52 am, Richardus Ari P  wrote:
>
>
>
>
>
>
>
> > can give me some example helper tree_utility in cakephp
>
> > thanks you

-- 
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: The evil of Cache.check = true

2011-09-06 Thread O.J. Tibi
Looks like my suggestion will not fit your situation, but I still want to 
ask if you have any plans to go dedicated? If you're working with a large 
number of small temporary files in your cache directory, then maybe you 
could place your app/tmp directory on an EXT4 or BTRFS partition? I heard 
that these have improvements on file seeks.

Sorry if I'm not much of a 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: Multiple file upload

2011-09-06 Thread 8vius
I would like the details of this, it's good to have another approach
in case

On Aug 26, 7:13 am, David Cole  wrote:
> I would recommend using SWFUpload and setting up an attachment
> controller and behavior. This way you can have swfupload send the
> files to a function in your controller. Then use the behavior to
> create HABTM associations on the fly to your other models. It's what
> I've done and it works great. If you need more details let me know, I
> can send you the code.
>
> On Aug 23, 9:37 pm,8vius wrote:
>
>
>
>
>
>
>
> > I'm really struggling to find a solution for what I want to do. I want
> > to be able to upload several image files simultaneously but I don't
> > want to have several file boxes but just one where the user can select
> > several files to upload, what is the best plugin and solution on the
> > frontend side to do 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: Sharing my TextMate Bundle for Cakephp 1.3

2011-09-06 Thread Ryan Snowden
What do you use now, Mark? :)

On 7 September 2011 04:40, mark_story  wrote:

> You should also take a look at the cakephp-tmbundle on github.  I used
> to do some of the maintenance, but I've stopped using TextMate, so I
> haven't done any updates recently.
>
> https://github.com/cakephp/cakephp-tmbundle
>
> -Mark
>
> On Sep 6, 6:33 am, homem-arvore  wrote:
> > I just wanted to share with you my TextMate Bundle for Cakephp 1.3.
> > It provides you with auto-complete for the most commonly used
> > functions
> >
> > Picking where Matthew Harris left, I update the bundle for the lattest
> > version and added a little regex smartness that makes it figure how
> > what model you're using.
> >
> > So, as an example, if you're working on a file called
> > posts_controller.php and type find>Tab will expand to $this->Post-
> >
> > >find($conditions, $fields, $order, $recursive);
> >
> > This is kind of a work in progress so there might still be some bugs/
> > room for improvement. Let me know if you have any suggestions.
> >
> > install instructions: 1. copy files to -> ~/Library/Application
> > Support/TextMate/Bundles (in Mac OS 10.7, the Library folder is
> > hidden. In finder type cmd+shift+G to get there) 2. Restart TextMate
> >
> > http://www.homem-arvore.com/files/php-cake.tmbundle.zip
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


cakephp 2.0 Email - Passing variables to templates

2011-09-06 Thread #2Will
Hello,

When using the new email Utility library with cake 2.0, what is the
procedure for passing variables?

In the past, I just used set, and that passed a variable to the
view  / email template.  I could also use Configure::read

these aren't working any more.

Thanks

will

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


amchart + CakePHP Xml Serialize

2011-09-06 Thread Hugo M
Hi, I'm using amchart to make graphics, I need to generate an XML like this:




 -0.307
-0.168
 -0.073
-0.027
 -0.251

But:

   $parsed = array(
'chart'=>array(
'graphs'=>array(
array(
'graph'=>array(
'gid'=>1,
'value'=>array(
array(
'xid'=>'100',
array(5)
)
)
)
)
)
)
);
is generating:





5




I don't want that duplicated 'value' tag. Can anyone help me?

-- 
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 2 app deployed on a subdomain

2011-09-06 Thread #2Will
hmm.  i fixed it. sort of.

My htaccess in webroot was:


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


but looking at a 1.3 app on the same server (different subdomain) it
was


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


So i have used this and the app is working.   Obviously not ideal to
be sticking bits of 1.3 into my 2.0 app to get it working.  I don't
really understand the changes in the htaccess file  - why the change?
is it  a bug? Something wrong with the server setup?

thanks

will

On Sep 7, 8:09 am, "#2Will"  wrote:
> Sorry for confusion, yes thats right just an app, deployed in the
> simple cake way, whole thing up onto the one area (which happens to be
> a subdomain)
>
> its just /people/login for the login action
>
> On Sep 6, 5:44 pm, WebbedIT  wrote:
>
>
>
>
>
>
>
> > No I think you're reading it right, but if it's a different app it's a
> > different app - a sub-domain is still a different domain when used in
> > that context.
>
> > If you want to have one central core you can go for the advanced
> > installation but if I read your post fully I can see I have been
> > thrown by your topic mentioning sub-domains (note to self: stop skim
> > reading people posts).
>
> > OK, so this has nothing to do with sub-domains, this is simply a
> > configuration issue on a different domain.  Looks as thought
> > the .htaccess files are not doing their jobs correctly.
>
> > Do your other apps access the login at '/app/webroot/people/people/
> > login' or do they instead  access '/people/login'?
>
> > HTH, Paul
> > @phpMagpie
>
> > On Sep 6, 12:29 am, "#2Will"  wrote:
>
> > > ok, thank you for replying.
>
> > > I think what they are talking about in that is when you want to be
> > > able to use different subdomains for different links etc?
>
> > > That shouldn't be necessary just to deploy the whole app to a
> > > subdomain should it?  or am i reading that wrong?
>
> > > Thanks
>
> > > will
>
> > > On Sep 5, 9:59 pm, WebbedIT  wrote:
>
> > > > Cake 2.0 beings some canges to the router to help with subdomains that
> > > > were touched on at 
> > > > CakeFest:http://book2.cakephp.org/en/appendices/new-features-in-cakephp-2-0.ht...
>
> > > > HTT, Paul
> > > > @phpMagpie
>
> > > > On Sep 5, 1:38 am, "#2Will"  wrote:
>
> > > > > comparing debug($_SERVER) between local and stage sites
>
> > > > > local:      [PHP_SELF] => /app/webroot/index.php/people/login
> > > > > stage:    [PHP_SELF] => /app/webroot/people/login
>
> > > > > This seems like a likely to be relevent, but what could be causing
> > > > > it?  I think i have all my htaccess files present.
>
> > > > > Looking at other apps ive deployed to subdomain-stage , the PHP_SELF
> > > > > is /app/webroot/index.php  without the /controller/action   - but
> > > > > thats 1.3 apps.
>
> > > > > hmm.  more digging.
>
> > > > > On Sep 5, 10:11 am, "#2Will"  wrote:
>
> > > > > > just running some debug statements looking at paths:
>
> > > > > > debug(ROOT);
> > > > > > debug(WWW_ROOT);
> > > > > > debug(WEBROOT_DIR);
> > > > > > debug(APP_DIR);
> > > > > > debug(APP_PATH);
> > > > > > gives me
>
> > > > > > /home/kindlem1/public_html/elip
> > > > > > /home/kindlem1/public_html/elip/app/webroot/
> > > > > > webroot
> > > > > > app
> > > > > > /home/kindlem1/public_html/elip/app/
>
> > > > > > Which i think looks as expected.
>
> > > > > > On Sep 5, 9:58 am, "#2Will"  wrote:
>
> > > > > > > Sorry, forgot to mention: i'm on 2.0 rc1
>
> > > > > > > On Sep 5, 9:56 am, "#2Will"  wrote:
>
> > > > > > > > Hello
>
> > > > > > > > I have deployed a little app to a subdomain as a stage 
> > > > > > > > environment -
> > > > > > > > iv'e done this before with 1.3 apps and not had to do anything 
> > > > > > > > special
> > > > > > > > to get it to work. The app works on my localhost
>
> > > > > > > > I'm getting errors where for example the login form now gives 
> > > > > > > > error
>
> > > > > > > > Error: The requested address '/app/webroot/people/people/login' 
> > > > > > > > was
> > > > > > > > not found on this server
>
> > > > > > > > and if i enable debug in config.php debug kit gives is broken, 
> > > > > > > > with
> > > > > > > > files missing because they are pointing to wrong addresses
>
> > > > > > > > eg:  app/webroot/people/debug_kit/js/js_debug_toolbar.js
>
> > > > > > > > Is there something special i need to do for cakephp2 apps in
> > > > > > > > subdomains?
>
> > > > > > > > Thanks v much for any help,
>
> > > > > > > > will

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

Re: Convert native PHP class into cakePHP component

2011-09-06 Thread elogic
Thankyou so much for the information. Sounds just like what I was
after.

Cheers!



On Sep 6, 5:33 pm, Teddy Zeenny  wrote:
> I think it's better not to change a pre-built class (in case they perform
> updates to it or fix any bugs you wouldn't be able to make use of them).
>
> This is why CakePHP has the "vendors" system.  You simply place your
> pre-built class in your vendors folder and call it from your application.
> For example:
>
> App::import('Vendor','SmsPHP');
> $sms_php=new SmsPHP();
>
> What I would also do is create a component that simply interacts with this
> class.
> For example create a component called SmsCakeComponent, and inside the
> component import the class from vendors and call it's functions.
> The reason why I'd create a component would be to abstract the vendor class
> away from my application, in that case if I want to switch classes I would
> only need to fix my component instead of fixing the entire application,
> therefore making my component act as an "interface" between my application
> and the vendor class.
>
> I hope I wasn't very confusing  :)
>
> Anyway, here's a link from the CakePHP book that might help you get started
> with vendors:http://book.cakephp.org/view/943/Loading-Vendor-Files
>
> Teddy
>
>
>
>
>
>
>
> On Tue, Sep 6, 2011 at 9:03 AM, elogic  wrote:
> > Hi All,
>
> > I am only new to cakePHP and am learning slowly (but loving it). I
> > have been given a pre-built class and some basic instructions on how
> > to use it from our SMS provider (it works very well and easily with
> > native PHP).
>
> > I need to convert the class into something that I can easily use
> > within cakePHP sites. Am I right in assuming I want to convert it into
> > a component? If not what would you suggest?
>
> > Are there any tutorials around that might help me complete my task? I
> > presume it shouldn't be too hard at all once I know what I am doing.
>
> > Thanks
>
> > --
> > 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: cakephp 2 app deployed on a subdomain

2011-09-06 Thread #2Will
Sorry for confusion, yes thats right just an app, deployed in the
simple cake way, whole thing up onto the one area (which happens to be
a subdomain)

its just /people/login for the login action


On Sep 6, 5:44 pm, WebbedIT  wrote:
> No I think you're reading it right, but if it's a different app it's a
> different app - a sub-domain is still a different domain when used in
> that context.
>
> If you want to have one central core you can go for the advanced
> installation but if I read your post fully I can see I have been
> thrown by your topic mentioning sub-domains (note to self: stop skim
> reading people posts).
>
> OK, so this has nothing to do with sub-domains, this is simply a
> configuration issue on a different domain.  Looks as thought
> the .htaccess files are not doing their jobs correctly.
>
> Do your other apps access the login at '/app/webroot/people/people/
> login' or do they instead  access '/people/login'?
>
> HTH, Paul
> @phpMagpie
>
> On Sep 6, 12:29 am, "#2Will"  wrote:
>
>
>
>
>
>
>
> > ok, thank you for replying.
>
> > I think what they are talking about in that is when you want to be
> > able to use different subdomains for different links etc?
>
> > That shouldn't be necessary just to deploy the whole app to a
> > subdomain should it?  or am i reading that wrong?
>
> > Thanks
>
> > will
>
> > On Sep 5, 9:59 pm, WebbedIT  wrote:
>
> > > Cake 2.0 beings some canges to the router to help with subdomains that
> > > were touched on at 
> > > CakeFest:http://book2.cakephp.org/en/appendices/new-features-in-cakephp-2-0.ht...
>
> > > HTT, Paul
> > > @phpMagpie
>
> > > On Sep 5, 1:38 am, "#2Will"  wrote:
>
> > > > comparing debug($_SERVER) between local and stage sites
>
> > > > local:      [PHP_SELF] => /app/webroot/index.php/people/login
> > > > stage:    [PHP_SELF] => /app/webroot/people/login
>
> > > > This seems like a likely to be relevent, but what could be causing
> > > > it?  I think i have all my htaccess files present.
>
> > > > Looking at other apps ive deployed to subdomain-stage , the PHP_SELF
> > > > is /app/webroot/index.php  without the /controller/action   - but
> > > > thats 1.3 apps.
>
> > > > hmm.  more digging.
>
> > > > On Sep 5, 10:11 am, "#2Will"  wrote:
>
> > > > > just running some debug statements looking at paths:
>
> > > > > debug(ROOT);
> > > > > debug(WWW_ROOT);
> > > > > debug(WEBROOT_DIR);
> > > > > debug(APP_DIR);
> > > > > debug(APP_PATH);
> > > > > gives me
>
> > > > > /home/kindlem1/public_html/elip
> > > > > /home/kindlem1/public_html/elip/app/webroot/
> > > > > webroot
> > > > > app
> > > > > /home/kindlem1/public_html/elip/app/
>
> > > > > Which i think looks as expected.
>
> > > > > On Sep 5, 9:58 am, "#2Will"  wrote:
>
> > > > > > Sorry, forgot to mention: i'm on 2.0 rc1
>
> > > > > > On Sep 5, 9:56 am, "#2Will"  wrote:
>
> > > > > > > Hello
>
> > > > > > > I have deployed a little app to a subdomain as a stage 
> > > > > > > environment -
> > > > > > > iv'e done this before with 1.3 apps and not had to do anything 
> > > > > > > special
> > > > > > > to get it to work. The app works on my localhost
>
> > > > > > > I'm getting errors where for example the login form now gives 
> > > > > > > error
>
> > > > > > > Error: The requested address '/app/webroot/people/people/login' 
> > > > > > > was
> > > > > > > not found on this server
>
> > > > > > > and if i enable debug in config.php debug kit gives is broken, 
> > > > > > > with
> > > > > > > files missing because they are pointing to wrong addresses
>
> > > > > > > eg:  app/webroot/people/debug_kit/js/js_debug_toolbar.js
>
> > > > > > > Is there something special i need to do for cakephp2 apps in
> > > > > > > subdomains?
>
> > > > > > > Thanks v much for any help,
>
> > > > > > > will

-- 
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: The evil of Cache.check = true

2011-09-06 Thread Teddy Zeenny
Can using RabbitMQ for cache clearing be a possible solution ? Maybe speed
up the write and perform cache clearing as an afterSave triggered
asynchronous event ?

On Tue, Sep 6, 2011 at 11:45 PM, mark_story  wrote:

> Because its globbing the disk for files to delete, and deleting them.
> With a slow disk or lots of files to delete that can get slow.
>
> -Mark
>
> On Sep 5, 6:11 pm, jodator  wrote:
> > Hi,
> >
> > I've just spend 40+ hours on deep debug my app, because all
> > Model::save actions where stupidly slow.
> >
> > For instance:
> > I had one action that copied some model's data with some associated
> > data and saved it as new instances.
> > Time with Cache.check = true - 130 seconds
> > Time with Cache.check = false - 0.6 second...
> >
> > The problem is execution time of glob() function inside clear_cache()
> > function from besics.php.
> >
> > I've left Cache.check set to true, when I was testing this
> > functionality, but my app doesn't use full view caching.
> >
> > I'm using cakphp1.2.*. My server is Debian (nginx, php-fpm, mysql)
> > running on VPS with Xen virtualization.
> >
> > Hope that helps someone...
> >
> > ps.: anyone have any idea why clear_cache is so slow?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: The evil of Cache.check = true

2011-09-06 Thread mark_story
Because its globbing the disk for files to delete, and deleting them.
With a slow disk or lots of files to delete that can get slow.

-Mark

On Sep 5, 6:11 pm, jodator  wrote:
> Hi,
>
> I've just spend 40+ hours on deep debug my app, because all
> Model::save actions where stupidly slow.
>
> For instance:
> I had one action that copied some model's data with some associated
> data and saved it as new instances.
> Time with Cache.check = true - 130 seconds
> Time with Cache.check = false - 0.6 second...
>
> The problem is execution time of glob() function inside clear_cache()
> function from besics.php.
>
> I've left Cache.check set to true, when I was testing this
> functionality, but my app doesn't use full view caching.
>
> I'm using cakphp1.2.*. My server is Debian (nginx, php-fpm, mysql)
> running on VPS with Xen virtualization.
>
> Hope that helps someone...
>
> ps.: anyone have any idea why clear_cache is so slow?

-- 
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: Sharing my TextMate Bundle for Cakephp 1.3

2011-09-06 Thread mark_story
You should also take a look at the cakephp-tmbundle on github.  I used
to do some of the maintenance, but I've stopped using TextMate, so I
haven't done any updates recently.

https://github.com/cakephp/cakephp-tmbundle

-Mark

On Sep 6, 6:33 am, homem-arvore  wrote:
> I just wanted to share with you my TextMate Bundle for Cakephp 1.3.
> It provides you with auto-complete for the most commonly used
> functions
>
> Picking where Matthew Harris left, I update the bundle for the lattest
> version and added a little regex smartness that makes it figure how
> what model you're using.
>
> So, as an example, if you're working on a file called
> posts_controller.php and type find>Tab will expand to $this->Post-
>
> >find($conditions, $fields, $order, $recursive);
>
> This is kind of a work in progress so there might still be some bugs/
> room for improvement. Let me know if you have any suggestions.
>
> install instructions: 1. copy files to -> ~/Library/Application
> Support/TextMate/Bundles (in Mac OS 10.7, the Library folder is
> hidden. In finder type cmd+shift+G to get there) 2. Restart TextMate
>
> http://www.homem-arvore.com/files/php-cake.tmbundle.zip

-- 
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: Issues With Auth Component

2011-09-06 Thread LunarDraco
Auth is NOT Access Control, It is simply authentication. You know the
user is real and has validated.

Access Control at a data level requires a bit more than Auth.

In general you can build up ACL (Access Control List) where you can
then control which data is visible to different request objects.

If you really don't need full ACL and you just want to limit the user
you can add a check against the Auth components current User id and
compare to the id they are trying to edit/view etc.
$this->Auth->user('id');

More info can be found here: 
http://book.cakephp.org/view/1242/Access-Control-Lists


On Sep 2, 12:55 pm, tubiz  wrote:
> I have already setup the auth component and it is working perfectly.
> But I just discovered a problem.
> There are two users in my users table when I am login as one of the
> users I can access the other users details just by changing the i.d.
> This wouldnt be secure as a login user can access all the details of
> other users,
> Please how can I stop this so that a logged in user is only able to
> view his details only and not other users details.

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


Group By Problem with PostgreSQL

2011-09-06 Thread gabrielr
Hi everybody.

I Have a problem making a GROUP BY operation with PostgreSQL Database.

This is my  Code

$apoyosEstado = $this->EncApoyo->find('all',array(
 
'fields'=>array('MAX(Estado.estado_id) AS
edo_id','MAX(Estado.descripcion) AS
estado','COUNT(EncApoyo.enc_apoyo_id) AS total'),
'group'=>
array('Estado.estado_id')
));

And It return an ERROR because Cake Adds the primary key to the SQL
QUERY. some like this:

SELECT MAX("Estado"."estado_id") AS edo_id,
MAX("Estado"."descripcion") AS estado,
COUNT("EncApoyo"."enc_apoyo_id") AS total, "EncApoyo"."enc_apoyo_id"
AS "EncApoyo__enc_apoyo_id" FROM "enc_apoyos" AS "EncApoyo" LEFT JOIN
"estados" AS "Estado" ON ("EncApoyo"."estado_id" =
"Estado"."estado_id") WHERE 1 = 1 GROUP BY "Estado"."estado_id"

This is an error because in PostgreSQL fields to display in a GROUP BY
query must be contained in an aggregate function.

If someone knows who solve it, answer me please.

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: New developer; Cake is NOT able to connect to the database.

2011-09-06 Thread Ma'moon
Just a quick small hint, never use "root" account for production, instead
create another database user and grant for it the desired permissions. and
by the way, if "root" worked for you then clearly you have a problem with
the "previous" user's permissions or existence.

On Tue, Sep 6, 2011 at 1:24 PM, Jeremy Williams  wrote:

> changed the username to 'root' and it connected! thanks guys!
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: 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: New developer; Cake is NOT able to connect to the database.

2011-09-06 Thread Jeremy Williams
changed the username to 'root' and it connected! thanks guys!

-- 
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: New developer; Cake is NOT able to connect to the database.

2011-09-06 Thread Jeremy Burns | Class Outfit
It'll be the username and password for the database, not the computer. By 
default, the username is probably 'root' and a blank password. If it's not, 
yo'll need to find out what credentials are need to access that database.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 6 Sep 2011, at 16:48, Jeremy Williams wrote:

> Your tmp directory is writable.
> 
> The FileEngine is being used for caching. To change the config edit
> APP/config/core.php
> 
> Your database configuration file is present.
> 
> Cake is NOT able to connect to the database.
> 
> I am going through the blog tut on: http://book.cakephp.org/view/1528/Blog
> and for some reason the database isn't connecting. From what i can
> tell there is a problem connecting over the local host server. I am
> using wamp for my web server but only connecting over localhost. And
> suggestions?
> 
> class DATABASE_CONFIG {
> 
>   var $default = array(
>   'driver' => 'mysql',
>   'persistent' => 'false',
>   'host' => 'localhost',
>   'port' => '',
>   'login' => 'User',
>   'password' => 'SuperSecretPass',
>   'database' => 'cakeblog_dtd',
> );
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: New developer; Cake is NOT able to connect to the database.

2011-09-06 Thread Teddy Zeenny
It's not the computer account's credentials.  It is mysql's username and
password.
If you haven't set any, I would try this:

 var $default = array(
   'driver' => 'mysql',
   'persistent' => 'false',
   'host' => 'localhost',
   'port' => '',
   'login' => 'root',
   'password' => '',
   'database' => 'cakeblog_dtd',

Usually that's the default username and password that come with wampserver
(username:root, and no password).

On Tue, Sep 6, 2011 at 8:14 PM, Jeremy Williams  wrote:

> everything you said was previously done, other than #4.
> does the username have to be the username and pass for the computer
> account i am on? how exactly do i define a username and password cuz i
> just made up a random one for testing.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: New developer; Cake is NOT able to connect to the database.

2011-09-06 Thread Jeremy Williams
everything you said was previously done, other than #4.
does the username have to be the username and pass for the computer
account i am on? how exactly do i define a username and password cuz i
just made up a random one for testing.

-- 
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: New developer; Cake is NOT able to connect to the database.

2011-09-06 Thread Teddy Zeenny
1. Make sure you are working in /app/config/database.php and NOT in
/app/config/database.php.default
2. Make sure mysql is on (try to access it using phpmyadmin for example)
3. Make sure you already created a database called 'cakeblog_dtd'
4. Double check your username and password.
 Are you sure it's User and not user? Maybe it's root?
 Are you sure this is your password ?  Maybe there is no password
then you should leave it blank?


Teddy



On Tue, Sep 6, 2011 at 6:48 PM, Jeremy Williams  wrote:

> Your tmp directory is writable.
>
> The FileEngine is being used for caching. To change the config edit
> APP/config/core.php
>
> Your database configuration file is present.
>
> Cake is NOT able to connect to the database.
>
> I am going through the blog tut on: http://book.cakephp.org/view/1528/Blog
> and for some reason the database isn't connecting. From what i can
> tell there is a problem connecting over the local host server. I am
> using wamp for my web server but only connecting over localhost. And
> suggestions?
>
> class DATABASE_CONFIG {
>
>var $default = array(
>'driver' => 'mysql',
>'persistent' => 'false',
>'host' => 'localhost',
>'port' => '',
>'login' => 'User',
>'password' => 'SuperSecretPass',
>'database' => 'cakeblog_dtd',
> );
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


New developer; Cake is NOT able to connect to the database.

2011-09-06 Thread Jeremy Williams
Your tmp directory is writable.

The FileEngine is being used for caching. To change the config edit
APP/config/core.php

Your database configuration file is present.

Cake is NOT able to connect to the database.

I am going through the blog tut on: http://book.cakephp.org/view/1528/Blog
and for some reason the database isn't connecting. From what i can
tell there is a problem connecting over the local host server. I am
using wamp for my web server but only connecting over localhost. And
suggestions?

class DATABASE_CONFIG {

var $default = array(
'driver' => 'mysql',
'persistent' => 'false',
'host' => 'localhost',
'port' => '',
'login' => 'User',
'password' => 'SuperSecretPass',
'database' => 'cakeblog_dtd',
);

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

2011-09-06 Thread AD7six


On Sep 6, 11:52 am, Richardus Ari P  wrote:
> can give me some example helper tree_utility in cakephp

yes

-- 
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: Could not describe table Error: An Internal Error Has Occurred.

2011-09-06 Thread Sebastian Henschel
hey Jon..

Am Saturday, den 03.09.2011, 20:38 -0700 schrieb Jon F:

> I am using cake 2.0 alpha.

i suggest you upgrade to the current version 2.0rc1:
http://bakery.cakephp.org/articles/markstory/2011/09/04/cakephp_2_0_0-rc1_hot_and_fresh

your problem could be fixed by that.

bye,
 Sebastian

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


Sharing my TextMate Bundle for Cakephp 1.3

2011-09-06 Thread homem-arvore
I just wanted to share with you my TextMate Bundle for Cakephp 1.3.
It provides you with auto-complete for the most commonly used
functions

Picking where Matthew Harris left, I update the bundle for the lattest
version and added a little regex smartness that makes it figure how
what model you're using.

So, as an example, if you're working on a file called
posts_controller.php and type find>Tab will expand to $this->Post-
>find($conditions, $fields, $order, $recursive);

This is kind of a work in progress so there might still be some bugs/
room for improvement. Let me know if you have any suggestions.

install instructions: 1. copy files to -> ~/Library/Application
Support/TextMate/Bundles (in Mac OS 10.7, the Library folder is
hidden. In finder type cmd+shift+G to get there) 2. Restart TextMate

http://www.homem-arvore.com/files/php-cake.tmbundle.zip

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


Authake problem with route mapping

2011-09-06 Thread 罗晟
Any one using Authake?

It saved tons of my time. But only one problem, I did lot of route
mapping, like "haidian" => array("controller" => "shops", "action"
=> ...)
in my config.php, there are hundreds of them. When I visit "mysite.com/
haidian", your tool stand out say I should login to access "/haidian".
I understand this happened because I didn't add /haidian to the rules.
But there are hundreds of this kind of route mapping. So by your way I
need tons of rules be edited.
And the route mapping is changing sometime.

What's your idea to get around this?

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


Singleton instance of controller

2011-09-06 Thread ajaxboy
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: CakePHP 2.0.0-RC1 Hot and fresh

2011-09-06 Thread sutikno sofjan
yeah me too ...

On Mon, Sep 5, 2011 at 10:17 PM, Taffarel de Lima wrote:

> Yeah, finally! I can't wait for the stable version.
>
> 2011/9/5 Vitor Pacheco 
>
>> Thanks so much!!
>>
>> Em Seg 05 Set 2011 11:11:07 BRT, Salines escreveu:
>>
>>  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+unsubscribe@**googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/**group/cake-php
>>>
>>
>> --
>> *Vitor Pacheco*
>> Skype: vitor.pacheco.costa
>> Msn: vitor-...@hotmail.com
>> Cel.: 71 8626-7909
>> Tel.: 71 3378-5778 / 71 3287-3475
>>
>>
>> --
>> 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+unsubscribe@**googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/**group/cake-php
>>
>
>
>
> --
> *Taffarel de Lima Oliveira (Taffarelo3)*
> *
> *
> *Desenvolvedor Web*
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: 'Site under maintenance' option

2011-09-06 Thread jodator
Why a secret url?
It could be just check if it's maintenance and if user is logged in.
If not, redirect to login action.

If your login action is too secret:
You also need an maintenance switch (which should be also in DB, if
you're switching to maintenance by editing files then you can edit
secret url also ;) ) so you have to have some Config/Setting model (or
just implement/google one).

Something like this: 
http://bakery.cakephp.org/articles/iamcam/2008/10/26/simply-storing-config-values-in-the-db
or anyone that suits your needs.

Your routes.php can have:
Router::connect(Configure::read('Secret.url'),
array('controller' => 'users', 'action' => 'secret_login'));
- or -
Router::connect(ClassRegistry::init('Config')->field('value',
array('key' => 'secret_url')),
array('controller' => 'users', 'action' => 'secret_login'));


On Sep 5, 9:45 pm, Xoubaman  wrote:
> I'm trying to implement a system to disable the site temporaly for
> maintenance purposes or whatever. If the site is disabled, only logged users
> can navigate through it, non-logged users are redirected to a "Site under
> maintenance" layout.
>
> Currently (o "As of now"), my approach is to allow a "secret url" that will
> lead to the login form, check in AppController::beforefilter if the current
> url is the allowed one and, if it isn't, set the maintenance layout. Trying
> to figure out how to allow only one url to log in, I came to define it as a
> constant in bootstrap and add the route in config/routes pointing to
> UsersController::login.
>
> It would be nice to save the secret url into the database and change it
> without editing bootstrap.php, though.
>
> Any suggestion?

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


The evil of Cache.check = true

2011-09-06 Thread jodator
Hi,

I've just spend 40+ hours on deep debug my app, because all
Model::save actions where stupidly slow.

For instance:
I had one action that copied some model's data with some associated
data and saved it as new instances.
Time with Cache.check = true - 130 seconds
Time with Cache.check = false - 0.6 second...

The problem is execution time of glob() function inside clear_cache()
function from besics.php.

I've left Cache.check set to true, when I was testing this
functionality, but my app doesn't use full view caching.

I'm using cakphp1.2.*. My server is Debian (nginx, php-fpm, mysql)
running on VPS with Xen virtualization.

Hope that helps someone...

ps.: anyone have any idea why clear_cache is so slow?

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


how to create extjs grid with cakephp CRUD

2011-09-06 Thread Mayur
how to create extjs grid and cakephp through show data in grid insert update 
and delete from grid.


Thankyou 

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


How to create cakephp With Extjs Grid - CRUD

2011-09-06 Thread Mayur
Hi,

I develop Ext JS Grid with cake php -CRUD

How can i Insert and update and delete record from extjs Editor grid
and cakephp.

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


Page Load Errors

2011-09-06 Thread Daren W
On loading my app index page I get the following error

2011-08-08 06:40:12 Warning: Warning (2): file_exists() [function.file-exists]:
open_basedir restriction in effect. File(/var/www/vhosts/site.com/cake/
libs/model/datasources/dbo_source.php) is not within the allowed
path(s): (/var/www/vhosts/pennyantix.com/site1/:/tmp/) in [APP/cake/
basics.php, line 861]

I see it's calling the path /var/www/vhosts/site.com/cake/libs/model/
datasources/dbo_source.php

The correct path is /var/www/vhosts/site.com/httpdocs/cake/libs/model/
datasources/dbo_source.php

Any ideas where to corrent 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


Issue with habtm

2011-09-06 Thread Ruslan Inozemtsev
Hello,

i'm trying to start using HABTM in Cake 1.3, but can't understand how
can i add an realtion.

Im trynig to create new relation between User and Project records in
DB, but no data apperas in users_projects
after im saving data :(

My code is:

$data = array(
  'User' => array('id' => 1),
'Project' => array(
'Project' => array(1, 2 , 3)
),
);
$this->User->saveAll($data);


And here is DB:

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` char(50) DEFAULT NULL,
  `password` char(40) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

-- 

CREATE TABLE IF NOT EXISTS `projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `order` int(11) NOT NULL,
  `count_total` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ;

-- 

CREATE TABLE IF NOT EXISTS `projects_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `project_id` (`project_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- 

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


Could not describe table Error: An Internal Error Has Occurred.

2011-09-06 Thread Jon F
Hey guys,

I am using cake 2.0 alpha. (I don't know why I chose this for
something I needed to work consistently, but I haven't had any trouble
until now.). I didn't make any changes to my database or code in the
last day, and am suddently getting this error.

Could not describe table for SimilarDebater

Error: An Internal Error Has Occurred.

With a stack trace of:

#0 /home/fantas53/public_html/ranking_systems/round_parser/lib/Cake/
Model/Model.php(989): Mysql->describe(Object(SimilarDebater), false)
#1 /home/fantas53/public_html/ranking_systems/round_parser/lib/Cake/
Model/Model.php(1160): Model->schema()
#2 /home/fantas53/public_html/ranking_systems/round_parser/app/
controllers/statistics_controller.php(410): Model->create()
#3 /home/fantas53/public_html/ranking_systems/round_parser/app/
controllers/statistics_controller.php(389): StatisticsController-
>calculate_associations_between_debaters()
#4 /home/fantas53/public_html/ranking_systems/round_parser/lib/Cake/
Routing/Dispatcher.php(151): StatisticsController-
>calculate_associations_between_all_names()
#5 /home/fantas53/public_html/ranking_systems/round_parser/lib/Cake/
Routing/Dispatcher.php(102): Dispatcher->_invoke(Array, Array)
#6 /home/fantas53/public_html/ranking_systems/round_parser/app/webroot/
index.php(80): Dispatcher->dispatch(Object(StatisticsController),
Object(CakeRequest))
#7 {main}

Obviously, there is something wrong with the creation of a new object,
but I can't figure out for the life of me why the describe query is
failing. I have manually described the table in question with no
problems.

Any help would be greatly appreciated!

Thanks,
Jon

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


Custom Plugin not loading anymore

2011-09-06 Thread Flosky
Hey everyone,

I had a fully working setup on my pc where i was developing my cake
app. With that I was using a custom plugin that I downloaded. I put it
in /plugins and I could use the helper and component that came with
the plugin.

Now I want to transfer this setup to a cloud hoster
(cloudcontrolled.com). To try this step by step, I got  a fresh cake
version from the website and loaded it up. For this the cake folder is
in ther root directory and there is no app folder (the controller,
view, model,plugins,.. files are in the root directory as well).
When I add the plugin helper to the app_controller.php I get an error
message indicating that the Javascript helper isnt working anymore. I
read that this indicates that some helper isnt loading properly. When
i remove the plugin helper everything works again.

Are there other settings that could screw this up (like routes,
rewrite rules, default directory settings, ...)??
I also used the latest version of cake, but there shouldn't be any
issues with that, should there??

I would greatly appretiate some help.

Cheers, Flosky

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


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


Re: Using $this->set in view doesn't set the var

2011-09-06 Thread Xoubaman
My concrete case:

In a CMS-like app, I have modules that can be attached to layout positions. 
Layout positions are vars echoed in each layout. So, I use a loader element, 
placed at the top of each layout, that should load each position var with 
his own output.

Layout example:


elements('loader'); ?>


...

...

...


Loader behavior:

foreach ($modules as $position => $attached_modules) {
foreach ($attached_modules as $model) {
 $output[$positions] .= $this->element($model);
}

$this->set($output);
}

Something like that. Code is not that way exactly, but I think it's enough 
to get the idea. The problem is that the $this->set at the bottom of loader 
element sets the var in viewVars attribute, but doesn't populate the vars to 
be accessed straight in the layout (as said in the doc, here: 
http://book.cakephp.org/view/1086/set)

I know I could call each element in each position, but it will mess up the 
layout code and difficult creating or editing layouts, instead the elegant 
echo $position ^^

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

2011-09-06 Thread WebbedIT
Need more information, what helper have you tried to use and what
happened?

HTH, Paul
@phpMagpie

On Sep 6, 10:52 am, Richardus Ari P  wrote:
> can give me some example helper tree_utility in cakephp
>
> thanks you

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


tree_utility

2011-09-06 Thread Richardus Ari P
can give me some example helper tree_utility in cakephp


thanks you

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


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


Re: Using $this->set in view doesn't set the var

2011-09-06 Thread WebbedIT
Still don't get it, maybe you need to show us your real world example
of how the element is communicating with the layout and other
elements.  That way we can understand and someone can solve or offer
an alternative solution.

At the initial page load, all elements should have their data passed
to them via the main controller action or their own requestAction, I
would fire separate ajax requests for other elements if they are to be
updated due to a DOM change.

I'm not sure the documentation does specifically say that elements can
set vars, did you read that from here?
http://book.cakephp.org/view/1081/Elements

You can set variables from the controller (to the view) and the view
(to the layout) but elements are not supposed to go to anything else,
they are the end of the line.

HTH, Paul
@phpMagpie

On Sep 5, 11:37 am, Xoubaman  wrote:
> Me neither, until now :)
>
> On the topic of setting vars in an element, regardless of it being wrong or
> not, the point is that it's possible. At least the doc says so, but it's not
> working for me (the Var::set() method).
>
> You may have an element that gets data from requestAction and, depending on
> the returned values, subsecuent layout contents will need different vars
> defined.

-- 
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: 'Site under maintenance' option

2011-09-06 Thread WebbedIT
Quickly off the top of my head I would set a boolean variable in my
App Controller (which could be served from database via a EAV style
settings model) then depending on the value you could override $this-
>Auth->allow(); declarations and maybe $this->Auth->loginScope(); if
you only wanted particular users/groups to be able to access the site.

You could also pass the variable to the login view to alter the login
required message reflecting that the site is in maintenance mode.

HTH, Paul
@phpMagpie

On Sep 5, 8:45 pm, Xoubaman  wrote:
> I'm trying to implement a system to disable the site temporaly for
> maintenance purposes or whatever. If the site is disabled, only logged users
> can navigate through it, non-logged users are redirected to a "Site under
> maintenance" layout.
>
> Currently (o "As of now"), my approach is to allow a "secret url" that will
> lead to the login form, check in AppController::beforefilter if the current
> url is the allowed one and, if it isn't, set the maintenance layout. Trying
> to figure out how to allow only one url to log in, I came to define it as a
> constant in bootstrap and add the route in config/routes pointing to
> UsersController::login.
>
> It would be nice to save the secret url into the database and change it
> without editing bootstrap.php, though.
>
> Any suggestion?

-- 
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 2 app deployed on a subdomain

2011-09-06 Thread WebbedIT
No I think you're reading it right, but if it's a different app it's a
different app - a sub-domain is still a different domain when used in
that context.

If you want to have one central core you can go for the advanced
installation but if I read your post fully I can see I have been
thrown by your topic mentioning sub-domains (note to self: stop skim
reading people posts).

OK, so this has nothing to do with sub-domains, this is simply a
configuration issue on a different domain.  Looks as thought
the .htaccess files are not doing their jobs correctly.

Do your other apps access the login at '/app/webroot/people/people/
login' or do they instead  access '/people/login'?

HTH, Paul
@phpMagpie

On Sep 6, 12:29 am, "#2Will"  wrote:
> ok, thank you for replying.
>
> I think what they are talking about in that is when you want to be
> able to use different subdomains for different links etc?
>
> That shouldn't be necessary just to deploy the whole app to a
> subdomain should it?  or am i reading that wrong?
>
> Thanks
>
> will
>
> On Sep 5, 9:59 pm, WebbedIT  wrote:
>
>
>
>
>
>
>
> > Cake 2.0 beings some canges to the router to help with subdomains that
> > were touched on at 
> > CakeFest:http://book2.cakephp.org/en/appendices/new-features-in-cakephp-2-0.ht...
>
> > HTT, Paul
> > @phpMagpie
>
> > On Sep 5, 1:38 am, "#2Will"  wrote:
>
> > > comparing debug($_SERVER) between local and stage sites
>
> > > local:      [PHP_SELF] => /app/webroot/index.php/people/login
> > > stage:    [PHP_SELF] => /app/webroot/people/login
>
> > > This seems like a likely to be relevent, but what could be causing
> > > it?  I think i have all my htaccess files present.
>
> > > Looking at other apps ive deployed to subdomain-stage , the PHP_SELF
> > > is /app/webroot/index.php  without the /controller/action   - but
> > > thats 1.3 apps.
>
> > > hmm.  more digging.
>
> > > On Sep 5, 10:11 am, "#2Will"  wrote:
>
> > > > just running some debug statements looking at paths:
>
> > > > debug(ROOT);
> > > > debug(WWW_ROOT);
> > > > debug(WEBROOT_DIR);
> > > > debug(APP_DIR);
> > > > debug(APP_PATH);
> > > > gives me
>
> > > > /home/kindlem1/public_html/elip
> > > > /home/kindlem1/public_html/elip/app/webroot/
> > > > webroot
> > > > app
> > > > /home/kindlem1/public_html/elip/app/
>
> > > > Which i think looks as expected.
>
> > > > On Sep 5, 9:58 am, "#2Will"  wrote:
>
> > > > > Sorry, forgot to mention: i'm on 2.0 rc1
>
> > > > > On Sep 5, 9:56 am, "#2Will"  wrote:
>
> > > > > > Hello
>
> > > > > > I have deployed a little app to a subdomain as a stage environment -
> > > > > > iv'e done this before with 1.3 apps and not had to do anything 
> > > > > > special
> > > > > > to get it to work. The app works on my localhost
>
> > > > > > I'm getting errors where for example the login form now gives error
>
> > > > > > Error: The requested address '/app/webroot/people/people/login' was
> > > > > > not found on this server
>
> > > > > > and if i enable debug in config.php debug kit gives is broken, with
> > > > > > files missing because they are pointing to wrong addresses
>
> > > > > > eg:  app/webroot/people/debug_kit/js/js_debug_toolbar.js
>
> > > > > > Is there something special i need to do for cakephp2 apps in
> > > > > > subdomains?
>
> > > > > > Thanks v much for any help,
>
> > > > > > will

-- 
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 without naming convention. is it possible?

2011-09-06 Thread WebbedIT
100 tables, ouch .. yeah sounds like your going to have to leave it as
it is, but as others are saying it should work with a little extra
configuration.  Good luck and get back to us with how you find it.

@phpMagpie

On Sep 6, 2:10 am, Greg Skerman  wrote:
> I told you how to do it :) its not impossible, you just risk it becoming an
> unmaintainable mess.
>
> There are many tables I use which come from other systems/are static dumps
> of tables out of systems i need to use as reference data but don't want to
> muck up the table definitions etc - and I routinely tell cake "this is this,
> that is that"...and all is good
>
> Its just something that needs to be dealt with carefully - if you have
> hundreds of tables and nothing else depends on them, and you have the
> time/budget to do it, it may be worth altering the tables to be more cake
> friendlybut if not, just configure your models and document everything
> carefully so the next developer who has to come along knows what it is
> you've done to make it work.
>
>
>
>
>
>
>
> On Mon, Sep 5, 2011 at 5:20 PM, Cruisine  wrote:
> > to be honest,i don't really want this happen.but what am i supposed to
> > do?i cant build new database since the current database have lots of
> > datas inside. after i read ur reply i started to think like that as
> > well.my work will be hard later. i have to define lots of things on
> > the model and i don't have an idea about the unpreddicted issues which
> > will follow later.
>
> > do you have any idea to solve this problem?
>
> > On Sep 5, 10:39 am, Greg Skerman  wrote:
> > >http://book.cakephp.org/view/1057/Model-Attributesisa good place to
> > start.
>
> > > you can configure in most circumstances cake to talk to any old database
> > -
> > > you just end up losing some of the magic and writing more code as a
> > result.
>
> > > for a model which does not comply with the convention you will at least
> > need
> > > to:
>
> > > 1) define the table name ($useTable)
> > > 2) define the primary key ($primaryKey)
> > > 3) define the display name ($displayName)
>
> > > you'll also need to provide more verbose settings in the model
> > associations
> > > in order to get them to play nice...
>
> > > On Mon, Sep 5, 2011 at 9:34 AM, Cruisine  wrote:
> > > > hi guys, i need to know something important about naming convention.
> > > > yeah, i've been using naming convention while developing all my app
> > > > all the time. but recently a problem appeared. let say  i've got a
> > > > project to re-developing an app ( from non-cakephp to cakephp) which
> > > > already had a database. and of course since the app hadn't been built
> > > > by cakephp the database also didn't follow the cakephp naming
> > > > convention rules.
> > > > the question i have is, how do i make an application using cakephp
> > > > with that database?is it still possible to  built a cakephp project
> > > > without following naming convention rules?
>
> > > > need ur help soon.thank you.
>
> > > > --
> > > > 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: Convert native PHP class into cakePHP component

2011-09-06 Thread Teddy Zeenny
I think it's better not to change a pre-built class (in case they perform
updates to it or fix any bugs you wouldn't be able to make use of them).

This is why CakePHP has the "vendors" system.  You simply place your
pre-built class in your vendors folder and call it from your application.
For example:

App::import('Vendor','SmsPHP');
$sms_php=new SmsPHP();

What I would also do is create a component that simply interacts with this
class.
For example create a component called SmsCakeComponent, and inside the
component import the class from vendors and call it's functions.
The reason why I'd create a component would be to abstract the vendor class
away from my application, in that case if I want to switch classes I would
only need to fix my component instead of fixing the entire application,
therefore making my component act as an "interface" between my application
and the vendor class.

I hope I wasn't very confusing  :)

Anyway, here's a link from the CakePHP book that might help you get started
with vendors: http://book.cakephp.org/view/943/Loading-Vendor-Files

Teddy

On Tue, Sep 6, 2011 at 9:03 AM, elogic  wrote:

> Hi All,
>
> I am only new to cakePHP and am learning slowly (but loving it). I
> have been given a pre-built class and some basic instructions on how
> to use it from our SMS provider (it works very well and easily with
> native PHP).
>
> I need to convert the class into something that I can easily use
> within cakePHP sites. Am I right in assuming I want to convert it into
> a component? If not what would you suggest?
>
> Are there any tutorials around that might help me complete my task? I
> presume it shouldn't be too hard at all once I know what I am doing.
>
> 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
>

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


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


Re: Using GET not POST returns empty $this->data

2011-09-06 Thread WebbedIT
First rule of security . never trust the user!  You really need to
watch Pierre Spring's (http://twitter.com/#!/shvi) CakeFest talk on
security when it is uploaded, it will scare the be-jeesus out of you!
Keep an eye out for that on tv.cakephp.org when @phpNut recovers from
his flight home, edits the talks and uploads them.

The problem is, the only way a user communicates with your app is via
HTTP requests and your server does not know if that request has come
from an evil hacker or an angelic genuine user.

Therefore you must ensure that any data posted to your app is only
ever sent from a form you created, that is served from within your
app*.  Same thing with delete requests, you should only ever accept
these from POST - how easy is it to type '/users/delete/1', '/users/
delete/2', 'users/delete/3' etc..

With GET requests anyone can type variable names and values direct
into the parameters string and add or update any field for any record
in your database without ever being on your site.  Ok, you can do some
authenticate and authorisation checks after recieving the request to
see if they own the record, but what if the user has managed to
compromise a user's account? (again Pierre Spring's talk will show how
easy this is if not protected with simple but effective methods that
CakePHP provide if used correctly).

* The only time you should accept POST requests from an external
server is if you've written an API, but then you need to operate on
HTTPS and have Keys and Tokens etc. to authorise requests.

HTH, Paul
@phpMagpie

On Sep 6, 2:26 am, Ryan Schmidt  wrote:
> On Sep 5, 2011, at 05:55, WebbedIT wrote:
>
> > It is a VERY bad idea to accept data via GET that you are going to
> > write into your database.  Please do not do it, you should only accept
> > POST data
>
> Why, by the way? It is no more difficult for a user (web browser, JavaScript, 
> curl, etc.) to send POST data than it is to send GET data. Either you trust 
> the user to supply data to your application or you don't.

-- 
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: baking plugins cakephp2

2011-09-06 Thread p r
but the same for baking views ends in "Error: Plugin PluginName could
not be found."..




On 5 Sep., 21:16, p r  wrote:
> cake bake model PluginName.ModelName works.
>
> On 5 Sep., 21:10, p r  wrote:
>
>
>
>
>
>
>
> > hello,
>
> > i tried to bake a plugin in cakephp 2. the help says i could use
> > parameter -p to bake some models like cake bake model -p PluginName.
> > but the "bake Model Path" does not changed to /app/Plugin/PluginName
> > and also does not use the created Plugin folder.
> > Has anybody some experiences to share? that would really appreciated.
> > greetings

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


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