本文整理汇总了PHP中errorLog函数的典型用法代码示例。如果您正苦于以下问题:PHP errorLog函数的具体用法?PHP errorLog怎么用?PHP errorLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了errorLog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: failRequest
function failRequest($message)
{
errorLog("There was an error in the edit group request: " . $message);
$response = array("success" => FALSE, "message" => $message);
echo json_encode($response);
exit;
}
示例2: newWorksheetForGroup
function newWorksheetForGroup($staff, $setid, $worksheetid, $duedate, $level, $type)
{
global $userid, $userval;
$postData = array("type" => "NEW", "userid" => $userid, "userval" => $userval);
if (isset($staff[0])) {
$postData["staff"] = $staff[0];
}
if (isset($staff[1])) {
$postData["addstaff1"] = $staff[1];
}
if (isset($staff[2])) {
$postData["addstaff2"] = $staff[2];
}
if (isset($setid)) {
$postData["set"] = $setid;
}
if (isset($worksheetid)) {
$postData["worksheet"] = $worksheetid;
}
if (isset($duedate)) {
$postData["datedue"] = $duedate;
}
$response = sendCURLRequest("/requests/setGroupWorksheet.php", $postData);
$respArray = json_decode($response[1], TRUE);
if ($respArray["result"]) {
$gwid = $respArray["gwid"];
// Go to page to enter the results
header("Location: ../editSetResults.php?gwid={$gwid}");
exit;
} else {
// Failure
errorLog("Adding the new worksheet failed with error: " . $response[1]);
returnToPageError("Something went wrong creating the new set of results.", $level, $type, $setid, $staff[0]);
}
}
示例3: returnToPageError
function returnToPageError($ex, $message)
{
errorLog("There was an error in the get students request: " . $ex->getMessage());
$response = array("success" => FALSE, "message" => $message . ": " . $ex->getMessage());
echo json_encode($response);
exit;
}
示例4: failRequest
function failRequest($message)
{
errorLog("There was an error in the get markbook request: " . $message);
$response = array("success" => FALSE);
echo json_encode($response);
exit;
}
示例5: failWithMessageAndException
function failWithMessageAndException($gwid, $message, $ex)
{
$type = 'ERROR';
$_SESSION['message'] = new Message($type, $message);
$exMsg = $ex != null ? $ex->getMessage() : "";
errorLog($message . " With exception: " . $exMsg);
header("Location: ../editSetResults.php?gwid={$gwid}");
exit;
}
示例6: includeMVCView
private function includeMVCView()
{
$controller = strtolower(Globals::getItem("controller"));
$method = strtolower(Globals::getItem("method"));
$filePath = BASE_DIR . "/Views/" . $controller . "/" . $method . ".php";
$filePath = str_replace("\\", DIRECTORY_SEPARATOR, $filePath);
if (!FileSystem::exists($filePath)) {
errorLog("View not found for " . $controller . "/" . $method, 2);
}
self::includeRequestedView($filePath);
}
示例7: autoSavePostData
function autoSavePostData($id, $tableName, $fieldNameList)
{
$sql = '';
$sql = getPostSql($id, $tableName, $fieldNameList);
//检测SQL
if (checkSql($sql) == false) {
errorLog('出错提示:<hr>sql=' . $sql . '<br>');
return '';
}
//conn.execute(sql) 'checksql这一步就已经执行了不需要再执行了20160410
}
示例8: returnToPageError
function returnToPageError($message)
{
$type = 'ERROR';
if (isset($_SESSION['user'])) {
$user = $_SESSION['user'];
$userid = $user->getUserId();
$msg = "User {$userid} was unable to switch users as the id was not correctly set.";
errorLog($msg);
}
$_SESSION['message'] = new Message($type, $message);
header("Location: ../switchUser.php");
exit;
}
示例9: execute
public function execute()
{
if (!function_exists("curl_init")) {
errorLog("CURL is required. Please install.", 3);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, $this->headers);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
示例10: errorDisplay
function errorDisplay()
{
$e = error_get_last();
if (!is_array($e) || !in_array($e['type'], array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR))) {
return;
}
echo "Application Error\n";
if (getenv('BLUZ_DEBUG')) {
echo $e['message'] . "\n";
echo $e['file'] . "#" . $e['line'] . "\n";
}
// try to write log
errorLog($e['message'], $e['file'] . "#" . $e['line']);
exit(1);
}
示例11: parseFields
public static function parseFields(array $fields, $required = true, $implode = true)
{
$data = [];
foreach ($fields as $field) {
if ($required && !Request::isItemSet($field)) {
errorLog("Invalid request for parse field : " . $field, 1);
}
$item = Request::getItem($field);
if (is_array($item)) {
$item = implode(",", $item);
}
$data[$field] = $item;
}
return $data;
}
示例12: handle_error
function handle_error($errno, $errstr, $errfile, $errline, $errcontext)
{
// timestamp for the error entry
$dt = date("Y-m-d H:i:s");
// Make log entries
$errortype = array(E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice', E_RECOVERABLE_ERROR => 'Catchable Fatal Error');
$error_msg = array("DT" => $dt, "E_NO" => $errno, "T" => $errortype, "E" => $errstr, "F" => $errfile, "L" => $errline);
//$error_msg = "[$dt] $errortype[$errno] $errstr in $errfile at $errline";
errorLog("{$error_msg}\n");
//Critical errors
$critical_errors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_USER_ERROR);
if (in_array($errno, $critical_errors)) {
error_log($error_msg, 1, "smsgyan@innoz.in");
terminate($error_msg);
}
}
示例13: errorDisplay
function errorDisplay()
{
if (!($e = error_get_last())) {
return;
}
if (!is_array($e) || !in_array($e['type'], array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR))) {
return;
}
// clean all buffers
while (ob_get_level()) {
ob_end_clean();
}
// try to write log
errorLog($e['message'], $e['file'] . "#" . $e['line']);
// display error page
require_once 'error.php';
}
示例14: connect
function connect()
{
static $dbh;
global $addon;
$db_params = $addon->callHook('db_params');
$dbh = mysql_connect($db_params['db_read_host'], $db_params['db_read_user'], $db_params['db_read_pass']);
if (!$dbh) {
errorLog("Failed attempt to connect to server - aborting.");
exitTo("/error.php?errNo=101301", "error: 101301 - data server can not be found");
}
$database = $db_params['db_read_name'];
if (isset($database)) {
if (!mysql_select_db($database)) {
errorLog("Failed attempt to open database: {$database} - aborting \n\t" . mysql_error());
exitTo("/error.php?errNo=101303", "error: 101303 - unknown database name");
}
}
return $dbh;
}
示例15: returnToPageError
function returnToPageError($message)
{
$type = 'ERROR';
errorLog($message);
$_SESSION['message'] = new Message($type, $message);
$_SESSION['formValues'] = $GLOBALS["informationArray"];
header("Location: ../addNewWorksheet.php");
exit;
}