1

Topic: admin : eAccelerator accelerator info

A little patch for eaccelerator display in admin :

Index: admin_index.php
===================================================================
--- admin_index.php    (revision 355)
+++ admin_index.php    (working copy)
@@ -138,6 +138,11 @@
// See if MMCache or PHPA is loaded
if (function_exists('mmcache'))
    $php_accelerator = '<a href="http://turck-mmcache.sourceforge.net/">Turck MMCache</a>';
+else if (function_exists('eaccelerator_info'))
+{
+    $php_accelerator_info = eaccelerator_info();
+    $php_accelerator = '<a href="http://eaccelerator.net/">eAccelerator '.$php_accelerator_info['version'].'</a>';
+}
else if (isset($_PHPA))
    $php_accelerator = '<a href="http://www.php-accelerator.co.uk/">ionCube PHP Accelerator</a>';
else

Re: admin : eAccelerator accelerator info

Thanks. Someone sent me a patch that adds a few more accelerators to the list though, so I think I will use that one in 1.3 instead.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: admin : eAccelerator accelerator info

Rickard wrote:

Thanks. Someone sent me a patch that adds a few more accelerators to the list though, so I think I will use that one in 1.3 instead.

that one was me smile

4 (edited by Richard 2006-09-27 01:44)

Re: admin : eAccelerator accelerator info

can you share it here?

I tried just adding:

else if (function_exists('eaccelerator_info'))
{
    $php_accelerator_info = eaccelerator_info();
    $php_accelerator = '<a href="http://eaccelerator.net/">eAccelerator '.$php_accelerator_info['version'].'</a>';
}

but it wasn't detecting that eAcellerator was installed.  My hoster is using 0.9.3 so I changed "eaccelerator_info" to "eaccelerator" and it does detect it now, but I get a login prompt asking for a username/password to access eAccelerator.  I assume it doesn't like the attempt to read the version #.

Re: admin : eAccelerator accelerator info

http://dev.punbb.org/file/branches/punb … _index.php

// Check for the existance of various PHP opcode caches/optimizers
if (function_exists('mmcache'))
        $php_accelerator = '<a href="Turck">http://turck-mmcache.sourceforge.net/">Turck MMCache</a>';
else if (isset($_PHPA))
        $php_accelerator = '<a href="ionCube">http://www.php-accelerator.co.uk/">ionCube PHP Accelerator</a>';
else if (ini_get('apc.enabled'))
        $php_accelerator ='<a href="Alternative">http://www.php.net/apc/">Alternative PHP Cache (APC)</a>';
else if (ini_get('zend_optimizer.optimization_level'))
        $php_accelerator = '<a href="Zend">http://www.zend.com/products/zend_optimizer/">Zend Optimizer</a>';
else if (ini_get('eaccelerator.enable'))
        $php_accelerator = '<a href="eAcceleratorhttp://eaccelerator.net/">eAccelerator</a>';
else if (ini_get('xcache.cacher'))
        $php_accelerator = '<a href="XCachehttp://trac.lighttpd.net/xcache/">XCache</a>';
else
        $php_accelerator = 'N/A';

Although it looks like you may have to fix the HTML a bit tongue

Re: admin : eAccelerator accelerator info

Thanks

I was able to get it to display the version like this:

else if (ini_get('eaccelerator.enable'))
        $php_accelerator = '<a href="http://eaccelerator.net/">eAccelerator '.EACCELERATOR_VERSION.'</a>';