本文整理汇总了PHP中decho函数的典型用法代码示例。如果您正苦于以下问题:PHP decho函数的具体用法?PHP decho怎么用?PHP decho使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了decho函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __call
public function __call($name, $args)
{
decho("{$name} in: " . print_r($args, true) . "\n");
$result = call_user_func_array(array($this->provider, $name), $args);
decho("{$name} out: " . print_r($result, true) . "\n");
return $result;
}
示例2: Platoon
public function Platoon($unit_id, $platoon_id)
{
$query = sprintf("SELECT leader_id, name, logo, creed, bio \n\t\tFROM rudi_platoons \n\t\tWHERE unit_id = %d AND platoon_id = %d", (int) $unit_id, (int) $platoon_id);
$result = $this->db->Query($query);
$platoon = $this->db->FetchObject($result, 'UnitInfo', true);
decho($platoon);
return $platoon;
}
示例3: getCombatSoldiers
function getCombatSoldiers($war_id)
{
global $db;
$query = "SELECT m.member_id, \n\t\t\t\t\t\t\t\t\t m.first_name, \n\t\t\t\t\t\t\t\t\t m.last_name, \n\t\t\t\t\t\t\t\t\t r.shortname, \n\t\t\t\t\t\t\t\t\t r.longname, \n\t\t\t\t\t\t\t\t\t w.record_id,\n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t FROM rudi_combat_record AS w \n\t\t\t\t\t\t\t JOIN rudi_unit_members AS m \n\t\t\t\t\t\t\t ON m.member_id = w.member_id \n\t\t\t\t\t\t\t JOIN rudi_ranks AS r \n\t\t\t\t\t\t\t ON m.rank_id = r.rank_id \n\t\t\t\t\t\t\t WHERE m.status_id < 4, w.war_id = {$war_id} OR w.war_id IS NULL \n\t\t\t\t\t\t\t ORDER BY r.weight DESC , m.date_promotion ASC , m.date_enlisted ASC";
decho($query);
$result = $db->Query($query);
$data = $db->Fetch($result);
return $data;
}
示例4: post_parse
function post_parse()
{
global $appmsg, $apperr, $action, $dmon_msg;
if (empty($_POST)) {
decho("call function post_parse without post", 1);
return -1;
}
foreach ($_POST as $ind => $val) {
switch ($ind) {
case "action":
$action = $val;
// switch val
break;
case "message":
$dmon_msg = $val;
break;
}
// switch $ind
}
// for
}
示例5: Translate
public function Translate($Code, $Default = FALSE)
{
$Result = parent::Translate($Code, $Default);
if (!$Code || substr($Code, 0, 1) == '@') {
return $Result;
}
$Prefix = self::GuessPrefix();
if (!$Prefix) {
return $Result;
}
if ($Prefix == 'unknown') {
decho($Code);
decho(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS));
die;
}
if (Gdn_Theme::InSection('Dashboard')) {
$Prefix = 'dash_' . $Prefix;
} else {
$Prefix = 'site_' . $Prefix;
}
$this->_CapturedDefinitions[$Prefix][$Code] = $Result;
return $Result;
}
示例6: spider
/**
* @return array an array of two values:
* 1. Whether all descendants of this item were spidered
* 2. Whether this item has or may have valid descendants
* - used to delete things that have no valid descendants
*/
public function spider($recursionDepth = 0)
{
// don't spider a Term in batch mode if it's an old term
if ($this instanceof Term && php_sapi_name() == 'cli' && $this->getStatus() == -1) {
return array(true, true);
}
$shallowSpidering = $this instanceof School && $recursionDepth == 2 || $this instanceof Campus && $recursionDepth == 1 || $this instanceof Term && $recursionDepth == 0;
if (!$shallowSpidering && !$this->needsSpidering()) {
return array(true, true);
}
if ($shallowSpidering && !$this->needsSpidering($this->getShallowSpideredAt())) {
return array(false, true);
}
if ($this instanceof Section) {
return $this->getBookstore()->spiderSections(array($this));
}
decho("Spidering {$this->class} " . call_user_func(array($this, "get{$this->debug}")) . "\n");
// mark all children in the database as untouched
$this->getChildQuery()->update(array('Touched' => false));
try {
$children = $this->getChildren();
} catch (BookstoreError $e) {
// retry once
$children = $this->getChildren();
}
// update the database with the spidered data
list($allChildren, $skipped) = $this->updateDb($children);
$recursionDepth -= (int) $skipped;
// if we were in the middle of spidering, pick up where we left off
$children = array_filter($allChildren, function ($c) {
return $c->needsSpidering();
});
$partial = count($children) < count($allChildren);
$complete = false;
if ($recursionDepth > 0) {
if ($this instanceof Course) {
// spider multiple sections at once
list($complete, $foo) = $this->getBookstore()->spiderSections($children);
$partial = $partial || $foo;
} else {
$complete = true;
foreach ($children as $child) {
$result = $child->spider($recursionDepth - 1);
$complete = $complete && $result[0];
$partial = $partial || $result[1];
}
}
} else {
$complete = $this instanceof Course;
$partial = true;
}
if ($complete) {
$this->setSpidered()->save();
}
if ($partial && $shallowSpidering) {
$this->setShallowSpideredAt(time())->save();
}
if (!$partial) {
$this->disable("No children!");
return array(true, true);
}
return array($complete, $partial);
}
示例7: defined
<?php
defined('APPLICATION') or exit;
?>
<h1><?php
echo $this->Data('Title');
?>
</h1>
<div class="Info"><?php
echo $this->Data('Info');
?>
</div>
<?php
echo $this->Form->Open();
echo $this->Form->Errors();
echo $this->Form->Label($this->Data('CategoriesLabel'), 'CheckBoxList');
echo $this->Form->CheckBoxList('Plugins.EventCalendar.CategoryIDs', $this->CategoryData, $this->EventCategory, array('ValueField' => 'CategoryID', 'TextField' => 'Name'));
echo $this->Form->Button('Save');
echo $this->Form->Close();
decho($this);
示例8: defined
<?php
defined('APPLICATION') or exit;
?>
<h1><?php
echo $this->Title();
?>
</h1>
<?php
decho($this->Data('TEST')->Result());
示例9: GetStatuses
$statuses = GetStatuses();
foreach ($statuses as $status) {
echo "<option value=\"{$status['status_id']}\">{$status['name']}</option>";
}
?>
</select>
</td></tr>
<tr><td class="right">Primary MOS:</td><td class="left"><input type="text" name="primmos" value="" /></td></tr>
<tr>
<td class="right">Role:</td>
<td class="left">
<select name="role">
<option value="0">---SELECT-POSITION---</option>
<?php
$groups = GetRoles();
decho($groups);
foreach ($groups as $group) {
echo "<optgroup label=\"{$group['name']}\">";
foreach ($group['roles'] as $role) {
echo "<option value=\"{$role['role_id']}\">{$role['name']}</option>";
}
echo "</optgroup>";
}
?>
</select>
</td>
</tr>
<tr>
<td class="right" style="font-weight:bold;">Unit:</td>
<td class="left">
<select name="unit">
示例10: addSchools
public static function addSchools()
{
$class = get_called_class();
decho("Adding schools for {$class}");
foreach (static::getSchools() as $data) {
print_r($data);
$school = SchoolQuery::create()->filterByBookstoreType($class)->filterBySubdomain($data['Subdomain'])->findOne();
if (!$school) {
$school = new School();
$school->setBookstoreType($class)->setSubdomain($data['Subdomain']);
}
$school->setSlug($data['Slug'])->setName($school->getName() ?: $data['Name'])->setShortName($school->getShortName(true) ?: (isset($data['ShortName']) ? $data['ShortName'] : School::guessShortName($data['Name'], $data['Slug'])))->setTouched(1)->save();
}
}
示例11: BayonetForm
<?php
$class_id = $_GET['cid'];
$form = new BayonetForm("", "POST");
if ($form->verifySubmit('processed')) {
global $db;
$name = $form->request['name'];
$text = $form->request['text'];
decho("INSERT INTO `rudi_awards` SET `class_id` = '{$class_id}', `name` = '{$name}', `description` = '{$text}'");
$db->Query("INSERT INTO `rudi_awards` SET `class_id` = '{$class_id}', `name` = '{$name}', `image` = '', `description` = '{$text}'");
PageRedirect(1, "?op=rudi&show=awards&cid=" . $class_id);
return;
}
echo LinkInternal("Cancel", "?op=rudi&show=awards&cid=" . $class_id);
OpenTable();
?>
<tr><th>Name:</th><td><?php
$form->textField('name', "", false, "50");
?>
</td><tr>
<tr><th>Image:</th><td><?php
?>
</td></tr>
<tr><th>Text:</th><td><?php
$form->textArea('text', 10, 30);
?>
</td></tr>
<tr><td><?php
$form->submitButton('processed', 'Add');
?>
示例12: die
<HTML>
<BODY>
<?php
$password = $_POST['pswd'];
$username = $_POST['name'];
echo "<BR>Checking authentication of user {$username} ... <P>";
if ($username == "" || $password == "") {
echo "<H3>Sorry, you must supply both username and password.</H3>\n";
die("<A HREF=\"./index.php\"><BUTTON TYPE=button> Try again or create new account? </BUTTON></A>\n");
}
my_connect();
$sessionid = session_id();
decho("You have authenticated as user '{$username}'. Your sessionid is '{$sessionid}'.<BR>");
my_disconnect();
$sessionid = session_id();
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;
$_SESSION['debug'] = $debug;
?>
<P>
<H3>You have logged in successfully.</H3>
<A HREF="./mainpage.php"><BUTTON TYPE=button> Proceed to the main page </BUTTON></A><P>
<A HREF="./logout.php"><BUTTON TYPE=button> Logout </BUTTON></A>
</BODY>
</HTML>
示例13: rewriteRequest
/**
* Rewrite the request based on rewrite rules (currently called routes in Vanilla).
*
* This method modifies the passed {@link $request} object. It can also cause a redirect if a rule matches that
* specifies a redirect.
*
* @param Gdn_Request $request The request to rewrite.
*/
private function rewriteRequest($request)
{
$pathAndQuery = $request->PathAndQuery();
$matchRoute = Gdn::router()->matchRoute($pathAndQuery);
// We have a route. Take action.
if (!empty($matchRoute)) {
$dest = $matchRoute['FinalDestination'];
if (strpos($dest, '?') === false) {
// The rewrite rule doesn't include a query string so keep the current one intact.
$request->path($dest);
} else {
// The rewrite rule has a query string so rewrite that too.
$request->pathAndQuery($dest);
}
switch ($matchRoute['Type']) {
case 'Internal':
// Do nothing. The request has been rewritten.
break;
case 'Temporary':
safeHeader("HTTP/1.1 302 Moved Temporarily");
safeHeader("Location: " . url($matchRoute['FinalDestination']));
exit;
break;
case 'Permanent':
safeHeader("HTTP/1.1 301 Moved Permanently");
safeHeader("Location: " . url($matchRoute['FinalDestination']));
exit;
break;
case 'NotAuthorized':
safeHeader("HTTP/1.1 401 Not Authorized");
break;
case 'NotFound':
safeHeader("HTTP/1.1 404 Not Found");
break;
case 'Drop':
die;
case 'Test':
decho($matchRoute, 'Route');
decho(array('Path' => $request->path(), 'Get' => $request->get()), 'Request');
die;
}
} elseif (in_array($request->path(), ['', '/'])) {
$this->isHomepage = true;
$defaultController = Gdn::router()->getRoute('DefaultController');
$request->pathAndQuery($defaultController['Destination']);
}
return $request;
}
示例14: get_globals
<?php
// File: edit-client-result.php
// Copyright (C) 2012 WoodDuck Computer Consulting
include "./header.php";
get_globals();
my_connect();
echo "<H3>Edit Client</H3>\n";
// Fetch client ID from the FORM POST data
$ID = $_POST['ID'];
decho("Editing client ID '{$ID}' ... <BR>");
// Do a SELECT query to get the old client data
$query = "SELECT ID,FName,MName,LName from clients WHERE ID = '{$ID}'";
$result = try_query($query);
// Display it as an editable form, including the INPUT boxes
echo "<FORM ACTION=\"./save-client.php\" METHOD=post>\n";
if (show_client_edit_form($result)) {
// Display the form buttons only if the return value was TRUE
echo "<P>" . "<INPUT TYPE=submit VALUE=\" SAVE edited client data \"><P>\n" . "<INPUT TYPE=reset VALUE=\" Reset to original client data \"><P>\n";
} else {
echo "<P>Sorry, no results match Client ID '{$ID}'.<P>\n";
}
echo "</FORM>\n";
my_disconnect();
?>
<P>
<A HREF="./edit-client.php"><BUTTON TYPE=button> Edit another client </BUTTON></A><P>
<A HREF="./main.php"><BUTTON TYPE=button> Return to main page </BUTTON></A><P>
<A HREF="./logout.php"><BUTTON TYPE=button> Logout </BUTTON></A>
示例15: get_parse
function get_parse()
{
global $appmsg;
global $apperr;
global $action;
global $icsmsg;
global $config_dir;
global $log_dir;
foreach ($_GET as $ind => $val) {
decho("get_parse:: index: {$ind} and val: {$val}<br>", 1);
switch ($ind) {
case "action":
$action = $val;
break;
case "message":
$icsmsg = json_decode($val);
$apperr .= "\n ics: " . $icsmsg;
break;
// ******* URL COMMANDLINE OPTIONS BELOW ***
// Initial or repair load of th edatabase for LamPI
// Need to specify this option on the URL: http://<my-lampi-url>/frontend_set.php?load
//
// ******* URL COMMANDLINE OPTIONS BELOW ***
// Initial or repair load of th edatabase for LamPI
// Need to specify this option on the URL: http://<my-lampi-url>/frontend_set.php?load
//
case "load":
echo "load:: config file: " . $config_dir . "database.cfg\n";
$cfg = read_database($config_dir . "database.cfg");
// Load $cfg Object from File
echo " cfg read; ";
print_database($cfg);
echo " now filling mysql; ";
$ret = fill_database($cfg);
// Fill the MySQL Database with $cfg object
echo " Making backup; ";
$ret = file_database($config_dir . "newdbms.cfg", $cfg);
// Make backup to other file
echo " Backup newdbms.cfg made";
if ($val < 1) {
decho("file_database:: value must be >0");
}
exit(0);
break;
case "print":
$cfg = load_database();
print_database($cfg);
exit(0);
break;
case "store":
$cfg = load_database();
// Fill $cfg from MySQL
$ret = file_database($config_dir . "newdbms.cfg", $cfg);
// Make backup to other file
if ($val < 1) {
decho("store:: value must be >0");
}
echo "Backup is complete";
exit(0);
break;
}
// Switch ind
}
// Foreach
return 0;
}