Nicolas Perriault wrote:
> Kiril Angov a écrit :
>
>   
>> The the method sfLoader::loadHelpers() you use include() instead of 
>> include_once() and I am having problem with helpers which depend on each 
>> other (cannot redeclare function). So my question is why would you use 
>> include instead of include_once() because as soon as I change it to 
>> include_once it stopped giving me this fatal error (of course) and no 
>> other side effects for now. If it is a bug I will file a report, I just 
>> wanted to run it through the list first.
>>     
>
> If it is for performance purpose, we could use:
>
> function_exists('helper_function') or include('helperfile.php');
>
> But this imply naming consistency in helper function names :/
>
> Same for classes:
>
> class_exists('sfClass') or require('sfClass.class.php');
>
> The *_exists() PHP functions are a lot faster than the require/include 
> ones, and (require|include)_once ones are known to have deplorable 
> performances too.
>
> ++
>
>   
Yes, I am sure it is for performance issues. It is much faster to check 
the static variable but what I do not realize is why it fails. I always 
load my helpers with loadHelpers() so the static variable must be 
sufficient. What I want here is to keep the same static variable method 
but use include_once in case where this fails (in my case for example). 
I see no reason why not to use include_once().

Kupo

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

Reply via email to