Skip to content

Commit

Permalink
Merge pull request #59 from JarvusInnovations/develop
Browse files Browse the repository at this point in the history
Release: emergence v1.0.4
  • Loading branch information
themightychris authored Mar 13, 2018
2 parents 99e6b58 + 8450bcd commit f021de4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
10 changes: 5 additions & 5 deletions bin/shell
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ fi

# determine code source
if [ "$2" == "--stdin" ]; then
INPUT_ARGS=""
INPUT_ARGS="-- ${@:3}"
elif [ "$2" == "--" ]; then
INPUT_ARGS="-a -- ${@:3}"
elif [ -n "$2" ]; then
INPUT_ARGS="-f $2"
INPUT_ARGS="-f $2 -- ${@:3}"
else
INPUT_ARGS="-a"
fi


# execute interactive shell
TERM=$TERM sudo -E -u www-data -g www-data php -d auto_prepend_file=$autoPrependScript -d apc.enable_cli=on $INPUT_ARGS

TERM=$TERM sudo -E -u www-data -g www-data php -d auto_prepend_file=$autoPrependScript -d apc.enable_cli=on -d memory_limit=-1 $INPUT_ARGS

# clean up
rm $autoPrependScript;
4 changes: 4 additions & 0 deletions php-bootstrap/lib/Emergence_FS.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ public static function findFiles($filename, $useRegexp = false, $scope = null, $
$collections[] = $scopeItem;
}
}

if(!count($collections)) {
return array();
}
}

DB::nonQuery('LOCK TABLES '.SiteFile::$tableName.' f1 READ, '.SiteFile::$tableName.' f2 READ, '.SiteCollection::$tableName.' collections READ');
Expand Down
2 changes: 1 addition & 1 deletion php-bootstrap/lib/HttpProxy.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function relayRequest($options)
}

if (!isset($options['interface'])) {
$options['interface'] = isset(static::$sourceInterface) ? static::$sourceInterface : $_SERVER['HTTP_HOST'];
$options['interface'] = isset(static::$sourceInterface) ? static::$sourceInterface : explode(':', $_SERVER['HTTP_HOST'])[0];
}

if (!isset($options['method'])) {
Expand Down
6 changes: 5 additions & 1 deletion php-bootstrap/lib/Site.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,11 @@ public static function redirect($path, $get = false, $hash = false)
if (preg_match('/^https?:\/\//i', $path)) {
$url = $path;
} else {
$url = ($_SERVER['HTTPS'] ? 'https' : 'http').'://'.static::$hostname.'/'.ltrim($path, '/');
$host = explode(':', $_SERVER['HTTP_HOST']);
$host[0] = static::$hostname;
$host = implode(':', $host);

$url = ($_SERVER['HTTPS'] ? 'https' : 'http').'://'.$host.'/'.ltrim($path, '/');
}

if ($get) {
Expand Down
2 changes: 1 addition & 1 deletion php-bootstrap/phpunit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// bootstrap emergence
require('bootstrap.inc.php');
Site::$debug = true;
Site::initialize($_SERVER['SITE_ROOT'], $_SERVER['HTTP_HOST']);
Site::initialize($_SERVER['SITE_ROOT'], explode(':', $_SERVER['HTTP_HOST'])[0]);
2 changes: 1 addition & 1 deletion php-bootstrap/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require('bootstrap.inc.php');

// load core
Site::initialize($_SERVER['SITE_ROOT'], $_SERVER['HTTP_HOST']);
Site::initialize($_SERVER['SITE_ROOT'], explode(':', $_SERVER['HTTP_HOST'])[0]);

// dispatch request
Site::handleRequest();

0 comments on commit f021de4

Please sign in to comment.