• Stars
    star
    852
  • Rank 51,382 (Top 2 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 11 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dependency graph visualization for composer.json (PHP + Composer)

clue/graph-composer

CI status downloads on GitHub installs on Packagist

Graph visualization for your project's composer.json and its dependencies:

dependency graph for clue/graph-composer

Table of contents

Usage

Once clue/graph-composer is installed, you can use it via command line like this.

graph-composer show

The show command creates a dependency graph for the given project path and opens the default desktop image viewer for you:

$ php graph-composer.phar show ~/path/to/your/project
  • It accepts an optional argument which is the path to your project directory or composer.json file (defaults to checking the current directory for a composer.json file).

  • You may optionally pass an --format=[svg/svgz/png/jpeg/...] option to set the image type (defaults to svg).

graph-composer export

The export command works very much like the show command, but instead of opening your default image viewer, it will write the resulting graph to STDOUT or into an image file:

$ php graph-composer.phar export ~/path/to/your/project
  • It accepts an optional argument which is the path to your project directory or composer.json file (defaults to checking the current directory for a composer.json file).

  • It accepts an additional optional argument which is the path to write the resulting image to. Its file extension also sets the image format (unless you also explicitly pass the --format option). Example call:

    $ php graph-composer.phar export ~/path/to/your/project export.png

    If this argument is not given, it defaults to writing to STDOUT, which may be useful for scripting purposes:

    $ php graph-composer.phar export ~/path/to/your/project | base64
  • You may optionally pass an --format=[svg/svgz/png/jpeg/...] option to set the image type (defaults to svg).

Install

You can grab a copy of clue/graph-composer in either of the following ways.

This project aims to run on any platform and thus does not require any PHP extensions and supports running on legacy PHP 5.3 through current PHP 8+. It's highly recommended to use the latest supported PHP version for this project.

The graph drawing feature is powered by the excellent GraphViz software. This means you'll have to install GraphViz (dot executable). The Graphviz homepage includes complete installation instructions for most common platforms, users of Debian/Ubuntu-based distributions may simply invoke:

$ sudo apt install graphviz

As a phar (recommended)

Once you have PHP and GraphViz installed, you can simply download a pre-packaged and ready-to-use version of this project as a Phar to any directory. You can simply download the latest graph-composer.phar file from our releases page. The latest release can always be downloaded like this:

$ curl -JOL https://clue.engineering/graph-composer-latest.phar

That's it already. Once downloaded, you can verify everything works by running this:

$ cd ~/Downloads
$ php graph-composer.phar --version

If you prefer a global (system-wide) installation without having to type the .phar extension each time, you may simply invoke:

$ chmod +x graph-composer.phar
$ sudo mv graph-composer.phar /usr/local/bin/graph-composer

You can verify everything works by running:

$ graph-composer --version

There's no separate update procedure, simply download the latest release again and overwrite the existing phar.

Installation using Composer

Alternatively, you can also install clue/graph-composer as part of your development dependencies. You will likely want to use the require-dev section to exclude clue/graph-composer in your production environment.

This method also requires PHP 5.3+, GraphViz and, of course, Composer.

You can either modify your composer.json manually or run the following command to include the latest tagged release:

$ composer require --dev clue/graph-composer

Now you should be able to invoke the following command in your project root:

$ ./vendor/bin/graph-composer show

Alternatively, you can install this globally for your user by running:

$ composer global require clue/graph-composer

Now, assuming you have ~/.composer/vendor/bin in your path, you can invoke the following command:

$ graph-composer show ~/path/to/your/project

Note: You should only invoke and rely on the main graph-composer bin file. Installing this project as a non-dev dependency in order to use its source code as a library is not supported.

To update to the latest release, just run composer update clue/graph-composer. If you installed it globally via composer you can run composer global update clue/graph-composer instead.

Development

clue/graph-composer is an open-source project and encourages everybody to participate in its development. You're interested in checking out how clue/graph-composer works under the hood and/or want to contribute to the development of clue/graph-composer? Then this section is for you!

The recommended way to install clue/graph-composer is to clone (or download) this repository and use Composer to download its dependencies. Therefore you'll need PHP, Composer, GraphViz, git and curl installed. For example, on a recent Ubuntu/debian system, simply run:

$ sudo apt install php7.2-cli git curl graphviz

$ git clone https://github.com/clue/graph-composer.git
$ cd graph-composer

$ curl -s https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

$ composer install

You can now verify everything works by running clue/graph-composer like this:

$ php bin/graph-composer show

If you want to distribute clue/graph-composer as a single standalone release file, you may compile the project into a single graph-composer.phar file like this:

$ composer build

Note that compiling will temporarily install a copy of this project to the local build/ directory and install all non-development dependencies for distribution. This should only take a second or two if you've previously installed its dependencies already. The build script optionally accepts the version number (VERSION env) and an output file name or will otherwise try to look up the last release tag, such as graph-composer-1.0.0.phar.

You can now verify the resulting graph-composer.phar file works by running it like this:

$ ./graph-composer.phar --version

To update your development version to the latest version, just run this:

$ git pull
$ php composer.phar install

Made some changes to your local development version?

Make sure to let the world know! :shipit: We welcome PRs and would love to hear from you!

Happy hacking!

Tests

To run the test suite, you first need to clone this repo and then install all dependencies through Composer:

$ composer install

To run the test suite, go to the project root and run:

$ php vendor/bin/phpunit

License

This project is released under the permissive MIT license.

Did you know that I offer custom development services and issuing invoices for sponsorships of releases and for contributions? Contact me (@clue) for details.

More Repositories

1

stream-filter

A simple and modern approach to stream filtering in PHP
PHP
1,608
star
2

phar-composer

Simple phar creation for every PHP project managed via Composer
PHP
853
star
3

framework-x

Framework X โ€“ the simple and fast micro framework for building reactive web applications that run anywhere.
PHP
718
star
4

reactphp-buzz

[Deprecated] Simple, async PSR-7 HTTP client for concurrently processing any number of HTTP requests, built on top of ReactPHP.
PHP
356
star
5

socket-raw

Simple and lightweight OOP wrapper for PHP's low-level sockets extension (ext-sockets)
PHP
325
star
6

docker-json-server

JSON Server docker image, REST API mocking based on plain JSON
Shell
297
star
7

reactphp-redis

Async Redis client implementation, built on top of ReactPHP.
PHP
245
star
8

docker-ttrss

Tiny Tiny RSS feed reader as a docker image.
PHP
200
star
9

reactphp-stdio

Async, event-driven and UTF-8 aware console input & output (STDIN, STDOUT) for truly interactive CLI applications, built on top of ReactPHP.
PHP
193
star
10

php-redis-server

A Redis server implementation in pure PHP
PHP
181
star
11

commander

Finally a sane way to register available commands and arguments and match your command line in PHP
PHP
171
star
12

reactphp-block

Lightweight library that eases using components built for ReactPHP in a traditional, blocking environment.
PHP
152
star
13

reactphp-mq

Mini Queue, the lightweight in-memory message queue to concurrently do many (but not too many) things at once, built on top of ReactPHP.
PHP
127
star
14

reactphp-zenity

Zenity allows you to build graphical desktop (GUI) applications in PHP, built on top of ReactPHP.
PHP
120
star
15

reactphp-socks

Async SOCKS proxy connector client and server implementation, tunnel any TCP/IP-based protocol through a SOCKS5 or SOCKS4(a) proxy server, built on top of ReactPHP.
PHP
116
star
16

reactphp-term

Streaming terminal emulator, built on top of ReactPHP
PHP
103
star
17

reactphp-docker

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.
PHP
100
star
18

reactphp-ami

Streaming, event-driven access to the Asterisk Manager Interface (AMI), built on top of ReactPHP.
PHP
71
star
19

framework-x-placeholder

Framework X โ€“ the simple and fast micro framework for building reactive web applications that run anywhere.
67
star
20

docker-adminer

Adminer docker image, a full-featured database management tool for the web
66
star
21

reactphp-utf8

Streaming UTF-8 parser, built on top of ReactPHP
PHP
66
star
22

reactphp-soap

Simple, async SOAP webservice client, built on top of ReactPHP.
PHP
62
star
23

php-socks

[maintenance] look at clue/socks-react instead
PHP
62
star
24

reactphp-ndjson

Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.
PHP
62
star
25

reactphp-flux

Flux, the lightweight stream processor to concurrently do many (but not too many) things at once, built on top of ReactPHP.
PHP
58
star
26

php-sse-react

Streaming, async HTML5 Server-Sent Events server (aka. SSE or EventSource), built on top of ReactPHP
PHP
54
star
27

psocksd

The SOCKS tunnel / proxy server daemon written in PHP
PHP
53
star
28

reactphp-csv

Streaming CSV (Comma-Separated Values or Character-Separated Values) parser and encoder for ReactPHP.
PHP
51
star
29

reactphp-eventsource

Instant real-time updates. Lightweight EventSource client receiving live messages via HTML5 Server-Sent Events (SSE). Fast stream processing built on top of ReactPHP's event-driven architecture.
PHP
48
star
30

reactphp-sqlite

Async SQLite database, lightweight non-blocking process wrapper around file-based database extension (ext-sqlite3), built on top of ReactPHP.
PHP
46
star
31

reactphp-http-proxy

Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP.
PHP
45
star
32

docker-phpvirtualbox

phpVirtualBox docker image, a modern webinterface mirroring the VirtualBox GUI to administer VirtualBox VMs in a headless environment
PHP
42
star
33

php-redis-protocol

A Redis protocol parser / serializer written in PHP
PHP
38
star
34

docker-h5ai

h5ai docker image, the modern web server index
34
star
35

reactphp-shell

Run async commands within any interactive shell command, built on top of ReactPHP.
PHP
32
star
36

arguments

The simple way to split your command line string into an array of command arguments in PHP.
PHP
31
star
37

php-json-query

The JSON query language implemented in PHP
PHP
30
star
38

reactphp-zlib

Streaming zlib compressor and decompressor for ReactPHP, supporting compression and decompression of GZIP, ZLIB and raw DEFLATE formats.
PHP
28
star
39

json-stream

Simple, lightweight, incremental parser for JSON streaming (concatenated JSON and newline-delimited JSON), in PHP
PHP
24
star
40

json-query-language

A structured query language for querying / filtering JSON documents, expressed in JSON
24
star
41

graph-uml

UML class diagrams in PHP
PHP
24
star
42

reactphp-ssh-proxy

Async SSH proxy connector and forwarder, tunnel any TCP/IP-based protocol through an SSH server, built on top of ReactPHP.
PHP
23
star
43

docker-streamripper

Streamripper docker image, an application that lets you record streaming mp3 to your hard drive
Shell
22
star
44

reactphp-multicast

Simple, event-driven multicast UDP message client and server for ReactPHP.
PHP
21
star
45

php-socket-react

Binding for raw sockets (ext-sockets) in React PHP
PHP
20
star
46

reactphp-connection-manager-extra

Provides extra (in terms of "additional", "extraordinary", "special" and "unusual") decorators, built on top of ReactPHP's Socket
PHP
20
star
47

reactphp-pq

PQ ("peak"), automatically wrap blocking functions in an async child process and turn blocking functions into non-blocking promises, built on top of ReactPHP
20
star
48

docker-frontroute

A docker image to automatically set up a front router (reverse proxy) for linked web containers
PHP
19
star
49

reactphp-ssdp

Async Simple Service Discovery Protocol (SSDP), built on top of ReactPHP.
PHP
19
star
50

reactphp-quassel

Streaming, event-driven access to your Quassel IRC core, built on top of ReactPHP
PHP
18
star
51

docker-webgrind

Webgrind docker image, a Xdebug profiling web frontend
Shell
18
star
52

php-wake-on-lan-react

Turn on your PC with Wake-On-LAN (WOL) requests via React PHP
PHP
18
star
53

docker-httpie

HTTpie docker image, a cURL-like tool for humans
Shell
17
star
54

make.php

A GNU Make clone written in pure PHP. Run your Makefiles no matter whether GNU make is available.
17
star
55

reactphp-packagist-api

Simple async access to packagist.org's API, like listing project details, number of downloads etc., built on top of ReactPHP.
PHP
16
star
56

reactphp-mdns

Simple, async multicast DNS (mDNS) resolver for zeroconf networking, built on top of ReactPHP.
PHP
14
star
57

reactphp-memoize

Automatically memoize async function calls by caching function results, built on top of ReactPHP.
13
star
58

docker-polipo

Docker image for Polipo, a caching web/http proxy
13
star
59

docker-apt-cacher

Dockerized apt-cacher container
Shell
13
star
60

php-icmp-react

Simple async lowlevel ICMP (ping) messaging library built on top of React PHP
PHP
13
star
61

php-hexdump

View any (binary) string as a hexdump in php
PHP
12
star
62

reactphp-tar

Streaming parser to extract tarballs with ReactPHP.
PHP
12
star
63

reactphp-s3

Async S3 filesystem API (supporting Amazon S3, Ceph, MiniIO, DigitalOcean Spaces and others), built on top of ReactPHP.
11
star
64

confgen

Configuration file generator (confgen) โ€“ an easy way to generate structured (configuration) files on the fly by processing a Twig template and an arbitrary input data structure.
PHP
10
star
65

reactphp-mailer

Async mailer using SMTP to send large number of emails concurrently, built on top of ReactPHP.
9
star
66

reactphp-clickhouse

Blazing fast access to your ClickHouse database, built on top of @ReactPHP.
8
star
67

docker-vboxwebsrv

Tunneled VirtualBox SOAP webserver docker image
Shell
8
star
68

php-solusvm-api-react

Simple async access to your VPS box through the SolusVM API, built on top of React PHP
PHP
7
star
69

php-json-merge-patch

JSON merge patch (RFC 7396) is a simple alternative to JSON patch (RFC 6902) โ€“ dead-simple PHP library
PHP
6
star
70

php-readline-react

Experimental reactive binding for ext-readline, built on top of React PHP
PHP
6
star
71

qdatastream

Lightweight PHP library that allows exchanging binary data with Qt programs (QDataStream)
PHP
5
star
72

reactphp-tsv

Streaming TSV (Tab-Separated Values) parser and encoder for ReactPHP.
5
star
73

docker-textract

textract docker image, allows you to extract text from any document. no muss. no fuss.
Shell
5
star
74

quasselio

Quassel I/O, the lightweight web interface for Quassel IRC in a single PHP file
5
star
75

fd

Access to low-level file desciptors (FDs) with PHP, provides close(), dup(), open() and family
5
star
76

docker-quassel-core

Quassel Core docker image, a modern, cross-platform, distributed IRC program
4
star
77

reactphp-ltsv

Streaming LTSV (Labeled Tab-Separated Values) parser and encoder for ReactPHP.
4
star
78

docker-archeologit

ArcheoloGit docker image, visualize the age and dev activity for git repositories
Shell
4
star
79

quassel-cli

A CLI Quassel client
4
star
80

reactphp-dns-sd

Async DNS Service Discovery (DNS-SD) implementation for ReactPHP
4
star
81

clue.engineering

Source code for the https://clue.engineering/ website.
HTML
4
star
82

reactphp-ftp

Streaming client for FTP servers (File Transfer Protocol), built on top of ReactPHP.
4
star
83

reactphp-rediscovered

A Redis server framework written in pure PHP. Create your own Redis server and your own custom commands without hassle.
3
star
84

docker-sculpin

Sculpin Docker image, a static site generator
3
star
85

docker-redis-benchmark

A minimal docker image to ease running the redis-benchmark
Shell
3
star
86

docker-php-redis-server

A docker image to easily test-drive the php-redis-server
Shell
2
star
87

phpmdoc

PHP + MarkDown + phpdoc = phpmdoc, because writing documentation for PHP projects shouldn't be hard. Parses your class files to create a simple and fully automated markdown document (such as a README.md).
2
star
88

framework-x-website

Source code for the Framework X website.
HTML
2
star
89

docker-kpcli

Minimal kpcli docker image, a command line interface for KeePass
Shell
2
star
90

bitbake-react

Programatically control your bitbake build shell, built on top of React PHP
PHP
2
star
91

clue

2
star
92

php-viewvc-api-react

Simple, async access to your ViewVC web interface, built on top of React PHP
PHP
2
star
93

reactphp-ping

Async, event-driven ping requests to check network connectivity, built on top of ReactPHP.
2
star
94

php-caret-notation

^B A dead-simple PHP library to add caret notation in order to safely show strings that contain ASCII control characters (unprintable characters)
PHP
2
star
95

docker-psocksd

A docker image for psocksd, the fast, extensible SOCKS tunnel / proxy server daemon written in PHP
Shell
1
star
96

reactphp-bencode

Streaming Bencode (B-encode) protocol parser and encoder for ReactPHP
1
star
97

docker-disco

Disco Docker image, a simple visual GitHub browser with pull request support
Shell
1
star
98

mdtoc

Automatic table of contents (TOC) for your markdown documents, with opinionated defaults to keep your README.md up to date without the fuss.
1
star
99

reactphp-imap

Streaming client for IMAP mail servers using IMAP IDLE for instant email notifications, built on top of ReactPHP.
1
star
100

reactphp-netstring

Streaming netstring protocol parser and encoder for ReactPHP
1
star