Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 873 Bytes

File metadata and controls

39 lines (31 loc) · 873 Bytes

Timber chain

The php code runner for any PHP project

Usage

This package is compile into a single phar file, you can download it from the release page.

To run PHP code at current directory:

php chain.phar "echo 'Hello, World!';"

To run PHP code at a specific directory:

php chain.phar --target=/path/to/project "echo 'Hello, World!';"

To run with multiple lines of code

You can pass they as base64 encoded string with --base64 option: PHP code:

$name = "Tom";
echo "Hello, $name!";

First, you need to encode it to base64:

JG5hbWUgPSAiVG9tIjsNCmVjaG8gIkhlbGxvLCAkbmFtZSEiOw==

Then run it, so you don't have to deal with escaping characters:

php chain.phar --target=/path/to/project --base64 "JG5hbWUgPSAiVG9tIjsNCmVjaG8gIkhlbGxvLCAkbmFtZSEiOw=="

Build

    composer build