Download the PHP package league/shunt without Composer

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

Shunt

Teaser

Build Status Dependencies Status Coverage Status Latest Stable Version Total Downloads

Inspired by Ruby's Capistrano, Shunt is PHP library for executing commands on multiple remote machines, via SSH. Specifically, this library was written to simplify and automate deployment of PHP applications to distributed environments.

Install

Via Composer

{
    "require": {
        "league/shunt": "~2.0"
    }
}

Requirement

Additional Features

Assumptions

Shunt has very firm ideas about how things ought to be done, and tries to force those ideas on you. Some of the assumptions behind these opinions are:

Do not expect these assumptions to change.

Usage

In general, you'll use Shunt as follows:

From the root folder of your composer-based project, use the Shunt script as follows:

vendor/bin/shunt some_task some_host,other_host

By default, the script will look for a file called Shuntfile, which contain hosts information, credential and your tasks. Here the structure of Shuntfile :

<?php

return array(

    'hosts' => array(
        'staging' => 'staging.domain.com',
        'repro' => 'backup.domain.com',
        'production' => 'production.domain.com',
    ),

    'auth' => array(
        'username' => 'shunt',
        'password' => 'hearmyroar',
        'pubkeyfile' => NULL,
        'privkeyfile' => NULL,
        'passphrase' => NULL,
    ),

    'tasks' => array(
        'read_home_dir' => function($s) {
            $s->run('ls');
        },
        'print_php_info' => function($s) {
            $s->run('php -i');
        },
        'upload_foo_source' => function($s) {
            $s->sftp()->mkdir('source');
            $s->scp()->put('foo', 'source/foo');
        }
    ),
);

The tasks collection indicates which tasks that available to execute. You can execute list command to see all the available tasks and available hosts. Based by above recipes, you could run :

vendor/bin/shunt read_home_dir .

Above command will execute ls on all remote machines defined in hosts parameter. You could tell Shunt to run the task on specific host(s) by appending the host nickname right after the task :

vendor/bin/shunt read_home_dir staging
vendor/bin/shunt print_php_info staging,production

As you may already notice, you could easily access SCP and SFTP instance by calling scp() or sftp() method within your task. Bellow table shows available APIs for both SCP and SFTP instances :

Type Method Signature Description
SCP put($localFile = '', $remoteFile = '') Send a file from local to remote path
SCP get($remoteFile = '', $localFile = '') Get a file from remote to local path
SFTP chmod($filename = '', $mode = 0644) Attempts to change the mode of the specified file to that given in mode.
SFTP lstat($path = '') Stats a symbolic link on the remote filesystem without following the link.
SFTP stat($path = '') Stats a file on the remote filesystem following any symbolic links.
SFTP mkdir($dirname = '', $mode = 0777, $recursive = false) Creates a directory on the remote file server with permissions set to mode.
SFTP rmdir($dirname = '') Removes a directory from the remote file server.
SFTP symlink($target = '',$link = '') Creates a symbolic link named link on the remote filesystem pointing to target.
SFTP readlink($link = '') Returns the target of a symbolic link.
SFTP realpath($filename = '') Translates filename into the effective real path on the remote filesystem.
SFTP rename($from = '', $to = '') Renames a file on the remote filesystem.
SFTP unlink($filename = '') Deletes a file on the remote filesystem.

Changelog

See the changelog file

Contributing

Please see CONTRIBUTING for details.

Support

Bugs and feature request are tracked on GitHub

License

Shunt is released under the MIT License. See the bundled LICENSE file for details.


All versions of shunt with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
ext-ssh2 Version >=0.12
symfony/console Version ~2.3
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 league/shunt contains the following files

Loading the files please wait ....