Loads code for subsystems and modules, and registers stream wrappers.
function _drupal_bootstrap_code() {
require_once __DIR__ . '/../../' . settings()
->get('path_inc', 'core/includes/path.inc');
require_once __DIR__ . '/theme.inc';
require_once __DIR__ . '/pager.inc';
require_once __DIR__ . '/../../' . settings()
->get('menu_inc', 'core/includes/menu.inc');
require_once __DIR__ . '/tablesort.inc';
require_once __DIR__ . '/file.inc';
require_once __DIR__ . '/unicode.inc';
require_once __DIR__ . '/image.inc';
require_once __DIR__ . '/form.inc';
require_once __DIR__ . '/mail.inc';
require_once __DIR__ . '/ajax.inc';
require_once __DIR__ . '/errors.inc';
require_once __DIR__ . '/schema.inc';
require_once __DIR__ . '/entity.inc';
// Load all enabled modules
Drupal::moduleHandler()
->loadAll();
// Make sure all stream wrappers are registered.
file_get_stream_wrappers();
// Now that stream wrappers are registered, log fatal errors from a simpletest
// child site to a test specific file directory.
$test_info =& $GLOBALS['drupal_test_info'];
if (!empty($test_info['in_child_site'])) {
ini_set('log_errors', 1);
ini_set('error_log', 'public://error.log');
}
// Set the allowed protocols once we have the config available.
$allowed_protocols = \Drupal::config('system.filter')
->get('protocols');
if (!isset($allowed_protocols)) {
// filter_xss_admin() is called by the installer and update.php, in which
// case the configuration may not exist (yet). Provide a minimal default set
// of allowed protocols for these cases.
$allowed_protocols = array(
'http',
'https',
);
}
UrlValidator::setAllowedProtocols($allowed_protocols);
}