Skip to content

Commit 79791d0

Browse files
author
Andrei Onita
committed
format according to QA Checks
1 parent 73cef2e commit 79791d0

4 files changed

Lines changed: 30 additions & 26 deletions

File tree

docs/book/v3/configuration.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
# Configuration
22

3-
### Register ConfigProvider
3+
## Register ConfigProvider
44

55
After installation, register `dot-cli` in your project by adding the below line to your configuration aggregator (usually: `config/config.php`):
66

77
Dot\Cli\ConfigProvider::class,
88

9-
### Copy bootstrap file
9+
## Copy bootstrap file
1010

1111
Locate file `bin/cli.php` in this package, then copy it to your application's `bin/` directory.
1212
This is the bootstrap file you will use to execute your commands with.
1313

14-
### Copy config file
14+
## Copy config file
15+
1516
Locate in this package the following file `config/autoload/cli.global.php` then copy it to your application's `config/autoload/` directory.
1617
This is the config file you will add your commands under the `commands` key, as in the following example:
1718

18-
```php
1919
'commands' => [
2020
DemoCommand::getDefaultName() => DemoCommand::class,
2121
ExampleCommand::getDefaultName() => ExampleCommand::class,
2222
],
23-
```
24-
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# Setting up as cronjob
2+
23
```text
34
* * * * * /opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/httpdocs/bin/cli.php demo:command -q
45
```
6+
57
or
8+
69
```text
710
* * * * * cd /var/www/vhosts/example.com/httpdocs/bin && /opt/plesk/php/7.4/bin/php ./cli.php demo:command -q
811
```
12+
913
Adapt the command to your specifications by replacing **7.4** with your PHP version and **example.com** with your domain name.
1014

1115
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).

docs/book/v3/testing.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
# Testing
2+
23
Using the command line, go to your application's root directory, then type the following command:
34

45
php /bin/cli.php
56

67
The output should look similar to this, containing information on how to start using dot-cli:
7-
```text
8-
DotKernel CLI 1.0.0
9-
10-
Usage:
11-
command [options] [arguments]
128

13-
Options:
14-
-h, --help Display help for the given command. When no command is given display help for the list command
15-
-q, --quiet Do not output any message
16-
-V, --version Display this application version
17-
--ansi Force ANSI output
18-
--no-ansi Disable ANSI output
19-
-n, --no-interaction Do not ask any interactive question
20-
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
9+
DotKernel CLI 1.0.0
10+
11+
Usage:
12+
command [options] [arguments]
13+
14+
Options:
15+
-h, --help Display help for the given command. When no command is given display help for the list command
16+
-q, --quiet Do not output any message
17+
-V, --version Display this application version
18+
--ansi Force ANSI output
19+
--no-ansi Disable ANSI output
20+
-n, --no-interaction Do not ask any interactive question
21+
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
22+
23+
Available commands:
24+
help Display help for a command
25+
list List commands
26+
demo
27+
demo:command Demo command description.
2128

22-
Available commands:
23-
help Display help for a command
24-
list List commands
25-
demo
26-
demo:command Demo command description.
27-
```
2829
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.
2930
For more information, see [laminas-cli documentation](https://docs.laminas.dev/laminas-cli/).

docs/book/v3/usage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Use `src/Command/DemoCommand.php` as an example when creating a new command.
44
Update the name & description in the `AsCommand` attribute as needed.
55
Also update the `$defaultName` property and the description set inside the `configure` method to match the `AsCommand` attribute.
66

7-
### Running
7+
## Running
8+
89
Using the command line, go to your application's root directory, then type the following command:
910

1011
php /bin/cli.php demo:command

0 commit comments

Comments
 (0)