Skip to content

Commit 3e427f9

Browse files
authored
Merge pull request #30 from OnitaAndrei/issue-29
Added documentation for v3
2 parents ab7f4bf + 8da7a56 commit 3e427f9

File tree

15 files changed

+213
-175
lines changed

15 files changed

+213
-175
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
tags:
8+
9+
jobs:
10+
ci:
11+
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected]

.github/workflows/cs-tests.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/docs-build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: docs-build
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Build Docs
13+
uses: dotkernel/documentation-theme/github-actions/docs@main
14+
env:
15+
DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,73 +15,79 @@
1515

1616
DotKernel component to build console applications based on [laminas-cli](https://github.com/laminas/laminas-cli).
1717

18-
### Requirements
18+
## Requirements
19+
1920
- PHP >= 8.2
2021
- laminas/laminas-servicemanager >= 3.11,
2122
- laminas/laminas-cli >= 1.4
2223

24+
## Setup
25+
26+
### 1. Install package
2327

24-
### Setup
25-
#### 1. Install package
2628
Run the following command in your application's root directory:
2729

2830
composer require dotkernel/dot-cli
2931

30-
#### 2. Register ConfigProvider
32+
### 2. Register ConfigProvider
33+
3134
Open your application's `config/config.php` and the following line under the _DK packages_ comment:
3235

3336
Dot\Cli\ConfigProvider::class,
3437

35-
#### 3. Copy bootstrap file
38+
### 3. Copy bootstrap file
39+
3640
Locate file `bin/cli.php` in this package, then copy it to your application's `bin/` directory.
3741
This is the bootstrap file you will use to execute your commands with.
3842

39-
#### 4. Copy config file
43+
### 4. Copy config file
44+
4045
Locate in this package the following file `config/autoload/cli.global.php` then copy it to your application's `config/autoload/` directory.
4146
This is the config file you will add your commands to.
4247

48+
## Testing
4349

44-
### Testing
4550
Using the command line, go to your application's root directory, then type the following command:
4651

4752
php /bin/cli.php
4853

4954
The output should look similar to this, containing information on how to start using dot-cli:
50-
```text
51-
DotKernel CLI 1.0.0
52-
53-
Usage:
54-
command [options] [arguments]
55-
56-
Options:
57-
-h, --help Display help for the given command. When no command is given display help for the list command
58-
-q, --quiet Do not output any message
59-
-V, --version Display this application version
60-
--ansi Force ANSI output
61-
--no-ansi Disable ANSI output
62-
-n, --no-interaction Do not ask any interactive question
63-
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
64-
65-
Available commands:
66-
help Display help for a command
67-
list List commands
68-
demo
69-
demo:command Demo command description.
70-
```
55+
56+
DotKernel CLI 1.0.0
57+
58+
Usage:
59+
command [options] [arguments]
60+
61+
Options:
62+
-h, --help Display help for the given command. When no command is given display help for the list command
63+
-q, --quiet Do not output any message
64+
-V, --version Display this application version
65+
--ansi Force ANSI output
66+
--no-ansi Disable ANSI output
67+
-n, --no-interaction Do not ask any interactive question
68+
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
69+
70+
Available commands:
71+
help Display help for a command
72+
list List commands
73+
demo
74+
demo:command Demo command description.
75+
7176
As shown in `config/autoload/cli.global.php`, dot-cli includes a demo command `demo:command` that will help you understand the basics of creating a new command.
7277
For more information, see [laminas-cli documentation](https://docs.laminas.dev/laminas-cli/).
7378

74-
### Setting up as cronjob
75-
```text
76-
* * * * * /opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/httpdocs/bin/cli.php demo:command -q
77-
```
79+
## Setting up as cronjob
80+
81+
* * * * * /opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/httpdocs/bin/cli.php demo:command -q
82+
7883
or
79-
```text
80-
* * * * * cd /var/www/vhosts/example.com/httpdocs/bin && /opt/plesk/php/7.4/bin/php ./cli.php demo:command -q
81-
```
84+
85+
* * * * * cd /var/www/vhosts/example.com/httpdocs/bin && /opt/plesk/php/7.4/bin/php ./cli.php demo:command -q
86+
8287
Adapt the command to your specifications by replacing **7.4** with your PHP version and **example.com** with your domain name.
8388

8489
Note the **-q** (or **--quiet**) option at the end of the command - it serves as a flag to inform the Application that no output should be returned (unless it's an error).
8590

8691
## License
92+
8793
MIT

SECURITY.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
6+
| Version | Supported | PHP Version |
7+
|---------|--------------------|---------------------------------------------------------------------------------------------------------|
8+
| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-cli/3.4.2) |
9+
| <= 2.x | :x: | |
10+
11+
12+
## Reporting Potential Security Issues
13+
14+
If you have encountered a potential security vulnerability in this project,
15+
please report it to us at <[email protected]>. We will work with you to
16+
verify the vulnerability and patch it.
17+
18+
When reporting issues, please provide the following information:
19+
20+
- Component(s) affected
21+
- A description indicating how to reproduce the issue
22+
- A summary of the security vulnerability and impact
23+
24+
We request that you contact us via the email address above and give the
25+
project contributors a chance to resolve the vulnerability and issue a new
26+
release prior to any public exposure; this helps protect the project's
27+
users, and provides them with a chance to upgrade and/or update in order to
28+
protect their applications.
29+
30+
31+
## Policy
32+
33+
If we verify a reported security vulnerability, our policy is:
34+
35+
- We will patch the current release branch, as well as the immediate prior minor
36+
release branch.
37+
38+
- After patching the release branches, we will immediately issue new security
39+
fix releases for each patched release branch.
40+

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"require-dev": {
3737
"laminas/laminas-coding-standard": "^2.5",
38-
"mikey179/vfsstream": "^1.6",
38+
"mikey179/vfsstream": "^1.6.7",
3939
"phpunit/phpunit": "^10.2",
4040
"vimeo/psalm": "^5.13"
4141
},

docs/book/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

docs/book/v3/configuration.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Configuration
2+
3+
## Register ConfigProvider
4+
5+
After installation, register `dot-cli` in your project by adding the below line to your configuration aggregator (usually: `config/config.php`):
6+
7+
Dot\Cli\ConfigProvider::class,
8+
9+
## Copy bootstrap file
10+
11+
Locate file `bin/cli.php` in this package, then copy it to your application's `bin/` directory.
12+
This is the bootstrap file you will use to execute your commands with.
13+
14+
## Copy config file
15+
16+
Locate in this package the following file `config/autoload/cli.global.php` then copy it to your application's `config/autoload/` directory.
17+
This is the config file you will add your commands under the `commands` key, as in the following example:
18+
19+
'commands' => [
20+
DemoCommand::getDefaultName() => DemoCommand::class,
21+
ExampleCommand::getDefaultName() => ExampleCommand::class,
22+
],

0 commit comments

Comments
 (0)