README.rst
1Metadata is a library for class/method/property metadata management in PHP
2==========================================================================
3
4Overview
5--------
6
7This library provides some commonly needed base classes for managing metadata
8for classes, methods and properties. The metadata can come from many different
9sources (annotations, YAML/XML/PHP configuration files).
10
11The metadata classes are used to abstract away that source and provide a common
12interface for all of them.
13
14Usage
15-----
16
17The library provides three classes that you can extend to add your application
18specific properties, and flags: ``ClassMetadata``, ``MethodMetadata``, and
19``PropertyMetadata``
20
21After you have added, your properties in sub-classes, you also need to add
22``DriverInterface`` implementations which know how to populate these classes
23from the different metadata sources.
24
25Finally, you can use the ``MetadataFactory`` to retrieve the metadata::
26
27 <?php
28
29 use Metadata\MetadataFactory;
30 use Metadata\Driver\DriverChain;
31
32 $driver = new DriverChain(array(
33 /** Annotation, YAML, XML, PHP, ... drivers */
34 ));
35 $factory = new MetadataFactory($driver);
36 $metadata = $factory->getMetadataForClass('MyNamespace\MyObject');
37
38