Re: [APC-DEV] Fwd: apc optimizations
| From: | Marcus Boerger | Date: | Sun, 14 Jan 2007 23:17:57 +0000 |
| Subject: | Re: [APC-DEV] Fwd: apc optimizations | ||
| References: | 1 | Groups: | php.apc.dev |
| Request: | Send a blank email to php-apc-dev+get-43@lists.php.net to get a copy of this message | ||
Hello,
Try data streams? See here:
marcus@zaphod /usr/src/php-cvs $ php -d allow_url_include=1 -r 'include "data:,<?php
echo \"Hello World\n\";";'
make: `sapi/cli/php' is up to date.
Hello World
marcus@zaphod /usr/src/php-cvs $ php -d allow_url_include=0 -r 'include "data:,<?php
echo \"Hello World\n\";";'
make: `sapi/cli/php' is up to date.
Warning: include() [http://www.php.net/manualfunction.include.php]: URL file-access is disabled in
the server configuration in Command line code on line 1
Warning: include(data:,<?php echo "Hello World
";) [http://www.php.net/manualfunction.include.php]: failed to open stream: no suitable wrapper
could be found in Command line code on line 1
Warning: include() [http://www.php.net/manualfunction.include.php]: Failed opening
'data:,<?php echo "Hello World
";' for inclusion (include_path='.') in Command line code on line 1
marcus@zaphod /usr/src/php-cvs $
Sunday, January 14, 2007, 11:00:31 PM, you wrote:
> Forwarding to apc-dev@lists.php.net.
> -------- Original Message --------
> Subject: apc optimizations
> Date: Sun, 14 Jan 2007 03:25:24 -0200
> From: Roberto Spadim <roberto@spadim.com.br>
> To: edink@emini.dk
> hello see my code first:
> <?
> $new_file='/tmp/tmpfile';
> if (!file_exists($new_file)){
> $read='';
> $files=array( many php files );
> foreach($files as file)
> $read.=file_get_contets($file);
> file_put_contents($newfile,$read);
> }
> include($newfile);
?>>
> that's the fastest way that i got to include many files, since reading
> file we need access a disk or get from "ramfs" or "tempfs" we have about
> ~1 ms for pentium 3 machine to read that file
> could we implement an apc_fetch_and_eval() ? for example, we apc_put()
> some variable and eval it when it exists, i don't do it with
> eval(file_get_contents) because eval is slower than include, can we
> optimize this code? thankx
> (i didn't found the apc developer list)
Best regards,
Marcus