Skip to content

Commit 1fa9106

Browse files
committed
Add base structure
0 parents  commit 1fa9106

File tree

8 files changed

+122
-0
lines changed

8 files changed

+122
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor
2+
.idea

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Temuri Takalandze
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Cherry-Console
2+
CLI Console for Cherry-project.
3+
4+
**2019 © Cherry-project**

composer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "cherry-project/console",
3+
"description": "CLI Console for Cherry-project",
4+
"type": "library",
5+
"keywords": ["cherry","console"],
6+
"homepage": "https://github.com/cherry-framework/console",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "ABGEO",
11+
"email": "[email protected]",
12+
"homepage": "http://www.abgeo.ga",
13+
"role": "Developer"
14+
}
15+
],
16+
"minimum-stability": "dev",
17+
"require": {
18+
"php": ">=5.6.0"
19+
},
20+
"autoload": {
21+
"psr-4": {
22+
"Cherry\\": "src/"
23+
}
24+
}
25+
}

composer.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/console

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
set_time_limit(0);
5+
6+
require __DIR__ . '/../vendor/autoload.php';
7+
8+
use Cherry\Console\ArgvInput;
9+
use Cherry\Console\Console;
10+
11+
$console = new Console(new ArgvInput());

src/Console/ArgvInput.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Cherry\Console;
4+
5+
class ArgvInput
6+
{
7+
private $_argv;
8+
9+
public function __construct()
10+
{
11+
$argv = $_SERVER['argv'];
12+
13+
// Strip the application name
14+
array_shift($argv);
15+
16+
$this->_argv = $argv;
17+
}
18+
19+
public function getArgv()
20+
{
21+
return $this->_argv;
22+
}
23+
}

src/Console/Console.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Cherry\Console;
4+
5+
class Console
6+
{
7+
private $_argvInput;
8+
private $_argv;
9+
10+
public function __construct(ArgvInput $argvInput)
11+
{
12+
$this->_argvInput = $argvInput;
13+
$this->_argv = $argvInput->getArgv();
14+
15+
var_dump($this->_argv);
16+
}
17+
}

0 commit comments

Comments
 (0)