dependencies.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. IoC::register('task: migrate', function()
  9. {
  10. $database = new Tasks\Migrate\Database;
  11. $resolver = new Tasks\Migrate\Resolver($database);
  12. return new Tasks\Migrate\Migrator($resolver, $database);
  13. });
  14. /**
  15. * The bundle task is responsible for the installation of bundles
  16. * and their dependencies. It utilizes the bundles API to get the
  17. * meta-data for the available bundles.
  18. */
  19. IoC::register('task: bundle', function()
  20. {
  21. $repository = IoC::resolve('bundle.repository');
  22. return new Tasks\Bundle\Bundler($repository);
  23. });
  24. /**
  25. * The key task is responsible for generating a secure, random
  26. * key for use by the application when encrypting strings or
  27. * setting the hash values on cookie signatures.
  28. */
  29. IoC::singleton('task: key', function()
  30. {
  31. return new Tasks\Key;
  32. });
  33. /**
  34. * The session task is responsible for performing tasks related
  35. * to the session store of the application. It can do things
  36. * such as generating the session table or clearing expired
  37. * sessions from storage.
  38. */
  39. IoC::singleton('task: session', function()
  40. {
  41. return new Tasks\Session\Manager;
  42. });
  43. /**
  44. * The route task is responsible for calling routes within the
  45. * application and dumping the result. This allows for simple
  46. * testing of APIs and JSON based applications.
  47. */
  48. IoC::singleton('task: route', function()
  49. {
  50. return new Tasks\Route;
  51. });
  52. /**
  53. * The "test" task is responsible for running the unit tests for
  54. * the application, bundles, and the core framework itself.
  55. * It provides a nice wrapper around PHPUnit.
  56. */
  57. IoC::singleton('task: test', function()
  58. {
  59. return new Tasks\Test\Runner;
  60. });
  61. /**
  62. * The bundle repository is responsible for communicating with
  63. * the Laravel bundle sources to get information regarding any
  64. * bundles that are requested for installation.
  65. */
  66. IoC::singleton('bundle.repository', function()
  67. {
  68. return new Tasks\Bundle\Repository;
  69. });
  70. /**
  71. * The bundle publisher is responsible for publishing bundle
  72. * assets to their correct directories within the install,
  73. * such as the web accessible directory.
  74. */
  75. IoC::singleton('bundle.publisher', function()
  76. {
  77. return new Tasks\Bundle\Publisher;
  78. });
  79. /**
  80. * The Github bundle provider installs bundles that live on
  81. * Github. This provider will add the bundle as a submodule
  82. * and will update the submodule so that the bundle is
  83. * installed into the bundle directory.
  84. */
  85. IoC::singleton('bundle.provider: github', function()
  86. {
  87. return new Tasks\Bundle\Providers\Github;
  88. });