2013-06-26 13:15:43 -04:00
|
|
|
<?php
|
2013-06-26 14:54:37 -04:00
|
|
|
CLI::taskName("hotfix-install");
|
2013-06-26 13:15:43 -04:00
|
|
|
|
|
|
|
|
CLI::taskDescription(<<<EOT
|
2013-06-26 14:54:37 -04:00
|
|
|
Install hotfix to system
|
2013-06-26 13:15:43 -04:00
|
|
|
|
|
|
|
|
This command is executed when you want to update certain files, which have improvements or solution to bugs.
|
|
|
|
|
EOT
|
|
|
|
|
);
|
|
|
|
|
|
2013-06-26 14:54:37 -04:00
|
|
|
CLI::taskRun(runHotfixInstall);
|
2013-06-26 13:15:43 -04:00
|
|
|
|
2013-06-26 14:54:37 -04:00
|
|
|
function runHotfixInstall($command, $args)
|
2013-06-26 13:15:43 -04:00
|
|
|
{
|
2013-06-26 14:54:37 -04:00
|
|
|
CLI::logging("HOTFIX", PATH_DATA . "log" . PATH_SEP . "upgrades.log");
|
|
|
|
|
CLI::logging("Install hotfix to system\n");
|
2013-06-26 13:15:43 -04:00
|
|
|
|
|
|
|
|
$arrayFile = $command;
|
|
|
|
|
|
|
|
|
|
if (count($arrayFile) > 0) {
|
2013-06-26 14:54:37 -04:00
|
|
|
//Install hotfix
|
2013-06-26 13:15:43 -04:00
|
|
|
foreach ($arrayFile as $value) {
|
|
|
|
|
$f = $value;
|
|
|
|
|
|
2013-06-26 14:54:37 -04:00
|
|
|
$result = workspaceTools::hotfixInstall($f);
|
2013-06-26 13:15:43 -04:00
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
2013-06-26 14:54:37 -04:00
|
|
|
CLI::logging("HOTFIX done\n");
|
2013-06-26 13:15:43 -04:00
|
|
|
} else {
|
2013-06-26 14:54:37 -04:00
|
|
|
CLI::logging("Not exist hotfixes to install in the command\n");
|
2013-06-26 13:15:43 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|