ScriptEvents.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Script;
  12. /**
  13. * The Script Events.
  14. *
  15. * @author François Pluchino <francois.pluchino@opendisplay.com>
  16. * @author Jordi Boggiano <j.boggiano@seld.be>
  17. */
  18. class ScriptEvents
  19. {
  20. /**
  21. * The PRE_INSTALL_CMD event occurs before the install command is executed.
  22. *
  23. * The event listener method receives a Composer\Script\CommandEvent instance.
  24. *
  25. * @var string
  26. */
  27. const PRE_INSTALL_CMD = 'pre-install-cmd';
  28. /**
  29. * The POST_INSTALL_CMD event occurs after the install command is executed.
  30. *
  31. * The event listener method receives a Composer\Script\CommandEvent instance.
  32. *
  33. * @var string
  34. */
  35. const POST_INSTALL_CMD = 'post-install-cmd';
  36. /**
  37. * The PRE_UPDATE_CMD event occurs before the update command is executed.
  38. *
  39. * The event listener method receives a Composer\Script\CommandEvent instance.
  40. *
  41. * @var string
  42. */
  43. const PRE_UPDATE_CMD = 'pre-update-cmd';
  44. /**
  45. * The POST_UPDATE_CMD event occurs after the update command is executed.
  46. *
  47. * The event listener method receives a Composer\Script\CommandEvent instance.
  48. *
  49. * @var string
  50. */
  51. const POST_UPDATE_CMD = 'post-update-cmd';
  52. /**
  53. * The PRE_STATUS_CMD event occurs before the status command is executed.
  54. *
  55. * The event listener method receives a Composer\Script\CommandEvent instance.
  56. *
  57. * @var string
  58. */
  59. const PRE_STATUS_CMD = 'pre-status-cmd';
  60. /**
  61. * The POST_STATUS_CMD event occurs after the status command is executed.
  62. *
  63. * The event listener method receives a Composer\Script\CommandEvent instance.
  64. *
  65. * @var string
  66. */
  67. const POST_STATUS_CMD = 'post-status-cmd';
  68. /**
  69. * The PRE_AUTOLOAD_DUMP event occurs before the autoload file is generated.
  70. *
  71. * The event listener method receives a Composer\Script\Event instance.
  72. *
  73. * @var string
  74. */
  75. const PRE_AUTOLOAD_DUMP = 'pre-autoload-dump';
  76. /**
  77. * The POST_AUTOLOAD_DUMP event occurs after the autoload file has been generated.
  78. *
  79. * The event listener method receives a Composer\Script\Event instance.
  80. *
  81. * @var string
  82. */
  83. const POST_AUTOLOAD_DUMP = 'post-autoload-dump';
  84. /**
  85. * The POST_ROOT_PACKAGE_INSTALL event occurs after the root package has been installed.
  86. *
  87. * The event listener method receives a Composer\Script\PackageEvent instance.
  88. *
  89. * @var string
  90. */
  91. const POST_ROOT_PACKAGE_INSTALL = 'post-root-package-install';
  92. /**
  93. * The POST_CREATE_PROJECT event occurs after the create-project command has been executed.
  94. * Note: Event occurs after POST_INSTALL_CMD
  95. *
  96. * The event listener method receives a Composer\Script\PackageEvent instance.
  97. *
  98. * @var string
  99. */
  100. const POST_CREATE_PROJECT_CMD = 'post-create-project-cmd';
  101. /**
  102. * The PRE_ARCHIVE_CMD event occurs before the update command is executed.
  103. *
  104. * The event listener method receives a Composer\Script\CommandEvent instance.
  105. *
  106. * @var string
  107. */
  108. const PRE_ARCHIVE_CMD = 'pre-archive-cmd';
  109. /**
  110. * The POST_ARCHIVE_CMD event occurs after the status command is executed.
  111. *
  112. * The event listener method receives a Composer\Script\CommandEvent instance.
  113. *
  114. * @var string
  115. */
  116. const POST_ARCHIVE_CMD = 'post-archive-cmd';
  117. /** Deprecated constants below */
  118. /**
  119. * The PRE_PACKAGE_INSTALL event occurs before a package is installed.
  120. *
  121. * The event listener method receives a Composer\Script\PackageEvent instance.
  122. *
  123. * @deprecated Use Composer\Installer\PackageEvents::PRE_PACKAGE_INSTALL instead.
  124. * @var string
  125. */
  126. const PRE_PACKAGE_INSTALL = 'pre-package-install';
  127. /**
  128. * The POST_PACKAGE_INSTALL event occurs after a package is installed.
  129. *
  130. * The event listener method receives a Composer\Script\PackageEvent instance.
  131. *
  132. * @deprecated Use Composer\Installer\PackageEvents::POST_PACKAGE_INSTALL instead.
  133. * @var string
  134. */
  135. const POST_PACKAGE_INSTALL = 'post-package-install';
  136. /**
  137. * The PRE_PACKAGE_UPDATE event occurs before a package is updated.
  138. *
  139. * The event listener method receives a Composer\Script\PackageEvent instance.
  140. *
  141. * @deprecated Use Composer\Installer\PackageEvents::PRE_PACKAGE_UPDATE instead.
  142. * @var string
  143. */
  144. const PRE_PACKAGE_UPDATE = 'pre-package-update';
  145. /**
  146. * The POST_PACKAGE_UPDATE event occurs after a package is updated.
  147. *
  148. * The event listener method receives a Composer\Script\PackageEvent instance.
  149. *
  150. * @deprecated Use Composer\Installer\PackageEvents::POST_PACKAGE_UPDATE instead.
  151. * @var string
  152. */
  153. const POST_PACKAGE_UPDATE = 'post-package-update';
  154. /**
  155. * The PRE_PACKAGE_UNINSTALL event occurs before a package has been uninstalled.
  156. *
  157. * The event listener method receives a Composer\Script\PackageEvent instance.
  158. *
  159. * @deprecated Use Composer\Installer\PackageEvents::PRE_PACKAGE_UNINSTALL instead.
  160. * @var string
  161. */
  162. const PRE_PACKAGE_UNINSTALL = 'pre-package-uninstall';
  163. /**
  164. * The POST_PACKAGE_UNINSTALL event occurs after a package has been uninstalled.
  165. *
  166. * The event listener method receives a Composer\Script\PackageEvent instance.
  167. *
  168. * @deprecated Use Composer\Installer\PackageEvents::POST_PACKAGE_UNINSTALL instead.
  169. * @var string
  170. */
  171. const POST_PACKAGE_UNINSTALL = 'post-package-uninstall';
  172. }