Skip to content

Instantly share code, notes, and snippets.

@JesseObrien
Created December 4, 2012 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JesseObrien/4206439 to your computer and use it in GitHub Desktop.
Save JesseObrien/4206439 to your computer and use it in GitHub Desktop.
Resque bootstrap for Laravel 3
<?php
// Bootstrap the laravel environment for our resque workers.
require 'paths.php';
require path('sys').'core.php';
Laravel\Bundle::start(DEFAULT_BUNDLE);
\Autoloader::directories(array(
path('app').'workers',
));
/*
|----------------------------------------------------------------
| Application Environment
|----------------------------------------------------------------
|
| When calling the resque.php from the CLI we can specify the
| environment to use. This is done with ENV=environment. This is
| always required.
|
| IE: ENV=development php resque.php
|
*/
$env = getenv('ENV');
if(empty($env))
{
die("Set ENV env var with the Laravel environtment to use.\n");
}
Request::set_env($env);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment