Download the PHP package hershel-theodore-layton/printf-state-machine without Composer

On this page you can find all versions of the php package hershel-theodore-layton/printf-state-machine. 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 printf-state-machine

Printf State Machine

Generate HH\FormatString<T> state machines.

This package uses a code generator to create state machines that process HH\FormatString<T> with their arguments and the accompanying typesafety interfaces. This is a --dev dependency. You don't need this generator in production to use the state machines.

Usage

You can chain together your own format string DSL in little to no time. Start with PrintfStateMachine\Factory::create() and chain ->with... methods. Once your DSL is ready, invoke |> PrintfStateMachine\codegen($$, PrintfStateMachine\ENGINE_TEMPLATE). You will get Entities, which are "just code". Put this code somewhere in a namespace it won't conflict with any other engines. Then create a typesafe caller.

This will transform your format and arguments according to the rules you've set out in your factory.

Use case

HH\Lib\SQL\Query has support for these specifiers:

Specifier Effect
%d %f %s nullable int, float, and string
%=d %=f %=s equality for int, float, and string
%C %T column and table names
%Ld %Lf %Ls %LC list of int, float, string, and column
%K /* comments */
%Q nested Query objects

You may very well want to add a strongly typed %N for TableAndColumnName to make sure that you never accidentally switch around a column name and a user supplied value. Short of patching the Hack typechecker, or building a very difficult to write linter that depends on type information, you'd need a tool like this. Write a definition for 12 (excluding %C and %T) specifiers and add ->withRewrite<TableAndColumnName>('N', 'C'). The format and args were typechecked by Hack.

A library will be published with these implementations.


All versions of printf-state-machine with dependencies

PHP Build Version
Package Version
Requires hhvm Version >=4.153
hershel-theodore-layton/hhvm-four-shim 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 hershel-theodore-layton/printf-state-machine contains the following files

Loading the files please wait ...