예제 #1
0
 public function getTokenAction()
 {
     $token_name = $this->request->get('token_name');
     if (!$token_name) {
         $token_name = 'form_token';
     }
     $form_token = md5(uniqid(microtime(true) * 1000) . uniqid());
     $this->session->set($token_name, $form_token);
     logLog('[IP:' . $_SERVER['REMOTE_ADDR'] . '][' . $token_name . ':' . $form_token . ']');
     returnJSON(array('err' => 1, 'data' => $form_token));
 }
예제 #2
0
        }
        // Count all lines
        $nLineSource++;
    }
}
// Log reading source results
$strDescription = '- done reading ' . $nLineSource . ' lines from file (';
$strDescription .= $nLineSourceHeader . ' header, ' . $nLineSourceData . ' data, +';
$strDescription .= $nLineSourceNoData . ' empty)';
$strLine = '';
logLog(0, $strDescription, $strLine, 2);
if (0 == $nSourceError) {
    // Log no errors
    $strDescription = '- no source errors' . PHP_EOL;
    $strLine = '';
    logLog(0, $strDescription, $strLine, 2);
} else {
    // Error: source errors detected
    $strDescription = PHP_EOL . '- source errors detected: ' . $nSourceError . PHP_EOL;
    $strLine = '';
    logLog(0, $strDescription, $strLine, 2);
}
// Close source file
fclose($fSource);
# END 21.1 - Read Source #
// END inc-section
if ($bLogInc) {
    $strDescription = 'END php include <<< ' . $strIncPhpScript . ' <<<' . PHP_EOL;
    $strLine = '';
    logLog(0, $strDescription, $strLine, 2);
}
예제 #3
0
function flushExit()
{
    global $nArrError, $strStartDateTime, $bLogFileOpen, $fLog, $bErrorFileOpen, $fError;
    // PHP slutt through flushExit
    $strDescription = PHP_EOL . 'PHP start [' . $strStartDateTime . ']' . PHP_EOL;
    $strLine = '';
    logLog(0, $strDescription, $strLine, 2);
    // Error count
    if (0 < $nArrError) {
        $strDescription = '- error count = ' . $nArrError . PHP_EOL;
        $strLine = '';
        logLog(0, $strDescription, $strLine, 2);
    }
    $timeEnd = time();
    $strEndDateTime = date('Y-m-d\\TH:i:sP', $timeEnd);
    $strDescription = 'PHP slutt [' . $strEndDateTime . ']' . PHP_EOL;
    $strLine = '';
    logLog(0, $strDescription, $strLine, 2);
    // final output to log-file and error-file (if content still inside arrays)
    flushLog();
    flushError();
    // Close log-file
    if ($bLogFileOpen) {
        fclose($fLog);
        $bLogFileOpen = false;
    }
    // Close error-file
    if ($bErrorFileOpen) {
        fclose($fError);
        $bErrorFileOpen = false;
    }
}