Skip to content

Commit b491e64

Browse files
committed
Update console line tools docs
1 parent cc33793 commit b491e64

15 files changed

+95
-70
lines changed

docs/framework/console-line-tool.md

Lines changed: 95 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,110 @@ The CLI component is available in `bin/console` file, you can watch listed comma
88
bin/console
99
````
1010

11-
![Command list](/../images/cli-list.jpg)
11+
![Command list](/../images/cli-list.png)
1212

1313
## Show Container Command
1414

15-
````php
16-
bin console config:show:container
17-
````
18-
![Show container command](/../images/cli-show-container.jpg)
15+
Shows all configured dependencies in a table.
16+
17+
```bash
18+
bin/console config:show:container
19+
```
20+
![Show container command](/../images/cli-show-container.png)
1921

2022
## Clear Config Cache
2123

22-
````php
23-
bin console config:clear-cache
24-
````
24+
Removes all files at configured cache directory, by default in keys 'config_cache_path' and '''cli_config_cache_path'.
25+
26+
```bash
27+
bin/console config:clear-cache
28+
```
29+
![Clear Config Cache command](/../images/clear-config-cache.png)
30+
31+
## Development mode
32+
33+
Enables and disables development mode.
34+
35+
### Enable Development mode
36+
37+
```bash
38+
bin/console config:development-mode
39+
```
40+
![Enable Development Mode command](/../images/enable-development-mode.png)
41+
42+
### Disable Development mode
43+
44+
```bash
45+
bin/console config:development-mode --disable=true
46+
```
47+
![Disable Development Mode command](/../images/disable-development-mode.png)
48+
49+
## Maker Commands
50+
51+
It has a set of useful CLI commands to facilitate the creation of different types of classes.
52+
53+
### Make PSR-7 Request Handler
54+
55+
Generates an instance of Psr\Http\Server\RequestHandlerInterface and allocates in its place on the filesystem
56+
respecting the given full qualified classname
57+
58+
```bash
59+
bin/console make:request-handler 'App\Application\Http\Handler\TestRequestHandler'
60+
```
61+
![Make Request Handler command](/../images/make-request-handler.png)
62+
63+
### Make PSR-15 Middleware
64+
65+
Generates an instance of Psr\Http\Server\MiddlewareInterface and allocates in its place on the filesystem
66+
respecting the given full qualified classname
67+
68+
```bash
69+
bin/console make:middleware 'App\Application\Http\Middleware\TestMiddleware'
70+
```
71+
![Make Middleware command](/../images/make-middleware.png)
72+
73+
### Make Invokable Factory
74+
75+
Generates an invokable factory and allocates in its place on the filesystem respecting the given full qualified classname
76+
77+
```bash
78+
bin/console make:factory 'App\Container\SomeFactory'
79+
```
80+
![Make Factory command](/../images/make-factory.png)
81+
82+
### Make PSR-14 Compatible Event
83+
84+
Generates an instance of Psr\EventDispatcher\StoppableEventInterface and allocates in its place on the filesystem
85+
respecting the given full qualified classname
86+
87+
```bash
88+
bin/console make:event 'App\Domain\Event\SomethingOccurred'
89+
```
90+
![Make Event command](/../images/make-event.png)
91+
92+
### Make Event Listener
93+
94+
Generates an event listener class for given event name, and allocates in its place on the filesystem
95+
respecting the given full qualified classname
96+
97+
```bash
98+
bin/console make:event-listener 'App\Application\Service\SomeEventListener' 'App\Domain\Event\SomethingOccurred'
99+
```
100+
![Make Event Listener command](/../images/make-event-listener.png)
101+
102+
### Make Symfony Console Command
103+
104+
Generates a command class compatible with Symfony console, and allocates in its place on the filesystem
105+
respecting the given full qualified classname
106+
107+
```bash
108+
bin/console make:event-listener 'App\Application\Service\SomeEventListener' 'App\Domain\Event\SomethingOccurred'
109+
```
110+
![Make Console Command command](/../images/make-console-command.png)
25111

26112
## Custom Console Command
27113

28-
Console tool is built in on top of Symfony Console Component, to createnew command you need to extend from Symfony
114+
The Console tool, built in on top of Symfony Console Component, to create new command you need to extend from Symfony
29115
Console Command Class
30116

31117
````php

docs/images/clear-config-cache.png

8.58 KB
Loading

docs/images/cli-list.jpg

-49.7 KB
Binary file not shown.

docs/images/cli-list.png

76.9 KB
Loading

docs/images/cli-show-container.jpg

-229 KB
Binary file not shown.

docs/images/cli-show-container.png

130 KB
Loading
7.52 KB
Loading
12.9 KB
Loading

docs/images/make-console-command.png

10.1 KB
Loading

docs/images/make-event-listener.png

11.4 KB
Loading

0 commit comments

Comments
 (0)