2017 © Pedro Peláez
 

library sh

Command line helper

image

gonzalo123/sh

Command line helper

  • Tuesday, March 12, 2013
  • by gonzalo123
  • Repository
  • 6 Watchers
  • 56 Stars
  • 48 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Command line library for PHP that allows to call programs as functions., (*1)

Build Status, (*2)

Inspired in Python Sh library (http://amoffat.github.com/sh/), (*3)

usage examples:, (*4)

<?php
error_reporting(-1);

// include PSR-0 autoloader
include __DIR__ . '/../vendor/autoload.php';

use Sh\Sh;

// Simple command using factory
echo Sh::factory()->runCommand('notify-send', array('-t', 5000, 'title', 'HOLA'));

// with instance
$sh  = new Sh();
echo $sh->ifconfig("eth0");

echo $sh->ls('-latr ~');

echo $sh->ls(array('-latr', '~'));

$sh->tail('-f /var/log/apache2/access.log', function ($buffer)  {
    echo $buffer;
});

// chainable commands (baking)
$sh->ssh(array('myserver.com', '-p' => 1393))->whoami();
// executes: ssh myserver.com -p 1393 whoami

$sh->ssh(array('myserver.com', '-p' => 1393))->tail(array("/var/log/dumb_daemon.log", 'n' => 100));
// executes: ssh myserver.com -p 1393 tail /var/log/dumb_daemon.log -n 100
});

Composer require:, (*5)

    "require":{
        "gonzalo123/sh": "v1.0",
        "symfony/process":"dev-master"
    },`

https://packagist.org/packages/gonzalo123/sh, (*6)

The Versions

12/03 2013

dev-master

9999999-dev https://github.com/gonzalo123/sh

Command line helper

  Sources   Download

MIT

The Requires

 

console cli process

03/12 2012

v1.0

1.0.0.0 https://github.com/gonzalo123/sh

Command line helper

  Sources   Download

MIT

The Requires

 

console cli process