Download the PHP package dxw/rubbishthorclone without Composer

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

Rubbish Thor Clone

Rubbish Thor Clone is a rubbish clone of Thor, a popular toolkit for CLI applications written in Ruby.

Rubbish Thor Clone exposes an executable with a number of subcommands, like git or bundler.

To install:

To use, first create a class that inherits from RubbishThorClone:

For each subcommand you want to define, you need to add a definition and a callback. Definitions go in a method called commands. Callbacks should be public methods on your class, with the same name as the subcommand:

You can also add options to subcommands. To define options, pass a callback in when you define your subcommand:

After you've added options, you can access them via $this->options:

Rubbish Thor Clone uses the OptionParser library to parse command lines, so check out its API for more.

After you've done all that, you just need to instantiate your class and call start:

For the full code, check hello_world.class.php in the examples directory.

Rubbish Thor Clone's API

RubbishThorClone::commands

An abstract function your class should implement. It's expected to call RubbishThorClone::command to define all your subcommands.

RubbishThorClone::command

Call this to define your subcommands. It takes three arguments: $definition, $description and (optionally) $options_callback.

$definition

Your subcommand's definition. Consists of the subcommand name followed by a number of mandatory arguments:

A method with the same name as your subcommand must exist in your class. It must accept an equal number of parameters as the subcommand has arguments. They will be passed into your method in the order they appear on the command line.

You can specify an optional argument by wrapping it in [brackets]:

if a command has an optional argument, there must only be one, and it must be the last one.

You can also bypass RubbishThorClone's argument parsing by prepending the argument with an asterisk. This helpful where arguments can contain spaces, or where you just want to parse things for yourself:

A command can only have one argument if it's a pass-through argument. If you use this notation, RubbishThorClone will pass the whole contents of the command line (after the command name) as one argument.

$description

A human-friendly short description of the subcommand, used to generate usage help.

$options_callback

A callable that defines the options your subcommand accepts, using OptionParser's API. RubbishThorClone has a built in "help" command, whose output is also generated from the information you provide here (using OptionParser::addHead and soforth).

RubbishThorClone::usage

Emits a list of the subcommands you have defined, along with their short descriptions.

RubbishThorClone::start

Takes one argument ($argv), figures out what to do with it , and calls your callbacks as necessary.


All versions of rubbishthorclone with dependencies

PHP Build Version
Package Version
Requires pear/console_table Version *
dxw/optionparser Version ^1.0
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 dxw/rubbishthorclone contains the following files

Loading the files please wait ....