예제 #1
0
 public function errorMessages()
 {
     if (errorSending()) {
         if (empty($_POST['number'])) {
             $this->info['number'] = 'Numéro vide ! ';
         }
         if (empty($_POST['message'])) {
             $this->info['message'] = 'Message vide !';
         }
         formSetSessionValues();
     } else {
         if (errorContact()) {
             if (empty($_POST['number'])) {
                 $this->warn['number'] = 'Numéro vide ! ';
             }
             if (empty($_POST['name'])) {
                 $this->warn['name'] = 'Nom de la personne vide !';
             }
         } else {
             if (errorList()) {
                 if (empty($_POST['list'])) {
                     $this->listoff['list'] = 'Nom de la list vide ! ';
                 }
                 if (empty($_POST['number1'])) {
                     $this->listoff['number'] = 'Vous devez renseigner 1 numéro minimum !';
                 }
             }
         }
     }
 }
예제 #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);
    }
}