当前位置: 首页>>代码示例>>PHP>>正文


PHP debuglog函数代码示例

本文整理汇总了PHP中debuglog函数的典型用法代码示例。如果您正苦于以下问题:PHP debuglog函数的具体用法?PHP debuglog怎么用?PHP debuglog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了debuglog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: creatureaddon_dohook

function creatureaddon_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "gravefight-start":
            if (get_module_objpref("creatures", $args['creatureid'], "description")) {
                output(stripslashes(get_module_objpref("creatures", $args['creatureid'], "description")));
            }
            break;
        case "creatureencounter":
            $args['creaturegold'] += get_module_objpref("creatures", $args['creatureid'], "addgold");
            $args['creaturehealth'] += get_module_objpref("creatures", $args['creatureid'], "addhit");
            $args['creatureattack'] += get_module_objpref("creatures", $args['creatureid'], "addattack");
            $args['creaturedefense'] += get_module_objpref("creatures", $args['creatureid'], "adddefense");
            if (get_module_objpref("creatures", $args['creatureid'], "image")) {
                rawoutput("<table width = \"100%\"><tr><td width=\"100%\" align = \"center\"><img src=\"./images/" . get_module_objpref("creatures", $args['creatureid'], "image") . "\"></td></tr></table>");
            }
            if (get_module_objpref("creatures", $args['creatureid'], "description") && !httpget("nodesc")) {
                output(stripslashes(get_module_objpref("creatures", $args['creatureid'], "description")));
            }
            break;
        case "battle-victory":
            if ($session['user']['level'] < 15 && e_rand(1, 100) <= get_module_objpref("creatures", $args['creatureid'], "gemchance") && get_module_objpref("creatures", $args['creatureid'], "gemmessage")) {
                $message = get_module_objpref("creatures", $args['creatureid'], "gemmessage");
                output($message);
                debug("Creature Addon module is awarding a gem.");
                $session['user']['gems']++;
                debuglog("found a gem when slaying a " . $args['creaturename']);
            }
            break;
    }
    return $args;
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:33,代码来源:creatureaddon.php

示例2: findgem_runevent

function findgem_runevent($type, $link)
{
    global $session;
    output("`^Fortune smiles on you and you find a `%gem`^!`0");
    $session['user']['gems']++;
    debuglog("found a gem in the dirt");
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:7,代码来源:findgem.php

示例3: get_spotify_page

function get_spotify_page($url)
{
    debuglog("Getting Spotify Page " . $url, "SPOTIBIO");
    if (file_exists('prefs/jsoncache/spotify/' . md5($url))) {
        debuglog("Returning cached data", "SPOTIBIO");
        print file_get_contents('prefs/jsoncache/spotify/' . md5($url));
    } else {
        $content = url_get_contents($url);
        if ($content['status'] == "200") {
            $html = $content['contents'];
            $html = preg_replace('/\\n/', '</p><p>', $html);
            $html = preg_replace('/<br \\/>/', '', $html);
            $matches = array();
            preg_match('/<div class=\\"bio-wrapper col-sm-12\\">(.*?)<\\/div>/', $html, $matches);
            $r = "";
            if (array_key_exists(1, $matches)) {
                $r = preg_replace('/<button id=\\"btn-reveal\\".*?<\\/button>/', '', $matches[1]);
                $r = preg_replace('/<a .*?>/', '', $r);
                $r = preg_replace('/<\\/a>/', '', $r);
            }
            file_put_contents('prefs/jsoncache/spotify/' . md5($url), '<p>' . $r . '</p>');
            print "<p>" . $r . "</p>";
        } else {
            header('HTTP/1.1 400 Bad Request');
        }
    }
}
开发者ID:cyrilix,项目名称:rompr,代码行数:27,代码来源:getspotibio.php

示例4: yobit_api_query2

function yobit_api_query2($method, $req = array())
{
    $api_key = '';
    $api_secret = '';
    $req['method'] = $method;
    $req['nonce'] = time();
    $post_data = http_build_query($req, '', '&');
    $sign = hash_hmac("sha512", $post_data, $api_secret);
    $headers = array('Sign: ' . $sign, 'Key: ' . $api_key);
    $ch = null;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; SMART_API PHP client; ' . php_uname('s') . '; PHP/' . phpversion() . ')');
    curl_setopt($ch, CURLOPT_URL, 'https://yobit.net/tapi/');
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
    $res = curl_exec($ch);
    if ($res === false) {
        $e = curl_error($ch);
        debuglog($e);
        curl_close($ch);
        return null;
    }
    curl_close($ch);
    $result = json_decode($res, true);
    if (!$result) {
        debuglog($res);
    }
    return $result;
}
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:32,代码来源:yobit.php

