Skip to content

Commit e922a4a

Browse files
authored
Merge pull request #4 from cherry-framework/develop
Develop
2 parents a38c381 + 92cfdf6 commit e922a4a

File tree

11 files changed

+307
-63
lines changed

11 files changed

+307
-63
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# Cherry-Console Changelog
22

3-
## [v1.0.0](https://github.com/cherry-framework/logs-viewer/releases/tag/v1.0.0 "v1.0.0") (2019-04-8)
3+
## [v1.5.0](https://github.com/cherry-framework/console/releases/tag/v1.5.0 "v1.5.0") (2019-04-21)
4+
5+
- Use color constants for output color definition;
6+
- Use Cherry Kernel;
7+
- Define Development Server Web Path from Config file;
8+
9+
## [v1.0.0](https://github.com/cherry-framework/console/releases/tag/v1.0.0 "v1.0.0") (2019-04-08)
410
#### The first stable version
511

612
- Package available on: `composer require cherry-project/console`
713
- Output text styling
814
- Available commands:
915

1016
- server - Run PHP Development server
11-

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CLI Console for Cherry-project.
44

55
[![GitHub license](https://img.shields.io/github/license/cherry-framework/console.svg)](https://github.com/cherry-framework/console/blob/master/LICENSE)
66

7-
[![GitHub release](https://img.shields.io/github/release/cherry-framework/console.svg)](https://github.com/console/logs-viewer/releases)
7+
[![GitHub release](https://img.shields.io/github/release/cherry-framework/console.svg)](https://github.com/cherry-framework/console/releases)
88

99
[![Packagist Version](https://img.shields.io/packagist/v/cherry-project/console.svg "Packagist Version")](https://packagist.org/packages/cherry-project/console "Packagist Version")
1010

@@ -25,14 +25,17 @@ require_once __DIR__ . '/vendor/autoload.php';
2525

2626
## Usage
2727

28-
Import class
28+
Import classes
2929

3030
```php
3131
use Cherry\Console\Console;
32+
use Cherry\Kernel;
3233
```
3334

34-
Create new console instance
35+
Create new Kernel and Console instance
3536
```php
37+
$app = new Kernel(__DIR__);
38+
3639
$console = new Console();
3740
```
3841

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
],
1616
"minimum-stability": "dev",
1717
"require": {
18-
"php": ">=5.6.0"
18+
"php": ">=5.6.0",
19+
"cherry-project/core": "^1.5"
1920
},
2021
"autoload": {
2122
"psr-4": {

composer.lock

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

examples/config/config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ROUTES_FILE": "",
3+
"CONTROLLERS_PATH": "",
4+
"TEMPLATES_PATH": "",
5+
"LOGS_PATH": "",
6+
"WEB_ROOT": "/"
7+
}

examples/console

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
require __DIR__ . '/../vendor/autoload.php';
55

66
use Cherry\Console\Console;
7+
use Cherry\Kernel;
8+
9+
$app = new Kernel(__DIR__);
710

811
$console = new Console();

examples/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
echo "Hello, World!";

examples/output.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
require __DIR__ . '/../vendor/autoload.php';
4+
5+
use Cherry\Console\Output\Output;
6+
7+
$out = new Output();
8+
9+
echo $out->text('Text');
10+
echo $out->info('Info');
11+
echo $out->success('Success');
12+
echo $out->warning('Warning');
13+
echo $out->danger('Danger');

src/Console/Console.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@ private function _server()
155155
print $this->_output
156156
->text($info);
157157

158-
echo exec("php -S {$server} -t " . dirname(dirname(__DIR__)));
158+
echo exec("php -S {$server} -t " . WEB_ROOT);
159159
}
160-
}
160+
}

0 commit comments

Comments
 (0)