Initializing repository & composer
parent
36175697b2
commit
caf446844e
@ -0,0 +1,2 @@
|
|||||||
|
.idea/
|
||||||
|
vendor/
|
@ -1,3 +1,71 @@
|
|||||||
# GroupedMessageProcessor
|
# GroupedMessageProcessor
|
||||||
|
|
||||||
An processor for monolog managing "grouped" logs messages
|
An processor for monolog managing "grouped" logs messages
|
||||||
|
|
||||||
|
|
||||||
|
# PHPCommandLine
|
||||||
|
__Command line management library in PHP (CLI)__
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
A command-line options parser with configurable expects and help auto generation.
|
||||||
|
|
||||||
|
There is two kind of arguments :
|
||||||
|
- options (short/long tag) : _-h_ or _--version_
|
||||||
|
- values : my/path/to/a/file
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
```
|
||||||
|
composer require darkelfe14728/commandline
|
||||||
|
```
|
||||||
|
|
||||||
|
## Description
|
||||||
|
At first, create a new CommandLine with program name and description. Add options and values by using respectively _addOption_ and _addValue_.
|
||||||
|
Default options for help (-h / --help) and version (--version) can be add with _addDefaultArguments_ and use _treatDefaultArguments_ for launching associated treatments.
|
||||||
|
|
||||||
|
Treat script arguments with _parse_ : return an object of variables.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use CommandLine\CommandLine;
|
||||||
|
use CommandLine\Argument\Option\Flag;
|
||||||
|
use CommandLine\Argument\Parser\StringParser;
|
||||||
|
use CommandLine\Argument\Value\Value;
|
||||||
|
|
||||||
|
$cmdline = new CommandLine('Checker', 'File checker', 'php checker.php');
|
||||||
|
$cmdline->addDefaultArguments();
|
||||||
|
|
||||||
|
$cmdline->addOption(new Flag('enhanced', false, 'Deep check ?'));
|
||||||
|
|
||||||
|
$cmdline->addValue(new Value('path', 'File path', new StringParser()));
|
||||||
|
|
||||||
|
var_dump($args = $cmdline->parse());
|
||||||
|
$cmdline->treatDefaultArguments($args);
|
||||||
|
```
|
||||||
|
|
||||||
|
Would display something like that :
|
||||||
|
|
||||||
|
class stdClass#13 (1) {
|
||||||
|
public $enhanced => bool(false)
|
||||||
|
public $path => string("my/path/to/a/file")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
## Automatic help generation
|
||||||
|
CommandLine provide a generator for command-line of programme. Example :
|
||||||
|
|
||||||
|
Checker
|
||||||
|
File checker
|
||||||
|
|
||||||
|
php checker.php [OPTIONS] path
|
||||||
|
Arguments :
|
||||||
|
path string File path
|
||||||
|
|
||||||
|
Options :
|
||||||
|
-h --help X Affiche cette aide
|
||||||
|
--enhanced Deep check ?
|
||||||
|
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "darkelfe14728/console-output",
|
||||||
|
"description": "Manager for console output",
|
||||||
|
"keywords": [ "cli" ],
|
||||||
|
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2",
|
||||||
|
"monolog/monolog": "^2.0",
|
||||||
|
"petrknap/php-singleton": "^1.0"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Console\\": "src/Console/"
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [ "tests/" ]
|
||||||
|
},
|
||||||
|
|
||||||
|
"readme": "README.md",
|
||||||
|
"homepage": "https://git.jrosset.ovh/darkelfe14728/ConsoleOutput",
|
||||||
|
"license": "CC-BY-4.0",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Julien Rosset",
|
||||||
|
"email": "jul.rosset@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"email": "jul.rosset@gmail.com",
|
||||||
|
"issues": "https://git.jrosset.ovh/darkelfe14728/ConsoleOutput/issues",
|
||||||
|
"wiki": "https://git.jrosset.ovh/darkelfe14728/ConsoleOutput/wiki",
|
||||||
|
"docs": "https://git.jrosset.ovh/darkelfe14728/ConsoleOutput/wiki",
|
||||||
|
"source": "https://git.jrosset.ovh/darkelfe14728/ConsoleOutput"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,200 @@
|
|||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "c163ee35d8eab5a63e0509ceaaf7dfaf",
|
||||||
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "monolog/monolog",
|
||||||
|
"version": "dev-master",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Seldaek/monolog.git",
|
||||||
|
"reference": "39637a5d0e98068d98189ce48a87f3dd61455429"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/39637a5d0e98068d98189ce48a87f3dd61455429",
|
||||||
|
"reference": "39637a5d0e98068d98189ce48a87f3dd61455429",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2",
|
||||||
|
"psr/log": "^1.0.1"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/log-implementation": "1.0.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
||||||
|
"doctrine/couchdb": "~1.0@dev",
|
||||||
|
"elasticsearch/elasticsearch": "^6.0",
|
||||||
|
"graylog2/gelf-php": "^1.4.2",
|
||||||
|
"php-amqplib/php-amqplib": "~2.4",
|
||||||
|
"php-console/php-console": "^3.1.3",
|
||||||
|
"php-parallel-lint/php-parallel-lint": "^1.0",
|
||||||
|
"phpspec/prophecy": "^1.6.1",
|
||||||
|
"phpunit/phpunit": "^8.5",
|
||||||
|
"predis/predis": "^1.1",
|
||||||
|
"rollbar/rollbar": "^1.3",
|
||||||
|
"ruflin/elastica": ">=0.90 <3.0",
|
||||||
|
"swiftmailer/swiftmailer": "^5.3|^6.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
|
||||||
|
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
|
||||||
|
"elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client",
|
||||||
|
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
|
||||||
|
"ext-mbstring": "Allow to work properly with unicode symbols",
|
||||||
|
"ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)",
|
||||||
|
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
|
||||||
|
"mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)",
|
||||||
|
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
|
||||||
|
"php-console/php-console": "Allow sending log messages to Google Chrome",
|
||||||
|
"rollbar/rollbar": "Allow sending log messages to Rollbar",
|
||||||
|
"ruflin/elastica": "Allow sending log messages to an Elastic Search server"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Monolog\\": "src/Monolog"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Jordi Boggiano",
|
||||||
|
"email": "j.boggiano@seld.be",
|
||||||
|
"homepage": "https://seld.be"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
||||||
|
"homepage": "https://github.com/Seldaek/monolog",
|
||||||
|
"keywords": [
|
||||||
|
"log",
|
||||||
|
"logging",
|
||||||
|
"psr-3"
|
||||||
|
],
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Seldaek",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2020-10-29T15:43:01+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "petrknap/php-singleton",
|
||||||
|
"version": "v1.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/petrknap/php-singleton.git",
|
||||||
|
"reference": "dec131d0d6c72dd76b5a5c7940f04f14f5df7a20"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/petrknap/php-singleton/zipball/dec131d0d6c72dd76b5a5c7940f04f14f5df7a20",
|
||||||
|
"reference": "dec131d0d6c72dd76b5a5c7940f04f14f5df7a20",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.4"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "4.*"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"PetrKnap\\Php\\Singleton\\": "src/Singleton"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Petr Knap",
|
||||||
|
"email": "dev@petrknap.cz",
|
||||||
|
"homepage": "http://petrknap.cz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Singleton pattern for PHP",
|
||||||
|
"homepage": "https://github.com/petrknap/php-singleton",
|
||||||
|
"time": "2016-09-22T07:59:18+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "psr/log",
|
||||||
|
"version": "dev-master",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-fig/log.git",
|
||||||
|
"reference": "dd738d0b4491f32725492cf345f6b501f5922fec"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-fig/log/zipball/dd738d0b4491f32725492cf345f6b501f5922fec",
|
||||||
|
"reference": "dd738d0b4491f32725492cf345f6b501f5922fec",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.1.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Psr\\Log\\": "Psr/Log/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "PHP-FIG",
|
||||||
|
"homepage": "https://www.php-fig.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Common interface for logging libraries",
|
||||||
|
"homepage": "https://github.com/php-fig/log",
|
||||||
|
"keywords": [
|
||||||
|
"log",
|
||||||
|
"psr",
|
||||||
|
"psr-3"
|
||||||
|
],
|
||||||
|
"time": "2020-09-18T06:44:51+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packages-dev": [],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": {
|
||||||
|
"php": "^7.2"
|
||||||
|
},
|
||||||
|
"platform-dev": [],
|
||||||
|
"plugin-api-version": "1.1.0"
|
||||||
|
}
|
Loading…
Reference in New Issue