Completed
Push — master ( cf0b9a...c06f64 )
by Iurii
01:19
created

Main::hookModuleDisableAfter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * @package Jquery File Upload
5
 * @author Iurii Makukh <[email protected]>
6
 * @copyright Copyright (c) 2017, Iurii Makukh <[email protected]>
7
 * @license https://www.gnu.org/licenses/gpl-3.0.en.html GPL-3.0+
8
 */
9
10
namespace gplcart\modules\jquery_file_upload;
11
12
use gplcart\core\Library;
13
14
/**
15
 * Main class for Jquery File Upload module
16
 */
17
class Main
18
{
19
20
    /**
21
     * Library class instance
22
     * @var \gplcart\core\Library $library
23
     */
24
    protected $library;
25
26
    /**
27
     * @param Library $library
28
     */
29
    public function __construct(Library $library)
30
    {
31
        $this->library = $library;
32
    }
33
34
    /**
35
     * Implements hook "library.list"
36
     * @param array $libraries
37
     */
38
    public function hookLibraryList(array &$libraries)
39
    {
40
        $libraries['jquery_file_upload'] = array(
41
            'name' => /* @text */'jQuery File Upload',
42
            'description' => /* @text */'File Upload widget with multiple file selection, drag&drop support, progress bars, validation and preview images, audio and video for jQuery',
43
            'type' => 'asset',
44
            'module' => 'jquery_file_upload',
45
            'url' => 'https://github.com/blueimp/jQuery-File-Upload',
46
            'download' => 'https://github.com/blueimp/jQuery-File-Upload/archive/v9.19.1.zip',
47
            'version_source' => array(
48
                'file' => 'vendor/jquery-file-upload/package.json'
49
            ),
50
            'files' => array(
51
                'vendor/jquery-file-upload/js/jquery.fileupload.js'
52
            ),
53
        );
54
    }
55
56
    /**
57
     * Implements hook "module.enable.after"
58
     */
59
    public function hookModuleEnableAfter()
60
    {
61
        $this->library->clearCache();
62
    }
63
64
    /**
65
     * Implements hook "module.disable.after"
66
     */
67
    public function hookModuleDisableAfter()
68
    {
69
        $this->library->clearCache();
70
    }
71
72
    /**
73
     * Implements hook "module.install.after"
74
     */
75
    public function hookModuleInstallAfter()
76
    {
77
        $this->library->clearCache();
78
    }
79
80
    /**
81
     * Implements hook "module.uninstall.after"
82
     */
83
    public function hookModuleUninstallAfter()
84
    {
85
        $this->library->clearCache();
86
    }
87
88
}
89