mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Linting fixes
This commit is contained in:
parent
83ec0b69fa
commit
6dc41e50a0
@ -86,9 +86,9 @@ class GridFieldLevelup implements GridField_HTMLProvider
|
|||||||
));
|
));
|
||||||
|
|
||||||
$template = SSViewer::get_templates_by_class($this, '', __CLASS__);
|
$template = SSViewer::get_templates_by_class($this, '', __CLASS__);
|
||||||
return array(
|
return [
|
||||||
'before' => $forTemplate->renderWith($template),
|
'before' => $forTemplate->renderWith($template),
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAttributes($attrs)
|
public function setAttributes($attrs)
|
||||||
|
@ -41,11 +41,12 @@ if (!defined('BASE_PATH')) {
|
|||||||
define('BASE_PATH', call_user_func(function () {
|
define('BASE_PATH', call_user_func(function () {
|
||||||
// Determine BASE_PATH based on the composer autoloader
|
// Determine BASE_PATH based on the composer autoloader
|
||||||
foreach (debug_backtrace() as $backtraceItem) {
|
foreach (debug_backtrace() as $backtraceItem) {
|
||||||
if (isset($backtraceItem['file']) && preg_match(
|
if (isset($backtraceItem['file'])
|
||||||
'#^(?<base>.*)(/|\\\\)vendor(/|\\\\)composer(/|\\\\)autoload_real.php#',
|
&& preg_match(
|
||||||
$backtraceItem['file'],
|
'#^(?<base>.*)(/|\\\\)vendor(/|\\\\)composer(/|\\\\)autoload_real.php#',
|
||||||
$matches
|
$backtraceItem['file'],
|
||||||
)) {
|
$matches
|
||||||
|
)) {
|
||||||
return realpath($matches['base']) ?: DIRECTORY_SEPARATOR;
|
return realpath($matches['base']) ?: DIRECTORY_SEPARATOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,23 +133,24 @@ if (!defined('BASE_URL')) {
|
|||||||
|
|
||||||
// When htaccess redirects from /base to /base/public folder, we need to only include /public
|
// When htaccess redirects from /base to /base/public folder, we need to only include /public
|
||||||
// in the BASE_URL if it's also present in the request
|
// in the BASE_URL if it's also present in the request
|
||||||
if ($baseURL
|
if (!$baseURL
|
||||||
&& PUBLIC_DIR
|
|| !PUBLIC_DIR
|
||||||
&& isset($_SERVER['REQUEST_URI'])
|
|| !isset($_SERVER['REQUEST_URI'])
|
||||||
&& substr($baseURL, -strlen(PUBLIC_DIR)) === PUBLIC_DIR
|
|| substr($baseURL, -strlen(PUBLIC_DIR)) !== PUBLIC_DIR
|
||||||
) {
|
) {
|
||||||
$requestURI = $_SERVER['REQUEST_URI'];
|
return $baseURL;
|
||||||
// Check if /base/public or /base are in the request
|
|
||||||
foreach ([$baseURL, dirname($baseURL)] as $candidate) {
|
|
||||||
if (stripos($requestURI, $candidate) === 0) {
|
|
||||||
return $candidate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Ambiguous
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $baseURL;
|
$requestURI = $_SERVER['REQUEST_URI'];
|
||||||
|
// Check if /base/public or /base are in the request
|
||||||
|
foreach ([$baseURL, dirname($baseURL)] as $candidate) {
|
||||||
|
if (stripos($requestURI, $candidate) === 0) {
|
||||||
|
return $candidate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ambiguous
|
||||||
|
return '';
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user