Main::hookJobHandlers()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
/**
4
 * @package Skeleton module
5
 * @author Iurii Makukh <[email protected]>
6
 * @copyright Copyright (c) 2015, Iurii Makukh
7
 * @license https://www.gnu.org/licenses/gpl.html GNU/GPLv3
8
 */
9
10
namespace gplcart\modules\skeleton;
11
12
/**
13
 * Main class for Skeleton module
14
 */
15
class Main
16
{
17
18
    /**
19
     * Implements hook "route.list"
20
     * @param array $routes
21
     */
22
    public function hookRouteList(array &$routes)
23
    {
24
        $routes['admin/tool/skeleton'] = array(
25
            'menu' => array('admin' => 'Skeleton'),
26
            'handlers' => array(
27
                'controller' => array('gplcart\\modules\\skeleton\\controllers\\Skeleton', 'editSkeleton')
28
            )
29
        );
30
    }
31
32
    /**
33
     * Implements hook "job.handlers"
34
     * @param array $handlers
35
     */
36
    public function hookJobHandlers(array &$handlers)
37
    {
38
        $handlers['skeleton'] = array(
39
            'handlers' => array(
40
                'process' => array('gplcart\\modules\\skeleton\\handlers\\Extract', 'process')
41
            ),
42
        );
43
    }
44
45
    /**
46
     * Implements hook "cron.run.after"
47
     */
48
    public function hookCronRunAfter()
49
    {
50
        gplcart_file_empty(gplcart_file_private_module('skeleton'), array('zip'), 24 * 60 * 60);
51
    }
52
53
}
54