示例5: postToEcwid

function postToEcwid($notice)
{
    require 'config.php';
    $x_response_code = '1';
    // 1=approved, 2=declined
    $x_response_reason_code = '1';
    // 1=approved, 2= declined
    $x_trans_id = $notice['id'];
    $x_invoice_num = $notice['posData'][1];
    $x_amount = $notice['posData'][0];
    $string = $hashValue . $login . $x_trans_id . $x_amount;
    $x_MD5_Hash = md5($string);
    $datatopost = array("x_response_code" => $x_response_code, "x_response_reason_code" => $x_response_reason_code, "x_trans_id" => $x_trans_id, "x_invoice_num" => $x_invoice_num, "x_amount" => $x_amount, "x_MD5_Hash" => $x_MD5_Hash);
    switch ($notice['status']) {
        case 'completed':
        case 'confirmed':
            $url = 'http://app.ecwid.com/authorizenet/' . $storeId;
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $datatopost);
            //curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $response = curl_exec($ch);
            if ($response === false) {
                debuglog('request to ecwid.com failed');
                debuglog(curl_error($ch));
            }
            curl_close($ch);
            return $response;
        default:
            return false;
    }
}
开发者ID:phpsource,项目名称:ecwid-plugin,代码行数:32,代码来源:functions.php

示例6: htoi

function htoi($s)
{
    $val = 0.0;
    $x = 0;
    if ($s[$x] == '0' && ($s[$x + 1] == 'x' || $s[$x + 1] == 'X')) {
        $x += 2;
    }
    while (isset($s[$x])) {
        //		debuglog("{$s[$x]}");
        if ($s[$x] >= '0' && $s[$x] <= '9') {
            $val = $val * 16 + $s[$x] - '0';
        } else {
            if ($s[$x] >= 'A' && $s[$x] <= 'F') {
                debuglog($s[$x]);
                debuglog($s[$x] - chr('A'));
                $val = $val * 16 + ord($s[$x]) - ord('A') + 10;
            } else {
                if ($s[$x] >= 'a' && $s[$x] <= 'f') {
                    $val = $val * 16 + ord($s[$x]) - ord('a') + 10;
                } else {
                    return 0;
                }
            }
        }
        $x++;
    }
    return $val;
}
开发者ID:zarethernet,项目名称:yaamp,代码行数:28,代码来源:utilConversion.php

示例7: es_bridge_gp_dohook

