本文整理汇总了PHP中Debugger::say方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::say方法的具体用法?PHP Debugger::say怎么用?PHP Debugger::say使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debugger
的用法示例。
在下文中一共展示了Debugger::say方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: web_clip_snapshot
/**
* Constructor.
*
* Note: you are not supposed to create a GMailSnapshot object yourself. You should
* use {@link GMailer::getSnapshot()} and/or {@link GMailer::webClip()} instead.
*
* @return GMailWebclipSnapshot
* @param array $raw
*/
function web_clip_snapshot($raw)
{
$clips = array();
foreach ($raw as $webclip) {
if (count($webclip) == 10) {
$ad_site = 4;
$ad_date = 5;
$ad_sub = 6;
$ad_type = 8;
$ad_cat = 9;
} elseif (count($webclip) == 6) {
$ad_site = 0;
// not really, but will be blank
$ad_date = 0;
// not really, but will be blank
$ad_sub = 0;
// not really, but will be blank
$ad_type = 4;
$ad_cat = 5;
} elseif (count($webclip) == 7) {
$ad_site = 4;
$ad_date = 0;
// not really, but will be blank
$ad_sub = 0;
// not really, but will be blank
$ad_type = 5;
$ad_cat = 6;
} else {
Debugger::say("odd web clips: " . print_r($webclip, true));
continue;
}
$clip = array();
//$clip[''] = $webclip[0]; // ??
//$clip[''] = $webclip[1]; // clip id??
$clip['url'] = $webclip[2];
$clip['title'] = $webclip[3];
$clip['site'] = $ad_site != 0 ? $webclip[$ad_site] : "";
$clip['date'] = $ad_date != 0 ? $webclip[$ad_date] : "";
$clip['sub'] = $ad_sub != 0 ? $webclip[$ad_sub] : "";
//$clip[''] = (($less) ? "" : $webclip[7]); // ?? empty
$clip['type'] = $webclip[$ad_type];
// web clip, advertisement, gmail tip, etc.
//$clip['category'] = $webclip[$ad_cat]; // a number
// 1 = Gmail Tip, 2 = News, 3 = Business, 4 = Lifestyle
// 5 = Fun, 6 = Tech, 7 = Sports, 8 = custom
$clips[] = $clip;
}
$this->web_clips = $clips;
return 1;
}
示例2: GMailSnapshot
/**
* Constructor.
*
* Note: you are not supposed to create a GMailSnapshot object yourself. You should
* use {@link GMailer::getSnapshot()} instead.
*
* @return GMailSnapshot
* @param constant $type
* @param array $raw
*/
function GMailSnapshot($type, $raw, $use_session)
{
// input: raw packet generated by GMailer
if (!is_array($raw)) {
$this->created = 0;
$this->snapshot_error = "libgmailer: invalid datapack -- not an array";
// Added by Neerav; 3 Aug 2005
return null;
}
if (count($raw) == 0) {
$this->created = 0;
$this->snapshot_error = "libgmailer: invalid datapack -- no entries";
// Added by Neerav; 3 Aug 2005
return null;
}
//Debugger::say("raw packet as snapshot input: ".print_r($raw,true));
// Gmail version
if (isset($raw["v"][1])) {
$this->gmail_ver = $raw["v"][1];
}
//$raw["v"][2] // What is this?
//$raw["v"][3] // What is this?
// IdentificationKey (ik)
// Added by Neerav; 6 July 2005
if ($use_session) {
if (!isset($_SESSION['id_key']) or $_SESSION['id_key'] == "") {
Debugger::say("Snapshot: Using Sessions, saving id_key(ik)...");
if (isset($raw["ud"][3])) {
$_SESSION['id_key'] = $raw["ud"][3];
Debugger::say("Snapshot: Session id_key saved: " . $_SESSION['id_key']);
} else {
Debugger::say('Snapshot: Session id_key NOT saved. $raw["ud"][3] not found.');
}
}
} else {
if (!isset($_COOKIE[GM_COOKIE_IK_KEY]) or $_COOKIE[GM_COOKIE_IK_KEY] == 0) {
Debugger::say("Snapshot: Using Cookies, saving id_key(ik)...");
if (isset($raw["ud"][3])) {
if (strpos($_SERVER["HTTP_HOST"], ":")) {
$domain = substr($_SERVER["HTTP_HOST"], 0, strpos($_SERVER["HTTP_HOST"], ":"));
} else {
$domain = $_SERVER["HTTP_HOST"];
}
Debugger::say("Saving id_key as cookie " . GM_COOKIE_IK_KEY . " with domain=" . $domain);
header("Set-Cookie: " . GM_COOKIE_IK_KEY . "=" . base64_encode($raw["ud"][3]) . "; Domain=" . $domain . ";");
Debugger::say("Snapshot: Cookie id_key saved: " . GM_COOKIE_IK_KEY . "=" . base64_encode($raw["ud"][3]));
} else {
Debugger::say('Snapshot: Cookie id_key NOT saved. $raw["ud"][3] not found.');
}
}
}
// other "UD"
// Added by Neerav; 6 July 2005
if (isset($raw["ud"])) {
// account email address
// your app SHOULD cache this in session or cookie for use across pages
// Added by Neerav; 6 May 2005
$this->gmail_email = $raw["ud"][1];
//$raw["ud"][2] // keyboard shortcuts
//$raw["ud"][3] // Identification Key, set above
//$raw["ud"][4] // What is this?
}
// su
//$raw["su"][1] // What is this?
//$raw["su"][2] // What is this? (?? array of text strings for invites)
// Google Accounts' name
// your app SHOULD cache this in session or cookie for use across pages
// it's bandwidth expensive to retrieve preferences just for this
// Added by Neerav; 2 July 2005
if (isset($raw["gn"][1])) {
$this->google_name = $raw["gn"][1];
}
// your app SHOULD cache this in session or cookie for use across pages
// it's bandwidth expensive to retrieve preferences just for this
// Added by Neerav; 6 July 2005
if (isset($raw["p"])) {
for ($i = 0; $i < count($raw["p"]); $i++) {
if ($raw["p"][$i][0] == "sx_sg") {
// can be undefined ?!?!
$this->signature = isset($raw["p"][$i][1]) ? $raw["p"][$i][1] : "";
break;
}
}
}
// Invites
if (isset($raw["i"][1])) {
$this->have_invit = $raw["i"][1];
} else {
$this->have_invit = 0;
}
//.........这里部分代码省略.........
示例3: GMailSnapshot
/**
* Constructor.
*
* Note: you are not supposed to create a GMailSnapshot object yourself. You should
* use {@link GMailer::getSnapshot()} instead.
*
* @return GMailSnapshot
* @param constant $type
* @param array $raw
*/
function GMailSnapshot($type, $raw, $use_session, $raw_html)
{
// input: raw packet generated by GMailer
// Invalid datapack checking
// snapshot_error Added; by Neerav; 3 Aug 2005
// Added http errors; by Neerav; 16 Sept 2005
if (!is_array($raw) or count($raw) == 0) {
$this->created = 0;
if (ereg('gmail_error=([0-9]{3})', $raw_html, $matches)) {
$this->snapshot_error = $matches[1];
if ($matches[1] != 500) {
Debugger::say("libgmailer: Gmail http error (" . $matches[1] . "), dump RAW HTML:\n" . print_r($raw_html, true));
}
/* $this->snapshot_error_no = $matches[1]; */
/* ereg('<p><font size="-1">(.*?)</font></p>',$raw_html,$matches); */
/* $this->snapshot_error = $matches[1]; */
} elseif (ereg('<title>([0-9]{3}) Server Error</title>', $raw_html, $matches)) {
$this->snapshot_error = $matches[1];
if ($matches[1] != 502) {
Debugger::say("libgmailer: Gmail http error (" . $matches[1] . "), dump RAW HTML:\n" . print_r($raw_html, true));
}
} elseif (strpos($raw_html, '500 Internal Server Error') !== false) {
$this->snapshot_error = 500;
} elseif (strpos($raw_html, 'gmail_error=') !== false) {
$this->snapshot_error = "Unknown gmail error";
Debugger::say("libgmailer: unknown gmail error, dump RAW HTML:\n" . print_r($raw_html, true));
} elseif (strpos($raw_html, 'top.location="https://www.google.com/accounts/ServiceLogin') !== false) {
// Added error; by Neerav; 12 Oct 2005
//libgmailer: Gmail redirect to login screen
$this->snapshot_error = "libg110";
} elseif ($raw_html == "") {
$this->snapshot_error = "No response from Gmail";
} elseif (!is_array($raw)) {
$this->snapshot_error = "Invalid response from Gmail (not an array)";
Debugger::say("libgmailer: invalid datapack -- not an array, dump RAW HTML:\n" . print_r($raw_html, true));
} elseif (count($raw) == 0) {
$this->snapshot_error = "Invalid response from Gmail (empty)";
}
return null;
}
// Gmail version
if (isset($raw["v"][1])) {
$this->gmail_ver = $raw["v"][1];
}
//$raw["v"][2] // What is this? Another version number?
//$raw["v"][3] // What is this?
// IdentificationKey (ik)
// Added by Neerav; 6 July 2005
if ($use_session) {
if (!isset($_SESSION['id_key']) or $_SESSION['id_key'] == "") {
Debugger::say("Snapshot: Using Sessions, saving id_key(ik)...");
if (isset($raw["ud"][3])) {
$_SESSION['id_key'] = $raw["ud"][3];
Debugger::say("Snapshot: Session id_key saved: " . $_SESSION['id_key']);
} else {
Debugger::say('Snapshot: Session id_key NOT saved. $raw["ud"][3] not found.');
}
}
} else {
if (!isset($_COOKIE[GM_COOKIE_IK_KEY]) or $_COOKIE[GM_COOKIE_IK_KEY] == 0) {
Debugger::say("Snapshot: Using Cookies, saving id_key(ik)...");
if (isset($raw["ud"][3])) {
if (strpos($_SERVER["HTTP_HOST"], ":")) {
$domain = substr($_SERVER["HTTP_HOST"], 0, strpos($_SERVER["HTTP_HOST"], ":"));
} else {
$domain = $_SERVER["HTTP_HOST"];
}
Debugger::say("Saving id_key as cookie " . GM_COOKIE_IK_KEY . " with domain=" . $domain);
header("Set-Cookie: " . GM_COOKIE_IK_KEY . "=" . base64_encode($raw["ud"][3]) . "; Domain=" . $domain . ";");
Debugger::say("Snapshot: Cookie id_key saved: " . GM_COOKIE_IK_KEY . "=" . base64_encode($raw["ud"][3]));
} else {
Debugger::say('Snapshot: Cookie id_key NOT saved. $raw["ud"][3] not found.');
}
}
}
// other "UD"
// Added by Neerav; 6 July 2005
if (isset($raw["ud"])) {
// account email address
// your app SHOULD cache this in session or cookie for use across pages
// Added by Neerav; 6 May 2005
$this->gmail_email = $raw["ud"][1];
//$raw["ud"][2] // keyboard shortcuts
//$raw["ud"][3] // Identification Key, set above
//$raw["ud"][4] // What is this? referrer?
//$raw["ud"][5] // What is this?
//$raw["ud"][6] // What is this?
//$raw["ud"][7] // What is this?
}
// su
//.........这里部分代码省略.........
示例4: web_clip_snapshot
/**
* Constructor.
*
* Note: you are not supposed to create a GMailSnapshot object yourself. You should
* use {@link GMailer::getSnapshot()} and/or {@link GMailer::webClip()} instead.
*
* @return GMailWebclipSnapshot
* @param array $raw
*/
function web_clip_snapshot($raw, $action = "item")
{
$clips = array();
if ($action == 'preview') {
$this->feed['id'] = $raw['fl'][2][0][0];
$this->feed['url'] = $raw['fl'][2][0][1];
$this->feed['site'] = $raw['fl'][2][0][2];
// must be last!
if (isset($raw['fl'][2][0][6])) {
$raw = $raw['fl'][2][0][6];
}
}
foreach ($raw as $webclip) {
if (count($webclip) == 10) {
$ad_site = 4;
$ad_date = 5;
$ad_sub = 6;
$ad_type = 8;
$ad_cat = 9;
} elseif (count($webclip) == 6) {
$ad_site = 0;
// not really, but will be blank
$ad_date = 0;
// not really, but will be blank
$ad_sub = 0;
// not really, but will be blank
$ad_type = 4;
$ad_cat = 5;
} elseif (count($webclip) == 7) {
$ad_site = 4;
$ad_date = 0;
// not really, but will be blank
$ad_sub = 0;
// not really, but will be blank
$ad_type = 5;
$ad_cat = 6;
} else {
Debugger::say(basename(__FILE__) . ": " . __LINE__ . ": " . "odd web clips: " . print_r($webclip, true));
continue;
}
$clip = array();
//$clip[''] = $webclip[0]; // ??
$clip['id'] = $webclip[1];
$clip['url'] = $webclip[2];
$clip['title'] = $webclip[3];
$clip['site'] = $ad_site != 0 ? $webclip[$ad_site] : "";
$clip['date'] = $ad_date != 0 ? $webclip[$ad_date] : "";
$clip['sub'] = $ad_sub != 0 ? $webclip[$ad_sub] : "";
//$clip[''] = (($less) ? "" : $webclip[7]); // ?? empty
$clip['type'] = $webclip[$ad_type];
// web clip, advertisement, gmail tip, etc.
$clip['category'] = $webclip[$ad_cat];
// a number
// 1 = Gmail Tip, 2 = News, 3 = Business, 4 = Lifestyle
// 5 = Fun, 6 = Tech, 7 = Sports, 8 = custom
$clips[] = $clip;
}
if ($action == 'preview') {
$this->feed['web_clips'] = $clips;
} else {
$this->web_clips = $clips;
}
return 1;
}