Conditions | 2 |
Paths | 2 |
Total Lines | 30 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
10 | static public function bootstrap(array $config = array()) |
||
|
|||
11 | { |
||
12 | $config += array('root_dir' => __DIR__ . '/..'); |
||
13 | $config += array('conf_file' => $config['root_dir'] . '/conf/config.yml'); |
||
14 | |||
15 | $app = new \Silex\Application; |
||
16 | |||
17 | // Registers the configuration service provider so that developers can |
||
18 | // configure the app through a config file. |
||
19 | $app->register(new \Igorw\Silex\ConfigServiceProvider($config['conf_file'], array( |
||
20 | 'root_dir' => $config['root_dir'], |
||
21 | ))); |
||
22 | |||
23 | // Optionally add the monolog service provider if the "monolog.logfile" |
||
24 | // configuration option is set. |
||
25 | if (isset($app['monolog.logfile'])) { |
||
26 | $app->register(new \Silex\Provider\MonologServiceProvider()); |
||
27 | } |
||
28 | |||
29 | // Register the index and service manager as a service so we can query |
||
30 | // our Acquia Search indexes. |
||
31 | $app->register(new \Acquia\Search\Proxy\Silex\AcquiaSearchIndexProvider()); |
||
32 | |||
33 | // Dispatch the "acquia.search.proxy.bootstrap" event so that developers |
||
34 | // can hook into the bootstrap process and add their providers. |
||
35 | $event = new Event\AppEvent($app); |
||
36 | $app['dispatcher']->dispatch(AppEvents::BOOTSTRAP, $event); |
||
37 | |||
38 | return $app; |
||
39 | } |
||
40 | } |
||
41 |