2017 © Pedro Peláez
 

symfony-bundle class-meta-bundle

Symfony bundle to add arbitrary metadata to classes and their constants by annotation

image

ashleydawson/class-meta-bundle

Symfony bundle to add arbitrary metadata to classes and their constants by annotation

  • Tuesday, December 12, 2017
  • by AshleyDawson
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,431 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 46 % Grown

The README.md

Class Meta Bundle

Symfony bundle for my Class Meta library. This allows you to attach arbitrary metadata to classes and their constants via annotation., (*1)

Installation

To install via composer, use the following command:, (*2)

$ composer require ashleydawson/class-meta-bundle

And then add the bundle to the AppKernel#registerBundles() method:, (*3)

$bundles = [
    // ...
    new AshleyDawson\ClassMetaBundle\AshleyDawsonClassMetaBundle(),
];

Configuration

Configuration allows you to set a cache provider. By default the cache provider is ArrayCache - so in production, I'd advise you change this to a more persistent cache strategy:, (*4)

# app/config/config.yml

services:
    my_class_meta_cache_provider:
        class: Doctrine\Common\Cache\FilesystemCache
        arguments: [ "%kernel.cache_dir%/ashleydawson/class_meta" ]

ashley_dawson_class_meta:
    cache_provider_service_id: my_class_meta_cache_provider # Cache provider service ID (optional)
    cache_provider_ttl: 300 # 5 minutes TTL (optional)

Note: The cache is invalidated by file modify time, but if you want to also add a TTL (Time-to-live) to the cache it can be done via the cache_provider_ttl parameter., (*5)

Note: To disable the cache, simply pass the id of a Doctrine\Common\Cache\VoidCache service., (*6)

Basic Usage

To use the meta cache manager service in a controller, simply do:, (*7)

public function indexAction()
{
    $meta = $this->get('ashleydawson.class_meta')->getClassConstantsMeta('AppBundle\Enum\MyEnum');

    dump($meta);
}

For more documentation, please see the full library readme., (*8)

The Versions

12/12 2017

dev-master

9999999-dev

Symfony bundle to add arbitrary metadata to classes and their constants by annotation

  Sources   Download

MIT

The Requires

 

by Ashley Dawson

class metadata meta annotation constant

12/12 2017

4.0.0

4.0.0.0

Symfony bundle to add arbitrary metadata to classes and their constants by annotation

  Sources   Download

MIT

The Requires

 

by Ashley Dawson

class metadata meta annotation constant

19/05 2016

1.0.2

1.0.2.0

Symfony bundle to add arbitrary metadata to classes and their constants by annotation

  Sources   Download

MIT

The Requires

 

by Ashley Dawson

class metadata meta annotation constant

19/05 2016

1.0.1

1.0.1.0

Symfony bundle to add arbitrary metadata to classes and their constants by annotation

  Sources   Download

MIT

The Requires

 

by Ashley Dawson

class metadata meta annotation constant