-
Notifications
You must be signed in to change notification settings - Fork 2
/
LocalSettingsHandler.php
36 lines (30 loc) · 1.15 KB
/
LocalSettingsHandler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace DigipolisGent\Robo\Helpers\EventHandler\DefaultHandler;
use Symfony\Component\EventDispatcher\GenericEvent;
class LocalSettingsHandler extends SettingsHandler
{
/**
* {@inheritDoc}
*/
public function handle(GenericEvent $event)
{
$this->readProperties();
$app = $event->getArgument('app');
$timestamp = $event->getArgument('timestamp');
$defaults = [
'app' => $app,
'time' => is_null($timestamp) ? $this->time : $timestamp,
'project_root' => $this->getConfig()->get('digipolis.root.project'),
'web_root' => $this->getConfig()->get('digipolis.root.web'),
'filesdir' => 'files',
];
// Set up destination config.
$replacements = array(
'[project_root]' => $this->getConfig()->get('digipolis.root.project'),
'[web_root]' => $this->getConfig()->get('digipolis.root.web'),
'[app]' => $app,
'[time]' => is_null($timestamp) ? $this->time : $timestamp,
);
return ($this->tokenReplace($this->getConfig()->get('local'), $replacements) ?? []) + $defaults;
}
}