Download the PHP package italix/console without Composer

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

Italix Console

PHP Version

One CLI for the whole framework. Commands are listed, not discovered; dependencies are declared, not reflected; exit codes mean something.

One dependency: psr/container, which is interface-only.


Writing a command

Register it in conf.php:

Injected properties must be protected. A private property of the subclass is invisible from BaseCommand's scope. The runner says so by name rather than letting PHP's "Cannot access private property" stand as the whole explanation.


Input

Written Read as
--max=100 option('max') → '100', int_option('max') → 100
--force flag('force') → true, has_option('force') → true
--no-cache flag('cache') → false, has_option('cache') → true
-vqf three flags: v, q, f
-- stops option parsing; everything after is an argument
anything else a positional argument, in order

flag() reads 0, false, no and off as false.

One trap worth knowing: --max with no value does not become 0. option() and int_option() fall back to the default, because a bare --max and an omitted --max diverging into a zero nobody asked for is how a worker ends up processing no jobs and reporting success. has_option() still reports it as given.


Output

Diagnostics go to stderr. A command whose errors land on stdout cannot be piped: ix jobs:status | grep failed would match its own error message.

Colour only when a terminal is watching. Escape codes are emitted when the stream is a TTY and suppressed otherwise, so a CI log gets text rather than \e[32m. NO_COLOR is honoured.

Output::in_memory() returns one that writes into memory; fetch() and fetch_errors() read it back. That is how the suite asserts on which stream a message went to.


Exit codes

Code Meaning
0 the command succeeded
1 the command failed, or threw
2 usage error — unknown verb, bad registration, missing container

The 1/2 split is the one encode-lint already used. run() returning a code the runner passes through verbatim is the point: a command that fails with 0 is the CLI equivalent of a validation rule that never runs.

An uncaught exception prints class, message, file and line, then suggests -v for the trace.


Wiring it up

bin/ix boots the same configuration the web entry point does and takes the container from the engine:

Engine::registry() builds the container without the dispatcher, so ix version does not write a route cache file as a side effect.

That shared container is the fix for a real bug: the old run_migration.php rebuilt the database credentials from $_ENV with its own defaults, so a change in conf.php never reached migrations.


Deliberately not


All versions of console with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
psr/container Version ^1.0 || ^2.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 italix/console contains the following files

Loading the files please wait ...