dependencies.php 2.7 KB
Newer Older
1
<?php namespace Laravel\CLI; use Laravel\IoC;
Taylor Otwell committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

/**
 * The migrate task is responsible for running database migrations
 * as well as migration rollbacks. We will also create an instance
 * of the migration resolver and database classes, which are used
 * to perform various support functions for the migrator.
 */
IoC::register('task: migrate', function()
{
	$database = new Tasks\Migrate\Database;

	$resolver = new Tasks\Migrate\Resolver($database);

	return new Tasks\Migrate\Migrator($resolver, $database);
});

/**
 * The bundle task is responsible for the installation of bundles
 * and their dependencies. It utilizes the bundles API to get the
 * meta-data for the available bundles.
 */
IoC::register('task: bundle', function()
{
25 26 27
	$repository = IoC::resolve('bundle.repository');

	return new Tasks\Bundle\Bundler($repository);
Taylor Otwell committed
28 29 30
});

/**
31 32 33 34 35 36 37 38 39 40
 * The key task is responsible for generating a secure, random
 * key for use by the application when encrypting strings or
 * setting the hash values on cookie signatures.
 */
IoC::singleton('task: key', function()
{
	return new Tasks\Key;
});

/**
41 42 43 44 45 46 47
 * The session task is responsible for performing tasks related
 * to the session store of the application. It can do things
 * such as generating the session table or clearing expired
 * sessions from storage.
 */
IoC::singleton('task: session', function()
{
48
	return new Tasks\Session\Manager;
49 50 51
});

/**
Taylor Otwell committed
52 53 54 55 56 57 58 59 60 61
 * The route task is responsible for calling routes within the
 * application and dumping the result. This allows for simple
 * testing of APIs and JSON based applications.
 */
IoC::singleton('task: route', function()
{
	return new Tasks\Route;
});

/**
Taylor Otwell committed
62 63 64 65 66 67 68 69 70 71
 * The "test" task is responsible for running the unit tests for
 * the application, bundles, and the core framework itself.
 * It provides a nice wrapper around PHPUnit.
 */
IoC::singleton('task: test', function()
{
	return new Tasks\Test\Runner;
});

/**
Taylor Otwell committed
72 73 74 75 76 77
 * The bundle repository is responsible for communicating with
 * the Laravel bundle sources to get information regarding any
 * bundles that are requested for installation.
 */
IoC::singleton('bundle.repository', function()
{
78
	return new Tasks\Bundle\Repository;
Taylor Otwell committed
79 80 81 82
});

/**
 * The bundle publisher is responsible for publishing bundle
Taylor Otwell committed
83 84
 * assets to their correct directories within the install,
 * such as the web accessible directory.
Taylor Otwell committed
85 86 87
 */
IoC::singleton('bundle.publisher', function()
{
88
	return new Tasks\Bundle\Publisher;
Taylor Otwell committed
89 90 91 92 93 94 95 96 97 98
});

/**
 * The Github bundle provider installs bundles that live on
 * Github. This provider will add the bundle as a submodule
 * and will update the submodule so that the bundle is
 * installed into the bundle directory.
 */
IoC::singleton('bundle.provider: github', function()
{
99
	return new Tasks\Bundle\Providers\Github;
Taylor Otwell committed
100
});