GlisWeb framework
_cache.php
Vai alla documentazione di questo file.
1 <?php
2 
14  // inclusione del framework
15  require '../../../_src/_config.php';
16 
17  // inizio output
18  $tx = 'cache attive: ' . PHP_EOL;
19 
20  // OPcache
21  if( function_exists( 'opcache_get_configuration' ) ) {
22  $tx .= 'OPCache attivo' . PHP_EOL;
23  $tx .= print_r( opcache_get_configuration(), true );
24  $tx .= print_r( opcache_get_status(), true );
25  } else {
26  $tx .= 'OPCache non attivo' . PHP_EOL;
27  }
28 
29  // Memcache
30  if( ! empty( $cf['memcache']['connection'] ) ) {
31  $st = memcache_get_stats( $cf['memcache']['connection'] );
32  memcacheWrite( $cf['memcache']['connection'], 'test', 'TEST' );
33  $tx .= 'Memcache attivo' . PHP_EOL;
34  $tx .= print_r( $cf['memcache'], true );
35  $tx .= 'test di lettura: ' . memcacheRead( $cf['memcache']['connection'], 'test' ) . PHP_EOL;
36  $tx .= print_r( $st, true );
37  $tx .= writeByte( $st['bytes'] ) . ' usati su ' . writeByte( $st['limit_maxbytes'] ) . PHP_EOL;
38  $tx .= sprintf( '%01.2f', $st['bytes'] * 100 / $st['limit_maxbytes'] ) . '% in uso' . PHP_EOL;
39  $tx .= 'trovati ' . $st['get_hits'] . ' oggetti contro ' . $st['get_misses'] . ' non trovati' . PHP_EOL;
40  $tx .= sprintf( '%01.2f', $st['get_hits'] * 100 / $st['cmd_get'] ) . '% trovati' . PHP_EOL;
41  } else {
42  $tx .= 'Memcache non attivo' . PHP_EOL;
43  }
44 
45  // output
46  build( $tx );
47 
48 ?>
$tx
Definition: _cache.php:18
$st['esito']
writeByte( $filesize)
$cf['ricerca']['template']
Definition: _030.common.php:7
memcacheRead( $conn, $key)
memcacheWrite( $conn, $key, $data, $ttl=MEMCACHE_DEFAULT_TTL, $seed=MEMCACHE_UNIQUE_SEED)
build( $content, $type=MIME_TEXT_PLAIN, $encoding=ENCODING_UTF8, $headers=array())