Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
simple_sitemap
Commits
27657785
Commit
27657785
authored
Aug 28, 2016
by
Pawel G
Browse files
Clean up services file and ensure no services are getting called anymore but injected
parent
d4888794
Changes
2
Hide whitespace changes
Inline
Side-by-side
simple_sitemap.services.yml
View file @
27657785
services
:
simple_sitemap.generator
:
class
:
Drupal\simple_sitemap\Simplesitemap
arguments
:
[
'
@simple_sitemap.sitemap_generator'
,
'
@config.factory'
,
'
@database'
,
'
@entity_type.manager'
,
'
@path.validator'
]
public
:
true
arguments
:
-
@
simple_sitemap.sitemap_generator
-
@
config.factory
-
@
database
-
@
entity_type.manager
-
@
path.validator
-
@
date.formatter
simple_sitemap.sitemap_generator
:
class
:
Drupal\simple_sitemap\SitemapGenerator
arguments
:
[
'
@simple_sitemap.batch'
,
'
@database'
,
'
@module_handler'
,
'
@language_manager'
]
public
:
false
arguments
:
-
@
simple_sitemap.batch
-
@
database
-
@
module_handler
-
@
language_manager
simple_sitemap.form
:
class
:
Drupal\simple_sitemap\Form\Form
arguments
:
[
'
@simple_sitemap.generator'
,
'
@current_user'
]
public
:
true
arguments
:
-
@
simple_sitemap.generator
-
@
current_user
simple_sitemap.batch
:
class
:
Drupal\simple_sitemap\Batch\Batch
public
:
false
simple_sitemap.batch_url_generator
:
class
:
Drupal\simple_sitemap\Batch\BatchUrlGenerator
arguments
:
[
'
@simple_sitemap.sitemap_generator'
,
'
@language_manager'
,
'
@entity_type.manager'
,
'
@path.validator'
,
'
@entity.query'
]
public
:
true
arguments
:
-
@
simple_sitemap.sitemap_generator
-
@
language_manager
-
@
entity_type.manager
-
@
path.validator
-
@
entity.query
src/Simplesitemap.php
View file @
27657785
...
...
@@ -23,23 +23,27 @@ class Simplesitemap {
/**
* Simplesitemap constructor.
*
*
@param $sitemapGenerator
* @param \Drupal\Core\Config\ConfigFactoryInterface $configFactoryInterface
* @param
\Drupal\Core\Database\Database
$database
* @param $database
* @param \Drupal\Core\Entity\EntityTypeManager $entityTypeManager
* @param $pathValidator
* @param $dateFormatter
*/
public
function
__construct
(
$sitemapGenerator
,
\
Drupal\Core\Config\ConfigFactoryInterface
$configFactoryInterface
,
$database
,
\
Drupal\Core\Entity\EntityTypeManager
$entityTypeManager
,
$pathValidator
$pathValidator
,
$dateFormatter
)
{
$this
->
sitemapGenerator
=
$sitemapGenerator
;
$this
->
configFactory
=
$configFactoryInterface
;
$this
->
db
=
$database
;
$this
->
entityTypeManager
=
$entityTypeManager
;
$this
->
pathValidator
=
$pathValidator
;
$this
->
dateFormatter
=
$dateFormatter
;
}
/**
...
...
@@ -442,7 +446,7 @@ class Simplesitemap {
public
function
getGeneratedAgo
()
{
$chunks
=
$this
->
fetchSitemapChunks
();
if
(
isset
(
$chunks
[
1
]
->
sitemap_created
))
{
return
\
Drupal
::
service
(
'
date
.f
ormatter
'
)
return
$this
->
date
F
ormatter
->
formatInterval
(
REQUEST_TIME
-
$chunks
[
1
]
->
sitemap_created
);
}
return
FALSE
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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