定制 dutymess/chalk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dutymess/chalk

最新稳定版本:v0.6.2

Composer 安装命令:

composer require dutymess/chalk

包简介

Easy tracepoint generator at the middle of procedures where creating breakpoints is not that easy.

README 文档

README

Packagist Downloads Github All Releases Semver license

Forks Forks

Introduction

Sometimes you need to have tracepoints inside your procedures, without breaking it with dumping some data.

Sometimes it's not very easy to use dd() or similar ways to see what's going on.

Chalk will utilize Laravel caching tools to make this work like a breeze.

Install

composer require dutymess/chalk

Simple Usage

⚠️ For security reasons, Chalk works when and only when the application is in the debug mode.

In the Tracepoint

Easily store what you want to monitor later. A timestamp is added automatically.

chalk()->write($anything);

where

  • $anything is a variable of any type, but is more efficient if provided in the type of string.

In a Safe Place

A safe place is somewhere out of your procedure. This could be a blank testing page, or simply the tinker tool in the terminal console.

Read stored data, ordered by the timestamp.

chalk()->read();

An array of stored data, together with the carbon timestamps will be returned in the form of an array.

Example

❗️ To be Added ❗️

Advanced Usage

Custom Stacks

Sometimes, there are lots of things to be traced. Putting them all in a single array would make it difficult to track the changes.

To solve this problem, you may specify a custom stack name when calling the chalk() helper.

chalk('jafar')->write('something');
chalk('jafar')->read();

Clearing Data

You may want to reset the current data and start clean at your first tracepoint.

chalk()->clear();

Of course, you may clear your data stored in the custom stacks as well.

chalk('jafar')->clear();

In some odd cases, you may want to clear all the stored data in all available stacks.

chalk()->clearAllStacks();

Custom Expire Time

By default, Chalk() stores data in the cache for just ten minutes. This should be pretty enough to see what's going on.

However, you may override this default behavior by setting a custom timeout.

chalk()::setTimeout($minutes);

License

Chalk is open-sourced and licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-20