Re: Plugin questions

2007-06-18 Thread AD7six



On Jun 19, 12:39 am, Geoff Ford <[EMAIL PROTECTED]> wrote:
> Thanks AD, I'll be integrating 1897 and 2526 into my install. It lloks
> like they will solve my problems.
>
> I will still need to look into the behaviours issue though I think.
> It would be really great if these would work as expected.

I get the feeling that it will be a short lived problem.

If you are impatient ( :) ), you might manage to get what you want if
you put a call to this method in your plugin somewhere (e.g. in the
plugin app model file, outside the class).
https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/configure.php?rev=5132#L419

You would normally just define the $behaviorPaths var in your
bootstrap (__loadBootstrap in that file would pick up your definition
and add it), but unless you scan and add all plugins model behavior
folders (overhead) or make an assumption from the url and include a
plugin, that's too early.

hth,

AD


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



Re: Plugin questions

2007-06-18 Thread Geoff Ford

Thanks AD, I'll be integrating 1897 and 2526 into my install. It lloks
like they will solve my problems.

I will still need to look into the behaviours issue though I think.
It would be really great if these would work as expected.

Cheers,
Geoff

On Jun 18, 4:52 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Jun 18, 3:45 am,GeoffFord<[EMAIL PROTECTED]> wrote:
>
>
>
> > I have just started making a plugin for cakephp 1.2 and have noticed a
> > few oddities.
>
> > The first was that the official testsuite does not include support for
> > plugin tests.  I have put in a ticket on trac (https://
> > trac.cakephp.org/ticket/2777) with a partial patch that allows you to
> > run tests stored in app/plugins/plugin_name/tests through a browser.
> > (Still worrking on the TextManager).  Is this something that the Test
> > Suite team is working on? Or are plugins not going to be supported?
>
> > The second is that plugins can't load behaviours from within
> > themselves, only application level behaviours.  I have not tested but
> > assume that components and helpers are similar.  This makes it hard to
> > make a plugin self contained.
>
> > Third, I think /app/plugins/plugin_name/routes.php should be supported
> > and possibly self contained css, img and js.
>
> > I have not had a look at doing anything for 2 and 3 so I have no idea
> > how easy/viable this would be, but I think it would be a great help to
> > make plugins as fully self contained as possible.
>
> > Is this a goal for plugins or am I on my own here?
>
> I think enabling plugin tests for the test suite is desirable, I know
> I want it to work, for the rest have a look at existing tickets
> (https://trac.cakephp.org/search?ticket=on&q=plugin),
>
> namely:https://trac.cakephp.org/ticket/2447
> mildly 
> relaventhttps://trac.cakephp.org/ticket/1897https://trac.cakephp.org/ticket/2526
>
> Reading routes from a plugin is imo not necessary - it's impractical
> to try to load plugin routes (you need to load all routes before
> parsing the url, i.e. its the app that defines the routes). However,
> if you define your urls as arrays, a single change to your routes file
> will work as you would expect if you have 2626 or something
> similar in place.
>
> hth,
>
> AD
> PS it's only behaviors atm that don't work when in a plugin.


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



Re: Plugin questions

2007-06-17 Thread AD7six



On Jun 18, 3:45 am, Geoff Ford <[EMAIL PROTECTED]> wrote:
> I have just started making a plugin for cakephp 1.2 and have noticed a
> few oddities.
>
> The first was that the official testsuite does not include support for
> plugin tests.  I have put in a ticket on trac (https://
> trac.cakephp.org/ticket/2777) with a partial patch that allows you to
> run tests stored in app/plugins/plugin_name/tests through a browser.
> (Still worrking on the TextManager).  Is this something that the Test
> Suite team is working on? Or are plugins not going to be supported?
>
> The second is that plugins can't load behaviours from within
> themselves, only application level behaviours.  I have not tested but
> assume that components and helpers are similar.  This makes it hard to
> make a plugin self contained.
>
> Third, I think /app/plugins/plugin_name/routes.php should be supported
> and possibly self contained css, img and js.
>
> I have not had a look at doing anything for 2 and 3 so I have no idea
> how easy/viable this would be, but I think it would be a great help to
> make plugins as fully self contained as possible.
>
> Is this a goal for plugins or am I on my own here?

I think enabling plugin tests for the test suite is desirable, I know
I want it to work, for the rest have a look at existing tickets
(https://trac.cakephp.org/search?ticket=on&q=plugin),

namely:
https://trac.cakephp.org/ticket/2447
mildly relavent https://trac.cakephp.org/ticket/1897
https://trac.cakephp.org/ticket/2526

Reading routes from a plugin is imo not necessary - it's impractical
to try to load plugin routes (you need to load all routes before
parsing the url, i.e. its the app that defines the routes). However,
if you define your urls as arrays, a single change to your routes file
will work as you would expect if you have 2626 or something
similar in place.

hth,

AD
PS it's only behaviors atm that don't work when in a plugin.


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