定制 dutymess/chalk 二次开发

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

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

dutymess/chalk

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.

dutymess/chalk 适用场景与选型建议

dutymess/chalk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.72k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 09 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「debug」 「cache」 「laravel」 「chalk」 「dutymess」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 dutymess/chalk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dutymess/chalk 我们能提供哪些服务?
定制开发 / 二次开发

基于 dutymess/chalk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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