Download the PHP package afrihost/base-command-bundle without Composer

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

Afrihost BaseCommandBundle

Latest Stable Version Total Downloads License Build Status

If you have lots of Symfony Commands, or if you simply want to skip the boilerplate involved in setting up commands, this bundle is for you. At its core is an abstract class that extends Symfony’s ContainerAwareCommand. This adds our own opinionated initialization for a range of boilerplate, such as logging and locking, so that you don’t have to re-invent the wheel with every command.

The overall design goal is to enable you to define defaults (such as whether to duplicate log output to your console) globally in your Symphony configuration while still having the freedom to override these in a single command (e.g. This command must always obtain a lock) and then change your mind again at runtime (to set the Log Level to DEBUG for this execution for example).

It is a small piece of ‘developer friendly’ code that we want to share with you in the hopes that it makes your life a little easier. If this appeals to you, Pull Requests are always welcome.

Installation

First install this bundle using composer

Note: Support for Symfony 2 and PHP 5 is still available under version zero (~0.6). We will continue to publish any important bug and security fixes as point releases on this version, however, new features will not be backported. The current version supports Symfony ~3.0 and PHP ~7.0

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

Configuration

Defaults are specified for all options so that no configuration is needed, but if you'd like, you can override the default configuration options in your app/config/config.yml file:

Locking: You may opt to enable/disable locking via configuration. Locking is enabled by default.

You might also want to change the default location where the lock files are created. If you do not specify a lock file folder, locks will be created in the system's default temporary directory. If you specify a relative directory, locks will be created relative to the Symfony Kernel root (which is "app" in most cases). If you specify an absolute path, the directory must already exist and be accessible by the PHP process. In POSIX environments, paths can be provided that start with ~/. This will be expanded using the $HOME environment variable and the full path subjected to he same constraints as absolute paths.

Example (relative): "storage" >> this will assume you want it under app/storage. "storage/lockfiles" >> this will assume you want it under "app/storage/lockfiles". Example (absolute): "/var/my-lockfiles" >> this will store it under "/var/my-lockfiles". "~/my-lockfiles" >> lock files will be created under "/home/your_username/my-lockfiles".

Full documentation for the locking functionality can be found at Resources/doc/locking.md

Logging The logging system has the ability to use several handlers. More handlers will be added soon, you're also welcome to add your own and send us a PR. Each handler has the potential of being enabled/disabled. Handlers are all enabled by default at this stage. Handlers generally have line formatting. The line_format entry states how this format looks like, and can be overwritten in the config.yml file. The file logger has a file extension, specified by file_extension and is defaulted, but can again be overwritten in config.yml.

Full documentation for the logging functionality can be found at Resources/doc/logging.md

Basic Usage

Instead of extending ContainerAwareCommand like this:

... you simply extend our BaseCommand like this:

Don't worry, BaseCommand still extends ContainerAwareCommand, so all the goodies you are used to having at your disposal from ContainerAwareCommand are still there. BaseCommand merely adds a few extra boilerplate and tools for you to use, such as:

Log Handler Initialisation - you can immediately start logging out of the box with Monolog:

Runtime Log Level - Change the log-level from the command line without having to change the code. Just provide the --log-level parameter with any of the RFC 5424 severity names supported by Monolog:

Log to Console - Toggle whether you want the log entries to be sent to STDOUT as well as the logfile

Output Icons

IconsColoursOptions
IconMethod
tick
error
exclamation
lt
gt
one
two
three
four
five
six
seven
eight
nine
ten
envelope
dead
noEntry
alarmClock
leftArrow
upArrow
rightArrow
downArrow
leftRightArrow
upDownArrow
💩smileyPoo
🍻beers
🐔chicken
💣bomb
💤snooze
🔒lock
🙏pray
Foreground Colour Methods
default
black
white
red
green
blue
yellow
cyan
magenta
Background Colour Methods
bgDefault
bgBlack
bgWhite
bgRed
bgGreen
bgBlue
bgYellow
bgCyan
bgMagenta
Method
bold
underscore
reverse

TODO

The following are features we would like to add. When this list is done (or reasonably short) we will release our first Major Version:


All versions of base-command-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ~7.1
symfony/symfony Version ~3.0|~4.0
monolog/monolog Version ~1.10
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 afrihost/base-command-bundle contains the following files

Loading the files please wait ....