Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
301
Merge Requests
301
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
4c3b3764
Commit
4c3b3764
authored
Apr 28, 2016
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2708379
by alexpott: Add uuid service to core.services.yml
parent
4376b33c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
15 deletions
+9
-15
core/core.services.yml
core/core.services.yml
+2
-1
core/lib/Drupal/Core/CoreServiceProvider.php
core/lib/Drupal/Core/CoreServiceProvider.php
+7
-14
No files found.
core/core.services.yml
View file @
4c3b3764
...
...
@@ -1600,7 +1600,8 @@ services:
update.post_update_registry_factory
:
class
:
Drupal\Core\Update\UpdateRegistryFactory
parent
:
container.trait
uuid
:
class
:
Drupal\Component\Uuid\Php
response_filter.active_link
:
class
:
Drupal\Core\EventSubscriber\ActiveLinkResponseFilter
arguments
:
[
'
@current_user'
,
'
@path.current'
,
'
@path.matcher'
,
'
@language_manager'
]
...
...
core/lib/Drupal/Core/CoreServiceProvider.php
View file @
4c3b3764
...
...
@@ -15,6 +15,7 @@
use
Drupal\Core\DependencyInjection\Compiler\StackedSessionHandlerPass
;
use
Drupal\Core\DependencyInjection\Compiler\RegisterStreamWrappersPass
;
use
Drupal\Core\DependencyInjection\Compiler\TwigExtensionPass
;
use
Drupal\Core\DependencyInjection\ServiceModifierInterface
;
use
Drupal\Core\DependencyInjection\ServiceProviderInterface
;
use
Drupal\Core\DependencyInjection\ContainerBuilder
;
use
Drupal\Core\DependencyInjection\Compiler\ModifyServiceDefinitionsPass
;
...
...
@@ -39,13 +40,12 @@
*
* @ingroup container
*/
class
CoreServiceProvider
implements
ServiceProviderInterface
{
class
CoreServiceProvider
implements
ServiceProviderInterface
,
ServiceModifierInterface
{
/**
* {@inheritdoc}
*/
public
function
register
(
ContainerBuilder
$container
)
{
$this
->
registerUuid
(
$container
);
$this
->
registerTest
(
$container
);
// Only register the private file stream wrapper if a file path has been set.
...
...
@@ -98,30 +98,23 @@ public function register(ContainerBuilder $container) {
}
/**
*
Determines and registers the UUID servic
e.
*
Alters the UUID service to use the most efficient method availabl
e.
*
* @param \Drupal\Core\DependencyInjection\ContainerBuilder $container
* The container builder.
*
* @return string
* Class name for the UUID service.
*/
public
static
function
registerUuid
(
ContainerBuilder
$container
)
{
$uuid_class
=
'Drupal\Component\Uuid\Php'
;
public
function
alter
(
ContainerBuilder
$container
)
{
$uuid_service
=
$container
->
getDefinition
(
'uuid'
);
// Debian/Ubuntu uses the (broken) OSSP extension as their UUID
// implementation. The OSSP implementation is not compatible with the
// PECL functions.
if
(
function_exists
(
'uuid_create'
)
&&
!
function_exists
(
'uuid_make'
))
{
$uuid_
class
=
'Drupal\Component\Uuid\Pecl'
;
$uuid_
service
->
setClass
(
'Drupal\Component\Uuid\Pecl'
)
;
}
// Try to use the COM implementation for Windows users.
elseif
(
function_exists
(
'com_create_guid'
))
{
$uuid_
class
=
'Drupal\Component\Uuid\Com'
;
$uuid_
service
->
setClass
(
'Drupal\Component\Uuid\Com'
)
;
}
$container
->
register
(
'uuid'
,
$uuid_class
);
return
$uuid_class
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment