定制 ennerd/sourcedog 二次开发

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

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

ennerd/sourcedog

Composer 安装命令:

composer create-project ennerd/sourcedog

包简介

Command line tool that monitors files in your source tree and performs linting and other useful things.

README 文档

README

Monitors your source tree. Makes useful information available to you. Keep this tool running while you develop!

Global Installation

# Install globally
composer global require ennerd/sourcedog

# The file is located in ~/.config/composer/vendor/bin/sourcedog
# Add this to your path by appending the following to your ~/.profile or ~/.bashrc file
PATH=$PATH:~/.config/composer/vendor/bin

Per Project Installation

# Require sourcedog in your project
composer require --dev ennerd/sourcedog

# The file will be placed in your vendor/bin directory
# You should add this path to your PATH environment variable by appending this to your
# ~/.profile or ~/.bashrc file. Replace ~/vendor/ with your actual vendor path.
PATH=$PATH:~/vendor/bin

Basic usage example

Scan all files in the current folder

# sourcedog

Monitor all files using inotify to watch for modifications.

# sourcedog -m

Other options:

# sourcedog --help

Options file

You can create an options file at ~/sourcedog.yaml. Currently only one option is supported:

tail:
  - /var/log/nginx/*.log
  - /var/log/mysql/*.log
  - /var/log/mysql*.log
  - /var/log/php*.log

This will cause SourceDog to search for files matching the patterns then run tail -f -n 0 <your files> in the background to output any new lines.

Linting

SourceDog will lint all modified files of a supported type. Currently supports .css, .js, .json, .yaml and .php.

Contributing

If you wish to add lint support for other file types, create a composer package that depends on ennerd/sourcedog and register your linter by doing the following in a composer.json autoloaded file.

$GLOBALS['SourceDogLinters'][] = MyClassName::class;

Your class must extend SourceDog\Linters\Linter.

I will also accept pull requests.

Ideas

  • Database for recording metadata and mistake prevention?
    • Changed files. Time spent. (Understands nano, vim, vi temp files?)
    • Backup of all files? Shorttime backup when detecting .filename.ext.swp files?
  • Special support for common open source software like WordPress. Vulnerability database?
  • Heuristic scan for backdoors and known vulnerabilities.
  • Post process various file types automatically:
    • yourfile.ts -> yourfile.js (using tsc)
    • yourfile.js -> yourfile.min.js (minify)
    • yourfile.scss -> yourfile.css
    • yourfile.css -> yourfile.min.css
    • yourfile.js -> yourfile.js.map
    • yourfile.less -> yourfile.css
  • Watch error and access logs.
  • Output git diff and/or git status after files have changed.
  • Feature for requiring special ubuntu packages like php-mbstring etc? To help installing on fresh servers.

ennerd/sourcedog 适用场景与选型建议

ennerd/sourcedog 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 51 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 08 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2019-08-25