nusje2000/dependency-graph
Composer 安装命令:
composer require nusje2000/dependency-graph
包简介
A PHP Library for resolving, visualizing and validating composer dependencies within a repository. Works within a monolithic repository as well.
README 文档
README
This package can be used to create a list of used packages and their dependencies.
Installation
Using composer:
composer require nusje2000/dependency-graph --dev
Usage
use Nusje2000\DependencyGraph\Cache\FileCache; use Nusje2000\DependencyGraph\DependencyGraph; // By default the DependencyGraph won't cache the result $graph = DependencyGraph::build('/path/to/project/root'); // Using the FileCache to cache the dependency graph $graph = DependencyGraph::build('/path/to/project/root', null, new FileCache());
The build method uses 3 parameters:
- The root path, this is the path to the root of your project.
- The builder, this class is used to build the dependency graph (leave null for default implementation).
- The cache class, this class will be used to cache the result or to load the graph from if a cache exists.
Visualizing dependencies
You can visualize the dependency graph by using vendor/bin/dependency-graph search.
This console command can be used to search through the graph and look at
information about certain packages. This command is still being worked on.
There is also a command for only visualizing a package (without the
search dialog). i.e. you can use vendor/bin/dependency-graph info nusje2000/dependency-graph
to see the dependencies of this package.
Validating the dependency graph in monolithic repositories
This package can be used to fetch all the packages defined in monolithic
repositories. This has been implemented into a command in the
nusje2000/composer-monolith package, which can be used to validate
internal and external dependencies in a monolithic repository.
Accessing the dependency graph
use Nusje2000\DependencyGraph\DependencyGraph; // building the dependency graph $graph = DependencyGraph::build('/path/to/project/root'); // get the root path $graph->getRootPath(); // get all packages $packages = $graph->getPackages(); // checking if a package exists $graph->hasPackage('foo/foo-pacakge'); // getting a specific package $fooPackage = $graph->getPackage('foo/foo-pacakge'); $fooPackage->getName(); // return the name of the package (foo/foo-pacakge) $fooPackage->getDependencies(); // returns a list of dependencies $fooPackage->getPackageLocation(); // returns the location of the package
nusje2000/dependency-graph 适用场景与选型建议
nusje2000/dependency-graph 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29.25k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 01 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nusje2000/dependency-graph 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nusje2000/dependency-graph 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 29.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-02