Skip to content

Commit cac5247

Browse files
committed
Merge branch '3.x'
# Conflicts: # .github/workflows/php.yml # src/AbstractHandler.php # src/Application.php # src/Console.php # src/Contract/InputFlagInterface.php # src/Controller.php # src/Flag/Argument.php # src/Flag/CmdArgumentsTrait.php # src/Flag/Flag.php # src/Flag/FlagException.php # src/Flag/Option.php # src/IO/AbstractInput.php # src/IO/Input.php # test/BaseTestCase.php
2 parents 1d8d724 + a9a98f2 commit cac5247

File tree

99 files changed

+2786
-1588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2786
-1588
lines changed

.github/changelog.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
options:
2+
title: '## Change Log'
3+
style: gh-release
4+
filters:
5+
# message length >= 12
6+
- name: msgLen
7+
minLen: 12
8+
# message words >= 3
9+
- name: wordsLen
10+
minLen: 3
11+
- name: keywords
12+
keywords: ['format code']
13+
exclude: true
14+
15+
# not matched will use 'Other' group.
16+
groups:
17+
- name: New
18+
keywords: [add, new]
19+
- name: Fixed
20+
startWiths: [add, new]
21+
keywords: [add, new]
22+
- name: Feat
23+
startWiths: [feat]
24+
keywords: [feature]
25+
- name: Update
26+
startWiths: [update, 'up:']
27+
keywords: [update]

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
# Check for updates to GitHub Actions every weekday
13+
interval: "daily"

.github/workflows/php.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ jobs:
1515
strategy:
1616
fail-fast: true
1717
matrix:
18-
php: [7.2, 7.3, 7.4] #
18+
php: [7.3, 7.4, 8.0] #
1919
os: [ubuntu-latest, macOS-latest] # windows-latest,
20+
include:
21+
- os: 'ubuntu-latest'
22+
php: '7.2'
23+
phpunit: '8.5.13'
2024

2125
steps:
2226
- name: Checkout
@@ -37,7 +41,7 @@ jobs:
3741
uses: shivammathur/setup-php@v2
3842
with:
3943
php-version: ${{ matrix.php}}
40-
tools: pecl, php-cs-fixer, phpunit
44+
tools: pecl, php-cs-fixer, phpunit:${{ matrix.phpunit }}
4145
extensions: mbstring, dom, fileinfo, mysql, openssl, igbinary, redis # , swoole-4.4.19 #optional, setup extensions
4246
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
4347
coverage: none #optional, setup coverage driver: xdebug, none
@@ -49,4 +53,4 @@ jobs:
4953
# Docs: https://getcomposer.org/doc/articles/scripts.md
5054

5155
- name: Run unit tests
52-
run: php vendor/bin/phpunit
56+
run: phpunit -vv

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
.idea/
66
.phpintel/
7+
.phpdoc/
8+
docs/api/
79
caches/
810
vendor/
911
!README.md

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,24 @@
22

33
## v4.0.x
44

5-
> begin at: 2020.08.21
5+
> begin at: 2020.08.21, branch `master`
66
7+
## v3.1.21
8+
9+
## v3.1.20
10+
11+
**update**
12+
13+
- update some for error tips and single list
14+
- add before/after methods on run controller method.
15+
- support controller object cache on repeat fetch
16+
- enhance built in php serve util logic
17+
18+
## v3.1.19
19+
20+
> publish at 2021.04.20
21+
22+
- up: use `Str::padByWidth` support zh-CN words on render table/list/panel
723

