Download the PHP package danc0/dcli without Composer

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

D-CLI

A Basic PHP CLI App Framework. This project is dependency free and meant to be a lightweight starting point for PHP CLI applications.

These docs are a work in progress as this project is still in development.

Full Documentation (For Beta Version)

GitHub tag (latest by date) GitHub

Basic Setup

Install with: or download the latest package.

After creating your main file (ex: src/dcli) ensure you make that file executable and optionally add it to your path so you can call your application from anywhere. You will also want to create a Composer autoload file.

The most basic setup uses anonymous functions to process commands.

This is the most basic possible usage and does not take advantage of sub commands.

Passing Class@method to Call

This method also does not make use of sub commands but allows you to move your logic into a class.

This will call the method in the class.

File Structure Controlled Commands

This method makes use of sub commands. To use the advanced structure a specific project layout is required. Your classes that will handle the commands must be placed in the directory. The command should be a sub folder. For example, the command should be placed in . Within that directory a file named should be created. This, and all classes in the directory should implement . This is the file that will be called on the command .

To use a sub command create an additional file with that sub-commands name. For example, would require you to make a file named with a class of in . This file will be called to process the sub command.

This requires a minimal setup in the main file.

The class handles the logic and routing of the calls.

Passing Arguments

Arguments are treated as key value pairs passed in the the key starting with the -- annotation. Arguments can be passed into the command in the following way:

The command parser will return John Smith for the name argument for either of these approaches.

The command runner will automatically set these variables within your class when it resolves the handler. For example, if you have a Default_Handler with the argument name available the command runner will add the value of name to $this->name within your class.

Passing Flags

Flags are considered booleans as can be passed with either - or -- annotation.

The command runner will automatically set these variables within your class when it resolves the handler. For example, if you have a Default_Handler with the flag v available the command runner will set $this->v to true or false depending on if it was passed or not.

Command_Container

The Command_Container holds information about your Config and your Request Environment. To tell the Command Runner to load this into your handler class you can do one of two things. First you can declare a variable in your class public Command_Container $Command_Container this will be set AFTER the class is instantiated so you will not have access in the constructor, but will in the other methods of your class. If you need this available in your constructor function add Command_Container $Command_Container as a variable that needs to be passed into the class.

Event_Handler Global

The main Application Event_Handler can be injected into your handler classes using the same two techniques outlined above for the Command_Container


All versions of dcli with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 danc0/dcli contains the following files

Loading the files please wait ....