本文整理汇总了PHP中debugmsg函数的典型用法代码示例。如果您正苦于以下问题:PHP debugmsg函数的具体用法?PHP debugmsg怎么用?PHP debugmsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debugmsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
//setrelated request
$ctoId = '12x22';
// Contacts
$pdoId = '14x52';
// Product
$docId = '15x159';
// Document
$srvId = '26x151';
// Services
$params = array("sessionName" => $cbSessionID, "operation" => 'SetRelation', "relate_this_id" => $ctoId, 'with_these_ids' => json_encode(array($pdoId, $docId, $srvId)));
$response = $httpc->send_post_data($cbURL, $params, true);
$dmsg .= debugmsg("Raw response (json) SetRelation", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response SetRelation", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('SetRelation failed:' . $jsonResponse['error']['message']);
echo 'SetRelation failed!';
} else {
// Show response
var_dump($jsonResponse['result']);
}
示例2: debugmsg
<?php
// Login Contact
// Validates a contact access to the portal: the contact must have an active portal access with correct access dates
// and give the correct email and password.
// This method returns a valid logged in session with the internal "portal" user
$email = 'joe@tsolucio.com';
$password = '6zdfda3f';
$params = "operation=loginPortal&username={$email}&password={$password}";
$response = $httpc->fetch_url("{$cbURL}?{$params}");
$dmsg .= debugmsg("Raw response (json) Query", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response loginPortal", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('loginPortal failed: ' . $jsonResponse['message']);
echo 'loginPortal failed!';
} else {
if (!$jsonResponse['result']) {
echo 'Contact with email ' . $email . ' could <b>NOT</b> be logged in correctly!';
} else {
echo 'Contact with ID ' . $jsonResponse['result'] . ' has been logged in correctly!';
}
}
示例3: array
<?php
//fill in the details of the invoice id.
$invoiceId = $_REQUEST['invoiceID'];
//sessionId is obtained from loginResult.
$params = array("sessionName" => $cbSessionID, "operation" => 'getpdfdata', "id" => $invoiceId);
//Create must be POST Request.
$response = $httpc->send_post_data($cbURL, $params, true);
$dmsg .= debugmsg("Raw response (json) GetPDFData", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response GetPDFData", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('GetPDFData failed: ' . $jsonResponse['error']['message']);
echo 'GetPDFData failed!';
} else {
// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Expires: 0");
// set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// browser must download file from server instead of cache
// force download dialog
header("Content-Type: application/force-download");
header('Content-Type: application/pdf');
header("Content-Type: application/download");
// use the Content-Disposition header to supply a recommended filename and
// force the browser to display the save dialog.
header('Content-Disposition: attachment; filename="invoice.pdf"');
/*
The Content-transfer-encoding header should be binary, since the file will be read
示例4: debugmsg
<?php
//SessionId is the session which is to be terminated.
$params = "operation=logout&sessionName={$cbSessionID}";
//logout must be GET Request.
$response = $httpc->fetch_url("{$cbURL}?{$params}");
$dmsg .= debugmsg("Raw response (json) Logout", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response Logout", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('logout failed: ' . $jsonResponse['message']);
echo 'logout failed!';
} else {
echo debugmsg("Webservice Logout", $jsonResponse);
}
示例5: urlencode
<?php
//sessionId is obtained from loginResult.
$grefParams = '&term=' . urlencode('es') . '&filter=contains' . '&searchinmodules=Accounts,Contacts' . '&limit=10';
$params = "sessionName={$cbSessionID}&operation=getReferenceAutocomplete{$grefParams}";
//Call must be GET Request.
$response = $httpc->fetch_url("{$cbURL}?{$params}");
$dmsg .= debugmsg("Raw response (json) getReferenceAutocomplete", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response getReferenceAutocomplete", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('getReferenceAutocomplete failed: ' . $jsonResponse['error']['message']);
echo 'getReferenceAutocomplete failed!';
} else {
var_dump($jsonResponse['result']);
}
示例6: debugmsg
<?php
//listtypes request must be GET request.
$response = $httpc->fetch_url("{$cbURL}?sessionName={$cbSessionID}&operation=listtypes");
$dmsg .= debugmsg("Raw response (json) listtypes", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response listtypes", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('list types failed:' . $jsonResponse['error']['message']);
echo 'list types failed!';
} else {
//Get the List of all the modules accessible.
$modules = $jsonResponse['result']['types'];
echo "<b>Accesible Modules</b><br>";
foreach ($modules as $modname) {
echo "{$modname}<br>";
}
}
示例7: md5
<?php
include 'testcode/010_getchallenge.php';
//create md5 string concatenating user accesskey from my preference page
//and the challenge token obtained from get challenge result.
$generatedKey = md5($challengeToken . $cbAccessKey);
//login request must be POST request.
$response = $httpc->send_post_data($cbURL, array('operation' => 'login', 'username' => $cbUserName, 'accessKey' => $generatedKey), true);
$dmsg .= debugmsg("Raw response (json) doLogin", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response doLogin", $jsonResponse);
//operation was successful get the token from the response.
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('login failed:' . $jsonResponse['error']['message']);
echo "Error trying to log in!";
} else {
//login successful extract sessionId and userId from LoginResult so it can used for further calls.
$sessionId = $jsonResponse['result']['sessionName'];
$userId = $jsonResponse['result']['userId'];
echo "doLogin sessionId: {$sessionId}<br>";
echo "doLogin userId: {$userId}<br>";
}
示例8: array
<?php
// authenticate Contact
// Validates a contact access to the portal: the contact must have an active portal access with correct access dates
// and give the correct email and password.
$email = 'mary_smith@company.com';
$password = 'j531iuze';
$params = array("sessionName" => $cbSessionID, "operation" => 'authenticateContact', 'email' => $email, 'password' => $password);
$response = $httpc->send_post_data($cbURL, $params, true);
$dmsg .= debugmsg("Raw response (json) Query", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response authenticateContact", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('authenticateContact failed: ' . $jsonResponse['message']);
echo 'authenticateContact failed!';
} else {
if (!$jsonResponse['result']) {
echo 'Contact with email ' . $email . ' could <b>NOT</b> be authenticated correctly!';
} else {
echo 'Contact with ID ' . $jsonResponse['result'] . ' has been authenticated correctly!';
}
}
示例9: debugmsg
<?php
//vtiger Object name which need be described or whose information is requested.
// Can be passed in with modulename parameter
$moduleName = 'Contacts';
//use sessionId created at the time of login.
$params = "sessionName={$cbSessionID}&operation=describe&elementType={$moduleName}";
//describe request must be GET request.
$response = $httpc->fetch_url("{$cbURL}?{$params}");
$dmsg .= debugmsg("Raw response (json) describe", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response describe", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('describe object failed:' . $jsonResponse['error']['message']);
echo 'describe object failed!';
} else {
//get describe result object.
$description = $jsonResponse['result'];
echo "<b>Module Name and Id:</b> " . $moduleName . ' (' . $description['idPrefix'] . ')</br>';
echo "<b>User can create records:</b> " . ($description['createable'] == 1 ? 'Yes' : 'No') . '</br>';
echo "<b>User can update records:</b> " . ($description['updateable'] == 1 ? 'Yes' : 'No') . '</br>';
echo "<b>User can delete records:</b> " . ($description['deleteable'] == 1 ? 'Yes' : 'No') . '</br>';
echo "<b>User can retrieve records:</b> " . ($description['retrieveable'] == 1 ? 'Yes' : 'No') . '</br>';
echo "<b>Fields (hover over name for full details):</b> </br>";
$i = 0;
foreach ($description['fields'] as $field) {
$ttname = "tt{$i}";
$i++;
$fieldname = $field['label'];
$fielddesc = "{$fieldname}\nField: " . $field['name'] . "\nMandatory: ";
示例10: array
<?php
//fill in the details of the document id
// select id from documents
// 7x138 is an existing document
$docId = '7x138';
//sessionId is obtained from loginResult.
$params = array("sessionName" => $cbSessionID, "operation" => 'retrievedocattachment', "id" => $docId, 'returnfile' => false);
//Create must be POST Request.
$response = $httpc->send_post_data($cbURL, $params, true);
$dmsg .= debugmsg("Raw response (json) retrievedocattachment", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response retrievedocattachment", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('retrievedocattachment failed: ' . $jsonResponse['error']['message']);
echo 'retrievedocattachment failed!';
} else {
echo "<script type='text/javascript'>\n\t\tfunction doDOCDownload() {\n\t\t\tio = document.createElement('iframe');\n\t\t\tio.src = 'index.php?action=execCodeDirect&script=430_getDocumentDirect.php&docId=" . $docId . "';\n\t\t\tio.style.display = 'block';\n\t\t\tio = \$(io);\n\t\t\t\$('body').append(io);\n\t\t\tsetTimeout(function() {\n\t\t\t\tio.remove();\n\t\t\t}, 5000);\n\t\t}\n\t\t</script>";
echo "<br><a href='javascript:doDOCDownload();' class='btn btn-primary btn-large'>Download Document</a>";
}
示例11: tagLI
<?php
function tagLI($vli)
{
echo "<li>{$vli}</li>";
}
echo '<ul>';
// show the variables we can use in our test code
tagLI("URL of the site we logged in with: <b>" . $cbURL . "</b>");
tagLI("Username we logged in with: <b>" . $cbUserName . "</b>");
tagLI("UserID we logged in with: <b>" . $cbUserID . "</b>");
tagLI("Accesskey we logged in with: <b>" . $cbAccessKey . "</b>");
tagLI("SessionID we logged in with: <b>" . $cbSessionID . "</b>");
tagLI('cbwsLibrary connection to coreBOS: <b>$cbconn</b>');
tagLI('http_curl connection to coreBOS: <b>$httpc</b>');
echo '</ul>';
// debug message
$dmsg = 'Any message we put into the <b>$dmsg</b> variable will be output to the Debug box';
$dmsg .= debugmsg('Result of the REST call', array('status' => 'success', 'result' => 'hello world'));
echo "<br>You can find some more information on our wiki: <a href='http://corebos.org/documentation/doku.php?id=en:devel:corebosws:coreBOSwsDevelopment'>coreBOSwsDevelopment</a>";
示例12: array
<?php
// Obtained from contact creation example
$contactId = '4x194';
//delete a record created in above examples, sessionId a obtain from the login result.
$params = array("sessionName" => $cbSessionID, "operation" => 'delete', "id" => $contactId);
//delete operation request must be POST request.
$response = $httpc->send_post_data($cbURL, $params, true);
$dmsg .= debugmsg("Raw response (json) Delete", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response Delete", $jsonResponse);
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('delete failed: ' . $jsonResponse['error']['message']);
echo 'delete failed!';
} else {
echo debugmsg("Record Deleted", $jsonResponse);
}
示例13: xmpp_presence
function xmpp_presence($stanza, $sock, $ircsock)
{
global $xmppparams, $ircdata;
$obj = new CXMLTag();
$obj->fromArray($stanza);
$toparts = xmpp_parse_jid($obj->attribs['to']);
$fromparts = xmpp_parse_jid($obj->attribs['from']);
// Join only valid IRC channel
if (!irc_valid_channel(from_utf($toparts['user']))) {
debugmsg("Invalid channel name\n");
return false;
}
// Ignore invalid jid
if (!$toparts['user'] || !$toparts['resource'] || !$fromparts['user'] || !$fromparts['resource']) {
$answer = $obj->createError("modify", "jid-malformed", true);
debugmsg("No nickname or room name\n");
xmpp_write($sock, $answer->toString());
return false;
}
$channel = from_utf($toparts['user']);
// Normalize case if channel exists
if ($norm_ch = $ircdata->channel_exists($channel)) {
$channel = $norm_ch;
} else {
$ircdata->add_channel($channel);
}
$nick = $ircdata->jid_exists(from_utf($obj->attribs['from']));
$newnick = from_utf($toparts['resource']);
$forcenick = '';
// dump_ircdata("ircdata.dump", FILE_APPEND, "Do");
if (!$nick) {
debugmsg("New user, trying to join IRC\n");
if (isset($obj->attribs['type'])) {
return false;
}
// First enter of JID
$nick = from_utf($toparts['resource']);
if (!irc_valid_nick($nick)) {
$answer = $obj->createError("cancel", "not-acceptable", true);
debugmsg("Invalid nick\n");
xmpp_write($sock, $answer->toString());
return false;
}
if ($ircdata->nick_exists($nick)) {
$answer = $obj->createError("cancel", "conflict", true);
debugmsg("Nick already exists\n");
xmpp_write($sock, $answer->toString());
return false;
}
$ircdata->add_nick($nick, '', '', '', from_utf($obj->attribs['from']));
// Send new nick to IRC server
irc_nick($ircsock, $nick);
} else {
if (isset($obj->attribs['type'])) {
if ($obj->attribs['type'] == 'unavailable') {
debugmsg("Part room\n");
if ($ircdata->is_on($nick, $channel)) {
if ($statustag = $obj->firstSubtag('status')) {
$status = from_utf($statustag->text);
} else {
$status = '';
}
xmpp_write($sock, xmpp_part(to_utf($nick), $toparts['user']));
irc_part($ircsock, $nick, $channel);
$ircdata->part_channel($nick, $channel, $status);
if (!$ircdata->get_on_channels($nick)) {
irc_quit($ircsock, $nick, $status);
$ircdata->remove_nick($nick);
}
} else {
return false;
}
return true;
}
}
// JID already exists
// Fix for status changes
if ($nick == $newnick) {
//return false;
debugmsg("JID already exists\n");
}
if (strcasecmp(from_utf($toparts['resource']), $nick) != 0) {
$forcenick = $nick;
}
}
// Is channel pressent
if ($nick != $newnick && $ircdata->is_on($nick, $channel)) {
// debugmsg(" --- Test: user on channel", 1);
if (!irc_valid_nick($newnick)) {
$answer = $obj->createError('cancel', 'not-acceptable', true);
debugmsg("Invalid nick\n");
xmpp_write($sock, $answer->toString());
return false;
}
// Change nick
$can_change = $ircdata->can_change_nick($nick, $newnick);
if ($can_change === true) {
debugmsg("Changing nick\n");
irc_change_nick($ircsock, $nick, $newnick);
xmpp_write($sock, xmpp_change_nick(to_utf($nick), to_utf($newnick)));
//.........这里部分代码省略.........
示例14: debugmsg
<?php
// show the variables we can use in our test code
echo "URL of the site we logged in with: <b>" . $cbURL . "</b><br>";
echo "Username we logged in with: <b>" . $cbUserName . "</b><br>";
echo "UserID we logged in with: <b>" . $cbUserID . "</b><br>";
echo "Accesskey we logged in with: <b>" . $cbAccessKey . "</b><br>";
echo "SessionID we logged in with: <b>" . $cbSessionID . "</b><br>";
echo 'cbwsLibrary connection to coreBOS: <b>$cbconn</b><br>';
echo 'http_curl connection to coreBOS: <b>$httpc</b><br>';
// debug message
$dmsg = 'Any message we put into the <b>$dmsg</b> variable will be output to the Debug box';
$dmsg .= debugmsg('we have a special function for debug messages which accepts complex variables', array('v1' => 'value 1', 'v2' => 'value2'));
echo "<br>You can find some more information on our wiki: <a href='http://corebos.org/documentation/doku.php?id=en:devel:corebosws:coreBOSwsDevelopment'>coreBOSwsDevelopment</a>";
示例15: debugmsg
<?php
// To obtain the identifier of the account you can use the Query operation
$accountId = '3x40';
//sessionId is obtained from loginResult.
$params = "sessionName={$cbSessionID}&operation=retrieve&id={$accountId}";
//Retrieve must be GET Request.
$response = $httpc->fetch_url("{$cbURL}?{$params}");
$dmsg .= debugmsg("Raw response (json) Retrieve", $response);
//decode the json encode response from the server.
$jsonResponse = json_decode($response, true);
$dmsg .= debugmsg("Webservice response Retrieve", $jsonResponse);
//operation was successful get the token from the response.
if ($jsonResponse['success'] == false) {
$dmsg .= debugmsg('retrieve failed:' . $jsonResponse['error']['message']);
echo 'retrieve failed!';
} else {
$retrievedObject = $jsonResponse['result'];
var_dump($retrievedObject);
}