本文整理匯總了PHP中print_pre函數的典型用法代碼示例。如果您正苦於以下問題:PHP print_pre函數的具體用法?PHP print_pre怎麽用?PHP print_pre使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了print_pre函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: cmdRepo
function cmdRepo()
{
$file = new File('/home/billy/1.tar.bz2', true);
$target = new Dir('/home/billy/temp/1.unpack/includes', true);
//Packer::unpack($file, $target);
Packer::pack($target, new File(dirname(__FILE__) . '/2.tbz', true));
return;
$pm = new PM();
$pm->startup();
$rb = PM::getRollback();
$rb->push('delete', dirname(__FILE__) . '/_files/source', dirname(__FILE__) . '/_files/target/includes/Controller.php');
//$rb->push('delete', './_files/source', '_files/target/includes/Controller.php' );
//$r = $rb->pop();
$r = $rb->stepBack();
print_r($r);
return;
$ps = PM::getPackageSequence();
print_r($ps->get());
print_r($ps->getAfter('news', '2.3'));
//print_pre($ps->addPackage('news', '2.8'));
print_pre($ps->removePackage('news', '2.8'));
return;
Autoload::addDir(Dir::get($this->root, true)->getDir('repo'));
$rl = new RepositoryList($this->dataDir->getFile('source.list'));
$r = $rl->search(explode(' ', 'qt package'));
print_pre($r);
$pm->shutdown();
}
示例2: call
/**
*
* @param string $service
* @param string $method
* @param array $parameters
* @return array|bool
*/
static function call($service = "", $method = "", $parameters = [], $type = 'get')
{
// Check if cache exist
$response = Cache::get(self::$cache_name);
if (null == $response) {
// Curl call
if ('post' == $type) {
$resp = Curl::to(config('services.gulliver.host') . ':' . config('services.gulliver.port') . '/' . $service . (false == empty($method) ? '/' . $method : ""))->withData($parameters)->withOption('TIMEOUT', self::$timeout)->withOption('FAILONERROR', false)->withOption('RETURNTRANSFER', self::$returntransfer)->withOption('ENCODING', self::$encoding)->asJson()->post();
} else {
$resp = Curl::to(config('services.gulliver.host') . ':' . config('services.gulliver.port') . '/' . $service . (false == empty($method) ? '/' . $method : ""))->withData($parameters)->withOption('TIMEOUT', self::$timeout)->withOption('FAILONERROR', false)->withOption('RETURNTRANSFER', self::$returntransfer)->withOption('ENCODING', self::$encoding)->get();
}
#print_pre(['to'=>config('services.gulliver.host').':'.config('services.gulliver.port').'/'.$service.((false==empty($method)) ? '/'.$method : ""),'response'=>$response]);
// Check response
if (false == $resp) {
self::$error = true;
return false;
}
#print_pre($response,1,1);
// Decode the response
$response = json_decode($resp, true);
#dd(['response'=>$response,'method'=>$method]);
// Check for json error
if (json_last_error() != JSON_ERROR_NONE) {
self::$error = 'json error: ' . json_last_error() . '<br>' . print_pre($resp);
return false;
} else {
unset($resp);
}
// Check error
if (false == empty($response['errors'])) {
self::$error = false == empty($response['errors'][0]['description']) ? $response['errors'][0]['description'] : true;
return false;
}
// Check data
if (true == empty($response['data'])) {
self::$error = 'Empty data node in response';
return false;
}
// Check method
if (false == empty($method) && true == empty($response['data'][$method])) {
self::$error = 'Empty method node in response';
return false;
}
// return array
if (false == empty($method)) {
$response = (array) $response['data'][$method];
} else {
$response = (array) $response['data'];
}
// Cache Store ?
if (0 < self::$cache_ttl) {
Cache::put(self::$cache_name, $response, self::$cache_ttl);
}
}
//
self::reset();
// return
return $response;
}
示例3: controller_test
function controller_test($args, $output = "inline")
{
$playback = $this->parent->getMPDPlayback();
$playlist = $this->parent->getMPDPlaylist();
$song = $playback->getCurrentSong();
print_pre(get_class_methods($playlist));
print_pre($song);
print_pre($playlist->getPlaylistInfoId($song["Id"]));
return "";
}
示例4: execute
function execute() {
global $wgUser, $wgTitle, $wgArticle, $wgOut, $wgSkin;
print_pre("Theme: " . $this->data['skin']->themename);
print_pre($this);
print_pre($wgTitle);
print_pre($wgArticle);
print_pre($wgUser);
print_pre($wgOut);
}
示例5: autoloader
function autoloader($class)
{
$file = BASE_DIR . DIRECTORY_SEPARATOR . $class . ".php";
$file = str_replace("/", DIRECTORY_SEPARATOR, $file);
$file = str_replace("\\", DIRECTORY_SEPARATOR, $file);
if (file_exists($file)) {
require_once $file;
return;
} else {
if (ENV_DEVELOPMENT) {
print_pre(debug_backtrace());
die("Failed to include class " . $class . " as " . $file);
}
}
}
示例6: print_stack
/**
* Print out a simpler backtrace than debug_print_backtrace and faster
* @param boolean $buffer should not print
* @param string $tag name of tag to surround output in
* @return string
* @see debug_backtrace
* @see print_pre
**/
function print_stack($buffer = false, $tag = "pre")
{
$output = "";
$backtrace = debug_backtrace();
$spacing = 40;
foreach ($backtrace as $traceEntry) {
$newline = PHP_EOL . $traceEntry['class'] . $traceEntry['type'] . $traceEntry['function'] . "()";
if (strlen($newline) > $spacing) {
$spacing = strlen($newline) + 10;
}
$newline = str_pad($newline, $spacing);
$newline .= " from " . $traceEntry['file'] . ':' . $traceEntry['line'];
$output .= $newline;
}
return print_pre($output, $buffer, $tag);
}
示例7: print_model
function print_model($model_or_array, $description = "", $debug = true, $return = false)
{
if (is_object($model_or_array)) {
return print_pre($model_or_array->getAttributes(), '(Model) ' . $description, $debug, $return);
} else {
$array = array();
if (is_array($model_or_array)) {
foreach ($model_or_array as $model) {
$array[] = $model->getAttributes();
}
} else {
$array = $model_or_array;
}
return print_pre($array, '(Model[s]) ' . $description, $debug, $return);
}
}
示例8: public_repair
/**
* 數據結構優化、修複、結構查看
*/
function public_repair()
{
$tables = trim($this->input->get_post('tables'));
$operation = trim($this->input->get_post('operation'));
$pdo_name = trim($this->input->get_post('pdo_name'));
$tables = is_array($tables) ? implode(',', $tables) : $tables;
if ($tables && in_array($operation, array('repair', 'optimize'))) {
$sql = "{$operation} TABLE {$tables}";
$this->db->query($sql)->result_array();
$this->showmessage('success', lang('com_success'), HTTP_REFERER);
} elseif ($tables && $operation == 'showcreat') {
$res = $this->db->query("SHOW CREATE TABLE {$tables}")->result_array();
if (!empty($res[0]['Create Table'])) {
print_pre($res[0]['Create Table']);
}
}
$this->showmessage('error', lang('com_parameter'), HTTP_REFERER);
}
示例9: controller_create
function controller_create($args, $output = "inline")
{
if (!empty($args["blog"])) {
$vars["blog"] = new Blog();
$vars["blog"]->blogname = $args["blog"]["blogname"];
$vars["blog"]->title = $args["blog"]["title"];
$vars["blog"]->subtitle = $args["blog"]["subtitle"];
$vars["blog"]->owner = $args["blog"]["owner"];
try {
OrmManager::save($vars["blog"]);
$vars["success"] = true;
header("Location: /demo/blog#blog_create_success:" . $vars["blog"]->blogname);
} catch (Exception $e) {
$vars["success"] = false;
print_pre($e);
}
}
return $this->GetComponentResponse("./create.tpl", $vars);
}
示例10: controller_form
function controller_form($args, $output = "inline")
{
$vars["args"] = $args;
$vars["obj"] = $args["obj"];
$vars["elements"] = $args["elements"];
$vars["formname"] = any($args["formname"], "htmlform");
$vars["formhandler"] = $args["formhandler"];
$vars["dispatchname"] = any($args["dispatchname"], $vars["formname"]);
//print_pre($vars);
if (empty($args[$vars["formname"]])) {
$ret = $this->GetTemplate("./form.tpl", $vars);
} else {
try {
$this->conn->save($vars[$formname]);
$vars["success"] = true;
} catch (Exception $e) {
print_pre($e);
$vars["success"] = false;
}
$ret = $this->GetTemplate("./create_status.tpl", $vars);
}
return $this->GetTemplate("./form.tpl", $vars);
}
示例11: ApplyRedirects
//.........這裏部分代碼省略.........
$exceptflag = true;
foreach ($rule->except->attributes() as $exceptkey => $exceptstr) {
$checkstr = array_get($req, $exceptkey);
if ($checkstr !== NULL) {
$m = NULL;
if (substr($exceptstr, 0, 1) == "!") {
$exceptflag &= !preg_match("#" . substr($exceptstr, 1) . "#", $checkstr, $m);
} else {
$exceptflag &= preg_match("#" . $exceptstr . "#", $checkstr, $m);
}
}
}
if ($exceptflag) {
$isexcept = true;
}
}
if ($ismatch && !$isexcept) {
// Apply nested rules first...
if ($rule->rule) {
$req = $this->ApplyRedirects($req, $rule->rule);
}
// Then process "set" command
if ($rule->set) {
Logger::Info("Applying redirect:\n " . $rule->asXML());
if (!empty($req["args"]["testredir"])) {
print "<pre>" . htmlspecialchars($rule->asXML()) . "</pre><hr />";
}
foreach ($rule->set->attributes() as $rewritekey => $rewritestr) {
if (count($matchvars) > 1 && strpos($rewritestr, "%") !== false) {
$find = array(NULL);
for ($i = 1; $i < count($matchvars); $i++) {
$find[] = "%{$i}";
}
$rewritestr = str_replace($find, $matchvars, $rewritestr);
}
array_set($req, (string) $rewritekey, (string) $rewritestr);
}
if ($rule["type"] == "redirect") {
$doRedirect = 301;
} else {
if ($rule["type"] == "bounce") {
$doRedirect = 302;
}
}
}
// And finally process "unset"
if ($rule->unset) {
$unset = false;
foreach ($rule->unset->attributes() as $unsetkey => $unsetval) {
if ($unsetkey == "_ALL_" && $unsetval == "ALL") {
$req["args"] = array();
} else {
if (!empty($unsetval)) {
$reqval = array_get($req, $unsetkey);
if ($reqval !== NULL) {
array_unset($req, $unsetkey);
$unset = true;
}
}
}
}
if ($unset) {
if ($rule["type"] == "redirect") {
$doRedirect = 301;
} else {
if ($rule["type"] == "bounce") {
$doRedirect = 302;
}
}
}
}
if ($doRedirect !== false) {
break;
}
}
}
}
if ($doRedirect !== false) {
$origscheme = "http" . ($req["ssl"] ? "s" : "");
if ($req["host"] != $_SERVER["HTTP_HOST"] || $req["scheme"] != $origscheme) {
$newurl = sprintf("%s://%s%s", $req["scheme"], $req["host"], $req["path"]);
} else {
$newurl = $req["path"];
}
if (empty($req["args"]["testredir"])) {
if (empty($req["friendly"])) {
$querystr = makeQueryString($req["args"]);
$newurl = http_build_url($newurl, array("query" => $querystr));
} else {
$newurl = makeFriendlyURL($newurl, $req["args"]);
}
if ($newurl != $req["url"]) {
http_redirect($newurl, NULL, true, $doRedirect);
}
} else {
print_pre($req);
}
}
return $req;
}
示例12: controller_location_enablecategories
function controller_location_enablecategories($args, $output = "inline")
{
return print_pre($_SESSION, true);
}
示例13: smarty_function_printpre
/**
* Smarty {printpre} plugin
*
* Type: function<br>
* Name: printpre<br>
* Purpose: Print a dump of the requested variable
*
* @author James Baicoianu
* @param array
* @param Smarty
* @return string|null if the assign parameter is passed, Smarty assigns the
* result to a template variable
*/
function smarty_function_printpre($args, &$smarty)
{
return print_pre($args["var"], true);
}
示例14: create_pm_plan
public function create_pm_plan()
{
$data_pm = array("pm_vendor" => "KJN", "pm_plan_name" => "plan Q2", "pm_description" => "", "pm_period_idpm_period" => "1011", "om_create_date" => date('Y-m-d H:i:s'), "om_update_date" => date('Y-m-d H:i:s'), "om_deletion_flag" => 0);
$idpm = $this->db->insert('pm', $data_pm);
$data_pm_plan = array("PM_idpm" => $idpm, "pmp_vendor" => "KJN", "pmp_idsite" => "JAW-CCJ-1996-H-B", "pmp_status" => "Missing PIC Assignment", "pmp_task_type" => "PM", "pmp_blocked_access" => 0, "om_created_date" => date('Y-m-d H:i:s'), "om_update_date" => date('Y-m-d H:i:s'), "om_deletion_flag" => 0, "pmp_vendor_deadline_date" => date('Y-m-d H:i:s'), "pmp_tenant" => "");
$idpm_plan_detil = $this->db->insert('pm_plan_detail', $data_pm_plan);
if ($idpm != false and $idpm_plan_detil != false) {
echo alert('berhasil membuat data pm plan', 'success');
print_pre($this->model_pm->find($idpm));
print_pre($this->model_pm->get_single('pm_plan_detail', 'idpm_plan_detil', $idpm_plan_detil));
} else {
echo alert('gagal membuat data pm plan', 'danger');
}
}
示例15: printErrors
/**
* Prints errors array
*/
public function printErrors()
{
print_pre($this->_errors);
}