Skip to content

Commit

Permalink
Use APP_INCLUDE in binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal de Vink committed Jul 21, 2016
1 parent 3eba766 commit 846ab0e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
19 changes: 9 additions & 10 deletions bin/resque
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ if (empty($QUEUE)) {
}

require __DIR__ . '/../../../../app/autoload.php';
require __DIR__ . '/../../../../var/bootstrap.php.cache';

$APP_INCLUDE = getenv('APP_INCLUDE');
if ($APP_INCLUDE) {
if (!file_exists($APP_INCLUDE)) {
die('APP_INCLUDE ('.$APP_INCLUDE.") does not exist.\n");
}

require_once $APP_INCLUDE;
}

$REDIS_BACKEND = getenv('REDIS_BACKEND');
$REDIS_BACKEND_DB = getenv('REDIS_BACKEND_DB');
Expand All @@ -29,15 +37,6 @@ if (!empty($LOGGING) || !empty($VERBOSE)) {
$logLevel = true;
}

$APP_INCLUDE = getenv('APP_INCLUDE');
if ($APP_INCLUDE) {
if (!file_exists($APP_INCLUDE)) {
die('APP_INCLUDE ('.$APP_INCLUDE.") does not exist.\n");
}

require_once $APP_INCLUDE;
}

// See if the APP_INCLUDE containes a logger object,
// If none exists, fallback to internal logger
if (!isset($logger) || !is_object($logger)) {
Expand Down
21 changes: 10 additions & 11 deletions bin/resque-scheduler
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
<?php

require __DIR__ . '/../../../../app/autoload.php';
require __DIR__ . '/../../../../var/bootstrap.php.cache';

// Load the user's application if one exists
$APP_INCLUDE = getenv('APP_INCLUDE');
if ($APP_INCLUDE) {
if (!file_exists($APP_INCLUDE)) {
die('APP_INCLUDE ('.$APP_INCLUDE.") does not exist.\n");
}

require_once $APP_INCLUDE;
}

// Look for an environment variable with
$RESQUE_PHP = getenv('RESQUE_PHP');
Expand Down Expand Up @@ -38,16 +47,6 @@ if (!empty($INTERVAL)) {
$interval = $INTERVAL;
}

// Load the user's application if one exists
$APP_INCLUDE = getenv('APP_INCLUDE');
if ($APP_INCLUDE) {
if (!file_exists($APP_INCLUDE)) {
die('APP_INCLUDE ('.$APP_INCLUDE.") does not exist.\n");
}

require_once $APP_INCLUDE;
}

$PREFIX = getenv('PREFIX');
if(!empty($PREFIX)) {
fwrite(STDOUT, '*** Prefix set to '.$PREFIX."\n");
Expand Down

0 comments on commit 846ab0e

Please sign in to comment.