dev-master
9999999-devIN2PIRE CLI Framework
MIT
The Requires
by Nhat Tran
console cli in2pire inspire
1.x-dev
1.9999999.9999999.9999999-devIN2PIRE CLI Framework
MIT
The Requires
by Nhat Tran
console cli in2pire inspire
Wallogit.com
2017 © Pedro Peláez
IN2PIRE CLI Framework
A Simple PHP CLI Framework provides, (*1)
Add in2pire/cli to your composer.json and run composer install, (*2)
TBD, (*3)
APP_NAME: Your app nameAPP_PATH: Path to your cli applicationAPP_CONF_PATH: Path to directory that stores config files for your applicationin2pire/cli to your composer.json)For examples, (*4)
#!/usr/bin/env php
<?php
/**
* Memcached CLI Application
*/
if (PHP_SAPI !== 'cli') {
echo 'Warning: memcached-cli should be invoked via the CLI version of PHP, not the ' . PHP_SAPI . ' SAPI' . PHP_EOL;
exit(1);
}
define('APP_NAME', 'memcached-cli');
define('APP_PATH', __DIR__);
define('APP_CONF_PATH', APP_PATH . '/../conf/' . APP_NAME);
// Add class loader.
require APP_PATH . '/../vendor/autoload.php';
// Run application.
$app = new In2pire\Cli\CliApplication();
$app->run();
The compiler is distributed in installation directory of in2pire/cli. It uses Phar to put entire application into a single file for easy distribution and installation, (*5)
Arguments
* --config: The path to config directory of your cli application
* --bin: The path to main executable of your cli application
* --no-compress: Do not compress php files
* --no-optimize: Do not optimize class loaders
* --no-phar: Do not add .phar extension
* --executable: Create executable file, (*6)
Requirements
* You need to run compiler in your git repository. It helps to detect application version
* You need Phar in order to compile your application
* zlib or bzip2 is required if you want to reduce size of your binary file, (*7)
For example, in memcached-cli. The binary is compiled by running, (*8)
./bin/compile --bin=bin/memcached-cli --config=conf/memcached-cli --executable --no-phar
IN2PIRE CLI Framework
MIT
console cli in2pire inspire
IN2PIRE CLI Framework
MIT
console cli in2pire inspire