Re: [APC-DEV] Fwd: apc optimizations

[email protected] (Marcus Boerger) Mon, 15 Jan 2007 00:17:57 +0100
Newsgroups php.apc.dev
Message-ID <[email protected]>
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 [email protected].

> -------- Original Message --------
> Subject:        apc optimizations
> Date:   Sun, 14 Jan 2007 03:25:24 -0200
> From:   Roberto Spadim <[email protected]>
> To:     [email protected]



> 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