├── .circleci └── config.yml ├── .docksal ├── .gitignore ├── addons │ └── phpunit │ │ └── phpunit ├── commands │ ├── init │ ├── init-site │ ├── php │ │ ├── ext │ │ └── xdebug │ └── test ├── docksal.env ├── docksal.yml ├── etc │ ├── mysql │ │ └── my.cnf │ └── php │ │ ├── php-fpm.conf │ │ └── php.ini └── settings │ ├── default.settings.local.php │ ├── example.gitignore │ ├── phpunit.xml │ └── settings.php ├── .gitignore ├── .travis.yml ├── README.md ├── config └── default │ ├── .htaccess │ └── README.txt └── drush └── aliases.drushrc.php /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # This is a temporary dummy config to stop CircleCI from building this branch with automatic v1.0 configuration for PHP 2 | 3 | version: 2 4 | jobs: 5 | build: 6 | docker: 7 | - image: alpine 8 | # Ignore all branches 9 | branches: 10 | ignore: 11 | - /.*/ 12 | steps: 13 | - run: echo 'Hello World' 14 | -------------------------------------------------------------------------------- /.docksal/.gitignore: -------------------------------------------------------------------------------- 1 | # Exclude local configuration overrides 2 | docksal-local.env 3 | docksal-local.yml 4 | -------------------------------------------------------------------------------- /.docksal/addons/phpunit/phpunit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #: exec_target = cli 4 | 5 | ## Creates a phpunit.xml file and runs PHPUnit tests in Drupal 8 6 | ## 7 | ## Usage: fin phpunit 8 | ## 9 | ## This first ensures that a `core/phpunit.xml` file exists, either by copying a 10 | ## stub from `.docksal/drupal/core/phpunit.xml` if that exists, or copying and 11 | ## renaming `core/phpunit.xml.dist`. 12 | ## 13 | ## If `core/phpunit.xml` exists, the phpunit command with then be run, appending 14 | ## any optional arguments such as the directory path (run `fin phpunit -h`) to 15 | ## see a full list of options. 16 | 17 | set -e 18 | 19 | DOCROOT_PATH="${PROJECT_ROOT}/${DOCROOT}" 20 | DRUPAL_CORE_PATH="${DOCROOT_PATH}/core" 21 | PHPUNIT_XML_PATH="${PROJECT_ROOT}/.docksal/settings/phpunit.xml" 22 | 23 | run_tests() { 24 | cd $DOCROOT_PATH 25 | ./vendor/bin/phpunit -c "${DRUPAL_CORE_PATH}" "$@" 26 | cd - 27 | } 28 | 29 | if [ ! -e ${DRUPAL_CORE_PATH}/phpunit.xml ]; then 30 | if [ -e "${PHPUNIT_XML_PATH}" ]; then 31 | echo "Copying ${PHPUNIT_XML_PATH} to ${DRUPAL_CORE_PATH}/phpunit.xml" 32 | cp "${PHPUNIT_XML_PATH}" ${DRUPAL_CORE_PATH}/phpunit.xml 33 | run_tests "$@" 34 | else 35 | echo "Copying phpunit.xml.dist to phpunit.xml." 36 | echo "Please edit it's values as needed and re-run 'fin phpunit'." 37 | cp ${DRUPAL_CORE_PATH}/phpunit.xml.dist ${DRUPAL_CORE_PATH}/phpunit.xml 38 | exit 1; 39 | fi 40 | else 41 | run_tests "$@" 42 | fi 43 | -------------------------------------------------------------------------------- /.docksal/commands/init: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Initialize stack and site (full reset) 4 | ## 5 | ## Usage: fin init 6 | 7 | # Abort if anything fails 8 | set -e 9 | 10 | #-------------------------- Helper functions -------------------------------- 11 | 12 | # Console colors 13 | red='\033[0;31m' 14 | green='\033[0;32m' 15 | green_bg='\033[1;97;42m' 16 | yellow='\033[1;33m' 17 | NC='\033[0m' 18 | 19 | echo-red () { echo -e "${red}$1${NC}"; } 20 | echo-green () { echo -e "${green}$1${NC}"; } 21 | echo-green-bg () { echo -e "${green_bg}$1${NC}"; } 22 | echo-yellow () { echo -e "${yellow}$1${NC}"; } 23 | 24 | #-------------------------- Execution -------------------------------- 25 | 26 | # Stack initialization 27 | echo -e "${green_bg} Step 1 ${NC}${green} Initializing stack...${NC}" 28 | fin project reset -f 29 | 30 | # Site initialization 31 | echo -e "${green_bg} Step 2 ${NC}${green} Initializing site...${NC}" 32 | # This runs inside cli using http://docs.docksal.io/en/v1.4.0/fin/custom-commands/#executing-commands-inside-cli 33 | fin init-site 34 | 35 | echo -e "${green_bg} DONE! ${NC}${green} Completed all initialization steps.${NC}" 36 | 37 | #-------------------------- END: Execution -------------------------------- 38 | -------------------------------------------------------------------------------- /.docksal/commands/init-site: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #: exec_target = cli 4 | 5 | ## Initialize/reinstall site 6 | ## 7 | ## Usage: fin init-site 8 | 9 | # Abort if anything fails 10 | set -e 11 | 12 | #-------------------------- Settings -------------------------------- 13 | 14 | # PROJECT_ROOT and DOCROOT are set as env variables in cli 15 | SITE_DIRECTORY="default" 16 | SETTINGS_PATH="${PROJECT_ROOT}/.docksal/settings" 17 | DOCROOT_PATH="${PROJECT_ROOT}/${DOCROOT}" 18 | SITEDIR_PATH="${DOCROOT_PATH}/sites/${SITE_DIRECTORY}" 19 | DRUPAL_GIT_REPO="https://git.drupalcode.org/project/drupal.git" 20 | 21 | #-------------------------- END: Settings -------------------------------- 22 | 23 | #-------------------------- Helper functions -------------------------------- 24 | 25 | # Console colors 26 | red='\033[0;31m' 27 | green='\033[0;32m' 28 | green_bg='\033[1;97;42m' 29 | yellow='\033[1;33m' 30 | NC='\033[0m' 31 | 32 | echo-red () { echo -e "${red}$1${NC}"; } 33 | echo-green () { echo -e "${green}$1${NC}"; } 34 | echo-green-bg () { echo -e "${green_bg}$1${NC}"; } 35 | echo-yellow () { echo -e "${yellow}$1${NC}"; } 36 | 37 | # Copy a settings file. 38 | # Skips if the destination file already exists. 39 | # @param $1 source file 40 | # @param $2 destination file 41 | copy_settings_file() 42 | { 43 | local source="$1" 44 | local dest="$2" 45 | 46 | if [[ ! -f $dest ]]; then 47 | echo "Copying ${dest}..." 48 | cp $source $dest 49 | else 50 | echo "${dest} already in place." 51 | fi 52 | } 53 | 54 | #-------------------------- END: Helper functions -------------------------------- 55 | 56 | #-------------------------- Functions -------------------------------- 57 | 58 | # Clones Drupal 8 repository into docroot. 59 | git_clone () 60 | { 61 | if [[ ! -d "$DOCROOT_PATH" ]]; then 62 | echo-green "Cloning Drupal 8" 63 | git clone "$DRUPAL_GIT_REPO" "$DOCROOT_PATH" 64 | fi 65 | } 66 | 67 | # Runs composer install in docroot 68 | composer_install () 69 | { 70 | cd "$DOCROOT_PATH" 71 | echo-green "Installing dependencies..." 72 | composer install 73 | } 74 | 75 | # Initialize local settings files 76 | init_settings () 77 | { 78 | # Copy from settings templates 79 | echo-green "Initializing local settings..." 80 | copy_settings_file "${SETTINGS_PATH}/example.gitignore" "${DOCROOT_PATH}/.gitignore" 81 | copy_settings_file "${SETTINGS_PATH}/phpunit.xml" "${DOCROOT_PATH}/core/phpunit.xml" 82 | copy_settings_file "${SETTINGS_PATH}/settings.php" "${SITEDIR_PATH}/settings.php" 83 | copy_settings_file "${SETTINGS_PATH}/default.settings.local.php" "${SITEDIR_PATH}/settings.local.php" 84 | } 85 | 86 | # Fix file/folder permissions 87 | fix_permissions () 88 | { 89 | echo-green "Making site directory writable..." 90 | chmod 755 "${SITEDIR_PATH}" 91 | } 92 | 93 | # Install site 94 | site_install () 95 | { 96 | cd "$DOCROOT_PATH" 97 | 98 | echo-green "Installing Drupal..." 99 | # We disable email sending here so site-install does not return an error 100 | # Credit: https://www.drupal.org/project/phpconfig/issues/1826652#comment-12071700 101 | drush site-install standard -y \ 102 | install_configure_form.enable_update_status_module=NULL \ 103 | --site-name='My Drupal 8 Site' 104 | } 105 | 106 | #-------------------------- END: Functions -------------------------------- 107 | 108 | #-------------------------- Execution -------------------------------- 109 | 110 | # Project initialization steps 111 | time -p git_clone 112 | time -p composer_install 113 | fix_permissions 114 | init_settings 115 | time -p site_install 116 | 117 | echo -e "Open ${yellow}http://${VIRTUAL_HOST}${NC} in your browser to verify the setup." 118 | echo-yellow "Look for admin login credentials in the output above." 119 | 120 | #-------------------------- END: Execution -------------------------------- 121 | -------------------------------------------------------------------------------- /.docksal/commands/php/ext: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## Toggles a given PHP extension (most commonly xdebug). 3 | ## 4 | ## Usage: fin php/ext xhprof on|off 5 | #: exec_target = cli 6 | 7 | usage() { 8 | echo "Usage:" 9 | echo "fin php-ext on|off" 10 | } 11 | 12 | toggle_on() { 13 | sudo su -c "sed -ri 's/^[#;]((zend_)?extension)/\1/' ${EXTENSION_PATH}" 14 | echo "${EXTENSION} on" 15 | } 16 | 17 | toggle_off() { 18 | sudo su -c "sed -ri 's/^((zend_)?extension)/#\1/' ${EXTENSION_PATH}" 19 | echo "${EXTENSION} off" 20 | } 21 | 22 | restart_php_fpm() { 23 | sudo supervisorctl restart php-fpm 24 | } 25 | 26 | find_extension() { 27 | EXTENSION_PATH=`php --ini | grep "${EXTENSION}" | tr -d ","` 28 | if [[ -z ${EXTENSION_PATH} ]]; then 29 | echo "Invalid extension: ${EXTENSION}" 30 | exit 1 31 | fi 32 | } 33 | 34 | if [[ -z ${2} ]]; then 35 | usage 36 | exit 1 37 | fi 38 | 39 | # main 40 | EXTENSION=${1} 41 | find_extension 42 | 43 | if [[ "${2}" == "on" ]]; then 44 | toggle_on 45 | elif [[ "${2}" == "off" ]]; then 46 | toggle_off 47 | else 48 | echo "Unknown option: ${2}" 49 | exit 1 50 | fi 51 | 52 | restart_php_fpm 53 | -------------------------------------------------------------------------------- /.docksal/commands/php/xdebug: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## Toggles xdebug on|off. 3 | ## 4 | ## Usage: fin php/xdebug on|off 5 | #: exec_target = cli 6 | 7 | set -e 8 | ${PROJECT_ROOT}/.docksal/commands/php/ext xdebug $1 9 | -------------------------------------------------------------------------------- /.docksal/commands/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Test site installation 4 | ## 5 | ## Usage: fin test 6 | 7 | # Abort if anything fails 8 | set -e 9 | 10 | # Debug mode switch 11 | if [[ "${DEBUG}" != "" ]]; then 12 | set -x 13 | fi 14 | 15 | # Test to use to verify phpunit is properly configured. 16 | PHPUNIT_FUNCTIONAL_TEST="core/modules/content_moderation/tests/src/Functional/ContentModerationWorkflowTypeTest.php" 17 | 18 | # JS test to verify selenium container is setup. 19 | PHPUNIT_FUNCTIONAL_JS_TEST="core/tests/Drupal/FunctionalJavascriptTests/JavascriptGetDrupalSettingsTest.php" 20 | 21 | # The .gitignore file exists. 22 | GITIGNORE_PATH="${PROJECT_ROOT}/${DOCROOT}/.gitignore" 23 | if [[ ! -f "${GITIGNORE_PATH}" ]]; then 24 | echo "No .gitignore file was copied to ${GITIGNORE_PATH}." 25 | exit 1 26 | fi 27 | 28 | # Verify phpunit is working. 29 | # @todo FunctionalJavascript tests. 30 | echo "Verifying PHPUnit is correctly installed..." 31 | fin phpunit "${PHPUNIT_FUNCTIONAL_TEST}" 32 | 33 | echo "Verifying Selenium container is installed..." 34 | fin phpunit "${PHPUNIT_FUNCTIONAL_JS_TEST}" 35 | 36 | echo "Testing home page..." 37 | curl -sL -I http://${VIRTUAL_HOST} | grep "HTTP/1.1 200 OK" 38 | curl -sL http://${VIRTUAL_HOST} | grep "My Drupal 8 Site" 39 | echo "Testing login page..." 40 | curl -sL -I http://${VIRTUAL_HOST}/user/login | grep "HTTP/1.1 200 OK" 41 | -------------------------------------------------------------------------------- /.docksal/docksal.env: -------------------------------------------------------------------------------- 1 | # This is a shared configuration file that is intended to be stored in the project repo. 2 | # To override a variable locally: 3 | # - create .docksal/docksal-local.env file and local variable overrides there 4 | # - add .docksal/docksal-local.env to .gitignore 5 | # 6 | # After editing, apply changes with 'fin up' 7 | 8 | # Use the default Docksal LAMP stack 9 | DOCKSAL_STACK=default 10 | 11 | # Lock images versions for LAMP services 12 | # This will prevent images from being updated when Docksal is updated 13 | #WEB_IMAGE='docksal/web:x.x-apache2.4' 14 | #DB_IMAGE='docksal/db:x.x-mysql-5.6' 15 | # Use a newer cli image 16 | 17 | # Override virtual host (matches project folder name by default) 18 | #VIRTUAL_HOST=drupal8.docksal 19 | # Override document root ('docroot' by default) 20 | #DOCROOT=docroot 21 | 22 | # MySQL settings. 23 | # MySQL will be exposed on a random port. Use "fin ps" to check the port. 24 | # To have a static MySQL port assigned, copy the line below into the .docksal/docksal-local.env file 25 | # and replace the host port "0" with a unique host port number (e.g. MYSQL_PORT_MAPPING='33061:3306') 26 | MYSQL_PORT_MAPPING='0:3306' 27 | 28 | # Enable/disable xdebug 29 | # To override locally, copy the two lines below into .docksal/docksal-local.env and adjust as necessary 30 | XDEBUG_ENABLED=0 31 | -------------------------------------------------------------------------------- /.docksal/docksal.yml: -------------------------------------------------------------------------------- 1 | version: "2.1" 2 | 3 | services: 4 | # Selenium2. 5 | browser: 6 | hostname: browser 7 | # Pin selenium (for chromedriver version 73) for now. 8 | # @see https://github.com/docksal/drupal8-contrib/issues/4 9 | image: selenium/standalone-chrome:3.141.59-mercury 10 | dns: 11 | - ${DOCKSAL_DNS1} 12 | - ${DOCKSAL_DNS2} 13 | 14 | cli: 15 | environment: 16 | # Allows browser output URLs generated during tests to be viewable in the 17 | # local browser. 18 | - BROWSERTEST_OUTPUT_BASE_URL=http://${VIRTUAL_HOST} 19 | -------------------------------------------------------------------------------- /.docksal/etc/mysql/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | 3 | # Enable slow query logging 4 | #long_query_time=1 5 | #slow_query_log=1 6 | #slow_query_log_file=/dev/stdout 7 | -------------------------------------------------------------------------------- /.docksal/etc/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; PHP FPM settings 2 | [www] 3 | ; Maximum amount of memory a script may consume 4 | ;php_admin_value[memory_limit] = 256M 5 | -------------------------------------------------------------------------------- /.docksal/etc/php/php.ini: -------------------------------------------------------------------------------- 1 | ; Global PHP settings 2 | [php] 3 | ; Maximum amount of memory a script may consume 4 | ;memory_limit = 1024M 5 | -------------------------------------------------------------------------------- /.docksal/settings/default.settings.local.php: -------------------------------------------------------------------------------- 1 | 'default', 138 | 'username' => 'user', 139 | 'password' => 'user', 140 | 'host' => 'db', 141 | 'driver' => 'mysql', 142 | ); 143 | 144 | // Workaround for permission issues with NFS shares 145 | $settings['file_chmod_directory'] = 0777; 146 | $settings['file_chmod_file'] = 0666; 147 | 148 | # File system settings. 149 | $config['system.file']['path']['temporary'] = '/tmp'; 150 | 151 | // Reverse proxy configuration (Docksal vhost-proxy) 152 | if (PHP_SAPI !== 'cli') { 153 | $settings['reverse_proxy'] = TRUE; 154 | $settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']); 155 | // HTTPS behind reverse-proxy 156 | if ( 157 | isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' && 158 | !empty($settings['reverse_proxy']) && in_array($_SERVER['REMOTE_ADDR'], $settings['reverse_proxy_addresses']) 159 | ) { 160 | $_SERVER['HTTPS'] = 'on'; 161 | // This is hardcoded because there is no header specifying the original port. 162 | $_SERVER['SERVER_PORT'] = 443; 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /.docksal/settings/example.gitignore: -------------------------------------------------------------------------------- 1 | # This file contains default .gitignore rules. To use it, copy it to .gitignore, 2 | # and it will cause files like your settings.php and user-uploaded files to be 3 | # excluded from Git version control. This is a common strategy to avoid 4 | # accidentally including private information in public repositories and patch 5 | # files. 6 | # 7 | # Because .gitignore can be specific to your site, this file has a different 8 | # name; updating Drupal core will not override your custom .gitignore file. 9 | 10 | # Ignore core when managing all of a project's dependencies with Composer 11 | # including Drupal core. 12 | # core 13 | 14 | # Ignore dependencies that are managed with Composer. 15 | # Generally you should only ignore the root vendor directory. It's important 16 | # that core/assets/vendor and any other vendor directories within contrib or 17 | # custom module, theme, etc., are not ignored unless you purposely do so. 18 | /vendor/ 19 | 20 | # Ignore configuration files that may contain sensitive information. 21 | sites/*/settings*.php 22 | sites/*/services*.yml 23 | 24 | # Ignore paths that contain user-generated content. 25 | sites/*/files 26 | sites/*/private 27 | 28 | # Ignore SimpleTest multi-site environment. 29 | sites/simpletest 30 | 31 | # If you prefer to store your .gitignore file in the sites/ folder, comment 32 | # or delete the previous settings and uncomment the following ones, instead. 33 | 34 | # Ignore configuration files that may contain sensitive information. 35 | # */settings*.php 36 | 37 | # Ignore paths that contain user-generated content. 38 | # */files 39 | # */private 40 | 41 | # Ignore SimpleTest multi-site environment. 42 | # simpletest 43 | 44 | # Ignore this file itself. 45 | /.gitignore 46 | -------------------------------------------------------------------------------- /.docksal/settings/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ./tests/TestSuites/UnitTestSuite.php 43 | 44 | 45 | ./tests/TestSuites/KernelTestSuite.php 46 | 47 | 48 | ./tests/TestSuites/FunctionalTestSuite.php 49 | 50 | 51 | ./tests/TestSuites/FunctionalJavascriptTestSuite.php 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | ./includes 65 | ./lib 66 | ./modules 67 | ../modules 68 | ../sites 69 | 70 | */tests/* 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /.docksal/settings/settings.php: -------------------------------------------------------------------------------- 1 | 'databasename', 81 | * 'username' => 'sqlusername', 82 | * 'password' => 'sqlpassword', 83 | * 'host' => 'localhost', 84 | * 'port' => '3306', 85 | * 'driver' => 'mysql', 86 | * 'prefix' => '', 87 | * 'collation' => 'utf8mb4_general_ci', 88 | * ); 89 | * @endcode 90 | */ 91 | $databases = array(); 92 | 93 | /** 94 | * Customizing database settings. 95 | * 96 | * Many of the values of the $databases array can be customized for your 97 | * particular database system. Refer to the sample in the section above as a 98 | * starting point. 99 | * 100 | * The "driver" property indicates what Drupal database driver the 101 | * connection should use. This is usually the same as the name of the 102 | * database type, such as mysql or sqlite, but not always. The other 103 | * properties will vary depending on the driver. For SQLite, you must 104 | * specify a database file name in a directory that is writable by the 105 | * webserver. For most other drivers, you must specify a 106 | * username, password, host, and database name. 107 | * 108 | * Transaction support is enabled by default for all drivers that support it, 109 | * including MySQL. To explicitly disable it, set the 'transactions' key to 110 | * FALSE. 111 | * Note that some configurations of MySQL, such as the MyISAM engine, don't 112 | * support it and will proceed silently even if enabled. If you experience 113 | * transaction related crashes with such configuration, set the 'transactions' 114 | * key to FALSE. 115 | * 116 | * For each database, you may optionally specify multiple "target" databases. 117 | * A target database allows Drupal to try to send certain queries to a 118 | * different database if it can but fall back to the default connection if not. 119 | * That is useful for primary/replica replication, as Drupal may try to connect 120 | * to a replica server when appropriate and if one is not available will simply 121 | * fall back to the single primary server (The terms primary/replica are 122 | * traditionally referred to as master/slave in database server documentation). 123 | * 124 | * The general format for the $databases array is as follows: 125 | * @code 126 | * $databases['default']['default'] = $info_array; 127 | * $databases['default']['replica'][] = $info_array; 128 | * $databases['default']['replica'][] = $info_array; 129 | * $databases['extra']['default'] = $info_array; 130 | * @endcode 131 | * 132 | * In the above example, $info_array is an array of settings described above. 133 | * The first line sets a "default" database that has one primary database 134 | * (the second level default). The second and third lines create an array 135 | * of potential replica databases. Drupal will select one at random for a given 136 | * request as needed. The fourth line creates a new database with a name of 137 | * "extra". 138 | * 139 | * You can optionally set prefixes for some or all database table names 140 | * by using the 'prefix' setting. If a prefix is specified, the table 141 | * name will be prepended with its value. Be sure to use valid database 142 | * characters only, usually alphanumeric and underscore. If no prefixes 143 | * are desired, leave it as an empty string ''. 144 | * 145 | * To have all database names prefixed, set 'prefix' as a string: 146 | * @code 147 | * 'prefix' => 'main_', 148 | * @endcode 149 | * 150 | * Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in 151 | * Drupal 9.0. After that, only a single prefix for all tables will be 152 | * supported. 153 | * 154 | * To provide prefixes for specific tables, set 'prefix' as an array. 155 | * The array's keys are the table names and the values are the prefixes. 156 | * The 'default' element is mandatory and holds the prefix for any tables 157 | * not specified elsewhere in the array. Example: 158 | * @code 159 | * 'prefix' => array( 160 | * 'default' => 'main_', 161 | * 'users' => 'shared_', 162 | * 'sessions' => 'shared_', 163 | * 'role' => 'shared_', 164 | * 'authmap' => 'shared_', 165 | * ), 166 | * @endcode 167 | * You can also use a reference to a schema/database as a prefix. This may be 168 | * useful if your Drupal installation exists in a schema that is not the default 169 | * or you want to access several databases from the same code base at the same 170 | * time. 171 | * Example: 172 | * @code 173 | * 'prefix' => array( 174 | * 'default' => 'main.', 175 | * 'users' => 'shared.', 176 | * 'sessions' => 'shared.', 177 | * 'role' => 'shared.', 178 | * 'authmap' => 'shared.', 179 | * ); 180 | * @endcode 181 | * NOTE: MySQL and SQLite's definition of a schema is a database. 182 | * 183 | * Advanced users can add or override initial commands to execute when 184 | * connecting to the database server, as well as PDO connection settings. For 185 | * example, to enable MySQL SELECT queries to exceed the max_join_size system 186 | * variable, and to reduce the database connection timeout to 5 seconds: 187 | * @code 188 | * $databases['default']['default'] = array( 189 | * 'init_commands' => array( 190 | * 'big_selects' => 'SET SQL_BIG_SELECTS=1', 191 | * ), 192 | * 'pdo' => array( 193 | * PDO::ATTR_TIMEOUT => 5, 194 | * ), 195 | * ); 196 | * @endcode 197 | * 198 | * WARNING: The above defaults are designed for database portability. Changing 199 | * them may cause unexpected behavior, including potential data loss. See 200 | * https://www.drupal.org/developing/api/database/configuration for more 201 | * information on these defaults and the potential issues. 202 | * 203 | * More details can be found in the constructor methods for each driver: 204 | * - \Drupal\Core\Database\Driver\mysql\Connection::__construct() 205 | * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct() 206 | * - \Drupal\Core\Database\Driver\sqlite\Connection::__construct() 207 | * 208 | * Sample Database configuration format for PostgreSQL (pgsql): 209 | * @code 210 | * $databases['default']['default'] = array( 211 | * 'driver' => 'pgsql', 212 | * 'database' => 'databasename', 213 | * 'username' => 'sqlusername', 214 | * 'password' => 'sqlpassword', 215 | * 'host' => 'localhost', 216 | * 'prefix' => '', 217 | * ); 218 | * @endcode 219 | * 220 | * Sample Database configuration format for SQLite (sqlite): 221 | * @code 222 | * $databases['default']['default'] = array( 223 | * 'driver' => 'sqlite', 224 | * 'database' => '/path/to/databasefilename', 225 | * ); 226 | * @endcode 227 | */ 228 | 229 | /** 230 | * Location of the site configuration files. 231 | * 232 | * The $config_directories array specifies the location of file system 233 | * directories used for configuration data. On install, the "sync" directory is 234 | * created. This is used for configuration imports. The "active" directory is 235 | * not created by default since the default storage for active configuration is 236 | * the database rather than the file system. (This can be changed. See "Active 237 | * configuration settings" below). 238 | * 239 | * The default location for the "sync" directory is inside a randomly-named 240 | * directory in the public files path. The setting below allows you to override 241 | * the "sync" location. 242 | * 243 | * If you use files for the "active" configuration, you can tell the 244 | * Configuration system where this directory is located by adding an entry with 245 | * array key CONFIG_ACTIVE_DIRECTORY. 246 | * 247 | * Example: 248 | * @code 249 | * $config_directories = array( 250 | * CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot', 251 | * ); 252 | * @endcode 253 | */ 254 | $config_directories = array( 255 | CONFIG_SYNC_DIRECTORY => dirname($app_root) . '/config/' . basename($site_path), 256 | ); 257 | 258 | /** 259 | * Settings: 260 | * 261 | * $settings contains environment-specific configuration, such as the files 262 | * directory and reverse proxy address, and temporary configuration, such as 263 | * security overrides. 264 | * 265 | * @see \Drupal\Core\Site\Settings::get() 266 | */ 267 | 268 | /** 269 | * The active installation profile. 270 | * 271 | * Changing this after installation is not recommended as it changes which 272 | * directories are scanned during extension discovery. If this is set prior to 273 | * installation this value will be rewritten according to the profile selected 274 | * by the user. 275 | * 276 | * @see install_select_profile() 277 | * 278 | * @deprecated in Drupal 8.3.0 and will be removed before Drupal 9.0.0. The 279 | * install profile is written to the core.extension configuration. If a 280 | * service requires the install profile use the 'install_profile' container 281 | * parameter. Functional code can use \Drupal::installProfile(). 282 | */ 283 | $settings['install_profile'] = 'standard'; 284 | 285 | /** 286 | * Salt for one-time login links, cancel links, form tokens, etc. 287 | * 288 | * This variable will be set to a random value by the installer. All one-time 289 | * login links will be invalidated if the value is changed. Note that if your 290 | * site is deployed on a cluster of web servers, you must ensure that this 291 | * variable has the same value on each server. 292 | * 293 | * For enhanced security, you may set this variable to the contents of a file 294 | * outside your document root; you should also ensure that this file is not 295 | * stored with backups of your database. 296 | * 297 | * Example: 298 | * @code 299 | * $settings['hash_salt'] = file_get_contents('/home/example/salt.txt'); 300 | * @endcode 301 | */ 302 | $settings['hash_salt'] = 'ts3MpgAEZcYSm0_tCkJgrYiEMg1rRSHPzyrXRHLGTg7uBOHXRojaOnIfu1sQJO4hWxZVGJSqTA'; 303 | 304 | /** 305 | * Deployment identifier. 306 | * 307 | * Drupal's dependency injection container will be automatically invalidated and 308 | * rebuilt when the Drupal core version changes. When updating contributed or 309 | * custom code that changes the container, changing this identifier will also 310 | * allow the container to be invalidated as soon as code is deployed. 311 | */ 312 | # $settings['deployment_identifier'] = \Drupal::VERSION; 313 | 314 | /** 315 | * Access control for update.php script. 316 | * 317 | * If you are updating your Drupal installation using the update.php script but 318 | * are not logged in using either an account with the "Administer software 319 | * updates" permission or the site maintenance account (the account that was 320 | * created during installation), you will need to modify the access check 321 | * statement below. Change the FALSE to a TRUE to disable the access check. 322 | * After finishing the upgrade, be sure to open this file again and change the 323 | * TRUE back to a FALSE! 324 | */ 325 | $settings['update_free_access'] = FALSE; 326 | 327 | /** 328 | * External access proxy settings: 329 | * 330 | * If your site must access the Internet via a web proxy then you can enter the 331 | * proxy settings here. Set the full URL of the proxy, including the port, in 332 | * variables: 333 | * - $settings['http_client_config']['proxy']['http']: The proxy URL for HTTP 334 | * requests. 335 | * - $settings['http_client_config']['proxy']['https']: The proxy URL for HTTPS 336 | * requests. 337 | * You can pass in the user name and password for basic authentication in the 338 | * URLs in these settings. 339 | * 340 | * You can also define an array of host names that can be accessed directly, 341 | * bypassing the proxy, in $settings['http_client_config']['proxy']['no']. 342 | */ 343 | # $settings['http_client_config']['proxy']['http'] = 'http://proxy_user:proxy_pass@example.com:8080'; 344 | # $settings['http_client_config']['proxy']['https'] = 'http://proxy_user:proxy_pass@example.com:8080'; 345 | # $settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost']; 346 | 347 | /** 348 | * Reverse Proxy Configuration: 349 | * 350 | * Reverse proxy servers are often used to enhance the performance 351 | * of heavily visited sites and may also provide other site caching, 352 | * security, or encryption benefits. In an environment where Drupal 353 | * is behind a reverse proxy, the real IP address of the client should 354 | * be determined such that the correct client IP address is available 355 | * to Drupal's logging, statistics, and access management systems. In 356 | * the most simple scenario, the proxy server will add an 357 | * X-Forwarded-For header to the request that contains the client IP 358 | * address. However, HTTP headers are vulnerable to spoofing, where a 359 | * malicious client could bypass restrictions by setting the 360 | * X-Forwarded-For header directly. Therefore, Drupal's proxy 361 | * configuration requires the IP addresses of all remote proxies to be 362 | * specified in $settings['reverse_proxy_addresses'] to work correctly. 363 | * 364 | * Enable this setting to get Drupal to determine the client IP from 365 | * the X-Forwarded-For header (or $settings['reverse_proxy_header'] if set). 366 | * If you are unsure about this setting, do not have a reverse proxy, 367 | * or Drupal operates in a shared hosting environment, this setting 368 | * should remain commented out. 369 | * 370 | * In order for this setting to be used you must specify every possible 371 | * reverse proxy IP address in $settings['reverse_proxy_addresses']. 372 | * If a complete list of reverse proxies is not available in your 373 | * environment (for example, if you use a CDN) you may set the 374 | * $_SERVER['REMOTE_ADDR'] variable directly in settings.php. 375 | * Be aware, however, that it is likely that this would allow IP 376 | * address spoofing unless more advanced precautions are taken. 377 | */ 378 | # $settings['reverse_proxy'] = TRUE; 379 | 380 | /** 381 | * Specify every reverse proxy IP address in your environment. 382 | * This setting is required if $settings['reverse_proxy'] is TRUE. 383 | */ 384 | # $settings['reverse_proxy_addresses'] = array('a.b.c.d', ...); 385 | 386 | /** 387 | * Set this value if your proxy server sends the client IP in a header 388 | * other than X-Forwarded-For. 389 | */ 390 | # $settings['reverse_proxy_header'] = 'X_CLUSTER_CLIENT_IP'; 391 | 392 | /** 393 | * Set this value if your proxy server sends the client protocol in a header 394 | * other than X-Forwarded-Proto. 395 | */ 396 | # $settings['reverse_proxy_proto_header'] = 'X_FORWARDED_PROTO'; 397 | 398 | /** 399 | * Set this value if your proxy server sends the client protocol in a header 400 | * other than X-Forwarded-Host. 401 | */ 402 | # $settings['reverse_proxy_host_header'] = 'X_FORWARDED_HOST'; 403 | 404 | /** 405 | * Set this value if your proxy server sends the client protocol in a header 406 | * other than X-Forwarded-Port. 407 | */ 408 | # $settings['reverse_proxy_port_header'] = 'X_FORWARDED_PORT'; 409 | 410 | /** 411 | * Set this value if your proxy server sends the client protocol in a header 412 | * other than Forwarded. 413 | */ 414 | # $settings['reverse_proxy_forwarded_header'] = 'FORWARDED'; 415 | 416 | /** 417 | * Page caching: 418 | * 419 | * By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page 420 | * views. This tells a HTTP proxy that it may return a page from its local 421 | * cache without contacting the web server, if the user sends the same Cookie 422 | * header as the user who originally requested the cached page. Without "Vary: 423 | * Cookie", authenticated users would also be served the anonymous page from 424 | * the cache. If the site has mostly anonymous users except a few known 425 | * editors/administrators, the Vary header can be omitted. This allows for 426 | * better caching in HTTP proxies (including reverse proxies), i.e. even if 427 | * clients send different cookies, they still get content served from the cache. 428 | * However, authenticated users should access the site directly (i.e. not use an 429 | * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid 430 | * getting cached pages from the proxy. 431 | */ 432 | # $settings['omit_vary_cookie'] = TRUE; 433 | 434 | 435 | /** 436 | * Cache TTL for client error (4xx) responses. 437 | * 438 | * Items cached per-URL tend to result in a large number of cache items, and 439 | * this can be problematic on 404 pages which by their nature are unbounded. A 440 | * fixed TTL can be set for these items, defaulting to one hour, so that cache 441 | * backends which do not support LRU can purge older entries. To disable caching 442 | * of client error responses set the value to 0. Currently applies only to 443 | * page_cache module. 444 | */ 445 | # $settings['cache_ttl_4xx'] = 3600; 446 | 447 | /** 448 | * Expiration of cached forms. 449 | * 450 | * Drupal's Form API stores details of forms in a cache and these entries are 451 | * kept for at least 6 hours by default. Expired entries are cleared by cron. 452 | * 453 | * @see \Drupal\Core\Form\FormCache::setCache() 454 | */ 455 | # $settings['form_cache_expiration'] = 21600; 456 | 457 | /** 458 | * Class Loader. 459 | * 460 | * If the APC extension is detected, the Symfony APC class loader is used for 461 | * performance reasons. Detection can be prevented by setting 462 | * class_loader_auto_detect to false, as in the example below. 463 | */ 464 | # $settings['class_loader_auto_detect'] = FALSE; 465 | 466 | /* 467 | * If the APC extension is not detected, either because APC is missing or 468 | * because auto-detection has been disabled, auto-loading falls back to 469 | * Composer's ClassLoader, which is good for development as it does not break 470 | * when code is moved in the file system. You can also decorate the base class 471 | * loader with another cached solution than the Symfony APC class loader, as 472 | * all production sites should have a cached class loader of some sort enabled. 473 | * 474 | * To do so, you may decorate and replace the local $class_loader variable. For 475 | * example, to use Symfony's APC class loader without automatic detection, 476 | * uncomment the code below. 477 | */ 478 | /* 479 | if ($settings['hash_salt']) { 480 | $prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']); 481 | $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader); 482 | unset($prefix); 483 | $class_loader->unregister(); 484 | $apc_loader->register(); 485 | $class_loader = $apc_loader; 486 | } 487 | */ 488 | 489 | /** 490 | * Authorized file system operations: 491 | * 492 | * The Update Manager module included with Drupal provides a mechanism for 493 | * site administrators to securely install missing updates for the site 494 | * directly through the web user interface. On securely-configured servers, 495 | * the Update manager will require the administrator to provide SSH or FTP 496 | * credentials before allowing the installation to proceed; this allows the 497 | * site to update the new files as the user who owns all the Drupal files, 498 | * instead of as the user the webserver is running as. On servers where the 499 | * webserver user is itself the owner of the Drupal files, the administrator 500 | * will not be prompted for SSH or FTP credentials (note that these server 501 | * setups are common on shared hosting, but are inherently insecure). 502 | * 503 | * Some sites might wish to disable the above functionality, and only update 504 | * the code directly via SSH or FTP themselves. This setting completely 505 | * disables all functionality related to these authorized file operations. 506 | * 507 | * @see https://www.drupal.org/node/244924 508 | * 509 | * Remove the leading hash signs to disable. 510 | */ 511 | # $settings['allow_authorize_operations'] = FALSE; 512 | 513 | /** 514 | * Default mode for directories and files written by Drupal. 515 | * 516 | * Value should be in PHP Octal Notation, with leading zero. 517 | */ 518 | # $settings['file_chmod_directory'] = 0775; 519 | # $settings['file_chmod_file'] = 0664; 520 | 521 | /** 522 | * Public file base URL: 523 | * 524 | * An alternative base URL to be used for serving public files. This must 525 | * include any leading directory path. 526 | * 527 | * A different value from the domain used by Drupal to be used for accessing 528 | * public files. This can be used for a simple CDN integration, or to improve 529 | * security by serving user-uploaded files from a different domain or subdomain 530 | * pointing to the same server. Do not include a trailing slash. 531 | */ 532 | # $settings['file_public_base_url'] = 'http://downloads.example.com/files'; 533 | 534 | /** 535 | * Public file path: 536 | * 537 | * A local file system path where public files will be stored. This directory 538 | * must exist and be writable by Drupal. This directory must be relative to 539 | * the Drupal installation directory and be accessible over the web. 540 | */ 541 | # $settings['file_public_path'] = 'sites/default/files'; 542 | 543 | /** 544 | * Private file path: 545 | * 546 | * A local file system path where private files will be stored. This directory 547 | * must be absolute, outside of the Drupal installation directory and not 548 | * accessible over the web. 549 | * 550 | * Note: Caches need to be cleared when this value is changed to make the 551 | * private:// stream wrapper available to the system. 552 | * 553 | * See https://www.drupal.org/documentation/modules/file for more information 554 | * about securing private files. 555 | */ 556 | # $settings['file_private_path'] = ''; 557 | 558 | /** 559 | * Session write interval: 560 | * 561 | * Set the minimum interval between each session write to database. 562 | * For performance reasons it defaults to 180. 563 | */ 564 | # $settings['session_write_interval'] = 180; 565 | 566 | /** 567 | * String overrides: 568 | * 569 | * To override specific strings on your site with or without enabling the Locale 570 | * module, add an entry to this list. This functionality allows you to change 571 | * a small number of your site's default English language interface strings. 572 | * 573 | * Remove the leading hash signs to enable. 574 | * 575 | * The "en" part of the variable name, is dynamic and can be any langcode of 576 | * any added language. (eg locale_custom_strings_de for german). 577 | */ 578 | # $settings['locale_custom_strings_en'][''] = array( 579 | # 'forum' => 'Discussion board', 580 | # '@count min' => '@count minutes', 581 | # ); 582 | 583 | /** 584 | * A custom theme for the offline page: 585 | * 586 | * This applies when the site is explicitly set to maintenance mode through the 587 | * administration page or when the database is inactive due to an error. 588 | * The template file should also be copied into the theme. It is located inside 589 | * 'core/modules/system/templates/maintenance-page.html.twig'. 590 | * 591 | * Note: This setting does not apply to installation and update pages. 592 | */ 593 | # $settings['maintenance_theme'] = 'bartik'; 594 | 595 | /** 596 | * PHP settings: 597 | * 598 | * To see what PHP settings are possible, including whether they can be set at 599 | * runtime (by using ini_set()), read the PHP documentation: 600 | * http://php.net/manual/ini.list.php 601 | * See \Drupal\Core\DrupalKernel::bootEnvironment() for required runtime 602 | * settings and the .htaccess file for non-runtime settings. 603 | * Settings defined there should not be duplicated here so as to avoid conflict 604 | * issues. 605 | */ 606 | 607 | /** 608 | * If you encounter a situation where users post a large amount of text, and 609 | * the result is stripped out upon viewing but can still be edited, Drupal's 610 | * output filter may not have sufficient memory to process it. If you 611 | * experience this issue, you may wish to uncomment the following two lines 612 | * and increase the limits of these variables. For more information, see 613 | * http://php.net/manual/pcre.configuration.php. 614 | */ 615 | # ini_set('pcre.backtrack_limit', 200000); 616 | # ini_set('pcre.recursion_limit', 200000); 617 | 618 | /** 619 | * Active configuration settings. 620 | * 621 | * By default, the active configuration is stored in the database in the 622 | * {config} table. To use a different storage mechanism for the active 623 | * configuration, do the following prior to installing: 624 | * - Create an "active" directory and declare its path in $config_directories 625 | * as explained under the 'Location of the site configuration files' section 626 | * above in this file. To enhance security, you can declare a path that is 627 | * outside your document root. 628 | * - Override the 'bootstrap_config_storage' setting here. It must be set to a 629 | * callable that returns an object that implements 630 | * \Drupal\Core\Config\StorageInterface. 631 | * - Override the service definition 'config.storage.active'. Put this 632 | * override in a services.yml file in the same directory as settings.php 633 | * (definitions in this file will override service definition defaults). 634 | */ 635 | # $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage'); 636 | 637 | /** 638 | * Configuration overrides. 639 | * 640 | * To globally override specific configuration values for this site, 641 | * set them here. You usually don't need to use this feature. This is 642 | * useful in a configuration file for a vhost or directory, rather than 643 | * the default settings.php. 644 | * 645 | * Note that any values you provide in these variable overrides will not be 646 | * viewable from the Drupal administration interface. The administration 647 | * interface displays the values stored in configuration so that you can stage 648 | * changes to other environments that don't have the overrides. 649 | * 650 | * There are particular configuration values that are risky to override. For 651 | * example, overriding the list of installed modules in 'core.extension' is not 652 | * supported as module install or uninstall has not occurred. Other examples 653 | * include field storage configuration, because it has effects on database 654 | * structure, and 'core.menu.static_menu_link_overrides' since this is cached in 655 | * a way that is not config override aware. Also, note that changing 656 | * configuration values in settings.php will not fire any of the configuration 657 | * change events. 658 | */ 659 | # $config['system.file']['path']['temporary'] = '/tmp'; 660 | # $config['system.site']['name'] = 'My Drupal site'; 661 | # $config['system.theme']['default'] = 'stark'; 662 | # $config['user.settings']['anonymous'] = 'Visitor'; 663 | 664 | /** 665 | * Fast 404 pages: 666 | * 667 | * Drupal can generate fully themed 404 pages. However, some of these responses 668 | * are for images or other resource files that are not displayed to the user. 669 | * This can waste bandwidth, and also generate server load. 670 | * 671 | * The options below return a simple, fast 404 page for URLs matching a 672 | * specific pattern: 673 | * - $config['system.performance']['fast_404']['exclude_paths']: A regular 674 | * expression to match paths to exclude, such as images generated by image 675 | * styles, or dynamically-resized images. The default pattern provided below 676 | * also excludes the private file system. If you need to add more paths, you 677 | * can add '|path' to the expression. 678 | * - $config['system.performance']['fast_404']['paths']: A regular expression to 679 | * match paths that should return a simple 404 page, rather than the fully 680 | * themed 404 page. If you don't have any aliases ending in htm or html you 681 | * can add '|s?html?' to the expression. 682 | * - $config['system.performance']['fast_404']['html']: The html to return for 683 | * simple 404 pages. 684 | * 685 | * Remove the leading hash signs if you would like to alter this functionality. 686 | */ 687 | # $config['system.performance']['fast_404']['exclude_paths'] = '/\/(?:styles)|(?:system\/files)\//'; 688 | # $config['system.performance']['fast_404']['paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; 689 | # $config['system.performance']['fast_404']['html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; 690 | 691 | /** 692 | * Load services definition file. 693 | */ 694 | $settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml'; 695 | 696 | /** 697 | * Override the default service container class. 698 | * 699 | * This is useful for example to trace the service container for performance 700 | * tracking purposes, for testing a service container with an error condition or 701 | * to test a service container that throws an exception. 702 | */ 703 | # $settings['container_base_class'] = '\Drupal\Core\DependencyInjection\Container'; 704 | 705 | /** 706 | * Override the default yaml parser class. 707 | * 708 | * Provide a fully qualified class name here if you would like to provide an 709 | * alternate implementation YAML parser. The class must implement the 710 | * \Drupal\Component\Serialization\SerializationInterface interface. 711 | */ 712 | # $settings['yaml_parser_class'] = NULL; 713 | 714 | /** 715 | * Trusted host configuration. 716 | * 717 | * Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host 718 | * header spoofing. 719 | * 720 | * To enable the trusted host mechanism, you enable your allowable hosts 721 | * in $settings['trusted_host_patterns']. This should be an array of regular 722 | * expression patterns, without delimiters, representing the hosts you would 723 | * like to allow. 724 | * 725 | * For example: 726 | * @code 727 | * $settings['trusted_host_patterns'] = array( 728 | * '^www\.example\.com$', 729 | * ); 730 | * @endcode 731 | * will allow the site to only run from www.example.com. 732 | * 733 | * If you are running multisite, or if you are running your site from 734 | * different domain names (eg, you don't redirect http://www.example.com to 735 | * http://example.com), you should specify all of the host patterns that are 736 | * allowed by your site. 737 | * 738 | * For example: 739 | * @code 740 | * $settings['trusted_host_patterns'] = array( 741 | * '^example\.com$', 742 | * '^.+\.example\.com$', 743 | * '^example\.org$', 744 | * '^.+\.example\.org$', 745 | * ); 746 | * @endcode 747 | * will allow the site to run off of all variants of example.com and 748 | * example.org, with all subdomains included. 749 | */ 750 | 751 | /** 752 | * The default list of directories that will be ignored by Drupal's file API. 753 | * 754 | * By default ignore node_modules and bower_components folders to avoid issues 755 | * with common frontend tools and recursive scanning of directories looking for 756 | * extensions. 757 | * 758 | * @see file_scan_directory() 759 | * @see \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory() 760 | */ 761 | $settings['file_scan_ignore_directories'] = [ 762 | 'node_modules', 763 | 'bower_components', 764 | ]; 765 | 766 | /** 767 | * The default number of entities to update in a batch process. 768 | * 769 | * This is used by update and post-update functions that need to go through and 770 | * change all the entities on a site, so it is useful to increase this number 771 | * if your hosting configuration (i.e. RAM allocation, CPU speed) allows for a 772 | * larger number of entities to be processed in a single batch run. 773 | */ 774 | $settings['entity_update_batch_size'] = 50; 775 | 776 | /** 777 | * Load local development override configuration, if available. 778 | * 779 | * Use settings.local.php to override variables on secondary (staging, 780 | * development, etc) installations of this site. Typically used to disable 781 | * caching, JavaScript/CSS compression, re-routing of outgoing emails, and 782 | * other things that should not happen on development and testing sites. 783 | * 784 | * Keep this code block at the end of this file to take full effect. 785 | */ 786 | 787 | if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { 788 | include $app_root . '/' . $site_path . '/settings.local.php'; 789 | } 790 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore binaries. 2 | /bin 3 | 4 | .idea/ 5 | docker-compose.yml 6 | docroot 7 | docroot/sites/*/settings.local.php 8 | docroot/sites/*/files 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: bionic 2 | 3 | language: minimal 4 | 5 | install: 6 | - curl -fsSL https://get.docksal.io | bash 7 | - fin version 8 | - fin sysinfo 9 | 10 | before_script: 11 | - fin init 12 | 13 | script: 14 | - fin test 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docksal powered Drupal 8 Core Contribution Installation 2 | 3 | This is a Drupal 8 installation geared for local Core and Contrib development 4 | for use with Docksal. 5 | 6 | [![Build status](https://travis-ci.org/jhedstrom/drupal8-contrib.svg?branch=master)](https://travis-ci.org/jhedstrom/drupal8-contrib?branch=master) 7 | 8 | Features: 9 | 10 | - Core Drupal 8 repository for local contribution development 11 | - `fin init` [example](.docksal/commands/init) 12 | - Using the [default](.docksal/docksal.env#L9) Docksal LAMP stack with [image version pinning](.docksal/docksal.env#L13-L15) 13 | - PHP and MySQL settings overrides [examples](.docksal/etc) 14 | - Drush aliases [example](drush/aliases.drushrc.php) (`drush @docksal status`) 15 | 16 | ## Setup instructions 17 | 18 | ### Step #1: Docksal environment setup 19 | 20 | **This is a one time setup - skip this if you already have a working Docksal environment.** 21 | 22 | Follow [Docksal environment setup instructions](https://docs.docksal.io/en/master/getting-started/env-setup) 23 | 24 | ### Step #2: Project setup 25 | 26 | 1. Clone this repo into your Projects directory 27 | 28 | ``` 29 | git clone https://github.com/docksal/drupal8-contrib.git drupal8 30 | cd drupal8 31 | ``` 32 | 33 | 2. Initialize the site 34 | 35 | This will clone the core repository into `docroot`, initialize local 36 | settings and install the site via drush 37 | 38 | ``` 39 | fin init 40 | ``` 41 | 42 | 3. Point your browser to 43 | 44 | ``` 45 | http://drupal8.docksal 46 | ``` 47 | 48 | When the automated install is complete the command line output will display the admin username and password. 49 | 50 | ### Step #3: Contributing to core! 51 | 52 | 1. Find and issue, and create a local branch in the `docroot` folder: 53 | 54 | ``` 55 | cd docroot 56 | git checkout -b 12345-short-description 57 | ``` 58 | 59 | where `12345` is the issue number, and `short-description` is just something to remind you of the issue. 60 | 61 | 2. Apply the patch from the issue if it exists. 62 | 63 | 3. Run any relevant phpunit tests locally: 64 | 65 | ``` 66 | fin phpunit path/to/file/or/directory 67 | ``` 68 | 69 | for instance: 70 | 71 | ``` 72 | fin phpunit core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php 73 | ``` 74 | 75 | **Note**: it is not advisable to simply run `fin phpunit` as this will run _all_ the core tests, which can take hours locally. 76 | 77 | ## Security notice 78 | 79 | This repo is intended for local core contributions and includes a hardcoded value for `hash_salt` in `settings.php`. 80 | **You should not base your project off of this code base**. If you do for whatever reason, make sure you regenerate and 81 | update the `hash_salt` value. A new value can be generated with `drush ev '$hash = Drupal\Component\Utility\Crypt::randomBytesBase64(55); print $hash . "\n";'` 82 | -------------------------------------------------------------------------------- /config/default/.htaccess: -------------------------------------------------------------------------------- 1 | # Deny all requests from Apache 2.4+. 2 | 3 | Require all denied 4 | 5 | 6 | # Deny all requests from Apache 2.0-2.2. 7 | 8 | Deny from all 9 | 10 | # Turn off all options we don't need. 11 | Options -Indexes -ExecCGI -Includes -MultiViews 12 | 13 | # Set the catch-all handler to prevent scripts from being executed. 14 | SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 15 | 16 | # Override the handler again if we're run later in the evaluation list. 17 | SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 18 | 19 | 20 | # If we know how to do it safely, disable the PHP engine entirely. 21 | 22 | php_flag engine off 23 | -------------------------------------------------------------------------------- /config/default/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync. For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config -------------------------------------------------------------------------------- /drush/aliases.drushrc.php: -------------------------------------------------------------------------------- 1 | '/var/www/docroot', 6 | 'uri' => 'drupal8.docksal', 7 | ); 8 | --------------------------------------------------------------------------------