824
## v3.0.x
925

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55
[![Latest Stable Version](http://img.shields.io/packagist/v/inhere/console.svg)](https://packagist.org/packages/inhere/console)
66
[![Github Actions Status](https://github.com/inhere/php-console/workflows/Unit-tests/badge.svg)](https://github.com/inhere/php-console/actions)
77

8-
A simple, full-featured php command line application library.
8+
Full-featured php command line application library.
99

1010
Provide console parameter parsing, command run, color style output, user information interaction, and special format information display.
1111

1212
> **[中文README](./README.zh-CN.md)**
1313
1414
## Command line preview
1515

16-
![app-command-list](https://raw.githubusercontent.com/inhere/php-console/master/docs/screenshots/app-command-list.png)
16+
![app-command-list](https://raw.githubusercontent.com/inhere/php-console/3.x/docs/screenshots/app-command-list.png)
1717

1818
## Features
1919

2020
> Easy to use. Can be easily integrated into any existing project.
2121
2222
- Command line application, `controller`, `command` parsing run on the command line
23-
- Support for setting aliases for commands. A command can have multiple aliases. Support command display/hide, enable/disable
23+
- Support for setting aliases for commands. A command can have multiple aliases.
24+
- Support command display/hide, enable/disable.
2425
- Full-featured command line option parameter parsing (named parameters, short options `-s`, long options `--long`).
2526
- The `input`, `output` of the command line, management, use
2627
- Command method comments are automatically parsed as help information (by default, `@usage` `@arguments` `@options` `@example`)
@@ -82,11 +83,30 @@ phpunit
8283
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text
8384
```
8485

86+
## Debuging
87+
88+
You can set debug level by ENV `CONSOLE_DEBUG=level`, global option `--debug level`
89+
90+
```bash
91+
# by ENV
92+
$ CONSOLE_DEBUG=4 php examples/app
93+
$ CONSOLE_DEBUG=5 php examples/app
94+
# by global options
95+
$ php examples/app --debug 4
96+
```
97+
98+
## Project use
99+
100+
Check out these projects, which use https://github.com/inhere/php-console :
101+
102+
- [kite](https://github.com/inhere/kite) Kite is a tool for help development.
103+
- More, please see [github used by](https://github.com/inhere/php-console/network/dependents?package_id=UGFja2FnZS01NDI5NzMxOTI%3D)
104+
85105
## License
86106

87107
[MIT](LICENSE)
88108

89-
## My other projects
109+
## My projects
90110

91111
- [inhere/php-validate](https://github.com/inhere/php-validate) A compact and full-featured php verification library
92112
- [inhere/sroute](https://github.com/inhere/php-srouter) Lightweight and fast HTTP request routing library

README.zh-CN.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
## 命令行预览
1313

14-
![app-command-list](https://raw.githubusercontent.com/inhere/php-console/master/docs/screenshots/app-command-list.png)
14+
![app-command-list](https://raw.githubusercontent.com/inhere/php-console/3.x/docs/screenshots/app-command-list.png)
1515

1616
## 功能概览
1717

@@ -79,6 +79,25 @@ phpunit
7979
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text
8080
```
8181

82+
## 开发调试
83+
84+
你可以通过环境变量 `CONSOLE_DEBUG=level`, 全局选项 `--debug level` 设置debug级别
85+
86+
```bash
87+
# by ENV
88+
$ CONSOLE_DEBUG=4 php examples/app
89+
$ CONSOLE_DEBUG=5 php examples/app
90+
# by global options
91+
$ php examples/app --debug 4
92+
```
93+
94+
## 使用console的项目
95+
96+
看看这些使用了 https://github.com/inhere/php-console 的项目:
97+
98+
- [kite](https://github.com/inhere/kite) PHP编写的,方便本地开发和使用的一些CLI工具应用
99+
- More, please see [github used by](https://github.com/inhere/php-console/network/dependents?package_id=UGFja2FnZS01NDI5NzMxOTI%3D)
100+
82101
## License
83102

84103
[MIT](LICENSE)

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
"require": {
2525
"php": ">7.2.0",
2626
"toolkit/cli-utils": "~1.0",
27+
"toolkit/pflag": "~1.0",
2728
"toolkit/stdlib": "~1.0",
2829
"toolkit/sys-utils": "~1.0"
2930
},
3031
"require-dev": {
31-
"phpunit/phpunit": "~9.1"
32+
"phpunit/phpunit": "^8.5 || ^9.1"
3233
},
3334
"autoload": {
3435
"psr-4": {
260 KB
Loading

examples/Command/CorCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CorCommand extends Command
3030
*/
3131
public static function aliases(): array
3232
{
33-
return ['coro'];
33+
return ['co', 'coro'];
3434
}
3535

3636
/**

0 commit comments

Comments
 (0)