function es_bridge_gp_dohook($hook, $args)
{
    global $session, $baseaccount;
    $item = httpget('item');
    $action = httpget('action');
    if ($session['user']['armor'] != $baseaccount['armor'] && ($action == 'weararmor' || $action == 'buyarmor') && $session['user']['armor'] == $item) {
        $category = 'armor';
        $defense = $session['user']['defense'];
    } elseif ($session['user']['weapon'] != $baseaccount['weapon'] && ($action == 'wearweapon' || $action == 'buyweapon') && $session['user']['weapon'] == $item) {
        $category = 'weapon';
        $attack = $session['user']['attack'];
    } else {
        $category = false;
    }
    if ($category && get_module_pref($category, 'mysticalshop')) {
        $current_id = get_module_pref($category . 'id', 'mysticalshop');
        debug("Current ID is {$current_id}");
        require_once './modules/mysticalshop/lib.php';
        mysticalshop_destroyitem($category);
        mysticalshop_resetbuffs($current_id);
        require_once './modules/mysticalshop_buffs/stripbuff.php';
        mysticalshop_buffs_stripbuff();
        if ($category == 'armor') {
            $session['user']['defense'] = $defense;
        } else {
            $session['user']['attack'] = $attack;
        }
        debuglog('es_bridge_gp: ' . $category . ' (ID: ' . $current_id . ') item removed on action "' . $action . '".');
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:es_bridge_gp.php

示例8: get_lfm_page

function get_lfm_page($page, $lang)
{
    $url = $page . "/+wiki";
    if ($lang) {
        debuglog("Getting Bio with language " . $lang, "LFMBIO");
        $url .= "?lang=" . $lang;
    }
    if (file_exists('prefs/jsoncache/lastfm/' . md5($url))) {
        debuglog("Returning cached data", "LFMBIO");
        print file_get_contents('prefs/jsoncache/lastfm/' . md5($url));
    } else {
        debuglog("Getting Bio Page " . $url, "LFMBIO");
        $content = url_get_contents($url);
        if ($content['status'] == "200") {
            debuglog("  .. Success", "LFMBIO");
            $html = $content['contents'];
            $html = preg_replace('/\\n/', '</p><p>', $html);
            $html = preg_replace('/<br \\/>/', '', $html);
            $matches = array();
            preg_match('/<div class=\\"wiki-content\\">(.*?)<\\/div>/', $html, $matches);
            if (array_key_exists(1, $matches)) {
                debuglog("  ... Found Wiki Data", "LFMBIO");
                file_put_contents('prefs/jsoncache/lastfm/' . md5($url), '<p>' . $matches[1] . '</p>');
                print "<p>" . $matches[1] . "</p>";
            } else {
                header('HTTP/1.1 400 Bad Request');
            }
        } else {
            header('HTTP/1.1 400 Bad Request');
        }
    }
}
开发者ID:cyrilix,项目名称:rompr,代码行数:32,代码来源:getLfmBio.php

示例9: BackendClearEarnings

function BackendClearEarnings()
{
    //	debuglog(__FUNCTION__);
    $delay = time() - 150 * 60;
    $total_cleared = 0;
    $list = getdbolist('db_earnings', "status=1 and mature_time<{$delay}");
    foreach ($list as $earning) {
        $user = getdbo('db_accounts', $earning->userid);
        if (!$user) {
            $earning->delete();
            continue;
        }
        $coin = getdbo('db_coins', $earning->coinid);
        if (!$coin) {
            $earning->delete();
            continue;
        }
        $earning->status = 2;
        // cleared
        $earning->price = $coin->price;
        $earning->save();
        // 		$refcoin = getdbo('db_coins', $user->coinid);
        // 		if($refcoin && $refcoin->price<=0) continue;
        // 		$value = $earning->amount * $coin->price / ($refcoin? $refcoin->price: 1);
        $value = yaamp_convert_amount_user($coin, $earning->amount, $user);
        $user->balance += $value;
        $user->save();
        if ($user->coinid == 6) {
            $total_cleared += $value;
        }
    }
    if ($total_cleared > 0) {
        debuglog("total cleared from mining {$total_cleared} BTC");
    }
}
开发者ID:Bitcoinsulting,项目名称:yiimp,代码行数:35,代码来源:clear.php

示例10: courses_list

/**
 * return array of the courses associated to a netid
 *
 * @param string $netid
 * @return array key: course code; value: course description
 */
function courses_list($netid)
{
    // prepared requests
    $statements = array('course_all_get' => 'SELECT DISTINCT ' . db_gettable('courses') . '.course_code AS mnemonic, ' . db_gettable('courses') . '.course_name AS label ' . 'FROM ' . db_gettable('courses') . ' ' . 'ORDER BY mnemonic ASC', 'user_courses_get' => 'SELECT DISTINCT ' . db_gettable('users_courses') . '.ID, ' . db_gettable('courses') . '.course_code, ' . db_gettable('courses') . '.shortname, ' . db_gettable('courses') . '.course_name, ' . db_gettable('courses') . '.in_recorders, ' . db_gettable('users_courses') . '.origin ' . 'FROM ' . db_gettable('courses') . ' ' . 'INNER JOIN ' . db_gettable('users_courses') . ' ON ' . db_gettable('courses') . '.course_code = ' . db_gettable('users_courses') . '.course_code ' . 'WHERE user_ID = :user_ID');
    $db = db_prepare($statements);
    if (!$db) {
        debuglog("could not connect to sgbd:" . mysql_error());
        die;
    }
    $result = array();
    if ($netid == "") {
        // retrieves all courses in the database
        $course_list = db_courses_all_get();
        $result = array();
        foreach ($course_list as $value) {
            $result[$value['mnemonic']] = $value['mnemonic'] . '|' . $value['label'];
        }
    } else {
        // retrieves all courses for a given netid
        $course_list = db_user_courses_get($netid);
        $result = array();
        foreach ($course_list as $value) {
            $result[$value['course_code']] = $value['course_code'] . '|' . $value['course_name'];
        }
    }
    db_close();
    return $result;
}
开发者ID:jingyexu,项目名称:ezcast,代码行数:34,代码来源:lib_courses.php

示例11: findgold_runevent

function findgold_runevent($type, $link)
{
    global $session;
    $min = $session['user']['level'] * get_module_setting("mingold");
    $max = $session['user']['level'] * get_module_setting("maxgold");
    $gold = e_rand($min, $max);
    output("`^Fortune smiles on you and you find %s gold!`0", $gold);
    $session['user']['gold'] += $gold;
    debuglog("found {$gold} gold in the dirt");
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:10,代码来源:findgold.php

示例12: musicCollectionSpotifyPlaylistHack

function musicCollectionSpotifyPlaylistHack($monitor)
{
    $dirs = array();
    $playlists = do_mpd_command("listplaylists", true, true);
    if (array_key_exists('playlist', $playlists)) {
        foreach ($playlists['playlist'] as $pl) {
            debuglog("Scanning Playlist " . $pl, "COLLECTION", 8);
            fwrite($monitor, "\nScanning Playlist " . $pl);
            doMpdParse('listplaylistinfo "' . format_for_mpd($pl) . '"', $dirs, array("spotify"));
        }
    }
}
开发者ID:cyrilix,项目名称:rompr,代码行数:12,代码来源:collectionupdate.php

示例13: doFileBrowse

function doFileBrowse($path, $prefix)
{
    global $connection, $prefs;
    debuglog("Browsing " . $path, "DIRBROWSER");
    $parts = true;
    $foundfile = false;
    $filedata = array();
    $dircount = 0;
    fputs($connection, 'lsinfo "' . format_for_mpd($path) . '"' . "\n");
    while (!feof($connection) && $parts) {
        $parts = getline($connection);
        if (is_array($parts)) {
            $s = trim($parts[1]);
            if (substr($s, 0, 1) != ".") {
                switch ($parts[0]) {
                    case "file":
                        if (!$foundfile) {
                            $foundfile = true;
                        } else {
                            if (!$prefs['ignore_unplayable'] || array_key_exists('Title', $filedata) && substr($filedata['Title'], 0, 12) != "[unplayable]") {
                                printFileItem(getFormatName($filedata), $filedata['file'], $filedata['Time']);
                            }
                            $filedata = array();
                        }
                        $filedata[$parts[0]] = $parts[1];
                        break;
                    case "playlist":
                        if ($path != "") {
                            // Ignore playlists located at the root. This is cleaner and makes more sense
                            printPlaylistItem(basename($parts[1]), $parts[1]);
                        }
                        break;
                    case "directory":
                        printDirectoryItem($parts[1], basename($parts[1]), $prefix, $dircount, false);
                        $dircount++;
                        break;
                    case "Title":
                    case "Time":
                    case "Artist":
                    case "Album":
                        $filedata[$parts[0]] = $parts[1];
                        break;
                }
            }
        }
    }
    if (array_key_exists('file', $filedata)) {
        if (!$prefs['ignore_unplayable'] || array_key_exists('Title', $filedata) && substr($filedata['Title'], 0, 12) != "[unplayable]") {
            printFileItem(getFormatName($filedata), $filedata['file'], $filedata['Time']);
        }
    }
}
开发者ID:cyrilix,项目名称:rompr,代码行数:52,代码来源:dirbrowser.php

示例14: abandoncastle_runevent

function abandoncastle_runevent($type)
{
    global $session;
    if (!get_module_pref("wasfound") and get_module_setting("forestvil") == 1) {
        output("`n`2While walking in the Forest, you have found a path that leads to an `bAbandoned Castle`b, which is very old.`n`nA sign near the castle says:`n\"`#Beware, only the bravest warrior should enter the Castle. If you decide to enter, your chance to die is pretty high.");
        addnews("%s has found a path to the Abandoned Castle.", $session['user']['name']);
        debuglog("found the Abandoned Castle");
        addnav("Enter the Castle", "runmodule.php?module=abandoncastle");
        addnav("Back to the Forest", "forest.php");
    } else {
        redirect("forest.php?op=search");
    }
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:13,代码来源:abandoncastle.php

示例15: get_int_text

function get_int_text($key, $sub = null)
{
    global $translations;
    if (array_key_exists($key, $translations)) {
        if (is_array($sub)) {
            return htmlspecialchars(vsprintf($translations[$key], $sub), ENT_QUOTES);
        } else {
            return htmlspecialchars($translations[$key], ENT_QUOTES);
        }
    } else {
        debuglog("ERROR! Translation key " . $key . " not found!", "INTERNATIONAL");
        return "UNKNOWN KEY";
    }
}
开发者ID:cyrilix,项目名称:rompr,代码行数:14,代码来源:international.php


注:本文中的debuglog函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。