Re: Model imports inexistent class Behavior

2008-10-08 Thread kAtremer

OK. It turned out to be like this: App::import('Core', 'Behavior') does 
in fact import classes ModelBehavior and BehaviorCollection. But on 
subsequent calls App::import() still checks if the 'Behavior' class is 
defined.

So I suppose what really should be made is: rename behavior.php to 
model_behavior.php; change App::import('Core', 'Behavior') to 
App::import('Core', 'ModelBehavior') in model.php and configure.php line 
1037.

It works for me and I think I've got noticeable performance gain; but 
I'm not sure that a consequence won't rise somewhere in the core code.

AD7six wrote:
>> What kind of pass-the-buck cop out logic is that...

If I got your slang right and you're really complaining about me not 
reporting the ticket myself, I must tell that I'm not sure which tickets 
must be supplemented with tests and which ones just can't be tested. If 
I write a test that ensures that App::import('Core', 'Behavior') imports 
classes ModelBehavior and BehaviorCollection, will that not be a break 
of test isolation? The same with model.php, I can't be sure that another 
test doesn't already included model.php.

I'll report the ticket, the rest is out of my reach for now.

-- 
kAtremer
[EMAIL PROTECTED]

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



Re: Model imports inexistent class Behavior

2008-10-07 Thread mark_story

Hate to burst the ticket bubble.   But if after App::import('Core',
'Behavior'); the ModelBehavior class from model/behavior.php doesn't
exist, then something is broken.  But seeing as how all the core tests
are passing, and the syntax is the same everywhere, I think you might
have a dud.  But I love being wrong, and this wouldn't be the first
time ;)

-Mark

On Oct 7, 12:39 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Oct 7, 4:51 pm, kAtremer <[EMAIL PROTECTED]> wrote:
>
> > OK. It will take some time to get used to the testing, so anybody more
> > familiar with the process and methodics is welcome to pick up the bug
> > and report.
>
> What kind of pass-the-buck cop out logic is that...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model imports inexistent class Behavior

2008-10-07 Thread AD7six



On Oct 7, 4:51 pm, kAtremer <[EMAIL PROTECTED]> wrote:
> OK. It will take some time to get used to the testing, so anybody more
> familiar with the process and methodics is welcome to pick up the bug
> and report.

What kind of pass-the-buck cop out logic is that...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model imports inexistent class Behavior

2008-10-07 Thread kAtremer

OK. It will take some time to get used to the testing, so anybody more 
familiar with the process and methodics is welcome to pick up the bug 
and report.

majna wrote:
> Report ticket.
> 
> On Oct 7, 10:07 am, kAtremer <[EMAIL PROTECTED]> wrote:
>> In cake/libs/model/model.php:
>>
>> App::import('Core', array('ClassRegistry', 'Overloadable', 'Validation',
>> 'Behavior', 'ConnectionManager', 'Set', 'String'));
>>
>> I guess 'Behavior' shouldn't be there since I coundn't find such class
>> anywhere in Cake libs, only ModelBehavior is there.
>>
>> Simple pr() after "!class_exists()" in App::import() shows that import()
>> tries to load this class several dozens times a page on a moderate-size
>> project!

-- 
kAtremer
[EMAIL PROTECTED]

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



Re: Model imports inexistent class Behavior

2008-10-07 Thread majna

Report ticket.

On Oct 7, 10:07 am, kAtremer <[EMAIL PROTECTED]> wrote:
> Hello.
>
> In cake/libs/model/model.php:
>
> App::import('Core', array('ClassRegistry', 'Overloadable', 'Validation',
> 'Behavior', 'ConnectionManager', 'Set', 'String'));
>
> I guess 'Behavior' shouldn't be there since I coundn't find such class
> anywhere in Cake libs, only ModelBehavior is there.
>
> Simple pr() after "!class_exists()" in App::import() shows that import()
> tries to load this class several dozens times a page on a moderate-size
> project!
>
> --
> kAtremer
> [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model imports inexistent class Behavior

2008-10-07 Thread kAtremer

Hello.

In cake/libs/model/model.php:

App::import('Core', array('ClassRegistry', 'Overloadable', 'Validation', 
'Behavior', 'ConnectionManager', 'Set', 'String'));

I guess 'Behavior' shouldn't be there since I coundn't find such class 
anywhere in Cake libs, only ModelBehavior is there.

Simple pr() after "!class_exists()" in App::import() shows that import() 
tries to load this class several dozens times a page on a moderate-size 
project!

-- 
kAtremer
[EMAIL PROTECTED]

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