Download the PHP package rb/polygen-php without Composer

On this page you can find all versions of the php package rb/polygen-php. 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 polygen-php

Polygen-PHP

Polygen is a tool that parses text files containing a grammar definition and generates text according to that definition. Polygen-PHP does the same, but in PHP 5.6+ and is compatible with the same grammar files, so now you can use Polygen on your website even if it's on a shared hosting service.

For example, the following grammar file

might result in the following sentences being generated:

... and so on.

There are many more features in the language, check out the official Polygen documentation to learn everything about it.

Installation

You can install Polygen-PHP using composer: composer require rb/polygen-php

Usage instructions

Parse once, produce many (POPM)

It's not necessary to parse the source grammar every time a production is wanted: once a Polygen document is obtained, it can be serialize()d to a string and stored as a string constant. This way, the parsing can be done only once at "compile time", then at runtime, it's sufficient to unserialize() the string back to a Polygen document, and it can be used as usual to obtain a production.

Command line usage

There is also a CLI tool that you can use. It's not refined at all, since it is intended for debugging only, but the basics work. If you require this package as a dependency of your project, Composer must have placed the CLI tool in your vendor/bin folder, so you can run it with ./vendor/bin/polygen.php. A small usage will be printed if launched with no parameters (or with -h or --help parameters).

Known issues

Static checking

Running tests

There are two test suites, Unit and Integration you can run both with vendor/bin/phpunit.


All versions of polygen-php with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/streams Version ^3
php Version ^5.6 || ^7.0
drupol/phpermutations Version ^1
savvot/random Version ^0.3
webmozart/assert Version ^1
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 rb/polygen-php contains the following files

Loading the files please wait ....