定制 anahkiasen/janitor 二次开发

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

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

anahkiasen/janitor

Composer 安装命令:

composer require anahkiasen/janitor

包简介

Janitor is a tool to help you remove unused code, views and assets from your codebase.

README 文档

README

Build Status Latest Stable Version Total Downloads Scrutinizer Quality Score Code Coverage Dependency Status Support via Gittip

Janitor is a tool to help you remove unused code, routes, views and assets from your codebase.

Install

Simply run the following command via Composer:

$ composer require anahkiasen/janitor --dev

Then add Janitor's service provider to your application's local providers:

'Janitor\JanitorServiceProvider',

Usage

Command-line

You can see the various things Janitor can do by simply running:

$ php artisan list janitor

Programmatically

Janitor can also be used programmatically, in order to do so:

<?php
// Define your codebase
$codebase = new Janitor\Codebase('app');

// Create an instance of any of Janitor's analyzer classes
$analyzer = new Janitor\Services\Analyzers\ViewsAnalyzer($codebase);

// Tell it which files you wish to analyze, and run the process
$analyzer->setFiles('app/views');
$files = $analyzer->analyze();

Here, $files will be a Collection of instances of AbstractAnalyzedEntity. Its most important property is the usage property, it's an integer whose value goes from 0 (file unused) to 1 (file used). The value can vary between these two points to indicate how certain Janitor is that the file is used.

{
  "root": "/Users/foobar/Sites/foo/bar/app/views",
  "name": "_emails/feedback.twig",
  "usage": 0
}

Available analyzers

Name Description Status
ViewsAnalyzer Analyzes your codebase and check for unused views
DatabaseAnalyzer Checks your database for dead entries Planned
CodebaseAnalyzer Checks your codebase for unused classes, models, etc Planned
RoutesAnalyzer Checks your views and controllers for unused routes Planned

Contributions and suggestions are welcome.

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License AbstractAnalyzedFile for more information.

统计信息

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

GitHub 信息

  • Stars: 21
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固