comparison core/lib/Drupal.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children af1871eacc83
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
80 class Drupal { 80 class Drupal {
81 81
82 /** 82 /**
83 * The current system version. 83 * The current system version.
84 */ 84 */
85 const VERSION = '8.5.5'; 85 const VERSION = '8.6.10';
86 86
87 /** 87 /**
88 * Core API compatibility. 88 * Core API compatibility.
89 */ 89 */
90 const CORE_COMPATIBILITY = '8.x'; 90 const CORE_COMPATIBILITY = '8.x';
139 */ 139 */
140 public static function hasContainer() { 140 public static function hasContainer() {
141 return static::$container !== NULL; 141 return static::$container !== NULL;
142 } 142 }
143 143
144
145 /** 144 /**
146 * Retrieves a service from the container. 145 * Retrieves a service from the container.
147 * 146 *
148 * Use this method if the desired service is not one of those with a dedicated 147 * Use this method if the desired service is not one of those with a dedicated
149 * accessor method below. If it is listed below, those methods are preferred 148 * accessor method below. If it is listed below, those methods are preferred
228 public static function request() { 227 public static function request() {
229 return static::getContainer()->get('request_stack')->getCurrentRequest(); 228 return static::getContainer()->get('request_stack')->getCurrentRequest();
230 } 229 }
231 230
232 /** 231 /**
233 * Retrives the request stack. 232 * Retrieves the request stack.
234 * 233 *
235 * @return \Symfony\Component\HttpFoundation\RequestStack 234 * @return \Symfony\Component\HttpFoundation\RequestStack
236 * The request stack 235 * The request stack
237 */ 236 */
238 public static function requestStack() { 237 public static function requestStack() {
318 * \Drupal\Core\DependencyInjection\ContainerInjectionInterface. 317 * \Drupal\Core\DependencyInjection\ContainerInjectionInterface.
319 * 318 *
320 * One common usecase is to provide a class which contains the actual code 319 * One common usecase is to provide a class which contains the actual code
321 * of a hook implementation, without having to create a service. 320 * of a hook implementation, without having to create a service.
322 * 321 *
323 * @return \Drupal\Core\DependencyInjection\ClassResolverInterface 322 * @param string $class
324 * The class resolver. 323 * (optional) A class name to instantiate.
325 */ 324 *
326 public static function classResolver() { 325 * @return \Drupal\Core\DependencyInjection\ClassResolverInterface|object
326 * The class resolver or if $class is provided, a class instance with a
327 * given class definition.
328 *
329 * @throws \InvalidArgumentException
330 * If $class does not exist.
331 */
332 public static function classResolver($class = NULL) {
333 if ($class) {
334 return static::getContainer()->get('class_resolver')->getInstanceFromDefinition($class);
335 }
327 return static::getContainer()->get('class_resolver'); 336 return static::getContainer()->get('class_resolver');
328 } 337 }
329 338
330 /** 339 /**
331 * Returns an expirable key value store collection. 340 * Returns an expirable key value store collection.