2017 © Pedro Peláez
 

library cachetool-bundle

CacheTool Symfony2 Bundle

image

gordalina/cachetool-bundle

CacheTool Symfony2 Bundle

  • Thursday, February 12, 2015
  • by gordalina
  • Repository
  • 3 Watchers
  • 21 Stars
  • 35,472 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 9 Versions
  • 5 % Grown

The README.md

CacheToolBundle

This bundle allows you to integrate CacheTool with Symfony2., (*1)

Installation

{
    "require": {
        "gordalina/cachetool-bundle": "~1.0"
    }
}

Register the bundle in app/Appkernel.php:, (*2)

// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new CacheTool\Bundle\CacheToolBundle(),
    );
}

Enable the bundle's configuration in app/config/config.yml:, (*3)

# app/config/config.yml
cache_tool: ~

Configuration

There are two adapters, (*4)

  1. CLI
# app/config/config.yml
cache_tool:
    adapter: cli
  1. FastCGI
# app/config/config.yml
cache_tool:
    adapter: fastcgi
    fastcgi: 127.0.0.1:900

You can also connect by socket replacing the above by: /var/run/php5-fpm.sock., (*5)

If you don’t need apc or opcache you can disable it by setting it to false:, (*6)

# app/config/config.yml
cache_tool:
    apc: false
# app/config/config.yml
cache_tool:
    opcache: false

Usage

Commands

  cachetool:apc:bin:dump                   Get a binary dump of files and user variables
  cachetool:apc:bin:load                   Load a binary dump into the APC file and user variables
  cachetool:apc:cache:info                 Shows APC user & system cache information
  cachetool:apc:cache:info:file            Shows APC file cache information
  cachetool:apc:key:delete                 Deletes an APC key
  cachetool:apc:key:exists                 Checks if an APC key exists
  cachetool:apc:key:fetch                  Shows the content of an APC key
  cachetool:apc:key:store                  Store an APC key with given value
  cachetool:apc:sma:info                   Show APC shared memory allocation information
  cachetool:cache:clear:dump               Clears APC cache (user, system or all)
  cachetool:opcache:configuration          Get configuration information about the cache
  cachetool:opcache:reset                  Resets the contents of the opcode cache
  cachetool:opcache:status                 Show summary information about the opcode cache
  cachetool:opcache:status:scripts         Show scripts in the opcode cache

Service

You can access all apc and opcode functions through the cachetool service., (*7)


$cache = $container->get('cachetool'); $cache->apc_clear_cache('both'); // or $cache->opcache_reset();

Extending CacheTool

CacheTool depends on Proxies to provide functionality, by default when creating a CacheTool instance from the factory all proxies are enabled ApcProxy, OpcacheProxy and PhpProxy, you can customize it or extend to your will like the example below:, (*8)

use CacheTool\Adapter\FastCGI;
use CacheTool\CacheTool;
use CacheTool\Proxy;

$adapter = new FastCGI('/var/run/php5-fpm.sock');
$cache = new CacheTool();
$cache->setAdapter($adapter);
$cache->addProxy(new Proxy\ApcProxy());
$cache->addProxy(new Proxy\PhpProxy());

You can read more information at CacheTool's page., (*9)

License

This bundle is released under the MIT license. See the complete license in the bundle., (*10)

The Versions

12/02 2015

dev-master

9999999-dev

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires

 

cache apc symfony2 bundle opcache

12/02 2015

1.7.0

1.7.0.0

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires

 

cache apc symfony2 bundle opcache

15/01 2015

1.6.2

1.6.2.0

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires

 

cache apc symfony2 bundle opcache

09/01 2015

1.6.1

1.6.1.0

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires

 

cache apc symfony2 bundle opcache

09/01 2015

1.5.0

1.5.0.0

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires

 

cache apc symfony2 bundle opcache

23/09 2014

1.2.1

1.2.1.0

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires

 

cache apc symfony2 bundle opcache

23/09 2014

1.2.0

1.2.0.0

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires

 

cache apc symfony2 bundle opcache

23/09 2014

1.0.1

1.0.1.0

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires

 

23/09 2014

1.0.0

1.0.0.0

CacheTool Symfony2 Bundle

  Sources   Download

MIT

The Requires