Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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