Merge pull request #10437 from creative-commoners/pulls/5/default-resource-dir

ENH Set the default resources dir to "_resources"
This commit is contained in:
Steve Boyd 2022-08-08 12:16:55 +12:00 committed by GitHub
commit ae3a0d9c65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -25,11 +25,6 @@ class ManifestFileFinder extends FileFinder
const TESTS_DIR = 'tests';
const VENDOR_DIR = 'vendor';
/**
* @deprecated 4.4.0:5.0.0 Use global `RESOURCES_DIR` instead.
*/
const RESOURCES_DIR = RESOURCES_DIR;
protected static $default_options = [
'include_themes' => false,
'ignore_tests' => true,

View File

@ -219,7 +219,7 @@ if (!defined('TEMP_FOLDER')) {
// Define the resource dir constant that will be use to exposed vendor assets
if (!defined('RESOURCES_DIR')) {
$project = new SilverStripe\Core\Manifest\Module(BASE_PATH, BASE_PATH);
$resourcesDir = $project->getResourcesDir() ?: 'resources';
$resourcesDir = $project->getResourcesDir() ?: '_resources';
if (preg_match('/^[_\-a-z0-9]+$/i', $resourcesDir ?? '')) {
define('RESOURCES_DIR', $resourcesDir);
} else {