Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme files. #19

Merged
merged 3 commits into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions .docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extensions:
```

The extension will look for all commands extending from [`Symfony\Component\Console\Command\Command`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Command/Command.php) and automatically add them to the console application.
That's all. You don't have to be worried about anything else.
That's all. You don't have to worry about anything else.

## Configuration

Expand All @@ -30,7 +30,7 @@ console:
helperSet: @customHelperSet
```

In fact in SAPI (CLI) mode there is no http request and thus no URL address. This inconvenience you have to solve by yourselve. Well, via `console.url` option.
In SAPI (CLI) mode there is no http request and thus no URL address. This is an inconvenience you have to solve by yourself - via the `console.url` option.

```yaml
console:
Expand All @@ -40,7 +40,7 @@ console:
### HelperSet

You could also define you custom `helperSet` just in case. There are 2 possible approaches. You can register your
`App\Model\MyCustomHelperSet` as services under `services` section or provide it directly to extesion config `helperSet`.
`App\Model\MyCustomHelperSet` as a service under the `services` section or provide it directly to the extension config `helperSet`.

Already defined service:

Expand All @@ -59,8 +59,8 @@ console:
helperSet: App\Model\MyCustomHelperSet
```

By default helperSet contains 5 helpers, 4 defined in `Symfony\Component\Console\Application` by default and 1 defined
by extension itself. In case of need you're able to add more helpers.
By default, helperSet contains 5 helpers - 4 defined in `Symfony\Component\Console\Application` and 1 defined
by the extension itself. You can add more helpers, if needed.

```yaml
console:
Expand All @@ -70,17 +70,17 @@ console:

### Lazy-loading

From version 3.4 of Symfony\Console uses command lazy-loading. This extension fully supports this feature and
you can enable it in NEON file.
From version 3.4 `Symfony\Console` uses command lazy-loading. This extension fully supports this feature and
you can enable it in the NEON file.

```yaml
console:
lazy: true
```

From this point, all commands are instanced only if needed. Don't forget, that listing all commands will instance all of them.
From this point forward, all commands are instantiated only if needed. Don't forget that listing all commands will instantiate them all.

How to define command names? Define `$defaultName` in command or via `console.command` tag on the service.
How to define command names? Define `$defaultName` in the command or via the `console.command` tag on the service.

```php
use Symfony\Component\Console\Command\Command;
Expand All @@ -91,7 +91,7 @@ class FooCommand extends Command
}
```

Or via service tag.
Or via a service tag.

```yaml
services:
Expand Down Expand Up @@ -135,15 +135,15 @@ services:
- App\Console\FooCommand
```

Maybe you will have to flush `temp/cache` directory.
Maybe you will have to flush the `temp/cache` directory.

## Entrypoint

The very last piece of puzzle is console entrypoit. It is simple scripts loading DI container and fire `Contributte\Console\Application::run`.
The very last piece of the puzzle is the console entrypoit. It is a simple script that loads the DI container and fires `Contributte\Console\Application::run`.

You can copy & paste to your projects, for example to `<root>/bin/console`.
You can copy & paste it to your project, for example to `<root>/bin/console`.

Make sure you set as executable. `chmod +x <root>/bin/console`.
Make sure to set it as executable. `chmod +x <root>/bin/console`.

```php
#!/usr/bin/env php
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Console

Ultra easy-to-use [`Symfony\Console`](https://github.com/symfony/console) to [`Nette Framework`](https://github.com/nette/).
Ultra easy-to-use [`Symfony\Console`](https://github.com/symfony/console) implementation for [`Nette Framework`](https://github.com/nette/).

-----

Expand Down