Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Foundation;
4
 
5
use Composer\Script\Event;
6
 
7
class ComposerScripts
8
{
9
    /**
10
     * Handle the post-install Composer event.
11
     *
12
     * @param  \Composer\Script\Event  $event
13
     * @return void
14
     */
15
    public static function postInstall(Event $event)
16
    {
17
        require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
18
 
19
        static::clearCompiled();
20
    }
21
 
22
    /**
23
     * Handle the post-update Composer event.
24
     *
25
     * @param  \Composer\Script\Event  $event
26
     * @return void
27
     */
28
    public static function postUpdate(Event $event)
29
    {
30
        require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
31
 
32
        static::clearCompiled();
33
    }
34
 
35
    /**
36
     * Handle the post-autoload-dump Composer event.
37
     *
38
     * @param  \Composer\Script\Event  $event
39
     * @return void
40
     */
41
    public static function postAutoloadDump(Event $event)
42
    {
43
        require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
44
 
45
        static::clearCompiled();
46
    }
47
 
48
    /**
49
     * Clear the cached Laravel bootstrapping files.
50
     *
51
     * @return void
52
     */
53
    protected static function clearCompiled()
54
    {
55
        $laravel = new Application(getcwd());
56
 
57
        if (is_file($configPath = $laravel->getCachedConfigPath())) {
58
            @unlink($configPath);
59
        }
60
 
61
        if (is_file($servicesPath = $laravel->getCachedServicesPath())) {
62
            @unlink($servicesPath);
63
        }
64
 
65
        if (is_file($packagesPath = $laravel->getCachedPackagesPath())) {
66
            @unlink($packagesPath);
67
        }
68
    }
69
}