本文整理汇总了PHP中FileWriter::writeLog方法的典型用法代码示例。如果您正苦于以下问题:PHP FileWriter::writeLog方法的具体用法?PHP FileWriter::writeLog怎么用?PHP FileWriter::writeLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileWriter
的用法示例。
在下文中一共展示了FileWriter::writeLog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWinningVideoId
public static function getWinningVideoId($id)
{
$logger = new FileWriter('win_id_log', 'a');
if (!is_integer($id) || $id <= 0) {
$fnOk = MyUtil::fnOk(false, "Invalid Session ID: {$id}" . !is_integer($id) . "-" . ($id <= 0), null);
$logger->writeLog($fnOk['reason']);
return $fnOk;
}
$stm = "SELECT COALESCE(winner_video_id, 0) as winner_video_id FROM " . self::$table_name . " WHERE id = {$id}";
$logger->writeLog($stm);
$result = ConnDB::query_db($stm);
if (!$result) {
return MyUtil::fnOk(false, "SQL Error", null);
}
$row = pg_fetch_assoc($result);
if ($row['winner_video_id'] > 0) {
return MyUtil::fnOk(true, "Video Id Found", $row['winner_video_id']);
} else {
$stm = " SELECT COALESCE(id, 0) as winner_video_id " . " FROM spire.videos " . " WHERE session_id = {$id} " . " AND votes = (SELECT MAX(votes) FROM spire.videos WHERE session_id = {$id})";
$logger->writeLog($stm);
$result = ConnDB::query_db($stm);
if (!$result) {
return MyUtil::fnOk(false, "SQL Error", null);
}
$row = pg_fetch_assoc($result);
if ($row['winner_video_id'] > 0) {
return MyUtil::fnOk(true, "Video Id Found", $row['winner_video_id']);
} else {
return MyUtil::fnOk(false, "Video Id Not Found", null);
}
}
}
示例2: FileWriter
//api/index.php
define('FACEBOOK_SDK_V4_SRC_DIR', '/home1/enderrac/SpirePHP/facebook-php-sdk-v4-4.0-dev/src/Facebook/');
require '/home1/enderrac/SpirePHP/facebook-php-sdk-v4-4.0-dev/autoload.php';
require '/home1/enderrac/SpirePHP/JsonResponse.php';
require '/home1/enderrac/SpirePHP/SpirePHP.php';
require '/home1/enderrac/SpirePHP/User.php';
use Facebook\FacebookSession;
use Facebook\FacebookRequest;
use Facebook\GraphUser;
use Facebook\FacebookRequestException;
use Facebook\FacebookRedirectLoginHelper;
FacebookSession::setDefaultApplication('879340512104772', '44e7ebc4f1bff480297ce6878f02ff40');
$logger = new FileWriter('spire_api_log', 'a');
$request_data = json_decode(file_get_contents("php://input"));
$logger->writeLog("\n#####NEW REQUEST#####");
$logger->writeLog("Request Type: " . $_SERVER['REQUEST_METHOD']);
$logger->writeLog("_GET = " . json_encode($_GET));
$logger->writeLog("_FILES = " . json_encode($_FILES));
$logger->writeLog("_POST = " . json_encode($_POST));
$logger->writeLog("request_data = " . json_encode($request_data));
$headers = apache_request_headers();
foreach ($headers as $header => $value) {
$logger->writeLog("{$header}: {$value}");
}
$TOKEN = $headers['Token'];
$logger->writeLog("\$TOKEN: {$TOKEN}");
$TOKEN_DATA = null;
$tokenDataHash = LoginDao::getTokenData($TOKEN);
if ($tokenDataHash['ok']) {
$TOKEN_DATA = $tokenDataHash['result'];