Rename sites directory to be the new config repository

This commit is contained in:
Manuel Cillero 2017-08-09 09:01:23 +02:00
parent 006992b900
commit 433e7eec80
31 changed files with 196 additions and 216 deletions

View file

@ -323,7 +323,7 @@ function conf_path($require_settings = TRUE, $reset = FALSE) {
return $conf;
}
$confdir = 'sites';
$confdir = 'config';
$uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);
$server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
for ($i = count($uri) - 1; $i > 0; $i--) {
@ -491,8 +491,7 @@ function conf_init() {
* in any of these three places:
*
* modules/foo/foo.module
* sites/all/modules/foo/foo.module
* sites/example.com/modules/foo/foo.module
* config/example.com/modules/foo/foo.module
*
* Calling drupal_get_filename('module', 'foo') will give you one of
* the above, depending on where the module is located.

View file

@ -2859,9 +2859,8 @@ function drupal_cron_cleanup() {
* Return an array of system file objects.
*
* Returns an array of file objects of the given type from the site-wide
* directory (i.e. modules/), the all-sites directory (i.e.
* sites/all/modules/), the profiles directory, and site-specific directory
* (i.e. sites/somesite/modules/). The returned array will be keyed using the
* directory (i.e. modules/), the profiles directory and site-specific directory
* (i.e. config/somesite/modules/). The returned array will be keyed using the
* key specified (name, basename, filename). Using name or basename will cause
* site-specific files to be prioritized over similar files in the default
* directories. That is, if a file with the same name appears in both the
@ -2872,8 +2871,7 @@ function drupal_cron_cleanup() {
* The regular expression of the files to find.
* @param $directory
* The subdirectory name in which the files are found. For example,
* 'modules' will search in both modules/ and
* sites/somesite/modules/.
* 'modules' will search in modules/.
* @param $key
* The key to be passed to file_scan_directory().
* @param $min_depth
@ -2883,31 +2881,10 @@ function drupal_cron_cleanup() {
* An array of file objects of the specified type.
*/
function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1) {
global $profile;
$config = conf_path();
// When this function is called during Drupal's initial installation process,
// the name of the profile that's about to be installed is stored in the global
// $profile variable. At all other times, the standard Drupal systems variable
// table contains the name of the current profile, and we can call variable_get()
// to determine what one is active.
if (!isset($profile)) {
$profile = variable_get('install_profile', 'default');
}
$searchdir = array($directory);
$files = array();
// The 'profiles' directory contains pristine collections of modules and
// themes as organized by a distribution. It is pristine in the same way
// that /modules is pristine for core; users should avoid changing anything
// there in favor of sites/all or sites/<domain> directories.
if (file_exists("profiles/$profile/$directory")) {
$searchdir[] = "profiles/$profile/$directory";
}
// Always search sites/all/* as well as the global directories
$searchdir[] = 'sites/all/'. $directory;
$config = conf_path();
if (file_exists("$config/$directory")) {
$searchdir[] = "$config/$directory";
}

View file

@ -34,7 +34,7 @@ function drupal_load_updates() {
* @param $module
* A module name.
* @return
* If the module has updates, an array of available updates sorted by version.
* If the module has updates, an array of available updates sorted by version.
* Otherwise, FALSE.
*/
function drupal_get_schema_versions($module) {
@ -172,7 +172,7 @@ function drupal_detect_database_types() {
* An array of settings that need to be updated.
*/
function drupal_rewrite_settings($settings = array(), $prefix = '') {
$default_settings = './sites/default/default.settings.php';
$default_settings = './config/default/default.settings.php';
$settings_file = './'. conf_path(FALSE, TRUE) .'/'. $prefix .'settings.php';
// Build list of setting names and insert the values into the global namespace.