Download the PHP package nelexa/crossplane without Composer

On this page you can find all versions of the php package nelexa/crossplane. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package crossplane

php-crossplane

Reliable and fast NGINX configuration file parser and builder

:information_source: This is a PHP port of the Nginx Python crossplane package which can be found here.

Packagist Version Packagist PHP Version Support Build Status License

Install

Install in project

Global install

Use in PHP

Parse config

This will return the same payload as described in the crossplane parse section.

Build config from payload

This will return a single string that contains an entire NGINX config file.

Lex config

$crossplane->lexer()->lex() generates 3-tuples.

Register custom Lexer / Builder directives

Command Line Interface

To invoke commands in the command line interface, use vendor/bin/crossplane if you have installed the package locally in the project, and crossplane if you have installed the package globally.

crossplane parse

This command will take a path to a main NGINX config file as input, then parse the entire config into the schema defined below, and dumps the entire thing as a JSON payload.

Privacy and Security

Since crossplane is usually used to create payloads that are sent to different servers, it's important to keep security in mind. For that reason, the --ignore option was added. It can be used to keep certain sensitive directives out of the payload output entirely.

For example, we always use the equivalent of this flag in the NGINX Amplify Agent out of respect for our users' privacy:

--ignore=auth_basic_user_file,secure_link_secret,ssl_certificate_key,ssl_client_certificate,ssl_password_file,ssl_stapling_file,ssl_trusted_certificate

Schema

Response Object

Config Object

Directive Object

Note
If this is an `include` directive and the `--single-file` flag was not used, an `"includes"` value will be used that holds an Array of indices of the configs that are included by this directive. If this is a block directive, a `"block"` value will be used that holds an Array of more Directive Objects that define the block context.

Error Object

Note
If the `--tb-onerror` flag was used by crossplane parse, `"callback"` will contain a string that represents the traceback that the error caused.

Example

The main NGINX config file is at /etc/nginx/nginx.conf:

And this config file is at /etc/nginx/conf.d/servers.conf:

So then if you run this:

vendor/bin/crossplane parse --indent=4 /etc/nginx/nginx.conf

The prettified JSON output would look like this:

crossplane parse (advanced)

This tool uses two flags that can change how crossplane handles errors.

The first, --no-catch, can be used if you'd prefer that crossplane quit parsing after the first error it finds.

The second, --tb-onerror, will add a "callback" key to all error objects in the JSON output, each containing a string representation of the traceback that would have been raised by the parser if the exception had not been caught. This can be useful for logging purposes.

crossplane build

This command will take a path to a file as input. The file should contain a JSON representation of an NGINX config that has the structure defined above. Saving and using the output from crossplane parse to rebuild your config files should not cause any differences in content except for the formatting.

crossplane lex

This command takes an NGINX config file, splits it into tokens by removing whitespace and comments, and dumps the list of tokens as a JSON array.

Example

Passing in this NGINX config file at /etc/nginx/nginx.conf:

By running:

vendor/bin/crossplane lex /etc/nginx/nginx.conf

Will result in this JSON output:

However, if you decide to use the --line-numbers flag, your output will look like:

crossplane format

This is a quick and dirty tool that uses crossplane parse internally to format an NGINX config file. It serves the purpose of demonstrating what you can do with crossplane's parsing abilities. It is not meant to be a fully fleshed out, feature-rich formatting tool. If that is what you are looking for, then you may want to look writing your own using crossplane's PHP API.

crossplane minify

This is a simple and fun little tool that uses crossplane lex internally to remove as much whitespace from an NGINX config file as possible without affecting what it does. It can't imagine it will have much of a use to most people, but it demonstrates the kinds of things you can do with crossplane's lexing abilities.


All versions of crossplane with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
ext-json Version *
ext-mbstring Version *
symfony/console Version *
symfony/polyfill-php73 Version ^1.23
symfony/polyfill-php80 Version ^1.23
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nelexa/crossplane contains the following files

Loading the files please wait ....