Changeset 111508 in spip-zone


Ignore:
Timestamp:
Sep 6, 2018, 8:23:03 AM (7 months ago)
Author:
root
Message:

Compat PHP 7.2 : create_function en moins (mais ce code est pas très à jour)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/memoization/trunk/exec/admin_memcache.php

    r89982 r111508  
    441441
    442442function dumpCacheSlab($server,$slabId,$limit){
    443     list($host,$port) = explode(':',$server);
    444     $resp = sendMemcacheCommand($host,$port,'stats cachedump '.$slabId.' '.$limit);
    445     $g = create_function('$f', 'return strpos($f, "'.$_SERVER['HTTP_HOST'].'") === 0;');
    446     foreach($resp['ITEM'] as $key=>$ignore)
    447         if (!$g($key))
    448                 unset($resp['ITEM'][$key]);
    449    return $resp;
     443        list($host, $port) = explode(':', $server);
     444        $resp = sendMemcacheCommand($host, $port, 'stats cachedump ' . $slabId . ' ' . $limit);
     445        $g = function ($f) {
     446                return strpos($f, $_SERVER['HTTP_HOST']) === 0;
     447        };
     448        foreach ($resp['ITEM'] as $key => $ignore) {
     449                if (!$g($key)) {
     450                        unset($resp['ITEM'][$key]);
     451                }
     452        }
     453        return $resp;
    450454
    451455}
Note: See TracChangeset for help on using the changeset viewer.