helmich / graphpizer-cli
Store PHP syntax trees in Neo4j graph structures
Fund package maintenance!
martin-helmich
donate.helmich.me
Requires
- php: >= 5.5
- guzzlehttp/guzzle: ~6.0
- justinrainbow/json-schema: ~1.5
- nikic/php-parser: ~1.4
- phpdocumentor/reflection-docblock: ~2.0
- symfony/console: ~2.7
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-28 05:44:10 UTC
README
Disclaimer: This project is actively developed and by no means stable. It is completely undocumented. I refuse to take any responsibility for any kind of havoc this program might wreak on your computer and to provide any kind of support.
Author and License
Martin Helmich
This project is GPL-licensed.
Background: This project started off as part of my master's thesis in CS at the University of Applied Sciences Osnabrück. It has proven it's worth there and I'll probably continue to develop and maintain it.
What is GraPHPizer?
This is a command-line tool that's designed for usage with the GraPHPizer server application. A general description of what GraPHPizer is and what it does can be found there.
Installation
Prerequisites
- PHP in version 5.5 or newer
- Composer in a halfway recent version
- A GraPHPizer server running on a network-reachable machine
Install using composer
You can install the GraPHPizer CLI using Composer:
$ composer require helmich/graphpizer-cli
You can also install the CLI globally:
$ composer global require helmich/graphpizer-cli
After installation you will find a graphpizer
executable in your bin dir
(when installing locally, this will typically be $PWD/vendor/bin
. When
installing globally, it will be $HOME/.composer/bin
).
Configuration
CLI flags
The graphpizer
command-line utility offers a variety of flags and parameters
that can be set on invocation:
--graph-host
or-H
configures the GraPHPizer server name. The default value islocalhost
.--graph-port
or-P
configures the GraPHPizer port. The default value is9000
The graphpizer.json
configuration file(s)
For a per-project configuration, you can also create a graphpizer.json
file
inside your project root directory. You can also create additional
graphpizer.json
files in sub-directories of your project; these configurations
will be applied to that directory and it's sub-directories only.
See the respective section in the GraPHPizer server documentation for more information.
Usage
The graphpizer
CLI tool offers a set of commands that can be called. The most
important is the import:ast
command which is invoked as follows:
graphpizer import:ast [--prune] <path-to-project>...
You can specify any number of diretories or files as arguments to the
import:ast
call. Furthermore, you can set the --prune
flag when you don't
want incremental source code import.