File size: 1,166 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
CLI::taskName("hotfix-install");

CLI::taskDescription(<<<EOT
    Install hotfix to system

    This command installs a hotfix, which updates ProcessMaker in order to add improvements or fix bugs.
EOT
);

CLI::taskRun("runHotfixInstall");

function runHotfixInstall($command, $args)
{
    CLI::logging("HOTFIX", PATH_DATA . "log" . PATH_SEP . "upgrades.log");
    CLI::logging("Install hotfix to system\n");

    $arrayFile = $command;

    if (count($arrayFile) > 0) {
        //Install hotfix
        foreach ($arrayFile as $value) {
            $f = $value;

            $result = WorkspaceTools::hotfixInstall($f);

            CLI::logging($result["message"] . "\n");
        }

        //Clear server's cache
        CLI::logging("\nClearing cache...\n");

        if (defined("PATH_C")) {
            G::rm_dir(PATH_C);
            G::mk_dir(PATH_C, 0777);
        }

        //Safe upgrade for JavaScript files
        CLI::logging("\nSafe upgrade for files cached by the browser\n\n");

        G::browserCacheFilesSetUid();

        CLI::logging("HOTFIX done\n");
    } else {
        CLI::logging("Please specify the hotfix to install\n");
    }
}