Revert setCoversConstant function

This commit is contained in:
DariusIII
2018-02-09 15:38:12 +01:00
parent 87333f75ba
commit 27e1c767d8
+7 -10
View File
@@ -366,26 +366,23 @@ class Utility
return $string === '' ? false : $string;
}
/**
* @param $path
*/
public static function setCoversConstant($path): void
public static function setCoversConstant($path)
{
if (! \defined('NN_COVERS')) {
switch (true) {
case $path[0] === '/' ||
$path[1] === ':' ||
$path[0] === '\\':
case substr($path, 0, 1) === '/' ||
substr($path, 1, 1) === ':' ||
substr($path, 0, 1) === '\\':
\define('NN_COVERS', self::trailingSlash($path));
break;
case \strlen($path) > 0 && $path[0] !== '/' && $path[1] !== ':' &&
$path[0] !== '\\':
case strlen($path) > 0 && substr($path, 0, 1) !== '/' && substr($path, 1, 1) !== ':' &&
substr($path, 0, 1) !== '\\':
\define('NN_COVERS', realpath(NN_ROOT.self::trailingSlash($path)));
break;
case empty($path): // Default to resources location.
default:
\define('NN_COVERS', NN_RES.'covers'.DS);
}
}``
}
}