News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[4350] Only shows one caching engine even if multiple are available

Started by shinji257, July 10, 2010, 02:22:51 AM

Previous topic - Next topic

shinji257

I have multiple caching systems installed on my system.  I setup both memcached and APC on the server.  When APC is disabled it will gladly show that memcached is available.  When I enable APC then it only reveals that one but memcached is never reported as being available on the server.  I do believe I have narrowed down where the bug is probably at if it is even a bug at all.


        // Detect an optimizer?
        if (function_exists('eaccelerator_put'))
                $detected = 'eAccelerator';
        elseif (function_exists('mmcache_put'))
                $detected = 'MMCache';
        elseif (function_exists('apc_store'))
                $detected = 'APC';
        elseif (function_exists('output_cache_put'))
                $detected = 'Zend';
        elseif (function_exists('memcache_set'))
                $detected = 'Memcached';
        elseif (function_exists('xcache_set'))
                $detected = 'XCache';
        else
                $detected = 'no_caching';

        $context['settings_message'] = sprintf($context['settings_message'], $txt['detected_' . $detected]);[code]

[/code]

Now then this may be purely cosmetic given the above code.  So my question comes around.  If I fill in the memcached setting field will it take advantage of both APC and memcached anyways?

Forgot this may be useful -- http://esminefield.net/phpinfo.php [nofollow]

Kill Em All

Sorry for getting to this late. Unfortunately, I'm unable to test this, however, I will move this to the Bug Reports board.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

live627


Kill Em All



My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

live627

Confirmed. Says APC when I also have XCache.

live627

OK. Here is my proposed ix (clunky as it may be):

./Sources/ManageServer.php

Code (Find) Select
if (function_exists('eaccelerator_put'))
$detected = 'eAccelerator';
elseif (function_exists('mmcache_put'))
$detected = 'MMCache';
elseif (function_exists('apc_store'))
$detected = 'APC';
elseif (function_exists('output_cache_put'))
$detected = 'Zend';
elseif (function_exists('memcache_set'))
$detected = 'Memcached';
elseif (function_exists('xcache_set'))
$detected = 'XCache';
else
$detected = 'no_caching';

$context['settings_message'] = sprintf($context['settings_message'], $txt['detected_' . $detected]);


Code (Replace with) Select
$detected = array();

// Detect an optimizer?
if (function_exists('eaccelerator_put'))
$detected[] = 'eAccelerator';
if (function_exists('mmcache_put'))
$detected[] = 'MMCache';
if (function_exists('apc_store'))
$detected[] = 'APC';
if (function_exists('output_cache_put'))
$detected[] = 'Zend';
if (function_exists('memcache_set'))
$detected[] = 'Memcached';
if (function_exists('xcache_set'))
$detected[] = 'XCache';

$installed = implode(', ', $detected);

if (empty($detected))
$context['settings_message'] = sprintf($context['settings_message'], $txt['detected_no_caching']);

$context['settings_message'] = sprintf($context['settings_message'], sprintf($txt['detected_accelerators'], $installed));


./Themes/default/languages/ManageSettings.php

Code (Find) Select
$txt['detected_APC'] = '<strong style="color: green">SMF has detected that your server has APC installed.</strong>';
$txt['detected_eAccelerator'] = '<strong style="color: green">SMF has detected that your server has eAccelerator installed.</strong>';
$txt['detected_MMCache'] = '<strong style="color: green">SMF has detected that your server has MMCache installed.</strong>';
$txt['detected_Zend'] = '<strong style="color: green">SMF has detected that your server has Zend installed.</strong>';
$txt['detected_Memcached'] = '<strong style="color: green">SMF has detected that your server has Memcached installed.</strong>';
$txt['detected_XCache'] = '<strong style="color: green">SMF has detected that your server has XCache installed.</strong>';


Code (Replace with) Select
$txt['detected_accelerators'] = '<strong style="color: green">SMF has detected the following accelerators: %1$s</strong>';

Again, it seems clunky and slow, but it's a quick fix that works.

Kill Em All



My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

live627


Acans

"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

live627

Is it hidden for a reason? Access denied to regular members...

Norv

Quote from: live627 on July 17, 2010, 02:25:29 PM
Is it hidden for a reason? Access denied to regular members...

It should be visible... I think. I'll check.

ETA: you're right, sorry about that. It was moved to an area dedicated to the next version of SMF, where not all features or issues discussed are public yet. :) (they would become public, in time, as the next version becomes current version).

I will see what I can do, as 2.0 final approaches, to lift some of the veil as soon as we can.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

live627


Norv

Yes.
Well, as I said, I will try to see about us making at least the acknowledged or proposed bugs to solve - publicly known. :)

The rest is a surprise for now. ;)
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github


Advertisement: