本文整理汇总了PHP中logToFile函数的典型用法代码示例。如果您正苦于以下问题:PHP logToFile函数的具体用法?PHP logToFile怎么用?PHP logToFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logToFile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPhonesearchData
function GetPhonesearchData($phonesearchParam, $searchParam)
{
$where = "";
if ($searchParam == "0") {
$where = " mobile_number ='{$phonesearchParam}'";
} else {
if ($searchParam == "1") {
$where = " mobile_number like '{$phonesearchParam}%'";
} else {
$where = " mobile_number like '%{$phonesearchParam}'";
}
}
$host = "localhost";
$user = "root";
$pass = "blinx";
$database = "blinx";
$conn = mysqli_connect($host, $user, $pass, $database) or die("Error " . mysqli_error($link));
$query = "SELECT user_id, first_name, last_name, email_id, mobile_number, alternative_mobile_number, date_of_birth, gender, qualification, institution, occupation, state, district, location, address, document_path, create_time, update_time, cud, verified, m_id, verifier_mid, pwd \nFROM m_user where";
$sql = $query . $where;
logToFile($sql);
$result = mysqli_query($conn, $sql);
logToFile('-------------------------------------------');
//logToFile($result);
if (!$result) {
echo "Could not successfully run query ({$sql}) from DB: " . mysql_error();
exit;
}
$data['data'] = array();
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
array_push($data['data'], $row);
}
echo json_encode($data);
mysqli_close($conn);
}
示例2: GetblocationsearchData
function GetblocationsearchData($lat1, $lng1)
{
$host = "localhost";
$user = "root";
$pass = "blinx";
$database = "blinx";
$conn = mysqli_connect($host, $user, $pass, $database) or die("Error " . mysqli_error($link));
if ($lat1 == "" && $lng1 == "") {
logToFile("No Latitude");
$query = "SELECT UserId,\n t.Id,\n helpId,\n h.Description,\n CONCAT(u.first_name, ' ', u.last_name) AS Name,\n t.Address,\n Requesteddate,\n Message\n FROM t_help_request t\n INNER JOIN f_help h ON t.helpId = h.Id\n INNER JOIN m_user u ON u.user_id = t.UserId\nWhere DATEDIFF(NOW(),Requesteddate)<100\nORDER BY Requesteddate asc\n LIMIT 0, 20";
} else {
$query = "SELECT ( 3959 * acos( cos( radians({$lat1}) ) * " . "cos( radians( latitude ) ) * cos( radians( longitude ) - radians({$lng1}) ) + sin( radians({$lat1}) ) * " . "sin( radians( latitude ) ) ) ) AS distance,latitude,longitude,UserId," . "t.Id,helpId,h.Description,CONCAT(u.first_name, ' ' ,u.last_name) as Name, t.Address," . " Requesteddate , Message" . " FROM t_help_request t inner join f_help h on t.helpId=h.Id " . " inner join m_user u on u.user_id=t.UserId " . " HAVING distance < 10 ORDER BY distance LIMIT 0 , 20";
}
$sql = $query;
logToFile($sql);
$result = mysqli_query($conn, $sql);
logToFile('-------------------------------------------');
//logToFile($result);
if (!$result) {
echo "Could not successfully run query ({$sql}) from DB: " . mysql_error();
exit;
}
$data['data'] = array();
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
array_push($data['data'], $row);
}
echo json_encode($data);
mysqli_close($conn);
}
示例3: processFbEvent
function processFbEvent($event)
{
foreach ($event->changes as $change) {
switch ($change->field) {
case 'feed':
// process new comment logic
if ($change->value->item == 'comment' && $change->value->verb == 'add' && $change->value->parent_id == $change->value->post_id && $change->value->sender_id != PAGE_ID && (USER_COMMENT_AUTO_LIKE_ON || USER_COMENT_AUTO_REPLY_ON)) {
$params = ['client_id' => APP_ID, 'client_secret' => APP_SECRET, 'access_token' => PAGE_VERIFY_TOKEN, 'fields' => 'from{id}'];
$postAuthorId = json_decode(fb_api_get("/" . $change->value->post_id, $params))->from->id;
logToFile('curl.log', $postAuthorId);
if ($postAuthorId != PAGE_ID) {
continue;
}
if (USER_COMMENT_AUTO_LIKE_ON) {
$params = ['client_id' => APP_ID, 'client_secret' => APP_SECRET, 'access_token' => PAGE_VERIFY_TOKEN];
fb_api_post("/{$change->value->comment_id}/likes", $params);
}
if (USER_COMMENT_AUTO_REPLY_ON) {
$params = ['client_id' => APP_ID, 'client_secret' => APP_SECRET, 'access_token' => PAGE_VERIFY_TOKEN, 'message' => USER_COMMENT_AUTO_REPLY_MSG];
fb_api_post("/{$change->value->comment_id}/comments", $params);
}
}
// process new post logic
if ($change->value->item == 'post' && $change->value->verb == 'add' && $change->value->sender_id != PAGE_ID && (USER_POST_AUTO_LIKE_ON || USER_POST_REPLY_ON)) {
if (USER_POST_AUTO_LIKE_ON) {
$params = ['client_id' => APP_ID, 'client_secret' => APP_SECRET, 'access_token' => PAGE_VERIFY_TOKEN];
fb_api_post("/{$change->value->post_id}/likes", $params);
}
if (USER_POST_AUTO_REPLY_ON) {
$params = ['client_id' => APP_ID, 'client_secret' => APP_SECRET, 'access_token' => PAGE_VERIFY_TOKEN, 'message' => USER_POST_AUTO_REPLY_MSG];
fb_api_post("/{$change->value->post_id}/comments", $params);
}
}
break;
case 'conversations':
if (CONVERSATION_REPLY_ON) {
$params = ['client_id' => APP_ID, 'client_secret' => APP_SECRET, 'access_token' => PAGE_VERIFY_TOKEN, 'fields' => 'from,created_time', 'since' => time() - CONVERSATION_AUTO_REPLY_COOLDOWN];
$lastMsgs = json_decode(fb_api_get("/{$change->value->thread_id}/messages", $params));
logToFile('curl.log', print_r($lastMsgs, 1));
$needReply = true;
foreach ($lastMsgs as $msg) {
if ($msg['from']['id'] == PAGE_ID) {
$needReply = false;
break;
}
}
if ($needReply) {
$params = ['client_id' => APP_ID, 'client_secret' => APP_SECRET, 'access_token' => PAGE_VERIFY_TOKEN, 'message' => CONVERSATION_AUTO_REPLY_MSG];
fb_api_post("/{$change->value->thread_id}/messages", $params);
}
}
break;
default:
//do nothing
}
}
}
示例4: resetDemo
function resetDemo()
{
checkConn();
unset($_SESSION['lastTextTime']);
unset($_SESSION['lastAction']);
$sql = "TRUNCATE TABLE `akshhhlt_blupay`.`users`";
$result = mysqli_query($GLOBALS['sqli_conn'], $sql);
logToFile($sql, $result);
echo "reset successful";
return "reset successful";
}
示例5: InsertBenificiaryData
function InsertBenificiaryData($firstname1, $lastname1, $email1, $phone1, $place1, $place2, $pwd)
{
$host = "localhost";
$user = "root";
$pass = "blinx";
$database = "blinx";
$conn = mysqli_connect($host, $user, $pass, $database) or die("Error " . mysqli_error($link));
try {
$sql1 = "select count(*) as count from m_volunteer where mobile_number='{$phone1}'";
logToFile($sql1);
$result = mysqli_query($conn, $sql1);
if (!$result) {
logToFile(mysql_error());
echo 'Failed Registration';
} else {
$count = mysqli_fetch_object($result)->count;
//logToFile((string)$row[0]);
if (intval($count) == 0) {
$sql2 = "select COALESCE(MAX(volunteer_id), 0) as id from m_volunteer";
logToFile($sql2);
$result1 = mysqli_query($conn, $sql2);
if (!$result1) {
echo "Failed Registration ({$sql2}) from DB: " . mysql_error();
} else {
$id = mysqli_fetch_object($result1)->id;
$bid = intval($id) + 1;
logToFile($bid);
$sql = "INSERT INTO m_volunteer " . "(volunteer_id," . "first_name," . "last_name," . "email_id," . "mobile_number," . "lati," . "longi," . "cud," . "create_time," . "pwd)" . "VALUES" . "( {$bid},'{$firstname1}'," . "'{$lastname1}','{$email1}','{$phone1}','{$place1}','{$place2}','C',now(),'{$pwd}')";
logToFile($sql);
if (!mysqli_query($conn, $sql)) {
logToFile(mysql_error());
mysqli_close($conn);
echo '0';
} else {
logToFile("Registration Success");
mysqli_close($conn);
echo '1';
}
}
} else {
echo '2';
}
}
} catch (Exception $e) {
logToFile($e->getMessage());
logToFile(mysqli_close($conn));
echo 'fail';
}
}
示例6: myErrorHandler
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
header("HTTP/1.1 500 Internal Server Error");
$date = date("Y-m-d H:i:s", time());
$message = "";
$message .= "-------------------------------------------------------\n";
$message .= "DATE : " . $date . "\n";
$message .= "ERRNO : " . $errno . "\n";
$message .= "ERRSTR : " . $errstr . "\n";
$message .= "ERRFILE : " . $errfile . "\n";
$message .= "ERRLINE : " . $errline . "\n";
$message .= "-------------------------------------------------------";
logToFile($message);
die('Erreur serveur');
}
示例7: checkSolarTemp
function checkSolarTemp()
{
global $minSolar;
$sql = query("SELECT sensorId FROM sensoren where name = 'Solar'");
$row = fetch($sql);
$temp = getSensorTemp($row[sensorId]);
logToFile("Skript: Prüfe Solartemperatur - Solarpanel IST: {$temp} Min.: {$minSolar}");
if ($minSolar > $temp) {
//logToFile("Skript: Solar EIN - Solarpanel IST: $temp Min.: $minSolar");
return 1;
} else {
//logToFile("Skript: Solar AUS - Solarpanel IST: $temp Min.: $minSolar");
return 0;
}
}
示例8: debugArrayToFile
function debugArrayToFile($array, $var_name = 'ARRAY')
{
$keys = array_keys($array);
foreach ($keys as $key) {
$value = $array[$key];
$name_length = strlen($var_name);
$temp_name = '';
for ($index = 0; $index < $name_length; $index++) {
$temp_name .= ' ';
}
if (is_array($value)) {
logToFile('DEBUG --- ' . $var_name);
logArrayToFile($value, $temp_name . ' [\'' . $key . '\']');
} else {
logToFile('DEBUG --- ' . $var_name . ' [\'' . $key . '\'] => ' . $value);
}
}
}
示例9: generateManifest
function generateManifest($manifest_path, $parent, $catalog)
{
$plist = new CFPropertyList();
$plist->add($dict = new CFDictionary());
if ($catalog != '') {
// Add manifest to production catalog by default
$dict->add('catalogs', $array = new CFArray());
$array->add(new CFString($catalog));
}
// Add parent manifest to included_manifests to achieve waterfall effect
$dict->add('included_manifests', $array = new CFArray());
$array->add(new CFString($parent));
$tmp = explode('/', $manifest_path);
$manifest = end($tmp);
logToFile("Generating manifest '{$manifest}'...");
// Save the newly created plist
$plist->saveXML($manifest_path);
}
示例10: VerifyLogin
function VerifyLogin($username1, $password1)
{
$host = "localhost";
$user = "root";
$pass = "blinx";
$database = "blinx";
$conn = mysqli_connect($host, $user, $pass, $database) or die("Error " . mysqli_error($link));
try {
$sql1 = "select count(*) as count from m_volunteer where email_id='{$username1}'";
logToFile($sql1);
$result = mysqli_query($conn, $sql1);
if (!$result) {
logToFile(mysql_error());
echo 'Failed Registration';
} else {
$count = mysqli_fetch_object($result)->count;
logToFile($count);
if (intval($count) >= 1) {
$sql2 = "select count(*) as count from m_volunteer where email_id='{$username1}' and pwd='{$password1}'";
logToFile($sql2);
$result1 = mysqli_query($conn, $sql2);
if (!$result1) {
echo "Failed Registration ({$sql2}) from DB: " . mysql_error();
} else {
$value = mysqli_fetch_object($result1)->count;
if (intval($value) == 1) {
echo '0';
} else {
echo '1';
}
}
} else {
echo '2';
}
}
} catch (Exception $e) {
logToFile($e->getMessage());
logToFile(mysqli_close($conn));
echo 'fail';
}
}
示例11: authenticateUser
function authenticateUser($username, $password)
{
$sql = "SELECT * FROM users WHERE username = :username and password = :password";
try {
$db = getConnection();
$stmt = $db->prepare($sql);
$stmt->bindParam("username", $username);
$stmt->bindParam("password", $password);
$stmt->execute();
$userDetails = $stmt->fetchAll(PDO::FETCH_OBJ);
logToFile("/Applications/MAMP/htdocs/HealthCareSystem/RestAPI/errorlog.log", "Hello User Details are " . $userDetails);
$db = null;
//echo '{"user": ' . json_encode($userDetails) . '}';
} catch (PDOException $e) {
echo '{"error":{"text":' . $e->getMessage() . '}}';
throw new Exception('Uncaught Exception' . $e->getMessage());
} catch (Exception $e1) {
echo '{"error1":{"text1":' . $e1->getMessage() . '}}';
throw new Exception('Uncaught Exception' . $e1->getMessage());
}
}
示例12: GetDateFilterData
function GetDateFilterData()
{
$host = "localhost";
$user = "root";
$pass = "blinx";
$database = "blinx";
$conn = mysqli_connect($host, $user, $pass, $database) or die("Error " . mysqli_error($link));
$sql = "SELECT Id,Description,IsUsed from f_date";
$result = mysqli_query($conn, $sql);
logToFile('-------------------------------------------');
//logToFile($result);
if (!$result) {
echo "Could not successfully run query ({$sql}) from DB: " . mysql_error();
exit;
}
$data['data'] = array();
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
array_push($data['data'], $row);
}
echo json_encode($data);
mysqli_close($conn);
}
示例13: InsertBenificiaryData
function InsertBenificiaryData($Uid1, $email1, $phone1, $helpdId1, $requestdate1, $place1, $place2, $address1, $message1, $education1, $latitide1, $logitude1, $duration1)
{
try {
$host = "localhost";
$user = "root";
$pass = "blinx";
$database = "blinx";
logToFile($database);
$conn = mysqli_connect($host, $user, $pass, $database) or die("Error " . mysqli_error($link));
$sql2 = "select COALESCE(MAX(Id), 0) as MaxID from t_help_request";
logToFile($sql2);
$result = mysqli_query($conn, $sql2);
if (!$result) {
logToFile("Failed");
echo 'Failed Registration';
} else {
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
$txnid = intval($row["MaxID"]) + 1;
$Uid1 = intval($Uid1);
$current_date = date("Y-m-d H:i:s");
$requestdate1 = date("Y-m-d H:i:s", strtotime($requestdate1));
$helpvalue1 = intval($helpvalue1);
logToFile($requestdate1);
$sql = "INSERT INTO t_help_request (Id,phone,email,UserId,helpId,Message,Address," . "Location,Requesteddate,Createddate,latitude,longitude,Duration)" . "VALUES( {$txnid},'{$phone1}','{$email1}',{$Uid1},{$helpdId1}," . "'{$message1}','{$address1}','{$place1}','{$requestdate1}'," . "'{$current_date}','{$latitide1}','{$logitude1}','{$duration1}')";
logToFile($sql);
if (!mysqli_query($conn, $sql)) {
logToFile(mysql_error());
echo 'Request Failed';
} else {
logToFile("callsid added");
echo 'Request Success';
}
}
} catch (Exception $e) {
logToFile($e->getMessage());
logToFile(mysql_close($con));
echo 'fail';
}
}
示例14: checkPasswordForLogin
function checkPasswordForLogin($Email, $Plain)
{
//Get the current password's salt, salt the given Plain-text password, and see if it's the same as
// the existing saltedPasswordHash
//While you're at it, if the user is valid, return the UserID for convenience (and efficiency, I suppose)
$conn = connectToDB();
$userInfo = GetSingleDbValue("SELECT `SaltedHash`, `Salt`, `UserID` FROM `Users` WHERE `EmailAddress`='" . $Email . "'", $conn);
$conn->close();
if (!$userInfo) {
return false;
}
//Debug login override
//TODO: Remove before final release and after properly instantiating User entries with salts and salted hashes
if ($Plain == 'Debug') {
return $userInfo['UserID'];
}
//TODO: next line temp
logToFile("Log Debug Password.txt", $Email . " Password: " . $Plain . " Salt: " . $userInfo['Salt'] . " SaltedHash: " . hash("sha256", $Plain . $userInfo['Salt']));
if (hash("sha256", $Plain . $userInfo['Salt']) !== $userInfo['SaltedHash']) {
return false;
}
return $userInfo['UserID'];
}
示例15: replacement
function replacement($environment,$file,$pfad,$datei,$namearray) {
$filecontent = file_get_contents($pfad.$datei);
#####################
# utf8
# ----
# text must be in utf8
# if not, we must convert to utf8
# because preg_match misses targets
# if text is not in utf8
#
#####################
include_once('functions/text_functions.php');
$filecontent = cs_utf8_encode2($filecontent);
#####################
# utf8
#####################
logToFile($pfad.$datei);
$disc_manager = $environment->getDiscManager();
$disc_manager->setPortalID($environment->getCurrentPortalID());
$disc_manager->setContextID($environment->getCurrentContextID());
$path_to_file = $disc_manager->getFilePath();
unset($disc_manager);
$path = $path_to_file.'html_'.$file->getDiskFileNameWithoutFolder().'/';
$linkpath = "";
if ( $path != $pfad ) {
$linkpath = str_replace($path,'',$pfad);
}
foreach ( $namearray['oldfilename'] as $index => $name ) {
$pattern = "~[\\\./\d\wÄÖÜäöü_-]{0,}".$name."~isu";
#$pattern = "~".$name."~isu";
logToFile($pattern);
#pr($pattern);
preg_match_all($pattern, $filecontent, $current_treffer);
#pr($current_treffer[0]);
foreach ( $current_treffer[0] as $treffer ) {
$trefferlowercase = mb_strtolower($treffer, 'UTF-8');
$path_relative = '';
if ( strlen($trefferlowercase) > (strlen($name)+1)
and ( strstr($trefferlowercase,'/')
or strstr($trefferlowercase,'\\')
)
) {
$path_relative = str_replace('\\','/',$treffer);
$path_relative = str_replace($name,'',$path_relative);
if ( $path_relative[0] == '.' ) {
$path_relative = substr($path_relative,1);
}
if ( $path_relative[0] == '/'
or $path_relative[0] == '\\'
) {
$path_relative = substr($path_relative,1);
}
}
global $c_single_entry_point;
if ( !isset($index)
or !isset($namearray['filename'][$index])
) {
$namearray_filename_index = '';
} else {
$namearray_filename_index = $namearray['filename'][$index];
}
if ( !empty($path_relative) ) {
if ( !empty($linkpath)
and stristr($linkpath,$path_relative)
) {
$path_relative = $linkpath;
}
$replacement = $c_single_entry_point.'?cid='.$environment->getCurrentContextID().'&mod=material&fct=showzip_file&iid='.$file->getFileID().'&file='.$path_relative.$namearray_filename_index;
} else {
$replacement = $c_single_entry_point.'?cid='.$environment->getCurrentContextID().'&mod=material&fct=showzip_file&iid='.$file->getFileID().'&file='.$linkpath.$namearray_filename_index;
}
if ( !mb_stristr($filecontent,$replacement) ) {
$filecontent = str_replace($treffer, $replacement, $filecontent);
}
}
if ( strstr($filecontent,"'".$name."'") ) {
$trefferlowercase = mb_strtolower($name, 'UTF-8');
$treffer = "'".$name."'";
global $c_single_entry_point;
if ( !isset($index)
or !isset($namearray['filename'][$index])
) {
$namearray_filename_index = '';
} else {
$namearray_filename_index = $namearray['filename'][$index];
}
$replacement = $c_single_entry_point.'?cid='.$environment->getCurrentContextID().'&mod=material&fct=showzip_file&iid='.$file->getFileID().'&file='.$linkpath.$namearray_filename_index;
$filecontent = str_replace($treffer, "'".$replacement."'", $filecontent);
}
}
return $filecontent;
}