File size: 743 Bytes
07c3cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<?php

namespace ProcessMaker\Plugins\Traits;

/**
 * Trait Init
 * @package ProcessMaker\Plugins\Traits
 */
trait Init
{
    /**
     * Initialization of functions and others of a plugin
     */
    public function init()
    {
        $this->initFunction();
    }

    /**
     * Initialization of plugin pmFunctions
     */
    private function initFunction()
    {
        $pmFunctions = $this->getPmFunctions();
        foreach ($pmFunctions as $namespace) {
            $filePmFunctions = PATH_PLUGINS . $namespace . PATH_SEP . 'classes' . PATH_SEP . 'class.pmFunctions.php';
            if (file_exists($filePmFunctions) && $this->isEnable($namespace)) {
                include_once($filePmFunctions);
            }
        }
    }

}