1 | <?php |
||
30 | class VarsServiceProvider implements ServiceProviderInterface |
||
31 | { |
||
32 | /** |
||
33 | * The entity to use Vars with |
||
34 | * |
||
35 | * @var null |
||
36 | */ |
||
37 | private $entity; |
||
38 | |||
39 | /** |
||
40 | * The available option keys |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | private $option_keys = array( |
||
45 | 'cache', |
||
46 | 'cache_path', |
||
47 | 'cache_expire', |
||
48 | 'loaders', |
||
49 | 'replacements', |
||
50 | 'merge_globals', |
||
51 | ); |
||
52 | |||
53 | /** |
||
54 | * The service provider constructor sets the entity to use with vars |
||
55 | * |
||
56 | * @param mixed $entity The entity |
||
57 | */ |
||
58 | 4 | public function __construct($entity = null) |
|
62 | |||
63 | /** |
||
64 | * Registers the service provider, sets the user defined options and returns the vars instance |
||
65 | * |
||
66 | * @param \Silex\Application $app The silex app |
||
67 | */ |
||
68 | public function register(Application $app) |
||
90 | |||
91 | /** |
||
92 | * Creates the defined options into a way that Vars can use |
||
93 | * |
||
94 | * @param \Silex\Application $app The silex app |
||
95 | * |
||
96 | * @return array The created options |
||
97 | */ |
||
98 | 4 | private function createOptions($app) |
|
120 | |||
121 | /** |
||
122 | * Registers the service provider, sets the user defined options and returns the vars instance |
||
123 | * |
||
124 | * @param array $options The already parsed options |
||
125 | * @param array $vars_options The options defined in the Silex app |
||
126 | * |
||
127 | * @return array The keyed options |
||
128 | */ |
||
129 | 3 | private function createKeyedOptions($options, $vars_options) |
|
137 | |||
138 | /** |
||
139 | * The silex service provider boot function |
||
140 | * |
||
141 | * @param \Silex\Application $app The silex app |
||
142 | * |
||
143 | * @codeCoverageIgnore |
||
144 | */ |
||
145 | public function boot(Application $app) |
||
148 | } |
||
149 |