dependencies.php 3.3 KB
Newer Older
1
<?php namespace Laravel\CLI; use Laravel\IoC;
Taylor Otwell committed
2 3 4 5 6 7 8

/**
 * 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.
 */
9
if(! IoC::registered('task: migrate'))
Taylor Otwell committed
10
{
11 12 13
	IoC::register('task: migrate', function()
	{
		$database = new Tasks\Migrate\Database;
Taylor Otwell committed
14

15 16 17 18 19
		$resolver = new Tasks\Migrate\Resolver($database);

		return new Tasks\Migrate\Migrator($resolver, $database);
	});	
}
Taylor Otwell committed
20 21 22 23 24 25 26


/**
 * 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.
 */
27
if(! IoC::registered('task: bundle'))
Taylor Otwell committed
28
{
29 30 31
	IoC::register('task: bundle', function()
	{
		$repository = IoC::resolve('bundle.repository');
32

33 34 35
		return new Tasks\Bundle\Bundler($repository);
	});
}
Taylor Otwell committed
36 37

/**
38 39 40 41
 * 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.
 */
42
if(! IoC::registered('task: key'))
43
{
44 45 46 47 48
	IoC::singleton('task: key', function()
	{
		return new Tasks\Key;
	});
}
49 50

/**
51 52 53 54 55
 * 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.
 */
56
if(! IoC::registered('task: session'))
57
{
58 59 60 61 62
	IoC::singleton('task: session', function()
	{
		return new Tasks\Session\Manager;
	});
}
63 64

/**
Taylor Otwell committed
65 66 67 68
 * 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.
 */
69
if(! IoC::registered('task: route'))
Taylor Otwell committed
70
{
71 72 73 74 75
	IoC::singleton('task: route', function()
	{
		return new Tasks\Route;
	});
}
Taylor Otwell committed
76 77

/**
Taylor Otwell committed
78 79 80 81
 * 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.
 */
82
if(! IoC::registered('task: test'))
Taylor Otwell committed
83
{
84 85 86 87 88
	IoC::singleton('task: test', function()
	{
		return new Tasks\Test\Runner;
	});
}
Taylor Otwell committed
89 90

/**
Taylor Otwell committed
91 92 93 94
 * The bundle repository is responsible for communicating with
 * the Laravel bundle sources to get information regarding any
 * bundles that are requested for installation.
 */
95
if(! IoC::registered('bundle.repository'))
Taylor Otwell committed
96
{
97 98 99 100 101
	IoC::singleton('bundle.repository', function()
	{
		return new Tasks\Bundle\Repository;
	});
}
Taylor Otwell committed
102 103 104

/**
 * The bundle publisher is responsible for publishing bundle
Taylor Otwell committed
105 106
 * assets to their correct directories within the install,
 * such as the web accessible directory.
Taylor Otwell committed
107
 */
108
if(! IoC::registered('bundle.publisher'))
Taylor Otwell committed
109
{
110 111 112 113 114
	IoC::singleton('bundle.publisher', function()
	{
		return new Tasks\Bundle\Publisher;
	});
}
Taylor Otwell committed
115 116 117 118 119 120 121

/**
 * 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.
 */
122
if(! IoC::registered('bundle.provider: github'))
Taylor Otwell committed
123
{
124 125 126 127
	IoC::singleton('bundle.provider: github', function()
	{
		return new Tasks\Bundle\Providers\Github;
	});
128 129 130 131 132 133 134 135 136 137 138 139
}

/**
 * The "help" task provides information about 
 * artisan usage.
 */
if(! IoC::registered('task: help'))
{
	IoC::singleton('task: help', function()
	{
		return new Tasks\Help;
	});
140
}