Download the PHP package elbakerino/console without Composer

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

PHP Console with DI and Annotations

Build PHP Console applications with Dependency Injection and Annotations.

Setup app skeleton and install dependencies with composer:

composer create-project elbakerino/console

That's it - ready to code!

Run demo commands:

# get help
php cli -h

# how to access operands, see `Commands\Demo->handle`    
php cli demo
php cli demo World
php cli demo:welcome
php cli demo:bye

For Docker, download repository and spin up services:

git clone https://github.com/elbakerino/console-di-annotations.git

docker-compose up

# open second terminal:
# open `bash` in docker service `app` with user `www-data`
docker-compose exec -u www-data app bash
composer install

Command Setup

At GetOpt-PHP commands are registered with inline documentation.

Here also the commands are registered for found annotations.

For only manual command, it's as short as:

You can register commands with annotations, like the demo commands (todo: annotation command docs).

See Commands\Demo for a demo class command handler, any callable/resolvable is possible as command handler.

See Commands\DemoMultiple for a demo class command handler which uses annotations at method level, not class level.

Schematic use of defined commands:

php cli <name> <..operand> <..-a=opt>

More Details

In launch.php the whole setup and auto-config is done, see inline-comments for details.

In _definitions.php you can define/overwrite service definitions for PHP-DI.

See Lib\ConsoleApp for the execution of GetOpt, use as base to switch to another console framework.

See Annotations for example annotations, further docs on annotation will follow / can be found below in the libraries links.

Configure Docker in docker-vhost.conf a rebuild is needed.

For further details see:

Install any other dependency for your project from packagist.

Todos

There is not really more needed, you can write simple and efficient console apps.

Some nice to haves would be:

Downloads

License

This project is free software distributed under the MIT License.

See: LICENSE.

Contributors

By committing your code to the code repository you agree to release the code under the MIT License attached to the repository.


Author: Michael Becker


All versions of console with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
psr/container Version ^1.0
php-di/php-di Version ^6.0.0
orbiter/annotations-util Version 0.2.x
ulrichsg/getopt-php Version ^3.2.2
vlucas/phpdotenv Version ^3.6
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 elbakerino/console contains the following files

Loading the files please wait ....