Esempio n. 1
0
        buildFilesList($cache, $files_list, GIT, $exclude_files, $folders[$x]);
    }
}
if (0 == errorCount() && $cache[1] == GITNEW) {
    downloadFiles($files_list);
}
if (0 == errorCount()) {
    backupFiles($tmp_folder, $files_list);
}
if (0 == errorCount()) {
    copyFiles($files_list);
}
if (0 == errorCount()) {
    $dbupdate = updateDB($nuConfigDBHost, $nuConfigDBName, $nuConfigDBUser, $nuConfigDBPassword);
}
if (errorCount() > 0) {
    $finalResult['message'] = 'ERRORS';
} else {
    $finalResult['message'] = 'SUCCESS';
}
$successCount = count($success);
$finalResult['errors'] = $errors;
$finalResult['success'] = array("{$successCount} File(s) updated");
$finalResult['cache'] = $cache;
$finalResult['dbupdate'] = $dbupdate;
$json = json_encode($finalResult);
//flush();
header('Content-Type: application/json');
echo $json;
function checkGlobeadmin($nuConfigDBHost, $nuConfigDBName, $nuConfigDBUser, $nuConfigDBPassword)
{
Esempio n. 2
0
function error_handler($code, $message, $file, $line, $context = false)
{
    $isError = true;
    errorCount($code, false);
    $errortype = getErrorType($code);
    errorList($errortype . "(" . $code . ") at {$file} : {$line} - " . $message, false);
    global $errIgnore, $errIgnoreCode, $errIgnorePattern, $ignoreErrorCount, $ignoreErrorFile, $ignoreErrorFolder, $errorFolder, $errorFile, $ignoreDebug;
    if ($ignoreDebug) {
        return true;
    }
    $errIgnoreCode = array(2);
    if (function_exists("phptrace_ignore_code")) {
        $arrNewIgnoreCode = phptrace_ignore_code();
        if ($arrNewIgnoreCode) {
            foreach ($arrNewIgnoreCode as $code) {
                $errIgnoreCode[] = $code;
            }
        }
    }
    if (isset($errorFile) && !empty($errorFile) || isset($errorFolde) && !empty($errorFolder)) {
        $isError = false;
        if (isset($errorFile) && in_array($file, $errorFile)) {
            $isError = true;
        }
        if (!$isError) {
            if (!empty($errorFolder)) {
                foreach ($errorFolder as $f) {
                    if (strpos($file, $f) === 0) {
                        $isError = true;
                        break;
                    }
                }
            }
        }
    } else {
        if (isset($ignoreErrorFile) && in_array($file, $ignoreErrorFile)) {
            $isError = false;
        } else {
            if (isset($ignoreErrorFolder)) {
                foreach ($ignoreErrorFolder as $f) {
                    if (strpos($file, $f) === 0) {
                        $isError = false;
                        break;
                    }
                }
            }
        }
    }
    if (empty($errIgnore)) {
        $errIgnore = array();
    }
    if (empty($errIgnoreCode)) {
        $errIgnoreCode = array();
    }
    if (empty($errIgnorePattern)) {
        $errIgnorePattern = array();
    }
    //$arrIgnore=null;
    //$arrIgnore[]="E_STRICT";
    ///skipping the error of ignore specified in config.xml
    if (in_array($errortype, $errIgnore) || in_array($code, $errIgnoreCode)) {
        $isError = false;
    }
    foreach ($errIgnorePattern as $pattern) {
        if (strpos($message, $pattern) !== false) {
            $isError = false;
            break;
        }
    }
    if (!$isError) {
        return true;
    }
    if (isset($ignoreErrorCount) && $ignoreErrorCount > 0 && errorCount($code) < $ignoreErrorCount) {
        trace($code . ": " . $message . "<br /> File:" . $file . ", Line:" . $line, $ignoreErrorCount + 1, false, true, false, false, $context);
    } else {
        trace($code . ": " . $message . "<br /> File:" . $file . ", Line:" . $line, null, false, true, false, false, $context);
    }
}