PM-1060: I changed the path of cron execution

This commit is contained in:
Paula V. Quispe
2015-06-17 15:25:21 -04:00
parent 8bff906b3f
commit 1c6c576629
2 changed files with 4 additions and 30 deletions

View File

@@ -11,7 +11,7 @@ try {
if (!$flagPathToCron) {
//Path to CRON by __FILE__
$arrayAux = explode(PATH_SEP, str_replace("engine" . PATH_SEP . "plugins" . PATH_SEP . "ldapAdvanced" . PATH_SEP . "bin", "", dirname(__FILE__)));
$arrayAux = explode(PATH_SEP, str_replace("engine" . PATH_SEP . "bin", "", dirname(__FILE__)));
array_pop($arrayAux);
@@ -21,32 +21,6 @@ try {
}
}
if (!$flagPathToCron) {
//Path to CRON by symlink
if ($osIsLinux) {
exec("pwd", $arrayOutput);
if (count($arrayOutput) > 0) {
$arrayPathAux = array(
"engine" . PATH_SEP . "plugins",
"engine" . PATH_SEP . "plugins" . PATH_SEP . "ldapAdvanced" . PATH_SEP . "bin"
);
foreach ($arrayPathAux as $value) {
$arrayAux = explode(PATH_SEP, str_replace($value, "", trim($arrayOutput[0])));
array_pop($arrayAux);
if (count($arrayAux) > 0 && $arrayAux[count($arrayAux) - 1] == "workflow") {
$arrayPathToCron = $arrayAux;
$flagPathToCron = true;
break;
}
}
}
}
}
if (!$flagPathToCron) {
throw new Exception("Error: Unable to execute the LDAP Advanced CRON, the path is incorrect");
}
@@ -136,7 +110,7 @@ try {
file_put_contents(PATH_DATA . "ldapcron", serialize($arrayCron));
try {
$ldapCronSinglePath = PATH_PLUGINS . "ldapAdvanced" . PATH_SEP . "bin" . PATH_SEP . "ldapcron_single.php";
$ldapCronSinglePath = PATH_HOME . "engine" . PATH_SEP . "bin" . PATH_SEP . "ldapcron_single.php";
$workspace = "";

View File

@@ -465,8 +465,8 @@ try {
eprintln("Processing workspace: " . $workflow, "green");
try {
require_once(PATH_PLUGINS . "ldapAdvanced" . PATH_SEP . "class.ldapAdvanced.php");
require_once(PATH_PLUGINS . "ldapAdvanced" . PATH_SEP . "services" . PATH_SEP . "ldapadvanced.php");
require_once(PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.ldapAdvanced.php");
require_once(PATH_HOME . "engine" . PATH_SEP . "services" . PATH_SEP . "ldapadvanced.php");
$obj = new ldapadvancedClassCron();