Skip to content

Commit

Permalink
add app console
Browse files Browse the repository at this point in the history
  • Loading branch information
steevenz committed Jun 22, 2020
1 parent 12b2ebe commit 9b2fbb2
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Cli Application",
"created": "29 January 2018",
"version": "1.0.0",
"description": "Cli application example",
"copyright": "Copyright (c) 2018 - Steeve Andrian Salim",
"authors": [
{
"name": "Steeve Andrian Salim",
"email": "steevenz@ymail.com",
"homepage": "http://o2system.id",
"role": "Founder"
}
],
"support": {
"email": "support@o2system.id",
"issues": "https://o2system.id/support"
},
"links": {
"info": "http://www.o2system.id/about",
"wiki": "http://www.o2system.id/wiki"
}
}
44 changes: 44 additions & 0 deletions app/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* This file is part of the O2System PHP Framework package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Steeve Andrian Salim
* @copyright Copyright (c) Steeve Andrian Salim
*/
// ------------------------------------------------------------------------

require_once '../cli.php';

/*
* ------------------------------------------------------
* CREATE APP
* ------------------------------------------------------
*/

// Commander
// php o2system commander/method --option --

$welcomeNote = <<<WELCOME_NOTE
( (
)\ )\ (
(((_) ( ( ( ( ((_) ))\
)\___ )\ )\ ) )\ )\ _ /((_)
((/ __| ((_) _(_/( ((_) ((_)| |(_))
| (__ / _ \| ' \))(_-</ _ \| |/ -_)
\___|\___/|_||_| /__/\___/|_|\___|
WELCOME_NOTE;

$cliApp = new O2System\Framework\Cli\App();
$cliApp
->setWelcomeNote( ( new \O2System\Kernel\Cli\Writers\Text )
->setContextualClass( \O2System\Kernel\Cli\Writers\Text::DANGER )
->setString( $welcomeNote )
)
->setName( 'Cli Application' )
->setVersion( '1.0.0' )
->setCommandersNamespace( '\App\Commanders' )
->setCommandersPath( PATH_APP . 'Commanders' )
->run();

0 comments on commit 9b2fbb2

Please sign in to comment.