Re: Prototype require class function
| From: | Hannes Magnusson | Date: | Mon, 26 Mar 2012 14:54:19 +0000 |
| Subject: | Re: Prototype require class function | ||
| References: | 1 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-13262@lists.php.net to get a copy of this message | ||
On Mon, Mar 26, 2012 at 16:17, Morten Heebøll <motsky.hee@gmail.com> wrote:
> Hello PHP.net
>
> I'm a big fan of php to code my websites, and uses objects all over. On my
> website I have in the neighborhood of 80 classes defined in each separate
> file, which I include in my project in an inc-file using the 'Require ()'
> function. I have tested the performance and observed that it takes much
> time to include all the class-files, so I wondered.
> Is there a way to include class files for the project that do not read files
> through, but merely creates a prototype of the class. Then, when the class
> is
> initialized, the file will be loaded?
You should be using opcode cache, like apc: http://pecl.php.net/package/apc
-Hannes