dependencies.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php namespace Laravel\CLI; use Laravel\IoC;
  2. /**
  3. * The migrate task is responsible for running database migrations
  4. * as well as migration rollbacks. We will also create an instance
  5. * of the migration resolver and database classes, which are used
  6. * to perform various support functions for the migrator.
  7. */
  8. if(! IoC::registered('task: migrate'))
  9. {
  10. IoC::register('task: migrate', function()
  11. {
  12. $database = new Tasks\Migrate\Database;
  13. $resolver = new Tasks\Migrate\Resolver($database);
  14. return new Tasks\Migrate\Migrator($resolver, $database);
  15. });
  16. }
  17. /**
  18. * The bundle task is responsible for the installation of bundles
  19. * and their dependencies. It utilizes the bundles API to get the
  20. * meta-data for the available bundles.
  21. */
  22. if(! IoC::registered('task: bundle'))
  23. {
  24. IoC::register('task: bundle', function()
  25. {
  26. $repository = IoC::resolve('bundle.repository');
  27. return new Tasks\Bundle\Bundler($repository);
  28. });
  29. }
  30. /**
  31. * The key task is responsible for generating a secure, random
  32. * key for use by the application when encrypting strings or
  33. * setting the hash values on cookie signatures.
  34. */
  35. if(! IoC::registered('task: key'))
  36. {
  37. IoC::singleton('task: key', function()
  38. {
  39. return new Tasks\Key;
  40. });
  41. }
  42. /**
  43. * The session task is responsible for performing tasks related
  44. * to the session store of the application. It can do things
  45. * such as generating the session table or clearing expired
  46. * sessions from storage.
  47. */
  48. if(! IoC::registered('task: session'))
  49. {
  50. IoC::singleton('task: session', function()
  51. {
  52. return new Tasks\Session\Manager;
  53. });
  54. }
  55. /**
  56. * The route task is responsible for calling routes within the
  57. * application and dumping the result. This allows for simple
  58. * testing of APIs and JSON based applications.
  59. */
  60. if(! IoC::registered('task: route'))
  61. {
  62. IoC::singleton('task: route', function()
  63. {
  64. return new Tasks\Route;
  65. });
  66. }
  67. /**
  68. * The "test" task is responsible for running the unit tests for
  69. * the application, bundles, and the core framework itself.
  70. * It provides a nice wrapper around PHPUnit.
  71. */
  72. if(! IoC::registered('task: test'))
  73. {
  74. IoC::singleton('task: test', function()
  75. {
  76. return new Tasks\Test\Runner;
  77. });
  78. }
  79. /**
  80. * The bundle repository is responsible for communicating with
  81. * the Laravel bundle sources to get information regarding any
  82. * bundles that are requested for installation.
  83. */
  84. if(! IoC::registered('bundle.repository'))
  85. {
  86. IoC::singleton('bundle.repository', function()
  87. {
  88. return new Tasks\Bundle\Repository;
  89. });
  90. }
  91. /**
  92. * The bundle publisher is responsible for publishing bundle
  93. * assets to their correct directories within the install,
  94. * such as the web accessible directory.
  95. */
  96. if(! IoC::registered('bundle.publisher'))
  97. {
  98. IoC::singleton('bundle.publisher', function()
  99. {
  100. return new Tasks\Bundle\Publisher;
  101. });
  102. }
  103. /**
  104. * The Github bundle provider installs bundles that live on
  105. * Github. This provider will add the bundle as a submodule
  106. * and will update the submodule so that the bundle is
  107. * installed into the bundle directory.
  108. */
  109. if(! IoC::registered('bundle.provider: github'))
  110. {
  111. IoC::singleton('bundle.provider: github', function()
  112. {
  113. return new Tasks\Bundle\Providers\Github;
  114. });
  115. }
  116. /**
  117. * The "help" task provides information about
  118. * artisan usage.
  119. */
  120. if(! IoC::registered('task: help'))
  121. {
  122. IoC::singleton('task: help', function()
  123. {
  124. return new Tasks\Help;
  125. });
  126. }