Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 1.07 KB

README.md

File metadata and controls

50 lines (41 loc) · 1.07 KB

Phalcon\Incubator\Annotations

Usage examples of the adapters available here:

Memcached

Stores the parsed annotations to Memcached. This adapter uses a Phalcon\Cache\Adapter\Libmemcached backend to store the cached content:

use Phalcon\Incubator\Annotations\Adapter\Memcached;

$di->set(
    'annotations',
    function () {
        return new Memcached(
            [
                'lifetime' => 8600,
                'host'     => 'localhost',
                'port'     => 11211,
                'weight'   => 1,
                'prefix'   => 'prefix.',
            ]
        );
    }
);

Redis

Stores the parsed annotations to Redis. This adapter uses a Phalcon\Cache\Adapter\Redis backend to store the cached content:

use Phalcon\Incubator\Annotations\Adapter\Redis;

$di->set(
    'annotations',
    function () {
        return new Redis(
            [
                'lifetime' => 8600,
                'host'     => 'localhost',
                'port'     => 6379,
                'prefix'   => 'annotations_',
            ]
        );
    }
);