skunkbad/debug-to-browser-tab 问题修复 & 功能扩展

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

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

skunkbad/debug-to-browser-tab

Composer 安装命令:

composer require skunkbad/debug-to-browser-tab

包简介

Dump debugging data into a browser tab

README 文档

README

This package allows for debugging PHP variables in a browser tab.

Through Symfony VarDumper, debugging data is written to a log file. Browsersync is set up to watch the log file, and when it does your browser tab will reload the contents of a PHP file that includes the log file.

If you don't have Gulp or Browsersync:

cd /your/project/path
npm install gulp-cli
npm install browser-sync

You need to integrate Browsersync. I use Gulp, so the following is integrated into my Gulpfile.js:

// Change this to your domain name
const host = 'example.com';

// This is the relative path from this Gulpfile to dumpLog.txt
const base = 'vendor/src/';

// This is the full path from the website's doc root to dumpLog.txt
const vndr = 'path/to/' + base;

const gulp = require('gulp'); 
const bs   = require('browser-sync').create();

gulp.task('dumplog', function() {
    bs.init({
        files: [base + 'dumpLog.txt'],
        proxy: host + '/' + vndr + 'dumpLog.php?vndr=' + encodeURIComponent(vndr)
    });
});

Load the debugger in your PHP, right after including composer's autoloader:

<?php
require 'vendor/autoload.php';
new \Skunkbad\Debugger\DebugToBrowserTab;

start Browsersync:

cd /your/project/path
gulp dumplog

While working in PHP, use the dump function to send debugging data to the browser tab:

<?php
dump( $foo );

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-09-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固