PHP code example of stevencorona / opcache-json

1. Go to this page and download the library: Download stevencorona/opcache-json library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stevencorona / opcache-json example snippets


// By default Statsd output is disabled
// $opcache = new Opcache\Status;

// Or pass in Statsd config with an array
// $opcache = new Opcache\Status(["host" => "localhost", "port" => "8125"]);

// Or configure the Statsd connection with a block
$opcache = new Opcache\Status(function() {

  $c   = new \Domnikl\Statsd\Connection\UdpSocket("127.0.0.1", "8125");
  return new \Domnikl\Statsd\Client($c, "opcache");

});

echo $opcache->status(true);

$opcache->send_extra_stats(array (
  'opcache_enabled'     => true,
  'cache_full'          => true,
));