Revert "Issue #1772708 by alexpott: Fixed The configuration directories can not be outside of DRUPAL_ROOT."
This reverts commit e003e4c580.
			
			
				8.0.x
			
			
		
							parent
							
								
									e003e4c580
								
							
						
					
					
						commit
						67d2a2ffc4
					
				| 
						 | 
				
			
			@ -508,13 +508,7 @@ function config_get_config_directory($type = CONFIG_ACTIVE_DIRECTORY) {
 | 
			
		|||
    $path = conf_path() . '/files/simpletest/' . substr($test_prefix, 10) . '/config_' . $type;
 | 
			
		||||
  }
 | 
			
		||||
  elseif (!empty($config_directories[$type])) {
 | 
			
		||||
    // Allow a configuration directory path to be outside of webroot.
 | 
			
		||||
    if (empty($config_directories[$type]['absolute'])) {
 | 
			
		||||
      $path = conf_path() . '/files/' . $config_directories[$type]['path'];
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
      $path = $config_directories[$type]['path'];
 | 
			
		||||
    }
 | 
			
		||||
    $path = conf_path() . '/files/' . $config_directories[$type];
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    throw new Exception(format_string('The configuration directory type %type does not exist.', array('%type' => $type)));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -266,12 +266,8 @@ function drupal_install_config_directories() {
 | 
			
		|||
  if (empty($config_directories)) {
 | 
			
		||||
    $settings['config_directories'] = array(
 | 
			
		||||
      'value' => array(
 | 
			
		||||
        CONFIG_ACTIVE_DIRECTORY => array(
 | 
			
		||||
          'path' => 'config/active_' . drupal_hash_base64(drupal_random_bytes(55)),
 | 
			
		||||
        ),
 | 
			
		||||
        CONFIG_STAGING_DIRECTORY => array(
 | 
			
		||||
          'path' => 'config/staging_' . drupal_hash_base64(drupal_random_bytes(55)),
 | 
			
		||||
        ),
 | 
			
		||||
        CONFIG_ACTIVE_DIRECTORY => 'config/active_' . drupal_hash_base64(drupal_random_bytes(55)),
 | 
			
		||||
        CONFIG_STAGING_DIRECTORY => 'config/staging_' . drupal_hash_base64(drupal_random_bytes(55)),
 | 
			
		||||
      ),
 | 
			
		||||
      'required' => TRUE,
 | 
			
		||||
    );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -727,7 +727,7 @@ abstract class TestBase {
 | 
			
		|||
    // @see config_get_config_directory()
 | 
			
		||||
    $GLOBALS['config_directories'] = array();
 | 
			
		||||
    foreach (array(CONFIG_ACTIVE_DIRECTORY, CONFIG_STAGING_DIRECTORY) as $type) {
 | 
			
		||||
      $GLOBALS['config_directories'][$type]['path'] = 'simpletest/' . substr($this->databasePrefix, 10) . '/config_' . $type;
 | 
			
		||||
      $GLOBALS['config_directories'][$type] = 'simpletest/' . substr($this->databasePrefix, 10) . '/config_' . $type;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Reset and create a new service container.
 | 
			
		||||
| 
						 | 
				
			
			@ -735,11 +735,11 @@ abstract class TestBase {
 | 
			
		|||
 | 
			
		||||
    $this->configDirectories = array();
 | 
			
		||||
    include_once DRUPAL_ROOT . '/core/includes/install.inc';
 | 
			
		||||
    foreach ($GLOBALS['config_directories'] as $type => $directory) {
 | 
			
		||||
    foreach ($GLOBALS['config_directories'] as $type => $path) {
 | 
			
		||||
      if (!install_ensure_config_directory($type)) {
 | 
			
		||||
        return FALSE;
 | 
			
		||||
      }
 | 
			
		||||
      $this->configDirectories[$type] = $this->originalFileDirectory . '/' . $directory['path'];
 | 
			
		||||
      $this->configDirectories[$type] = $this->originalFileDirectory . '/' . $path;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Unset globals.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -259,14 +259,8 @@ $drupal_hash_salt = '';
 | 
			
		|||
 * Example:
 | 
			
		||||
 * @code
 | 
			
		||||
 *   $config_directories = array(
 | 
			
		||||
 *     CONFIG_ACTIVE_DIRECTORY => array(
 | 
			
		||||
 *       'path' => '/some/directory/outside/webroot',
 | 
			
		||||
 *       'absolute' => TRUE,
 | 
			
		||||
 *     ),
 | 
			
		||||
 *     CONFIG_STAGING_DIRECTORY => array(
 | 
			
		||||
 *       'path' => '/another/directory/outside/webroot',
 | 
			
		||||
 *       'absolute' => TRUE,
 | 
			
		||||
 *     ),
 | 
			
		||||
 *     CONFIG_ACTIVE_DIRECTORY => '/some/directory/outside/webroot',
 | 
			
		||||
 *     CONFIG_STAGING_DIRECTORY => '/another/directory/outside/webroot',
 | 
			
		||||
 *   );
 | 
			
		||||
 * @endcode
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue