本文整理汇总了PHP中Debug::Log方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::Log方法的具体用法?PHP Debug::Log怎么用?PHP Debug::Log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::Log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delWait
/**
* Delete
*
* @param int $message_type
* @param int $msgid
*/
public function delWait($message_type, $msgid)
{
if (isset($this->command_awaits[$message_type][$msgid])) {
Debug::Log(Debug::DEBUG, "Forget " . Message::$name[$message_type] . " msgid={$msgid}");
unset($this->command_awaits[$message_type][$msgid]);
--$this->command_awaits_counter;
}
}
示例2: Append
/**
* Append some content to file
*
* @access public
* @param string $sContent
* @return boolean
*/
public function Append($sContent)
{
try {
return file_put_contents($this->sFile, $sContent, FILE_APPEND);
} catch (Exception $e) {
Debug::Log($e, ERROR);
return false;
}
}
示例3: __autoload
/**
*
* @param string $class_name
* @return void
*/
function __autoload($class_name)
{
if (stristr($class_name, "exception")) {
require_once "include/" . 'exceptions.class.php';
Debug::Log("Exceptions loaded!");
} else {
require_once "include/" . strtolower($class_name) . '.class.php';
Debug::Log("Class " . $class_name . " loaded!");
}
}
示例4: Load
public static function Load()
{
$file = PREFIX . "/lang/" . LANG . ".php";
if (is_readable($file)) {
require $file;
} else {
require PREFIX . "/lang/en.php";
}
/* default system language */
self::$language = $lang;
Debug::Log("Language '" . LANG . "', file : '" . $file) . "'";
}
示例5: Add
/**
*
* @access public
* @static
* @param Rate $obj
* @return Rate|false
*/
public static function Add($obj)
{
$cmd = sprintf("INSERT INTO zi_rates (user_id,idea_id) VALUES(%d,%d)", $obj->user_id, $obj->idea_id);
try {
if (!Database::Query($cmd, false)) {
throw new RateException("can't add rate");
}
$obj->rate_id = Database::GetLastInsertId();
} catch (Exception $e) {
Debug::Log($e, ERROR);
return false;
}
return $obj;
}
示例6: GetCollectionData
/**
* function to not repeating same code in every method
* $query sql query
* $message message throwed by exception
* @access private
* @static
* @return Ideas|false
*/
private static function GetCollectionData($query, $message = "error while getting ideas")
{
if (empty($query)) {
return false;
}
$obj = new Ideas();
try {
$data = Database::Query($query);
if (empty($data)) {
throw new IdeasException($message);
}
foreach ($data as $row) {
$obj->collection[] = Idea::GetById($row["idea_id"]);
}
} catch (Exception $e) {
Debug::Log($e, WARNING);
return false;
}
return $obj->collection;
}
示例7: registerUid
registerUid($formid);
$result = "STATE_VALID";
}
// Debug info
$debugtmp .= ", FORMID: " . $formid;
} else {
$txid = $reward->txid;
// Debug info
$debugtmp .= ", TXID VIA REWARD: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
} else {
$txid = $reward->txid;
// Debug info
$debugtmp .= ", TXID VIA IP: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
} else {
$txid = retrieveCookie();
// Debug info
$debugtmp .= ", TXID VIA COOKIE: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
}
}
} else {
$result = "STATE_SESSION_ERROR";
}
if ($result != "STATE_VALID") {
Debug::Log("state_google.php, STATE: " . $result . $debugtmp);
}
示例8: Remove
/**
*
* @access public
* @return boolean
*/
public static function Remove($comment, $user)
{
try {
if ($user->user_id == $comment->user_id || $user->IsAdmin()) {
$cmd = sprintf("DELETE FROM zi_comments WHERE comment_id=%d;", $comment->comment_id);
if (!Database::Query($cmd, false)) {
throw new IdeaException("can't remove comment - database problem");
}
} else {
throw new IdeaException("can't remove comment - user is not an owner of the comment ");
}
} catch (Exception $e) {
Debug::Log($e, WARNING);
return false;
}
return true;
}
示例9: retrieveCookie
$txid = $reward->txid;
// Debug info
$debugtmp .= ", REQUESTID: " . $reward->requestid . ", TXID VIA REWARD: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
} else {
$txid = $reward->txid;
// Debug info
$debugtmp .= ", REQUESTID: " . $reward->requestid . ", TXID VIA IP: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
} else {
$txid = retrieveCookie();
// Debug info
$debugtmp .= ", TXID VIA COOKIE: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
} else {
$result = "STATE_NOT_QUALIFIED";
}
} else {
$result = "STATE_INVALID_SIGNATURE";
}
}
}
} else {
$result = "STATE_SESSION_ERROR";
}
if ($result != "STATE_VALID") {
Debug::Log("state_bitcointalk.php, STATE: " . $result . $debugtmp);
}
示例10: RateMinus
/**
*
* @access public
* @return boolean
*/
public static function RateMinus($idea)
{
$cmd = sprintf("UPDATE zi_ideas SET idea_rate=%d WHERE idea_id=%d", $idea->idea_rate -= 1, $idea->idea_id);
try {
if (!Database::Query($cmd, false)) {
throw new IdeaException("can't rate minus idea");
}
} catch (Exception $e) {
Debug::Log($e, ERROR);
return false;
}
return true;
}
示例11: GetCountByIdea
/**
*
* @access public
* @static
* @param Idea $idea
* @return integer|false
*/
public static function GetCountByIdea($idea)
{
$cmd = sprintf("SELECT count(comment_id) AS comments_count FROM zi_comments WHERE idea_id=%d", $idea->idea_id);
try {
$data = Database::Query($cmd);
if (empty($data)) {
throw new IdeaException("can't get comments count for idea");
}
} catch (Exception $e) {
Debug::Log($e, ERROR);
return false;
}
return $data[0]["comments_count"];
}
示例12: retrieveCookie
// Debug info
$debugtmp .= ", FORMID: " . $formid;
} else {
$txid = $reward->txid;
// Debug info
$debugtmp .= ", REQUESTID: " . $reward->requestid . ", TXID VIA REWARD: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
} else {
$txid = $reward->txid;
// Debug info
$debugtmp .= ", REQUESTID: " . $reward->requestid . ", TXID VIA IP: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
} else {
$txid = retrieveCookie();
// Debug info
$debugtmp .= ", TXID VIA COOKIE: " . $txid;
$result = "STATE_ALREADY_CLAIMED";
}
} else {
$result = "STATE_NOT_QUALIFIED";
}
}
}
} else {
$result = "STATE_SESSION_ERROR";
}
if ($result != "STATE_VALID") {
Debug::Log("state_reddit.php, STATE: " . $result . $debugtmp);
}
示例13: GetLastInsertId
/**
*
* @access public
* @static
* @return integer|false
*/
public static function GetLastInsertId()
{
if (empty(self::$db_connection)) {
if (!self::Init()) {
return false;
}
}
try {
$id = @mysql_insert_id(self::$db_connection);
if (mysql_error()) {
throw new DatabaseException(mysql_error());
}
} catch (Exception $e) {
Debug::Log($e, ERROR);
return false;
}
return $id;
}
示例14: send
public function send()
{
if (!$this->isSetHeader()) {
$this->setHeader();
}
try {
if (empty($this->to)) {
throw new MailerException("no recipient of email");
}
} catch (Exception $e) {
Debug::Log($e, WARNING);
return false;
}
try {
if (!@mail($this->to, $this->subject, $this->content, $this->header)) {
throw new MailerException("mail function error");
}
} catch (Exception $e) {
Debug::Log($e, WARNING);
return false;
}
return true;
}
示例15: Update
/**
* Update user account
* For now used only for new password
*
* @param object $user
*
* @return boolean if updated
*/
public static function Update($user)
{
if (!User::GetById($user->user_id)) {
Debug::Log($e, ERROR);
return false;
}
$cmd = sprintf("UPDATE zi_users SET user_password=md5('%s'),user_name='%s',user_email='%s' WHERE user_id=%d", $user->user_password, $user->user_name, $user->user_email, $user->user_id);
try {
if (!Database::Query($cmd, false)) {
throw new UserException("can't update user");
}
} catch (Exception $e) {
Debug::Log($e, ERROR);
return false;
}
return true;
}