1
0
mirror of synced 2024-11-24 06:16:27 +03:00

Easiest way to disable the compiler prompt was not mentioned in the documentation (#131)

This commit is contained in:
Pavel 2021-12-13 10:46:08 +03:00 committed by GitHub
parent 8c05f269fa
commit e76bb59970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 14 deletions

View File

@ -46,23 +46,20 @@ Allow these packages to compile? ([y]es, [a]lways, [n]o, [l]ist, [h]elp)
```
That's because the Client uses code generation to speed up serialization and deserialization of models in production. This code should be generated during installation or update. Without that code, the library itself will not work at all.
Just type `y` here and press Enter. The DTO cache will be generated after that.
Choose `[a]lways` by typing `a` and pressing Enter if you don't want to see this message anymore. If you want to approve the compilation task every time - use `[y]es` option. The DTO cache will be generated after that.
**Note:** You should choose `[a]lways` if your application is using CI/CD pipeline because the interactive terminal is not available
in that environment which will result in failure during the dependencies installation.
If you skipped the compilation task - don't worry, it can be executed manually at any time with this command:
```sh
composer compile --all
```
3. **Optional.** Disable compilation prompt that you have seen in the previous step. Run this command to do that:
3. **Optional.** Disable compilation prompt that you have seen in the previous step.
```sh
./vendor/bin/retailcrm-client compiler:prompt
```
Replace `vendor/bin` with your bin directory path if it's different from the default. You can find more information about this step in the [documentation](doc/compilation_prompt.md).
**Note:** You should not skip this step if your application is using CI/CD pipeline because the interactive terminal is not available
in that environment which will result in failure during the dependencies installation.
If you wish to disable the compilation prompt but didn't do that at the previous step - you can disable the prompt manually.
Read the [documentation](doc/compilation_prompt.md) to learn how to do that.
4. Include the autoloader if it's not included, or you didn't use Composer before.
```php

View File

@ -12,15 +12,23 @@ That's because the API client utilizes code generation to speed up the serializa
this prompt may be annoying and sometimes can even break the application lifecycle pipeline (in the CI/CD environment). We can't just
disable it for everyone [because of security concerns](https://github.com/composer/composer/issues/1193). But you can disable it for your project.
There are two ways of disabling this prompt:
1. Automated way.
2. Manual way.
There are three ways of disabling this prompt:
1. During the installation.
2. Automated way.
3. Manual way.
### Disable compilation prompt during the installation
Just choose `[a]lways` option by pressing `a` followed by Enter. This will automatically edit your `composer.json` and will disable
the compilation prompt for you. No additional steps are needed.
### Disable or enable compilation prompt via CLI
For the automated way, you can use `retailcrm-client` CLI utility. It will be in your binary directory. By default, it'll be in the
Alternatively, you can use `retailcrm-client` CLI utility. It will be in your binary directory. By default, it'll be in the
`vendor/bin` directory if not defined otherwise in the composer.json `config.bin-dir` entry.
The only benefit of this utility is the fact that it also can enable the prompt again.
#### Disabling compilation prompt
You can disable the compiler prompt by running this command: