|
Posted by mootmail-googlegroups on 09/14/06 12:25
ngocviet wrote:
> Sorry for the noob question!
> My project have alot class files(>100), in one request I only need some
> class(1-5), but I dont like to have to specifies needed files so I make
> a include.php, that include all my class files.
>
> In action file, I only include the include.php! Is it good for
> performent? Does it make any problem?
>
> Thanks!
No, it is not good for performance, as has already been stated.
The bright side is that you don't have to specify each include that you
need to use seperately anymore. Have a look at autoload [1]. With
this function, you tell php that whenever I want an ABC object, include
the file class.ABC.php, or whatever naming convention you are using.
This way, php only includes the files which are referenced in your
code. Just define it in your include.php file and you'll never have to
think about it again.
*Disclaimer: PHP 5 only
[1] - http://us3.php.net/manual/en/language.oop5.autoload.php
[Back to original message]
|