phalcon/incubator-annotations

Phalcon Incubator Annotations

v1.0.0 2021-03-28 13:56 UTC

This package is auto-updated.

Last update: 2024-04-19 21:50:50 UTC


README

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_',
            ]
        );
    }
);