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
294
Merge Requests
294
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
838bf21e
Commit
838bf21e
authored
Aug 22, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git commit -m Issue
parent
4165a693
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
333 additions
and
131 deletions
+333
-131
core/includes/common.inc
core/includes/common.inc
+1
-2
core/lib/Drupal.php
core/lib/Drupal.php
+1
-1
core/lib/Drupal/Core/Controller/ControllerBase.php
core/lib/Drupal/Core/Controller/ControllerBase.php
+1
-1
core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php
core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php
+0
-1
core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php
...rupal/Core/EventSubscriber/RedirectResponseSubscriber.php
+4
-4
core/lib/Drupal/Core/Routing/NullGenerator.php
core/lib/Drupal/Core/Routing/NullGenerator.php
+5
-3
core/lib/Drupal/Core/Routing/UrlGenerator.php
core/lib/Drupal/Core/Routing/UrlGenerator.php
+39
-76
core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
+202
-0
core/modules/action/lib/Drupal/action/Plugin/Action/GotoAction.php
...les/action/lib/Drupal/action/Plugin/Action/GotoAction.php
+4
-4
core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
...lib/Drupal/aggregator/Controller/AggregatorController.php
+3
-3
core/modules/comment/lib/Drupal/comment/Controller/CommentController.php
...mment/lib/Drupal/comment/Controller/CommentController.php
+4
-4
core/modules/config/lib/Drupal/config/Form/ConfigSync.php
core/modules/config/lib/Drupal/config/Form/ConfigSync.php
+4
-4
core/modules/image/lib/Drupal/image/ImageStyleListController.php
...dules/image/lib/Drupal/image/ImageStyleListController.php
+4
-4
core/modules/locale/lib/Drupal/locale/Controller/LocaleController.php
.../locale/lib/Drupal/locale/Controller/LocaleController.php
+2
-2
core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php
core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php
+4
-5
core/modules/node/lib/Drupal/node/NodeTypeListController.php
core/modules/node/lib/Drupal/node/NodeTypeListController.php
+4
-4
core/modules/overlay/lib/Drupal/overlay/EventSubscriber/OverlaySubscriber.php
.../lib/Drupal/overlay/EventSubscriber/OverlaySubscriber.php
+4
-4
core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
+47
-9
No files found.
core/includes/common.inc
View file @
838bf21e
...
...
@@ -448,7 +448,6 @@ function drupal_get_query_parameters(array $query = NULL, array $exclude = array
/**
* Parses an array into a valid, rawurlencoded query string.
*
* @see \Drupal\Core\Routing\PathBasedGeneratorInterface::httpBuildQuery()
* @see drupal_get_query_parameters()
* @deprecated as of Drupal 8.0. Use Url::buildQuery() instead.
* @ingroup php_wrappers
...
...
@@ -1192,7 +1191,7 @@ function datetime_default_format_type() {
* When creating links in modules, consider whether l() could be a better
* alternative than url().
*
* @see \Drupal\Core\Routing\
PathBased
GeneratorInterface::generateFromPath().
* @see \Drupal\Core\Routing\
Url
GeneratorInterface::generateFromPath().
*/
function
url
(
$path
=
NULL
,
array
$options
=
array
())
{
$generator
=
Drupal
::
urlGenerator
();
...
...
core/lib/Drupal.php
View file @
838bf21e
...
...
@@ -364,7 +364,7 @@ public static function token() {
/**
* Returns the url generator service.
*
* @return \Drupal\Core\Routing\
PathBased
GeneratorInterface
* @return \Drupal\Core\Routing\
Url
GeneratorInterface
* The url generator service.
*/
public
static
function
urlGenerator
()
{
...
...
core/lib/Drupal/Core/Controller/ControllerBase.php
View file @
838bf21e
...
...
@@ -114,7 +114,7 @@ protected function moduleHandler() {
/**
* Returns the url generator service.
*
* @return \Drupal\Core\Routing\
PathBased
GeneratorInterface
* @return \Drupal\Core\Routing\
Url
GeneratorInterface
* The url generator service.
*/
protected
function
urlGenerator
()
{
...
...
core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php
View file @
838bf21e
...
...
@@ -9,7 +9,6 @@
use
Drupal\Core\CacheDecorator\AliasManagerCacheDecorator
;
use
Drupal\Core\PathProcessor\InboundPathProcessorInterface
;
use
Drupal\Core\Routing\PathBasedGeneratorInterface
;
use
Symfony\Component\HttpKernel\HttpKernelInterface
;
use
Symfony\Component\HttpKernel\KernelEvents
;
use
Symfony\Component\HttpKernel\Event\GetResponseEvent
;
...
...
core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php
View file @
838bf21e
...
...
@@ -7,7 +7,7 @@
namespace
Drupal\Core\EventSubscriber
;
use
Drupal\Core\Routing\
PathBased
GeneratorInterface
;
use
Drupal\Core\Routing\
Url
GeneratorInterface
;
use
Symfony\Component\HttpKernel\KernelEvents
;
use
Symfony\Component\HttpKernel\Event\FilterResponseEvent
;
use
Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent
;
...
...
@@ -22,17 +22,17 @@ class RedirectResponseSubscriber implements EventSubscriberInterface {
/**
* The url generator service.
*
* @var \Drupal\Core\Routing\
PathBased
GeneratorInterface
* @var \Drupal\Core\Routing\
Url
GeneratorInterface
*/
protected
$urlGenerator
;
/**
* Constructs a RedirectResponseSubscriber object.
*
* @param \Drupal\Core\Routing\
PathBased
GeneratorInterface $url_generator
* @param \Drupal\Core\Routing\
Url
GeneratorInterface $url_generator
* The url generator service.
*/
public
function
__construct
(
PathBased
GeneratorInterface
$url_generator
)
{
public
function
__construct
(
Url
GeneratorInterface
$url_generator
)
{
$this
->
urlGenerator
=
$url_generator
;
}
...
...
core/lib/Drupal/Core/Routing/NullGenerator.php
View file @
838bf21e
...
...
@@ -7,7 +7,6 @@
namespace
Drupal\Core\Routing
;
use
Symfony\Component\Routing\Generator\UrlGeneratorInterface
;
use
Symfony\Component\Routing\RequestContext
;
use
Symfony\Component\Routing\Exception\RouteNotFoundException
;
...
...
@@ -23,9 +22,12 @@ public function __construct() {
}
/**
* Overrides Drupal\Core\Routing\UrlGenerator::generate();
* {@inheritdoc}
*
* generate(), generateFromRoute(), and getPathFromRoute() all call this
* protected method.
*/
p
ublic
function
generate
(
$name
,
$parameters
=
array
(),
$absolute
=
FALSE
)
{
p
rotected
function
getRoute
(
$name
)
{
throw
new
RouteNotFoundException
();
}
...
...
core/lib/Drupal/Core/Routing/UrlGenerator.php
View file @
838bf21e
...
...
@@ -23,7 +23,7 @@
/**
* A Generator creates URL strings based on a specified route.
*/
class
UrlGenerator
extends
ProviderBasedGenerator
implements
PathBased
GeneratorInterface
{
class
UrlGenerator
extends
ProviderBasedGenerator
implements
Url
GeneratorInterface
{
/**
* A request object.
...
...
@@ -87,7 +87,7 @@ public function __construct(RouteProviderInterface $provider, OutboundPathProces
}
/**
*
Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setRequest().
*
{@inheritdoc}
*/
public
function
setRequest
(
Request
$request
)
{
$this
->
request
=
$request
;
...
...
@@ -108,7 +108,7 @@ public function setRequest(Request $request) {
* {@inheritdoc}
*/
public
function
getPathFromRoute
(
$name
,
$parameters
=
array
())
{
$route
=
$this
->
getRoute
(
$name
,
$parameters
);
$route
=
$this
->
getRoute
(
$name
);
$path
=
$this
->
getInternalPathFromRoute
(
$route
,
$parameters
);
// Router-based paths may have a querystring on them but Drupal paths may
// not have one, so remove any ? and anything after it. For generate() this
...
...
@@ -157,18 +157,41 @@ protected function getInternalPathFromRoute(SymfonyRoute $route, $parameters = a
* {@inheritdoc}
*/
public
function
generate
(
$name
,
$parameters
=
array
(),
$absolute
=
FALSE
)
{
$
route
=
$this
->
getRoute
(
$name
,
$parameters
)
;
$path
=
$this
->
getInternalPathFromRoute
(
$route
,
$parameter
s
);
$path
=
$this
->
processPath
(
$path
);
$
options
[
'absolute'
]
=
$absolute
;
return
$this
->
generateFromRoute
(
$name
,
$parameters
,
$option
s
);
}
/**
* {@inheritdoc}
*/
public
function
generateFromRoute
(
$name
,
$parameters
=
array
(),
$options
=
array
())
{
$absolute
=
!
empty
(
$options
[
'absolute'
]);
$route
=
$this
->
getRoute
(
$name
);
// Symfony adds any parameters that are not path slugs as query strings.
if
(
isset
(
$options
[
'query'
])
&&
is_array
(
$options
[
'query'
]))
{
$parameters
=
(
array
)
$parameters
+
$options
[
'query'
];
}
$path
=
$this
->
getInternalPathFromRoute
(
$route
,
$parameters
);
$path
=
$this
->
processPath
(
$path
,
$options
);
$fragment
=
''
;
if
(
isset
(
$options
[
'fragment'
]))
{
if
((
$fragment
=
trim
(
$options
[
'fragment'
]))
!=
''
)
{
$fragment
=
'#'
.
$fragment
;
}
}
$base_url
=
$this
->
context
->
getBaseUrl
();
if
(
!
$absolute
||
!
$host
=
$this
->
context
->
getHost
())
{
return
$base_url
.
$path
;
return
$base_url
.
$path
.
$fragment
;
}
// Prepare an absolute URL by getting the correct scheme, host and port from
// the request context.
$scheme
=
$this
->
context
->
getScheme
();
if
(
isset
(
$options
[
'https'
])
&&
$this
->
mixedModeSessions
)
{
$scheme
=
$options
[
'https'
]
?
'https'
:
'http'
;
}
else
{
$scheme
=
$this
->
context
->
getScheme
();
}
$scheme_req
=
$route
->
getRequirement
(
'_scheme'
);
if
(
isset
(
$scheme_req
)
&&
(
$req
=
strtolower
(
$scheme_req
))
&&
$scheme
!==
$req
)
{
$scheme
=
$req
;
...
...
@@ -179,68 +202,11 @@ public function generate($name, $parameters = array(), $absolute = FALSE) {
}
elseif
(
'https'
===
$scheme
&&
443
!=
$this
->
context
->
getHttpsPort
())
{
$port
=
':'
.
$this
->
context
->
getHttpsPort
();
}
return
$scheme
.
'://'
.
$host
.
$port
.
$base_url
.
$path
;
return
$scheme
.
'://'
.
$host
.
$port
.
$base_url
.
$path
.
$fragment
;
}
/**
* Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::generateFromPath().
*
* @param $path
* (optional) The internal path or external URL being linked to, such as
* "node/34" or "http://example.com/foo". The default value is equivalent to
* passing in '<front>'. A few notes:
* - If you provide a full URL, it will be considered an external URL.
* - If you provide only the path (e.g. "node/34"), it will be
* considered an internal link. In this case, it should be a system URL,
* and it will be replaced with the alias, if one exists. Additional query
* arguments for internal paths must be supplied in $options['query'], not
* included in $path.
* - If you provide an internal path and $options['alias'] is set to TRUE, the
* path is assumed already to be the correct path alias, and the alias is
* not looked up.
* - The special string '<front>' generates a link to the site's base URL.
* - If your external URL contains a query (e.g. http://example.com/foo?a=b),
* then you can either URL encode the query keys and values yourself and
* include them in $path, or use $options['query'] to let this method
* URL encode them.
*
* @param $options
* (optional) An associative array of additional options, with the following
* elements:
* - 'query': An array of query key/value-pairs (without any URL-encoding) to
* append to the URL.
* - 'fragment': A fragment identifier (named anchor) to append to the URL.
* Do not include the leading '#' character.
* - 'absolute': Defaults to FALSE. Whether to force the output to be an
* absolute link (beginning with http:). Useful for links that will be
* displayed outside the site, such as in an RSS feed.
* - 'alias': Defaults to FALSE. Whether the given path is a URL alias
* already.
* - 'external': Whether the given path is an external URL.
* - 'language': An optional language object. If the path being linked to is
* internal to the site, $options['language'] is used to look up the alias
* for the URL. If $options['language'] is omitted, the language will be
* obtained from language(Language::TYPE_URL).
* - 'https': Whether this URL should point to a secure location. If not
* defined, the current scheme is used, so the user stays on HTTP or HTTPS
* respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can
* only be enforced when the variable 'https' is set to TRUE.
* - 'base_url': Only used internally, to modify the base URL when a language
* dependent URL requires so.
* - 'prefix': Only used internally, to modify the path when a language
* dependent URL requires so.
* - 'script': Added to the URL between the base path and the path prefix.
* Defaults to empty string when clean URLs are in effect, and to
* 'index.php/' when they are not.
* - 'entity_type': The entity type of the object that called url(). Only
* set if url() is invoked by Drupal\Core\Entity\Entity::uri().
* - 'entity': The entity object (such as a node) for which the URL is being
* generated. Only set if url() is invoked by Drupal\Core\Entity\Entity::uri().
*
* @return
* A string containing a URL to the given path.
*
* @throws \Drupal\Core\Routing\GeneratorNotInitializedException.
* {@inheritdoc}
*/
public
function
generateFromPath
(
$path
=
NULL
,
$options
=
array
())
{
...
...
@@ -329,21 +295,21 @@ public function generateFromPath($path = NULL, $options = array()) {
}
/**
*
Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setBaseUrl().
*
{@inheritdoc}
*/
public
function
setBaseUrl
(
$url
)
{
$this
->
baseUrl
=
$url
;
}
/**
*
Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setBasePath().
*
{@inheritdoc}
*/
public
function
setBasePath
(
$path
)
{
$this
->
basePath
=
$path
;
}
/**
*
Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setScriptPath().
*
{@inheritdoc}
*/
public
function
setScriptPath
(
$path
)
{
$this
->
scriptPath
=
$path
;
...
...
@@ -381,13 +347,10 @@ protected function initialized() {
}
/**
* Find the route using the provided route name
(and parameters)
.
* Find the route using the provided route name.
*
* @param string $name
* The route name to fetch
* @param array $parameters
* The parameters as they are passed to the UrlGeneratorInterface::generate
* call.
*
* @return \Symfony\Component\Routing\Route
* The found route.
...
...
@@ -397,11 +360,11 @@ protected function initialized() {
*
* @see \Drupal\Core\Routing\RouteProviderInterface
*/
protected
function
getRoute
(
$name
,
$parameters
)
{
protected
function
getRoute
(
$name
)
{
if
(
$name
instanceof
SymfonyRoute
)
{
$route
=
$name
;
}
elseif
(
NULL
===
$route
=
$this
->
provider
->
getRouteByName
(
$name
,
$parameters
))
{
elseif
(
NULL
===
$route
=
$this
->
provider
->
getRouteByName
(
$name
))
{
throw
new
RouteNotFoundException
(
sprintf
(
'Route "%s" does not exist.'
,
$name
));
}
return
$route
;
...
...
core/lib/Drupal/Core/Routing/
PathBased
GeneratorInterface.php
→
core/lib/Drupal/Core/Routing/
Url
GeneratorInterface.php
View file @
838bf21e
...
...
@@ -2,30 +2,83 @@
/**
* @file
* Contains
Drupal\Core\Routing\PathBased
GeneratorInterface.
* Contains
\Drupal\Core\Routing\Url
GeneratorInterface.
*/
namespace
Drupal\Core\Routing
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Cmf\Component\Routing\VersatileGeneratorInterface
;
/**
* Defines an interface for generating a url from a path as opposed to a route.
* Defines an interface for generating a url from a route or system path.
*
* Provides additional methods and options not present in the base interface.
*/
interface
PathBased
GeneratorInterface
{
interface
UrlGeneratorInterface
extends
Versatile
GeneratorInterface
{
/**
* Generates an internal or external URL.
*
* @param $path
* @param
string
$path
* (optional) The internal path or external URL being linked to, such as
* "node/34" or "http://example.com/foo".
*
* @param $options
* (optional) An associative array of additional options.
* "node/34" or "http://example.com/foo". The default value is equivalent to
* passing in '<front>'. A few notes:
* - If you provide a full URL, it will be considered an external URL.
* - If you provide only the path (e.g. "node/34"), it will be
* considered an internal link. In this case, it should be a system URL,
* and it will be replaced with the alias, if one exists. Additional query
* arguments for internal paths must be supplied in $options['query'], not
* included in $path.
* - If you provide an internal path and $options['alias'] is set to TRUE, the
* path is assumed already to be the correct path alias, and the alias is
* not looked up.
* - The special string '<front>' generates a link to the site's base URL.
* - If your external URL contains a query (e.g. http://example.com/foo?a=b),
* then you can either URL encode the query keys and values yourself and
* include them in $path, or use $options['query'] to let this method
* URL encode them.
*
* @param array $options
* (optional) An associative array of additional options, with the following
* elements:
* - 'query': An array of query key/value-pairs (without any URL-encoding) to
* append to the URL.
* - 'fragment': A fragment identifier (named anchor) to append to the URL.
* Do not include the leading '#' character.
* - 'absolute': Defaults to FALSE. Whether to force the output to be an
* absolute link (beginning with http:). Useful for links that will be
* displayed outside the site, such as in an RSS feed.
* - 'alias': Defaults to FALSE. Whether the given path is a URL alias
* already.
* - 'external': Whether the given path is an external URL.
* - 'language': An optional language object. If the path being linked to is
* internal to the site, $options['language'] is used to look up the alias
* for the URL. If $options['language'] is omitted, the language will be
* obtained from language(Language::TYPE_URL).
* - 'https': Whether this URL should point to a secure location. If not
* defined, the current scheme is used, so the user stays on HTTP or HTTPS
* respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can
* only be enforced when the variable 'https' is set to TRUE.
* - 'base_url': Only used internally, to modify the base URL when a language
* dependent URL requires so.
* - 'prefix': Only used internally, to modify the path when a language
* dependent URL requires so.
* - 'script': Added to the URL between the base path and the path prefix.
* Defaults to empty string when clean URLs are in effect, and to
* 'index.php/' when they are not.
* - 'entity_type': The entity type of the object that called url(). Only
* set if url() is invoked by Drupal\Core\Entity\Entity::uri().
* - 'entity': The entity object (such as a node) for which the URL is being
* generated. Only set if url() is invoked by Drupal\Core\Entity\Entity::uri().
*
* @return
* A string containing a URL to the given path.
*
* @throws \Drupal\Core\Routing\GeneratorNotInitializedException.
*
* @deprecated since version 8.0
* System paths should not be used - use route names and parameters.
*/
public
function
generateFromPath
(
$path
=
NULL
,
$options
=
array
());
...
...
@@ -40,9 +93,51 @@ public function generateFromPath($path = NULL, $options = array());
*
* @return string
* The internal Drupal path corresponding to the route.
*
* @deprecated since version 8.0
* System paths should not be used - use route names and parameters.
*/
public
function
getPathFromRoute
(
$name
,
$parameters
=
array
());
/**
* Generates a URL or path for a specific route based on the given parameters.
*
* Parameters that reference placeholders in the route pattern will be
* substituted for them in the pattern. Extra params are added as query
* strings to the URL.
*
* @param string $name
* The name of the route
* @param array $parameters
* An associative array of parameter names and values.
* @param array $options
* (optional) An associative array of additional options, with the following
* elements:
* - 'query': An array of query key/value-pairs (without any URL-encoding)
* to append to the URL. Merged with the parameters array.
* - 'fragment': A fragment identifier (named anchor) to append to the URL.
* Do not include the leading '#' character.
* - 'absolute': Defaults to FALSE. Whether to force the output to be an
* absolute link (beginning with http:). Useful for links that will be
* displayed outside the site, such as in an RSS feed.
* - 'language': An optional language object used to look up the alias
* for the URL. If $options['language'] is omitted, the language will be
* obtained from language(Language::TYPE_URL).
* - 'https': Whether this URL should point to a secure location. If not
* defined, the current scheme is used, so the user stays on HTTP or HTTPS
* respectively. if mixed mode sessions are permitted, TRUE enforces HTTPS
* and FALSE enforces HTTP.
*
* @return string
* The generated URL for the given route.
*
* @throws RouteNotFoundException If the named route doesn't exist
* @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route
* @throws InvalidParameterException When a parameter value for a placeholder is not correct because
* it does not match the requirement
*/
public
function
generateFromRoute
(
$name
,
$parameters
=
array
(),
$options
=
array
());
/**
* Sets the $request property.
*
...
...
core/modules/action/lib/Drupal/action/Plugin/Action/GotoAction.php
View file @
838bf21e
...
...
@@ -11,7 +11,7 @@
use
Drupal\Core\Annotation\Translation
;
use
Drupal\Core\Action\ConfigurableActionBase
;
use
Drupal\Core\Plugin\ContainerFactoryPluginInterface
;
use
Drupal\Core\Routing\
PathBased
GeneratorInterface
;
use
Drupal\Core\Routing\
Url
GeneratorInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
...
...
@@ -38,7 +38,7 @@ class GotoAction extends ConfigurableActionBase implements ContainerFactoryPlugi
/**
* The url generator service.
*
* @var \Drupal\Core\Routing\
PathBased
GeneratorInterface
* @var \Drupal\Core\Routing\
Url
GeneratorInterface
*/
protected
$urlGenerator
;
...
...
@@ -53,10 +53,10 @@ class GotoAction extends ConfigurableActionBase implements ContainerFactoryPlugi
* The plugin implementation definition.
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
* The tempstore factory.
* @param \Drupal\Core\Routing\
PathBased
GeneratorInterface $url_generator
* @param \Drupal\Core\Routing\
Url
GeneratorInterface $url_generator
* The url generator service.
*/
public
function
__construct
(
array
$configuration
,
$plugin_id
,
array
$plugin_definition
,
EventDispatcherInterface
$dispatcher
,
PathBased
GeneratorInterface
$url_generator
)
{
public
function
__construct
(
array
$configuration
,
$plugin_id
,
array
$plugin_definition
,
EventDispatcherInterface
$dispatcher
,
Url
GeneratorInterface
$url_generator
)
{
parent
::
__construct
(
$configuration
,
$plugin_id
,
$plugin_definition
);
$this
->
dispatcher
=
$dispatcher
;
...
...
core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
View file @
838bf21e
...
...
@@ -13,7 +13,7 @@
use
Drupal\Core\Database\Connection
;
use
Drupal\Core\Entity\EntityManager
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Drupal\Core\Routing\
PathBased
GeneratorInterface
;
use
Drupal\Core\Routing\
Url
GeneratorInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpFoundation\Request
;
...
...
@@ -55,7 +55,7 @@ class AggregatorController implements ControllerInterface {
/**
* The url generator.
*
* @var \Drupal\Core\Routing\
PathBased
GeneratorInterface
* @var \Drupal\Core\Routing\
Url
GeneratorInterface
*/
protected
$urlGenerator
;
...
...
@@ -73,7 +73,7 @@ class AggregatorController implements ControllerInterface {
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
*/
public
function
__construct
(
EntityManager
$entity_manager
,
Connection
$database
,
ConfigFactory
$config_factory
,
ModuleHandlerInterface
$module_handler
,
PathBased
GeneratorInterface
$url_generator
)
{
public
function
__construct
(
EntityManager
$entity_manager
,
Connection
$database
,
ConfigFactory
$config_factory
,
ModuleHandlerInterface
$module_handler
,
Url
GeneratorInterface
$url_generator
)
{
$this
->
entityManager
=
$entity_manager
;
$this
->
database
=
$database
;
$this
->
configFactory
=
$config_factory
;
...
...
core/modules/comment/lib/Drupal/comment/Controller/CommentController.php
View file @
838bf21e
...
...
@@ -10,7 +10,7 @@
use
Drupal\comment\CommentInterface
;
use
Drupal\comment\Entity\Comment
;
use
Drupal\Core\Controller\ControllerInterface
;
use
Drupal\Core\Routing\
PathBased
GeneratorInterface
;
use
Drupal\Core\Routing\
Url
GeneratorInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpFoundation\Request
;
...
...
@@ -28,7 +28,7 @@ class CommentController implements ControllerInterface {
/**
* The url generator service.
*
* @var \Drupal\Core\Routing\
PathBased
GeneratorInterface
* @var \Drupal\Core\Routing\
Url
GeneratorInterface
*/
protected
$urlGenerator
;
...
...
@@ -42,12 +42,12 @@ class CommentController implements ControllerInterface {
/**
* Constructs a CommentController object.
*
* @param \Drupal\Core\Routing\
PathBased
GeneratorInterface $url_generator
* @param \Drupal\Core\Routing\
Url
GeneratorInterface $url_generator
* The url generator service.
* @param \Symfony\Component\HttpKernel\HttpKernelInterface $httpKernel
* HTTP kernel to handle requests.
*/
public
function
__construct
(
PathBased
GeneratorInterface
$url_generator
,
HttpKernelInterface
$httpKernel
)
{
public
function
__construct
(
Url
GeneratorInterface
$url_generator
,
HttpKernelInterface
$httpKernel
)
{
$this
->
urlGenerator
=
$url_generator
;
$this
->
httpKernel
=
$httpKernel
;
}
...
...
core/modules/config/lib/Drupal/config/Form/ConfigSync.php
View file @
838bf21e
...
...
@@ -15,7 +15,7 @@
use
Drupal\Core\Config\ConfigImporter
;
use
Drupal\Core\Config\ConfigException
;
use
Drupal\Core\Config\ConfigFactory
;
use
Drupal\Core\Routing\
PathBased
GeneratorInterface
;
use
Drupal\Core\Routing\
Url
GeneratorInterface
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -65,7 +65,7 @@ class ConfigSync extends FormBase {
/**
* URL generator service.
*
* @var \Drupal\Core\Routing\
PathBased
GeneratorInterface
* @var \Drupal\Core\Routing\
Url
GeneratorInterface
*/
protected
$urlGenerator
;
...
...
@@ -84,10 +84,10 @@ class ConfigSync extends FormBase {
* Configuration object factory.
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* Entity manager.
* @param \Drupal\Core\Routing\
PathBased
GeneratorInterface $url_generator
* @param \Drupal\Core\Routing\
Url
GeneratorInterface $url_generator
* The url generator service.
*/
public
function
__construct
(
StorageInterface
$sourceStorage
,
StorageInterface
$targetStorage
,
LockBackendInterface
$lock
,
EventDispatcherInterface
$event_dispatcher
,
ConfigFactory
$config_factory
,
EntityManager
$entity_manager
,
PathBased
GeneratorInterface
$url_generator
)
{
public
function
__construct
(
StorageInterface
$sourceStorage
,
StorageInterface
$targetStorage
,
LockBackendInterface
$lock
,
EventDispatcherInterface
$event_dispatcher
,
ConfigFactory
$config_factory
,
EntityManager
$entity_manager
,
Url
GeneratorInterface
$url_generator
)
{
$this
->
sourceStorage
=
$sourceStorage
;
$this
->
targetStorage
=
$targetStorage
;
$this
->
lock
=
$lock
;
...
...
core/modules/image/lib/Drupal/image/ImageStyleListController.php
View file @
838bf21e
...
...
@@ -12,7 +12,7 @@
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\EntityStorageControllerInterface
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Drupal\Core\Routing\
PathBased
GeneratorInterface
;
use
Drupal\Core\Routing\
Url
GeneratorInterface
;
use
Drupal\Core\StringTranslation\Translator\TranslatorInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -24,7 +24,7 @@ class ImageStyleListController extends ConfigEntityListController implements Ent
/**
* The URL generator.
*
* @var \Drupal\Core\Routing\
PathBased
GeneratorInterface
* @var \Drupal\Core\Routing\
Url
GeneratorInterface
*/
protected
$urlGenerator
;
...
...
@@ -46,12 +46,12 @@ class ImageStyleListController extends ConfigEntityListController implements Ent
* The image style entity storage controller class.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler to invoke hooks on.
* @param \Drupal\Core\Routing\
PathBased
GeneratorInterface $url_generator
* @param \Drupal\Core\Routing\
Url
GeneratorInterface $url_generator
* The URL generator.
* @param \Drupal\Core\StringTranslation\Translator\TranslatorInterface $translator
* The translation manager.
*/
public
function
__construct
(
$entity_type
,
array
$entity_info
,
EntityStorageControllerInterface
$image_style_storage
,
ModuleHandlerInterface
$module_handler
,
PathBased
GeneratorInterface
$url_generator
,
TranslatorInterface
$translator
)
{
public
function
__construct
(
$entity_type
,
array
$entity_info
,
EntityStorageControllerInterface
$image_style_storage
,
ModuleHandlerInterface
$module_handler
,
Url
GeneratorInterface
$url_generator
,
TranslatorInterface
$translator
)
{
parent
::
__construct
(
$entity_type
,
$entity_info
,
$image_style_storage
,
$module_handler
);
$this
->
urlGenerator
=
$url_generator
;
$this
->
translator
=
$translator
;
...
...
core/modules/locale/lib/Drupal/locale/Controller/LocaleController.php
View file @
838bf21e
...
...
@@ -7,7 +7,7 @@
namespace
Drupal\locale\Controller
;
use
Drupal\Core\Controller\ControllerInterface
;
use
Drupal\Core\Routing\
PathBased
GeneratorInterface
;
use
Drupal\Core\Routing\
Url
GeneratorInterface
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
...
...
@@ -29,7 +29,7 @@ class LocaleController implements ControllerInterface {
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
*/
public
function
__construct
(
ModuleHandlerInterfa