jbzoo/composer-graph

渲染 composer.json 和 composer.lock 依赖关系图

7.0.2 2024-01-28 13:04 UTC

This package is auto-updated.

Last update: 2024-09-22 09:28:50 UTC


README

CI Coverage Status Psalm Coverage Psalm Level CodeFactor
Stable Version Total Downloads Dependents GitHub License

安装

composer require        jbzoo/composer-graph # For a specific project
composer global require jbzoo/composer-graph # As global tool

# OR use phar file.
wget https://github.com/JBZoo/Composer-Graph/releases/latest/download/composer-graph.phar

用法

$ php ./vendor/bin/composer-graph --help

Usage:
  build [options]

Options:
  -r, --root=ROOT                The path has to contain "composer.json" and "composer.lock" files [default: "./"]
  -o, --output=OUTPUT            Path to html output. [default: "./build/composer-graph.html"]
  -f, --format=FORMAT            Output format. Available options: html,mermaid [default: "html"]
  -D, --direction=DIRECTION      Direction of graph. Available options: LR,TB,BT,RL [default: "LR"]
  -p, --show-php                 Show PHP-node
  -e, --show-ext                 Show all ext-* nodes (PHP modules)
  -d, --show-dev                 Show all dev dependencies
  -s, --show-suggests            Show not installed suggests packages
  -l, --show-link-versions       Show version requirements in links
  -P, --show-package-versions    Show version of packages
  -O, --abc-order                Strict ABC ordering nodes in graph. It's fine tuning, sometimes it useful.
      --no-progress              Disable progress bar animation for logs. It will be used only for text output format.
      --mute-errors              Mute any sort of errors. So exit code will be always "0" (if it's possible).
                                 It has major priority then --non-zero-on-error. It's on your own risk!
      --stdout-only              For any errors messages application will use StdOut instead of StdErr. It's on your own risk!
      --non-zero-on-error        None-zero exit code on any StdErr message.
      --timestamp                Show timestamp at the beginning of each message.It will be used only for text output format.
      --profile                  Display timing and memory usage information.
      --output-mode=OUTPUT-MODE  Output format. Available options:
                                 text - Default text output format, userfriendly and easy to read.
                                 cron - Shortcut for crontab. It's basically focused on human-readable logs output.
                                 It's combination of --timestamp --profile --stdout-only --no-progress -vv.
                                 logstash - Logstash output format, for integration with ELK stack.
                                  [default: "text"]
      --cron                     Alias for --output-mode=cron. Deprecated!
  -h, --help                     Display help for the given command. When no command is given display help for the build command
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi|--no-ansi           Force (or disable --no-ansi) ANSI output
  -n, --no-interaction           Do not ask any interactive question
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

示例

所有示例都是基于软件包 JBZoo/Toolbox 的截图。

默认输出(无参数)- 最小视图

php ./vendor/bin/composer-graph

Example

默认输出包含 PHP 扩展(模块)

php ./vendor/bin/composer-graph  --show-ext

Example

默认输出包含软件包版本和关系

php ./vendor/bin/composer-graph  --show-link-versions  --show-package-versions

Example

显示未安装的建议软件包

php ./vendor/bin/composer-graph  --show-suggests

Example

显示开发依赖

php ./vendor/bin/composer-graph  --show-dev

Example

完整报告

所有选项都已启用,但 --show-php(软件包太多)。

php ./vendor/bin/composer-graph            \
                 --show-ext                \
                 --show-dev                \
                 --show-suggests           \
                 --show-link-versions      \
                 --show-package-versions

Example

单元测试和代码风格检查

make update
make test-all

许可证

MIT

另请参阅

  • CI-Report-Converter - 将不同的错误报告转换为与流行的 CI 系统深度兼容。
  • Composer-Diff - 查看 composer update 后更改了哪些软件包。
  • Mermaid-PHP - 使用 mermaid 脚本语言生成图表和流程图。
  • Utils - 收集有用的 PHP 函数、迷你类和日常片段。
  • Image - 提供面向对象的方式操作图像,尽可能简单。
  • Data - 扩展 ArrayObject 实现。使用文件作为配置/数组。
  • Retry - 提供重试/回退功能的微型 PHP 库,支持多种回退策略和抖动支持。
  • SimpleTypes - 转换任何值和度量 - 货币、重量、汇率、长度等...