本文整理汇总了PHP中dump函数的典型用法代码示例。如果您正苦于以下问题:PHP dump函数的具体用法?PHP dump怎么用?PHP dump使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dump函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sql_mailman
/**
* Simple function to send an email on failure of MySQL commands
* @param string $subject
* @param string $body
* @param array $trace
* @return boolean
*/
function sql_mailman($subject, $body, $trace)
{
ob_start();
dump($trace);
$trace = ob_get_contents();
ob_end_clean();
global $MYSQL_OPTS;
$to = DEBUG_EMAIL;
$from = "noreply@{$MYSQL_OPTS['domain_name']}";
$params = "-f" . $from;
$headers = "From: MySQL Debug <" . $from . ">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"MIME-BOUNDARY\"\r\n";
$message = "\r\n";
$message .= "--MIME-BOUNDARY\r\n";
$message .= "Content-type: text/html; charset=US-ASCII\r\n";
$message .= "\r\n";
$message .= "<HTML>\r\n" . "<HEAD>\r\n" . "<STYLE TYPE='text/css'>\r\n" . "#SQL, #SQL TD, #SQL TH { font-family: Tahoma, Helvetica, sans-serif; font-size: 10pt; color: #000000; }\r\n" . "#SQL { border: 1px solid #000000 }\r\n" . "#SQL TD { border: 1px solid #000000 }\r\n" . "#SQL TH { background: #000000; color: #FFFFFF }\r\n" . "</STYLE>\r\n" . "</HEAD>\r\n" . "<BODY BGCOLOR=WHITE>\r\n" . "{$body}\r\n" . "</BODY>\r\n" . "</HTML>\r\n";
$message .= "\r\n";
$message .= "--MIME-BOUNDARY\r\n";
$message .= "Content-Type: text/html;\n" . " name=\"backtrace.html\"\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n" . chunk_split(base64_encode($trace)) . "\r\n\r\n" . "--MIME-BOUNDARY--";
ob_start();
$ok = mail($to, $subject, $message, $headers, $params);
$buffer = ob_get_contents();
ob_clean();
return $ok ? true : false;
}
示例2: index
function index()
{
$user = new UserViewModel();
$list = $user->select();
dump($list);
//$this->display();
}
示例3: barbersUpdate
public function barbersUpdate()
{
$this->checkroute();
if (IS_POST) {
$data = M('barber')->find(1);
$data['name'] = I('post.name');
$data['expert'] = I('post.major');
$data['details'] = I('post.message');
M('order_type')->where('fk_bid=' . $data['bid'])->delete();
$items = I('post.item');
$costs = I('post.cost');
for ($i = 0; $i < count($items); $i++) {
$orders[] = array('fk_bid' => $data['bid'], 'type_name' => $items[$i], 'cost' => $costs[$i], 'insert_time' => time());
}
dump(I('post.'));
dump(M('order_type')->addAll($orders));
/*if(M('barber')->save($data)&&M('order_type')->addAll($orders))
$this->success('修改成功!','barbers');
else
$this->error('修改失败,请重试!','barbersUpdate?id='.$data['bid']);*/
} else {
$barberinfo = M('barber')->find(I('get.id'));
$this->assign('barberinfo', $barberinfo);
$data = M('order_type')->where("fk_bid=" . $barberinfo['bid'])->select();
$this->assign('data', $data);
//dump($data);
$this->display('barbers_done');
}
}
示例4: login
public function login()
{
if ($_POST) {
$user = M('auth_user')->where($_POST)->select();
dump($user);
if ($user) {
$timeout = 30;
// 3600 * 24 * 2
setcookie("username", $_POST['name'], time() + $timeout);
setcookie("password", $_POST['password'], time() + $timeout);
$_SESSION['user'] = $user;
} else {
echo "invalid username or password !";
die;
}
$returnUrl = $_SESSION['returnUrl'];
$_SESSION['returnUrl'] = null;
if ($returnUrl) {
$this->redirect($returnUrl);
} else {
$this->redirect("/");
}
die;
}
$this->display();
}
示例5: p
/**
* 公共函数
* @package config
* @copyright Copyright (c) 2014-2030 Wangkeyun-com Inc.(http://www.wangkeyun.com)
* @license http://www.wangkeyun.com
* @link http://www.wangkeyun.com
* @author wangkeyun-com Team
*/
function p($arr, $Charset = 'utf-8')
{
if (!empty($Charset)) {
header("Content-Type: text/html; charset={$Charset}");
}
dump($arr, 1, '<pre>', 0);
}
示例6: onLogged
/**
* Funcao que eh chamada apos o login
*
* @param Event $objEvent
*/
public function onLogged(Event $objEvent)
{
dump('Efutuar o log do usuario logado');
dump($objEvent);
dump($objEvent->getTarget());
dump($objEvent->getParams());
}
示例7: start_order
public function start_order()
{
header("Content-Type:text/html; charset=utf-8");
$d = I("post.");
if ($d['menu_id'] == '' || $d['menu_id' == '0']) {
$this->error("请正确订餐", U('/Home/StartOrder/Index'));
}
$menu = M('menu');
$d['order_name'] = session('name');
$d['order_user'] = session('username');
$m_info = $menu->field('food_name,food_price')->where('id=' . $d['menu_id'])->find();
dump($m_info);
$shop = M('shop');
$s_info = $shop->field('shopname')->where('id=' . $d['shop_id'])->find();
$d['order_res'] = $s_info['shopname'];
$d['order_food'] = $m_info['food_name'];
$d['order_time'] = time();
//通过order_food和order_res,查询food_price
$menu = M('menu');
//$order_price = $menu->where("food_name = '$data[order_food]' AND food_res = '$data[order_res]'")->field('food_price')->find();
$d['order_price'] = $m_info['food_price'];
//添加新的订单信息
$this->assign('order_info', $d);
session('order', $d);
$this->display('sure');
}
示例8: excute
public function excute()
{
$aliyunQueue = new Queue_Model_MNS();
$aliyunQueue->setQueue('notifications');
switch ($_REQUEST['action']) {
case 'send':
$message = $_REQUEST['message'];
$message = $message ? $message : "Jesse";
$result = $aliyunQueue->sendMessage($message);
break;
case 'get':
$result = $aliyunQueue->receiveMessage();
if ($_REQUEST['del']) {
$delResult = $aliyunQueue->delMessage($result['ReceiptHandle']);
dump($delResult);
}
break;
case 'info':
$result = $aliyunQueue->getQueueInfo();
break;
case 'del':
$result = $aliyunQueue->delMessage($_REQUEST['receipt_handle']);
break;
}
dump($result);
}
示例9: process
/**
* Default form handler
*/
public function process()
{
/** @var ArrayHash $values */
$values = $this->values;
try {
$this->onBeforeProcess($this, $values);
if (isset($values->id)) {
$this->onBeforeUpdate($this, $values);
$arr = (array) $values;
unset($arr['id']);
$row = $this->selection->wherePrimary($values->id)->fetch();
$row->update($arr);
$this->onAfterUpdate($row, $this, $values);
} else {
$this->onBeforeInsert($this, $values);
$row = $this->selection->insert($values);
$this->onAfterInsert($row, $this, $values);
}
$this->onAfterProcess($row, $this, $values);
} catch (\PDOException $e) {
$this->addError($e->getMessage());
dump($e);
Debugger::log($e);
}
}
示例10: throwNewExceptionFromAnywhere
/**
* Captura todas as exceções não tratadas do sistema.
*
* @param Exception $e
*/
function throwNewExceptionFromAnywhere($e)
{
$setup = BraghimSistemas::getInstance();
// Tenta carregar a tela de erro do MODULO.
try {
$setup->mvc = $setup->resolve($setup->mvc->moduleName, 'error', 'error');
} catch (Exception $ex) {
// Tenta carregar a tela de erro
// padrao do framework.
try {
$setup->mvc = $setup->resolve('ModuleError', 'error', 'error', __DIR__ . DIRECTORY_SEPARATOR . 'library');
} catch (Exception $ex2) {
if (function_exists('createSystemLog')) {
createSystemLog($e);
}
echo "Exception sem possibilidade de tratamento.";
dump($e);
}
}
$setup->mvc->exception = $e;
// Ultima tentativa de dar certo,
// se chegar aqui e der erro então
// o projeto esta configurado incorretamente.
try {
$setup->run();
} catch (Exception $ex3) {
if (function_exists('createSystemLog')) {
createSystemLog($e);
}
echo "Exception sem possibilidade de tratamento.";
dump($ex3);
}
}
示例11: registerAction
/**
* @Route("/register", name="security_register")
* @Method("POST")
*/
public function registerAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$request = Request::createFromGlobals();
$email = $request->request->get('email');
$password = $request->request->get('password');
$ico = trim($request->request->get('ico'));
$user = new User();
$encoder = $this->container->get('security.encoder_factory')->getEncoder($user);
$user->setPassword($encoder->encodePassword($password, $user->getSalt()));
$user->setEmail($email);
$user->setIco($ico);
$backgroundImages = ['animal', 'corn', 'farming', 'chicken'];
shuffle($backgroundImages);
$user->setBackgroundImage($backgroundImages[0]);
$profileImages = ['animal', 'corn', 'farming', 'chicken'];
shuffle($profileImages);
$user->setProfileImage($profileImages[0]);
$em->persist($user);
$em->flush();
$token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
$this->get('security.token_storage')->setToken($token);
//rabbit MQ
$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest');
$channel = $connection->channel();
$channel->queue_declare('ico_queue', false, false, false, false);
$json = json_encode(["userId" => $user->getId(), "ico" => $ico]);
$msg = new AMQPMessage($json);
$channel->basic_publish($msg, '', 'ico_queue');
dump(" [x] Sent '{$ico}'\n");
$channel->close();
$connection->close();
return $this->redirect($this->generateUrl('main_overview'));
}
示例12: run
function run()
{
// 设置默认错误级别, 测试环境,尽量显示所有错误
if (Config::get('show_error')) {
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
} else {
ini_set('display_errors', 'Off');
error_reporting(0);
}
// echo 'Application.php';
// var_dump(microtime(1) - $_SERVER['REQUEST_TIME_FLOAT']);
dump("SERVER内容", $_SERVER);
// dump($_SERVER);
// dump((($sdir = dirname($_SERVER['SCRIPT_NAME'])) == '/' || $sdir == '\\') ? '' : $sdir);
// run_info(1);
// try
// {
// // $x = 1 / 0;
// throw new CommonException("Application.php 发生了错误!");
// }
// catch (CommonException $e)
// {
// echo $e;
// }
// \wlog("test", "Application.php");
// run_info();
// \show_404();
// show_success("Application.php");
show_error("Application.php");
}
示例13: red
public function red()
{
$userinfo = M('Userinfo');
$list = $User->where($userinfo['infoid'] == 0)->select();
$this->assign('list', $list);
dump($list);
}
示例14: checkverify
public function checkverify()
{
$code = $_GET['code'];
$verify = new \Think\Verify();
$result = $verify->check($code);
dump($result);
}
示例15: run
public function run()
{
if (!$this->request->isAjax()) {
cmsCore::error404();
}
$orfo = $this->request->get('orfo');
$url = $this->request->get('url');
$comment = $this->request->get('comment', false);
$author = !cmsUser::isLogged() ? cmsUser::getIp() : cmsUser::get('nickname');
$form = $this->getForm('orfo');
$is_submitted = $this->request->has('submit');
if ($is_submitted) {
$data = $form->parse($this->request, $is_submitted);
$data['date'] = date('Y-m-d H:i:s');
$errors = $form->validate($this, $data);
dump($errors);
if (!$errors) {
$this->model->addComplaints($data);
$messenger = cmsCore::getController('messages');
$messenger->addRecipient(1);
$notice = array('content' => sprintf(LANG_COMPLAINTS_ADD_NOTICE, $url, $orfo), 'options' => array('is_closeable' => true));
$messenger->ignoreNotifyOptions()->sendNoticePM($notice, 'complaints_add');
}
cmsTemplate::getInstance()->renderJSON(array('errors' => false, 'callback' => 'formSuccess'));
}
$data = array('orfo' => $orfo, 'url' => $url, 'author' => $author, 'comment' => $comment);
return cmsTemplate::getInstance()->render('orfo', array('form' => $form, 'data' => $data));
}