You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,38 +15,44 @@
15
15
16
16
DotKernel component to build console applications based on [laminas-cli](https://github.com/laminas/laminas-cli).
17
17
18
-
### Requirements
18
+
## Requirements
19
+
19
20
- PHP >= 8.2
20
21
- laminas/laminas-servicemanager >= 3.11,
21
22
- laminas/laminas-cli >= 1.4
22
23
24
+
## Setup
25
+
26
+
### 1. Install package
23
27
24
-
### Setup
25
-
#### 1. Install package
26
28
Run the following command in your application's root directory:
27
29
28
30
composer require dotkernel/dot-cli
29
31
30
-
#### 2. Register ConfigProvider
32
+
### 2. Register ConfigProvider
33
+
31
34
Open your application's `config/config.php` and the following line under the _DK packages_ comment:
32
35
33
36
Dot\Cli\ConfigProvider::class,
34
37
35
-
#### 3. Copy bootstrap file
38
+
### 3. Copy bootstrap file
39
+
36
40
Locate file `bin/cli.php` in this package, then copy it to your application's `bin/` directory.
37
41
This is the bootstrap file you will use to execute your commands with.
38
42
39
-
#### 4. Copy config file
43
+
### 4. Copy config file
44
+
40
45
Locate in this package the following file `config/autoload/cli.global.php` then copy it to your application's `config/autoload/` directory.
41
46
This is the config file you will add your commands to.
42
47
48
+
## Testing
43
49
44
-
### Testing
45
50
Using the command line, go to your application's root directory, then type the following command:
46
51
47
52
php /bin/cli.php
48
53
49
54
The output should look similar to this, containing information on how to start using dot-cli:
55
+
50
56
```text
51
57
DotKernel CLI 1.0.0
52
58
@@ -68,20 +74,26 @@ Available commands:
68
74
demo
69
75
demo:command Demo command description.
70
76
```
77
+
71
78
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.
72
79
For more information, see [laminas-cli documentation](https://docs.laminas.dev/laminas-cli/).
Adapt the command to your specifications by replacing **7.4** with your PHP version and **example.com** with your domain name.
83
94
84
95
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).
0 commit comments