本文整理汇总了PHP中print_pre函数的典型用法代码示例。如果您正苦于以下问题:PHP print_pre函数的具体用法?PHP print_pre怎么用?PHP print_pre使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_pre函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:point,项目名称:cassea,代码行数:28,代码来源:PackageManagerFacade.php
示例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;
}
开发者ID:fcolella,项目名称:docker,代码行数:66,代码来源:Gulliver.php
示例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 "";
}
开发者ID:ameyer430,项目名称:elation,代码行数:10,代码来源:supercritical_audio_playback.php
示例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);
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:11,代码来源:Test.php
示例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);
}
}
}
开发者ID:akitech,项目名称:hooks,代码行数:15,代码来源:autoloader.php
示例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);
}
开发者ID:ameyer430,项目名称:elation,代码行数:24,代码来源:common_funcs.php
示例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);
}
}
开发者ID:EuresTools,项目名称:eVote-web,代码行数:16,代码来源:globals.php
示例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);
}
开发者ID:zydj333,项目名称:hualiangcaifu,代码行数:21,代码来源:dbsave.php
示例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);
}
开发者ID:ameyer430,项目名称:elation,代码行数:19,代码来源:demo_blog.php
示例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);
}
开发者ID:ameyer430,项目名称:elation,代码行数:23,代码来源:html_form.php
示例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;
}
开发者ID:ameyer430,项目名称:elation,代码行数:101,代码来源:webapp_class.php
示例12: controller_location_enablecategories
function controller_location_enablecategories($args, $output = "inline")
{
return print_pre($_SESSION, true);
}
开发者ID:ameyer430,项目名称:elation,代码行数:4,代码来源:supercritical_navigation.php
示例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);
}
开发者ID:jbaicoianu,项目名称:elation,代码行数:17,代码来源:function.printpre.php
示例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');
}
}
开发者ID:ridwanskaterock,项目名称:coc-ri-comunnity,代码行数:14,代码来源:Task.php
示例15: printErrors
/**
* Prints errors array
*/
public function printErrors()
{
print_pre($this->_errors);
}
开发者ID:HotwireCommunications,项目名称:skyphp,代码行数:7,代码来源:class.Model.php
示例16: session_start
session_start();
$debug = false;
$authentication = new Authentication();
// ---- Security ---------------------------------------------------------- //
if (!isset($_SESSION['accessGranted']) || !$_SESSION['accessGranted']) {
$result = $storageManager->grantAccess($_POST['login'], $_POST['mdp']);
if (!$result) {
header('Location: /admin/?action=error');
} else {
$_SESSION['accessGranted'] = true;
}
}
// ------------------------------------------------------------------------ //
// ---- Forms processing -------------------------------------------------- //
if ($debug) {
print_pre($_POST);
}
if (!empty($_POST)) {
// ---- Traitement des Contact
if ($_POST['reference'] == 'contact') {
$contact = new Contact();
if ($_POST['action'] == 'modif') {
//Modifier
try {
$result = $contact->contactModify($_POST);
$contact = null;
header('Location: /admin/contact-list.php');
} catch (Exception $e) {
echo 'Erreur contactez votre administrateur <br> :', $e->getMessage(), "\n";
$contact = null;
exit;
开发者ID:xav335,项目名称:votreimmopro,代码行数:31,代码来源:formprocess.php
示例17: send2server
print "<a href=#c>Client Driver Tests</a><p>";
print "<h3>Test Error</h3>";
$rs = send2server($serverURL, $sql1);
print_pre($rs);
print "<hr />";
print "<h3>Test Insert</h3>";
$rs = send2server($serverURL, $sql2);
print_pre($rs);
print "<hr />";
print "<h3>Test Insert2</h3>";
$rs = send2server($serverURL, $sql3);
print_pre($rs);
print "<hr />";
print "<h3>Test Delete</h3>";
$rs = send2server($serverURL, $sql4);
print_pre($rs);
print "<hr />";
print "<h3>Test select</h3>";
$rs = send2server($serverURL, $sql5);
if ($rs) {
rs2html($rs);
}
print "<hr />";
}
print "<a name=c><h1>CLIENT Driver Tests</h1>";
$conn = ADONewConnection('csv');
$conn->Connect($serverURL);
$conn->debug = true;
print "<h3>Bad SQL</h3>";
$rs = $conn->Execute($sql1);
print "<h3>Insert SQL 1</h3>";
开发者ID:dasatti,项目名称:dashboard,代码行数:31,代码来源:client.php
示例18: array
$vps = $r->new_vps('dummy-order.com', 'centos5.64', 'EU2B', array('billing_oid' => $billing_method->billing_oid, 'memory_mb' => 256));
print_pre($vps);
close_div();
/**/
/**
* Testing vps->restart
**********************/
open_div('Testing vps->reboot', 'reboot_vps');
$reboot_info = $vps->reboot();
print_pre($reboot_info);
close_div();
/**/
/**
* Testing vps->power_cycle
***************************/
open_div('Testing vps->power_cycle', 'powercycle');
$cycle_info = $vps->power_cycle();
print_pre($cycle_info);
close_div();
/**/
/**
* Testing vps->destroy
**********************/
open_div('Testing vps->destroy', 'destroy');
$destroy_info = $vps->destroy();
print_pre($destroy_info);
close_div();
/**/
?>
</body>
</html>
开发者ID:rimuhosting,项目名称:rimuhosting-php-bindings,代码行数:31,代码来源:api_test.php
示例19: GetSpecialPage
/**
* @brief This returns the HTML output of any SpecialPage::execute function
* @details
* SpecialPage::capturePath will skip SpecialPages which are not "includable"
* (which is all the interesting ones) So we need to force it.
*
* @requestParam string page the name of the Special page to invoke
* @responseParam string output the HTML output of the special page
*/
public function GetSpecialPage()
{
if (!$this->wg->User->isAllowed('admindashboard')) {
$this->displayRestrictionError();
return false;
// skip rendering
}
// Construct title object from request params
$pageName = $this->getVal("page");
$title = SpecialPage::getTitleFor($pageName);
// Save global variables and initialize context for special page
global $wgOut, $wgTitle;
$oldTitle = $wgTitle;
$oldOut = $wgOut;
$wgOut = new OutputPage();
$wgOut->setTitle($title);
$wgTitle = $title;
// Construct special page object
try {
$basePages = array("Categories", "Recentchanges", "Specialpages");
if (in_array($pageName, $basePages)) {
$sp = SpecialPageFactory::getPage($pageName);
} else {
$sp = new $pageName();
}
} catch (Exception $e) {
print_pre("Could not construct special page object");
}
if ($sp instanceof SpecialPage) {
$ret = $sp->execute(false);
} else {
print_pre("Object is not a special page.");
}
// TODO: check retval of special page call?
$this->output = $wgOut->getHTML();
// Restore global variables
$wgTitle = $oldTitle;
$wgOut = $oldOut;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:48,代码来源:AdminDashboardSpecialPageController.class.php
示例20: __construct
public function __construct($config)
{
parent::__construct($config);
$this->load_config('hooks', 'hook_test');
print_pre($this->config['hooks']);
}
开发者ID:not2me,项目名称:micromvc,代码行数:6,代码来源:hook_test.php
注:本文中的print_pre函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论