jackdtaylor/dpr 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jackdtaylor/dpr

Composer 安装命令:

composer require jackdtaylor/dpr

包简介

die(print_r()) helper functions

README 文档

README

Set of utility/debugging PHP functions.

Documentation

Constants

DPR_DEVELOPER_IPS

define('DPR_DEVELOPER_IPS', '127.0.0.1, 192.168.0.1')
List of comma-separated IPs or false to disable this check. Spaces are trimmed. Declares IP addresses allowed to see the debug info. For users not matching this filter dpr() will simply return first passed argument and do nothing.

DPR_SHOW_MEMINFO

define('DPR_SHOW_MEMINFO', true)
Whether show memory info or not

DPR_ENCODING

define('DPR_ENCODING', 'utf-8')
Default encoding to send with header('Content-Type: text/plain; charset=<your encoding here>');

$_SERVER['REQUEST_TIME_FLOAT']

$_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
Optionally you can put this line to the very start of your execution flow to measure request execution time.
If not present, dpr() will set it up as the time of include 'dpr.php';.

Functions

is_developer()

is_developer(); // Returns boolean
Returns true if $_SERVER['REMOTE_ADDR'] is in DPR_DEVELOPER_IPS constant.

dpr

dpr($var : any, ...);
Basic functionality. Prints variables provided as arguments and stops the script execution.

dprv

dprv($var : any, ...); // -v for "var_dump"
Same as dpr(), but uses var_dump() instead of print_r()

dprt

dprt(); // -t for "trace"
Prints backtrace and stops the script execution.

dprb

dprb(); // -b for "breakpoint"
Defines a breakpoint for dprd() function.

dprd

dprd($var : any, ...); // -d for something like "debug" or whatever
Triggers dpr() only if breakpoint was defined with dprb()

dprm

dprm($var : any, ...); // -m for "measure"
Prints all measures made with dprmFrom()/dprmTo() and then executes dpr() for passed arguments.

dprmFrom

dprmFrom($key : string);
Starts execution time measure named as $key.

dprmTo

dprmTo($key : string);
Ends execution time measure named as $key.

统计信息

  • 总下载量: 57
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: WTFPL
  • 更新时间: 2019-06-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固