Merge branch '1400748-namespaces' into dbtngtng
commit
3f0cb723a0
|
@ -2294,7 +2294,7 @@ function _drupal_bootstrap_configuration() {
|
||||||
// Register explicit vendor namespaces.
|
// Register explicit vendor namespaces.
|
||||||
$loader->registerNamespaces(array(
|
$loader->registerNamespaces(array(
|
||||||
// All Symfony-borrowed code lives in /core/includes/Symfony.
|
// All Symfony-borrowed code lives in /core/includes/Symfony.
|
||||||
'Symfony' => DRUPAL_ROOT . '/core/includes',
|
'Symfony' => DRUPAL_ROOT . '/core/vendor',
|
||||||
));
|
));
|
||||||
// Register the Drupal namespace for classes in core as a fallback.
|
// Register the Drupal namespace for classes in core as a fallback.
|
||||||
// This allows to register additional namespaces within the Drupal namespace
|
// This allows to register additional namespaces within the Drupal namespace
|
||||||
|
@ -2304,7 +2304,7 @@ function _drupal_bootstrap_configuration() {
|
||||||
// register/overload namespaces in Drupal core.
|
// register/overload namespaces in Drupal core.
|
||||||
$loader->registerNamespaceFallbacks(array(
|
$loader->registerNamespaceFallbacks(array(
|
||||||
// All Drupal-namespaced code in core lives in /core/includes/Drupal.
|
// All Drupal-namespaced code in core lives in /core/includes/Drupal.
|
||||||
'Drupal' => DRUPAL_ROOT . '/core/includes',
|
'Drupal' => DRUPAL_ROOT . '/core/lib',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3022,7 +3022,7 @@ function drupal_get_complete_schema($rebuild = FALSE) {
|
||||||
*/
|
*/
|
||||||
function drupal_classloader() {
|
function drupal_classloader() {
|
||||||
// Include the Symfony ClassLoader for loading PSR-0-compatible classes.
|
// Include the Symfony ClassLoader for loading PSR-0-compatible classes.
|
||||||
require_once DRUPAL_ROOT . '/core/includes/Symfony/Component/ClassLoader/UniversalClassLoader.php';
|
require_once DRUPAL_ROOT . '/core/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
|
||||||
|
|
||||||
// By default, use the UniversalClassLoader which is best for development,
|
// By default, use the UniversalClassLoader which is best for development,
|
||||||
// as it does not break when code is moved on the file system. However, as it
|
// as it does not break when code is moved on the file system. However, as it
|
||||||
|
@ -3034,7 +3034,7 @@ function drupal_classloader() {
|
||||||
switch (variable_get('autoloader_mode', 'default')) {
|
switch (variable_get('autoloader_mode', 'default')) {
|
||||||
case 'apc':
|
case 'apc':
|
||||||
if (function_exists('apc_store')) {
|
if (function_exists('apc_store')) {
|
||||||
require_once DRUPAL_ROOT . '/core/includes/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php';
|
require_once DRUPAL_ROOT . '/core/vendor/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php';
|
||||||
$loader = new ApcUniversalClassLoader('drupal.' . $GLOBALS['drupal_hash_salt']);
|
$loader = new ApcUniversalClassLoader('drupal.' . $GLOBALS['drupal_hash_salt']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,10 @@
|
||||||
* The cache bin for which the cache object should be returned, defaults to
|
* The cache bin for which the cache object should be returned, defaults to
|
||||||
* 'cache'.
|
* 'cache'.
|
||||||
*
|
*
|
||||||
* @return Drupal\Cache\CacheBackendInterface
|
* @return Drupal\Core\Cache\CacheBackendInterface
|
||||||
* The cache object associated with the specified bin.
|
* The cache object associated with the specified bin.
|
||||||
*
|
*
|
||||||
* @see Drupal\Cache\CacheBackendInterface
|
* @see Drupal\Core\Cache\CacheBackendInterface
|
||||||
*/
|
*/
|
||||||
function cache($bin = 'cache') {
|
function cache($bin = 'cache') {
|
||||||
// Temporary backwards compatibiltiy layer, allow old style prefixed cache
|
// Temporary backwards compatibiltiy layer, allow old style prefixed cache
|
||||||
|
@ -34,7 +34,7 @@ function cache($bin = 'cache') {
|
||||||
if (!isset($cache_objects[$bin])) {
|
if (!isset($cache_objects[$bin])) {
|
||||||
$class = variable_get('cache_class_' . $bin);
|
$class = variable_get('cache_class_' . $bin);
|
||||||
if (!isset($class)) {
|
if (!isset($class)) {
|
||||||
$class = variable_get('cache_default_class', 'Drupal\Cache\DatabaseBackend');
|
$class = variable_get('cache_default_class', 'Drupal\Core\Cache\DatabaseBackend');
|
||||||
}
|
}
|
||||||
$cache_objects[$bin] = new $class($bin);
|
$cache_objects[$bin] = new $class($bin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
Drupal Components are independent libraries that do not depend on the rest of
|
||||||
|
Drupal in order to function. Components MAY depend on other Components, but
|
||||||
|
that is discouraged. Components MAY NOT depend on any code that is not part of
|
||||||
|
PHP itself or another Drupal component.
|
||||||
|
|
||||||
|
Each Component should be in its own namespace, and should be as self-contained
|
||||||
|
as possible. It should be possible to split a Component off to its own
|
||||||
|
repository and use as a stand-alone library, independently of Drupal.
|
|
@ -5,7 +5,7 @@
|
||||||
* Definition of CacheBackendInterface.
|
* Definition of CacheBackendInterface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Drupal\Cache;
|
namespace Drupal\Core\Cache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines an interface for cache implementations.
|
* Defines an interface for cache implementations.
|
|
@ -5,7 +5,7 @@
|
||||||
* Definition of DatabaseBackend.
|
* Definition of DatabaseBackend.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Drupal\Cache;
|
namespace Drupal\Core\Cache;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* Definition of InstallBackend.
|
* Definition of InstallBackend.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Drupal\Cache;
|
namespace Drupal\Core\Cache;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* Definition of NullBackend.
|
* Definition of NullBackend.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Drupal\Cache;
|
namespace Drupal\Core\Cache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a stub cache implementation.
|
* Defines a stub cache implementation.
|
|
@ -0,0 +1,6 @@
|
||||||
|
Code in the Core namespace represents Drupal subsystems provided by the base
|
||||||
|
system. These subsystems MAY depend on Drupal Components and other Subsystems,
|
||||||
|
but MAY NOT depend on any code in a module.
|
||||||
|
|
||||||
|
Each Component should be in its own namespace, and should be as self-contained
|
||||||
|
as possible.
|
|
@ -0,0 +1,3 @@
|
||||||
|
This directory contains test case code for Drupal core Components and Subsystems.
|
||||||
|
Test classes should mirror the namespace of the code being tested. Supporting
|
||||||
|
code for test classes is allowed.
|
|
@ -0,0 +1,6 @@
|
||||||
|
3rd party libraries provided by Drupal core should be placed in this directory.
|
||||||
|
They should not be modified from their original form at any time. They should
|
||||||
|
be changed only to keep up to date with upstream projects.
|
||||||
|
|
||||||
|
Code in this directory MAY be licensed under a GPL-compatible non-GPL license. If
|
||||||
|
so, it must be properly documented in COPYRIGHT.txt.
|
Loading…
Reference in New Issue