本文整理汇总了PHP中Config::getDebug方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getDebug方法的具体用法?PHP Config::getDebug怎么用?PHP Config::getDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config::getDebug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVenue
public function getVenue($venueID, $returnFormat = "xml", $authentication = false)
{
$url = $this->FOURSQUARE_APIS['VENUE'] . "." . $returnFormat;
$url .= "?vid=" . $venueID;
if (Config::getDebug()) {
Config::getLogObject()->log("{$url}", PEAR_LOG_INFO);
}
$curl = @curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = @curl_exec($curl);
@curl_close($curl);
echo $result;
}
示例2: insertUserBank
public function insertUserBank($userID, $activityName = 'register')
{
$bankBalance = 0;
if (!empty($activityName)) {
$activityReward = new ActivityReward($activityName);
$bankBalance = isset($activityReward) ? $activityReward->getActivityRewardAmount() : 0;
}
$link = @mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
return GAMEON_ERROR;
}
$sql = sprintf("insert into go_userBank (userID, bankBalance ) values ('%u','%u')", mysqli_real_escape_string($link, $userID), mysqli_real_escape_string($link, $bankBalance));
if (Config::getDebug()) {
$this->LOG->log("{$sql}", PEAR_LOG_INFO);
}
$rc = @mysqli_query($link, $sql);
$affectedRows = mysqli_affected_rows($link);
if ($affectedRows > 0) {
return GAMEON_OK;
} else {
return GAMEON_ERROR;
}
}
示例3: getPublicGames
public function getPublicGames()
{
$sql = goPublicGame::getSql();
$link = @mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
mydie("Error connecting to Database");
}
if (Config::getDebug()) {
$this->LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = @mysqli_query($link, $sql);
if (!$cursor) {
$this->mydie(mysqli_error($link), $link);
}
$record = 0;
while ($row = @mysqli_fetch_assoc($cursor)) {
$game = new goPublicgame();
//$game->setGameID($row['gameID']);
$game->setDescription($row['description']);
$game->setTitle($row['title']);
$game->setEventName($row['eventName']);
$game->setEventDate($row['eventDate']);
$game->setSportID($row['sport']);
$game->setSportName($row['sportName']);
$game->setLeagueName($row['leagueName']);
$game->setFavorite($row['favorite']);
$game->setTypeID($row['type']);
$game->setTypeName($row['typeName']);
/*** temp explicit treatment as array storage***/
$this->publicGames[$record] = $game;
$record++;
/*** end temp ***/
}
//while
$link->close();
}
示例4: getActivityReward
public function getActivityReward($activityReward)
{
$link = @mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
return GAMEON_ERROR;
}
$sql = sprintf("select * from go_activityRewards where activityName= '%s'", mysqli_real_escape_string($link, $activityReward));
if (Config::getDebug()) {
$this->LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = @mysqli_query($link, $sql);
if (isset($cursor)) {
$row = @mysqli_fetch_assoc($cursor);
if (isset($row) && count($row) > 0) {
$this->setActivityRewardID($row['activityID']);
$this->setActivityRewardName($row['activityName']);
$this->setActivityRewardType($row['rewardType']);
$this->setActivityRewardAmount($row['amount']);
$rv = GAMEON_OK;
$this->setStatusCode(GAMEON_OK);
} else {
$rv = GAMEON_NORECORD;
}
} else {
//if
$rv = GAMEON_ERROR;
}
//else
if (isset($cursor)) {
$cursor->close();
}
if (isset($link)) {
$link->close();
}
return $rv;
}
示例5: mydie
mandatory
*/
if (!isset($userID)) {
mydie("paramaters not complete");
}
$params['userid'] = $userID;
$params['operation'] = strtolower($operation);
$params['query'] = $query;
$link = mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
// Server error
header('HTTP/1.1 500 Internal Server Error');
mydie("Error connecting to Database");
}
$sql = getQuery($params, $link);
if (Config::getDebug()) {
$LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = mysqli_query($link, $sql);
if (!$cursor) {
// Server error
mydie(mysqli_error($link), "500", $link);
}
$numberOfFriends = $cursor->num_rows;
header('HTTP/1.1 200 OK');
// Fetch the results of the query
header("Cache-Control: no-cache, must-revalidate");
header("content-type: text/xml");
echo '<?xml version="1.0"?>';
Utility::emitXML("", 'go_friends', 0);
Utility::emitXML("200", 'status_code');
示例6: updateFacebookOAuth
public function updateFacebookOAuth($userID, $facebookID, $imageUrl, $sec, $tok)
{
$link = mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
die("Error connecting to Database");
}
if (Config::getDebug()) {
$LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = mysqli_query($link, $sql);
if (!$cursor) {
die(mysqli_error($link));
}
$link->close();
return true;
}
示例7: getTeams
function getTeams($sportID = null, $selected = null)
{
global $LOG;
$link = @mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
mydie("Error connecting to Database");
}
$sql = "select * from go_teams_lu ";
if (!empty($sportID)) {
if (is_numeric($sportID)) {
$where = " where sportID = {$sportID}";
} else {
$where = ' where leagueName ="' . $sportID . '"';
}
}
//if
$sql .= $where . " order by teamName";
if (Config::getDebug()) {
$LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = @mysqli_query($link, $sql);
if (!$cursor) {
mydie(mysqli_error($link), $link);
}
echo '<select id="teamlistbox" name="teamname">';
while (($row = @mysqli_fetch_assoc($cursor)) != null) {
$selectedFlag = strtolower($selected) == strtolower($row['teamName']) ? ' SELECTED' : null;
echo '<option value="' . $row['teamName'] . '"' . $selectedFlag . '>' . $row['teamName'] . '</option>';
}
$link->close();
echo '</select>';
}
示例8: generateTypeListbox
function generateTypeListbox($typeName = null)
{
global $LOG;
$link = @mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
mydie("Error connecting to Database");
}
$sql = "select * from go_types_lu order by typeName";
if (Config::getDebug()) {
$LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = @mysqli_query($link, $sql);
if (!$cursor) {
$this->mydie(mysqli_error($link), $link);
}
echo '<select id="typelistbox" name="typename">';
while (($row = @mysqli_fetch_assoc($cursor)) != null) {
$selected = strtoupper($typeName) == strtoupper($row['typeName']) ? ' SELECTED' : null;
echo '<option value="' . $row['id'] . '"' . $selected . '>' . $row['typeName'] . '</option>';
}
$link->close();
echo '</select>';
}
示例9: userNameAvailable
function userNameAvailable($userName, $link)
{
global $LOG;
$userName = strtolower($userName);
// $sql = sprintf("select count(*) as countOfUserName from go_user where userName = '%s'",
// mysqli_real_escape_string($link,$userName));
$sql = sprintf("select userName from go_user where userName = '%s'", mysqli_real_escape_string($link, $userName));
if (Config::getDebug()) {
$LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = mysqli_query($link, $sql);
if (!$cursor) {
// Server error
mydie(mysqli_error($link) . " executing sql {$sql}");
}
//if
$countOfUserName = $cursor->num_rows;
// if ($row = @mysqli_fetch_assoc($cursor) == null) mydie(mysqli_error($link) . " executing sql $sql");
// $countOfUserName = $row['countOfUserName'];
$cursor->close();
if ($countOfUserName > 0) {
return false;
} else {
return true;
}
}
示例10: getQuery
function getQuery($params, $lookup)
{
global $LOG;
$where = null;
//declare
$league = strtoupper($params['league']);
//leauge query parameter
if (!empty($league)) {
$where = " where leagueName='" . $league . "'";
}
$team = $params['team'];
//team query parameter
if (!empty($team)) {
//team passed as parameter , need to lookup TeamID
$teamID = $lookup[$team];
if (empty($teamID)) {
//try more advanced search for team - using normalizedTeamName and nickName fields
}
//if
if (!empty($teamID)) {
$where .= (!empty($where) ? "and" : " where ") . " gameID in (select gameID from go_publicgames_combatants where teamID = {$teamID})";
}
//if
}
//if
$timeFrame = $params['timeframe'];
if (!empty($timeFrame)) {
$today = date('Y-m-d G:i:s');
$endDateEpoch = strtotime(date("Y-m-d G:i:s", strtotime($today)) . "+" . $timeFrame . "day");
$endDate = date('Y-m-d G:i:s', $endDateEpoch);
// $endDate="2010-09-01 23:59:59";
$where .= (!empty($where) ? "and" : " where ") . " date between '{$today}' and '{$endDate}' ";
} else {
$where .= !empty($where) ? " and date > now()" : " where date > now() ";
}
//if
$basesql = "select * from go_publicgames g ";
$sql = $basesql . $where;
if (Config::getDebug()) {
$LOG->log($sql, PEAR_DEBUG);
}
return $sql;
}
示例11: getPublicGameCombatants
private function getPublicGameCombatants($gameID, $link = null)
{
if (empty($link)) {
return false;
}
$sql = "select g.teamID,t.teamName, g.homeTeam from go_publicgames_combatants g LEFT JOIN go_teams_lu t on g.teamID = t.id where gameID = {$gameID} order by g.homeTeam desc";
if (Config::getDebug()) {
$this->LOG->log($sql, PEAR_LOG_DEBUG);
}
$cursor = @mysqli_query($link, $sql);
if (!$cursor) {
$this->mydie(mysqli_error($link), $link);
}
if (mysqli_num_rows($cursor) != 2) {
return false;
}
$row = @mysqli_fetch_assoc($cursor);
/*Add JHM - public Games */
$this->setHomeTeamID($row['teamID']);
$this->setHomeTeam($row['teamName']);
$row = @mysqli_fetch_assoc($cursor);
$this->setVisitingTeamID($row['teamID']);
$this->setVisitingTeam($row['teamName']);
/*Finish add */
return true;
}
示例12: getTeamIDOrTeamName
public static function getTeamIDOrTeamName($param, $type = 'id')
{
$LOG = Config::getLogObject();
$link = mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
// Server error
// mydie("Error connecting to Database");
return GAMEON_ERROR;
}
if ($type == 'id') {
$sql = sprintf("select * from go_teams_lu where id='%u'", mysqli_real_escape_string($link, $param));
} else {
$sql = sprintf("select * from go_teams_lu where teamName='%s'", mysqli_real_escape_string($link, $param));
}
if (Config::getDebug()) {
$LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = mysqli_query($link, $sql);
if ($cursor) {
$row = mysqli_fetch_assoc($cursor);
$rv = GAMEON_OK . GAMEON_DELIMITER . ($type == 'id' ? 'teamname' . GAMEON_DELIMITER . $row['teamName'] : 'teamid' . GAMEON_DELIMITER . $row['id']);
} else {
$rv = GAMEON_NORECORD;
}
if (isset($cursor)) {
$cursor->close();
}
if (isset($link)) {
$link->close();
}
return $rv;
}
示例13: insertNewUser
function insertNewUser($params)
{
global $LOG;
$userID = 0;
$userName = $params['newusername'];
$password = $params['newpassword'];
$url = Config::getAPIDomain() . "/go_postnewuser.php?" . "newusername=" . urlencode($userName) . "&password=" . urlencode($password);
if (Config::getDebug()) {
$LOG->log("calling insertNewUser using url = " . $url);
}
$curl = @curl_init($url);
$opts = Facebook::$CURL_OPTS;
curl_setopt_array($curl, $opts);
$result = @curl_exec($curl);
$LOG->log("{$result}");
@curl_close($curl);
/* Parse the returned XML */
$document = @simplexml_load_string($result);
if ($document) {
//check the return code
if ($document->status_code == 200) {
$userID = $document->userid;
} else {
return false;
}
}
//
return $userID;
}
示例14: insertGameInvites
function insertGameInvites($link, $gameID, $inviteKey, $closeDateTime, $createdByUserID, $createdByUserName, $gameInvitees)
{
global $LOG;
$sql = sprintf("insert into go_gameInvite (gameID,inviteKey) values ('%s','%s')", mysqli_real_escape_string($link, $gameID), mysqli_real_escape_string($link, $inviteKey));
if (Config::getDebug()) {
$LOG->log("{$sql}", PEAR_LOG_INFO);
}
$rc = mysqli_query($link, $sql);
if (!$rc) {
// Server error
header('HTTP/1.1 500 Internal Server Error');
mydie(mysqli_error($link), 500, $link);
}
//if
//TODO - Remove temporary automatic insert into invite Detail
$gameInviteesArray = explode(" ", trim($gameInvitees));
$count = count($gameInviteesArray);
for ($x = 0; $x < $count; $x++) {
$inviteeUserID = $gameInviteesArray[$x];
$sql = sprintf("insert into go_gameInviteDetail (gameID, inviteKey, createdByUserID,createdByUserName, closeDateTime,inviteeUserID) values ('%s','%s','%u','%s','%s','%u')", mysqli_real_escape_string($link, $gameID), mysqli_real_escape_string($link, $inviteKey), mysqli_real_escape_string($link, $createdByUserID), mysqli_real_escape_string($link, $createdByUserName), mysqli_real_escape_string($link, $closeDateTime), mysqli_real_escape_string($link, $inviteeUserID));
if (Config::getDebug()) {
$LOG->log("{$sql}", PEAR_LOG_INFO);
}
$rc = mysqli_query($link, $sql);
}
//for
}
示例15: getGame
public function getGame($gameID, $type = 'game')
{
$link = @mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase());
if (!$link) {
mydie("Error connecting to Database");
}
//added JHM 8/19/2010
$sql = $this->getQuery($gameID, $type, $link);
if (Config::getDebug()) {
$this->LOG->log("{$sql}", PEAR_LOG_INFO);
}
$cursor = @mysqli_query($link, $sql);
if (!$cursor) {
$this->mydie(mysqli_error($link), $link);
}
$row = @mysqli_fetch_assoc($cursor);
if (Config::getDebug()) {
$this->LOG->log("{$row}", PEAR_LOG_DEBUG);
}
if (!row) {
return false;
}
$this->setGameID($row['gameID']);
$this->setPublicGameID($row['publicGameID']);
$this->setDescription($row['description']);
$this->setCreatedByUserID($row['createdByUserID']);
$this->setCreatedByUserName($row['createdByUserName']);
$this->setTitle($row['title']);
$this->setSportID($row['sport']);
$this->setSportName($row['sportName']);
$this->setTypeID($row['type']);
$this->setTypeName($row['typeName']);
$this->setWagerUnits($row['wagerUnits']);
$this->setWagerTypeID($row['wagerTypeID']);
$this->setWagerType($row['wagerType']);
$this->setSubscriptionCloseDate($row['subscriptionClose']);
$this->setSubscriptionOpen($row['subscriptionOpen']);
$this->setSyndicationUrl($row['syndicationUrl']);
$this->setPivotDate($row['pivotDate']);
$this->setPivotCondition($row['pivotCondition']);
/*Add JHM - public Games */
$this->setHomeTeamID($row['team1ID']);
$this->setVisitingTeamID($row['team2ID']);
$this->setHomeTeam($row['teamName1']);
$this->setVisitingTeam($row['teamName2']);
/*Finish add */
}