Download the PHP package owlycode/interlacing without Composer

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

What is it?

It's a php alternative to Tracery by GalaxyKate, from which it was heavily inspired. It is used to generate procedural texts based on a grammar.

How to use it?

Grab the phar at https://github.com/OwlyCode/interlacing/releases or install it as a dependency of your project with composer: composer req owlycode/interlacing.

Firt declare a grammar:

And then use it by running interlacing.phar grammar.yaml or inside your own code:

The grammar file is composed of a list of placeholders and their possible associated values. You can put placeholders inside content using the {{ }} delimiters. Each time interlacing encounters a placeholder, it lookups for possible values from the grammar and picks one randomly.

Usually the root placeholder is used as an entrypoint.

Using alterations and resolvers

You can apply alterations to your placeholders by appending them with a leading |. Alterations can be chained.

Resolvers are not manually applied, they just affect the way a placeholder is replaced by a value. Everytime a placeholder is used, Interlacing runs every known resolvers and returns the value of the first one that gives a non-null result. Otherwise, it lookups into the grammar for the possible values and picks one.

Builtin alterations and resolvers

Pluralize

Pluralize a word. You can change the locale inside the grammar (english by default):

Capitalize

Capitalizes the first letter.

Could produce: The mouse can eat the cow, as they say.

Memory

Allows to dynamically build placeholders during the execution.

Examples:

Beware: If you override a grammar based placeholder by a memory value, it will replace it entirely.

Silence

Prevents a placeholder from rendering, often used with memory alterations: it allows to pair some results.

Will produce Fishes are good at swimming. or Fishes are bad at flying. but never Fishes are good at flying..

Creating your own alterations and resolvers

You can create your own alterations by implementing the OwlyCode\Interlacing\Plugin\AlterationInterface interface:

And you can create a resolver by implementing the OwlyCode\Interlacing\Plugin\ResolverInterface interface:

Now let's use our previously declared alteration and resolver:

This would display: time: 2019-11-08 22:44:00, where the date and time are set to now.


All versions of interlacing with dependencies

PHP Build Version
Package Version
Requires symfony/yaml Version ^4.3
doctrine/inflector Version dev-master
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 owlycode/interlacing contains the following files

Loading the files please wait ....