Jean-Baptiste Nahan 2663cd6aac Update composer.json
2019-04-02 09:20:29 +02:00
2015-07-23 18:34:46 +02:00
2015-09-24 14:52:05 +02:00
2015-09-24 14:52:05 +02:00
2015-07-21 23:18:42 +02:00
2019-04-02 09:20:29 +02:00
2015-09-24 14:56:21 +02:00

phpcache-bundle

Dependency Status Latest Stable Version Latest Unstable Version License

Install

php composer.phar require mactronique/phpcache-bundle "~1.0"

Configuration

Register Bundle

Add in your app/AppKernel.php :

new Mactronique\Bundle\PhpCacheBundle\MactroniquePhpCacheBundle(),

Write sementic configuration

Add in you app/config/config.yml

mactronique_php_cache:
    drivers:
        -
            name: xcache
        -
            name: redis
            options:
                    host: 127.0.0.1
                    port: 6379
                    password: ''
                    database: 1
                    timeout: 1
		-
			name: memcached
			options:
				-
					server: 127.0.0.1
					port: 11211
					sharing: 100
        -
            name: "null"

Use

In controller :

// Set value into key for 30 seconds
$this->get('mactronique_cache.phpcache')->set('key', 'value', 30);

// Set value into key
$this->get('mactronique_cache.phpcache')->set('key', 'value');

//get key
$this->get('mactronique_cache.phpcache')->get('key');

//check if key exists
$this->get('mactronique_cache.phpcache')->exists('key');

//remove key
$this->get('mactronique_cache.phpcache')->remove('key');

Contributing

Please fork main repo and send a pull request with your change.

Thanks your in advance !

Description
No description provided
Readme 64 KiB
Latest
2015-09-24 14:56:21 +02:00
Languages
PHP 99.7%
Twig 0.3%