security update devel, metatag

This commit is contained in:
2019-02-27 10:27:41 +01:00
parent df29c2f5a7
commit 04a4b8895d
80 changed files with 926 additions and 384 deletions
@@ -1,3 +1,8 @@
Metatag 8.x-1.8, 2019-02-20
---------------------------
By samuel.mortenson, Berdir, DamienMcKenna: Fix data property definition.
Metatag 8.x-1.7, 2018-08-31 Metatag 8.x-1.7, 2018-08-31
--------------------------- ---------------------------
#2994979 by DamienMcKenna, dspachos, ynotpeanutbutter, oxy86, IT-Cru, kdeds, #2994979 by DamienMcKenna, dspachos, ynotpeanutbutter, oxy86, IT-Cru, kdeds,
@@ -13,8 +13,8 @@ test_dependencies:
- restui:restui - restui:restui
- schema_metatag:schema_web_page - schema_metatag:schema_web_page
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -7,8 +7,8 @@ dependencies:
- metatag:metatag - metatag:metatag
- metatag:metatag_dc - metatag:metatag_dc
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -7,8 +7,8 @@ dependencies:
- metatag:metatag - metatag:metatag
- metatag:metatag_open_graph - metatag:metatag_open_graph
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -7,8 +7,8 @@ dependencies:
- page_manager:page_manager - page_manager:page_manager
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: SEO
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -7,8 +7,8 @@ dependencies:
- metatag:metatag - metatag:metatag
- drupal:views - drupal:views
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -4,7 +4,6 @@ namespace Drupal\metatag;
use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase; use Drupal\Core\DependencyInjection\ServiceProviderBase;
use Drupal\metatag\Normalizer\FieldItemNormalizer;
use Drupal\metatag\Normalizer\MetatagHalNormalizer; use Drupal\metatag\Normalizer\MetatagHalNormalizer;
use Drupal\metatag\Normalizer\MetatagNormalizer; use Drupal\metatag\Normalizer\MetatagNormalizer;
use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Definition;
@@ -30,10 +29,6 @@ class MetatagServiceProvider extends ServiceProviderBase {
$metatag_hal = new Definition(MetatagHalNormalizer::class); $metatag_hal = new Definition(MetatagHalNormalizer::class);
$metatag_hal->addTag('normalizer', ['priority' => 31]); $metatag_hal->addTag('normalizer', ['priority' => 31]);
$container->setDefinition('metatag.normalizer.metatag.hal', $metatag_hal); $container->setDefinition('metatag.normalizer.metatag.hal', $metatag_hal);
$metatag_field = new Definition(FieldItemNormalizer::class);
$metatag_field->addTag('normalizer', ['priority' => 30]);
$container->setDefinition('metatag.normalizer.metatag_field', $metatag_field);
} }
} }
@@ -1,28 +0,0 @@
<?php
namespace Drupal\metatag\Normalizer;
use Drupal\serialization\Normalizer\NormalizerBase;
/**
* Converts the Metatag field item object structure to METATAG array structure.
*/
class FieldItemNormalizer extends NormalizerBase {
/**
* {@inheritdoc}
*/
protected $supportedInterfaceOrClass = 'Drupal\metatag\Plugin\Field\FieldType\MetatagFieldItem';
/**
* {@inheritdoc}
*/
public function normalize($field_item, $format = NULL, array $context = []) {
$values = $field_item->getValue();
$normalized['value'] = unserialize($values['value']);
return $normalized;
}
}
@@ -19,7 +19,6 @@ class MetatagHalNormalizer extends MetatagNormalizer {
$normalized = parent::normalize($field_item, $format, $context); $normalized = parent::normalize($field_item, $format, $context);
// Mock the field array similar to the other fields. // Mock the field array similar to the other fields.
// @see Drupal\hal\Normalizer\FieldItemNormalizer
return [ return [
'metatag' => [$normalized], 'metatag' => [$normalized],
]; ];
@@ -14,7 +14,10 @@ use Drupal\Core\TypedData\DataDefinition;
* label = @Translation("Meta tags"), * label = @Translation("Meta tags"),
* description = @Translation("This field stores code meta tags."), * description = @Translation("This field stores code meta tags."),
* default_widget = "metatag_firehose", * default_widget = "metatag_firehose",
* default_formatter = "metatag_empty_formatter" * default_formatter = "metatag_empty_formatter",
* serialized_property_names = {
* "value"
* }
* ) * )
*/ */
class MetatagFieldItem extends FieldItemBase { class MetatagFieldItem extends FieldItemBase {
@@ -6,8 +6,8 @@ package: Testing
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
@@ -6,8 +6,8 @@ package: Testing
dependencies: dependencies:
- metatag:metatag - metatag:metatag
# Information added by Drupal.org packaging script on 2018-08-31 # Information added by Drupal.org packaging script on 2019-02-20
version: '8.x-1.7' version: '8.x-1.8'
core: '8.x' core: '8.x'
project: 'metatag' project: 'metatag'
datestamp: 1535726412 datestamp: 1550683387
+70 -29
View File
@@ -1,8 +1,23 @@
Devel README.txt for Devel module
========== ---------------------------
Devel module contains helper functions and pages for Drupal developers and inquisitive admins:
CONTENTS OF THIS FILE
---------------------
* Introduction
* Requirements
* Included Modules and Features
* Recommended Modules
* Installation
* Configuration
* Maintainers
INTRODUCTION
------------
Devel module contains helper functions and pages for Drupal developers and
inquisitive admins:
- A block for running custom PHP on a page
- A block for quickly accessing devel pages - A block for quickly accessing devel pages
- A block for masquerading as other users (useful for testing) - A block for masquerading as other users (useful for testing)
- A mail-system class which redirects outbound email to files - A mail-system class which redirects outbound email to files
@@ -13,35 +28,61 @@ Devel module contains helper functions and pages for Drupal developers and inqui
This module is safe to use on a production site. Just be sure to only grant This module is safe to use on a production site. Just be sure to only grant
'access development information' permission to developers. 'access development information' permission to developers.
Devel Kint - For a full description of the module visit:
=================== https://www.drupal.org/project/devel
Provides a dpr() function, which pretty prints variables.
- To submit bug reports and feature suggestions, or to track changes visit:
https://www.drupal.org/project/issues/devel
REQUIREMENTS
------------
This module requires no modules outside of Drupal core.
INCLUDED MODULES AND FEATURES
-----------------------------
Devel Kint - Provides a dpr() function, which pretty prints variables.
Useful during development. Also see similar helpers like dpm(), dvm(). Useful during development. Also see similar helpers like dpm(), dvm().
Webprofiler Webprofiler - Adds a debug bar at bottom of all pages with tons of useful
============== information like a query list, cache hit/miss data, memory profiling, page
Adds a debug bar at bottom of all pages with tons of useful information like a query list, speed, php info, session info, etc.
cache hit/miss data, memory profiling, page speed, php info, session info, etc.
Devel Generate Devel Generate - Bulk creates nodes, users, comment, terms for development. Has
================= Drush integration.
Bulk creates nodes, users, comment, terms for development. Has Drush integration.
Devel Generate Extensions Drush Unit Testing - See develDrushTest.php for an example of unit testing of
========================= the Drush integration. This uses Drush's own test framework, based on PHPUnit.
Devel Images Provider [http://drupal.org/project/devel_image_provider] allows to configure external providers for images. To run the tests, use run-tests-drush.sh. You may pass in any arguments that
are valid for `phpunit`.
RECOMMENDED MODULE
------------------
Devel Generate Extensions - Devel Images Provider allows to configure external
providers for images.
- http://drupal.org/project/devel_image_provider
INSTALLATION
------------
- Install the Devel module as you would normally install a contributed Drupal
module. Visit https://www.drupal.org/node/1897420 for further information.
Drush Unit Testing
==================
See develDrushTest.php for an example of unit testing of the Drush integration.
This uses Drush's own test framework, based on PHPUnit. To run the tests, use
run-tests-drush.sh. You may pass in any arguments that are valid for `phpunit`.
Author/Maintainers Author/Maintainers
====================== ------------------
- Moshe Weitzman <weitzman at tejasa DOT com> http://www.acquia.com
- Hans Salvisberg <drupal at salvisberg DOT com> - Moshe Weitzman (moshe weitzman) - https://www.drupal.org/u/moshe-weitzman
- Pedro Cambra https://drupal.org/user/122101/contact http://www.ymbra.com/ - Hans Salvisberg (salvis) - https://www.drupal.org/u/salvis
- Juan Pablo Novillo https://www.drupal.org/u/juampynr - Pedro Cambra https://drupal.org/user/122101/contact http://www.ymbra.com/
- lussoluca https://www.drupal.org/u/lussoluca - Juan Pablo Novillo https://www.drupal.org/u/juampynr
- willzyx https://www.drupal.org/u/willzyx - lussoluca https://www.drupal.org/u/lussoluca
- willzyx https://www.drupal.org/u/willzyx
@@ -38,8 +38,15 @@
}, },
"license": "GPL-2.0+", "license": "GPL-2.0+",
"minimum-stability": "dev", "minimum-stability": "dev",
"require": {}, "require": {
"suggest": { "symfony/var-dumper": "~2.7|^3"
"symfony/var-dumper": "Pretty print complex values better with var-dumper available" },
"suggest": {},
"extra": {
"drush": {
"services": {
"drush.services.yml": "^9"
}
}
} }
} }
@@ -2,7 +2,6 @@ toolbar_items:
- 'devel.admin_settings_link' - 'devel.admin_settings_link'
- 'devel.cache_clear' - 'devel.cache_clear'
- 'devel.container_info.service' - 'devel.container_info.service'
- 'devel.execute_php'
- 'devel.menu_rebuild' - 'devel.menu_rebuild'
- 'devel.reinstall' - 'devel.reinstall'
- 'devel.route_info' - 'devel.route_info'
@@ -7,8 +7,8 @@ configure: devel.admin_settings
tags: tags:
- developer - developer
# Information added by Drupal.org packaging script on 2017-10-05 # Information added by Drupal.org packaging script on 2019-01-29
version: '8.x-1.2' version: '8.x-2.0'
core: '8.x' core: '8.x'
project: 'devel' project: 'devel'
datestamp: 1507197848 datestamp: 1548799386
@@ -46,10 +46,6 @@ devel.phpinfo:
title: 'PHPinfo()' title: 'PHPinfo()'
route_name: system.php route_name: system.php
menu_name: devel menu_name: devel
devel.execute_php:
title: 'Execute PHP'
route_name: devel.execute_php
menu_name: devel
devel.session: devel.session:
title: 'View Session' title: 'View Session'
route_name: devel.session route_name: devel.session
@@ -324,6 +324,9 @@ if (!function_exists('dd')) {
/** /**
* Wrapper for DevelDumperManager::debug(). * Wrapper for DevelDumperManager::debug().
* *
* @deprecated since Drupal 8.6.0 because symfony now has dd() as a function.
* Use the ddm() function instead.
*
* @see \Drupal\devel\DevelDumperManager::debug() * @see \Drupal\devel\DevelDumperManager::debug()
*/ */
function dd($data, $label = NULL) { function dd($data, $label = NULL) {
@@ -331,6 +334,17 @@ if (!function_exists('dd')) {
} }
} }
if (!function_exists('ddm')) {
/**
* Wrapper for DevelDumperManager::debug() to replace previous dd function.
*
* @see \Drupal\devel\DevelDumperManager::debug()
*/
function ddm($data, $label = NULL) {
return \Drupal::service('devel.dumper')->debug($data, $label, 'default');
}
}
/** /**
* Wrapper for DevelDumperManager::message(). * Wrapper for DevelDumperManager::message().
* *
@@ -3,11 +3,6 @@ access devel information:
title: 'Access developer information' title: 'Access developer information'
restrict access: TRUE restrict access: TRUE
execute php code:
title: 'Execute PHP code'
description: 'Run arbitrary PHP from a block.'
restrict access: TRUE
switch users: switch users:
title: 'Switch users' title: 'Switch users'
description: 'Become any user on the site with just a click.' description: 'Become any user on the site with just a click.'
@@ -96,16 +96,6 @@ devel.field_info_page:
requirements: requirements:
_permission: 'access devel information' _permission: 'access devel information'
devel.execute_php:
path: '/devel/php'
defaults:
_form: '\Drupal\devel\Form\ExecutePHP'
_title: 'Execute PHP code'
options:
_admin_route: TRUE
requirements:
_permission: 'execute php code'
devel.session: devel.session:
path: '/devel/session' path: '/devel/session'
defaults: defaults:
@@ -38,7 +38,7 @@ will want to directly inherit from Drupal\devel_generate\DevelGenerateBase.
To give support for a new field type the field type base class should properly To give support for a new field type the field type base class should properly
implements \Drupal\Core\Field\FieldItemInterface::generateSampleValue(). implements \Drupal\Core\Field\FieldItemInterface::generateSampleValue().
Devel generate automatically use the values returned by this method during the Devel Generate automatically uses the values returned by this method during the
generate process for generate placeholder field values. For more information generate process for generate placeholder field values. For more information
see: see:
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21FieldItemInterface.php/function/FieldItemInterface::generateSampleValue https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21FieldItemInterface.php/function/FieldItemInterface::generateSampleValue
@@ -0,0 +1,52 @@
{
"name": "drupal/devel_generate",
"description": "Generate dummy users, nodes, menus, taxonomy terms...",
"type": "drupal-module",
"homepage": "http://drupal.org/project/devel",
"authors": [
{
"name": "Moshe Weitzman",
"email": "weitzman@tejasa.com",
"homepage": "https://github.com/weitzman",
"role": "Maintainer"
},
{
"name": "Hans Salvisberg",
"email": "drupal@salvisberg.com",
"homepage": "https://www.drupal.org/u/salvis",
"role": "Maintainer"
},
{
"name": "Luca Lusso",
"homepage": "https://www.drupal.org/u/lussoluca",
"role": "Maintainer"
},
{
"name": "Marco (willzyx)",
"homepage": "https://www.drupal.org/u/willzyx",
"role": "Maintainer"
},
{
"name": "See contributors",
"homepage": "https://www.drupal.org/node/3236/committers"
}
],
"support": {
"issues": "http://drupal.org/project/devel",
"irc": "irc://irc.freenode.org/drupal-contribute",
"source": "http://cgit.drupalcode.org/devel"
},
"license": "GPL-2.0+",
"minimum-stability": "dev",
"require": {},
"suggest": {
"drupal/realistic_dummy_content": "Generate realistic demo content with Devel's devel_generate module."
},
"extra": {
"drush": {
"services": {
"drush.services.yml": "^9"
}
}
}
}
@@ -1,13 +1,13 @@
type: module type: module
name: 'Devel generate' name: 'Devel Generate'
description: 'Generate dummy users, nodes, menus, taxonomy terms...' description: 'Generate dummy users, nodes, menus, taxonomy terms...'
package: Development package: Development
# core: 8.x # core: 8.x
tags: tags:
- developer - developer
# Information added by Drupal.org packaging script on 2017-10-05 # Information added by Drupal.org packaging script on 2019-01-29
version: '8.x-1.2' version: '8.x-2.0'
core: '8.x' core: '8.x'
project: 'devel' project: 'devel'
datestamp: 1507197848 datestamp: 1548799386
@@ -53,7 +53,7 @@ function devel_generate_entity_insert(EntityInterface $entity) {
'source' => '/node/' . $entity->id(), 'source' => '/node/' . $entity->id(),
'alias' => '/node-' . $entity->id() . '-' . $entity->bundle(), 'alias' => '/node-' . $entity->id() . '-' . $entity->bundle(),
); );
\Drupal::service('path.alias_storage')->save($path['source'], $path['alias']); \Drupal::service('path.alias_storage')->save($path['source'], $path['alias'], $entity->language()->getId());
} }
// Add node statistics. // Add node statistics.
@@ -77,12 +77,12 @@ class DevelGenerateForm extends FormBase {
$plugin_id = $this->getPluginIdFromRequest(); $plugin_id = $this->getPluginIdFromRequest();
$instance = $this->getPluginInstance($plugin_id); $instance = $this->getPluginInstance($plugin_id);
$form = $instance->settingsForm($form, $form_state); $form = $instance->settingsForm($form, $form_state);
$form['actions'] = array('#type' => 'actions'); $form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = array( $form['actions']['submit'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Generate'), '#value' => $this->t('Generate'),
'#button_type' => 'primary', '#button_type' => 'primary',
); ];
return $form; return $form;
} }
@@ -1,14 +1,14 @@
name: 'Devel generate Example' name: 'Devel Generate Example'
type: module type: module
description: 'Create an example of DevelGenerate plugin type for testing purposing.' description: 'Create an example of a Devel Generate plugin type for testing purposes.'
package: Development package: Development
# core: 8.x # core: 8.x
configure: admin/config/development/generate configure: admin/config/development/generate
tags: tags:
- developer - developer
# Information added by Drupal.org packaging script on 2017-10-05 # Information added by Drupal.org packaging script on 2019-01-29
version: '8.x-1.2' version: '8.x-2.0'
core: '8.x' core: '8.x'
project: 'devel' project: 'devel'
datestamp: 1507197848 datestamp: 1548799386
@@ -70,7 +70,7 @@ class ExampleDevelGenerate extends DevelGenerateBase {
} }
// Populate all fields with sample values. // Populate all fields with sample values.
$this->populateFields($node); $this->populateFields($account);
$account->save(); $account->save();
@@ -1,38 +0,0 @@
<?php
namespace Unish;
if (class_exists('Unish\CommandUnishTestCase')) {
/**
* PHPUnit Tests for devel. This uses Drush's own test framework, based on PHPUnit.
* To run the tests, use run-tests-drush.sh from the devel directory.
*/
class develCase extends CommandUnishTestCase {
public function testFnCommands() {
// Specify '8' just in case user has not set UNISH_DRUPAL_MAJOR_VERSION env variable.
$sites = $this->setUpDrupal(1, TRUE, '8');
// Symlink this module into the Site Under test so it can be enabled.
$target = dirname(__DIR__);
\symlink($target, $this->webroot() . '/modules/devel');
$options = array(
'root' => $this->webroot(),
'uri' => key($sites),
);
$this->drush('pm-enable', array('devel'), $options + array('skip' => NULL, 'yes' => NULL));
$this->drush('fn-view', array('drush_main'), $options);
$output = $this->getOutput();
$this->assertContains('@return', $output, 'Output contain @return Doxygen.');
$this->assertContains('function drush_main() {', $output, 'Output contains function drush_main() declaration');
// $this->drush('fn-hook', array('cron'), $options);
// $output = $this->getOutputAsList();
// $expected = array('dblog', 'file', 'field', 'system', 'update');
// $this->assertSame($expected, $output);
}
}
}
@@ -6,8 +6,8 @@ package: Development
tags: tags:
- developer - developer
# Information added by Drupal.org packaging script on 2017-10-05 # Information added by Drupal.org packaging script on 2019-01-29
version: '8.x-1.2' version: '8.x-2.0'
core: '8.x' core: '8.x'
project: 'devel' project: 'devel'
datestamp: 1507197848 datestamp: 1548799386
@@ -1,21 +0,0 @@
#!/usr/bin/env sh
# This script will run phpunit-based test classes using Drush's
# test framework. First, the Drush executable is located, and
# then phpunit is invoked, pointing to Drush's phpunit.xml as
# the configuration.
#
# Any parameters that may be passed to `phpunit` may also be used
# with this script.
DRUSH_PATH="`which drush`"
DRUSH_DIRNAME="`dirname -- "$DRUSH_PATH"`"
# The following line is needed is you use a `drush` that differs from `which drush`
# export UNISH_DRUSH=$DRUSH_PATH
if [ $# = 0 ] ; then
phpunit --configuration="$DRUSH_DIRNAME/tests" drush
else
# Pass along any arguments.
phpunit --configuration="$DRUSH_DIRNAME/tests" $@
fi
@@ -4,12 +4,15 @@ namespace Drupal\devel;
use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Session\AccountProxyInterface; use Drupal\Core\Session\AccountProxyInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
/** /**
* Class DevelDumperManager * Class DevelDumperManager.
*/ */
class DevelDumperManager implements DevelDumperManagerInterface { class DevelDumperManager implements DevelDumperManagerInterface {
use StringTranslationTrait;
/** /**
* The devel config. * The devel config.
* *
@@ -100,7 +103,7 @@ class DevelDumperManager implements DevelDumperManagerInterface {
// The temp directory does vary across multiple simpletest instances. // The temp directory does vary across multiple simpletest instances.
$file = file_directory_temp() . '/drupal_debug.txt'; $file = file_directory_temp() . '/drupal_debug.txt';
if (file_put_contents($file, $output, FILE_APPEND) === FALSE && $this->hasAccessToDevelInformation()) { if (file_put_contents($file, $output, FILE_APPEND) === FALSE && $this->hasAccessToDevelInformation()) {
drupal_set_message(t('Devel was unable to write to %file.', ['%file' => $file]), 'error'); drupal_set_message($this->t('Devel was unable to write to %file.', ['%file' => $file]), 'error');
return FALSE; return FALSE;
} }
} }
@@ -96,7 +96,7 @@ class ThemeInfoRebuildSubscriber implements EventSubscriberInterface {
protected function triggerWarningIfNeeded(Request $request) { protected function triggerWarningIfNeeded(Request $request) {
if ($this->account && $this->account->hasPermission('access devel information')) { if ($this->account && $this->account->hasPermission('access devel information')) {
$session = $request->getSession(); $session = $request->getSession();
if (!$session->has($this->notificationFlag)) { if ($session && !$session->has($this->notificationFlag)) {
$session->set($this->notificationFlag, TRUE); $session->set($this->notificationFlag, TRUE);
$message = $this->t('The theme information is being rebuilt on every request. Remember to <a href=":url">turn off</a> this feature on production websites.', [':url' => Url::fromRoute('devel.admin_settings')->toString()]); $message = $this->t('The theme information is being rebuilt on every request. Remember to <a href=":url">turn off</a> this feature on production websites.', [':url' => Url::fromRoute('devel.admin_settings')->toString()]);
drupal_set_message($message, 'warning', TRUE); drupal_set_message($message, 'warning', TRUE);
@@ -69,11 +69,11 @@ class ConfigEditor extends FormBase {
'#required' => TRUE, '#required' => TRUE,
); );
$form['actions'] = array('#type' => 'actions'); $form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = array( $form['actions']['submit'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Save'), '#value' => $this->t('Save'),
); ];
$form['actions']['cancel'] = array( $form['actions']['cancel'] = array(
'#type' => 'link', '#type' => 'link',
'#title' => $this->t('Cancel'), '#title' => $this->t('Cancel'),
@@ -35,10 +35,11 @@ class ConfigsList extends FormBase {
'#title_display' => 'invisible', '#title_display' => 'invisible',
'#default_value' => $filter, '#default_value' => $filter,
); );
$form['filter']['show'] = array( $form['filter']['actions'] = ['#type' => 'actions'];
$form['filter']['actions']['show'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Filter'), '#value' => $this->t('Filter'),
); ];
$header = array( $header = array(
'name' => array('data' => $this->t('Name')), 'name' => array('data' => $this->t('Name')),
@@ -116,11 +116,11 @@ class DevelReinstall extends FormBase {
$form['#attached']['library'][] = 'system/drupal.system.modules'; $form['#attached']['library'][] = 'system/drupal.system.modules';
$form['actions'] = array('#type' => 'actions'); $form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = array( $form['actions']['submit'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Reinstall'), '#value' => $this->t('Reinstall'),
); ];
return $form; return $form;
} }
@@ -1,55 +0,0 @@
<?php
namespace Drupal\devel\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Defines a form that allows privileged users to execute arbitrary PHP code.
*/
class ExecutePHP extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'devel_execute_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form = array(
'#title' => $this->t('Execute PHP Code'),
'#description' => $this->t('Execute some PHP code'),
);
$form['execute']['code'] = array(
'#type' => 'textarea',
'#title' => t('PHP code to execute'),
'#description' => t('Enter some code. Do not use <code>&lt;?php ?&gt;</code> tags.'),
'#default_value' => (isset($_SESSION['devel_execute_code']) ? $_SESSION['devel_execute_code'] : ''),
'#rows' => 20,
);
$form['execute']['op'] = array('#type' => 'submit', '#value' => t('Execute'));
$form['#redirect'] = FALSE;
if (isset($_SESSION['devel_execute_code'])) {
unset($_SESSION['devel_execute_code']);
}
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
ob_start();
$code = $form_state->getValue('code');
print eval($code);
$_SESSION['devel_execute_code'] = $code;
dpm(ob_get_clean());
}
}
@@ -66,7 +66,7 @@ class SettingsForm extends ConfigFormBase {
$form['page_alter'] = array('#type' => 'checkbox', $form['page_alter'] = array('#type' => 'checkbox',
'#title' => t('Display $page array'), '#title' => t('Display $page array'),
'#default_value' => $devel_config->get('page_alter'), '#default_value' => $devel_config->get('page_alter'),
'#description' => t('Display $page array from <a href="http://api.drupal.org/api/function/hook_page_alter/7">hook_page_alter()</a> in the messages area of each page.'), '#description' => t('Display $page array from <a href="https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21theme.api.php/function/hook_page_attachments_alter/8">hook_page_attachments_alter()</a> in the messages area of each page.'),
); );
$form['raw_names'] = array('#type' => 'checkbox', $form['raw_names'] = array('#type' => 'checkbox',
'#title' => t('Display machine names of permissions and modules'), '#title' => t('Display machine names of permissions and modules'),
@@ -108,17 +108,17 @@ class SystemStateEdit extends FormBase {
'#rows' => 15, '#rows' => 15,
); );
$form['actions'] = array('#type' => 'actions'); $form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = array( $form['actions']['submit'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Save'), '#value' => $this->t('Save'),
'#disabled' => $disabled, '#disabled' => $disabled,
); ];
$form['actions']['cancel'] = array( $form['actions']['cancel'] = [
'#type' => 'link', '#type' => 'link',
'#title' => $this->t('Cancel'), '#title' => $this->t('Cancel'),
'#url' => Url::fromRoute('devel.state_system_page') '#url' => Url::fromRoute('devel.state_system_page')
); ];
return $form; return $form;
} }
@@ -1,33 +0,0 @@
<?php
namespace Drupal\devel\Plugin\Block;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Session\AccountInterface;
/**
* Provides a block for executing PHP code.
*
* @Block(
* id = "devel_execute_php",
* admin_label = @Translation("Execute PHP")
* )
*/
class DevelExecutePHP extends BlockBase {
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'execute php code');
}
/**
* {@inheritdoc}
*/
public function build() {
return \Drupal::formBuilder()->getForm('Drupal\devel\Form\ExecutePHP');
}
}
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION # version: VERSION
# core: 8.x # core: 8.x
# Information added by Drupal.org packaging script on 2017-10-05 # Information added by Drupal.org packaging script on 2019-01-29
version: '8.x-1.2' version: '8.x-2.0'
core: '8.x' core: '8.x'
project: 'devel' project: 'devel'
datestamp: 1507197848 datestamp: 1548799386
@@ -5,12 +5,12 @@ package: Testing
# version: VERSION # version: VERSION
# core: 8.x # core: 8.x
dependencies: dependencies:
- field - drupal:field
- text - drupal:text
- entity_test - drupal:entity_test
# Information added by Drupal.org packaging script on 2017-10-05 # Information added by Drupal.org packaging script on 2019-01-29
version: '8.x-1.2' version: '8.x-2.0'
core: '8.x' core: '8.x'
project: 'devel' project: 'devel'
datestamp: 1507197848 datestamp: 1548799386
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION # version: VERSION
# core: 8.x # core: 8.x
# Information added by Drupal.org packaging script on 2017-10-05 # Information added by Drupal.org packaging script on 2019-01-29
version: '8.x-1.2' version: '8.x-2.0'
core: '8.x' core: '8.x'
project: 'devel' project: 'devel'
datestamp: 1507197848 datestamp: 1548799386
@@ -50,7 +50,7 @@ class DevelDumperTest extends BrowserTestBase {
'chromephp', 'chromephp',
'var_dumper', 'var_dumper',
]; ];
$available_dumpers = ['default', 'drupal_variable']; $available_dumpers = ['default', 'drupal_variable', 'var_dumper'];
foreach ($dumpers as $dumper) { foreach ($dumpers as $dumper) {
$this->assertFieldByXPath('//input[@type="radio" and @name="dumper"]', $dumper); $this->assertFieldByXPath('//input[@type="radio" and @name="dumper"]', $dumper);
@@ -40,7 +40,6 @@ class DevelToolbarTest extends BrowserTestBase {
'devel.cache_clear', 'devel.cache_clear',
'devel.container_info.service', 'devel.container_info.service',
'devel.admin_settings_link', 'devel.admin_settings_link',
'devel.execute_php',
'devel.menu_rebuild', 'devel.menu_rebuild',
'devel.reinstall', 'devel.reinstall',
'devel.route_info', 'devel.route_info',
@@ -59,7 +58,6 @@ class DevelToolbarTest extends BrowserTestBase {
$this->develUser = $this->drupalCreateUser([ $this->develUser = $this->drupalCreateUser([
'administer site configuration', 'administer site configuration',
'access devel information', 'access devel information',
'execute php code',
'access toolbar', 'access toolbar',
]); ]);
$this->toolbarUser = $this->drupalCreateUser([ $this->toolbarUser = $this->drupalCreateUser([
@@ -69,7 +69,7 @@ class DevelQueryDebugTest extends KernelTestBase {
// permissions. We expect only one status message containing the SQL for // permissions. We expect only one status message containing the SQL for
// the debugged query. // the debugged query.
\Drupal::currentUser()->setAccount($this->develUser); \Drupal::currentUser()->setAccount($this->develUser);
$expected_message = "SELECT u.uid AS uid\nFROM \n{users} u"; $expected_message = "SELECT u.uid AS uid\nFROM\n{users} u";
$query = \Drupal::database()->select('users', 'u'); $query = \Drupal::database()->select('users', 'u');
$query->fields('u', ['uid']); $query->fields('u', ['uid']);
@@ -102,7 +102,7 @@ class DevelQueryDebugTest extends KernelTestBase {
// permissions. We expect only one status message containing the SQL for // permissions. We expect only one status message containing the SQL for
// the debugged entity query. // the debugged entity query.
\Drupal::currentUser()->setAccount($this->develUser); \Drupal::currentUser()->setAccount($this->develUser);
$expected_message = "SELECT base_table.uid AS uid, base_table.uid AS base_table_uid\nFROM \n{users} base_table"; $expected_message = "SELECT base_table.uid AS uid, base_table.uid AS base_table_uid\nFROM\n{users} base_table";
$query = \Drupal::entityQuery('user'); $query = \Drupal::entityQuery('user');
$query->addTag('debug'); $query->addTag('debug');
@@ -70,7 +70,7 @@ class DevelTwigExtensionTest extends KernelTestBase {
*/ */
public function testTwigExtensionLoaded() { public function testTwigExtensionLoaded() {
$twig_service = \Drupal::service('twig'); $twig_service = \Drupal::service('twig');
$extension = $twig_service->getExtension('devel_debug'); $extension = $twig_service->getExtension(Debug::class);
$this->assertEquals(get_class($extension), Debug::class, 'Debug Extension loaded successfully.'); $this->assertEquals(get_class($extension), Debug::class, 'Debug Extension loaded successfully.');
} }
@@ -0,0 +1,31 @@
<?php
namespace Drupal\Tests\devel\Unish;
use Unish\CommandUnishTestCase;
/**
* @group devel
* @group commands
*/
class DevelDrushTest extends CommandUnishTestCase {
/**
* {@inheritdoc}
*/
protected function setUp() {
$this->setUpDrupal(1, true);
$this->drush('pm:enable', ['devel']);
}
/**
* Test devel:services command.
*/
public function testServices() {
$this->drush('devel:services');
$output = $this->getOutput();
$this->assertContains('account_switcher', $output);
}
}
@@ -0,0 +1,6 @@
Running Unish Tests
===================
Follow instructions provided by [Drush test README.md](https://github.com/drush-ops/drush/blob/master/tests/README.md) in order to test Unish test cases provided by contrib modules.
See: https://github.com/drush-ops/drush/blob/master/tests/README.md
@@ -62,7 +62,9 @@ class ToolbarController extends ControllerBase {
* *
* @param Profile $profile * @param Profile $profile
* *
* @return array * @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Exception
*/ */
public function toolbarAction(Profile $profile) { public function toolbarAction(Profile $profile) {
$this->profiler->disable(); $this->profiler->disable();
@@ -43,8 +43,16 @@ class DatabaseDataCollector extends DataCollector implements DrupalDataCollector
public function collect(Request $request, Response $response, \Exception $exception = NULL) { public function collect(Request $request, Response $response, \Exception $exception = NULL) {
$connections = []; $connections = [];
foreach (Database::getAllConnectionInfo() as $key => $info) { foreach (Database::getAllConnectionInfo() as $key => $info) {
$database = Database::getConnection('default', $key); try {
$connections[$key] = $database->getLogger()->get('webprofiler'); $database = Database::getConnection('default', $key);
if ($database->getLogger()) {
$connections[$key] = $database->getLogger()->get('webprofiler');
}
} catch(\Exception $e) {
// There was some error during database connection, maybe a stale
// configuration in settings.php or wrong values used for a migration.
}
} }
$this->data['connections'] = array_keys($connections); $this->data['connections'] = array_keys($connections);
@@ -7,6 +7,13 @@ namespace Drupal\webprofiler\DataCollector;
*/ */
trait DrupalDataCollectorTrait { trait DrupalDataCollectorTrait {
/**
* {@inheritdoc}
*/
public function reset() {
$this->data = array();
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
@@ -47,8 +54,6 @@ trait DrupalDataCollectorTrait {
* @param $method * @param $method
* *
* @return array * @return array
*
* @throws \ReflectionException
*/ */
public function getMethodData($class, $method) { public function getMethodData($class, $method) {
$class = is_object($class) ? get_class($class) : $class; $class = is_object($class) ? get_class($class) : $class;
@@ -41,11 +41,11 @@ class FormsDataCollector extends DataCollector implements DrupalDataCollectorInt
* @return array * @return array
*/ */
public function getForms() { public function getForms() {
return $this->data['forms']; return (!empty($this->data['forms']) && is_array($this->data['forms'])) ? $this->data['forms'] : [];
} }
/** /**
* @return array * @return int
*/ */
public function getFormsCount() { public function getFormsCount() {
return count($this->getForms()); return count($this->getForms());
@@ -51,7 +51,8 @@ class RequestDataCollector extends BaseRequestDataCollector implements DrupalDat
/** /**
* @param $service_id * @param $service_id
* @param $callable * @param $callable
* @param $request * @param \Symfony\Component\HttpFoundation\Request $request
*
*/ */
public function addAccessCheck($service_id, $callable, Request $request) { public function addAccessCheck($service_id, $callable, Request $request) {
$this->accessCheck[$request->getPathInfo()][] = [ $this->accessCheck[$request->getPathInfo()][] = [
@@ -71,7 +72,7 @@ class RequestDataCollector extends BaseRequestDataCollector implements DrupalDat
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getPanelSummary() { public function getPanelSummary() {
return $this->data['status_code'].' '.$this->data['status_text']; return $this->data['status_code'] . ' ' . $this->data['status_text'];
} }
/** /**
@@ -80,4 +81,33 @@ class RequestDataCollector extends BaseRequestDataCollector implements DrupalDat
public function getIcon() { public function getIcon() {
return 'iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAQAAADYBBcfAAACvElEQVR42tVTbUhTYRTerDCnKVoUUr/KCZmypA9Koet0bXNLJ5XazDJ/WFaCUY0pExRZXxYiJgsxWWjkaL+yK+po1gjyR2QfmqWxtBmaBtqWGnabT++c11Fu4l/P4VzOPc95zoHznsNZodIbLDdRcKnc1Bu8DAK45ZsOnykQNMopsNooLxCknb0cDq5vml9FtHiIgpBR0R6iihYyFMTDt2Lg56ObPkI6TMGXSof1EV67IqCwisJSWliFAG/E0CfFIiebdNypcxi/1zgyFiIiZ3sJQr0RQx5frLa6k7SOKRo3oMFNR5t62h2rttKXEOKFqDCxtXNmmBokO2KKTlp3IdWuT2dYRNGKwEXEBCcL172G5FG0aIxC0kR9PBTVH1kkwQn+IqJnCE33EalVzT9GJQS1tAdD3CKicJYFrxqx7W2ejCEdZy1FiC5tZxHhLJKOZaRdQJAyV/YAvDliySALHxmxR4Hqe2iwvaOR/CEuZYJFSgYhVbZRkA8KGdEktrqnqra90NndCdkt77fjIHIhexOrfO6O3bbbOj/rqu5IptgyR3sU93QbOYhquZK4MCDp0Ina/PLsu5JvbCTRaapUdUmIV/RzoMdsk/0hWRNdAvKOmvqlN0drsJbJf1P4YsQ5lGrJeuosiOUgbOC8cto3LfOXTdVd7BqZsQKbse+0jUL6WPcesqs4MNSUTQAxGjwFiC8m3yzmqwHJBWYKBJ9WNqW/dHkpU/osch1Yj5RJfXPfSEe/2UPsN490NPfZG5CKyJmcV5ayHyzy7BMqsXfuHhGK/cjAIeSpR92gehR55D8TcQhDEKJwytBJ4fr4NULvrEM8NszfJPyxDoHYAQ1oPCWmIX4gifmDS/DV2DKeb25FHWr76yEG7/9L4YFPeiQQ4/8LkgJ8Et+NncTCsYqzXAEXa7CWdPZzGWdlyV+vST0JanfPvwAAAABJRU5ErkJggg=='; return 'iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAQAAADYBBcfAAACvElEQVR42tVTbUhTYRTerDCnKVoUUr/KCZmypA9Koet0bXNLJ5XazDJ/WFaCUY0pExRZXxYiJgsxWWjkaL+yK+po1gjyR2QfmqWxtBmaBtqWGnabT++c11Fu4l/P4VzOPc95zoHznsNZodIbLDdRcKnc1Bu8DAK45ZsOnykQNMopsNooLxCknb0cDq5vml9FtHiIgpBR0R6iihYyFMTDt2Lg56ObPkI6TMGXSof1EV67IqCwisJSWliFAG/E0CfFIiebdNypcxi/1zgyFiIiZ3sJQr0RQx5frLa6k7SOKRo3oMFNR5t62h2rttKXEOKFqDCxtXNmmBokO2KKTlp3IdWuT2dYRNGKwEXEBCcL172G5FG0aIxC0kR9PBTVH1kkwQn+IqJnCE33EalVzT9GJQS1tAdD3CKicJYFrxqx7W2ejCEdZy1FiC5tZxHhLJKOZaRdQJAyV/YAvDliySALHxmxR4Hqe2iwvaOR/CEuZYJFSgYhVbZRkA8KGdEktrqnqra90NndCdkt77fjIHIhexOrfO6O3bbbOj/rqu5IptgyR3sU93QbOYhquZK4MCDp0Ina/PLsu5JvbCTRaapUdUmIV/RzoMdsk/0hWRNdAvKOmvqlN0drsJbJf1P4YsQ5lGrJeuosiOUgbOC8cto3LfOXTdVd7BqZsQKbse+0jUL6WPcesqs4MNSUTQAxGjwFiC8m3yzmqwHJBWYKBJ9WNqW/dHkpU/osch1Yj5RJfXPfSEe/2UPsN490NPfZG5CKyJmcV5ayHyzy7BMqsXfuHhGK/cjAIeSpR92gehR55D8TcQhDEKJwytBJ4fr4NULvrEM8NszfJPyxDoHYAQ1oPCWmIX4gifmDS/DV2DKeb25FHWr76yEG7/9L4YFPeiQQ4/8LkgJ8Et+NncTCsYqzXAEXa7CWdPZzGWdlyV+vST0JanfPvwAAAABJRU5ErkJggg==';
} }
/**
* @return array|string
*/
public function getData() {
// Drupal 8.5+ uses Symfony 3.4.x that changes the way the Request data are
// collected. Data is altered with \Symfony\Component\HttpKernel\DataCollector\DataCollector::cloneVar.
// The stored data (of type \Symfony\Component\VarDumper\Cloner\Data) is
// suitable to be converted to a string by a Dumper (\Symfony\Component\VarDumper\Dumper\DataDumperInterface).
// In our implementation however we need that data as an array, to be later
// converted in a json response by a REST endpoint. We need to refactor the
// whole way Web Profiler works to allow that. At the moment we just
// retrieve the raw Data value and do some string manipulation to clean the
// output a bit.
$data = $this->data->getValue(TRUE);
unset($data['request_attributes']['_route_params']);
unset($data['request_attributes']['_access_result']);
$route_object = [];
foreach($data['request_attributes']['_route_object'] as $key => $result) {
$key = str_replace("\0", '', $key);
$key = str_replace('Symfony\Component\Routing\Route', 'Symfony\Component\Routing\Route::', $key);
$route_object[$key] = $result;
}
$data['request_attributes']['_route_object'] = $route_object;
return $data;
}
} }
@@ -0,0 +1,33 @@
<?php
namespace Drupal\webprofiler\Entity\Decorators\Config;
use Drupal\image\ImageStyleStorageInterface;
/**
* Class ImageStyleStorageDecorator
*/
class ImageStyleStorageDecorator extends ConfigEntityStorageDecorator implements ImageStyleStorageInterface {
/**
* {@inheritdoc}
*/
public function setReplacementId($name, $replacement) {
return $this->getOriginalObject()->setReplacementId($name, $replacement);
}
/**
* {@inheritdoc}
*/
public function getReplacementId($name) {
return $this->getOriginalObject()->getReplacementId($name);
}
/**
* {@inheritdoc}
*/
public function clearReplacementId($name) {
return $this->getOriginalObject()->clearReplacementId($name);
}
}
@@ -8,6 +8,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\EntityViewBuilderInterface; use Drupal\Core\Entity\EntityViewBuilderInterface;
use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\webprofiler\Entity\Decorators\Config\ConfigEntityStorageDecorator; use Drupal\webprofiler\Entity\Decorators\Config\ConfigEntityStorageDecorator;
use Drupal\webprofiler\Entity\Decorators\Config\ImageStyleStorageDecorator;
use Drupal\webprofiler\Entity\Decorators\Config\RoleStorageDecorator; use Drupal\webprofiler\Entity\Decorators\Config\RoleStorageDecorator;
use Drupal\webprofiler\Entity\Decorators\Config\ShortcutSetStorageDecorator; use Drupal\webprofiler\Entity\Decorators\Config\ShortcutSetStorageDecorator;
use Drupal\webprofiler\Entity\Decorators\Config\VocabularyStorageDecorator; use Drupal\webprofiler\Entity\Decorators\Config\VocabularyStorageDecorator;
@@ -98,6 +99,9 @@ class EntityManagerWrapper extends DefaultPluginManager implements EntityTypeMan
case 'shortcut_set': case 'shortcut_set':
return new ShortcutSetStorageDecorator($handler); return new ShortcutSetStorageDecorator($handler);
break; break;
case 'image_style':
return new ImageStyleStorageDecorator($handler);
break;
default: default:
return new ConfigEntityStorageDecorator($handler); return new ConfigEntityStorageDecorator($handler);
break; break;
@@ -170,10 +170,18 @@ class TraceableEventDispatcher extends ContainerAwareEventDispatcher implements
* @param $priority * @param $priority
*/ */
private function addCalledListener($definition, $event_name, $priority) { private function addCalledListener($definition, $event_name, $priority) {
$this->calledListeners[$event_name][$priority][] = [ if ($this->isClosure($definition['callable'])) {
'class' => get_class($definition['callable'][0]), $this->calledListeners[$event_name][$priority][] = [
'method' => $definition['callable'][1], 'class' => 'Closure',
]; 'method' => '',
];
}
else {
$this->calledListeners[$event_name][$priority][] = [
'class' => get_class($definition['callable'][0]),
'method' => $definition['callable'][1],
];
}
foreach ($this->notCalledListeners[$event_name][$priority] as $key => $listener) { foreach ($this->notCalledListeners[$event_name][$priority] as $key => $listener) {
if (isset($listener['service'])) { if (isset($listener['service'])) {
@@ -182,12 +190,25 @@ class TraceableEventDispatcher extends ContainerAwareEventDispatcher implements
} }
} }
else { else {
if (get_class($listener['callable'][0]) == get_class($definition['callable'][0]) && $listener['callable'][1] == $definition['callable'][1]) { if ($this->isClosure($listener['callable'])) {
unset($this->notCalledListeners[$event_name][$priority][$key]); if (is_callable($listener['callable'], TRUE, $listenerCallableName) && is_callable($definition['callable'], TRUE, $definitionCallableName)) {
if ($listenerCallableName == $definitionCallableName) {
unset($this->notCalledListeners[$event_name][$priority][$key]);
}
}
}
else {
if (get_class($listener['callable'][0]) == get_class($definition['callable'][0]) && $listener['callable'][1] == $definition['callable'][1]) {
unset($this->notCalledListeners[$event_name][$priority][$key]);
}
} }
} }
} }
} }
private function isClosure($t) {
return is_object($t) && ($t instanceof \Closure);
}
} }
@@ -0,0 +1,118 @@
<?php
namespace Drupal\webprofiler\EventSubscriber;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ProfilerSubscriber implements EventSubscriberInterface {
protected $profiler;
protected $matcher;
protected $onlyException;
protected $onlyMasterRequests;
protected $exception;
protected $profiles;
protected $requestStack;
protected $parents;
/**
* @param Profiler $profiler A Profiler instance
* @param RequestStack $requestStack A RequestStack instance
* @param RequestMatcherInterface|null $matcher A RequestMatcher instance
* @param bool $onlyException True if the profiler only collects data when an
* exception occurs, false otherwise
* @param bool $onlyMasterRequests True if the profiler only collects data
* when the request is a master request, false otherwise
*/
public function __construct(Profiler $profiler, RequestStack $requestStack, RequestMatcherInterface $matcher = NULL, $onlyException = FALSE, $onlyMasterRequests = FALSE) {
$this->profiler = $profiler;
$this->matcher = $matcher;
$this->onlyException = (bool) $onlyException;
$this->onlyMasterRequests = (bool) $onlyMasterRequests;
$this->profiles = new \SplObjectStorage();
$this->parents = new \SplObjectStorage();
$this->requestStack = $requestStack;
}
/**
* Handles the onKernelException event.
*/
public function onKernelException(GetResponseForExceptionEvent $event) {
if ($this->onlyMasterRequests && !$event->isMasterRequest()) {
return;
}
$this->exception = $event->getException();
}
/**
* Handles the onKernelResponse event.
*/
public function onKernelResponse(FilterResponseEvent $event) {
$master = $event->isMasterRequest();
if ($this->onlyMasterRequests && !$master) {
return;
}
if ($this->onlyException && NULL === $this->exception) {
return;
}
$request = $event->getRequest();
$exception = $this->exception;
$this->exception = NULL;
if (NULL !== $this->matcher && !$this->matcher->matches($request)) {
return;
}
if (!$profile = $this->profiler->collect($request, $event->getResponse(), $exception)) {
return;
}
$this->profiles[$request] = $profile;
$this->parents[$request] = $this->requestStack->getParentRequest();
}
public function onKernelFinishRequest(FinishRequestEvent $event) {
// attach children to parents
foreach ($this->profiles as $request) {
if (NULL !== $parentRequest = $this->parents[$request]) {
if (isset($this->profiles[$parentRequest])) {
$this->profiles[$parentRequest]->addChild($this->profiles[$request]);
}
}
}
// save profiles
foreach ($this->profiles as $request) {
$this->profiler->saveProfile($this->profiles[$request]);
}
$this->profiles = new \SplObjectStorage();
$this->parents = new \SplObjectStorage();
}
public static function getSubscribedEvents() {
return [
KernelEvents::RESPONSE => ['onKernelResponse', -100],
KernelEvents::EXCEPTION => 'onKernelException',
KernelEvents::FINISH_REQUEST => ['onKernelFinishRequest', -1024],
];
}
}
@@ -165,7 +165,8 @@ class ConfigForm extends ConfigFormBase {
'#open' => FALSE, '#open' => FALSE,
]; ];
$form['purge']['purge'] = [ $form['purge']['actions'] = ['#type' => 'actions'];
$form['purge']['actions']['purge'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Purge'), '#value' => $this->t('Purge'),
'#submit' => [[$this, 'purge']], '#submit' => [[$this, 'purge']],
@@ -36,8 +36,18 @@ class HttpClientMiddleware {
return function ($handler) { return function ($handler) {
return function (RequestInterface $request, array $options) use ($handler) { return function (RequestInterface $request, array $options) use ($handler) {
$options['on_stats'] = function (TransferStats $stats) use ($request) { // If on_stats callback is already set then save it
// and call it after ours.
if (isset($options['on_stats'])) {
$next = $options['on_stats'];
}
else {
$next = function(TransferStats $stats) {};
}
$options['on_stats'] = function (TransferStats $stats) use ($request, $next) {
$request->stats = $stats; $request->stats = $stats;
$next($stats);
}; };
return $handler($request, $options)->then( return $handler($request, $options)->then(
@@ -91,4 +91,14 @@ class MailManagerWrapper extends DefaultPluginManager implements MailManagerInte
return $message; return $message;
} }
/**
* {@inheritdoc}
*
* Must call getInstance on the decorated MailManager.
* @see https://www.drupal.org/node/2625554
*/
public function getInstance(array $options) {
return $this->mailManager->getInstance($options);
}
} }
@@ -0,0 +1,325 @@
<?php
// @codingStandardsIgnoreFile
/**
* This file was generated via php core/scripts/generate-proxy-class.php
* 'Drupal\webprofiler\Command\ListCommand'
* "modules/contrib/devel/webprofiler/src".
*/
namespace Drupal\webprofiler\ProxyClass\Command {
/**
* Provides a proxy class for \Drupal\webprofiler\Command\ListCommand.
*
* @see \Drupal\Component\ProxyBuilder
*/
class ListCommand {
use \Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
* The id of the original proxied service.
*
* @var string
*/
protected $drupalProxyOriginalServiceId;
/**
* The real proxied service, after it was lazy loaded.
*
* @var \Drupal\webprofiler\Command\ListCommand
*/
protected $service;
/**
* The service container.
*
* @var \Symfony\Component\DependencyInjection\ContainerInterface
*/
protected $container;
/**
* Constructs a ProxyClass Drupal proxy object.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The container.
* @param string $drupal_proxy_original_service_id
* The service ID of the original service.
*/
public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container, $drupal_proxy_original_service_id) {
$this->container = $container;
$this->drupalProxyOriginalServiceId = $drupal_proxy_original_service_id;
}
/**
* Lazy loads the real service from the container.
*
* @return object
* Returns the constructed real service.
*/
protected function lazyLoadItself() {
if (!isset($this->service)) {
$this->service = $this->container->get($this->drupalProxyOriginalServiceId);
}
return $this->service;
}
/**
* {@inheritdoc}
*/
public function showMessage($output, $message, $type = 'info') {
return $this->lazyLoadItself()->showMessage($output, $message, $type);
}
/**
* {@inheritdoc}
*/
public function ignoreValidationErrors() {
return $this->lazyLoadItself()->ignoreValidationErrors();
}
/**
* {@inheritdoc}
*/
public function setApplication(\Symfony\Component\Console\Application $application = NULL) {
return $this->lazyLoadItself()->setApplication($application);
}
/**
* {@inheritdoc}
*/
public function setHelperSet(\Symfony\Component\Console\Helper\HelperSet $helperSet) {
return $this->lazyLoadItself()->setHelperSet($helperSet);
}
/**
* {@inheritdoc}
*/
public function getHelperSet() {
return $this->lazyLoadItself()->getHelperSet();
}
/**
* {@inheritdoc}
*/
public function getApplication() {
return $this->lazyLoadItself()->getApplication();
}
/**
* {@inheritdoc}
*/
public function isEnabled() {
return $this->lazyLoadItself()->isEnabled();
}
/**
* {@inheritdoc}
*/
public function run(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) {
return $this->lazyLoadItself()->run($input, $output);
}
/**
* {@inheritdoc}
*/
public function setCode(callable $code) {
return $this->lazyLoadItself()->setCode($code);
}
/**
* {@inheritdoc}
*/
public function mergeApplicationDefinition($mergeArgs = TRUE) {
return $this->lazyLoadItself()->mergeApplicationDefinition($mergeArgs);
}
/**
* {@inheritdoc}
*/
public function setDefinition($definition) {
return $this->lazyLoadItself()->setDefinition($definition);
}
/**
* {@inheritdoc}
*/
public function getDefinition() {
return $this->lazyLoadItself()->getDefinition();
}
/**
* {@inheritdoc}
*/
public function getNativeDefinition() {
return $this->lazyLoadItself()->getNativeDefinition();
}
/**
* {@inheritdoc}
*/
public function addArgument($name, $mode = NULL, $description = '', $default = NULL) {
return $this->lazyLoadItself()
->addArgument($name, $mode, $description, $default);
}
/**
* {@inheritdoc}
*/
public function addOption($name, $shortcut = NULL, $mode = NULL, $description = '', $default = NULL) {
return $this->lazyLoadItself()
->addOption($name, $shortcut, $mode, $description, $default);
}
/**
* {@inheritdoc}
*/
public function setName($name) {
return $this->lazyLoadItself()->setName($name);
}
/**
* {@inheritdoc}
*/
public function setProcessTitle($title) {
return $this->lazyLoadItself()->setProcessTitle($title);
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this->lazyLoadItself()->getName();
}
/**
* {@inheritdoc}
*/
public function setHidden($hidden) {
return $this->lazyLoadItself()->setHidden($hidden);
}
/**
* {@inheritdoc}
*/
public function isHidden() {
return $this->lazyLoadItself()->isHidden();
}
/**
* {@inheritdoc}
*/
public function setDescription($description) {
return $this->lazyLoadItself()->setDescription($description);
}
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->lazyLoadItself()->getDescription();
}
/**
* {@inheritdoc}
*/
public function setHelp($help) {
return $this->lazyLoadItself()->setHelp($help);
}
/**
* {@inheritdoc}
*/
public function getHelp() {
return $this->lazyLoadItself()->getHelp();
}
/**
* {@inheritdoc}
*/
public function getProcessedHelp() {
return $this->lazyLoadItself()->getProcessedHelp();
}
/**
* {@inheritdoc}
*/
public function setAliases($aliases) {
return $this->lazyLoadItself()->setAliases($aliases);
}
/**
* {@inheritdoc}
*/
public function getAliases() {
return $this->lazyLoadItself()->getAliases();
}
/**
* {@inheritdoc}
*/
public function getSynopsis($short = FALSE) {
return $this->lazyLoadItself()->getSynopsis($short);
}
/**
* {@inheritdoc}
*/
public function addUsage($usage) {
return $this->lazyLoadItself()->addUsage($usage);
}
/**
* {@inheritdoc}
*/
public function getUsages() {
return $this->lazyLoadItself()->getUsages();
}
/**
* {@inheritdoc}
*/
public function getHelper($name) {
return $this->lazyLoadItself()->getHelper($name);
}
/**
* {@inheritdoc}
*/
public function setContainer($container) {
return $this->lazyLoadItself()->setContainer($container);
}
/**
* {@inheritdoc}
*/
public function has($key) {
return $this->lazyLoadItself()->has($key);
}
/**
* {@inheritdoc}
*/
public function get($key) {
return $this->lazyLoadItself()->get($key);
}
/**
* {@inheritdoc}
*/
public function setTranslator($translator) {
return $this->lazyLoadItself()->setTranslator($translator);
}
/**
* {@inheritdoc}
*/
public function trans($key) {
return $this->lazyLoadItself()->trans($key);
}
}
}
@@ -57,7 +57,7 @@
<option value="1">{{ 'Yes'|t }}</option> <option value="1">{{ 'Yes'|t }}</option>
<option value="0">{{ 'No'|t }}</option> <option value="0">{{ 'No'|t }}</option>
</select> </select>
<label for="edit-type" class="panel__filter-label">{{ 'Slow queryes'|t }}</label> <label for="edit-type" class="panel__filter-label">{{ 'Slow queries'|t }}</label>
</div> </div>
<div class="panel__filter--select"> <div class="panel__filter--select">
<select id="edit-database" class="js--live-filter"> <select id="edit-database" class="js--live-filter">
@@ -44,7 +44,13 @@
<tr> <tr>
<td><%= event_name %></td> <td><%= event_name %></td>
<% if( listener.clazz ) { %> <% if( listener.clazz ) { %>
<td><%= Drupal.webprofiler.helpers.classLink(listener.clazz) %></td> <td>
<% if( listener.class == "Closure" ) { %>
<%= "Closure" %>
<% } else { %>
<%= Drupal.webprofiler.helpers.classLink(listener.clazz) %>
<% } %>
</td>
<% } else { %> <% } else { %>
<td><%= listener.service[0] %>::<%= listener.service[1] %></td> <td><%= listener.service[0] %>::<%= listener.service[1] %></td>
<% } %> <% } %>
@@ -46,9 +46,10 @@
<% if (!_.isEmpty(data.request_query)) { %> <% if (!_.isEmpty(data.request_query)) { %>
<div class="panel__container"> <div class="panel__container">
<h3>GET parameters</h3>
<table class="table--duo"> <table class="table--duo">
<thead> <thead>
<th>{{ 'GET Parameters'|t }}</th> <th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th> <th>{{ 'Value'|t }}</th>
</thead> </thead>
<tbody> <tbody>
@@ -65,9 +66,10 @@
<% if (!_.isEmpty(data.request_request)) { %> <% if (!_.isEmpty(data.request_request)) { %>
<div class="panel__container"> <div class="panel__container">
<h3>POST parameters</h3>
<table class="table--duo"> <table class="table--duo">
<thead> <thead>
<th>{{ 'POST Parameters'|t }}</th> <th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th> <th>{{ 'Value'|t }}</th>
</thead> </thead>
<tbody> <tbody>
@@ -83,18 +85,20 @@
<% } %> <% } %>
<div class="panel__container"> <div class="panel__container">
<h3>Request attributes</h3>
<table class="table--duo"> <table class="table--duo">
<thead> <thead>
<th>{{ 'Attributes'|t }}</th> <th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th> <th>{{ 'Value'|t }}</th>
</thead> </thead>
<tbody> <tbody>
<% _.each( data.request_attributes, function( item, key ){ %> <% _.each( data.request_attributes, function( item, key ){ %>
<tr> <tr>
<td><%- key %></td> <td><%- key %></td>
<% if(key == '_controller') { %> <% if(key == '_controller') { %>
<td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td> <td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
<% } else if(key == '_form') { %>
<td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
<% } else { %> <% } else { %>
<td><%= Drupal.webprofiler.helpers.frm(item) %></td> <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
<% } %> <% } %>
@@ -106,9 +110,10 @@
<% if (!_.isEmpty(data.request_cookies)) { %> <% if (!_.isEmpty(data.request_cookies)) { %>
<div class="panel__container"> <div class="panel__container">
<h3>Cookies</h3>
<table class="table--duo"> <table class="table--duo">
<thead> <thead>
<th>{{ 'Cookies'|t }}</th> <th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th> <th>{{ 'Value'|t }}</th>
</thead> </thead>
<tbody> <tbody>
@@ -124,9 +129,10 @@
<% } %> <% } %>
<div class="panel__container"> <div class="panel__container">
<h3>Request headers</h3>
<table class="table--duo"> <table class="table--duo">
<thead> <thead>
<th>{{ 'Request headers'|t }}</th> <th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th> <th>{{ 'Value'|t }}</th>
</thead> </thead>
<tbody> <tbody>
@@ -142,16 +148,18 @@
<% if (!_.isEmpty(data.content)) { %> <% if (!_.isEmpty(data.content)) { %>
<div class="panel__container"> <div class="panel__container">
<h3>Raw content</h3>
<div class="h--word-broken"><%- data.content %></div> <div class="h--word-broken"><%- data.content %></div>
</div> </div>
<% } %> <% } %>
<% if (!_.isEmpty(data.access_check)) { %> <% if (!_.isEmpty(data.access_check)) { %>
<div class="panel__container"> <div class="panel__container">
<h3>Access check</h3>
<table class="table--duo"> <table class="table--duo">
<thead> <thead>
<th>{{ 'Path'|t }}</th> <th>{{ 'Path'|t }}</th>
<th>{{ 'Access check'|t }}</th> <th>{{ 'Service'|t }}</th>
</thead> </thead>
<tbody> <tbody>
<% _.each(data.access_check, function(items, key){ %> <% _.each(data.access_check, function(items, key){ %>
@@ -170,9 +178,10 @@
<% } %> <% } %>
<div class="panel__container"> <div class="panel__container">
<h3>Server Parameters</h3>
<table class="table--duo"> <table class="table--duo">
<thead> <thead>
<th>{{ 'Server Parameters'|t }}</th> <th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th> <th>{{ 'Value'|t }}</th>
</thead> </thead>
<tbody> <tbody>
@@ -187,9 +196,10 @@
</div> </div>
<div class="panel__container"> <div class="panel__container">
<h3>Response headers</h3>
<table class="table--duo"> <table class="table--duo">
<thead> <thead>
<th>{{ 'Response headers'|t }}</th> <th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th> <th>{{ 'Value'|t }}</th>
</thead> </thead>
<tbody> <tbody>
@@ -41,9 +41,9 @@
<tr> <tr>
<td><%- item.id %></td> <td><%- item.id %></td>
<td><%- item.current_display %></td> <td><%- item.current_display %></td>
<td><%- Drupal.webprofiler.helpers.printTime(item.build_time) %></td> <td><%- Drupal.webprofiler.helpers.printTime(item.build_time, 's') %></td>
<td><%- Drupal.webprofiler.helpers.printTime(item.execute_time) %></td> <td><%- Drupal.webprofiler.helpers.printTime(item.execute_time, 's') %></td>
<td><%- Drupal.webprofiler.helpers.printTime(item.render_time) %></td> <td><%- Drupal.webprofiler.helpers.printTime(item.render_time, 's') %></td>
<td><a href="<%- item.route %>">{{ 'Edit'|t }}</a></td> <td><a href="<%- item.route %>">{{ 'Edit'|t }}</a></td>
</tr> </tr>
<% }); %> <% }); %>
@@ -7,10 +7,10 @@ configure: webprofiler.settings
tags: tags:
- developer - developer
dependencies: dependencies:
- devel - devel:devel
# Information added by Drupal.org packaging script on 2017-10-05 # Information added by Drupal.org packaging script on 2019-01-29
version: '8.x-1.2' version: '8.x-2.0'
core: '8.x' core: '8.x'
project: 'devel' project: 'devel'
datestamp: 1507197848 datestamp: 1548799386
@@ -46,7 +46,7 @@ services:
# event subscribers # event subscribers
webprofiler.profiler_listener: webprofiler.profiler_listener:
class: Symfony\Component\HttpKernel\EventListener\ProfilerListener class: Drupal\webprofiler\EventSubscriber\ProfilerSubscriber
arguments: ['@profiler', '@request_stack', '@?webprofiler.matcher', '%webprofiler.only_exceptions%', '%webprofiler.only_master_requests%'] arguments: ['@profiler', '@request_stack', '@?webprofiler.matcher', '%webprofiler.only_exceptions%', '%webprofiler.only_master_requests%']
tags: tags:
- { name: event_subscriber } - { name: event_subscriber }