broeser/madpiper

MadPiper lets you create piped cli commands with a fluent interface

0.0.0 2016-01-29 14:47 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:23:55 UTC


README

MadPiper lets you create piped cli commands with a fluent interface.

Build Status codecov.io License SemVer 2.0.0

Goals

  • MadPiper shall be easy to use and easy to learn

Installation

MadPiper works with PHP 5.4, 5.5., 5.6 and 7.0.

The package can be installed via composer:

composer require broeser/madpiper

Check your safe mode settings and restrictions, in case you want to execute commands generated with MadPiper.

How to use

You can use MadPiper like this:

<?php
$madPiperCommand = new MadPiper\Command();

exec($madPiperCommand
    ->ps('u')
    ->grep('COMMAND')
);

Which will execute this (not very useful) command:

ps u|grep COMMAND

Note that neither ps() nor grep() are predefined methods, you can use almost any command you can imagine with as many arguments as you want.

<?php
$madPiperCommand = new MadPiper\Command();

exec($madPiperCommand
    ->ls('-ls', 'R*')
    ->…
);

MadPiper does not execute, ist just returns the command as string. That means, that it should be easy to use MadPiper in your own project and with almost any framework.

MadPiper currently does not escape arguments.

Contributing?

Yes, please!

See CONTRIBUTING.md for details and/or open an issue with your questions.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

MadPiper?

A pun on the pipe-character | and the fact, that this project is slightly mad.