Download the PHP package programster/command without Composer

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

CLI Command PHP Package

A package to simplify the creation of CLI commands in PHP, with BASH autocompletion support.

Execute Parameters

When writing your execute function, be aware that the keys for the options and switches will always be the longhand name, and without any hyphens. E.g. shell instead of s when the user enters --shell or -s.

Option Value Validation

We don't validate any of the values that get passed into the options, so you will need to perform any validation yourself.

Example

Below is an example, in which I have written a command that wraps around docker-exec, to allow me to tab-complete the container names, and then enter them by ID, defaulting to the BASH shell, but allowing the user to provide the --shell or -s option to specify they want to use sh instead.

Install Command

Once you have built a command using this framework, you will want to know how to "install" it, so that you can execute it from anywhere, and the BASH autocomplete functionality works.

Put It In Your $PATH

Place the command, or a symlink to it, in your $PATH at /usr/bin/{command name}. Make sure the executable flag is set.

Creating The BASH Completion File

Unfortunately, one still needs to create a completion file for your program, in order to tell BASH to ask your program for the tab hints. One case easily create this using your program, using the "hidden" --generate-autocomplete-file switch like so:

Alternatively, you can manually create your own completion script. Below is an example for a custom command you created called my-command.

Now open a new BASH shell, and you should see it working!.

Roadmap


All versions of command with dependencies

PHP Build Version
Package Version
Requires php Version >=8.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 programster/command contains the following files

Loading the files please wait ....