Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Yii 2 Composer Installer
  2. ========================
  3. This is the composer installer for [Yii framework 2.0](http://www.yiiframework.com) extensions.
  4. It implements a new composer package type named `yii2-extension`,
  5. which should be used by all Yii 2 extensions if they are distributed as composer packages.
  6. For license information check the [LICENSE](LICENSE.md)-file.
  7. [![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-composer/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-composer)
  8. [![Total Downloads](https://poser.pugx.org/yiisoft/yii2-composer/downloads.png)](https://packagist.org/packages/yiisoft/yii2-composer)
  9. Usage
  10. -----
  11. To use Yii 2 composer installer, simply set `type` to be `yii2-extension` in your `composer.json`,
  12. like the following:
  13. ```json
  14. {
  15. "type": "yii2-extension",
  16. "require": {
  17. "yiisoft/yii2": "*"
  18. },
  19. ...
  20. }
  21. ```
  22. You may specify a bootstrapping class in the `extra` section. The `init()` method of the class will be executed each time
  23. the Yii 2 application is responding to a request. For example,
  24. ```json
  25. {
  26. "type": "yii2-extension",
  27. ...,
  28. "extra": {
  29. "bootstrap": "yii\\jui\\Extension"
  30. }
  31. }
  32. ```
  33. The `Installer` class also implements a static method `setPermission()` that can be called after
  34. a Yii 2 projected is installed, through the `post-create-project-cmd` composer script.
  35. The method will set specified directories or files to be writable or executable, depending on
  36. the corresponding parameters set in the `extra` section of the `composer.json` file.
  37. For example,
  38. ```json
  39. {
  40. "name": "yiisoft/yii2-app-basic",
  41. "type": "project",
  42. ...
  43. "scripts": {
  44. "post-create-project-cmd": [
  45. "yii\\composer\\Installer::setPermission"
  46. ]
  47. },
  48. "extra": {
  49. "writable": [
  50. "runtime",
  51. "web/assets"
  52. ],
  53. "executable": [
  54. "yii"
  55. ]
  56. }
  57. }
  58. ```