forked from Spea/SpBowerBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCacheCreateListener.php
56 lines (48 loc) · 1.28 KB
/
CacheCreateListener.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
* This file is part of the SpBowerBundle package.
*
* (c) Martin Parsiegla <martin.parsiegla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sp\BowerBundle\EventListener;
use Sp\BowerBundle\Bower\Bower;
use Sp\BowerBundle\Bower\Event\BowerCommandEvent;
use Sp\BowerBundle\Bower\Event\BowerEvent;
use Sp\BowerBundle\Bower\Event\BowerEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* @author Martin Parsiegla <martin.parsiegla@gmail.com>
*/
class CacheCreateListener implements EventSubscriberInterface
{
/**
* @var \Sp\BowerBundle\Bower\Bower
*/
protected $bower;
/**
* @param \Sp\BowerBundle\Bower\Bower $bower
*/
public function __construct(Bower $bower)
{
$this->bower = $bower;
}
/**
* @param \Sp\BowerBundle\Bower\Event\BowerEvent $event
*/
public function onPostInstall(BowerEvent $event)
{
$this->bower->createDependencyMappingCache($event->getConfiguration());
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return array(
BowerEvents::POST_INSTALL => array('onPostInstall', 0),
);
}
}