Arguments

Ce module permet d'interpréter une ligne de command.

Installation

composer require mediashare/kernel
Bash

Usage

<?php
// ./console.php
require 'vendor/autoload.php';
use Mediashare\Kernel\Kernel;

$kernel = new Kernel();
$kernel->run();

$arguments = $kernel->get('Arguments');
$arguments->argv = $argv;
$arguments->run();
$message = $arguments->get('--message');
dump($message);
PHP
php console.php --message "Hello world!"
Bash
array (1)
   0 => "Hello World!" (12)
PHP

MarquandT

Ethical Hacker ~ Web Developper ~ Hosting Provider ~ Crypto Enthusiast ~ Automation Expert Bitcoin donation: 32Uu4NKGnxSPC7UukYXVyRHwbppbQpKVki

Comments

You must login to send a comment.