# HG changeset patch # User Chris Cannam # Date 1557412388 -3600 # Node ID af1871eacc833086bc81c87288770547d1d9c39b # Parent 129ea1e6d78336d2fdbbdf5ec4ca4d117ac3ac9a Update to Drupal core 8.7.1 diff -r 129ea1e6d783 -r af1871eacc83 composer.json --- a/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/composer.json Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,7 @@ "composer/installers": "^1.0.24", "wikimedia/composer-merge-plugin": "^1.4", "drush/drush": "^8.1", - "drupal/core": "^8.4" + "drupal/core": "^8.7.1" }, "minimum-stability": "dev", "prefer-stable": true, diff -r 129ea1e6d783 -r af1871eacc83 composer.lock --- a/composer.lock Thu Feb 28 13:21:36 2019 +0000 +++ b/composer.lock Thu May 09 15:33:08 2019 +0100 @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "673d6450e7592482b377d82d279d6f25", + "content-hash": "af87129dd8cd6e9d21edbfdc973e7c89", "packages": [ { "name": "asm89/stack-cors", @@ -59,6 +59,42 @@ "time": "2017-12-20T14:37:45+00:00" }, { + "name": "brumann/polyfill-unserialize", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/dbrumann/polyfill-unserialize.git", + "reference": "844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dbrumann/polyfill-unserialize/zipball/844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b", + "reference": "844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brumann\\Polyfill\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Denis Brumann", + "email": "denis.brumann@sensiolabs.de" + } + ], + "description": "Backports unserialize options introduced in PHP 7.0 to older PHP versions.", + "time": "2017-02-03T09:55:47+00:00" + }, + { "name": "composer/installers", "version": "v1.6.0", "source": { @@ -180,16 +216,16 @@ }, { "name": "composer/semver", - "version": "1.4.2", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", "shasum": "" }, "require": { @@ -238,20 +274,20 @@ "validation", "versioning" ], - "time": "2016-08-30T16:08:34+00:00" + "time": "2019-03-19T17:25:45+00:00" }, { "name": "consolidation/annotated-command", - "version": "2.11.2", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "004af26391cd7d1cd04b0ac736dc1324d1b4f572" + "reference": "512a2e54c98f3af377589de76c43b24652bcb789" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/004af26391cd7d1cd04b0ac736dc1324d1b4f572", - "reference": "004af26391cd7d1cd04b0ac736dc1324d1b4f572", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/512a2e54c98f3af377589de76c43b24652bcb789", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789", "shasum": "" }, "require": { @@ -334,20 +370,20 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2019-02-02T02:29:53+00:00" + "time": "2019-03-08T16:55:03+00:00" }, { "name": "consolidation/output-formatters", - "version": "3.4.0", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + "reference": "0881112642ad9059071f13f397f571035b527cb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", - "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/0881112642ad9059071f13f397f571035b527cb9", + "reference": "0881112642ad9059071f13f397f571035b527cb9", "shasum": "" }, "require": { @@ -357,11 +393,10 @@ "symfony/finder": "^2.5|^3|^4" }, "require-dev": { - "g1a/composer-test-scenarios": "^2", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", "phpunit/phpunit": "^5.7.27", - "satooshi/php-coveralls": "^2", "squizlabs/php_codesniffer": "^2.7", - "symfony/console": "3.2.3", "symfony/var-dumper": "^2.8|^3|^4", "victorjonsson/markdowndocs": "^1.3" }, @@ -370,6 +405,52 @@ }, "type": "library", "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony3": { + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "config": { + "platform": { + "php": "5.6.32" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, "branch-alias": { "dev-master": "3.x-dev" } @@ -390,7 +471,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2018-10-19T22:35:38+00:00" + "time": "2019-03-14T03:45:44+00:00" }, { "name": "dflydev/dot-access-data", @@ -885,16 +966,16 @@ }, { "name": "drupal/core", - "version": "8.6.10", + "version": "8.7.1", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "59568ac02948cf075ee8543e6c6d4386ad8daec1" + "reference": "969f24810fb31eac71dd624de593f551bd6dc2a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/59568ac02948cf075ee8543e6c6d4386ad8daec1", - "reference": "59568ac02948cf075ee8543e6c6d4386ad8daec1", + "url": "https://api.github.com/repos/drupal/core/zipball/969f24810fb31eac71dd624de593f551bd6dc2a3", + "reference": "969f24810fb31eac71dd624de593f551bd6dc2a3", "shasum": "" }, "require": { @@ -903,7 +984,7 @@ "doctrine/annotations": "^1.2", "doctrine/common": "^2.5", "easyrdf/easyrdf": "^0.9", - "egulias/email-validator": "^1.2", + "egulias/email-validator": "^2.0", "ext-date": "*", "ext-dom": "*", "ext-filter": "*", @@ -920,14 +1001,15 @@ "guzzlehttp/guzzle": "^6.2.1", "masterminds/html5": "^2.1", "paragonie/random_compat": "^1.0|^2.0", + "pear/archive_tar": "^1.4", "php": "^5.5.9|>=7.0.8", "stack/builder": "^1.0", "symfony-cmf/routing": "^1.4", "symfony/class-loader": "~3.4.0", "symfony/console": "~3.4.0", - "symfony/dependency-injection": "~3.4.0", + "symfony/dependency-injection": "~3.4.26", "symfony/event-dispatcher": "~3.4.0", - "symfony/http-foundation": "~3.4.14", + "symfony/http-foundation": "~3.4.27", "symfony/http-kernel": "~3.4.14", "symfony/polyfill-iconv": "^1.0", "symfony/process": "~3.4.0", @@ -937,8 +1019,8 @@ "symfony/translation": "~3.4.0", "symfony/validator": "~3.4.0", "symfony/yaml": "~3.4.5", - "twig/twig": "^1.35.0", - "typo3/phar-stream-wrapper": "^2.0.1", + "twig/twig": "^1.38.2", + "typo3/phar-stream-wrapper": "^2.1.1", "zendframework/zend-diactoros": "^1.1", "zendframework/zend-feed": "^2.4" }, @@ -990,6 +1072,7 @@ "drupal/core-transliteration": "self.version", "drupal/core-utility": "self.version", "drupal/core-uuid": "self.version", + "drupal/core-version": "self.version", "drupal/datetime": "self.version", "drupal/datetime_range": "self.version", "drupal/dblog": "self.version", @@ -1007,6 +1090,7 @@ "drupal/history": "self.version", "drupal/image": "self.version", "drupal/inline_form_errors": "self.version", + "drupal/jsonapi": "self.version", "drupal/language": "self.version", "drupal/layout_builder": "self.version", "drupal/layout_discovery": "self.version", @@ -1057,9 +1141,10 @@ "behat/mink": "1.7.x-dev", "behat/mink-goutte-driver": "^1.2", "behat/mink-selenium2-driver": "1.3.x-dev", - "drupal/coder": "^8.2.12", + "drupal/coder": "^8.3.1", "jcalderonzumba/gastonjs": "^1.0.2", "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "justinrainbow/json-schema": "^5.2", "mikey179/vfsstream": "^1.2", "phpspec/prophecy": "^1.7", "phpunit/phpunit": "^4.8.35 || ^6.5", @@ -1092,7 +1177,8 @@ "core/lib/Drupal/Component/Serialization/composer.json", "core/lib/Drupal/Component/Transliteration/composer.json", "core/lib/Drupal/Component/Utility/composer.json", - "core/lib/Drupal/Component/Uuid/composer.json" + "core/lib/Drupal/Component/Uuid/composer.json", + "core/lib/Drupal/Component/Version/composer.json" ], "recurse": false, "replace": false, @@ -1120,24 +1206,24 @@ "GPL-2.0-or-later" ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", - "time": "2019-02-20T18:35:01+00:00" + "time": "2019-05-08T16:00:55+00:00" }, { "name": "drush/drush", - "version": "8.1.18", + "version": "8.2.3", "source": { "type": "git", "url": "https://github.com/drush-ops/drush.git", - "reference": "799e4135ad7161f1a4668164ff8a6e5bcd779fc7" + "reference": "bf2b2471b9410e0ff4adc23aee020ee1aff28610" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drush-ops/drush/zipball/799e4135ad7161f1a4668164ff8a6e5bcd779fc7", - "reference": "799e4135ad7161f1a4668164ff8a6e5bcd779fc7", + "url": "https://api.github.com/repos/drush-ops/drush/zipball/bf2b2471b9410e0ff4adc23aee020ee1aff28610", + "reference": "bf2b2471b9410e0ff4adc23aee020ee1aff28610", "shasum": "" }, "require": { - "consolidation/annotated-command": "^2.9.1", + "consolidation/annotated-command": "^2.12.0", "consolidation/output-formatters": "~3", "pear/console_table": "~1.3.1", "php": ">=5.4.5", @@ -1148,6 +1234,7 @@ "symfony/finder": "~2.7|^3", "symfony/var-dumper": "~2.7|^3", "symfony/yaml": "~2.3|^3", + "webflo/drupal-finder": "^1.1.0", "webmozart/path-util": "~2" }, "require-dev": { @@ -1179,6 +1266,9 @@ "psr-0": { "Drush": "lib/", "Consolidation": "lib/" + }, + "psr-4": { + "Drush\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1229,7 +1319,7 @@ ], "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", "homepage": "http://www.drush.org", - "time": "2018-11-21T22:57:06+00:00" + "time": "2019-04-03T04:20:26+00:00" }, { "name": "easyrdf/easyrdf", @@ -1295,24 +1385,29 @@ }, { "name": "egulias/email-validator", - "version": "1.2.15", + "version": "2.1.7", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "758a77525bdaabd6c0f5669176bd4361cb2dda9e" + "reference": "709f21f92707308cdf8f9bcfa1af4cb26586521e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/758a77525bdaabd6c0f5669176bd4361cb2dda9e", - "reference": "758a77525bdaabd6c0f5669176bd4361cb2dda9e", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/709f21f92707308cdf8f9bcfa1af4cb26586521e", + "reference": "709f21f92707308cdf8f9bcfa1af4cb26586521e", "shasum": "" }, "require": { "doctrine/lexer": "^1.0.1", - "php": ">= 5.3.3" + "php": ">= 5.5" }, "require-dev": { - "phpunit/phpunit": "^4.8.24" + "dominicsayers/isemail": "dev-master", + "phpunit/phpunit": "^4.8.35||^5.7||^6.0", + "satooshi/php-coveralls": "^1.0.1" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" }, "type": "library", "extra": { @@ -1321,8 +1416,8 @@ } }, "autoload": { - "psr-0": { - "Egulias\\": "src/" + "psr-4": { + "Egulias\\EmailValidator\\": "EmailValidator" } }, "notification-url": "https://packagist.org/downloads/", @@ -1334,7 +1429,7 @@ "name": "Eduardo Gulias Davis" } ], - "description": "A library for validating emails", + "description": "A library for validating emails against several RFCs", "homepage": "https://github.com/egulias/EmailValidator", "keywords": [ "email", @@ -1343,7 +1438,7 @@ "validation", "validator" ], - "time": "2018-09-25T20:59:41+00:00" + "time": "2018-12-04T22:38:24+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1618,16 +1713,16 @@ }, { "name": "masterminds/html5", - "version": "2.5.0", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/Masterminds/html5-php.git", - "reference": "b5d892a4bd058d61f736935d32a9c248f11ccc93" + "reference": "c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/b5d892a4bd058d61f736935d32a9c248f11ccc93", - "reference": "b5d892a4bd058d61f736935d32a9c248f11ccc93", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad", + "reference": "c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad", "shasum": "" }, "require": { @@ -1644,7 +1739,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -1681,7 +1776,7 @@ "serializer", "xml" ], - "time": "2018-12-27T22:03:43+00:00" + "time": "2019-03-10T11:41:28+00:00" }, { "name": "nikic/php-parser", @@ -1784,6 +1879,119 @@ "time": "2019-01-03T20:59:08+00:00" }, { + "name": "pear/archive_tar", + "version": "1.4.7", + "source": { + "type": "git", + "url": "https://github.com/pear/Archive_Tar.git", + "reference": "7e48add6f8edc3027dd98ad15964b1a28fd0c845" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/7e48add6f8edc3027dd98ad15964b1a28fd0c845", + "reference": "7e48add6f8edc3027dd98ad15964b1a28fd0c845", + "shasum": "" + }, + "require": { + "pear/pear-core-minimal": "^1.10.0alpha2", + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-bz2": "Bz2 compression support.", + "ext-xz": "Lzma2 compression support.", + "ext-zlib": "Gzip compression support." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Archive_Tar": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Vincent Blavet", + "email": "vincent@phpconcept.net" + }, + { + "name": "Greg Beaver", + "email": "greg@chiaraquartet.net" + }, + { + "name": "Michiel Rook", + "email": "mrook@php.net" + } + ], + "description": "Tar file management class with compression support (gzip, bzip2, lzma2)", + "homepage": "https://github.com/pear/Archive_Tar", + "keywords": [ + "archive", + "tar" + ], + "time": "2019-04-08T13:15:55+00:00" + }, + { + "name": "pear/console_getopt", + "version": "v1.4.2", + "source": { + "type": "git", + "url": "https://github.com/pear/Console_Getopt.git", + "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/6c77aeb625b32bd752e89ee17972d103588b90c0", + "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Console": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Greg Beaver", + "email": "cellog@php.net", + "role": "Helper" + }, + { + "name": "Andrei Zmievski", + "email": "andrei@php.net", + "role": "Lead" + }, + { + "name": "Stig Bakken", + "email": "stig@php.net", + "role": "Developer" + } + ], + "description": "More info available on: http://pear.php.net/package/Console_Getopt", + "time": "2019-02-06T16:52:33+00:00" + }, + { "name": "pear/console_table", "version": "v1.3.1", "source": { @@ -1839,6 +2047,105 @@ "time": "2018-01-25T20:47:17+00:00" }, { + "name": "pear/pear-core-minimal", + "version": "v1.10.9", + "source": { + "type": "git", + "url": "https://github.com/pear/pear-core-minimal.git", + "reference": "742be8dd68c746a01e4b0a422258e9c9cae1c37f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/742be8dd68c746a01e4b0a422258e9c9cae1c37f", + "reference": "742be8dd68c746a01e4b0a422258e9c9cae1c37f", + "shasum": "" + }, + "require": { + "pear/console_getopt": "~1.4", + "pear/pear_exception": "~1.0" + }, + "replace": { + "rsky/pear-core-min": "self.version" + }, + "type": "library", + "autoload": { + "psr-0": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "src/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@php.net", + "role": "Lead" + } + ], + "description": "Minimal set of PEAR core files to be used as composer dependency", + "time": "2019-03-13T18:15:44+00:00" + }, + { + "name": "pear/pear_exception", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/pear/PEAR_Exception.git", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b", + "shasum": "" + }, + "require": { + "php": ">=4.4.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "class", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "PEAR": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "." + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Helgi Thormar", + "email": "dufuz@php.net" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net" + } + ], + "description": "The PEAR Exception base class.", + "homepage": "https://github.com/pear/PEAR_Exception", + "keywords": [ + "exception" + ], + "time": "2015-02-10T20:07:52+00:00" + }, + { "name": "psr/container", "version": "1.0.0", "source": { @@ -2208,7 +2515,7 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", @@ -2264,16 +2571,16 @@ }, { "name": "symfony/console", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be" + "reference": "15a9104356436cb26e08adab97706654799d31d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/069bf3f0e8f871a2169a06e43d9f3f03f355e9be", - "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be", + "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8", + "reference": "15a9104356436cb26e08adab97706654799d31d8", "shasum": "" }, "require": { @@ -2332,20 +2639,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-01-25T10:42:12+00:00" + "time": "2019-04-08T09:29:13+00:00" }, { "name": "symfony/debug", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8" + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", - "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", + "url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9", + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9", "shasum": "" }, "require": { @@ -2388,20 +2695,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-01-25T10:19:25+00:00" + "time": "2019-04-11T09:48:14+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1" + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1", - "reference": "b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0feb3fa202aedfd8d1956f2dafd563fb13acbf", + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf", "shasum": "" }, "require": { @@ -2459,20 +2766,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-01-30T17:48:51+00:00" + "time": "2019-04-20T15:32:49+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b" + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ed5be1663fa66623b3a7004d5d51a14c4045399b", - "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a088aafcefb4eef2520a290ed82e4374092a6dff", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff", "shasum": "" }, "require": { @@ -2522,20 +2829,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-04-02T08:51:52+00:00" }, { "name": "symfony/finder", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7c0c627220308928e958a87c293108e5891cde1d" + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7c0c627220308928e958a87c293108e5891cde1d", - "reference": "7c0c627220308928e958a87c293108e5891cde1d", + "url": "https://api.github.com/repos/symfony/finder/zipball/61af5ce0b34b942d414fe8f1b11950d0e9a90e98", + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98", "shasum": "" }, "require": { @@ -2571,20 +2878,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:43:35+00:00" + "time": "2019-04-02T19:54:57+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "9a81d2330ea255ded06a69b4f7fb7804836e7a05" + "reference": "fa02215233be8de1c2b44617088192f9e8db3512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9a81d2330ea255ded06a69b4f7fb7804836e7a05", - "reference": "9a81d2330ea255ded06a69b4f7fb7804836e7a05", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/fa02215233be8de1c2b44617088192f9e8db3512", + "reference": "fa02215233be8de1c2b44617088192f9e8db3512", "shasum": "" }, "require": { @@ -2625,20 +2932,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-01-27T09:04:14+00:00" + "time": "2019-05-01T08:04:33+00:00" }, { "name": "symfony/http-kernel", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "dc6bf17684b7120f7bf74fae85c9155506041002" + "reference": "586046f5adc6a08eaebbe4519ef18ad52f54e453" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/dc6bf17684b7120f7bf74fae85c9155506041002", - "reference": "dc6bf17684b7120f7bf74fae85c9155506041002", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/586046f5adc6a08eaebbe4519ef18ad52f54e453", + "reference": "586046f5adc6a08eaebbe4519ef18ad52f54e453", "shasum": "" }, "require": { @@ -2714,20 +3021,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-02-03T12:22:50+00:00" + "time": "2019-05-01T13:03:24+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "82ebae02209c21113908c229e9883c419720738a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", "shasum": "" }, "require": { @@ -2739,7 +3046,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -2772,20 +3079,20 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "97001cfc283484c9691769f51cdf25259037eba2" + "reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/97001cfc283484c9691769f51cdf25259037eba2", - "reference": "97001cfc283484c9691769f51cdf25259037eba2", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/f037ea22acfaee983e271dd9c3b8bb4150bd8ad7", + "reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7", "shasum": "" }, "require": { @@ -2797,7 +3104,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -2831,20 +3138,20 @@ "portable", "shim" ], - "time": "2018-09-21T06:26:08+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", "shasum": "" }, "require": { @@ -2856,7 +3163,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -2890,20 +3197,20 @@ "portable", "shim" ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" + "reference": "bc4858fb611bda58719124ca079baff854149c89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", - "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89", + "reference": "bc4858fb611bda58719124ca079baff854149c89", "shasum": "" }, "require": { @@ -2913,7 +3220,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -2949,20 +3256,20 @@ "portable", "shim" ], - "time": "2018-09-21T06:26:08+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/process", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "url": "https://api.github.com/repos/symfony/process/zipball/a9c4dfbf653023b668c282e4e02609d131f4057a", + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a", "shasum": "" }, "require": { @@ -2998,20 +3305,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-04-08T16:15:54+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v1.1.0", + "version": "v1.1.2", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "53c15a6a7918e6c2ab16ae370ea607fb40cab196" + "reference": "a33352af16f78a5ff4f9d90811536abf210df12b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/53c15a6a7918e6c2ab16ae370ea607fb40cab196", - "reference": "53c15a6a7918e6c2ab16ae370ea607fb40cab196", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/a33352af16f78a5ff4f9d90811536abf210df12b", + "reference": "a33352af16f78a5ff4f9d90811536abf210df12b", "shasum": "" }, "require": { @@ -3020,12 +3327,10 @@ "symfony/http-foundation": "^2.3.42 || ^3.4 || ^4.0" }, "require-dev": { - "symfony/phpunit-bridge": "^3.4 || 4.0" + "symfony/phpunit-bridge": "^3.4 || ^4.0" }, "suggest": { - "psr/http-factory-implementation": "To use the PSR-17 factory", - "psr/http-message-implementation": "To use the HttpFoundation factory", - "zendframework/zend-diactoros": "To use the Zend Diactoros factory" + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" }, "type": "symfony-bridge", "extra": { @@ -3036,7 +3341,10 @@ "autoload": { "psr-4": { "Symfony\\Bridge\\PsrHttpMessage\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3057,22 +3365,23 @@ "keywords": [ "http", "http-message", + "psr-17", "psr-7" ], - "time": "2018-08-30T16:28:28+00:00" + "time": "2019-04-03T17:09:40+00:00" }, { "name": "symfony/routing", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646" + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646", - "reference": "62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646", + "url": "https://api.github.com/repos/symfony/routing/zipball/ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", "shasum": "" }, "require": { @@ -3095,7 +3404,6 @@ "suggest": { "doctrine/annotations": "For using the annotation loader", "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", "symfony/expression-language": "For using expression matching", "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" @@ -3136,20 +3444,20 @@ "uri", "url" ], - "time": "2019-01-29T08:47:12+00:00" + "time": "2019-03-29T21:58:42+00:00" }, { "name": "symfony/serializer", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "a897373b86489ddecacc665d15ab32983a519907" + "reference": "99aceeb3e10852b951b9cab57a2b83062db09efb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/a897373b86489ddecacc665d15ab32983a519907", - "reference": "a897373b86489ddecacc665d15ab32983a519907", + "url": "https://api.github.com/repos/symfony/serializer/zipball/99aceeb3e10852b951b9cab57a2b83062db09efb", + "reference": "99aceeb3e10852b951b9cab57a2b83062db09efb", "shasum": "" }, "require": { @@ -3172,7 +3480,7 @@ "symfony/dependency-injection": "~3.2|~4.0", "symfony/http-foundation": "~2.8|~3.0|~4.0", "symfony/property-access": "~2.8|~3.0|~4.0", - "symfony/property-info": "~3.1|~4.0", + "symfony/property-info": "^3.4.13|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -3215,20 +3523,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2019-01-26T19:55:54+00:00" + "time": "2019-04-27T21:20:35+00:00" }, { "name": "symfony/translation", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "81cfcd6935cb7505640153576c1f9155b2a179c1" + "reference": "301a5d627220a1c4ee522813b0028653af6c4f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/81cfcd6935cb7505640153576c1f9155b2a179c1", - "reference": "81cfcd6935cb7505640153576c1f9155b2a179c1", + "url": "https://api.github.com/repos/symfony/translation/zipball/301a5d627220a1c4ee522813b0028653af6c4f54", + "reference": "301a5d627220a1c4ee522813b0028653af6c4f54", "shasum": "" }, "require": { @@ -3245,7 +3553,9 @@ "symfony/config": "~2.8|~3.0|~4.0", "symfony/dependency-injection": "~3.4|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/http-kernel": "~3.4|~4.0", "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/var-dumper": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -3283,20 +3593,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-01-25T10:00:44+00:00" + "time": "2019-05-01T11:10:09+00:00" }, { "name": "symfony/validator", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "06af494d8634df6ad9655ec7d80cb61983253912" + "reference": "cc3f577d8887737df4d77a4c0cc6e3c22164cea4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/06af494d8634df6ad9655ec7d80cb61983253912", - "reference": "06af494d8634df6ad9655ec7d80cb61983253912", + "url": "https://api.github.com/repos/symfony/validator/zipball/cc3f577d8887737df4d77a4c0cc6e3c22164cea4", + "reference": "cc3f577d8887737df4d77a4c0cc6e3c22164cea4", "shasum": "" }, "require": { @@ -3368,20 +3678,20 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2019-01-30T09:03:33+00:00" + "time": "2019-04-29T08:34:27+00:00" }, { "name": "symfony/var-dumper", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2159335b452d929cbb9921fc4eb7d1bfed32d0be" + "reference": "ca5fef348a0440411bbca0f9ec14e9a11625bd6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2159335b452d929cbb9921fc4eb7d1bfed32d0be", - "reference": "2159335b452d929cbb9921fc4eb7d1bfed32d0be", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ca5fef348a0440411bbca0f9ec14e9a11625bd6a", + "reference": "ca5fef348a0440411bbca0f9ec14e9a11625bd6a", "shasum": "" }, "require": { @@ -3437,20 +3747,20 @@ "debug", "dump" ], - "time": "2019-01-29T16:19:17+00:00" + "time": "2019-05-01T09:52:10+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d" + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", "shasum": "" }, "require": { @@ -3496,20 +3806,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-01-16T10:59:17+00:00" + "time": "2019-03-25T07:48:46+00:00" }, { "name": "twig/twig", - "version": "v1.37.1", + "version": "v1.40.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62" + "reference": "35889516bbd6bbe46a600c2c33b03515df4a076e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/66be9366c76cbf23e82e7171d47cbfa54a057a62", - "reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/35889516bbd6bbe46a600c2c33b03515df4a076e", + "reference": "35889516bbd6bbe46a600c2c33b03515df4a076e", "shasum": "" }, "require": { @@ -3524,7 +3834,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.37-dev" + "dev-master": "1.40-dev" } }, "autoload": { @@ -3562,26 +3872,30 @@ "keywords": [ "templating" ], - "time": "2019-01-14T14:59:29+00:00" + "time": "2019-04-29T14:12:28+00:00" }, { "name": "typo3/phar-stream-wrapper", - "version": "v2.0.1", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/TYPO3/phar-stream-wrapper.git", - "reference": "0469d9fefa0146ea4299d3b11cfbb76faa7045bf" + "reference": "e438b0c78652b33407983eb29d215a1a3f68f6f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TYPO3/phar-stream-wrapper/zipball/0469d9fefa0146ea4299d3b11cfbb76faa7045bf", - "reference": "0469d9fefa0146ea4299d3b11cfbb76faa7045bf", + "url": "https://api.github.com/repos/TYPO3/phar-stream-wrapper/zipball/e438b0c78652b33407983eb29d215a1a3f68f6f3", + "reference": "e438b0c78652b33407983eb29d215a1a3f68f6f3", "shasum": "" }, "require": { + "brumann/polyfill-unserialize": "^1.0", + "ext-fileinfo": "*", + "ext-json": "*", "php": "^5.3.3|^7.0" }, "require-dev": { + "ext-xdebug": "*", "phpunit/phpunit": "^4.8.36" }, "type": "library", @@ -3602,7 +3916,44 @@ "security", "stream-wrapper" ], - "time": "2018-10-18T08:46:28+00:00" + "time": "2019-05-05T17:30:51+00:00" + }, + { + "name": "webflo/drupal-finder", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-finder.git", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/8a7886c575d6eaa67a425dceccc84e735c0b9637", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637", + "shasum": "" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/DrupalFinder.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Florian Weber", + "email": "florian@webflo.org" + } + ], + "description": "Helper class to locate a Drupal installation from a given path.", + "time": "2017-10-24T08:12:11+00:00" }, { "name": "webmozart/assert", @@ -3861,16 +4212,16 @@ }, { "name": "zendframework/zend-feed", - "version": "2.11.0", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-feed.git", - "reference": "5248e9fffa760e5c36092aeff02c3797e4a8a690" + "reference": "d926c5af34b93a0121d5e2641af34ddb1533d733" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/5248e9fffa760e5c36092aeff02c3797e4a8a690", - "reference": "5248e9fffa760e5c36092aeff02c3797e4a8a690", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/d926c5af34b93a0121d5e2641af34ddb1533d733", + "reference": "d926c5af34b93a0121d5e2641af34ddb1533d733", "shasum": "" }, "require": { @@ -3901,8 +4252,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" + "dev-master": "2.12.x-dev", + "dev-develop": "2.13.x-dev" } }, "autoload": { @@ -3920,7 +4271,7 @@ "feed", "zf" ], - "time": "2019-01-29T21:37:15+00:00" + "time": "2019-03-05T20:08:49+00:00" }, { "name": "zendframework/zend-stdlib", @@ -3976,12 +4327,12 @@ "source": { "type": "git", "url": "https://github.com/minkphp/Mink.git", - "reference": "d5ee350c40baff5f331a05ebdbe1927345c9ac8b" + "reference": "153e4bbee958fea4a6dc542105ff6013c06813e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/d5ee350c40baff5f331a05ebdbe1927345c9ac8b", - "reference": "d5ee350c40baff5f331a05ebdbe1927345c9ac8b", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/153e4bbee958fea4a6dc542105ff6013c06813e8", + "reference": "153e4bbee958fea4a6dc542105ff6013c06813e8", "shasum": "" }, "require": { @@ -4027,7 +4378,7 @@ "testing", "web" ], - "time": "2018-06-24T20:08:51+00:00" + "time": "2019-05-07T14:41:06+00:00" }, { "name": "behat/mink-browserkit-driver", @@ -4257,16 +4608,16 @@ }, { "name": "drupal/coder", - "version": "8.3.1", + "version": "8.3.3", "source": { "type": "git", "url": "https://git.drupal.org/project/coder.git", - "reference": "29a25627e7148b3119c84f18e087fc3b8c85b959" + "reference": "a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43" }, "require": { "ext-mbstring": "*", - "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.0.1", + "php": ">=5.5.9", + "squizlabs/php_codesniffer": "^3.4.1", "symfony/yaml": ">=2.0.0" }, "require-dev": { @@ -4276,7 +4627,7 @@ "autoload": { "psr-0": { "Drupal\\": "coder_sniffer/Drupal/", - "DrupalPractice\\": "coder_sniffer/Drupal/" + "DrupalPractice\\": "coder_sniffer/DrupalPractice/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4290,7 +4641,7 @@ "phpcs", "standards" ], - "time": "2018-09-21T14:22:49+00:00" + "time": "2019-04-16T18:56:06+00:00" }, { "name": "fabpot/goutte", @@ -4523,16 +4874,16 @@ }, { "name": "mikey179/vfsStream", - "version": "v1.6.5", + "version": "v1.6.6", "source": { "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d", "shasum": "" }, "require": { @@ -4565,7 +4916,7 @@ ], "description": "Virtual file system to mock the real file system in unit tests.", "homepage": "http://vfs.bovigo.org/", - "time": "2017-08-01T08:02:14+00:00" + "time": "2019-04-08T13:54:32+00:00" }, { "name": "myclabs/deep-copy", @@ -4770,16 +5121,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", "shasum": "" }, "require": { @@ -4817,7 +5168,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" + "time": "2019-04-30T17:48:53+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -5883,16 +6234,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.0", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48" + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", "shasum": "" }, "require": { @@ -5925,25 +6276,25 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-12-19T23:57:18+00:00" + "time": "2019-04-10T23:49:02+00:00" }, { "name": "symfony/browser-kit", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "884689e5d29fc3c48498a0038e96d60e4f91b471" + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/884689e5d29fc3c48498a0038e96d60e4f91b471", - "reference": "884689e5d29fc3c48498a0038e96d60e4f91b471", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/7f2b0843d5045468225f9a9b27a0cb171ae81828", + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828", "shasum": "" }, "require": { @@ -5987,11 +6338,11 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-01-16T09:39:14+00:00" + "time": "2019-04-06T19:33:58+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -6044,16 +6395,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "32cb577c07bd900ee883a9d4b55d4098aa02e422" + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/32cb577c07bd900ee883a9d4b55d4098aa02e422", - "reference": "32cb577c07bd900ee883a9d4b55d4098aa02e422", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d40023c057393fb25f7ca80af2a56ed948c45a09", + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09", "shasum": "" }, "require": { @@ -6097,20 +6448,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-02-23T15:06:07+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v3.4.22", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "6a2148bfc6ca0016846a32bdc55a317274283709" + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/6a2148bfc6ca0016846a32bdc55a317274283709", - "reference": "6a2148bfc6ca0016846a32bdc55a317274283709", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/a43a2f6c465a2d99635fea0addbebddc3864ad97", + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97", "shasum": "" }, "require": { @@ -6120,7 +6471,6 @@ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "suggest": { - "ext-zip": "Zip support is required when using bin/simple-phpunit", "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" }, "bin": [ @@ -6163,20 +6513,20 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2019-01-30T13:30:37+00:00" + "time": "2019-04-16T09:03:16+00:00" }, { "name": "theseer/tokenizer", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8", "shasum": "" }, "require": { @@ -6203,7 +6553,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2019-04-04T09:56:43+00:00" } ], "aliases": [], diff -r 129ea1e6d783 -r af1871eacc83 core/.stylelintrc.json --- a/core/.stylelintrc.json Thu Feb 28 13:21:36 2019 +0000 +++ b/core/.stylelintrc.json Thu May 09 15:33:08 2019 +0100 @@ -31,6 +31,7 @@ "rule-empty-line-before": null, "selector-pseudo-element-colon-notation": null, "shorthand-property-no-redundant-values": null, + "string-quotes": "double", "unit-whitelist": ["deg", "em", "ex", "ms", "rem", "%", "s", "px", "vw", "vh"] }, "ignoreFiles": [ diff -r 129ea1e6d783 -r af1871eacc83 core/INSTALL.txt --- a/core/INSTALL.txt Thu Feb 28 13:21:36 2019 +0000 +++ b/core/INSTALL.txt Thu May 09 15:33:08 2019 +0100 @@ -238,7 +238,7 @@ maintenance account on a "Welcome" page. If the default Drupal theme is not displaying properly and links on the page result in "Page Not Found" errors, you may be experiencing problems with clean URLs. Visit - https://www.drupal.org/getting-started/clean-urls to troubleshoot. + https://www.drupal.org/docs/8/clean-urls-in-drupal-8 to troubleshoot. 5. Change file system storage settings (optional). @@ -405,7 +405,7 @@ for www.example.com could be in 'sites/example.com/settings.php' (note that 'www.' should be omitted if users can access your site at http://example.com/). - $ cp sites/default/defaults.settings.php sites/example.com/settings.php + $ cp sites/default/default.settings.php sites/example.com/settings.php Sites do not have to have a different domain. You can also use subdomains and subdirectories for Drupal sites. For example, example.com, sub.example.com, and @@ -448,7 +448,7 @@ modules/custom_module For more information about multiple virtual hosts or the configuration -settings, consult https://www.drupal.org/documentation/install/multi-site +settings, consult https://www.drupal.org/docs/8/multisite For more information on configuring Drupal's file system path in a multisite configuration, see step 6 above. @@ -460,4 +460,4 @@ installed later. For detailed instructions, visit -https://www.drupal.org/documentation/multilingual +https://www.drupal.org/docs/8/multilingual diff -r 129ea1e6d783 -r af1871eacc83 core/MAINTAINERS.txt --- a/core/MAINTAINERS.txt Thu Feb 28 13:21:36 2019 +0000 +++ b/core/MAINTAINERS.txt Thu May 09 15:33:08 2019 +0100 @@ -248,10 +248,20 @@ - Matthew Grill 'alwaysworking' https://www.drupal.org/u/alwaysworking - Sally Young 'justafish' https://www.drupal.org/u/justafish +JSON:API +- Gabe Sullice 'gabesullice' https://www.drupal.org/u/gabesullice +- Mateu Aguiló Bosch 'e0ipso' https://www.drupal.org/u/e0ipso +- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers + Language - Francesco Placella 'plach' https://www.drupal.org/u/plach - Daniel F. Kudwien 'sun' https://www.drupal.org/u/sun +Layout Builder +- Ted Bowman 'tedbow' https://www.drupal.org/u/tedbow +- Emilie Nouveau 'DyanneNova' https://www.drupal.org/u/dyannenova +- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett + Link Field - Weber Macedo 'Mac_Weber' https://www.drupal.org/u/mac_weber @@ -285,7 +295,6 @@ - Adam Globus-Hoenich 'phenaproxima' https://www.drupal.org/u/phenaproxima - Lucas Hedding 'heddn' https://www.drupal.org/u/heddn - Michael Lutz 'mikelutz' https://www.drupal.org/u/mikelutz -- Markus Sipilä 'masipila' https://www.drupal.org/u/masipila - Vicki Spagnolo 'quietone' https://www.drupal.org/u/quietone Node @@ -319,7 +328,7 @@ - Théodore Biadala 'nod_' https://www.drupal.org/u/nod_ RDF -- Stéphane Corlosquet 'scor' https://www.drupal.org/u/scor +- ? Render API - Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia @@ -409,6 +418,12 @@ Typed Data - Wolfgang Ziegler 'fago' https://www.drupal.org/u/fago +Umami demo +- Mark Conroy 'markconroy' https://www.drupal.org/u/markconroy +- Gareth Goodwin 'smaz' https://www.drupal.org/u/smaz +- Keith Jay 'kjay' https://www.drupal.org/u/kjay +- Ofer Shaal 'shaal' https://www.drupal.org/u/shaal + Update UI - ? @@ -443,6 +458,7 @@ - ? Usability +- Cristina Chumillas 'ckrina' https://www.drupal.org/u/ckrina - Roy Scholten 'yoroy' https://www.drupal.org/u/yoroy - Bojhan Somers 'Bojhan' https://www.drupal.org/u/bojhan @@ -489,12 +505,6 @@ Media Initiative - Janez Urevc 'slashrsm' https://www.drupal.org/u/slashrsm -Out-of-the-Box Initiative -- Mark Conroy 'markconroy' https://www.drupal.org/u/markconroy -- Gareth Goodwin 'smaz' https://www.drupal.org/u/smaz -- Keith Jay 'kjay' https://www.drupal.org/u/kjay -- Elliot Ward 'eli-t' https://www.drupal.org/u/eli-t - PHPUnit Initiative - Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner - (provisional) Michiel Nugter 'michielnugter' https://www.drupal.org/u/michielnugter diff -r 129ea1e6d783 -r af1871eacc83 core/assets/vendor/ckeditor/CHANGES.md --- a/core/assets/vendor/ckeditor/CHANGES.md Thu Feb 28 13:21:36 2019 +0000 +++ b/core/assets/vendor/ckeditor/CHANGES.md Thu May 09 15:33:08 2019 +0100 @@ -1,6 +1,113 @@ CKEditor 4 Changelog ==================== +## CKEditor 4.11.3 + +Fixed Issues: + +* [#2721](https://github.com/ckeditor/ckeditor-dev/issues/2721), [#487](https://github.com/ckeditor/ckeditor-dev/issues/487): Fixed: The order of sublist items is reversed when a higher level list item is removed. +* [#2527](https://github.com/ckeditor/ckeditor-dev/issues/2527): Fixed: [Emoji](https://ckeditor.com/cke4/addon/emoji) autocomplete order does not prioritize emojis with the name starting from the used string. +* [#2572](https://github.com/ckeditor/ckeditor-dev/issues/2572): Fixed: Icons in the [Emoji](https://ckeditor.com/cke4/addon/emoji) dropdown navigation groups are not centered. +* [#1191](https://github.com/ckeditor/ckeditor-dev/issues/1191): Fixed: Items in the [elements path](https://ckeditor.com/cke4/addon/elementspath) are draggable. +* [#2292](https://github.com/ckeditor/ckeditor-dev/issues/2292): Fixed: Dropping a list with a link on the editor's margin causes a console error and removes the dragged text from editor. +* [#2756](https://github.com/ckeditor/ckeditor-dev/issues/2756): Fixed: The [Auto Link](https://ckeditor.com/cke4/addon/autolink) plugin causes an error when typing in the [source editing mode](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_sourcearea.html). +* [#1986](https://github.com/ckeditor/ckeditor-dev/issues/1986): Fixed: The Cell Properties dialog from the [Table Tools](https://ckeditor.com/cke4/addon/tabletools) plugin shows styles that are not allowed through [`config.allowedContent`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent). +* [#2565](https://github.com/ckeditor/ckeditor-dev/issues/2565): [IE, Edge] Fixed: Buttons in the [editor toolbar](https://ckeditor.com/cke4/addon/toolbar) are activated by clicking them with the right mouse button. +* [#2792](https://github.com/ckeditor/ckeditor-dev/pull/2792): Fixed: A bug in the [Copy Formatting](https://ckeditor.com/cke4/addon/copyformatting) plugin that caused the following issues: + * [#2780](https://github.com/ckeditor/ckeditor-dev/issues/2780): Fixed: Undo steps disappear after multiple changes of selection. + * [#2470](https://github.com/ckeditor/ckeditor-dev/issues/2470): [Firefox] Fixed: Widget's nested editable gets blurred upon focus. + * [#2655](https://github.com/ckeditor/ckeditor-dev/issues/2655): [Chrome, Safari] Fixed: Widget's nested editable cannot be focused under certain circumstances. + +## CKEditor 4.11.2 + +Fixed Issues: + +* [#2403](https://github.com/ckeditor/ckeditor-dev/issues/2403): Fixed: Styling inline editor initialized inside a table with the [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin is causing style leaks. +* [#2514](https://github.com/ckeditor/ckeditor-dev/issues/2403): Fixed: Pasting table data into inline editor initialized inside a table with the [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin inserts pasted content into the wrapping table. +* [#2451](https://github.com/ckeditor/ckeditor-dev/issues/2451): Fixed: The [Remove Format](https://ckeditor.com/cke4/addon/removeformat) plugin changes selection. +* [#2546](https://github.com/ckeditor/ckeditor-dev/issues/2546): Fixed: The separator in the toolbar moves when buttons are focused. +* [#2506](https://github.com/ckeditor/ckeditor-dev/issues/2506): Fixed: [Enhanced Image](https://ckeditor.com/cke4/addon/image2) throws a type error when an empty `
` tag with an `image` class is upcasted. +* [#2650](https://github.com/ckeditor/ckeditor-dev/issues/2650): Fixed: [Table](https://ckeditor.com/cke4/addon/table) dialog validator fails when the `getValue()` function is defined in the global scope. +* [#2690](https://github.com/ckeditor/ckeditor-dev/issues/2690): Fixed: Decimal characters are removed from the inside of numbered lists when pasting content using the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin. +* [#2205](https://github.com/ckeditor/ckeditor-dev/issues/2205): Fixed: It is not possible to add new list items under an item containing a block element. +* [#2411](https://github.com/ckeditor/ckeditor-dev/issues/2411), [#2438](https://github.com/ckeditor/ckeditor-dev/issues/2438) Fixed: Apply numbered list option throws a console error for a specific markup. +* [#2430](https://github.com/ckeditor/ckeditor-dev/issues/2430) Fixed: [Color Button](https://ckeditor.com/cke4/addon/colorbutton) and [List Block](https://ckeditor.com/cke4/addon/listblock) items are draggable. + +Other Changes: + +* Updated the [WebSpellChecker](https://ckeditor.com/cke4/addon/wsc) (WSC) plugin: + * [#52](https://github.com/WebSpellChecker/ckeditor-plugin-wsc/issues/52) Fixed: Clicking "Finish Checking" without a prior action would hang the Spell Checking dialog. +* [#2603](https://github.com/ckeditor/ckeditor-dev/issues/2603): Corrected the GPL license entry in the `package.json` file. + +## CKEditor 4.11.1 + +Fixed Issues: + +* [#2571](https://github.com/ckeditor/ckeditor-dev/issues/2571): Fixed: Clicking the categories in the [Emoji](https://ckeditor.com/cke4/addon/emoji) dropdown panel scrolls the entire page. + +## CKEditor 4.11 + +**Security Updates:** + +* Fixed XSS vulnerability in the HTML parser reported by [maxarr](https://hackerone.com/maxarr). + + Issue summary: It was possible to execute XSS inside CKEditor after persuading the victim to: (i) switch CKEditor to source mode, then (ii) paste a specially crafted HTML code, prepared by the attacker, into the opened CKEditor source area, and (iii) switch back to WYSIWYG mode. + +**An upgrade is highly recommended!** + +New Features: + +* [#2062](https://github.com/ckeditor/ckeditor-dev/pull/2062): Added the emoji dropdown that allows the user to choose the emoji from the toolbar and search for them using keywords. +* [#2154](https://github.com/ckeditor/ckeditor-dev/issues/2154): The [Link](https://ckeditor.com/cke4/addon/link) plugin now supports phone number links. +* [#1815](https://github.com/ckeditor/ckeditor-dev/issues/1815): The [Auto Link](https://ckeditor.com/cke4/addon/autolink) plugin supports typing link completion. +* [#2478](https://github.com/ckeditor/ckeditor-dev/issues/2478): [Link](https://ckeditor.com/cke4/addon/link) can be inserted using the Ctrl/Cmd + K keystroke. +* [#651](https://github.com/ckeditor/ckeditor-dev/issues/651): Text pasted using the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin preserves indentation in paragraphs. +* [#2248](https://github.com/ckeditor/ckeditor-dev/issues/2248): Added support for justification in the [BBCode](https://ckeditor.com/cke4/addon/bbcode) plugin. Thanks to [Matěj Kmínek](https://github.com/KminekMatej)! +* [#706](https://github.com/ckeditor/ckeditor-dev/issues/706): Added a different cursor style when selecting cells for the [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin. +* [#2072](https://github.com/ckeditor/ckeditor-dev/issues/2072): The [UI Button](https://ckeditor.com/cke4/addon/button) plugin supports custom `aria-haspopup` property values. The [Menu Button](https://ckeditor.com/cke4/addon/menubutton) `aria-haspopup` value is now `menu`, the [Panel Button](https://ckeditor.com/cke4/addon/panelbutton) and [Rich Combo](https://ckeditor.com/cke4/addon/richcombo) `aria-haspopup` value is now `listbox`. +* [#1176](https://github.com/ckeditor/ckeditor-dev/pull/1176): The [Balloon Panel](https://ckeditor.com/cke4/addon/balloonpanel) can now be attached to a selection instead of an element. +* [#2202](https://github.com/ckeditor/ckeditor-dev/issues/2202): Added the `contextmenu_contentsCss` configuration option to allow adding custom CSS to the [Context Menu](https://ckeditor.com/cke4/addon/contextmenu). + +Fixed Issues: + +* [#1477](https://github.com/ckeditor/ckeditor-dev/issues/1477): Fixed: On destroy, [Balloon Toolbar](https://ckeditor.com/cke4/addon/balloontoolbar) does not destroy its content. +* [#2394](https://github.com/ckeditor/ckeditor-dev/issues/2394): Fixed: [Emoji](https://ckeditor.com/cke4/addon/emoji) dropdown does not show up with repeated symbols in a single line. +* [#1181](https://github.com/ckeditor/ckeditor-dev/issues/1181): [Chrome] Fixed: Opening the context menu in a read-only editor results in an error. +* [#2276](https://github.com/ckeditor/ckeditor-dev/issues/2276): [iOS] Fixed: [Button](https://ckeditor.com/cke4/addon/button) state does not refresh properly. +* [#1489](https://github.com/ckeditor/ckeditor-dev/issues/1489): Fixed: Table contents can be removed in read-only mode when the [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin is used. +* [#1264](https://github.com/ckeditor/ckeditor-dev/issues/1264) Fixed: Right-click does not clear the selection created with the [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin. +* [#586](https://github.com/ckeditor/ckeditor-dev/issues/586) Fixed: The `required` attribute is not correctly recognized by the [Form Elements](https://ckeditor.com/cke4/addon/forms) plugin dialog. Thanks to [Roli Züger](https://github.com/rzueger)! +* [#2380](https://github.com/ckeditor/ckeditor-dev/issues/2380) Fixed: Styling HTML comments in a top-level element results in extra paragraphs. +* [#2294](https://github.com/ckeditor/ckeditor-dev/issues/2294) Fixed: Pasting content from Microsoft Outlook and then bolding it results in an error. +* [#2035](https://github.com/ckeditor/ckeditor-dev/issues/2035) [Edge] Fixed: `Permission denied` is thrown when opening a [Panel](https://ckeditor.com/cke4/addon/panel) instance. +* [#965](https://github.com/ckeditor/ckeditor-dev/issues/965) Fixed: The [`config.forceSimpleAmpersand`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-forceSimpleAmpersand) option does not work. Thanks to [Alex Maris](https://github.com/alexmaris)! +* [#2448](https://github.com/ckeditor/ckeditor-dev/issues/2448): Fixed: The [`Escape HTML Entities`] plugin with custom [additional entities](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-entities_additional) configuration breaks HTML escaping. +* [#898](https://github.com/ckeditor/ckeditor-dev/issues/898): Fixed: [Enhanced Image](https://ckeditor.com/cke4/addon/image2) long alternative text protrudes into the editor when the image is selected. +* [#1113](https://github.com/ckeditor/ckeditor-dev/issues/1113): [Firefox] Fixed: Nested contenteditable elements path is not updated on focus with the [Div Editing Area](https://ckeditor.com/cke4/addon/divarea) plugin. +* [#1682](https://github.com/ckeditor/ckeditor-dev/issues/1682) Fixed: Hovering the [Balloon Toolbar](https://ckeditor.com/cke4/addon/balloontoolbar) panel changes its size, causing flickering. +* [#421](https://github.com/ckeditor/ckeditor-dev/issues/421) Fixed: Expandable [Button](https://ckeditor.com/cke4/addon/button) puts the `(Selected)` text at the end of the label when clicked. +* [#1454](https://github.com/ckeditor/ckeditor-dev/issues/1454): Fixed: The [`onAbort`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_fileTools_uploadWidgetDefinition.html#property-onAbort) method of the [Upload Widget](https://ckeditor.com/cke4/addon/uploadwidget) is not called when the loader is aborted. +* [#1451](https://github.com/ckeditor/ckeditor-dev/issues/1451): Fixed: The context menu is incorrectly positioned when opened with Shift+F10. +* [#1722](https://github.com/ckeditor/ckeditor-dev/issues/1722): [`CKEDITOR.filter.instances`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_filter.html#static-property-instances) is causing memory leaks. +* [#2491](https://github.com/ckeditor/ckeditor-dev/issues/2491): Fixed: The [Mentions](https://ckeditor.com/cke4/addon/mentions) plugin is not matching diacritic characters. +* [#2519](https://github.com/ckeditor/ckeditor-dev/issues/2519): Fixed: The [Accessibility Help](https://ckeditor.com/cke4/addon/a11yhelp) dialog should display all available keystrokes for a single command. + +API Changes: + +* [#2453](https://github.com/ckeditor/ckeditor-dev/issues/2453): The [`CKEDITOR.ui.panel.block.getItems`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_ui_panel_block.html#method-getItems) method now also returns `input` elements in addition to links. +* [#2224](https://github.com/ckeditor/ckeditor-dev/issues/2224): The [`CKEDITOR.tools.convertToPx`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-convertToPx) function now converts negative values. +* [#2253](https://github.com/ckeditor/ckeditor-dev/issues/2253): The widget definition [`insert`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_widget_definition.html#property-insert) method now passes `editor` and `commandData`. Thanks to [marcparmet](https://github.com/marcparmet)! +* [#2045](https://github.com/ckeditor/ckeditor-dev/issues/2045): Extracted [`tools.eventsBuffer`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-eventsBuffer) and [`tools.throttle`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-throttle) functions logic into a separate namespace. + * [`tools.eventsBuffer`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-eventsBuffer) was extracted into [`tools.buffers.event`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_buffers_event.html), + * [`tools.throttle`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-throttle) was extracted into [`tools.buffers.throttle`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_buffers_throttle.html). +* [#2466](https://github.com/ckeditor/ckeditor-dev/issues/2466): The [`CKEDITOR.filter`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-constructor) constructor accepts an additional `rules` parameter allowing to bind the editor and filter together. +* [#2493](https://github.com/ckeditor/ckeditor-dev/issues/2493): The [`editor.getCommandKeystroke`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-getCommandKeystroke) method accepts an additional `all` parameter allowing to retrieve an array of all command keystrokes. +* [#2483](https://github.com/ckeditor/ckeditor-dev/issues/2483): Button's DOM element created with the [`hasArrow`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_ui.html#method-addButton) definition option can by identified by the `.cke_button_expandable` CSS class. + +Other Changes: + +* [#1713](https://github.com/ckeditor/ckeditor-dev/issues/1713): Removed the redundant `lang.title` entry from the [Clipboard](https://ckeditor.com/cke4/addon/clipboard) plugin. + ## CKEditor 4.10.1 Fixed Issues: @@ -12,7 +119,7 @@ * [#2169](https://github.com/ckeditor/ckeditor-dev/issues/2169): [Edge] Fixed: Error thrown when pasting into the editor. * [#1084](https://github.com/ckeditor/ckeditor-dev/issues/1084) Fixed: Using the "Automatic" option with [Color Button](https://ckeditor.com/cke4/addon/colorbutton) on a text with the color already defined sets an invalid color value. * [#2271](https://github.com/ckeditor/ckeditor-dev/issues/2271): Fixed: Custom color name not used as a label in the [Color Button](https://ckeditor.com/cke4/addon/image2) plugin. Thanks to [Eric Geloen](https://github.com/egeloen)! -* [#2296](https://github.com/ckeditor/ckeditor-dev/issues/2296): Fixed: [Color Button](https://ckeditor.com/cke4/addon/colorbutton) throws an error when activated on a content containing HTML comments. +* [#2296](https://github.com/ckeditor/ckeditor-dev/issues/2296): Fixed: The [Color Button](https://ckeditor.com/cke4/addon/colorbutton) plugin throws an error when activated on content containing HTML comments. * [#966](https://github.com/ckeditor/ckeditor-dev/issues/966): Fixed: Executing [`editor.destroy()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-destroy) during the [file upload](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_fileTools_uploadWidgetDefinition.html#property-onUploading) throws an error. Thanks to [Maksim Makarevich](https://github.com/MaksimMakarevich)! * [#1719](https://github.com/ckeditor/ckeditor-dev/issues/1719): Fixed: Ctrl/Cmd + A inadvertently focuses inline editor if it is starting and ending with a list. Thanks to [theNailz](https://github.com/theNailz)! * [#1046](https://github.com/ckeditor/ckeditor-dev/issues/1046): Fixed: Subsequent new links do not include the `id` attribute. Thanks to [Nathan Samson](https://github.com/nathansamson)! @@ -545,7 +652,7 @@ - New features: - CKEditor [Language](https://ckeditor.com/cke4/addon/language) plugin support. - CKEditor [Placeholder](https://ckeditor.com/cke4/addon/placeholder) plugin support. - - [Drag&Drop](https://sdk.ckeditor.com/samples/fileupload.html) support. + - [Drag&Drop](https://ckeditor.com/docs/ckeditor4/latest/examples/fileupload.html) support. - **Experimental** [GRAYT](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-grayt_autoStartup) (Grammar As You Type) functionality. - Fixed issues: * [#98](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/98): SCAYT affects dialog double-click. Fixed in SCAYT core. @@ -764,7 +871,7 @@ * Direct access to clipboard could only be implemented in Chrome, Safari on Mac OS, Opera and Firefox. In other browsers the pastebin must still be used. * [#12875](https://dev.ckeditor.com/ticket/12875): Samples and toolbar configuration tools. - * The old set of samples shipped with every CKEditor package was replaced with a shiny new single-page sample. This change concluded a long term plan which started from introducing the [CKEditor SDK](https://sdk.ckeditor.com/) and [CKEditor Functionality Overview](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_features.html) section in the documentation which essentially redefined the old samples. + * The old set of samples shipped with every CKEditor package was replaced with a shiny new single-page sample. This change concluded a long term plan which started from introducing the [CKEditor SDK](https://ckeditor.com/docs/ckeditor4/latest/examples/index.html) and [CKEditor Functionality Overview](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_features.html) section in the documentation which essentially redefined the old samples. * Toolbar configurators with live previews were introduced. They will be shipped with every CKEditor package and are meant to help in configuring toolbar layouts. * [#10925](https://dev.ckeditor.com/ticket/10925): The [Media Embed](https://ckeditor.com/cke4/addon/embed) and [Semantic Media Embed](https://ckeditor.com/cke4/addon/embedsemantic) plugins were introduced. Read more about the new features in the [Embedding Content](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_media_embed.html) article. @@ -915,7 +1022,7 @@ * [#12315](https://dev.ckeditor.com/ticket/12315): Fixed: Marked [`config.autoParagraph`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-autoParagraph) as deprecated. * [#12113](https://dev.ckeditor.com/ticket/12113): Fixed: A [code snippet](https://ckeditor.com/cke4/addon/codesnippet) should be presented in the [elements path](https://ckeditor.com/cke4/addon/elementspath) as "code snippet" (translatable). * [#12311](https://dev.ckeditor.com/ticket/12311): Fixed: [Remove Format](https://ckeditor.com/cke4/addon/removeformat) should also remove `` elements. -* [#12261](https://dev.ckeditor.com/ticket/12261): Fixed: Filter has to be destroyed and removed from [`CKEDITOR.filter.instances`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_filter.html#static-property-instances) on editor destroy. +* [#12261](https://dev.ckeditor.com/ticket/12261): Fixed: The filter is not destroyed and removed from [`CKEDITOR.filter.instances`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_filter.html#static-property-instances) on editor destroy. * [#12398](https://dev.ckeditor.com/ticket/12398): Fixed: [Maximize](https://ckeditor.com/cke4/addon/maximize) does not work on an instance without a [title](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-title). * [#12097](https://dev.ckeditor.com/ticket/12097): Fixed: JAWS not reading the number of options correctly in the [Text Color and Background Color](https://ckeditor.com/cke4/addon/colorbutton) button menu. * [#12411](https://dev.ckeditor.com/ticket/12411): Fixed: [Page Break](https://ckeditor.com/cke4/addon/pagebreak) used directly in the editable breaks the editor. diff -r 129ea1e6d783 -r af1871eacc83 core/assets/vendor/ckeditor/LICENSE.md --- a/core/assets/vendor/ckeditor/LICENSE.md Thu Feb 28 13:21:36 2019 +0000 +++ b/core/assets/vendor/ckeditor/LICENSE.md Thu May 09 15:33:08 2019 +0100 @@ -2,7 +2,7 @@ ========================== CKEditor - The text editor for Internet - https://ckeditor.com/ -Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. Licensed under the terms of any of the following licenses at your choice: @@ -37,7 +37,7 @@ The following libraries are included in CKEditor under the MIT license (see Appendix D): -* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2018, CKSource - Frederico Knabben. +* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2019, CKSource - Frederico Knabben. * PicoModal (included in `samples/js/sf.js`) - Copyright (c) 2012 James Frasca. * CodeMirror (included in the samples) - Copyright (C) 2014 by Marijn Haverbeke and others. diff -r 129ea1e6d783 -r af1871eacc83 core/assets/vendor/ckeditor/ckeditor.js --- a/core/assets/vendor/ckeditor/ckeditor.js Thu Feb 28 13:21:36 2019 +0000 +++ b/core/assets/vendor/ckeditor/ckeditor.js Thu May 09 15:33:08 2019 +0100 @@ -1,1149 +1,1159 @@ /* -Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -(function(){window.CKEDITOR&&window.CKEDITOR.dom||(window.CKEDITOR||(window.CKEDITOR=function(){var f=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,h={timestamp:"I8E8",version:"4.10.1",revision:"59246e973",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:f},status:"unloaded",basePath:function(){var d=window.CKEDITOR_BASEPATH||"";if(!d)for(var k=document.getElementsByTagName("script"),e=0;ea.getListenerIndex(d)){a=a.listeners;e||(e=this);isNaN(b)&&(b=10);var n=this;g.fn=d;g.priority=b;for(var w=a.length-1;0<=w;w--)if(a[w].priority<=b)return a.splice(w+1,0,g),{removeListener:c};a.unshift(g)}return{removeListener:c}},once:function(){var k=Array.prototype.slice.call(arguments),d=k[1];k[1]=function(k){k.removeListener();return d.apply(this, -arguments)};return this.on.apply(this,k)},capture:function(){CKEDITOR.event.useCapture=1;var k=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return k},fire:function(){var k=0,d=function(){k=1},e=0,f=function(){e=1};return function(b,g,c){var a=h(this)[b];b=k;var n=e;k=e=0;if(a){var w=a.listeners;if(w.length)for(var w=w.slice(0),v,t=0;tdocument.documentMode),mobile:-1k||e.quirks);e.gecko&&(h=f.match(/rv:([\d\.]+)/))&&(h=h[1].split("."),k=1E4*h[0]+100*(h[1]||0)+1*(h[2]||0));e.air&&(k=parseFloat(f.match(/ adobeair\/(\d+)/)[1]));e.webkit&&(k=parseFloat(f.match(/ applewebkit\/(\d+)/)[1]));e.version=k;e.isCompatible=!(e.ie&&7>k)&&!(e.gecko&&4E4>k)&&!(e.webkit&& -534>k);e.hidpi=2<=window.devicePixelRatio;e.needsBrFiller=e.gecko||e.webkit||e.ie&&10k;e.cssClass="cke_browser_"+(e.ie?"ie":e.gecko?"gecko":e.webkit?"webkit":"unknown");e.quirks&&(e.cssClass+=" cke_browser_quirks");e.ie&&(e.cssClass+=" cke_browser_ie"+(e.quirks?"6 cke_browser_iequirks":e.version));e.air&&(e.cssClass+=" cke_browser_air");e.iOS&&(e.cssClass+=" cke_browser_ios");e.hidpi&&(e.cssClass+=" cke_hidpi");return e}()),"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR); -CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var f=document.createElement("script");f.type="text/javascript";f.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(f)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(f){(this._.pending||(this._.pending=[])).push(f)};(function(){CKEDITOR.domReady(function(){var f=CKEDITOR.loadFullCore,h=CKEDITOR.loadFullCoreTimeout;f&&(CKEDITOR.status= -"basic_ready",f&&f._load?f():h&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*h))})})();CKEDITOR.status="basic_loaded"}(),"use strict",CKEDITOR.VERBOSITY_WARN=1,CKEDITOR.VERBOSITY_ERROR=2,CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR,CKEDITOR.warn=function(f,h){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:f,additionalData:h})},CKEDITOR.error=function(f,h){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log", -{type:"error",errorCode:f,additionalData:h})},CKEDITOR.on("log",function(f){if(window.console&&window.console.log){var h=console[f.data.type]?f.data.type:"log",e=f.data.errorCode;if(f=f.data.additionalData)console[h]("[CKEDITOR] Error code: "+e+".",f);else console[h]("[CKEDITOR] Error code: "+e+".");console[h]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+e)}},null,null,999),CKEDITOR.dom={},function(){var f=[],h=CKEDITOR.env.gecko? -"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",e=/&/g,k=/>/g,d=/|\s) /g,function(a,c){return c+"\x26nbsp;"}).replace(/ (?=<)/g, -"\x26nbsp;")},getNextNumber:function(){var c=0;return function(){return++c}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var c="e",a=0;8>a;a++)c+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return c},override:function(c,a){var n=a(c);n.prototype=c.prototype;return n},setTimeout:function(c,a,n,b,g){g||(g=window);n||(n=g);return g.setTimeout(function(){b?c.apply(n,[].concat(b)):c.apply(n)},a||0)},throttle:function(c,a,n){var b,g=0;n=n||{};return{input:function(){function d(){g= -(new Date).getTime();b=!1;a.apply(n,e)}var e=Array.prototype.slice.call(arguments);b&&(clearTimeout(b),b=0);var k=(new Date).getTime()-g;kc;c++)a[c]=("0"+parseInt(a[c],10).toString(16)).slice(-2);return"#"+a.join("")})},normalizeHex:function(c){return c.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(a,c,b,g){a=c.toLowerCase();3==a.length&&(a=a.split(""),a=[a[0],a[0],a[1],a[1],a[2],a[2]].join(""));return"#"+a+g})},parseCssText:function(c,a,b){var g={}; -b&&(c=(new CKEDITOR.dom.element("span")).setAttribute("style",c).getAttribute("style")||"");c&&(c=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(c)));if(!c||";"==c)return g;c.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(c,b,n){a&&(b=b.toLowerCase(),"font-family"==b&&(n=n.replace(/\s*,\s*/g,",")),n=CKEDITOR.tools.trim(n));g[b]=n});return g},writeCssText:function(c,a){var b,g=[];for(b in c)g.push(b+":"+c[b]);a&&g.sort();return g.join("; ")},objectCompare:function(c, -a,b){var g;if(!c&&!a)return!0;if(!c||!a)return!1;for(g in c)if(c[g]!=a[g])return!1;if(!b)for(g in a)if(c[g]!=a[g])return!1;return!0},objectKeys:function(c){var a=[],b;for(b in c)a.push(b);return a},convertArrayToObject:function(c,a){var b={};1==arguments.length&&(a=!0);for(var g=0,d=c.length;gb;b++)c.push(Math.floor(256*Math.random()));for(b=0;bCKEDITOR.env.version?4===a.button?CKEDITOR.MOUSE_BUTTON_MIDDLE:1===a.button?CKEDITOR.MOUSE_BUTTON_LEFT:CKEDITOR.MOUSE_BUTTON_RIGHT:a.button:!1},convertHexStringToBytes:function(c){var a=[],b=c.length/ -2,g;for(g=0;ge)for(f=e;3>f;f++)d[f]=0;k[0]=(d[0]&252)>>2;k[1]=(d[0]&3)<<4|d[1]>>4;k[2]=(d[1]&15)<<2|(d[2]&192)>>6;k[3]=d[2]&63;for(f=0;4>f;f++)a=f<=e?a+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k[f]):a+"\x3d"}return a},style:{parse:{_colors:{aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF", -aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F", -darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000", -greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899", -lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000", -olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB", -slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "),_widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi, -_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(c){var a={},b=this._findColor(c);b.length&&(a.color=b[0],CKEDITOR.tools.array.forEach(b,function(a){c=c.replace(a,"")}));if(c=CKEDITOR.tools.trim(c))a.unprocessed=c;return a},margin:function(c){function a(a){b.top=g[a[0]];b.right=g[a[1]];b.bottom=g[a[2]];b.left=g[a[3]]}var b={},g=c.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset)/g)||["0px"];switch(g.length){case 1:a([0,0,0,0]);break;case 2:a([0, -1,0,1]);break;case 3:a([0,1,2,1]);break;case 4:a([0,1,2,3])}return b},border:function(c){var a={},b=c.split(/\s+/g);c=CKEDITOR.tools.style.parse._findColor(c);c.length&&(a.color=c[0]);CKEDITOR.tools.array.forEach(b,function(c){a.style||-1===CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle,c)?!a.width&&CKEDITOR.tools.style.parse._widthRegExp.test(c)&&(a.width=c):a.style=c});return a},_findColor:function(c){var a=[],b=CKEDITOR.tools.array,a=a.concat(c.match(this._rgbaRegExp)||[]),a=a.concat(c.match(this._hslaRegExp)|| -[]);return a=a.concat(b.filter(c.split(/\s+/),function(a){return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:a.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(c,a,b){var g=[];this.forEach(c,function(d,e){a.call(b,d,e,c)&&g.push(d)});return g},forEach:function(c,a,b){var g=c.length,d;for(d=0;dCKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&k(d);return d},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling}, -insertAfter:function(f){f.$.parentNode.insertBefore(this.$,f.$.nextSibling);return f},insertBefore:function(f){f.$.parentNode.insertBefore(this.$,f.$);return f},insertBeforeMe:function(f){this.$.parentNode.insertBefore(f.$,this.$);return f},getAddress:function(f){for(var h=[],e=this.getDocument().$.documentElement,k=this.$;k&&k!=e;){var d=k.parentNode;d&&h.unshift(this.getIndex.call({$:k},f));k=d}return h},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)}, -getIndex:function(f){function h(d,b){var g=b?d.nextSibling:d.previousSibling;return g&&g.nodeType==CKEDITOR.NODE_TEXT?e(g)?h(g,b):g:null}function e(d){return!d.nodeValue||d.nodeValue==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE}var k=this.$,d=-1,l;if(!this.$.parentNode||f&&k.nodeType==CKEDITOR.NODE_TEXT&&e(k)&&!h(k)&&!h(k,!0))return-1;do f&&k!=this.$&&k.nodeType==CKEDITOR.NODE_TEXT&&(l||e(k))||(d++,l=k.nodeType==CKEDITOR.NODE_TEXT);while(k=k.previousSibling);return d},getNextSourceNode:function(f, -h,e){if(e&&!e.call){var k=e;e=function(d){return!d.equals(k)}}f=!f&&this.getFirst&&this.getFirst();var d;if(!f){if(this.type==CKEDITOR.NODE_ELEMENT&&e&&!1===e(this,!0))return null;f=this.getNext()}for(;!f&&(d=(d||this).getParent());){if(e&&!1===e(d,!0))return null;f=d.getNext()}return!f||e&&!1===e(f)?null:h&&h!=f.type?f.getNextSourceNode(!1,h,e):f},getPreviousSourceNode:function(f,h,e){if(e&&!e.call){var k=e;e=function(d){return!d.equals(k)}}f=!f&&this.getLast&&this.getLast();var d;if(!f){if(this.type== -CKEDITOR.NODE_ELEMENT&&e&&!1===e(this,!0))return null;f=this.getPrevious()}for(;!f&&(d=(d||this).getParent());){if(e&&!1===e(d,!0))return null;f=d.getPrevious()}return!f||e&&!1===e(f)?null:h&&f.type!=h?f.getPreviousSourceNode(!1,h,e):f},getPrevious:function(f){var h=this.$,e;do e=(h=h.previousSibling)&&10!=h.nodeType&&new CKEDITOR.dom.node(h);while(e&&f&&!f(e));return e},getNext:function(f){var h=this.$,e;do e=(h=h.nextSibling)&&new CKEDITOR.dom.node(h);while(e&&f&&!f(e));return e},getParent:function(f){var h= -this.$.parentNode;return h&&(h.nodeType==CKEDITOR.NODE_ELEMENT||f&&h.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(h):null},getParents:function(f){var h=this,e=[];do e[f?"push":"unshift"](h);while(h=h.getParent());return e},getCommonAncestor:function(f){if(f.equals(this))return this;if(f.contains&&f.contains(this))return f;var h=this.contains?this:this.getParent();do if(h.contains(f))return h;while(h=h.getParent());return null},getPosition:function(f){var h=this.$,e=f.$;if(h.compareDocumentPosition)return h.compareDocumentPosition(e); -if(h==e)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&f.type==CKEDITOR.NODE_ELEMENT){if(h.contains){if(h.contains(e))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(e.contains(h))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in h)return 0>h.sourceIndex||0>e.sourceIndex?CKEDITOR.POSITION_DISCONNECTED:h.sourceIndex=document.documentMode||!h||(f=h+":"+f);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(f))},getHead:function(){var f=this.$.getElementsByTagName("head")[0];return f=f?new CKEDITOR.dom.element(f):this.getDocumentElement().append(new CKEDITOR.dom.element("head"), -!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(f){this.$.open("text/html","replace");CKEDITOR.env.ie&&(f=f.replace(/(?:^\s*]*?>)|^/i,'$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e('+CKEDITOR.tools.fixDomain+")();\x3c/script\x3e"));this.$.write(f);this.$.close()},find:function(f){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(f))}, -findOne:function(f){return(f=this.$.querySelector(f))?new CKEDITOR.dom.element(f):null},_getHtml5ShivFrag:function(){var f=this.getCustomData("html5ShivFrag");f||(f=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(f,!0),this.setCustomData("html5ShivFrag",f));return f}}),CKEDITOR.dom.nodeList=function(f){this.$=f},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(f){return 0>f||f>=this.$.length?null:(f=this.$[f])?new CKEDITOR.dom.node(f):null}, -toArray:function(){return CKEDITOR.tools.array.map(this.$,function(f){return new CKEDITOR.dom.node(f)})}},CKEDITOR.dom.element=function(f,h){"string"==typeof f&&(f=(h?h.$:document).createElement(f));CKEDITOR.dom.domObject.call(this,f)},CKEDITOR.dom.element.get=function(f){return(f="string"==typeof f?document.getElementById(f)||document.getElementsByName(f)[0]:f)&&(f.$?f:new CKEDITOR.dom.element(f))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(f, -h){var e=new CKEDITOR.dom.element("div",h);e.setHtml(f);return e.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(f,h,e,k){var d=h.getCustomData("list_marker_id")||h.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),l=h.getCustomData("list_marker_names")||h.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");f[d]=h;l[e]=1;return h.setCustomData(e,k)},CKEDITOR.dom.element.clearAllMarkers=function(f){for(var h in f)CKEDITOR.dom.element.clearMarkers(f, -f[h],1)},CKEDITOR.dom.element.clearMarkers=function(f,h,e){var k=h.getCustomData("list_marker_names"),d=h.getCustomData("list_marker_id"),l;for(l in k)h.removeCustomData(l);h.removeCustomData("list_marker_names");e&&(h.removeCustomData("list_marker_id"),delete f[d])},function(){function f(b,g){return-1<(" "+b+" ").replace(l," ").indexOf(" "+g+" ")}function h(b){var g=!0;b.$.id||(b.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),g=!1);return function(){g||b.removeAttribute("id")}}function e(b,g){var c= -CKEDITOR.tools.escapeCss(b.$.id);return"#"+c+" "+g.split(/,\s*/).join(", #"+c+" ")}function k(b){for(var g=0,c=0,a=m[b].length;cCKEDITOR.env.version?this.$.text+=b:this.append(new CKEDITOR.dom.text(b))},appendBogus:function(b){if(b||CKEDITOR.env.needsBrFiller){for(b=this.getLast();b&&b.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(b.getText());)b= -b.getPrevious();b&&b.is&&b.is("br")||(b=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&b.setAttribute("type","_moz"),this.append(b))}},breakParent:function(b,g){var c=new CKEDITOR.dom.range(this.getDocument());c.setStartAfter(this);c.setEndAfter(b);var a=c.extractContents(!1,g||!1),d;c.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(c=new CKEDITOR.dom.element("div");d=a.getFirst();)d.$.style.backgroundColor&&(d.$.style.backgroundColor=d.$.style.backgroundColor),c.append(d); -c.insertAfter(this);c.remove(!0)}else a.insertAfterNode(this)},contains:document.compareDocumentPosition?function(b){return!!(this.$.compareDocumentPosition(b.$)&16)}:function(b){var g=this.$;return b.type!=CKEDITOR.NODE_ELEMENT?g.contains(b.getParent().$):g!=b.$&&g.contains(b.$)},focus:function(){function b(){try{this.$.focus()}catch(b){}}return function(g){g?CKEDITOR.tools.setTimeout(b,100,this):b.call(this)}}(),getHtml:function(){var b=this.$.innerHTML;return CKEDITOR.env.ie?b.replace(/<\?[^>]*>/g, -""):b},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var b=this.$.ownerDocument.createElement("div");b.appendChild(this.$.cloneNode(!0));return b.innerHTML},getClientRect:function(b){var g=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());!g.width&&(g.width=g.right-g.left);!g.height&&(g.height=g.bottom-g.top);return b?CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(),g):g},setHtml:CKEDITOR.env.ie&&9>CKEDITOR.env.version?function(b){try{var g= -this.$;if(this.getParent())return g.innerHTML=b;var c=this.getDocument()._getHtml5ShivFrag();c.appendChild(g);g.innerHTML=b;c.removeChild(g);return b}catch(a){this.$.innerHTML="";g=new CKEDITOR.dom.element("body",this.getDocument());g.$.innerHTML=b;for(g=g.getChildren();g.count();)this.append(g.getItem(0));return b}}:function(b){return this.$.innerHTML=b},setText:function(){var b=document.createElement("p");b.innerHTML="x";b=b.textContent;return function(g){this.$[b?"textContent":"innerText"]=g}}(), -getAttribute:function(){var b=function(b){return this.$.getAttribute(b,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b){switch(b){case "class":b="className";break;case "http-equiv":b="httpEquiv";break;case "name":return this.$.name;case "tabindex":return b=this.$.getAttribute(b,2),0!==b&&0===this.$.tabIndex&&(b=null),b;case "checked":return b=this.$.attributes.getNamedItem(b),(b.specified?b.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[b]; -case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(b,2)}:b}(),getAttributes:function(b){var g={},c=this.$.attributes,a;b=CKEDITOR.tools.isArray(b)?b:[];for(a=0;a=document.documentMode){var g=this.$.scopeName;"HTML"!=g&&(b=g.toLowerCase()+":"+b)}this.getName=function(){return b};return this.getName()},getValue:function(){return this.$.value}, -getFirst:function(b){var g=this.$.firstChild;(g=g&&new CKEDITOR.dom.node(g))&&b&&!b(g)&&(g=g.getNext(b));return g},getLast:function(b){var g=this.$.lastChild;(g=g&&new CKEDITOR.dom.node(g))&&b&&!b(g)&&(g=g.getPrevious(b));return g},getStyle:function(b){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(b)]},is:function(){var b=this.getName();if("object"==typeof arguments[0])return!!arguments[0][b];for(var g=0;gCKEDITOR.env.version&&this.is("a")){var c=this.getParent();c.type==CKEDITOR.NODE_ELEMENT&&(c=c.clone(),c.setHtml(g),g=c.getHtml(),c.setHtml(b),b=c.getHtml())}return g== -b},isVisible:function(){var b=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),g,c;b&&CKEDITOR.env.webkit&&(g=this.getWindow(),!g.equals(CKEDITOR.document.getWindow())&&(c=g.$.frameElement)&&(b=(new CKEDITOR.dom.element(c)).isVisible()));return!!b},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;for(var b=this.getChildren(),g=0,c=b.count();gCKEDITOR.env.version?function(g){return"name"==g?!!this.$.name:b.call(this,g)}:b:function(b){return!!this.$.attributes.getNamedItem(b)}}(), -hide:function(){this.setStyle("display","none")},moveChildren:function(b,g){var c=this.$;b=b.$;if(c!=b){var a;if(g)for(;a=c.lastChild;)b.insertBefore(c.removeChild(a),b.firstChild);else for(;a=c.firstChild;)b.appendChild(c.removeChild(a))}},mergeSiblings:function(){function b(b,c,a){if(c&&c.type==CKEDITOR.NODE_ELEMENT){for(var d=[];c.data("cke-bookmark")||c.isEmptyInlineRemoveable();)if(d.push(c),c=a?c.getNext():c.getPrevious(),!c||c.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(c)){for(var e= -a?b.getLast():b.getFirst();d.length;)d.shift().move(b,!a);c.moveChildren(b,!a);c.remove();e&&e.type==CKEDITOR.NODE_ELEMENT&&e.mergeSiblings()}}}return function(g){if(!1===g||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))b(this,this.getNext(),!0),b(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var b=function(b,c){this.$.setAttribute(b,c);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(g, -c){"class"==g?this.$.className=c:"style"==g?this.$.style.cssText=c:"tabindex"==g?this.$.tabIndex=c:"checked"==g?this.$.checked=c:"contenteditable"==g?b.call(this,"contentEditable",c):b.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(g,c){if("src"==g&&c.match(/^http:\/\//))try{b.apply(this,arguments)}catch(a){}else b.apply(this,arguments);return this}:b}(),setAttributes:function(b){for(var g in b)this.setAttribute(g,b[g]);return this},setValue:function(b){this.$.value= -b;return this},removeAttribute:function(){var b=function(b){this.$.removeAttribute(b)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b){"class"==b?b="className":"tabindex"==b?b="tabIndex":"contenteditable"==b&&(b="contentEditable");this.$.removeAttribute(b)}:b}(),removeAttributes:function(b){if(CKEDITOR.tools.isArray(b))for(var g=0;gCKEDITOR.env.version?(b=Math.round(100*b),this.setStyle("filter",100<=b?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+b+")")):this.setStyle("opacity",b)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var b, -g=this.getElementsByTag("*"),c=0,a=g.count();ck||0k?k:d);c&&(0>e||0e?e:a,0)},setState:function(b,g,c){g=g||"cke";switch(b){case CKEDITOR.TRISTATE_ON:this.addClass(g+"_on");this.removeClass(g+"_off");this.removeClass(g+"_disabled");c&&this.setAttribute("aria-pressed", -!0);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(g+"_disabled");this.removeClass(g+"_off");this.removeClass(g+"_on");c&&this.setAttribute("aria-disabled",!0);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(g+"_off"),this.removeClass(g+"_on"),this.removeClass(g+"_disabled"),c&&this.removeAttribute("aria-pressed"),c&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var b=this.$;try{b.contentWindow.document}catch(g){b.src= -b.src}return b&&new CKEDITOR.dom.document(b.contentWindow.document)},copyAttributes:function(b,g){var c=this.$.attributes;g=g||{};for(var a=0;a=y.getChildCount()?(y=y.getChild(z-1),F=!0):y=y.getChild(z):H=F=!0;u.type==CKEDITOR.NODE_TEXT?l?G=!0:u.split(x):0Z)for(;Y;)Y=e(Y,K,!0);K=U}l||f()}}function e(){var a=!1,c=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(g){return b(g)||c(g)?!0:d(g)&&!a?a=!0:g.type==CKEDITOR.NODE_TEXT&&(g.hasAscendant("pre")||CKEDITOR.tools.trim(g.getText()).length)||g.type==CKEDITOR.NODE_ELEMENT&&!g.is(l)?!1:!0}}function k(a){var c=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.dom.walker.bookmark(1); -return function(d){return b(d)||c(d)?!0:!a&&m(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function d(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&c(a)&&(b=a);return g(a)&&!(m(a)&&a.equals(b))})}}var l={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},m=CKEDITOR.dom.walker.bogus(),b=/^[\t\r\n ]*(?: |\xa0)$/, -g=CKEDITOR.dom.walker.editable(),c=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var a=new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){a?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),this.startOffset=this.endOffset); -this.collapsed=!0},cloneContents:function(a){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||h(this,2,c,!1,"undefined"==typeof a?!0:a);return c},deleteContents:function(a){this.collapsed||h(this,0,null,a)},extractContents:function(a,c){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||h(this,1,b,a,"undefined"==typeof c?!0:c);return b},createBookmark:function(a){var c,b,d,g,e=this.collapsed;c=this.document.createElement("span");c.data("cke-bookmark",1);c.setStyle("display", -"none");c.setHtml("\x26nbsp;");a&&(d="cke_bm_"+CKEDITOR.tools.getNextNumber(),c.setAttribute("id",d+(e?"C":"S")));e||(b=c.clone(),b.setHtml("\x26nbsp;"),a&&b.setAttribute("id",d+"E"),g=this.clone(),g.collapse(),g.insertNode(b));g=this.clone();g.collapse(!0);g.insertNode(c);b?(this.setStartAfter(c),this.setEndBefore(b)):this.moveToPosition(c,CKEDITOR.POSITION_AFTER_END);return{startNode:a?d+(e?"C":"S"):c,endNode:a?d+"E":b,serializable:a,collapsed:e}},createBookmark2:function(){function a(a){var c= -a.container,d=a.offset,g;g=c;var e=d;g=g.type!=CKEDITOR.NODE_ELEMENT||0===e||e==g.getChildCount()?0:g.getChild(e-1).type==CKEDITOR.NODE_TEXT&&g.getChild(e).type==CKEDITOR.NODE_TEXT;g&&(c=c.getChild(d-1),d=c.getLength());if(c.type==CKEDITOR.NODE_ELEMENT&&0=a.offset&&(a.offset=g.getIndex(),a.container=g.getParent()))}}var b=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(b){var d=this.collapsed,g={container:this.startContainer, -offset:this.startOffset},e={container:this.endContainer,offset:this.endOffset};b&&(a(g),c(g,this.root),d||(a(e),c(e,this.root)));return{start:g.container.getAddress(b),end:d?null:e.container.getAddress(b),startOffset:g.offset,endOffset:e.offset,normalized:b,collapsed:d,is2:!0}}}(),moveToBookmark:function(a){if(a.is2){var c=this.document.getByAddress(a.start,a.normalized),b=a.startOffset,d=a.end&&this.document.getByAddress(a.end,a.normalized);a=a.endOffset;this.setStart(c,b);d?this.setEnd(d,a):this.collapse(!0)}else c= -(b=a.serializable)?this.document.getById(a.startNode):a.startNode,a=b?this.document.getById(a.endNode):a.endNode,this.setStartBefore(c),c.remove(),a?(this.setEndBefore(a),a.remove()):this.collapse(!0)},getBoundaryNodes:function(){var a=this.startContainer,c=this.endContainer,b=this.startOffset,d=this.endOffset,g;if(a.type==CKEDITOR.NODE_ELEMENT)if(g=a.getChildCount(),g>b)a=a.getChild(b);else if(1>g)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a= -a.getNextSourceNode()||a}if(c.type==CKEDITOR.NODE_ELEMENT)if(g=c.getChildCount(),g>d)c=c.getChild(d).getPreviousSourceNode(!0);else if(1>g)c=c.getPreviousSourceNode();else{for(c=c.$;c.lastChild;)c=c.lastChild;c=new CKEDITOR.dom.node(c)}a.getPosition(c)&CKEDITOR.POSITION_FOLLOWING&&(a=c);return{startNode:a,endNode:c}},getCommonAncestor:function(a,c){var b=this.startContainer,d=this.endContainer,b=b.equals(d)?a&&b.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?b.getChild(this.startOffset): -b:b.getCommonAncestor(d);return c&&!b.is?b.getParent():b},optimize:function(){var a=this.startContainer,c=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(c?c>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;c=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(c?c>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,c=this.endContainer;a.is&&a.is("span")&&a.data("cke-bookmark")&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START); -c&&c.is&&c.is("span")&&c.data("cke-bookmark")&&this.setEndAt(c,CKEDITOR.POSITION_AFTER_END)},trim:function(a,c){var b=this.startContainer,d=this.startOffset,g=this.collapsed;if((!a||g)&&b&&b.type==CKEDITOR.NODE_TEXT){if(d)if(d>=b.getLength())d=b.getIndex()+1,b=b.getParent();else{var e=b.split(d),d=b.getIndex()+1,b=b.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(e,this.endOffset-this.startOffset):b.equals(this.endContainer)&&(this.endOffset+=1)}else d=b.getIndex(),b=b.getParent(); -this.setStart(b,d);if(g){this.collapse(!0);return}}b=this.endContainer;d=this.endOffset;c||g||!b||b.type!=CKEDITOR.NODE_TEXT||(d?(d>=b.getLength()||b.split(d),d=b.getIndex()+1):d=b.getIndex(),b=b.getParent(),this.setEnd(b,d))},enlarge:function(a,c){function b(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var d=new RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var g=1;case CKEDITOR.ENLARGE_ELEMENT:var e=function(a,c){var b=new CKEDITOR.dom.range(f); -b.setStart(a,c);b.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);var b=new CKEDITOR.dom.walker(b),g;for(b.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=b.next();){if(g.type!=CKEDITOR.NODE_TEXT)return!1;I=g!=a?g.getText():g.substring(c);if(d.test(I))return!1}return!0};if(this.collapsed)break;var k=this.getCommonAncestor(),f=this.root,h,m,l,u,y,x=!1,z,I;z=this.startContainer;var F=this.startOffset;z.type==CKEDITOR.NODE_TEXT?(F&&(z=!CKEDITOR.tools.trim(z.substring(0,F)).length&& -z,x=!!z),z&&((u=z.getPrevious())||(l=z.getParent()))):(F&&(u=z.getChild(F-1)||z.getLast()),u||(l=z));for(l=b(l);l||u;){if(l&&!u){!y&&l.equals(k)&&(y=!0);if(g?l.isBlockBoundary():!f.contains(l))break;x&&"inline"==l.getComputedStyle("display")||(x=!1,y?h=l:this.setStartBefore(l));u=l.getPrevious()}for(;u;)if(z=!1,u.type==CKEDITOR.NODE_COMMENT)u=u.getPrevious();else{if(u.type==CKEDITOR.NODE_TEXT)I=u.getText(),d.test(I)&&(u=null),z=/[\s\ufeff]$/.test(I);else if((u.$.offsetWidth>(CKEDITOR.env.webkit?1: -0)||c&&u.is("br"))&&!u.data("cke-bookmark"))if(x&&CKEDITOR.dtd.$removeEmpty[u.getName()]){I=u.getText();if(d.test(I))u=null;else for(var F=u.$.getElementsByTagName("*"),E=0,H;H=F[E++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){u=null;break}u&&(z=!!I.length)}else u=null;z&&(x?y?h=l:l&&this.setStartBefore(l):x=!0);if(u){z=u.getPrevious();if(!l&&!z){l=u;u=null;break}u=z}else l=null}l&&(l=b(l.getParent()))}z=this.endContainer;F=this.endOffset;l=u=null;y=x=!1;z.type==CKEDITOR.NODE_TEXT? -CKEDITOR.tools.trim(z.substring(F)).length?x=!0:(x=!z.getLength(),F==z.getLength()?(u=z.getNext())||(l=z.getParent()):e(z,F)&&(l=z.getParent())):(u=z.getChild(F))||(l=z);for(;l||u;){if(l&&!u){!y&&l.equals(k)&&(y=!0);if(g?l.isBlockBoundary():!f.contains(l))break;x&&"inline"==l.getComputedStyle("display")||(x=!1,y?m=l:l&&this.setEndAfter(l));u=l.getNext()}for(;u;){z=!1;if(u.type==CKEDITOR.NODE_TEXT)I=u.getText(),e(u,0)||(u=null),z=/^[\s\ufeff]/.test(I);else if(u.type==CKEDITOR.NODE_ELEMENT){if((0=k.getLength()?e.setStartAfter(k):(e.setStartBefore(k),b=0):e.setStartBefore(k));f&&f.type==CKEDITOR.NODE_TEXT&&(l?l>=f.getLength()?e.setEndAfter(f):(e.setEndAfter(f),m=0):e.setEndBefore(f));var e=new CKEDITOR.dom.walker(e),u=CKEDITOR.dom.walker.bookmark(),y=CKEDITOR.dom.walker.bogus();e.evaluator=function(c){return c.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)}; -var x;e.guard=function(c,b){if(g&&y(c)||u(c))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&&c.type==CKEDITOR.NODE_TEXT||b&&c.equals(x)||!1===d&&c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()||c.type==CKEDITOR.NODE_ELEMENT&&c.hasAttribute("contenteditable"))return!1;b||c.type!=CKEDITOR.NODE_ELEMENT||(x=c);return!0};b&&(k=e[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(k,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);m&&(e.reset(),(e=e[a==CKEDITOR.SHRINK_ELEMENT? -"lastBackward":"previous"]())&&this.setEndAt(e,c?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));return!(!b&&!m)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var c=this.startContainer,b=c.getChild(this.startOffset);b?a.insertBefore(b):c.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,c){this.setStartAt(a,c);this.collapse(!0)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset); -this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(a,c){a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]&&(c=a.getIndex(),a=a.getParent());this._setStartContainer(a);this.startOffset=c;this.endContainer||(this._setEndContainer(a),this.endOffset=c);f(this)},setEnd:function(a,c){a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]&&(c=a.getIndex()+ -1,a=a.getParent());this._setEndContainer(a);this.endOffset=c;this.startContainer||(this._setStartContainer(a),this.startOffset=c);f(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(a,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setStart(a,0); -break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setStart(a,a.getLength()):this.setStart(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(a);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(a)}f(this)},setEndAt:function(a,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setEnd(a,0);break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setEnd(a,a.getLength()):this.setEnd(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(a); -break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(a)}f(this)},fixBlock:function(a,c){var b=this.createBookmark(),d=this.document.createElement(c);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);d.trim();this.insertNode(d);var g=d.getBogus();g&&g.remove();d.appendBogus();this.moveToBookmark(b);return d},splitBlock:function(a,c){var b=new CKEDITOR.dom.elementPath(this.startContainer,this.root),d=new CKEDITOR.dom.elementPath(this.endContainer,this.root), -g=b.block,e=d.block,k=null;if(!b.blockLimit.equals(d.blockLimit))return null;"br"!=a&&(g||(g=this.fixBlock(!0,a),e=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),e||(e=this.fixBlock(!1,a)));b=g&&this.checkStartOfBlock();d=e&&this.checkEndOfBlock();this.deleteContents();g&&g.equals(e)&&(d?(k=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),e=null):b?(k=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(g, -CKEDITOR.POSITION_BEFORE_START),g=null):(e=this.splitElement(g,c||!1),g.is("ul","ol")||g.appendBogus()));return{previousBlock:g,nextBlock:e,wasStartOfBlock:b,wasEndOfBlock:d,elementPath:k}},splitElement:function(a,c){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var b=this.extractContents(!1,c||!1),d=a.clone(!1,c||!1);b.appendTo(d);d.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return d},removeEmptyBlocksAtEnd:function(){function a(a){return function(d){return c(d)|| -b(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.isEmptyInlineRemoveable()||a.is("table")&&d.is("caption")?!1:!0}}var c=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.dom.walker.bookmark(!1);return function(c){for(var b=this.createBookmark(),d=this[c?"endPath":"startPath"](),g=d.block||d.blockLimit,e;g&&!g.equals(d.root)&&!g.getFirst(a(g));)e=g.getParent(),this[c?"setEndAt":"setStartAt"](g,CKEDITOR.POSITION_AFTER_END),g.remove(1),g=e;this.moveToBookmark(b)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer, -this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(a,c){var b=c==CKEDITOR.START,d=this.clone();d.collapse(b);d[b?"setStartAt":"setEndAt"](a,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=k(b);return d[b?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var a=this.startContainer,c=this.startOffset;CKEDITOR.env.ie&&c&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.ltrim(a.substring(0, -c)),b.test(a)&&this.trim(0,1));this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer,this.root);c=this.clone();c.collapse(!0);c.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(c);a.evaluator=e();return a.checkBackward()},checkEndOfBlock:function(){var a=this.endContainer,c=this.endOffset;CKEDITOR.env.ie&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.rtrim(a.substring(c)),b.test(a)&&this.trim(1,0));this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer, -this.root);c=this.clone();c.collapse(!1);c.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END);a=new CKEDITOR.dom.walker(c);a.evaluator=e();return a.checkForward()},getPreviousNode:function(a,c,b){var d=this.clone();d.collapse(1);d.setStartAt(b||this.root,CKEDITOR.POSITION_AFTER_START);b=new CKEDITOR.dom.walker(d);b.evaluator=a;b.guard=c;return b.previous()},getNextNode:function(a,c,b){var d=this.clone();d.collapse();d.setEndAt(b||this.root,CKEDITOR.POSITION_BEFORE_END);b=new CKEDITOR.dom.walker(d); -b.evaluator=a;b.guard=c;return b.next()},checkReadOnly:function(){function a(a,c){for(;a;){if(a.type==CKEDITOR.NODE_ELEMENT){if("false"==a.getAttribute("contentEditable")&&!a.data("cke-editable"))return 0;if(a.is("html")||"true"==a.getAttribute("contentEditable")&&(a.contains(c)||a.equals(c)))break}a=a.getParent()}return 1}return function(){var c=this.startContainer,b=this.endContainer;return!(a(c,b)&&a(b,c))}}(),moveToElementEditablePosition:function(a,d){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a, -d?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var g=0;a;){if(a.type==CKEDITOR.NODE_TEXT){d&&this.endContainer&&this.checkEndOfBlock()&&b.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,d?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);g=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,d?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),g=1;else if(d&&a.is("br")&&this.endContainer&& -this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var e=a,k=g,f=void 0;e.type==CKEDITOR.NODE_ELEMENT&&e.isEditable(!1)&&(f=e[d?"getLast":"getFirst"](c));k||f||(f=e[d?"getPrevious":"getNext"](c));a=f}return!!g},moveToClosestEditablePosition:function(a,c){var b,d=0,g,e,k=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(b=new CKEDITOR.dom.range(this.root), -b.moveToPosition(a,k[c?0:1])):b=this.clone();if(a&&!a.is(CKEDITOR.dtd.$block))d=1;else if(g=b[c?"getNextEditableNode":"getPreviousEditableNode"]())d=1,(e=g.type==CKEDITOR.NODE_ELEMENT)&&g.is(CKEDITOR.dtd.$block)&&"false"==g.getAttribute("contenteditable")?(b.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),b.setEndAt(g,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&e&&g.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(b.setEnd(g,0),b.collapse()):b.moveToPosition(g,k[c?1:0]);d&&this.moveToRange(b); -return!!d},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),c=CKEDITOR.dom.walker.bookmark(!1,!0),b=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return b(a)&&c(a)};var d=a.next(); -a.reset();return d&&d.equals(a.previous())?d:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=this.endContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:d(),getPreviousEditableNode:d(1),_getTableElement:function(a){a=a||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var c=this.startContainer,b= -this.endContainer,d=c.getAscendant("table",!0),g=b.getAscendant("table",!0);return CKEDITOR.env.safari&&d&&b.equals(this.root)?c.getAscendant(a,!0):this.getEnclosedNode()?this.getEnclosedNode().getAscendant(a,!0):d&&g&&(d.equals(g)||d.contains(g)||g.contains(d))?c.getAscendant(a,!0):null},scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),c,b,d,g=this.clone();g.optimize();(d=g.startContainer.type==CKEDITOR.NODE_TEXT)?(b=g.startContainer.getText(), -c=g.startContainer.split(g.startOffset),a.insertAfter(g.startContainer)):g.insertNode(a);a.scrollIntoView();d&&(g.startContainer.setText(b),c.remove());a.remove()},getClientRects:function(){function a(a,c){var b=CKEDITOR.tools.array.map(a,function(a){return a}),d=new CKEDITOR.dom.range(c.root),g,e,k;c.startContainer instanceof CKEDITOR.dom.element&&(e=0===c.startOffset&&c.startContainer.hasAttribute("data-widget"));c.endContainer instanceof CKEDITOR.dom.element&&(k=(k=c.endOffset===(c.endContainer.getChildCount? -c.endContainer.getChildCount():c.endContainer.length))&&c.endContainer.hasAttribute("data-widget"));e&&d.setStart(c.startContainer.getParent(),c.startContainer.getIndex());k&&d.setEnd(c.endContainer.getParent(),c.endContainer.getIndex()+1);if(e||k)c=d;d=c.cloneContents();d=CKEDITOR.dom.document.prototype.find.call(d,"[data-cke-widget-id]").toArray();if(d=CKEDITOR.tools.array.map(d,function(a){var b=c.root.editor;a=a.getAttribute("data-cke-widget-id");return b.widgets.instances[a].element}))return d= -CKEDITOR.tools.array.map(d,function(a){var c;c=a.getParent().hasClass("cke_widget_wrapper")?a.getParent():a;g=this.root.getDocument().$.createRange();g.setStart(c.getParent().$,c.getIndex());g.setEnd(c.getParent().$,c.getIndex()+1);c=g.getClientRects();c.widgetRect=a.getClientRect();return c},c),CKEDITOR.tools.array.forEach(d,function(a){function c(g){CKEDITOR.tools.array.forEach(b,function(c,e){var k=CKEDITOR.tools.objectCompare(a[g],c);k||(k=CKEDITOR.tools.objectCompare(a.widgetRect,c));k&&(Array.prototype.splice.call(b, -e,a.length-g,a.widgetRect),d=!0)});d||(garguments.length||(this.range=c,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function h(c){var a=[];c.forEach(function(c){if("true"==c.getAttribute("contenteditable"))return a.push(c),!1},CKEDITOR.NODE_ELEMENT,!0);return a}function e(c,a,b,d){a:{null==d&&(d=h(b));for(var g;g=d.shift();)if(g.getDtd().p){d={element:g,remaining:d};break a}d=null}if(!d)return 0;if((g=CKEDITOR.filter.instances[d.element.data("cke-filter")])&& -!g.check(a))return e(c,a,b,d.remaining);a=new CKEDITOR.dom.range(d.element);a.selectNodeContents(d.element);a=a.createIterator();a.enlargeBr=c.enlargeBr;a.enforceRealBlocks=c.enforceRealBlocks;a.activeFilter=a.filter=g;c._.nestedEditable={element:d.element,container:b,remaining:d.remaining,iterator:a};return 1}function k(c,a,b){if(!a)return!1;c=c.clone();c.collapse(!b);return c.checkBoundaryOfElement(a,b?CKEDITOR.START:CKEDITOR.END)}var d=/^[\r\n\t ]+$/,l=CKEDITOR.dom.walker.bookmark(!1,!0),m=CKEDITOR.dom.walker.whitespaces(!0), -b=function(c){return l(c)&&m(c)},g={dd:1,dt:1,li:1};f.prototype={getNextParagraph:function(c){var a,f,h,m,t;c=c||"p";if(this._.nestedEditable){if(a=this._.nestedEditable.iterator.getNextParagraph(c))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,a;this.activeFilter=this.filter;if(e(this,c,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(c);this._.nestedEditable= -null}if(!this.range.root.getDtd()[c])return null;if(!this._.started){var p=this.range.clone();f=p.startPath();var q=p.endPath(),A=!p.collapsed&&k(p,f.block),r=!p.collapsed&&k(p,q.block,1);p.shrink(CKEDITOR.SHRINK_ELEMENT,!0);A&&p.setStartAt(f.block,CKEDITOR.POSITION_BEFORE_END);r&&p.setEndAt(q.block,CKEDITOR.POSITION_AFTER_START);f=p.endContainer.hasAscendant("pre",!0)||p.startContainer.hasAscendant("pre",!0);p.enlarge(this.forceBrBreak&&!f||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS); -p.collapsed||(f=new CKEDITOR.dom.walker(p.clone()),q=CKEDITOR.dom.walker.bookmark(!0,!0),f.evaluator=q,this._.nextNode=f.next(),f=new CKEDITOR.dom.walker(p.clone()),f.evaluator=q,f=f.previous(),this._.lastNode=f.getNextSourceNode(!0,null,p.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(q=this.range.clone(),q.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),q.checkEndOfBlock()&& -(q=new CKEDITOR.dom.elementPath(q.endContainer,q.root),this._.lastNode=(q.block||q.blockLimit).getNextSourceNode(!0))),this._.lastNode&&p.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=p.document.createText(""),this._.lastNode.insertAfter(f)),p=null);this._.started=1;f=p}q=this._.nextNode;p=this._.lastNode;for(this._.nextNode=null;q;){var A=0,r=q.hasAscendant("pre"),C=q.type!=CKEDITOR.NODE_ELEMENT,B=0;if(C)q.type==CKEDITOR.NODE_TEXT&&d.test(q.getText())&&(C=0);else{var u=q.getName(); -if(CKEDITOR.dtd.$block[u]&&"false"==q.getAttribute("contenteditable")){a=q;e(this,c,a);break}else if(q.isBlockBoundary(this.forceBrBreak&&!r&&{br:1})){if("br"==u)C=1;else if(!f&&!q.getChildCount()&&"hr"!=u){a=q;h=q.equals(p);break}f&&(f.setEndAt(q,CKEDITOR.POSITION_BEFORE_START),"br"!=u&&(this._.nextNode=q));A=1}else{if(q.getFirst()){f||(f=this.range.clone(),f.setStartAt(q,CKEDITOR.POSITION_BEFORE_START));q=q.getFirst();continue}C=1}}C&&!f&&(f=this.range.clone(),f.setStartAt(q,CKEDITOR.POSITION_BEFORE_START)); -h=(!A||C)&&q.equals(p);if(f&&!A)for(;!q.getNext(b)&&!h;){u=q.getParent();if(u.isBlockBoundary(this.forceBrBreak&&!r&&{br:1})){A=1;C=0;h||u.equals(p);f.setEndAt(u,CKEDITOR.POSITION_BEFORE_END);break}q=u;C=1;h=q.equals(p);B=1}C&&f.setEndAt(q,CKEDITOR.POSITION_AFTER_END);q=this._getNextSourceNode(q,B,p);if((h=!q)||A&&f)break}if(!a){if(!f)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;a=new CKEDITOR.dom.elementPath(f.startContainer,f.root);q=a.blockLimit;A={div:1,th:1,td:1}; -a=a.block;!a&&q&&!this.enforceRealBlocks&&A[q.getName()]&&f.checkStartOfBlock()&&f.checkEndOfBlock()&&!q.equals(f.root)?a=q:!a||this.enforceRealBlocks&&a.is(g)?(a=this.range.document.createElement(c),f.extractContents().appendTo(a),a.trim(),f.insertNode(a),m=t=!0):"li"!=a.getName()?f.checkStartOfBlock()&&f.checkEndOfBlock()||(a=a.clone(!1),f.extractContents().appendTo(a),a.trim(),t=f.splitBlock(),m=!t.wasStartOfBlock,t=!t.wasEndOfBlock,f.insertNode(a)):h||(this._.nextNode=a.equals(p)?null:this._getNextSourceNode(f.getBoundaryNodes().endNode, -1,p))}m&&(m=a.getPrevious())&&m.type==CKEDITOR.NODE_ELEMENT&&("br"==m.getName()?m.remove():m.getLast()&&"br"==m.getLast().$.nodeName.toLowerCase()&&m.getLast().remove());t&&(m=a.getLast())&&m.type==CKEDITOR.NODE_ELEMENT&&"br"==m.getName()&&(!CKEDITOR.env.needsBrFiller||m.getPrevious(l)||m.getNext(l))&&m.remove();this._.nextNode||(this._.nextNode=h||a.equals(p)||!p?null:this._getNextSourceNode(a,1,p));return a},_getNextSourceNode:function(c,a,b){function d(a){return!(a.equals(b)||a.equals(g))}var g= -this.range.root;for(c=c.getNextSourceNode(a,null,d);!l(c);)c=c.getNextSourceNode(a,null,d);return c}};CKEDITOR.dom.range.prototype.createIterator=function(){return new f(this)}}(),CKEDITOR.command=function(f,h){this.uiItems=[];this.exec=function(e){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return!1;this.editorFocus&&f.focus();return!1===this.fire("exec")?!0:!1!==h.exec.call(this,f,e)};this.refresh=function(e,d){if(!this.readOnly&&e.readOnly)return!0;if(this.context&&!d.isContextFor(this.context)|| -!this.checkAllowed(!0))return this.disable(),!0;this.startDisabled||this.enable();this.modes&&!this.modes[e.mode]&&this.disable();return!1===this.fire("refresh",{editor:e,path:d})?!0:h.refresh&&!1!==h.refresh.apply(this,arguments)};var e;this.checkAllowed=function(k){return k||"boolean"!=typeof e?e=f.activeFilter.checkFeature(this):e};CKEDITOR.tools.extend(this,h,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!h.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)},CKEDITOR.command.prototype= -{enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(f){if(this.state==f||f!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState=this.state;this.state=f;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON): -this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.event.implementOn(CKEDITOR.command.prototype),CKEDITOR.ENTER_P=1,CKEDITOR.ENTER_BR=2,CKEDITOR.ENTER_DIV=3,CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"), -extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]},function(){function f(a,c,b,d,g){var e,f;a=[];for(e in c){f=c[e];f="boolean"==typeof f?{}:"function"==typeof f?{match:f}:E(f);"$"!=e.charAt(0)&&(f.elements=e);b&&(f.featureName=b.toLowerCase());var k=f;k.elements=m(k.elements,/\s+/)||null;k.propertiesOnly=k.propertiesOnly||!0===k.elements;var h=/\s*,\s*/,n=void 0;for(n in L){k[n]=m(k[n], -h)||null;var l=k,q=O[n],u=m(k[O[n]],h),D=k[n],B=[],J=!0,p=void 0;u?J=!1:u={};for(p in D)"!"==p.charAt(0)&&(p=p.slice(1),B.push(p),u[p]=!0,J=!1);for(;p=B.pop();)D[p]=D["!"+p],delete D["!"+p];l[q]=(J?!1:u)||null}k.match=k.match||null;d.push(f);a.push(f)}c=g.elements;g=g.generic;var w;b=0;for(d=a.length;b=--b&&(l&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),a(e))},w=function(a,c){f[a]=1;var b=h[a];delete h[a];for(var d=0;d=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?b.$.onreadystatechange=function(){if("loaded"==b.$.readyState||"complete"==b.$.readyState)b.$.onreadystatechange=null,w(a,!0)}:(b.$.onload=function(){setTimeout(function(){w(a,!0)},0)},b.$.onerror=function(){w(a,!1)}));b.appendTo(CKEDITOR.document.getHead())}}};l&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var t=0;t]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}},function(){var f=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g, -h={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(e){for(var k,d,l=0,m;k=this._.htmlPartsRegex.exec(e);){d=k.index;if(d>l)if(l=e.substring(l,d),m)m.push(l);else this.onText(l);l=this._.htmlPartsRegex.lastIndex;if(d=k[1])if(d=d.toLowerCase(),m&&CKEDITOR.dtd.$cdata[d]&& -(this.onCDATA(m.join("")),m=null),!m){this.onTagClose(d);continue}if(m)m.push(k[0]);else if(d=k[3]){if(d=d.toLowerCase(),!/="/.test(d)){var b={},g,c=k[4];k=!!k[5];if(c)for(;g=f.exec(c);){var a=g[1].toLowerCase();g=g[2]||g[3]||g[4]||"";b[a]=!g&&h[a]?a:CKEDITOR.tools.htmlDecodeAttr(g)}this.onTagOpen(d,b,k);!m&&CKEDITOR.dtd.$cdata[d]&&(m=[])}}else if(d=k[2])this.onComment(d)}if(e.length>l)this.onText(e.substring(l,e.length))}}}(),CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._= -{output:[]}},proto:{openTag:function(f){this._.output.push("\x3c",f)},openTagClose:function(f,h){h?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(f,h){"string"==typeof h&&(h=CKEDITOR.tools.htmlEncodeAttr(h));this._.output.push(" ",f,'\x3d"',h,'"')},closeTag:function(f){this._.output.push("\x3c/",f,"\x3e")},text:function(f){this._.output.push(f)},comment:function(f){this._.output.push("\x3c!--",f,"--\x3e")},write:function(f){this._.output.push(f)},reset:function(){this._.output= -[];this._.indent=!1},getHtml:function(f){var h=this._.output.join("");f&&this.reset();return h}}}),"use strict",function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var f=this.parent.children,h=CKEDITOR.tools.indexOf(f,this),e=this.previous,k=this.next;e&&(e.next=k);k&&(k.previous=e);f.splice(h,1);this.parent=null},replaceWith:function(f){var h=this.parent.children,e=CKEDITOR.tools.indexOf(h,this),k=f.previous=this.previous,d=f.next=this.next;k&&(k.next= -f);d&&(d.previous=f);h[e]=f;f.parent=this.parent;this.parent=null},insertAfter:function(f){var h=f.parent.children,e=CKEDITOR.tools.indexOf(h,f),k=f.next;h.splice(e+1,0,this);this.next=f.next;this.previous=f;f.next=this;k&&(k.previous=this);this.parent=f.parent},insertBefore:function(f){var h=f.parent.children,e=CKEDITOR.tools.indexOf(h,f);h.splice(e,0,this);this.next=f;(this.previous=f.previous)&&(f.previous.next=this);f.previous=this;this.parent=f.parent},getAscendant:function(f){var h="function"== -typeof f?f:"string"==typeof f?function(e){return e.name==f}:function(e){return e.name in f},e=this.parent;for(;e&&e.type==CKEDITOR.NODE_ELEMENT;){if(h(e))return e;e=e.parent}return null},wrapWith:function(f){this.replaceWith(f);f.add(this);return f},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(f){return f||{}}}}(),"use strict",CKEDITOR.htmlParser.comment=function(f){this.value=f;this._={isBlockLike:!1}},CKEDITOR.htmlParser.comment.prototype= -CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(f,h){var e=this.value;if(!(e=f.onComment(h,e,this)))return this.remove(),!1;if("string"!=typeof e)return this.replaceWith(e),!1;this.value=e;return!0},writeHtml:function(f,h){h&&this.filter(h);f.comment(this.value)}}),"use strict",function(){CKEDITOR.htmlParser.text=function(f){this.value=f;this._={isBlockLike:!1}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT, -filter:function(f,h){if(!(this.value=f.onText(h,this.value,this)))return this.remove(),!1},writeHtml:function(f,h){h&&this.filter(h);f.text(this.value)}})}(),"use strict",function(){CKEDITOR.htmlParser.cdata=function(f){this.value=f};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(f){f.write(this.value)}})}(),"use strict",CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null; -this._={isBlockLike:!0,hasInlineStarted:!1}},function(){function f(d){return d.attributes["data-cke-survive"]?!1:"a"==d.name&&d.attributes.href||CKEDITOR.dtd.$removeEmpty[d.name]}var h=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),e={ol:1,ul:1},k=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),d={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"}; -CKEDITOR.htmlParser.fragment.fromHtml=function(l,m,b){function g(a){var b;if(0m;m++)if(h=d[m]){h= -h.exec(e,f,this);if(!1===h)return null;if(h&&h!=f)return this.onNode(e,h);if(f.parent&&!f.name)break}return f},onNode:function(e,f){var d=f.type;return d==CKEDITOR.NODE_ELEMENT?this.onElement(e,f):d==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(e,f.value)):d==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(e,f.value)):null},onAttribute:function(e,f,d,h){return(d=this.attributesRules[d])?d.exec(e,h,f,this):h}}});CKEDITOR.htmlParser.filterRulesGroup=f;f.prototype= -{add:function(e,f,d){this.rules.splice(this.findIndex(f),0,{value:e,priority:f,options:d})},addMany:function(e,f,d){for(var h=[this.findIndex(f),0],m=0,b=e.length;m/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function n(a){return a.replace(L,function(a,c){return decodeURIComponent(c)})}function w(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, -function(a){return"\x3c!--"+A+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function v(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,c){return decodeURIComponent(c)})}function t(a,c){var b=c._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,c){return decodeURIComponent(c)}).replace(/\{cke_protected_(\d+)\}/g,function(a,c){return b&&b[c]||""})}function p(a,c){var b=[],d=c.config.protectedSource,g=c._.dataStore||(c._.dataStore= -{id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,d=[/|$)/gi,//gi,//gi].concat(d);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_tempcomment}"+(b.push(a)-1)+"--\x3e"});for(var f=0;f]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(a,c){g[g.id]=decodeURIComponent(c);return"{cke_protected_"+g.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,b,d,g){return"\x3c"+b+d+"\x3e"+t(v(g),c)+"\x3c/"+b+"\x3e"})}CKEDITOR.htmlDataProcessor=function(b){var d, -g,e=this;this.editor=b;this.dataFilter=d=new CKEDITOR.htmlParser.filter;this.htmlFilter=g=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;d.addRules(u);d.addRules(y,{applyToAll:!0});d.addRules(f(b,"data"),{applyToAll:!0});g.addRules(x);g.addRules(z,{applyToAll:!0});g.addRules(f(b,"html"),{applyToAll:!0});b.on("toHtml",function(d){d=d.data;var g=d.dataValue,e,g=p(g,b),g=a(g,G),g=c(g),g=a(g,H),g=g.replace(O,"$1cke:$2"),g=g.replace(S,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"), -g=g.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),g=g.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");e=d.context||b.editable().getName();var f;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==e&&(e="div",g="\x3cpre\x3e"+g+"\x3c/pre\x3e",f=1);e=b.document.createElement(e);e.setHtml("a"+g);g=e.getHtml().substr(1);g=g.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");f&&(g=g.replace(/^
|<\/pre>$/gi,""));g=g.replace(D,"$1$2");g=n(g);g=v(g);e=!1===d.fixForBody?!1:
-h(d.enterMode,b.config.autoParagraph);g=CKEDITOR.htmlParser.fragment.fromHtml(g,d.context,e);e&&(f=g,!f.children.length&&CKEDITOR.dtd[f.name][e]&&(e=new CKEDITOR.htmlParser.element(e),f.add(e)));d.dataValue=g},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(e.dataFilter,!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var c=a.dataValue,
-b=new CKEDITOR.htmlParser.basicWriter;c.writeChildrenHtml(b);c=b.getHtml(!0);a.dataValue=w(c)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^
/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,h(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(e.htmlFilter,!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue, -!1,!0)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,d=e.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(!0);c=v(c);c=t(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,c,b,d){var g=this.editor,e,f,k,h;c&&"object"==typeof c?(e=c.context,b=c.fixForBody,d=c.dontFilter,f=c.filter,k=c.enterMode,h=c.protectedWhitespaces):e=c;e||null===e||(e=g.editable().getName());return g.fire("toHtml",{dataValue:a,context:e,fixForBody:b,dontFilter:d, -filter:f||g.filter,enterMode:k||g.enterMode,protectedWhitespaces:h}).dataValue},toDataFormat:function(a,c){var b,d,g;c&&(b=c.context,d=c.filter,g=c.enterMode);b||null===b||(b=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,filter:d||this.editor.filter,context:b,enterMode:g||this.editor.enterMode}).dataValue}};var q=/(?: |\xa0)$/,A="{cke_protected}",r=CKEDITOR.dtd,C="caption colgroup col thead tfoot tbody".split(" "),B=CKEDITOR.tools.extend({},r.$blockLimit, -r.$block),u={elements:{input:b,textarea:b}},y={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var c=a.attributes.src.toLowerCase().replace(/[^a-z]/gi,"");if(0===c.indexOf("javascript")||0===c.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},x={elements:{embed:function(a){var c=a.parent;if(c&&"object"==c.name){var b=c.attributes.width,c=c.attributes.height; -b&&(a.attributes.width=b);c&&(a.attributes.height=c)}},a:function(a){var c=a.attributes;if(!(a.children.length||c.name||c.id||a.attributes["data-cke-saved-name"]))return!1}}},z={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var c=a.attributes;if(c){if(c["data-cke-temp"])return!1;for(var b=["name","href","src"],d,g=0;gd?1:-1})},param:function(a){a.children=[];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck; -delete a.attributes.contenteditable},style:function(a){var c=a.children[0];c&&c.value&&(c.value=CKEDITOR.tools.trim(c.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var c=a.children[0];!c&&m(a,c=new CKEDITOR.htmlParser.text);c.value=a.attributes["data-cke-title"]||""},input:g,textarea:g},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(z.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g, -function(a){return a.toLowerCase()})});var I=/<(a|area|img|input|source)\b([^>]*)>/gi,F=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,E=/^(href|src|name)$/i,H=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,G=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,L=/([^<]*)<\/cke:encoded>/gi,O=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,D=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,S=/]*?)\/?>(?!\s*<\/cke:\1)/gi}(), -"use strict",CKEDITOR.htmlParser.element=function(f,h){this.name=f;this.attributes=h||{};this.children=[];var e=f||"",k=e.match(/^cke:(.*)/);k&&(e=k[1]);e=!!(CKEDITOR.dtd.$nonBodyContent[e]||CKEDITOR.dtd.$block[e]||CKEDITOR.dtd.$listItem[e]||CKEDITOR.dtd.$tableContent[e]||CKEDITOR.dtd.$nonEditable[e]||"br"==e);this.isEmpty=!!CKEDITOR.dtd.$empty[f];this.isUnknown=!CKEDITOR.dtd[f];this._={isBlockLike:e,hasInlineStarted:this.isEmpty||!e}},CKEDITOR.htmlParser.cssStyle=function(f){var h={};((f instanceof -CKEDITOR.htmlParser.element?f.attributes.style:f)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,f,d){"font-family"==f&&(d=d.replace(/["']/g,""));h[f.toLowerCase()]=d});return{rules:h,populate:function(e){var f=this.toString();f&&(e instanceof CKEDITOR.dom.element?e.setAttribute("style",f):e instanceof CKEDITOR.htmlParser.element?e.attributes.style=f:e.style=f)},toString:function(){var e=[],f;for(f in h)h[f]&&e.push(f,":",h[f],";");return e.join("")}}},function(){function f(e){return function(d){return d.type== -CKEDITOR.NODE_ELEMENT&&("string"==typeof e?d.name==e:d.name in e)}}var h=function(e,d){e=e[0];d=d[0];return ed?1:0},e=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:e.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(e,d){var f=this,h,b;d=f.getFilterContext(d);if(d.off)return!0;if(!f.parent)e.onRoot(d,f);for(;;){h=f.name;if(!(b= -e.onElementName(d,h)))return this.remove(),!1;f.name=b;if(!(f=e.onElement(d,f)))return this.remove(),!1;if(f!==this)return this.replaceWith(f),!1;if(f.name==h)break;if(f.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(f),!1;if(!f.name)return this.replaceWithChildren(),!1}h=f.attributes;var g,c;for(g in h){for(b=h[g];;)if(c=e.onAttributeName(d,g))if(c!=g)delete h[g],g=c;else break;else{delete h[g];break}c&&(!1===(b=e.onAttribute(d,f,c,b))?delete h[c]:h[c]=b)}f.isEmpty||this.filterChildren(e,!1, -d);return!0},filterChildren:e.filterChildren,writeHtml:function(e,d){d&&this.filter(d);var f=this.name,m=[],b=this.attributes,g,c;e.openTag(f,b);for(g in b)m.push([g,b[g]]);e.sortAttributes&&m.sort(h);g=0;for(c=m.length;gCKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),c());else if(this.hasFocus)this.focus(),a();else this.once("focus",function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document); -a={doc:this.getDocument(),range:a.clone()};r.eol.detect(a,this);r.bogus.exclude(a);r.cell.shrink(a);a.fragment=a.range.cloneContents();r.tree.rebuild(a,this);r.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,c){var b=C,d={range:a,doc:a.document},g=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),g;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var e=this.editor.createRange(); -e.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=e.createBookmark();b.list.detectMerge(d,this);b.table.detectRanges(d,this);b.block.detectMerge(d,this);d.tableContentsRanges?(b.table.deleteRanges(d),a.moveToBookmark(d.bookmark),d.range=a):(a.moveToBookmark(d.bookmark),d.range=a,a.extractContents(b.detectExtractMerge(d)));a.moveToBookmark(d.targetBookmark);a.optimize();b.fixUneditableRangePosition(a);b.list.merge(d,this);b.table.purge(d,this);b.block.merge(d,this); -if(c){b=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&b.block&&!a.root.equals(b.block)){a:{var d=b.block.getElementsByTag("span"),e=0,f;if(d)for(;f=d.getItem(e++);)if(!n(f)){d=!0;break a}d=!1}d=!d}d&&(a.moveToPosition(b.block,CKEDITOR.POSITION_BEFORE_START),b.block.remove())}else b.autoParagraph(this.editor,a),w(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings();return g},setup:function(){var b=this.editor;this.attachListener(b,"beforeGetData",function(){var a= -this.getData();this.is("textarea")||!1!==b.config.ignoreEmptyParagraph&&(a=a.replace(t,function(a,c){return c}));b.setData(a,null,1)},this);this.attachListener(b,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(b,"afterSetData",function(){this.setData(b.getData(1))},this);this.attachListener(b,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(b,"beforeFocus",function(){var a=b.getSelection();(a=a&&a.getNative())&&"Control"==a.type||this.focus()}, +(function(){window.CKEDITOR&&window.CKEDITOR.dom||(window.CKEDITOR||(window.CKEDITOR=function(){var e=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,f={timestamp:"J24I",version:"4.11.3",revision:"8b53603e8",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:e},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var c=document.getElementsByTagName("script"),h=0;ha.getListenerIndex(b)){a=a.listeners;f||(f=this);isNaN(d)&&(d=10);var n=this;g.fn=b;g.priority=d;for(var w=a.length-1;0<=w;w--)if(a[w].priority<=d)return a.splice(w+1,0,g),{removeListener:m};a.unshift(g)}return{removeListener:m}},once:function(){var c=Array.prototype.slice.call(arguments),b=c[1];c[1]=function(c){c.removeListener();return b.apply(this, +arguments)};return this.on.apply(this,c)},capture:function(){CKEDITOR.event.useCapture=1;var c=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return c},fire:function(){var c=0,b=function(){c=1},e=0,k=function(){e=1};return function(d,g,m){var a=f(this)[d];d=c;var n=e;c=e=0;if(a){var w=a.listeners;if(w.length)for(var w=w.slice(0),u,t=0;tdocument.documentMode),mobile:-1h||c.quirks);c.gecko&&(f=e.match(/rv:([\d\.]+)/))&&(f=f[1].split("."),h=1E4*f[0]+100*(f[1]||0)+1*(f[2]||0));c.air&&(h=parseFloat(e.match(/ adobeair\/(\d+)/)[1]));c.webkit&&(h=parseFloat(e.match(/ applewebkit\/(\d+)/)[1]));c.version=h;c.isCompatible=!(c.ie&&7>h)&&!(c.gecko&&4E4>h)&&!(c.webkit&& +534>h);c.hidpi=2<=window.devicePixelRatio;c.needsBrFiller=c.gecko||c.webkit||c.ie&&10h;c.cssClass="cke_browser_"+(c.ie?"ie":c.gecko?"gecko":c.webkit?"webkit":"unknown");c.quirks&&(c.cssClass+=" cke_browser_quirks");c.ie&&(c.cssClass+=" cke_browser_ie"+(c.quirks?"6 cke_browser_iequirks":c.version));c.air&&(c.cssClass+=" cke_browser_air");c.iOS&&(c.cssClass+=" cke_browser_ios");c.hidpi&&(c.cssClass+=" cke_hidpi");return c}()),"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR); +CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var e=document.createElement("script");e.type="text/javascript";e.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(e)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(e){(this._.pending||(this._.pending=[])).push(e)};(function(){CKEDITOR.domReady(function(){var e=CKEDITOR.loadFullCore,f=CKEDITOR.loadFullCoreTimeout;e&&(CKEDITOR.status= +"basic_ready",e&&e._load?e():f&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*f))})})();CKEDITOR.status="basic_loaded"}(),"use strict",CKEDITOR.VERBOSITY_WARN=1,CKEDITOR.VERBOSITY_ERROR=2,CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR,CKEDITOR.warn=function(e,f){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:e,additionalData:f})},CKEDITOR.error=function(e,f){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log", +{type:"error",errorCode:e,additionalData:f})},CKEDITOR.on("log",function(e){if(window.console&&window.console.log){var f=console[e.data.type]?e.data.type:"log",c=e.data.errorCode;if(e=e.data.additionalData)console[f]("[CKEDITOR] Error code: "+c+".",e);else console[f]("[CKEDITOR] Error code: "+c+".");console[f]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+c)}},null,null,999),CKEDITOR.dom={},function(){function e(a,d,g){this._minInterval= +a;this._context=g;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(d,g||{});var b=this;this.input=function(){function a(){b._lastOutput=(new Date).getTime();b._scheduledTimer=0;b._call()}if(!b._scheduledTimer||!1!==b._reschedule()){var n=(new Date).getTime()-b._lastOutput;n/g,k=/|\s) /g, +function(a,n){return n+"\x26nbsp;"}).replace(/ (?=<)/g,"\x26nbsp;")},getNextNumber:function(){var a=0;return function(){return++a}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var a="e",d=0;8>d;d++)a+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return a},override:function(a,d){var g=d(a);g.prototype=a.prototype;return g},setTimeout:function(a,d,g,b,c){c||(c=window);g||(g=c);return c.setTimeout(function(){b?a.apply(g,[].concat(b)):a.apply(g)}, +d||0)},throttle:function(a,d,g){return new this.buffers.throttle(a,d,g)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(d){return d.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(d){return d.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(d){return d.replace(a,"")}}(),indexOf:function(a,d){if("function"==typeof d)for(var g=0,b=a.length;gparseFloat(d);g&&(d=d.replace("-",""));a.setStyle("width",d);d=a.$.clientWidth;return g?-d:d}return d}}(),repeat:function(a,d){return Array(d+ +1).join(a)},tryThese:function(){for(var a,d=0,g=arguments.length;dd;d++)a[d]=("0"+parseInt(a[d],10).toString(16)).slice(-2);return"#"+a.join("")})},normalizeHex:function(a){return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(a,d,g,n){a=d.toLowerCase();3==a.length&&(a=a.split(""),a=[a[0],a[0],a[1],a[1],a[2],a[2]].join(""));return"#"+a+n})},parseCssText:function(a,d,g){var b={};g&&(a=(new CKEDITOR.dom.element("span")).setAttribute("style",a).getAttribute("style")||"");a&&(a=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a))); +if(!a||";"==a)return b;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,g,n){d&&(g=g.toLowerCase(),"font-family"==g&&(n=n.replace(/\s*,\s*/g,",")),n=CKEDITOR.tools.trim(n));b[g]=n});return b},writeCssText:function(a,d){var g,b=[];for(g in a)b.push(g+":"+a[g]);d&&b.sort();return b.join("; ")},objectCompare:function(a,d,g){var b;if(!a&&!d)return!0;if(!a||!d)return!1;for(b in a)if(a[b]!=d[b])return!1;if(!g)for(b in d)if(a[b]!=d[b])return!1;return!0},objectKeys:function(a){var d= +[],g;for(g in a)d.push(g);return d},convertArrayToObject:function(a,d){var g={};1==arguments.length&&(d=!0);for(var b=0,c=a.length;bg;g++)a.push(Math.floor(256*Math.random())); +for(g=0;gCKEDITOR.env.version||CKEDITOR.env.ie6Compat)?4===a.button?CKEDITOR.MOUSE_BUTTON_MIDDLE:1===a.button? +CKEDITOR.MOUSE_BUTTON_LEFT:CKEDITOR.MOUSE_BUTTON_RIGHT:a.button:!1},convertHexStringToBytes:function(a){var d=[],g=a.length/2,b;for(b=0;be)for(h=e;3>h;h++)c[h]=0;m[0]=(c[0]&252)>>2;m[1]=(c[0]&3)<<4|c[1]>>4;m[2]=(c[1]&15)<<2|(c[2]&192)>>6;m[3]=c[2]&63;for(h=0;4>h;h++)d=h<=e?d+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m[h]): +d+"\x3d"}return d},style:{parse:{_colors:{aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9", +darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF", +gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1", +lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA", +mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072", +sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "), +_widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(a){var d={},g=this._findColor(a);g.length&&(d.color=g[0],CKEDITOR.tools.array.forEach(g,function(d){a=a.replace(d,"")}));if(a=CKEDITOR.tools.trim(a))d.unprocessed=a;return d},margin:function(a){function d(a){g.top=b[a[0]];g.right= +b[a[1]];g.bottom=b[a[2]];g.left=b[a[3]]}var g={},b=a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset)/g)||["0px"];switch(b.length){case 1:d([0,0,0,0]);break;case 2:d([0,1,0,1]);break;case 3:d([0,1,2,1]);break;case 4:d([0,1,2,3])}return g},border:function(a){var d={},g=a.split(/\s+/g);a=CKEDITOR.tools.style.parse._findColor(a);a.length&&(d.color=a[0]);CKEDITOR.tools.array.forEach(g,function(a){d.style||-1===CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle,a)?!d.width&&CKEDITOR.tools.style.parse._widthRegExp.test(a)&& +(d.width=a):d.style=a});return d},_findColor:function(a){var d=[],g=CKEDITOR.tools.array,d=d.concat(a.match(this._rgbaRegExp)||[]),d=d.concat(a.match(this._hslaRegExp)||[]);return d=d.concat(g.filter(a.split(/\s+/),function(a){return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:a.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(a,d,g){var b=[];this.forEach(a,function(c,e){d.call(g,c,e,a)&&b.push(c)});return b},forEach:function(a,d,g){var b=a.length,c;for(c=0;cCKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type== +CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&h(b);return b},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(e){e.$.parentNode.insertBefore(this.$,e.$.nextSibling);return e},insertBefore:function(e){e.$.parentNode.insertBefore(this.$,e.$);return e},insertBeforeMe:function(e){this.$.parentNode.insertBefore(e.$,this.$);return e},getAddress:function(e){for(var f=[],c=this.getDocument().$.documentElement,h=this.$;h&&h!=c;){var b=h.parentNode; +b&&f.unshift(this.getIndex.call({$:h},e));h=b}return f},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(e){function f(b,d){var g=d?b.nextSibling:b.previousSibling;return g&&g.nodeType==CKEDITOR.NODE_TEXT?c(g)?f(g,d):g:null}function c(b){return!b.nodeValue||b.nodeValue==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE}var h=this.$,b=-1,l;if(!this.$.parentNode||e&&h.nodeType==CKEDITOR.NODE_TEXT&&c(h)&&!f(h)&&!f(h,!0))return-1; +do e&&h!=this.$&&h.nodeType==CKEDITOR.NODE_TEXT&&(l||c(h))||(b++,l=h.nodeType==CKEDITOR.NODE_TEXT);while(h=h.previousSibling);return b},getNextSourceNode:function(e,f,c){if(c&&!c.call){var h=c;c=function(b){return!b.equals(h)}}e=!e&&this.getFirst&&this.getFirst();var b;if(!e){if(this.type==CKEDITOR.NODE_ELEMENT&&c&&!1===c(this,!0))return null;e=this.getNext()}for(;!e&&(b=(b||this).getParent());){if(c&&!1===c(b,!0))return null;e=b.getNext()}return!e||c&&!1===c(e)?null:f&&f!=e.type?e.getNextSourceNode(!1, +f,c):e},getPreviousSourceNode:function(e,f,c){if(c&&!c.call){var h=c;c=function(b){return!b.equals(h)}}e=!e&&this.getLast&&this.getLast();var b;if(!e){if(this.type==CKEDITOR.NODE_ELEMENT&&c&&!1===c(this,!0))return null;e=this.getPrevious()}for(;!e&&(b=(b||this).getParent());){if(c&&!1===c(b,!0))return null;e=b.getPrevious()}return!e||c&&!1===c(e)?null:f&&e.type!=f?e.getPreviousSourceNode(!1,f,c):e},getPrevious:function(e){var f=this.$,c;do c=(f=f.previousSibling)&&10!=f.nodeType&&new CKEDITOR.dom.node(f); +while(c&&e&&!e(c));return c},getNext:function(e){var f=this.$,c;do c=(f=f.nextSibling)&&new CKEDITOR.dom.node(f);while(c&&e&&!e(c));return c},getParent:function(e){var f=this.$.parentNode;return f&&(f.nodeType==CKEDITOR.NODE_ELEMENT||e&&f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(f):null},getParents:function(e){var f=this,c=[];do c[e?"push":"unshift"](f);while(f=f.getParent());return c},getCommonAncestor:function(e){if(e.equals(this))return this;if(e.contains&&e.contains(this))return e; +var f=this.contains?this:this.getParent();do if(f.contains(e))return f;while(f=f.getParent());return null},getPosition:function(e){var f=this.$,c=e.$;if(f.compareDocumentPosition)return f.compareDocumentPosition(c);if(f==c)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&e.type==CKEDITOR.NODE_ELEMENT){if(f.contains){if(f.contains(c))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(c.contains(f))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in +f)return 0>f.sourceIndex||0>c.sourceIndex?CKEDITOR.POSITION_DISCONNECTED:f.sourceIndex=document.documentMode||!f||(e=f+":"+ +e);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(e))},getHead:function(){var e=this.$.getElementsByTagName("head")[0];return e=e?new CKEDITOR.dom.element(e):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(e){this.$.open("text/html", +"replace");CKEDITOR.env.ie&&(e=e.replace(/(?:^\s*]*?>)|^/i,'$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e('+CKEDITOR.tools.fixDomain+")();\x3c/script\x3e"));this.$.write(e);this.$.close()},find:function(e){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(e))},findOne:function(e){return(e=this.$.querySelector(e))?new CKEDITOR.dom.element(e):null},_getHtml5ShivFrag:function(){var e=this.getCustomData("html5ShivFrag");e||(e=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(e, +!0),this.setCustomData("html5ShivFrag",e));return e}}),CKEDITOR.dom.nodeList=function(e){this.$=e},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(e){return 0>e||e>=this.$.length?null:(e=this.$[e])?new CKEDITOR.dom.node(e):null},toArray:function(){return CKEDITOR.tools.array.map(this.$,function(e){return new CKEDITOR.dom.node(e)})}},CKEDITOR.dom.element=function(e,f){"string"==typeof e&&(e=(f?f.$:document).createElement(e));CKEDITOR.dom.domObject.call(this, +e)},CKEDITOR.dom.element.get=function(e){return(e="string"==typeof e?document.getElementById(e)||document.getElementsByName(e)[0]:e)&&(e.$?e:new CKEDITOR.dom.element(e))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(e,f){var c=new CKEDITOR.dom.element("div",f);c.setHtml(e);return c.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(e,f,c,h){var b=f.getCustomData("list_marker_id")||f.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"), +l=f.getCustomData("list_marker_names")||f.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");e[b]=f;l[c]=1;return f.setCustomData(c,h)},CKEDITOR.dom.element.clearAllMarkers=function(e){for(var f in e)CKEDITOR.dom.element.clearMarkers(e,e[f],1)},CKEDITOR.dom.element.clearMarkers=function(e,f,c){var h=f.getCustomData("list_marker_names"),b=f.getCustomData("list_marker_id"),l;for(l in h)f.removeCustomData(l);f.removeCustomData("list_marker_names");c&&(f.removeCustomData("list_marker_id"), +delete e[b])},function(){function e(d,g){return-1<(" "+d+" ").replace(l," ").indexOf(" "+g+" ")}function f(d){var g=!0;d.$.id||(d.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),g=!1);return function(){g||d.removeAttribute("id")}}function c(d,g){var b=CKEDITOR.tools.escapeCss(d.$.id);return"#"+b+" "+g.split(/,\s*/).join(", #"+b+" ")}function h(d){for(var g=0,b=0,a=k[d].length;bCKEDITOR.env.version?this.$.text+=d:this.append(new CKEDITOR.dom.text(d))},appendBogus:function(d){if(d||CKEDITOR.env.needsBrFiller){for(d=this.getLast();d&&d.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(d.getText());)d=d.getPrevious();d&&d.is&&d.is("br")||(d=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&d.setAttribute("type","_moz"),this.append(d))}},breakParent:function(d,g){var b=new CKEDITOR.dom.range(this.getDocument());b.setStartAfter(this);b.setEndAfter(d); +var a=b.extractContents(!1,g||!1),c;b.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(b=new CKEDITOR.dom.element("div");c=a.getFirst();)c.$.style.backgroundColor&&(c.$.style.backgroundColor=c.$.style.backgroundColor),b.append(c);b.insertAfter(this);b.remove(!0)}else a.insertAfterNode(this)},contains:document.compareDocumentPosition?function(d){return!!(this.$.compareDocumentPosition(d.$)&16)}:function(d){var g=this.$;return d.type!=CKEDITOR.NODE_ELEMENT?g.contains(d.getParent().$): +g!=d.$&&g.contains(d.$)},focus:function(){function d(){try{this.$.focus()}catch(d){}}return function(g){g?CKEDITOR.tools.setTimeout(d,100,this):d.call(this)}}(),getHtml:function(){var d=this.$.innerHTML;return CKEDITOR.env.ie?d.replace(/<\?[^>]*>/g,""):d},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var d=this.$.ownerDocument.createElement("div");d.appendChild(this.$.cloneNode(!0));return d.innerHTML},getClientRect:function(d){var g=CKEDITOR.tools.extend({}, +this.$.getBoundingClientRect());!g.width&&(g.width=g.right-g.left);!g.height&&(g.height=g.bottom-g.top);return d?CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(),g):g},setHtml:CKEDITOR.env.ie&&9>CKEDITOR.env.version?function(d){try{var g=this.$;if(this.getParent())return g.innerHTML=d;var b=this.getDocument()._getHtml5ShivFrag();b.appendChild(g);g.innerHTML=d;b.removeChild(g);return d}catch(a){this.$.innerHTML="";g=new CKEDITOR.dom.element("body",this.getDocument());g.$.innerHTML=d;for(g=g.getChildren();g.count();)this.append(g.getItem(0)); +return d}}:function(d){return this.$.innerHTML=d},setText:function(){var d=document.createElement("p");d.innerHTML="x";d=d.textContent;return function(g){this.$[d?"textContent":"innerText"]=g}}(),getAttribute:function(){var d=function(d){return this.$.getAttribute(d,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(d){switch(d){case "class":d="className";break;case "http-equiv":d="httpEquiv";break;case "name":return this.$.name;case "tabindex":return d=this.$.getAttribute(d, +2),0!==d&&0===this.$.tabIndex&&(d=null),d;case "checked":return d=this.$.attributes.getNamedItem(d),(d.specified?d.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[d];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(d,2)}:d}(),getAttributes:function(d){var g={},b=this.$.attributes,a;d=CKEDITOR.tools.isArray(d)? +d:[];for(a=0;a=document.documentMode){var g=this.$.scopeName;"HTML"!=g&&(d=g.toLowerCase()+":"+d)}this.getName=function(){return d};return this.getName()},getValue:function(){return this.$.value},getFirst:function(d){var g=this.$.firstChild;(g=g&&new CKEDITOR.dom.node(g))&&d&&!d(g)&&(g=g.getNext(d));return g},getLast:function(d){var g=this.$.lastChild;(g=g&&new CKEDITOR.dom.node(g))&&d&&!d(g)&&(g=g.getPrevious(d));return g},getStyle:function(d){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(d)]}, +is:function(){var d=this.getName();if("object"==typeof arguments[0])return!!arguments[0][d];for(var g=0;gCKEDITOR.env.version&&this.is("a")){var b=this.getParent();b.type==CKEDITOR.NODE_ELEMENT&&(b=b.clone(),b.setHtml(g),g=b.getHtml(),b.setHtml(d),d=b.getHtml())}return g==d},isVisible:function(){var d=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),g,b;d&&CKEDITOR.env.webkit&&(g=this.getWindow(),!g.equals(CKEDITOR.document.getWindow())&&(b=g.$.frameElement)&&(d=(new CKEDITOR.dom.element(b)).isVisible()));return!!d},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1; +for(var d=this.getChildren(),g=0,b=d.count();gCKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:d.call(this,b)}:d:function(d){return!!this.$.attributes.getNamedItem(d)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(d,b){var c=this.$;d=d.$;if(c!=d){var a;if(b)for(;a=c.lastChild;)d.insertBefore(c.removeChild(a),d.firstChild);else for(;a=c.firstChild;)d.appendChild(c.removeChild(a))}},mergeSiblings:function(){function d(d,b,a){if(b&&b.type==CKEDITOR.NODE_ELEMENT){for(var c= +[];b.data("cke-bookmark")||b.isEmptyInlineRemoveable();)if(c.push(b),b=a?b.getNext():b.getPrevious(),!b||b.type!=CKEDITOR.NODE_ELEMENT)return;if(d.isIdentical(b)){for(var e=a?d.getLast():d.getFirst();c.length;)c.shift().move(d,!a);b.moveChildren(d,!a);b.remove();e&&e.type==CKEDITOR.NODE_ELEMENT&&e.mergeSiblings()}}}return function(b){if(!1===b||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))d(this,this.getNext(),!0),d(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"", +visibility:""})},setAttribute:function(){var d=function(d,b){this.$.setAttribute(d,b);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b,c){"class"==b?this.$.className=c:"style"==b?this.$.style.cssText=c:"tabindex"==b?this.$.tabIndex=c:"checked"==b?this.$.checked=c:"contenteditable"==b?d.call(this,"contentEditable",c):d.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,c){if("src"==b&&c.match(/^http:\/\//))try{d.apply(this, +arguments)}catch(a){}else d.apply(this,arguments);return this}:d}(),setAttributes:function(d){for(var b in d)this.setAttribute(b,d[b]);return this},setValue:function(d){this.$.value=d;return this},removeAttribute:function(){var d=function(d){this.$.removeAttribute(d)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(d){"class"==d?d="className":"tabindex"==d?d="tabIndex":"contenteditable"==d&&(d="contentEditable");this.$.removeAttribute(d)}:d}(),removeAttributes:function(d){if(CKEDITOR.tools.isArray(d))for(var b= +0;bCKEDITOR.env.version?(d=Math.round(100*d),this.setStyle("filter",100<=d?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+d+")")):this.setStyle("opacity",d)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", +"none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var d,b=this.getElementsByTag("*"),c=0,a=b.count();cf||0f?f:e);c&&(0>h||0h?h:a,0)},setState:function(d,b,c){b=b||"cke";switch(d){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+ +"_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",!0);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");c&&this.setAttribute("aria-disabled",!0);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off"),this.removeClass(b+"_on"),this.removeClass(b+"_disabled"),c&&this.removeAttribute("aria-pressed"),c&&this.removeAttribute("aria-disabled")}}, +getFrameDocument:function(){var b=this.$;try{b.contentWindow.document}catch(c){b.src=b.src}return b&&new CKEDITOR.dom.document(b.contentWindow.document)},copyAttributes:function(b,c){var e=this.$.attributes;c=c||{};for(var a=0;a=A.getChildCount()?(A=A.getChild(z-1),E=!0):A=A.getChild(z):F=E=!0;k.type== +CKEDITOR.NODE_TEXT?x?G=!0:k.split(D):0Z)for(;Y;)Y=e(Y,K,!0);K=V}x||m()}}function c(){var a=!1,b=CKEDITOR.dom.walker.whitespaces(),d=CKEDITOR.dom.walker.bookmark(!0),c=CKEDITOR.dom.walker.bogus();return function(g){return d(g)||b(g)?!0:c(g)&&!a?a=!0:g.type==CKEDITOR.NODE_TEXT&&(g.hasAscendant("pre")||CKEDITOR.tools.trim(g.getText()).length)||g.type==CKEDITOR.NODE_ELEMENT&&!g.is(l)?!1:!0}}function h(a){var b=CKEDITOR.dom.walker.whitespaces(), +d=CKEDITOR.dom.walker.bookmark(1);return function(c){return d(c)||b(c)?!0:!a&&k(c)||c.type==CKEDITOR.NODE_ELEMENT&&c.is(CKEDITOR.dtd.$removeEmpty)}}function b(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&m(a)&&(b=a);return g(a)&&!(k(a)&&a.equals(b))})}}var l={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},k=CKEDITOR.dom.walker.bogus(), +d=/^[\t\r\n ]*(?: |\xa0)$/,g=CKEDITOR.dom.walker.editable(),m=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var a=new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){a?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer), +this.startOffset=this.endOffset);this.collapsed=!0},cloneContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||f(this,2,b,!1,"undefined"==typeof a?!0:a);return b},deleteContents:function(a){this.collapsed||f(this,0,null,a)},extractContents:function(a,b){var d=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||f(this,1,d,a,"undefined"==typeof b?!0:b);return d},createBookmark:function(a){var b,d,c,g,e=this.collapsed;b=this.document.createElement("span"); +b.data("cke-bookmark",1);b.setStyle("display","none");b.setHtml("\x26nbsp;");a&&(c="cke_bm_"+CKEDITOR.tools.getNextNumber(),b.setAttribute("id",c+(e?"C":"S")));e||(d=b.clone(),d.setHtml("\x26nbsp;"),a&&d.setAttribute("id",c+"E"),g=this.clone(),g.collapse(),g.insertNode(d));g=this.clone();g.collapse(!0);g.insertNode(b);d?(this.setStartAfter(b),this.setEndBefore(d)):this.moveToPosition(b,CKEDITOR.POSITION_AFTER_END);return{startNode:a?c+(e?"C":"S"):b,endNode:a?c+"E":d,serializable:a,collapsed:e}},createBookmark2:function(){function a(a){var b= +a.container,c=a.offset,g;g=b;var e=c;g=g.type!=CKEDITOR.NODE_ELEMENT||0===e||e==g.getChildCount()?0:g.getChild(e-1).type==CKEDITOR.NODE_TEXT&&g.getChild(e).type==CKEDITOR.NODE_TEXT;g&&(b=b.getChild(c-1),c=b.getLength());if(b.type==CKEDITOR.NODE_ELEMENT&&0=a.offset&&(a.offset=g.getIndex(),a.container=g.getParent()))}}var d=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(d){var c=this.collapsed,g={container:this.startContainer, +offset:this.startOffset},e={container:this.endContainer,offset:this.endOffset};d&&(a(g),b(g,this.root),c||(a(e),b(e,this.root)));return{start:g.container.getAddress(d),end:c?null:e.container.getAddress(d),startOffset:g.offset,endOffset:e.offset,normalized:d,collapsed:c,is2:!0}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),d=a.startOffset,c=a.end&&this.document.getByAddress(a.end,a.normalized);a=a.endOffset;this.setStart(b,d);c?this.setEnd(c,a):this.collapse(!0)}else b= +(d=a.serializable)?this.document.getById(a.startNode):a.startNode,a=d?this.document.getById(a.endNode):a.endNode,this.setStartBefore(b),b.remove(),a?(this.setEndBefore(a),a.remove()):this.collapse(!0)},getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,d=this.startOffset,c=this.endOffset,g;if(a.type==CKEDITOR.NODE_ELEMENT)if(g=a.getChildCount(),g>d)a=a.getChild(d);else if(1>g)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a= +a.getNextSourceNode()||a}if(b.type==CKEDITOR.NODE_ELEMENT)if(g=b.getChildCount(),g>c)b=b.getChild(c).getPreviousSourceNode(!0);else if(1>g)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=b.lastChild;b=new CKEDITOR.dom.node(b)}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var d=this.startContainer,c=this.endContainer,d=d.equals(c)?a&&d.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?d.getChild(this.startOffset): +d:d.getCommonAncestor(c);return b&&!d.is?d.getParent():d},optimize:function(){var a=this.startContainer,b=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&a.is("span")&&a.data("cke-bookmark")&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START); +b&&b.is&&b.is("span")&&b.data("cke-bookmark")&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,b){var d=this.startContainer,c=this.startOffset,g=this.collapsed;if((!a||g)&&d&&d.type==CKEDITOR.NODE_TEXT){if(c)if(c>=d.getLength())c=d.getIndex()+1,d=d.getParent();else{var e=d.split(c),c=d.getIndex()+1,d=d.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(e,this.endOffset-this.startOffset):d.equals(this.endContainer)&&(this.endOffset+=1)}else c=d.getIndex(),d=d.getParent(); +this.setStart(d,c);if(g){this.collapse(!0);return}}d=this.endContainer;c=this.endOffset;b||g||!d||d.type!=CKEDITOR.NODE_TEXT||(c?(c>=d.getLength()||d.split(c),c=d.getIndex()+1):c=d.getIndex(),d=d.getParent(),this.setEnd(d,c))},enlarge:function(a,b){function d(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var c=new RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var g=1;case CKEDITOR.ENLARGE_ELEMENT:var e=function(a,b){var d=new CKEDITOR.dom.range(m); +d.setStart(a,b);d.setEndAt(m,CKEDITOR.POSITION_BEFORE_END);var d=new CKEDITOR.dom.walker(d),g;for(d.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=d.next();){if(g.type!=CKEDITOR.NODE_TEXT)return!1;J=g!=a?g.getText():g.substring(b);if(c.test(J))return!1}return!0};if(this.collapsed)break;var h=this.getCommonAncestor(),m=this.root,f,l,k,y,A,D=!1,z,J;z=this.startContainer;var E=this.startOffset;z.type==CKEDITOR.NODE_TEXT?(E&&(z=!CKEDITOR.tools.trim(z.substring(0,E)).length&& +z,D=!!z),z&&((y=z.getPrevious())||(k=z.getParent()))):(E&&(y=z.getChild(E-1)||z.getLast()),y||(k=z));for(k=d(k);k||y;){if(k&&!y){!A&&k.equals(h)&&(A=!0);if(g?k.isBlockBoundary():!m.contains(k))break;D&&"inline"==k.getComputedStyle("display")||(D=!1,A?f=k:this.setStartBefore(k));y=k.getPrevious()}for(;y;)if(z=!1,y.type==CKEDITOR.NODE_COMMENT)y=y.getPrevious();else{if(y.type==CKEDITOR.NODE_TEXT)J=y.getText(),c.test(J)&&(y=null),z=/[\s\ufeff]$/.test(J);else if((y.$.offsetWidth>(CKEDITOR.env.webkit?1: +0)||b&&y.is("br"))&&!y.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[y.getName()]){J=y.getText();if(c.test(J))y=null;else for(var E=y.$.getElementsByTagName("*"),H=0,F;F=E[H++];)if(!CKEDITOR.dtd.$removeEmpty[F.nodeName.toLowerCase()]){y=null;break}y&&(z=!!J.length)}else y=null;z&&(D?A?f=k:k&&this.setStartBefore(k):D=!0);if(y){z=y.getPrevious();if(!k&&!z){k=y;y=null;break}y=z}else k=null}k&&(k=d(k.getParent()))}z=this.endContainer;E=this.endOffset;k=y=null;A=D=!1;z.type==CKEDITOR.NODE_TEXT? +CKEDITOR.tools.trim(z.substring(E)).length?D=!0:(D=!z.getLength(),E==z.getLength()?(y=z.getNext())||(k=z.getParent()):e(z,E)&&(k=z.getParent())):(y=z.getChild(E))||(k=z);for(;k||y;){if(k&&!y){!A&&k.equals(h)&&(A=!0);if(g?k.isBlockBoundary():!m.contains(k))break;D&&"inline"==k.getComputedStyle("display")||(D=!1,A?l=k:k&&this.setEndAfter(k));y=k.getNext()}for(;y;){z=!1;if(y.type==CKEDITOR.NODE_TEXT)J=y.getText(),e(y,0)||(y=null),z=/^[\s\ufeff]/.test(J);else if(y.type==CKEDITOR.NODE_ELEMENT){if((0=h.getLength()?e.setStartAfter(h):(e.setStartBefore(h),d=0):e.setStartBefore(h));m&&m.type==CKEDITOR.NODE_TEXT&&(k?k>=m.getLength()?e.setEndAfter(m):(e.setEndAfter(m),l=0):e.setEndBefore(m));var e=new CKEDITOR.dom.walker(e),y=CKEDITOR.dom.walker.bookmark(),A=CKEDITOR.dom.walker.bogus();e.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)}; +var D;e.guard=function(b,d){if(g&&A(b)||y(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||d&&b.equals(D)||!1===c&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return!1;d||b.type!=CKEDITOR.NODE_ELEMENT||(D=b);return!0};d&&(h=e[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(h,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);l&&(e.reset(),(e=e[a==CKEDITOR.SHRINK_ELEMENT? +"lastBackward":"previous"]())&&this.setEndAt(e,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));return!(!d&&!l)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var b=this.startContainer,d=b.getChild(this.startOffset);d?a.insertBefore(d):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(!0)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset); +this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(a,b){a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]&&(b=a.getIndex(),a=a.getParent());this._setStartContainer(a);this.startOffset=b;this.endContainer||(this._setEndContainer(a),this.endOffset=b);e(this)},setEnd:function(a,b){a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]&&(b=a.getIndex()+ +1,a=a.getParent());this._setEndContainer(a);this.endOffset=b;this.startContainer||(this._setStartContainer(a),this.startOffset=b);e(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(a,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setStart(a,0); +break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setStart(a,a.getLength()):this.setStart(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(a);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(a)}e(this)},setEndAt:function(a,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setEnd(a,0);break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setEnd(a,a.getLength()):this.setEnd(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(a); +break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(a)}e(this)},fixBlock:function(a,b){var d=this.createBookmark(),c=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(c);c.trim();this.insertNode(c);var g=c.getBogus();g&&g.remove();c.appendBogus();this.moveToBookmark(d);return c},splitBlock:function(a,b){var d=new CKEDITOR.dom.elementPath(this.startContainer,this.root),c=new CKEDITOR.dom.elementPath(this.endContainer,this.root), +g=d.block,e=c.block,h=null;if(!d.blockLimit.equals(c.blockLimit))return null;"br"!=a&&(g||(g=this.fixBlock(!0,a),e=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),e||(e=this.fixBlock(!1,a)));d=g&&this.checkStartOfBlock();c=e&&this.checkEndOfBlock();this.deleteContents();g&&g.equals(e)&&(c?(h=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),e=null):d?(h=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(g, +CKEDITOR.POSITION_BEFORE_START),g=null):(e=this.splitElement(g,b||!1),g.is("ul","ol")||g.appendBogus()));return{previousBlock:g,nextBlock:e,wasStartOfBlock:d,wasEndOfBlock:c,elementPath:h}},splitElement:function(a,b){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var d=this.extractContents(!1,b||!1),c=a.clone(!1,b||!1);d.appendTo(c);c.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return c},removeEmptyBlocksAtEnd:function(){function a(a){return function(c){return b(c)|| +d(c)||c.type==CKEDITOR.NODE_ELEMENT&&c.isEmptyInlineRemoveable()||a.is("table")&&c.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),d=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var d=this.createBookmark(),c=this[b?"endPath":"startPath"](),g=c.block||c.blockLimit,e;g&&!g.equals(c.root)&&!g.getFirst(a(g));)e=g.getParent(),this[b?"setEndAt":"setStartAt"](g,CKEDITOR.POSITION_AFTER_END),g.remove(1),g=e;this.moveToBookmark(d)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer, +this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(a,b){var d=b==CKEDITOR.START,c=this.clone();c.collapse(d);c[d?"setStartAt":"setEndAt"](a,d?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(c);c.evaluator=h(d);return c[d?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var a=this.startContainer,b=this.startOffset;CKEDITOR.env.ie&&b&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.ltrim(a.substring(0, +b)),d.test(a)&&this.trim(0,1));this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer,this.root);b=this.clone();b.collapse(!0);b.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(b);a.evaluator=c();return a.checkBackward()},checkEndOfBlock:function(){var a=this.endContainer,b=this.endOffset;CKEDITOR.env.ie&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.rtrim(a.substring(b)),d.test(a)&&this.trim(1,0));this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer, +this.root);b=this.clone();b.collapse(!1);b.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END);a=new CKEDITOR.dom.walker(b);a.evaluator=c();return a.checkForward()},getPreviousNode:function(a,b,d){var c=this.clone();c.collapse(1);c.setStartAt(d||this.root,CKEDITOR.POSITION_AFTER_START);d=new CKEDITOR.dom.walker(c);d.evaluator=a;d.guard=b;return d.previous()},getNextNode:function(a,b,d){var c=this.clone();c.collapse();c.setEndAt(d||this.root,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(c); +d.evaluator=a;d.guard=b;return d.next()},checkReadOnly:function(){function a(a,b){for(;a;){if(a.type==CKEDITOR.NODE_ELEMENT){if("false"==a.getAttribute("contentEditable")&&!a.data("cke-editable"))return 0;if(a.is("html")||"true"==a.getAttribute("contentEditable")&&(a.contains(b)||a.equals(b)))break}a=a.getParent()}return 1}return function(){var b=this.startContainer,d=this.endContainer;return!(a(b,d)&&a(d,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a, +b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var c=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&d.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);c=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),c=1;else if(b&&a.is("br")&&this.endContainer&& +this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var g=a,e=c,h=void 0;g.type==CKEDITOR.NODE_ELEMENT&&g.isEditable(!1)&&(h=g[b?"getLast":"getFirst"](m));e||h||(h=g[b?"getPrevious":"getNext"](m));a=h}return!!c},moveToClosestEditablePosition:function(a,b){var d,c=0,g,e,h=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(d=new CKEDITOR.dom.range(this.root), +d.moveToPosition(a,h[b?0:1])):d=this.clone();if(a&&!a.is(CKEDITOR.dtd.$block))c=1;else if(g=d[b?"getNextEditableNode":"getPreviousEditableNode"]())c=1,(e=g.type==CKEDITOR.NODE_ELEMENT)&&g.is(CKEDITOR.dtd.$block)&&"false"==g.getAttribute("contenteditable")?(d.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),d.setEndAt(g,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&e&&g.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(d.setEnd(g,0),d.collapse()):d.moveToPosition(g,h[b?1:0]);c&&this.moveToRange(d); +return!!c},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(!1,!0),d=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return d(a)&&b(a)};var c=a.next(); +a.reset();return c&&c.equals(a.previous())?c:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=this.endContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:b(),getPreviousEditableNode:b(1),_getTableElement:function(a){a=a||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var b=this.startContainer,d= +this.endContainer,c=b.getAscendant("table",!0),g=d.getAscendant("table",!0);return c&&!this.root.contains(c)?null:CKEDITOR.env.safari&&c&&d.equals(this.root)?b.getAscendant(a,!0):this.getEnclosedNode()?this.getEnclosedNode().getAscendant(a,!0):c&&g&&(c.equals(g)||c.contains(g)||g.contains(c))?b.getAscendant(a,!0):null},scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),b,d,c,g=this.clone();g.optimize();(c=g.startContainer.type== +CKEDITOR.NODE_TEXT)?(d=g.startContainer.getText(),b=g.startContainer.split(g.startOffset),a.insertAfter(g.startContainer)):g.insertNode(a);a.scrollIntoView();c&&(g.startContainer.setText(d),b.remove());a.remove()},getClientRects:function(){function a(a,b){var d=CKEDITOR.tools.array.map(a,function(a){return a}),c=new CKEDITOR.dom.range(b.root),g,e,h;b.startContainer instanceof CKEDITOR.dom.element&&(e=0===b.startOffset&&b.startContainer.hasAttribute("data-widget"));b.endContainer instanceof CKEDITOR.dom.element&& +(h=(h=b.endOffset===(b.endContainer.getChildCount?b.endContainer.getChildCount():b.endContainer.length))&&b.endContainer.hasAttribute("data-widget"));e&&c.setStart(b.startContainer.getParent(),b.startContainer.getIndex());h&&c.setEnd(b.endContainer.getParent(),b.endContainer.getIndex()+1);if(e||h)b=c;c=b.cloneContents();c=CKEDITOR.dom.document.prototype.find.call(c,"[data-cke-widget-id]").toArray();if(c=CKEDITOR.tools.array.map(c,function(a){var d=b.root.editor;a=a.getAttribute("data-cke-widget-id"); +return d.widgets.instances[a].element}))return c=CKEDITOR.tools.array.map(c,function(a){var b;b=a.getParent().hasClass("cke_widget_wrapper")?a.getParent():a;g=this.root.getDocument().$.createRange();g.setStart(b.getParent().$,b.getIndex());g.setEnd(b.getParent().$,b.getIndex()+1);b=g.getClientRects();b.widgetRect=a.getClientRect();return b},b),CKEDITOR.tools.array.forEach(c,function(a){function b(g){CKEDITOR.tools.array.forEach(d,function(b,e){var h=CKEDITOR.tools.objectCompare(a[g],b);h||(h=CKEDITOR.tools.objectCompare(a.widgetRect, +b));h&&(Array.prototype.splice.call(d,e,a.length-g,a.widgetRect),c=!0)});c||(garguments.length||(this.range=b,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function f(b){var a=[];b.forEach(function(b){if("true"==b.getAttribute("contenteditable"))return a.push(b),!1},CKEDITOR.NODE_ELEMENT,!0);return a}function c(b,a,d,g){a:{null==g&&(g=f(d));for(var e;e=g.shift();)if(e.getDtd().p){g={element:e,remaining:g};break a}g=null}if(!g)return 0; +if((e=CKEDITOR.filter.instances[g.element.data("cke-filter")])&&!e.check(a))return c(b,a,d,g.remaining);a=new CKEDITOR.dom.range(g.element);a.selectNodeContents(g.element);a=a.createIterator();a.enlargeBr=b.enlargeBr;a.enforceRealBlocks=b.enforceRealBlocks;a.activeFilter=a.filter=e;b._.nestedEditable={element:g.element,container:d,remaining:g.remaining,iterator:a};return 1}function h(b,a,d){if(!a)return!1;b=b.clone();b.collapse(!d);return b.checkBoundaryOfElement(a,d?CKEDITOR.START:CKEDITOR.END)} +var b=/^[\r\n\t ]+$/,l=CKEDITOR.dom.walker.bookmark(!1,!0),k=CKEDITOR.dom.walker.whitespaces(!0),d=function(b){return l(b)&&k(b)},g={dd:1,dt:1,li:1};e.prototype={getNextParagraph:function(e){var a,f,k,u,t;e=e||"p";if(this._.nestedEditable){if(a=this._.nestedEditable.iterator.getNextParagraph(e))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,a;this.activeFilter=this.filter;if(c(this,e,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter, +this._.nestedEditable.iterator.getNextParagraph(e);this._.nestedEditable=null}if(!this.range.root.getDtd()[e])return null;if(!this._.started){var p=this.range.clone();f=p.startPath();var r=p.endPath(),v=!p.collapsed&&h(p,f.block),q=!p.collapsed&&h(p,r.block,1);p.shrink(CKEDITOR.SHRINK_ELEMENT,!0);v&&p.setStartAt(f.block,CKEDITOR.POSITION_BEFORE_END);q&&p.setEndAt(r.block,CKEDITOR.POSITION_AFTER_START);f=p.endContainer.hasAscendant("pre",!0)||p.startContainer.hasAscendant("pre",!0);p.enlarge(this.forceBrBreak&& +!f||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);p.collapsed||(f=new CKEDITOR.dom.walker(p.clone()),r=CKEDITOR.dom.walker.bookmark(!0,!0),f.evaluator=r,this._.nextNode=f.next(),f=new CKEDITOR.dom.walker(p.clone()),f.evaluator=r,f=f.previous(),this._.lastNode=f.getNextSourceNode(!0,null,p.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(r=this.range.clone(), +r.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),r.checkEndOfBlock()&&(r=new CKEDITOR.dom.elementPath(r.endContainer,r.root),this._.lastNode=(r.block||r.blockLimit).getNextSourceNode(!0))),this._.lastNode&&p.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=p.document.createText(""),this._.lastNode.insertAfter(f)),p=null);this._.started=1;f=p}r=this._.nextNode;p=this._.lastNode;for(this._.nextNode=null;r;){var v=0,q=r.hasAscendant("pre"),B=r.type!=CKEDITOR.NODE_ELEMENT, +x=0;if(B)r.type==CKEDITOR.NODE_TEXT&&b.test(r.getText())&&(B=0);else{var y=r.getName();if(CKEDITOR.dtd.$block[y]&&"false"==r.getAttribute("contenteditable")){a=r;c(this,e,a);break}else if(r.isBlockBoundary(this.forceBrBreak&&!q&&{br:1})){if("br"==y)B=1;else if(!f&&!r.getChildCount()&&"hr"!=y){a=r;k=r.equals(p);break}f&&(f.setEndAt(r,CKEDITOR.POSITION_BEFORE_START),"br"!=y&&(this._.nextNode=r));v=1}else{if(r.getFirst()){f||(f=this.range.clone(),f.setStartAt(r,CKEDITOR.POSITION_BEFORE_START));r=r.getFirst(); +continue}B=1}}B&&!f&&(f=this.range.clone(),f.setStartAt(r,CKEDITOR.POSITION_BEFORE_START));k=(!v||B)&&r.equals(p);if(f&&!v)for(;!r.getNext(d)&&!k;){y=r.getParent();if(y.isBlockBoundary(this.forceBrBreak&&!q&&{br:1})){v=1;B=0;k||y.equals(p);f.setEndAt(y,CKEDITOR.POSITION_BEFORE_END);break}r=y;B=1;k=r.equals(p);x=1}B&&f.setEndAt(r,CKEDITOR.POSITION_AFTER_END);r=this._getNextSourceNode(r,x,p);if((k=!r)||v&&f)break}if(!a){if(!f)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode= +null;a=new CKEDITOR.dom.elementPath(f.startContainer,f.root);r=a.blockLimit;v={div:1,th:1,td:1};a=a.block;!a&&r&&!this.enforceRealBlocks&&v[r.getName()]&&f.checkStartOfBlock()&&f.checkEndOfBlock()&&!r.equals(f.root)?a=r:!a||this.enforceRealBlocks&&a.is(g)?(a=this.range.document.createElement(e),f.extractContents().appendTo(a),a.trim(),f.insertNode(a),u=t=!0):"li"!=a.getName()?f.checkStartOfBlock()&&f.checkEndOfBlock()||(a=a.clone(!1),f.extractContents().appendTo(a),a.trim(),t=f.splitBlock(),u=!t.wasStartOfBlock, +t=!t.wasEndOfBlock,f.insertNode(a)):k||(this._.nextNode=a.equals(p)?null:this._getNextSourceNode(f.getBoundaryNodes().endNode,1,p))}u&&(u=a.getPrevious())&&u.type==CKEDITOR.NODE_ELEMENT&&("br"==u.getName()?u.remove():u.getLast()&&"br"==u.getLast().$.nodeName.toLowerCase()&&u.getLast().remove());t&&(u=a.getLast())&&u.type==CKEDITOR.NODE_ELEMENT&&"br"==u.getName()&&(!CKEDITOR.env.needsBrFiller||u.getPrevious(l)||u.getNext(l))&&u.remove();this._.nextNode||(this._.nextNode=k||a.equals(p)||!p?null:this._getNextSourceNode(a, +1,p));return a},_getNextSourceNode:function(b,a,d){function c(a){return!(a.equals(d)||a.equals(g))}var g=this.range.root;for(b=b.getNextSourceNode(a,null,c);!l(b);)b=b.getNextSourceNode(a,null,c);return b}};CKEDITOR.dom.range.prototype.createIterator=function(){return new e(this)}}(),CKEDITOR.command=function(e,f){this.uiItems=[];this.exec=function(c){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return!1;this.editorFocus&&e.focus();return!1===this.fire("exec")?!0:!1!==f.exec.call(this, +e,c)};this.refresh=function(c,b){if(!this.readOnly&&c.readOnly)return!0;if(this.context&&!b.isContextFor(this.context)||!this.checkAllowed(!0))return this.disable(),!0;this.startDisabled||this.enable();this.modes&&!this.modes[c.mode]&&this.disable();return!1===this.fire("refresh",{editor:c,path:b})?!0:f.refresh&&!1!==f.refresh.apply(this,arguments)};var c;this.checkAllowed=function(h){return h||"boolean"!=typeof c?c=e.activeFilter.checkFeature(this):c};CKEDITOR.tools.extend(this,f,{modes:{wysiwyg:1}, +editorFocus:1,contextSensitive:!!f.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)},CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(e){if(this.state==e||e!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState= +this.state;this.state=e;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.event.implementOn(CKEDITOR.command.prototype),CKEDITOR.ENTER_P=1,CKEDITOR.ENTER_BR=2,CKEDITOR.ENTER_DIV=3,CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR, +docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]},function(){function e(a,b,d,c,g){var e,h;a=[];for(e in b){h=b[e];h="boolean"==typeof h?{}:"function"==typeof h?{match:h}:H(h);"$"!=e.charAt(0)&&(h.elements=e);d&&(h.featureName=d.toLowerCase());var f=h;f.elements=k(f.elements, +/\s+/)||null;f.propertiesOnly=f.propertiesOnly||!0===f.elements;var m=/\s*,\s*/,r=void 0;for(r in L){f[r]=k(f[r],m)||null;var l=f,n=I[r],x=k(f[I[r]],m),C=f[r],A=[],y=!0,q=void 0;x?y=!1:x={};for(q in C)"!"==q.charAt(0)&&(q=q.slice(1),A.push(q),x[q]=!0,y=!1);for(;q=A.pop();)C[q]=C["!"+q],delete C["!"+q];l[n]=(y?!1:x)||null}f.match=f.match||null;c.push(h);a.push(h)}b=g.elements;g=g.generic;var w;d=0;for(c=a.length;d=--d&&(l&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),a(c))},w=function(a,b){e[a]=1;var d=f[a];delete f[a];for(var c=0;c=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?d.$.onreadystatechange=function(){if("loaded"==d.$.readyState||"complete"==d.$.readyState)d.$.onreadystatechange=null,w(a,!0)}:(d.$.onload=function(){setTimeout(function(){w(a,!0)},0)},d.$.onerror=function(){w(a,!1)}));d.appendTo(CKEDITOR.document.getHead())}}};l&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait"); +for(var t=0;t]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}}, +function(){var e=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,f={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(c){for(var h,b,l=0,k;h=this._.htmlPartsRegex.exec(c);){b=h.index;if(b>l)if(l=c.substring(l,b),k)k.push(l);else this.onText(l); +l=this._.htmlPartsRegex.lastIndex;if(b=h[1])if(b=b.toLowerCase(),k&&CKEDITOR.dtd.$cdata[b]&&(this.onCDATA(k.join("")),k=null),!k){this.onTagClose(b);continue}if(k)k.push(h[0]);else if(b=h[3]){if(b=b.toLowerCase(),!/="/.test(b)){var d={},g,m=h[4];h=!!h[5];if(m)for(;g=e.exec(m);){var a=g[1].toLowerCase();g=g[2]||g[3]||g[4]||"";d[a]=!g&&f[a]?a:CKEDITOR.tools.htmlDecodeAttr(g)}this.onTagOpen(b,d,h);!k&&CKEDITOR.dtd.$cdata[b]&&(k=[])}}else if(b=h[2])this.onComment(b)}if(c.length>l)this.onText(c.substring(l, +c.length))}}}(),CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(e){this._.output.push("\x3c",e)},openTagClose:function(e,f){f?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(e,f){"string"==typeof f&&(f=CKEDITOR.tools.htmlEncodeAttr(f));this._.output.push(" ",e,'\x3d"',f,'"')},closeTag:function(e){this._.output.push("\x3c/",e,"\x3e")},text:function(e){this._.output.push(e)},comment:function(e){this._.output.push("\x3c!--", +e,"--\x3e")},write:function(e){this._.output.push(e)},reset:function(){this._.output=[];this._.indent=!1},getHtml:function(e){var f=this._.output.join("");e&&this.reset();return f}}}),"use strict",function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var e=this.parent.children,f=CKEDITOR.tools.indexOf(e,this),c=this.previous,h=this.next;c&&(c.next=h);h&&(h.previous=c);e.splice(f,1);this.parent=null},replaceWith:function(e){var f=this.parent.children, +c=CKEDITOR.tools.indexOf(f,this),h=e.previous=this.previous,b=e.next=this.next;h&&(h.next=e);b&&(b.previous=e);f[c]=e;e.parent=this.parent;this.parent=null},insertAfter:function(e){var f=e.parent.children,c=CKEDITOR.tools.indexOf(f,e),h=e.next;f.splice(c+1,0,this);this.next=e.next;this.previous=e;e.next=this;h&&(h.previous=this);this.parent=e.parent},insertBefore:function(e){var f=e.parent.children,c=CKEDITOR.tools.indexOf(f,e);f.splice(c,0,this);this.next=e;(this.previous=e.previous)&&(e.previous.next= +this);e.previous=this;this.parent=e.parent},getAscendant:function(e){var f="function"==typeof e?e:"string"==typeof e?function(c){return c.name==e}:function(c){return c.name in e},c=this.parent;for(;c&&c.type==CKEDITOR.NODE_ELEMENT;){if(f(c))return c;c=c.parent}return null},wrapWith:function(e){this.replaceWith(e);e.add(this);return e},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(e){return e||{}}}}(),"use strict",CKEDITOR.htmlParser.comment= +function(e){this.value=e;this._={isBlockLike:!1}},CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(e,f){var c=this.value;if(!(c=e.onComment(f,c,this)))return this.remove(),!1;if("string"!=typeof c)return this.replaceWith(c),!1;this.value=c;return!0},writeHtml:function(e,f){f&&this.filter(f);e.comment(this.value)}}),"use strict",function(){CKEDITOR.htmlParser.text=function(e){this.value=e;this._={isBlockLike:!1}};CKEDITOR.htmlParser.text.prototype= +CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(e,f){if(!(this.value=e.onText(f,this.value,this)))return this.remove(),!1},writeHtml:function(e,f){f&&this.filter(f);e.text(this.value)}})}(),"use strict",function(){CKEDITOR.htmlParser.cdata=function(e){this.value=e};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(e){e.write(this.value)}})}(),"use strict", +CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:!0,hasInlineStarted:!1}},function(){function e(b){return b.attributes["data-cke-survive"]?!1:"a"==b.name&&b.attributes.href||CKEDITOR.dtd.$removeEmpty[b.name]}var f=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),c={ol:1,ul:1},h=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),b={ul:"li", +ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(l,k,d){function g(a){var b;if(0k;k++)if(f=b[k]){f= +f.exec(c,e,this);if(!1===f)return null;if(f&&f!=e)return this.onNode(c,f);if(e.parent&&!e.name)break}return e},onNode:function(c,e){var b=e.type;return b==CKEDITOR.NODE_ELEMENT?this.onElement(c,e):b==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(c,e.value)):b==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(c,e.value)):null},onAttribute:function(c,e,b,f){return(b=this.attributesRules[b])?b.exec(c,f,e,this):f}}});CKEDITOR.htmlParser.filterRulesGroup=e;e.prototype= +{add:function(c,e,b){this.rules.splice(this.findIndex(e),0,{value:c,priority:e,options:b})},addMany:function(c,e,b){for(var f=[this.findIndex(e),0],k=0,d=c.length;k/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function n(a){return a.replace(C,function(a,b){return decodeURIComponent(b)})}function w(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, +function(a){return"\x3c!--"+B+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function u(a){return CKEDITOR.tools.array.reduce(a.split(""),function(a,b){var d=b.toLowerCase(),c=b.toUpperCase(),e=t(d);d!==c&&(e+="|"+t(c));return a+("("+e+")")},"")}function t(a){var b;b=a.charCodeAt(0);var d=b.toString(16);b={htmlCode:"\x26#"+b+";?",hex:"\x26#x0*"+d+";?",entity:{"\x3c":"\x26lt;","\x3e":"\x26gt;",":":"\x26colon;"}[a]};for(var c in b)b[c]&&(a+="|"+b[c]);return a}function p(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g, +function(a,b){return decodeURIComponent(b)})}function r(a,b){var d=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return d&&d[b]||""})}function v(a,b){var d=[],c=b.config.protectedSource,e=b._.dataStore||(b._.dataStore={id:1}),g=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,c=[/|$)/gi,//gi,//gi].concat(c);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g, +function(a){return"\x3c!--{cke_tempcomment}"+(d.push(a)-1)+"--\x3e"});for(var f=0;f]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g, +function(a,b){e[e.id]=decodeURIComponent(b);return"{cke_protected_"+e.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,d,c,e){return"\x3c"+d+c+"\x3e"+r(p(e),b)+"\x3c/"+d+"\x3e"})}CKEDITOR.htmlDataProcessor=function(b){var d,c,g=this;this.editor=b;this.dataFilter=d=new CKEDITOR.htmlParser.filter;this.htmlFilter=c=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;d.addRules(D);d.addRules(z,{applyToAll:!0});d.addRules(e(b,"data"), +{applyToAll:!0});c.addRules(J);c.addRules(E,{applyToAll:!0});c.addRules(e(b,"html"),{applyToAll:!0});b.on("toHtml",function(d){d=d.data;var c=d.dataValue,e,c=c.replace(S,""),c=v(c,b),c=a(c,I),c=m(c),c=a(c,L),c=c.replace(O,"$1cke:$2"),c=c.replace(K,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),c=c.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");e=d.context||b.editable().getName();var g;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"== +e&&(e="div",c="\x3cpre\x3e"+c+"\x3c/pre\x3e",g=1);e=b.document.createElement(e);e.setHtml("a"+c);c=e.getHtml().substr(1);c=c.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");g&&(c=c.replace(/^
|<\/pre>$/gi,""));c=c.replace(P,"$1$2");c=n(c);c=p(c);e=!1===d.fixForBody?!1:f(d.enterMode,b.config.autoParagraph);c=CKEDITOR.htmlParser.fragment.fromHtml(c,d.context,e);e&&(g=c,!g.children.length&&CKEDITOR.dtd[g.name][e]&&(e=new CKEDITOR.htmlParser.element(e),g.add(e)));d.dataValue=c},null,null,
+5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(g.dataFilter,!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var b=a.dataValue,d=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(d);b=d.getHtml(!0);a.dataValue=w(b)},null,null,15);b.on("toDataFormat",function(a){var d=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(d=d.replace(/^
/i, +""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(d,a.data.context,f(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(g.htmlFilter,!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,!1,!0)},null,null,11);b.on("toDataFormat",function(a){var d=a.data.dataValue,c=g.writer;c.reset();d.writeChildrenHtml(c);d=c.getHtml(!0);d=p(d);d=r(d,b);a.data.dataValue=d},null,null,15)};CKEDITOR.htmlDataProcessor.prototype= +{toHtml:function(a,b,d,c){var e=this.editor,g,f,h,m;b&&"object"==typeof b?(g=b.context,d=b.fixForBody,c=b.dontFilter,f=b.filter,h=b.enterMode,m=b.protectedWhitespaces):g=b;g||null===g||(g=e.editable().getName());return e.fire("toHtml",{dataValue:a,context:g,fixForBody:d,dontFilter:c,filter:f||e.filter,enterMode:h||e.enterMode,protectedWhitespaces:m}).dataValue},toDataFormat:function(a,b){var d,c,e;b&&(d=b.context,c=b.filter,e=b.enterMode);d||null===d||(d=this.editor.editable().getName());return this.editor.fire("toDataFormat", +{dataValue:a,filter:c||this.editor.filter,context:d,enterMode:e||this.editor.enterMode}).dataValue}};var q=/(?: |\xa0)$/,B="{cke_protected}",x=CKEDITOR.dtd,y="caption colgroup col thead tfoot tbody".split(" "),A=CKEDITOR.tools.extend({},x.$blockLimit,x.$block),D={elements:{input:d,textarea:d}},z={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var b=a.attributes.src.toLowerCase().replace(/[^a-z]/gi, +"");if(0===b.indexOf("javascript")||0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},J={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var d=b.attributes.width,b=b.attributes.height;d&&(a.attributes.width=d);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},E={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/, +""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var d=["name","href","src"],c,e=0;ec? +1:-1})},param:function(a){a.children=[];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];b&&b.value&&(b.value=CKEDITOR.tools.trim(b.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var b=a.children[0];!b&&k(a,b=new CKEDITOR.htmlParser.text); +b.value=a.attributes["data-cke-title"]||""},input:g,textarea:g},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(E.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var H=/<(a|area|img|input|source)\b([^>]*)>/gi,F=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,G=/^(href|src|name)$/i,L=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi, +I=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,C=/([^<]*)<\/cke:encoded>/gi,S=new RegExp("("+u("\x3ccke:encoded\x3e")+"(.*?)"+u("\x3c/cke:encoded\x3e")+")|("+u("\x3c")+u("/")+"?"+u("cke:encoded\x3e")+")","gi"),O=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,P=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,K=/]*?)\/?>(?!\s*<\/cke:\1)/gi}(),"use strict",CKEDITOR.htmlParser.element=function(e,f){this.name=e;this.attributes=f||{};this.children= +[];var c=e||"",h=c.match(/^cke:(.*)/);h&&(c=h[1]);c=!!(CKEDITOR.dtd.$nonBodyContent[c]||CKEDITOR.dtd.$block[c]||CKEDITOR.dtd.$listItem[c]||CKEDITOR.dtd.$tableContent[c]||CKEDITOR.dtd.$nonEditable[c]||"br"==c);this.isEmpty=!!CKEDITOR.dtd.$empty[e];this.isUnknown=!CKEDITOR.dtd[e];this._={isBlockLike:c,hasInlineStarted:this.isEmpty||!c}},CKEDITOR.htmlParser.cssStyle=function(e){var f={};((e instanceof CKEDITOR.htmlParser.element?e.attributes.style:e)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, +function(c,e,b){"font-family"==e&&(b=b.replace(/["']/g,""));f[e.toLowerCase()]=b});return{rules:f,populate:function(c){var e=this.toString();e&&(c instanceof CKEDITOR.dom.element?c.setAttribute("style",e):c instanceof CKEDITOR.htmlParser.element?c.attributes.style=e:c.style=e)},toString:function(){var c=[],e;for(e in f)f[e]&&c.push(e,":",f[e],";");return c.join("")}}},function(){function e(c){return function(b){return b.type==CKEDITOR.NODE_ELEMENT&&("string"==typeof c?b.name==c:b.name in c)}}var f= +function(c,b){c=c[0];b=b[0];return cb?1:0},c=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:c.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(c,b){var e=this,f,d;b=e.getFilterContext(b);if(!e.parent)c.onRoot(b,e);for(;;){f=e.name;if(!(d=c.onElementName(b,f)))return this.remove(),!1;e.name=d;if(!(e=c.onElement(b,e)))return this.remove(), +!1;if(e!==this)return this.replaceWith(e),!1;if(e.name==f)break;if(e.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(e),!1;if(!e.name)return this.replaceWithChildren(),!1}f=e.attributes;var g,m;for(g in f){for(d=f[g];;)if(m=c.onAttributeName(b,g))if(m!=g)delete f[g],g=m;else break;else{delete f[g];break}m&&(!1===(d=c.onAttribute(b,e,m,d))?delete f[m]:f[m]=d)}e.isEmpty||this.filterChildren(c,!1,b);return!0},filterChildren:c.filterChildren,writeHtml:function(c,b){b&&this.filter(b);var e=this.name, +k=[],d=this.attributes,g,m;c.openTag(e,d);for(g in d)k.push([g,d[g]]);c.sortAttributes&&k.sort(f);g=0;for(m=k.length;gCKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),b());else if(this.hasFocus)this.focus(),a();else this.once("focus",function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document); +a={doc:this.getDocument(),range:a.clone()};q.eol.detect(a,this);q.bogus.exclude(a);q.cell.shrink(a);a.fragment=a.range.cloneContents();q.tree.rebuild(a,this);q.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var d=B,c={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),e;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);d.table.detectPurge(c);c.bookmark=a.createBookmark();delete c.range;var g=this.editor.createRange(); +g.moveToPosition(c.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);c.targetBookmark=g.createBookmark();d.list.detectMerge(c,this);d.table.detectRanges(c,this);d.block.detectMerge(c,this);c.tableContentsRanges?(d.table.deleteRanges(c),a.moveToBookmark(c.bookmark),c.range=a):(a.moveToBookmark(c.bookmark),c.range=a,a.extractContents(d.detectExtractMerge(c)));a.moveToBookmark(c.targetBookmark);a.optimize();d.fixUneditableRangePosition(a);d.list.merge(c,this);d.table.purge(c,this);d.block.merge(c,this); +if(b){d=a.startPath();if(c=a.checkStartOfBlock()&&a.checkEndOfBlock()&&d.block&&!a.root.equals(d.block)){a:{var c=d.block.getElementsByTag("span"),g=0,f;if(c)for(;f=c.getItem(g++);)if(!n(f)){c=!0;break a}c=!1}c=!c}c&&(a.moveToPosition(d.block,CKEDITOR.POSITION_BEFORE_START),d.block.remove())}else d.autoParagraph(this.editor,a),w(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings();return e},setup:function(){var b=this.editor;this.attachListener(b,"beforeGetData",function(){var a= +this.getData();this.is("textarea")||!1!==b.config.ignoreEmptyParagraph&&(a=a.replace(t,function(a,b){return b}));b.setData(a,null,1)},this);this.attachListener(b,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(b,"afterSetData",function(){this.setData(b.getData(1))},this);this.attachListener(b,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(b,"beforeFocus",function(){var a=b.getSelection();(a=a&&a.getNative())&&"Control"==a.type||this.focus()}, this);this.attachListener(b,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode,a.data.range)},this);this.attachListener(b,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(b,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(b.readOnly);this.attachClass("cke_editable");b.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"):b.elementMode!=CKEDITOR.ELEMENT_MODE_REPLACE&&b.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO|| this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+b.config.contentsLangDirection);b.keystrokeHandler.blockedKeystrokes[8]=+b.readOnly;b.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=!1},null,null,-1);this.on("focus",function(){this.hasFocus=!0},null,null,-1);if(CKEDITOR.env.webkit)this.on("scroll",function(){b._.previousScrollTop=b.editable().$.scrollTop},null,null,-1);if(CKEDITOR.env.edge&&14CKEDITOR.env.version?n.$.styleSheet.cssText=h:n.setText(h)):(h=g.appendStyleText(h),h=new CKEDITOR.dom.element(h.ownerNode||h.owningElement),f.setCustomData("stylesheet",h),h.data("cke-temp",1))}f=g.getCustomData("stylesheet_ref")||0;g.setCustomData("stylesheet_ref", -f+1);this.setCustomData("cke_includeReadonly",!b.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var c=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");c&&2!=a.$.button&&c.isReadOnly()&&a.preventDefault()});var m={8:1,46:1};this.attachListener(b,"key",function(c){if(b.readOnly)return!0;var d=c.data.domEvent.getKey(),g;c=b.getSelection();if(0!==c.getRanges().length){if(d in m){var e,f=c.getRanges()[0],h=f.startPath(),k,n,q,d=8==d;CKEDITOR.env.ie&& -11>CKEDITOR.env.version&&(e=c.getSelectedElement())||(e=l(c))?(b.fire("saveSnapshot"),f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e.remove(),f.select(),b.fire("saveSnapshot"),g=1):f.collapsed&&((k=h.block)&&(q=k[d?"getPrevious":"getNext"](a))&&q.type==CKEDITOR.NODE_ELEMENT&&q.is("table")&&f[d?"checkStartOfBlock":"checkEndOfBlock"]()?(b.fire("saveSnapshot"),f[d?"checkEndOfBlock":"checkStartOfBlock"]()&&k.remove(),f["moveToElementEdit"+(d?"End":"Start")](q),f.select(),b.fire("saveSnapshot"), -g=1):h.blockLimit&&h.blockLimit.is("td")&&(n=h.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(n,d?CKEDITOR.START:CKEDITOR.END)&&(q=n[d?"getPrevious":"getNext"](a))?(b.fire("saveSnapshot"),f["moveToElementEdit"+(d?"End":"Start")](q),f.checkStartOfBlock()&&f.checkEndOfBlock()?q.remove():f.select(),b.fire("saveSnapshot"),g=1):(n=h.contains(["td","th","caption"]))&&f.checkBoundaryOfElement(n,d?CKEDITOR.START:CKEDITOR.END)&&(g=1))}return!g}});b.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&& -this.attachListener(this,"keyup",function(a){a.data.getKeystroke()in m&&!this.getFirst(k)&&(this.appendBogus(),a=b.createRange(),a.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),a.select())});this.attachListener(this,"dblclick",function(a){if(b.readOnly)return!1;a={element:a.data.getTarget()};b.fire("doubleclick",a)});CKEDITOR.env.ie&&this.attachListener(this,"click",e);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(a){var c=a.data.getTarget();c.is("img","hr", -"input","textarea","select")&&!c.isReadOnly()&&(b.getSelection().selectElement(c),c.is("input","textarea","select")&&a.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(a){(a=a.data.getTarget())&&a.is("img")&&!a.isReadOnly()&&b.getSelection().selectElement(a)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(a){if(2==a.data.$.button&&(a=a.data.getTarget(),!a.getAscendant("table")&&!a.getOuterHtml().replace(t,""))){var c=b.createRange();c.moveToElementEditStart(a); -c.select(!0)}});CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()}),this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()}));CKEDITOR.env.webkit&&this.attachListener(b,"key",function(a){if(b.readOnly)return!0;var d=a.data.domEvent.getKey();if(d in m&&(a=b.getSelection(),0!==a.getRanges().length)){var d=8==d,g=a.getRanges()[0];a=g.startPath();if(g.collapsed)a:{var e= -a.block;if(e&&g[d?"checkStartOfBlock":"checkEndOfBlock"]()&&g.moveToClosestEditablePosition(e,!d)&&g.collapsed){if(g.startContainer.type==CKEDITOR.NODE_ELEMENT){var f=g.startContainer.getChild(g.startOffset-(d?1:0));if(f&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("hr")){b.fire("saveSnapshot");f.remove();a=!0;break a}}g=g.startPath().block;if(!g||g&&g.contains(e))a=void 0;else{b.fire("saveSnapshot");var h;(h=(d?g:e).getBogus())&&h.remove();h=b.getSelection();f=h.createBookmarks();(d?e:g).moveChildren(d? -g:e,!1);a.lastElement.mergeSiblings();c(e,g,!d);h.selectBookmarks(f);a=!0}}else a=!1}else d=g,h=a.block,g=d.endPath().block,h&&g&&!h.equals(g)?(b.fire("saveSnapshot"),(e=h.getBogus())&&e.remove(),d.enlarge(CKEDITOR.ENLARGE_INLINE),d.deleteContents(),g.getParent()&&(g.moveChildren(h,!1),a.lastElement.mergeSiblings(),c(h,g,!0)),d=b.getSelection().getRanges()[0],d.collapse(1),d.optimize(),""===d.startContainer.getHtml()&&d.startContainer.appendBogus(),d.select(),a=!0):a=!1;if(!a)return;b.getSelection().scrollIntoView(); -b.fire("saveSnapshot");return!1}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1);this.clearListeners();this.restoreAttrs();var a;if(a=this.removeCustomData("classes"))for(;a.length;)this.removeClass(a.pop());if(!this.is("textarea")){a=this.getDocument();var c=a.getHead();if(c.getCustomData("stylesheet")){var b=a.getCustomData("stylesheet_ref");--b?a.setCustomData("stylesheet_ref",b):(a.removeCustomData("stylesheet_ref"),c.removeCustomData("stylesheet").remove())}}this.editor.fire("contentDomUnload"); -delete this.editor}}});CKEDITOR.editor.prototype.editable=function(a){var c=this._.editable;if(c&&a)return 0;arguments.length&&(c=this._.editable=a?a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(c&&c.detach(),null));return c};CKEDITOR.on("instanceLoaded",function(a){var c=a.editor;c.on("insertElement",function(a){a=a.data;a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))&&("false"!=a.getAttribute("contentEditable")&&a.data("cke-editable",a.hasAttribute("contenteditable")? -"true":"1"),a.setAttribute("contentEditable",!1))});c.on("selectionChange",function(a){if(!c.readOnly){var b=c.getSelection();b&&!b.isLocked&&(b=c.checkDirty(),c.fire("lockSnapshot"),f(a),c.fire("unlockSnapshot"),!b&&c.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var c=a.editor;c.on("mode",function(){var a=c.editable();if(a&&a.isInline()){var b=c.title;a.changeAttr("role","textbox");a.changeAttr("aria-multiline","true");a.changeAttr("aria-label",b);b&&a.changeAttr("title",b);var d= -c.fire("ariaEditorHelpLabel",{}).label;if(d&&(b=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var g=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+g+'" class\x3d"cke_voice_label"\x3e'+d+"\x3c/span\x3e");b.append(d);a.changeAttr("aria-describedby",g)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");a=CKEDITOR.dom.walker.whitespaces(!0);n=CKEDITOR.dom.walker.bookmark(!1, -!0);w=CKEDITOR.dom.walker.empty();v=CKEDITOR.dom.walker.bogus();t=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;p=function(){function a(c){return c.type==CKEDITOR.NODE_ELEMENT}function c(b,d){var g,e,f,h,k=[],l=d.range.startContainer;g=d.range.startPath();for(var l=n[l.getName()],m=0,q=b.getChildren(),p=q.count(),w=-1,t=-1,r=0,F=g.contains(n.$list);mCKEDITOR.env.version&&d.getChildCount()&&d.getFirst().remove())}return function(d){var g=d.startContainer,e=g.getAscendant("table",1),f=!1;b(e.getElementsByTag("td"));b(e.getElementsByTag("th"));e=d.clone();e.setStart(g,0);e=a(e).lastBackward();e||(e=d.clone(),e.setEndAt(g,CKEDITOR.POSITION_BEFORE_END), -e=a(e).lastForward(),f=!0);e||(e=g);e.is("table")?(d.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),d.collapse(!0),e.remove()):(e.is({tbody:1,thead:1,tfoot:1})&&(e=c(e,"tr",f)),e.is("tr")&&(e=c(e,e.getParent().is("thead")?"th":"td",f)),(g=e.getBogus())&&g.remove(),d.moveToPosition(e,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}();A=function(){function a(c){c=new CKEDITOR.dom.walker(c);c.guard=function(a,c){if(c)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)|| -a.is(CKEDITOR.dtd.$listItem)};c.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$listItem)};return c}return function(c){var b=c.startContainer,d=!1,g;g=c.clone();g.setStart(b,0);g=a(g).lastBackward();g||(g=c.clone(),g.setEndAt(b,CKEDITOR.POSITION_BEFORE_END),g=a(g).lastForward(),d=!0);g||(g=b);g.is(CKEDITOR.dtd.$list)?(c.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),c.collapse(!0),g.remove()):((b=g.getBogus())&&b.remove(),c.moveToPosition(g,d?CKEDITOR.POSITION_AFTER_START: -CKEDITOR.POSITION_BEFORE_END),c.select())}}();r={eol:{detect:function(a,c){var b=a.range,d=b.clone(),g=b.clone(),e=new CKEDITOR.dom.elementPath(b.startContainer,c),f=new CKEDITOR.dom.elementPath(b.endContainer,c);d.collapse(1);g.collapse();e.block&&d.checkBoundaryOfElement(e.block,CKEDITOR.END)&&(b.setStartAfter(e.block),a.prependEolBr=1);f.block&&g.checkBoundaryOfElement(f.block,CKEDITOR.START)&&(b.setEndBefore(f.block),a.appendEolBr=1)},fix:function(a,c){var b=c.getDocument(),d;a.appendEolBr&&(d= -this.createEolBr(b),a.fragment.append(d));!a.prependEolBr||d&&!d.getPrevious()||a.fragment.append(this.createEolBr(b),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var c=a.range.getBoundaryNodes(),b=c.startNode,c=c.endNode;!c||!v(c)||b&&b.equals(c)||a.range.setEndBefore(c)}},tree:{rebuild:function(a,c){var b=a.range,d=b.getCommonAncestor(),g=new CKEDITOR.dom.elementPath(d,c),e=new CKEDITOR.dom.elementPath(b.startContainer,c), -b=new CKEDITOR.dom.elementPath(b.endContainer,c),f;d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());if(g.blockLimit.is({tr:1,table:1})){var h=g.contains("table").getParent();f=function(a){return!a.equals(h)}}else if(g.block&&g.block.is(CKEDITOR.dtd.$listItem)&&(e=e.contains(CKEDITOR.dtd.$list),b=b.contains(CKEDITOR.dtd.$list),!e.equals(b))){var k=g.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(k)}}f||(f=function(a){return!a.equals(g.block)&&!a.equals(g.blockLimit)});this.rebuildFragment(a, -c,d,f)},rebuildFragment:function(a,c,b,d){for(var g;b&&!b.equals(c)&&d(b);)g=b.clone(0,1),a.fragment.appendTo(g),a.fragment=g,b=b.getParent()}},cell:{shrink:function(a){a=a.range;var c=a.startContainer,b=a.endContainer,d=a.startOffset,g=a.endOffset;c.type==CKEDITOR.NODE_ELEMENT&&c.equals(b)&&c.is("tr")&&++d==g&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};C=function(){function a(c,b){var d=c.getParent();if(d.is(CKEDITOR.dtd.$inline))c[b?"insertBefore":"insertAfter"](d)}function c(b,d,g){a(d);a(g,1);for(var e;e= -g.getNext();)e.insertAfter(d),d=e;w(b)&&b.remove()}function d(a,c){var b=new CKEDITOR.dom.range(a);b.setStartAfter(c.startNode);b.setEndBefore(c.endNode);return b}return{list:{detectMerge:function(a,c){var b=d(c,a.bookmark),g=b.startPath(),e=b.endPath(),f=g.contains(CKEDITOR.dtd.$list),h=e.contains(CKEDITOR.dtd.$list);a.mergeList=f&&h&&f.getParent().equals(h.getParent())&&!f.equals(h);a.mergeListItems=g.block&&e.block&&g.block.is(CKEDITOR.dtd.$listItem)&&e.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList|| -a.mergeListItems)b=b.clone(),b.setStartBefore(a.bookmark.startNode),b.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=b.createBookmark()},merge:function(a,b){if(a.mergeListBookmark){var d=a.mergeListBookmark.startNode,g=a.mergeListBookmark.endNode,e=new CKEDITOR.dom.elementPath(d,b),f=new CKEDITOR.dom.elementPath(g,b);if(a.mergeList){var h=e.contains(CKEDITOR.dtd.$list),k=f.contains(CKEDITOR.dtd.$list);h.equals(k)||(k.moveChildren(h),k.remove())}a.mergeListItems&&(e=e.contains(CKEDITOR.dtd.$listItem), -f=f.contains(CKEDITOR.dtd.$listItem),e.equals(f)||c(f,d,g));d.remove();g.remove()}}},block:{detectMerge:function(a,c){if(!a.tableContentsRanges&&!a.mergeListBookmark){var b=new CKEDITOR.dom.range(c);b.setStartBefore(a.bookmark.startNode);b.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=b.createBookmark()}},merge:function(a,b){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var d=a.mergeBlockBookmark.startNode,g=a.mergeBlockBookmark.endNode,e=new CKEDITOR.dom.elementPath(d,b),f=new CKEDITOR.dom.elementPath(g, -b),e=e.block,f=f.block;e&&f&&!e.equals(f)&&c(f,d,g);d.remove();g.remove()}}},table:function(){function a(d){var g=[],e,f=new CKEDITOR.dom.walker(d),h=d.startPath().contains(b),k=d.endPath().contains(b),n={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var l="visited_"+(f?"out":"in");if(a.getCustomData(l))return;CKEDITOR.dom.element.setMarker(n,a,l,1)}if(f&&h&&a.equals(h))e=d.clone(),e.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),g.push(e);else if(!f&&k&&a.equals(k))e=d.clone(),e.setStartAt(k, -CKEDITOR.POSITION_AFTER_START),g.push(e);else{if(l=!f)l=a.type==CKEDITOR.NODE_ELEMENT&&a.is(b)&&(!h||c(a,h))&&(!k||c(a,k));if(!l&&(l=f))if(a.is(b))var l=h&&h.getAscendant("table",!0),m=k&&k.getAscendant("table",!0),q=a.getAscendant("table",!0),l=l&&l.contains(q)||m&&m.contains(q);else l=void 0;l&&(e=d.clone(),e.selectNodeContents(a),g.push(e))}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(n);return g}function c(a,b){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,g=a.getPosition(b); -return g===CKEDITOR.POSITION_IDENTICAL?!1:0===(g&d)}var b={td:1,th:1,caption:1};return{detectPurge:function(a){var c=a.range,d=c.clone();d.enlarge(CKEDITOR.ENLARGE_ELEMENT);var d=new CKEDITOR.dom.walker(d),g=0;d.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(b)&&++g};d.checkForward();if(1e&&g&&g.intersectsNode(b.$)){var f=[{node:d.anchorNode,offset:d.anchorOffset},{node:d.focusNode,offset:d.focusOffset}];d.anchorNode==b.$&&d.anchorOffset>e&&(f[0].offset-=e);d.focusNode==b.$&&d.focusOffset>e&&(f[1].offset-=e)}}b.setText(w(b.getText(),1));f&&(b=a.getDocument().$,d=b.getSelection(), -b=b.createRange(),b.setStart(f[0].node,f[0].offset),b.collapse(!0),d.removeAllRanges(),d.addRange(b),d.extend(f[1].node,f[1].offset))}}function w(a,c){return c?a.replace(C,function(a,c){return c?" ":""}):a.replace(r,"")}function v(a,c){var b=c&&CKEDITOR.tools.htmlEncode(c)||"\x26nbsp;",b=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+(CKEDITOR.env.ie&&14>CKEDITOR.env.version?"display:none":"position:fixed;top:0;left:-1000px")+'"\x3e'+b+"\x3c/div\x3e", -a.document);a.fire("lockSnapshot");a.editable().append(b);var d=a.getSelection(1),g=a.createRange(),e=d.root.on("selectionchange",function(a){a.cancel()},null,null,0);g.setStartAt(b,CKEDITOR.POSITION_AFTER_START);g.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);d.selectRanges([g]);e.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=b}function t(a){var c={37:1,39:1,8:1,46:1};return function(b){var d=b.data.getKeystroke();if(c[d]){var g=a.getSelection().getRanges(),e=g[0];1==g.length&& -e.collapsed&&(d=e[38>d?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&"false"==d.getAttribute("contenteditable")&&(a.getSelection().fake(d),b.data.preventDefault(),b.cancel())}}}function p(a){for(var c=0;c=d.getLength()?h.setStartAfter(d):h.setStartBefore(d));g&&g.type==CKEDITOR.NODE_TEXT&&(f?h.setEndAfter(g):h.setEndBefore(g));d=new CKEDITOR.dom.walker(h);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&d.isReadOnly()){var g=b.clone();b.setEndBefore(d);b.collapsed&&a.splice(c--,1);d.getPosition(h.endContainer)&CKEDITOR.POSITION_CONTAINS||(g.setStartAfter(d), -g.collapsed||a.splice(c+1,0,g));return!0}return!1};d.next()}}return a}var q="function"!=typeof window.getSelection,A=1,r=CKEDITOR.tools.repeat("​",7),C=new RegExp(r+"( )?","g"),B,u,y,x=CKEDITOR.dom.walker.invisible(1),z=function(){function a(c){return function(a){var b=a.editor.createRange();b.moveToClosestEditablePosition(a.selected,c)&&a.editor.getSelection().selectRanges([b]);return!1}}function c(a){return function(c){var b=c.editor,d=b.createRange(),g;if(!b.readOnly)return(g=d.moveToClosestEditablePosition(c.selected, -a))||(g=d.moveToClosestEditablePosition(c.selected,!a)),g&&b.getSelection().selectRanges([d]),b.fire("saveSnapshot"),c.selected.remove(),g||(d.moveToElementEditablePosition(b.editable()),b.getSelection().selectRanges([d])),b.fire("saveSnapshot"),!1}}var b=a(),d=a(1);return{37:b,38:b,39:d,40:d,8:c(),46:c(1)}}();CKEDITOR.on("instanceCreated",function(a){function c(){var a=b.getSelection();a&&a.removeAllRanges()}var b=a.editor;b.on("contentDom",function(){function a(){r=new CKEDITOR.dom.selection(b.getSelection()); -r.lock()}function c(){e.removeListener("mouseup",c);k.removeListener("mouseup",c);var a=CKEDITOR.document.$.selection,b=a.createRange();"None"!=a.type&&b.parentElement()&&b.parentElement().ownerDocument==g.$&&b.select()}function d(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")},!0))&&"false"===a.getAttribute("contenteditable")?a:null:null}var g=b.document,e=CKEDITOR.document,f=b.editable(),h=g.getBody(), -k=g.getDocumentElement(),w=f.isInline(),p,r;CKEDITOR.env.gecko&&f.attachListener(f,"focus",function(a){a.removeListener();0!==p&&(a=b.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==f.$&&(a=b.createRange(),a.moveToElementEditStart(f),a.select())},null,null,-2);f.attachListener(f,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){p&&CKEDITOR.env.webkit&&(p=b._.previousActive&&b._.previousActive.equals(g.getActive()))&&null!=b._.previousScrollTop&&b._.previousScrollTop!=f.$.scrollTop&&(f.$.scrollTop= -b._.previousScrollTop);b.unlockSelection(p);p=0},null,null,-1);f.attachListener(f,"mousedown",function(){p=0});if(CKEDITOR.env.ie||w)q?f.attachListener(f,"beforedeactivate",a,null,null,-1):f.attachListener(b,"selectionCheck",a,null,null,-1),f.attachListener(f,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){b.lockSelection(r);p=1},null,null,-1),f.attachListener(f,"mousedown",function(){p=0});if(CKEDITOR.env.ie&&!w){var u;f.attachListener(f,"mousedown",function(a){2==a.data.$.button&&((a=b.document.getSelection())&& -a.getType()!=CKEDITOR.SELECTION_NONE||(u=b.window.getScrollPosition()))});f.attachListener(f,"mouseup",function(a){2==a.data.$.button&&u&&(b.document.$.documentElement.scrollLeft=u.x,b.document.$.documentElement.scrollTop=u.y);u=null});if("BackCompat"!=g.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var A,v;k.on("mousedown",function(a){function c(a){a=a.data.$;if(A){var b=h.$.createTextRange();try{b.moveToPoint(a.clientX,a.clientY)}catch(d){}A.setEndPoint(0>v.compareEndPoints("StartToStart", -b)?"EndToEnd":"StartToStart",b);A.select()}}function b(){k.removeListener("mousemove",c);e.removeListener("mouseup",b);k.removeListener("mouseup",b);A.select()}a=a.data;if(a.getTarget().is("html")&&a.$.yCKEDITOR.env.version)k.on("mousedown",function(a){a.data.getTarget().is("html")&& -(e.on("mouseup",c),k.on("mouseup",c))})}}f.attachListener(f,"selectionchange",l,b);f.attachListener(f,"keyup",m,b);CKEDITOR.env.ie&&f.attachListener(f,"keydown",function(a){var c=this.getSelection(1),b=d(c);b&&!b.equals(f)&&(c.selectElement(b),a.data.preventDefault())},b);f.attachListener(f,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){b.forceNextSelectionCheck();b.selectionChange(1)});if(w&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var B;f.attachListener(f,"mousedown",function(){B=1});f.attachListener(g.getDocumentElement(), -"mouseup",function(){B&&m.call(b);B=0})}else f.attachListener(CKEDITOR.env.ie?f:g.getDocumentElement(),"mouseup",m,b);CKEDITOR.env.webkit&&f.attachListener(g,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:f.hasFocus&&n(f)}},null,null,-1);f.attachListener(f,"keydown",t(b),null,null,-1)});b.on("setData",function(){b.unlockSelection();CKEDITOR.env.webkit&&c()});b.on("contentDomUnload",function(){b.unlockSelection()});if(CKEDITOR.env.ie9Compat)b.on("beforeDestroy", -c,null,null,9);b.on("dataReady",function(){delete b._.fakeSelection;delete b._.hiddenSelectionContainer;b.selectionChange(1)});b.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),c=b.editable().getLast(a);c&&c.hasAttribute("data-cke-hidden-sel")&&(c.remove(),CKEDITOR.env.gecko&&(a=b.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);b.on("key",function(a){if("wysiwyg"==b.mode){var c=b.getSelection();if(c.isFake){var d= -z[a.data.keyCode];if(d)return d({editor:b,selected:c.getSelectedElement(),selection:c,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var c=a.editor;c.on("selectionChange",function(){var a=c.editable(),b=a.getCustomData("cke-fillingChar");b&&(b.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):b.setCustomData("ready",1))},null,null,-1);c.on("beforeSetMode",function(){n(c.editable())},null,null,-1);c.on("getSnapshot",function(a){a.data&&(a.data=w(a.data))}, -c,null,20);c.on("toDataFormat",function(a){a.data.dataValue=w(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?l:m).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection||a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);return a.getType()!=CKEDITOR.SELECTION_NONE? -(!a.isLocked&&a.lock(),this._.savedSelection=a,!0):!1};CKEDITOR.editor.prototype.unlockSelection=function(a){var c=this._.savedSelection;return c?(c.unlock(a),delete this._.savedSelection,!0):!1};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection(): -new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var c=a;a=a.root}var b=a instanceof CKEDITOR.dom.element;this.rev=c?c.rev:A++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=b?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(c)return CKEDITOR.tools.extend(this._.cache,c._.cache), -this.isFake=c.isFake,this.isLocked=c.isLocked,this;a=this.getNative();var d,g;if(a)if(a.getRangeAt)d=(g=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(g.commonAncestorContainer);else{try{g=a.createRange()}catch(e){}d=g&&CKEDITOR.dom.element.get(g.item&&g.item(0)||g.parentElement())}if(!d||d.type!=CKEDITOR.NODE_ELEMENT&&d.type!=CKEDITOR.NODE_TEXT||!this.root.equals(d)&&!this.root.contains(d))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement= -null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var I={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:w,_createFillingCharSequenceNode:a,FILLING_CHAR_SEQUENCE:r});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel= -q?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:q?function(){var a=this._.cache;if(a.type)return a.type;var c=CKEDITOR.SELECTION_NONE;try{var b=this.getNative(),d=b.type;"Text"==d&&(c=CKEDITOR.SELECTION_TEXT);"Control"==d&&(c=CKEDITOR.SELECTION_ELEMENT);b.createRange().parentElement()&&(c=CKEDITOR.SELECTION_TEXT)}catch(g){}return a.type=c}:function(){var a=this._.cache;if(a.type)return a.type;var c=CKEDITOR.SELECTION_TEXT,b=this.getNative();if(!b||!b.rangeCount)c=CKEDITOR.SELECTION_NONE; -else if(1==b.rangeCount){var b=b.getRangeAt(0),d=b.startContainer;d==b.endContainer&&1==d.nodeType&&1==b.endOffset-b.startOffset&&I[d.childNodes[b.startOffset].nodeName.toLowerCase()]&&(c=CKEDITOR.SELECTION_ELEMENT)}return a.type=c},getRanges:function(){var a=q?function(){function a(c){return(new CKEDITOR.dom.node(c)).getIndex()}var c=function(c,b){c=c.duplicate();c.collapse(b);var d=c.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var g=d.children,e,f,h=c.duplicate(),k=0, -n=g.length-1,l=-1,m,q;k<=n;)if(l=Math.floor((k+n)/2),e=g[l],h.moveToElementText(e),m=h.compareEndPoints("StartToStart",c),0m)k=l+1;else return{container:d,offset:a(e)};if(-1==l||l==g.length-1&&0>m){h.moveToElementText(d);h.setEndPoint("StartToStart",c);h=h.text.replace(/(\r\n|\r)/g,"\n").length;g=d.childNodes;if(!h)return e=g[g.length-1],e.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:g.length}:{container:e,offset:e.nodeValue.length};for(d=g.length;0]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g," ");f=f.replace(/]*>/gi,"\n");if(CKEDITOR.env.ie){var h=c.getDocument().createElement("div");h.append(e);e.$.outerHTML="\x3cpre\x3e"+f+"\x3c/pre\x3e";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=w(d?[c.getHtml()]:a(c),b):c.moveChildren(b);b.replace(c);if(g){var d=b,k;(k=d.getPrevious(G))&&k.type==CKEDITOR.NODE_ELEMENT&& -k.is("pre")&&(g=n(k.getHtml(),/\n$/,"")+"\n\n"+n(d.getHtml(),/^\n/,""),CKEDITOR.env.ie?d.$.outerHTML="\x3cpre\x3e"+g+"\x3c/pre\x3e":d.setHtml(g),k.remove())}else d&&q(b)}function a(a){var c=[];n(a.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,c,b){return c+"\x3c/pre\x3e"+b+"\x3cpre\x3e"}).replace(/([\s\S]*?)<\/pre>/gi,function(a,b){c.push(b)});return c}function n(a,c,b){var d="",g="";a=a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi, -function(a,c,b){c&&(d=c);b&&(g=b);return""});return d+a.replace(c,b)+g}function w(a,c){var b;1=k?(l=d.createText(""),l.insertAfter(this)):(f=d.createText(""),f.insertAfter(l),f.remove())); -return l},substring:function(f,h){return"number"!=typeof h?this.$.nodeValue.substr(f):this.$.nodeValue.substring(f,h)}}),function(){function f(e,f,d){var h=e.serializable,m=f[d?"endContainer":"startContainer"],b=d?"endOffset":"startOffset",g=h?f.document.getById(e.startNode):e.startNode;e=h?f.document.getById(e.endNode):e.endNode;m.equals(g.getPrevious())?(f.startOffset=f.startOffset-m.getLength()-e.getPrevious().getLength(),m=e.getNext()):m.equals(e.getPrevious())&&(f.startOffset-=m.getLength(), -m=e.getNext());m.equals(g.getParent())&&f[b]++;m.equals(e.getParent())&&f[b]++;f[d?"endContainer":"startContainer"]=m;return f}CKEDITOR.dom.rangeList=function(e){if(e instanceof CKEDITOR.dom.rangeList)return e;e?e instanceof CKEDITOR.dom.range&&(e=[e]):e=[];return CKEDITOR.tools.extend(e,h)};var h={createIterator:function(){var e=this,f=CKEDITOR.dom.walker.bookmark(),d=[],h;return{getNextRange:function(m){h=void 0===h?0:h+1;var b=e[h];if(b&&1c?-1:1}),d=0, -g;dCKEDITOR.env.version?c[f].$.styleSheet.cssText+=e:c[f].$.innerHTML+=e}}var l={};CKEDITOR.skin={path:f,loadPart:function(c,a){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(f()+"skin.js"),function(){e(c,a)}):e(c,a)}, -getPath:function(c){return CKEDITOR.getUrl(h(c))},icons:{},addIcon:function(c,a,b,d){c=c.toLowerCase();this.icons[c]||(this.icons[c]={path:a,offset:b||0,bgsize:d||"16px"})},getIconStyle:function(c,a,b,d,g){var e;c&&(c=c.toLowerCase(),a&&(e=this.icons[c+"-rtl"]),e||(e=this.icons[c]));c=b||e&&e.path||"";d=d||e&&e.offset;g=g||e&&e.bgsize||"16px";c&&(c=c.replace(/'/g,"\\'"));return c&&"background-image:url('"+CKEDITOR.getUrl(c)+"');background-position:0 "+d+"px;background-size:"+g+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype, -{getUiColor:function(){return this.uiColor},setUiColor:function(c){var a=k(CKEDITOR.document);return(this.setUiColor=function(c){this.uiColor=c;var e=CKEDITOR.skin.chameleon,f="",h="";"function"==typeof e&&(f=e(this,"editor"),h=e(this,"panel"));c=[[g,c]];d([a],f,c);d(b,h,c)}).call(this,c)}});var m="cke_ui_color",b=[],g=/\$color/g;CKEDITOR.on("instanceLoaded",function(c){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var a=c.editor;c=function(c){c=(c.data[0]||c.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument(); -if(!c.getById("cke_ui_color")){c=k(c);b.push(c);var e=a.getUiColor();e&&d([c],CKEDITOR.skin.chameleon(a,"panel"),[[g,e]])}};a.on("panelShow",c);a.on("menuShow",c);a.config.uiColor&&a.setUiColor(a.config.uiColor)}})}(),function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var f=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',CKEDITOR.document);f.appendTo(CKEDITOR.document.getHead()); -try{var h=f.getComputedStyle("border-top-color"),e=f.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!h||h!=e)}catch(k){CKEDITOR.env.hc=!1}f.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc");CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(f=CKEDITOR._.pending)for(delete CKEDITOR._.pending,h=0;hh;h++){var m=h,b;b=parseInt(d[h],16);b=("0"+(0>f?0|b*(1+f):0|b+(255-b)*f).toString(16)).slice(-2);d[m]=b}return"#"+d.join("")}}(),h={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover,{id} a.cke_path_item:focus,{id} a.cke_path_item:active [background-color:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] "), +null!=b._.previousScrollTop&&a.getDocument().equals(CKEDITOR.document)&&(a.$.scrollTop=b._.previousScrollTop,b._.previousScrollTop=null,this.removeListener("scroll",d))};this.on("scroll",d)}b.focusManager.add(this);this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,b.once("contentDom",function(){b.focusManager.focus(this)},this));this.isInline()&&this.changeAttr("tabindex",b.tabIndex);if(!this.is("textarea")){b.document=this.getDocument();b.window=this.getWindow();var e=b.document;this.changeAttr("spellcheck", +!b.config.disableNativeSpellChecker);var g=b.config.contentsLangDirection;this.getDirection(1)!=g&&this.changeAttr("dir",g);var f=CKEDITOR.getCss();if(f){var g=e.getHead(),k=g.getCustomData("stylesheet");k?f!=k.getText()&&(CKEDITOR.env.ie&&9>CKEDITOR.env.version?k.$.styleSheet.cssText=f:k.setText(f)):(f=e.appendStyleText(f),f=new CKEDITOR.dom.element(f.ownerNode||f.owningElement),g.setCustomData("stylesheet",f),f.data("cke-temp",1))}g=e.getCustomData("stylesheet_ref")||0;e.setCustomData("stylesheet_ref", +g+1);this.setCustomData("cke_includeReadonly",!b.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var n={8:1,46:1};this.attachListener(b,"key",function(d){if(b.readOnly)return!0;var c=d.data.domEvent.getKey(),e;d=b.getSelection();if(0!==d.getRanges().length){if(c in n){var g,f=d.getRanges()[0],m=f.startPath(),h,k,r,c=8==c;CKEDITOR.env.ie&& +11>CKEDITOR.env.version&&(g=d.getSelectedElement())||(g=l(d))?(b.fire("saveSnapshot"),f.moveToPosition(g,CKEDITOR.POSITION_BEFORE_START),g.remove(),f.select(),b.fire("saveSnapshot"),e=1):f.collapsed&&((h=m.block)&&(r=h[c?"getPrevious":"getNext"](a))&&r.type==CKEDITOR.NODE_ELEMENT&&r.is("table")&&f[c?"checkStartOfBlock":"checkEndOfBlock"]()?(b.fire("saveSnapshot"),f[c?"checkEndOfBlock":"checkStartOfBlock"]()&&h.remove(),f["moveToElementEdit"+(c?"End":"Start")](r),f.select(),b.fire("saveSnapshot"), +e=1):m.blockLimit&&m.blockLimit.is("td")&&(k=m.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END)&&(r=k[c?"getPrevious":"getNext"](a))?(b.fire("saveSnapshot"),f["moveToElementEdit"+(c?"End":"Start")](r),f.checkStartOfBlock()&&f.checkEndOfBlock()?r.remove():f.select(),b.fire("saveSnapshot"),e=1):(k=m.contains(["td","th","caption"]))&&f.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END)&&(e=1))}return!e}});b.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&& +this.attachListener(this,"keyup",function(a){a.data.getKeystroke()in n&&!this.getFirst(h)&&(this.appendBogus(),a=b.createRange(),a.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),a.select())});this.attachListener(this,"dblclick",function(a){if(b.readOnly)return!1;a={element:a.data.getTarget()};b.fire("doubleclick",a)});CKEDITOR.env.ie&&this.attachListener(this,"click",c);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(a){var d=a.data.getTarget();d.is("img","hr", +"input","textarea","select")&&!d.isReadOnly()&&(b.getSelection().selectElement(d),d.is("input","textarea","select")&&a.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(a){(a=a.data.getTarget())&&a.is("img")&&!a.isReadOnly()&&b.getSelection().selectElement(a)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(a){if(2==a.data.$.button&&(a=a.data.getTarget(),!a.getAscendant("table")&&!a.getOuterHtml().replace(t,""))){var d=b.createRange();d.moveToElementEditStart(a); +d.select(!0)}});CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()}),this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()}));CKEDITOR.env.webkit&&this.attachListener(b,"key",function(a){if(b.readOnly)return!0;var d=a.data.domEvent.getKey();if(d in n&&(a=b.getSelection(),0!==a.getRanges().length)){var d=8==d,c=a.getRanges()[0];a=c.startPath();if(c.collapsed)a:{var e= +a.block;if(e&&c[d?"checkStartOfBlock":"checkEndOfBlock"]()&&c.moveToClosestEditablePosition(e,!d)&&c.collapsed){if(c.startContainer.type==CKEDITOR.NODE_ELEMENT){var g=c.startContainer.getChild(c.startOffset-(d?1:0));if(g&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("hr")){b.fire("saveSnapshot");g.remove();a=!0;break a}}c=c.startPath().block;if(!c||c&&c.contains(e))a=void 0;else{b.fire("saveSnapshot");var f;(f=(d?c:e).getBogus())&&f.remove();f=b.getSelection();g=f.createBookmarks();(d?e:c).moveChildren(d? +c:e,!1);a.lastElement.mergeSiblings();m(e,c,!d);f.selectBookmarks(g);a=!0}}else a=!1}else d=c,f=a.block,c=d.endPath().block,f&&c&&!f.equals(c)?(b.fire("saveSnapshot"),(e=f.getBogus())&&e.remove(),d.enlarge(CKEDITOR.ENLARGE_INLINE),d.deleteContents(),c.getParent()&&(c.moveChildren(f,!1),a.lastElement.mergeSiblings(),m(f,c,!0)),d=b.getSelection().getRanges()[0],d.collapse(1),d.optimize(),""===d.startContainer.getHtml()&&d.startContainer.appendBogus(),d.select(),a=!0):a=!1;if(!a)return;b.getSelection().scrollIntoView(); +b.fire("saveSnapshot");return!1}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1);this.clearListeners();this.restoreAttrs();var a;if(a=this.removeCustomData("classes"))for(;a.length;)this.removeClass(a.pop());if(!this.is("textarea")){a=this.getDocument();var b=a.getHead();if(b.getCustomData("stylesheet")){var d=a.getCustomData("stylesheet_ref");--d?a.setCustomData("stylesheet_ref",d):(a.removeCustomData("stylesheet_ref"),b.removeCustomData("stylesheet").remove())}}this.editor.fire("contentDomUnload"); +delete this.editor}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;arguments.length&&(b=this._.editable=a?a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),null));return b};CKEDITOR.on("instanceLoaded",function(a){var b=a.editor;b.on("insertElement",function(a){a=a.data;a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))&&("false"!=a.getAttribute("contentEditable")&&a.data("cke-editable",a.hasAttribute("contenteditable")? +"true":"1"),a.setAttribute("contentEditable",!1))});b.on("selectionChange",function(a){if(!b.readOnly){var d=b.getSelection();d&&!d.isLocked&&(d=b.checkDirty(),b.fire("lockSnapshot"),e(a),b.fire("unlockSnapshot"),!d&&b.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var d=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-multiline","true");a.changeAttr("aria-label",d);d&&a.changeAttr("title",d);var c= +b.fire("ariaEditorHelpLabel",{}).label;if(c&&(d=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var e=CKEDITOR.tools.getNextId(),c=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+e+'" class\x3d"cke_voice_label"\x3e'+c+"\x3c/span\x3e");d.append(c);a.changeAttr("aria-describedby",e)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");a=CKEDITOR.dom.walker.whitespaces(!0);n=CKEDITOR.dom.walker.bookmark(!1, +!0);w=CKEDITOR.dom.walker.empty();u=CKEDITOR.dom.walker.bogus();t=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;p=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(d,c){var e,g,f,m,h=[],k=c.range.startContainer;e=c.range.startPath();for(var k=n[k.getName()],l=0,r=d.getChildren(),w=r.count(),p=-1,q=-1,A=0,E=e.contains(n.$list);lCKEDITOR.env.version&&c.getChildCount()&&c.getFirst().remove())}return function(c){var e=c.startContainer,g=e.getAscendant("table",1),f=!1;d(g.getElementsByTag("td"));d(g.getElementsByTag("th"));g=c.clone();g.setStart(e,0);g=a(g).lastBackward();g||(g=c.clone(),g.setEndAt(e,CKEDITOR.POSITION_BEFORE_END), +g=a(g).lastForward(),f=!0);g||(g=e);g.is("table")?(c.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),c.collapse(!0),g.remove()):(g.is({tbody:1,thead:1,tfoot:1})&&(g=b(g,"tr",f)),g.is("tr")&&(g=b(g,g.getParent().is("thead")?"th":"td",f)),(e=g.getBogus())&&e.remove(),c.moveToPosition(g,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}();v=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)|| +a.is(CKEDITOR.dtd.$listItem)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$listItem)};return b}return function(b){var d=b.startContainer,c=!1,e;e=b.clone();e.setStart(d,0);e=a(e).lastBackward();e||(e=b.clone(),e.setEndAt(d,CKEDITOR.POSITION_BEFORE_END),e=a(e).lastForward(),c=!0);e||(e=d);e.is(CKEDITOR.dtd.$list)?(b.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),b.collapse(!0),e.remove()):((d=e.getBogus())&&d.remove(),b.moveToPosition(e,c?CKEDITOR.POSITION_AFTER_START: +CKEDITOR.POSITION_BEFORE_END),b.select())}}();q={eol:{detect:function(a,b){var d=a.range,c=d.clone(),e=d.clone(),g=new CKEDITOR.dom.elementPath(d.startContainer,b),f=new CKEDITOR.dom.elementPath(d.endContainer,b);c.collapse(1);e.collapse();g.block&&c.checkBoundaryOfElement(g.block,CKEDITOR.END)&&(d.setStartAfter(g.block),a.prependEolBr=1);f.block&&e.checkBoundaryOfElement(f.block,CKEDITOR.START)&&(d.setEndBefore(f.block),a.appendEolBr=1)},fix:function(a,b){var d=b.getDocument(),c;a.appendEolBr&&(c= +this.createEolBr(d),a.fragment.append(c));!a.prependEolBr||c&&!c.getPrevious()||a.fragment.append(this.createEolBr(d),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),d=b.startNode,b=b.endNode;!b||!u(b)||d&&d.equals(b)||a.range.setEndBefore(b)}},tree:{rebuild:function(a,b){var d=a.range,c=d.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(c,b),g=new CKEDITOR.dom.elementPath(d.startContainer,b), +d=new CKEDITOR.dom.elementPath(d.endContainer,b),f;c.type==CKEDITOR.NODE_TEXT&&(c=c.getParent());if(e.blockLimit.is({tr:1,table:1})){var m=e.contains("table").getParent();f=function(a){return!a.equals(m)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)&&(g=g.contains(CKEDITOR.dtd.$list),d=d.contains(CKEDITOR.dtd.$list),!g.equals(d))){var h=e.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(h)}}f||(f=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a, +b,c,f)},rebuildFragment:function(a,b,d,c){for(var e;d&&!d.equals(b)&&c(d);)e=d.clone(0,1),a.fragment.appendTo(e),a.fragment=e,d=d.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,d=a.endContainer,c=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(d)&&b.is("tr")&&++c==e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};B=function(){function a(b,d){var c=b.getParent();if(c.is(CKEDITOR.dtd.$inline))b[d?"insertBefore":"insertAfter"](c)}function b(d,c,e){a(c);a(e,1);for(var g;g= +e.getNext();)g.insertAfter(c),c=g;w(d)&&d.remove()}function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,a.bookmark),e=d.startPath(),g=d.endPath(),f=e.contains(CKEDITOR.dtd.$list),m=g.contains(CKEDITOR.dtd.$list);a.mergeList=f&&m&&f.getParent().equals(m.getParent())&&!f.equals(m);a.mergeListItems=e.block&&g.block&&e.block.is(CKEDITOR.dtd.$listItem)&&g.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList|| +a.mergeListItems)d=d.clone(),d.setStartBefore(a.bookmark.startNode),d.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=d.createBookmark()},merge:function(a,d){if(a.mergeListBookmark){var c=a.mergeListBookmark.startNode,e=a.mergeListBookmark.endNode,g=new CKEDITOR.dom.elementPath(c,d),f=new CKEDITOR.dom.elementPath(e,d);if(a.mergeList){var m=g.contains(CKEDITOR.dtd.$list),h=f.contains(CKEDITOR.dtd.$list);m.equals(h)||(h.moveChildren(m),h.remove())}a.mergeListItems&&(g=g.contains(CKEDITOR.dtd.$listItem), +f=f.contains(CKEDITOR.dtd.$listItem),g.equals(f)||b(f,c,e));c.remove();e.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var d=new CKEDITOR.dom.range(b);d.setStartBefore(a.bookmark.startNode);d.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=d.createBookmark()}},merge:function(a,d){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var c=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,g=new CKEDITOR.dom.elementPath(c,d),f=new CKEDITOR.dom.elementPath(e, +d),g=g.block,f=f.block;g&&f&&!g.equals(f)&&b(f,c,e);c.remove();e.remove()}}},table:function(){function a(c){var e=[],g,f=new CKEDITOR.dom.walker(c),m=c.startPath().contains(d),h=c.endPath().contains(d),k={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var n="visited_"+(f?"out":"in");if(a.getCustomData(n))return;CKEDITOR.dom.element.setMarker(k,a,n,1)}if(f&&m&&a.equals(m))g=c.clone(),g.setEndAt(m,CKEDITOR.POSITION_BEFORE_END),e.push(g);else if(!f&&h&&a.equals(h))g=c.clone(),g.setStartAt(h, +CKEDITOR.POSITION_AFTER_START),e.push(g);else{if(n=!f)n=a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!m||b(a,m))&&(!h||b(a,h));if(!n&&(n=f))if(a.is(d))var n=m&&m.getAscendant("table",!0),l=h&&h.getAscendant("table",!0),r=a.getAscendant("table",!0),n=n&&n.contains(r)||l&&l.contains(r);else n=void 0;n&&(g=c.clone(),g.selectNodeContents(a),e.push(g))}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(k);return e}function b(a,d){var c=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(d); +return e===CKEDITOR.POSITION_IDENTICAL?!1:0===(e&c)}var d={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,c=b.clone();c.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=new CKEDITOR.dom.walker(c),e=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&++e};c.checkForward();if(1g&&e&&e.intersectsNode(d.$)){var f=[{node:c.anchorNode,offset:c.anchorOffset},{node:c.focusNode,offset:c.focusOffset}];c.anchorNode==d.$&&c.anchorOffset>g&&(f[0].offset-=g);c.focusNode==d.$&&c.focusOffset>g&&(f[1].offset-=g)}}d.setText(w(d.getText(),1));f&&(d=a.getDocument().$, +c=d.getSelection(),d=d.createRange(),d.setStart(f[0].node,f[0].offset),d.collapse(!0),c.removeAllRanges(),c.addRange(d),c.extend(f[1].node,f[1].offset))}}function w(a,b){return b?a.replace(B,function(a,b){return b?" ":""}):a.replace(q,"")}function u(a,b){var d=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;",d=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+(CKEDITOR.env.ie&&14>CKEDITOR.env.version?"display:none":"position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;")+ +'"\x3e'+d+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(d);var c=a.getSelection(1),e=a.createRange(),g=c.root.on("selectionchange",function(a){a.cancel()},null,null,0);e.setStartAt(d,CKEDITOR.POSITION_AFTER_START);e.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);c.selectRanges([e]);g.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=d}function t(a){var b={37:1,39:1,8:1,46:1};return function(d){var c=d.data.getKeystroke();if(b[c]){var e=a.getSelection().getRanges(), +g=e[0];1==e.length&&g.collapsed&&(c=g[38>c?"getPreviousEditableNode":"getNextEditableNode"]())&&c.type==CKEDITOR.NODE_ELEMENT&&"false"==c.getAttribute("contenteditable")&&(a.getSelection().fake(c),d.data.preventDefault(),d.cancel())}}}function p(a){for(var b=0;b=c.getLength()?m.setStartAfter(c):m.setStartBefore(c));e&&e.type==CKEDITOR.NODE_TEXT&&(f?m.setEndAfter(e):m.setEndBefore(e));c=new CKEDITOR.dom.walker(m);c.evaluator=function(c){if(c.type==CKEDITOR.NODE_ELEMENT&&c.isReadOnly()){var e=d.clone();d.setEndBefore(c);d.collapsed&&a.splice(b--,1);c.getPosition(m.endContainer)& +CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(c),e.collapsed||a.splice(b+1,0,e));return!0}return!1};c.next()}}return a}var r="function"!=typeof window.getSelection,v=1,q=CKEDITOR.tools.repeat("​",7),B=new RegExp(q+"( )?","g"),x,y,A,D=CKEDITOR.dom.walker.invisible(1),z=function(){function a(b){return function(a){var d=a.editor.createRange();d.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([d]);return!1}}function b(a){return function(b){var d=b.editor,c=d.createRange(), +e;if(!d.readOnly)return(e=c.moveToClosestEditablePosition(b.selected,a))||(e=c.moveToClosestEditablePosition(b.selected,!a)),e&&d.getSelection().selectRanges([c]),d.fire("saveSnapshot"),b.selected.remove(),e||(c.moveToElementEditablePosition(d.editable()),d.getSelection().selectRanges([c])),d.fire("saveSnapshot"),!1}}var d=a(),c=a(1);return{37:d,38:d,39:c,40:c,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(a){function b(){var a=d.getSelection();a&&a.removeAllRanges()}var d=a.editor;d.on("contentDom", +function(){function a(){q=new CKEDITOR.dom.selection(d.getSelection());q.lock()}function b(){g.removeListener("mouseup",b);h.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,d=a.createRange();"None"!=a.type&&d.parentElement()&&d.parentElement().ownerDocument==e.$&&d.select()}function c(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")},!0))&&"false"===a.getAttribute("contenteditable")? +a:null:null}var e=d.document,g=CKEDITOR.document,f=d.editable(),m=e.getBody(),h=e.getDocumentElement(),w=f.isInline(),p,q;CKEDITOR.env.gecko&&f.attachListener(f,"focus",function(a){a.removeListener();0!==p&&(a=d.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==f.$&&(a=d.createRange(),a.moveToElementEditStart(f),a.select())},null,null,-2);f.attachListener(f,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(p&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){p=d._.previousActive&& +d._.previousActive.equals(e.getActive());var a=null!=d._.previousScrollTop&&d._.previousScrollTop!=f.$.scrollTop;CKEDITOR.env.webkit&&p&&a&&(f.$.scrollTop=d._.previousScrollTop)}d.unlockSelection(p);p=0},null,null,-1);f.attachListener(f,"mousedown",function(){p=0});if(CKEDITOR.env.ie||w)r?f.attachListener(f,"beforedeactivate",a,null,null,-1):f.attachListener(d,"selectionCheck",a,null,null,-1),f.attachListener(f,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusout":"blur",function(){d.lockSelection(q); +p=1},null,null,-1),f.attachListener(f,"mousedown",function(){p=0});if(CKEDITOR.env.ie&&!w){var v;f.attachListener(f,"mousedown",function(a){2==a.data.$.button&&((a=d.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(v=d.window.getScrollPosition()))});f.attachListener(f,"mouseup",function(a){2==a.data.$.button&&v&&(d.document.$.documentElement.scrollLeft=v.x,d.document.$.documentElement.scrollTop=v.y);v=null});if("BackCompat"!=e.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var x, +u;h.on("mousedown",function(a){function b(a){a=a.data.$;if(x){var d=m.$.createTextRange();try{d.moveToPoint(a.clientX,a.clientY)}catch(c){}x.setEndPoint(0>u.compareEndPoints("StartToStart",d)?"EndToEnd":"StartToStart",d);x.select()}}function d(){h.removeListener("mousemove",b);g.removeListener("mouseup",d);h.removeListener("mouseup",d);x.select()}a=a.data;if(a.getTarget().is("html")&&a.$.yCKEDITOR.env.version)h.on("mousedown",function(a){a.data.getTarget().is("html")&&(g.on("mouseup",b),h.on("mouseup",b))})}}f.attachListener(f,"selectionchange",l,d);f.attachListener(f,"keyup",k,d);f.attachListener(f,"touchstart",k,d);f.attachListener(f,"touchend",k,d);CKEDITOR.env.ie&&f.attachListener(f,"keydown",function(a){var b=this.getSelection(1),d=c(b);d&&!d.equals(f)&&(b.selectElement(d),a.data.preventDefault())}, +d);f.attachListener(f,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){d.forceNextSelectionCheck();d.selectionChange(1)});if(w&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var A;f.attachListener(f,"mousedown",function(){A=1});f.attachListener(e.getDocumentElement(),"mouseup",function(){A&&k.call(d);A=0})}else f.attachListener(CKEDITOR.env.ie?f:e.getDocumentElement(),"mouseup",k,d);CKEDITOR.env.webkit&&f.attachListener(e,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:f.hasFocus&& +n(f)}},null,null,-1);f.attachListener(f,"keydown",t(d),null,null,-1)});d.on("setData",function(){d.unlockSelection();CKEDITOR.env.webkit&&b()});d.on("contentDomUnload",function(){d.unlockSelection()});if(CKEDITOR.env.ie9Compat)d.on("beforeDestroy",b,null,null,9);d.on("dataReady",function(){delete d._.fakeSelection;delete d._.hiddenSelectionContainer;d.selectionChange(1)});d.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=d.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&& +(b.remove(),CKEDITOR.env.gecko&&(a=d.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);d.on("key",function(a){if("wysiwyg"==d.mode){var b=d.getSelection();if(b.isFake){var c=z[a.data.keyCode];if(c)return c({editor:d,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),d=a.getCustomData("cke-fillingChar"); +d&&(d.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):d.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){n(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=w(a.data))},b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=w(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?l:k).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection|| +a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);return a.getType()!=CKEDITOR.SELECTION_NONE?(!a.isLocked&&a.lock(),this._.savedSelection=a,!0):!1};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;return b?(b.unlock(a),delete this._.savedSelection,!0):!1};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath}; +CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var b=a;a=a.root}var d=a instanceof CKEDITOR.dom.element; +this.rev=b?b.rev:v++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=d?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b)return CKEDITOR.tools.extend(this._.cache,b._.cache),this.isFake=b.isFake,this.isLocked=b.isLocked,this;a=this.getNative();var c,e;if(a)if(a.getRangeAt)c=(e=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(g){}c=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!c|| +c.type!=CKEDITOR.NODE_ELEMENT&&c.type!=CKEDITOR.NODE_TEXT||!this.root.equals(c)&&!this.root.contains(c))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var J={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:w, +_createFillingCharSequenceNode:a,FILLING_CHAR_SEQUENCE:q});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=r?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:r?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var d=this.getNative(),c=d.type;"Text"==c&&(b=CKEDITOR.SELECTION_TEXT);"Control"==c&&(b=CKEDITOR.SELECTION_ELEMENT);d.createRange().parentElement()&& +(b=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,d=this.getNative();if(!d||!d.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==d.rangeCount){var d=d.getRangeAt(0),c=d.startContainer;c==d.endContainer&&1==c.nodeType&&1==d.endOffset-d.startOffset&&J[c.childNodes[d.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=r?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()} +var b=function(b,d){b=b.duplicate();b.collapse(d);var c=b.parentElement();if(!c.hasChildNodes())return{container:c,offset:0};for(var e=c.children,g,f,m=b.duplicate(),h=0,k=e.length-1,n=-1,l,r;h<=k;)if(n=Math.floor((h+k)/2),g=e[n],m.moveToElementText(g),l=m.compareEndPoints("StartToStart",b),0l)h=n+1;else return{container:c,offset:a(g)};if(-1==n||n==e.length-1&&0>l){m.moveToElementText(c);m.setEndPoint("StartToStart",b);m=m.text.replace(/(\r\n|\r)/g,"\n").length;e=c.childNodes;if(!m)return g= +e[e.length-1],g.nodeType!=CKEDITOR.NODE_TEXT?{container:c,offset:e.length}:{container:g,offset:g.nodeValue.length};for(c=e.length;0]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g," ");f=f.replace(/]*>/gi,"\n");if(CKEDITOR.env.ie){var m=b.getDocument().createElement("div"); +m.append(g);g.$.outerHTML="\x3cpre\x3e"+f+"\x3c/pre\x3e";g.copyAttributes(m.getFirst());g=m.getFirst().remove()}else g.setHtml(f);d=g}else f?d=w(c?[b.getHtml()]:a(b),d):b.moveChildren(d);d.replace(b);if(e){var c=d,h;(h=c.getPrevious(G))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("pre")&&(e=n(h.getHtml(),/\n$/,"")+"\n\n"+n(c.getHtml(),/^\n/,""),CKEDITOR.env.ie?c.$.outerHTML="\x3cpre\x3e"+e+"\x3c/pre\x3e":c.setHtml(e),h.remove())}else c&&r(d)}function a(a){var b=[];n(a.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, +function(a,b,d){return b+"\x3c/pre\x3e"+d+"\x3cpre\x3e"}).replace(/([\s\S]*?)<\/pre>/gi,function(a,d){b.push(d)});return b}function n(a,b,d){var c="",e="";a=a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,d){b&&(c=b);d&&(e=d);return""});return c+a.replace(b,d)+e}function w(a,b){var d;1=h?(l=b.createText(""),l.insertAfter(this)):(e=b.createText(""),e.insertAfter(l),e.remove()));return l},substring:function(e,f){return"number"!=typeof f?this.$.nodeValue.substr(e): +this.$.nodeValue.substring(e,f)}}),function(){function e(c,e,b){var f=c.serializable,k=e[b?"endContainer":"startContainer"],d=b?"endOffset":"startOffset",g=f?e.document.getById(c.startNode):c.startNode;c=f?e.document.getById(c.endNode):c.endNode;k.equals(g.getPrevious())?(e.startOffset=e.startOffset-k.getLength()-c.getPrevious().getLength(),k=c.getNext()):k.equals(c.getPrevious())&&(e.startOffset-=k.getLength(),k=c.getNext());k.equals(g.getParent())&&e[d]++;k.equals(c.getParent())&&e[d]++;e[b?"endContainer": +"startContainer"]=k;return e}CKEDITOR.dom.rangeList=function(c){if(c instanceof CKEDITOR.dom.rangeList)return c;c?c instanceof CKEDITOR.dom.range&&(c=[c]):c=[];return CKEDITOR.tools.extend(c,f)};var f={createIterator:function(){var c=this,e=CKEDITOR.dom.walker.bookmark(),b=[],f;return{getNextRange:function(k){f=void 0===f?0:f+1;var d=c[f];if(d&&1b?-1:1}),c=0,g;cCKEDITOR.env.version?b[f].$.styleSheet.cssText+=g:b[f].$.innerHTML+=g}}var l={};CKEDITOR.skin={path:e,loadPart:function(b,a){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e()+"skin.js"),function(){c(b,a)}):c(b,a)},getPath:function(b){return CKEDITOR.getUrl(f(b))},icons:{},addIcon:function(b,a,d,c){b= +b.toLowerCase();this.icons[b]||(this.icons[b]={path:a,offset:d||0,bgsize:c||"16px"})},getIconStyle:function(b,a,d,c,e){var g;b&&(b=b.toLowerCase(),a&&(g=this.icons[b+"-rtl"]),g||(g=this.icons[b]));b=d||g&&g.path||"";c=c||g&&g.offset;e=e||g&&g.bgsize||"16px";b&&(b=b.replace(/'/g,"\\'"));return b&&"background-image:url('"+CKEDITOR.getUrl(b)+"');background-position:0 "+c+"px;background-size:"+e+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(c){var a= +h(CKEDITOR.document);return(this.setUiColor=function(c){this.uiColor=c;var e=CKEDITOR.skin.chameleon,f="",m="";"function"==typeof e&&(f=e(this,"editor"),m=e(this,"panel"));c=[[g,c]];b([a],f,c);b(d,m,c)}).call(this,c)}});var k="cke_ui_color",d=[],g=/\$color/g;CKEDITOR.on("instanceLoaded",function(c){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var a=c.editor;c=function(c){c=(c.data[0]||c.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!c.getById("cke_ui_color")){c=h(c);d.push(c); +var e=a.getUiColor();e&&b([c],CKEDITOR.skin.chameleon(a,"panel"),[[g,e]])}};a.on("panelShow",c);a.on("menuShow",c);a.config.uiColor&&a.setUiColor(a.config.uiColor)}})}(),function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var e=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',CKEDITOR.document);e.appendTo(CKEDITOR.document.getHead());try{var f=e.getComputedStyle("border-top-color"), +c=e.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!f||f!=c)}catch(h){CKEDITOR.env.hc=!1}e.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc");CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(e=CKEDITOR._.pending)for(delete CKEDITOR._.pending,f=0;ff;f++){var k=f,d;d=parseInt(b[f],16);d=("0"+(0>e?0|d*(1+e):0|d+(255-d)*e).toString(16)).slice(-2);b[k]=d}return"#"+b.join("")}}(),f={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover,{id} a.cke_path_item:focus,{id} a.cke_path_item:active [background-color:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] "), panel:new CKEDITOR.template(".cke_panel_grouptitle [background-color:{lightBackground};border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active [background-color:{menubuttonHover};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")}; -return function(e,k){var d=f(e.uiColor,.4),d={id:"."+e.id,defaultBorder:f(d,-.2),toolbarElementsBorder:f(d,-.25),defaultBackground:d,lightBackground:f(d,.8),darkBackground:f(d,-.15),ckeButtonOn:f(d,.4),ckeResizer:f(d,-.4),ckeColorauto:f(d,.8),dialogBody:f(d,.7),dialogTab:f(d,.65),dialogTabSelected:"#FFF",dialogTabSelectedBorder:"#FFF",elementsPathColor:f(d,-.6),menubuttonHover:f(d,.1),menubuttonIcon:f(d,.5),menubuttonIconHover:f(d,.3)};return h[k].output(d).replace(/\[/g,"{").replace(/\]/g,"}")}}(), -CKEDITOR.plugins.add("dialogui",{onLoad:function(){var f=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var c=[this._],a=1;aarguments.length)){var e=f.call(this,c);e.labelId=CKEDITOR.tools.getNextId()+ -"_label";this._.children=[];var h={role:c.role||"presentation"};c.includeLabel&&(h["aria-labelledby"]=e.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,c,a,"div",null,h,function(){var a=[],f=c.required?" cke_required":"";"horizontal"!=c.labelLayout?a.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+f+'" ',' id\x3d"'+e.labelId+'"',e.inputId?' for\x3d"'+e.inputId+'"':"",(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e",c.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"', -c.controlStyle?' style\x3d"'+c.controlStyle+'"':"",' role\x3d"presentation"\x3e',d.call(this,b,c),"\x3c/div\x3e"):(f={type:"hbox",widths:c.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+f+'" id\x3d"'+e.labelId+'" for\x3d"'+e.inputId+'"'+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(c.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+(c.controlStyle?' style\x3d"'+c.controlStyle+ -'"':"")+"\x3e"+d.call(this,b,c)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,f,a));return a.join("")})}},textInput:function(d,c,a){if(!(3>arguments.length)){f.call(this,c);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",h={"class":"cke_dialog_ui_input_"+c.type,id:e,type:c.type};c.validate&&(this.validate=c.validate);c.maxLength&&(h.maxlength=c.maxLength);c.size&&(h.size=c.size);c.inputStyle&&(h.style=c.inputStyle);var k=this,l=!1;d.on("load",function(){k.getInputElement().on("keydown", -function(a){13==a.data.getKeystroke()&&(l=!0)});k.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&l&&(d.getButton("ok")&&setTimeout(function(){d.getButton("ok").click()},0),l=!1);k.bidi&&b.call(k,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,d,c,a,function(){var a=['\x3cdiv class\x3d"cke_dialog_ui_input_',c.type,'" role\x3d"presentation"'];c.width&&a.push('style\x3d"width:'+c.width+'" ');a.push("\x3e\x3cinput ");h["aria-labelledby"]=this._.labelId;this._.required&& -(h["aria-required"]=this._.required);for(var b in h)a.push(b+'\x3d"'+h[b]+'" ');a.push(" /\x3e\x3c/div\x3e");return a.join("")})}},textarea:function(d,c,a){if(!(3>arguments.length)){f.call(this,c);var e=this,h=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",k={};c.validate&&(this.validate=c.validate);k.rows=c.rows||5;k.cols=c.cols||20;k["class"]="cke_dialog_ui_input_textarea "+(c["class"]||"");"undefined"!=typeof c.inputStyle&&(k.style=c.inputStyle);c.dir&&(k.dir=c.dir);if(e.bidi)d.on("load", -function(){e.getInputElement().on("keyup",b)},e);CKEDITOR.ui.dialog.labeledElement.call(this,d,c,a,function(){k["aria-labelledby"]=this._.labelId;this._.required&&(k["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',h,'" '],c;for(c in k)a.push(c+'\x3d"'+CKEDITOR.tools.htmlEncode(k[c])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(e._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b, -c,a){if(!(3>arguments.length)){var d=f.call(this,c,{"default":!!c["default"]});c.validate&&(this.validate=c.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,c,a,"span",null,null,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),e=[],f=CKEDITOR.tools.getNextId()+"_label",h={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":f};m(a);c["default"]&&(h.checked="checked");"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle); -d.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,e,"input",null,h);e.push(' \x3clabel id\x3d"',f,'" for\x3d"',h.id,'"'+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(c.label),"\x3c/label\x3e");return e.join("")})}},radio:function(b,c,a){if(!(3>arguments.length)){f.call(this,c);this._["default"]||(this._["default"]=this._.initValue=c.items[0][1]);c.validate&&(this.validate=c.validate);var d=[],e=this;c.role="radiogroup";c.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this, -b,c,a,function(){for(var a=[],f=[],h=(c.id?c.id:CKEDITOR.tools.getNextId())+"_radio",k=0;karguments.length)){var d=f.call(this,c);c.validate&&(this.validate=c.validate);d.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,c,a,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),e=[],f=[],h={id:d.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};e.push('\x3cdiv class\x3d"cke_dialog_ui_input_', -c.type,'" role\x3d"presentation"');c.width&&e.push('style\x3d"width:'+c.width+'" ');e.push("\x3e");void 0!==c.size&&(h.size=c.size);void 0!==c.multiple&&(h.multiple=c.multiple);m(a);for(var k=0,l;karguments.length)){void 0===c["default"]&&(c["default"]="");var d=CKEDITOR.tools.extend(f.call(this,c),{definition:c,buttons:[]});c.validate&&(this.validate=c.validate);b.on("load",function(){CKEDITOR.document.getById(d.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,a,function(){d.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var a=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"', -d.frameId,'" title\x3d"',c.label,'" src\x3d"javascript:void('];a.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");a.push(')"\x3e\x3c/iframe\x3e');return a.join("")})}},fileButton:function(b,c,a){var d=this;if(!(3>arguments.length)){f.call(this,c);c.validate&&(this.validate=c.validate);var e=CKEDITOR.tools.extend({},c),h=e.onClick;e.className=(e.className?e.className+" ":"")+"cke_dialog_ui_button";e.onClick=function(a){var d= -c["for"];a=h?h.call(this,a):!1;!1!==a&&("xhr"!==a&&b.getContentElement(d[0],d[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(c["for"][0],c["for"][1])._.buttons.push(d)});CKEDITOR.ui.dialog.button.call(this,b,e,a)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,c=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,a=/\/$/;return function(d,e,f){if(!(3>arguments.length)){var h=[],k=e.html;"\x3c"!=k.charAt(0)&&(k="\x3cspan\x3e"+k+"\x3c/span\x3e");var l=e.focus;if(l){var m=this.focus; -this.focus=function(){("function"==typeof l?l:m).call(this);this.fire("focus")};e.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,d,e,h,"span",null,null,"");h=h.join("").match(b);k=k.match(c)||["","",""];a.test(k[1])&&(k[1]=k[1].slice(0,-1),k[2]="/"+k[2]);f.push([k[1]," ",h[1]||"",k[2]].join(""))}}}(),fieldset:function(b,c,a,d,e){var f=e.label;this._={children:c};CKEDITOR.ui.dialog.uiElement.call(this,b,e,d,"fieldset",null,null,function(){var c= -[];f&&c.push("\x3clegend"+(e.labelStyle?' style\x3d"'+e.labelStyle+'"':"")+"\x3e"+f+"\x3c/legend\x3e");for(var b=0;bc.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(c):c.getChild(0).$.nodeValue= -b;return this},getLabel:function(){var b=CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:d},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var b=this.getElement();b&&b.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")}, -isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(b,c){this.on("click",function(){c.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)}, -focus:function(){var b=this.selectParentTab();setTimeout(function(){var c=b.getInputElement();c&&c.$.focus()},0)},select:function(){var b=this.selectParentTab();setTimeout(function(){var c=b.getInputElement();c&&(c.$.focus(),c.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(b){if(this.bidi){var c=b&&b.charAt(0);(c="‪"==c?"ltr":"‫"==c?"rtl":null)&&(b=b.slice(1));this.setDirectionMarker(c)}b||(b="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)}, -getValue:function(){var b=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&b){var c=this.getDirectionMarker();c&&(b=("ltr"==c?"‪":"‫")+b)}return b},setDirectionMarker:function(b){var c=this.getInputElement();b?c.setAttributes({dir:b,"data-cke-dir-marker":b}):this.getDirectionMarker()&&c.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},k,!0);CKEDITOR.ui.dialog.textarea.prototype= -new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(b,c,a){var d=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),e=this.getInputElement().$;d.$.text=b;d.$.value=void 0===c||null===c?b:c;void 0===a||null===a?CKEDITOR.env.ie?e.add(d.$):e.add(d.$,null):e.add(d.$,a);return this},remove:function(b){this.getInputElement().$.remove(b); -return this},clear:function(){for(var b=this.getInputElement().$;0b-a;c--)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function h(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;cn.width-k.width-f?n.width-k.width+("rtl"==e.lang.dir?0:h[1]):g.x,g.y+h[0]n.height-k.height-f?n.height-k.height+h[2]:g.y,1);c.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove", -b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=x.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",c)}}var d=null,g=null,e=a.getParentEditor(),f=e.config.dialog_magnetDistance,h=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof f&&(f=20);a.parts.title.on("mousedown",function(e){d={x:e.data.$.screenX,y:e.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);g=a.getPosition();if(CKEDITOR.env.ie6Compat){var f= -x.getChild(0).getFrameDocument();f.on("mousemove",b);f.on("mouseup",c)}e.data.preventDefault()},a)}function a(a){function b(c){var m="rtl"==e.lang.dir,q=l.width,r=l.height,p=q+(c.data.$.screenX-n.x)*(m?-1:1)*(a._.moved?1:2),u=r+(c.data.$.screenY-n.y)*(a._.moved?1:2),w=a._.element.getFirst(),w=m&&w.getComputedStyle("right"),t=a.getPosition();t.y+u>k.height&&(u=k.height-t.y);(m?w:t.x)+p>k.width&&(p=k.width-(m?w:t.x));if(g==CKEDITOR.DIALOG_RESIZE_WIDTH||g==CKEDITOR.DIALOG_RESIZE_BOTH)q=Math.max(d.minWidth|| -0,p-f);if(g==CKEDITOR.DIALOG_RESIZE_HEIGHT||g==CKEDITOR.DIALOG_RESIZE_BOTH)r=Math.max(d.minHeight||0,u-h);a.resize(q,r);a._.moved||a.layout();c.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mouseup",c);CKEDITOR.document.removeListener("mousemove",b);m&&(m.remove(),m=null);if(CKEDITOR.env.ie6Compat){var a=x.getChild(0).getFrameDocument();a.removeListener("mouseup",c);a.removeListener("mousemove",b)}}var d=a.definition,g=d.resizable;if(g!=CKEDITOR.DIALOG_RESIZE_NONE){var e=a.getParentEditor(), -f,h,k,n,l,m,q=CKEDITOR.tools.addFunction(function(d){l=a.getSize();var g=a.parts.contents;g.$.getElementsByTagName("iframe").length&&(m=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%;"\x3e\x3c/div\x3e'),g.append(m));h=l.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks));f=l.width-a.parts.contents.getSize("width",1);n={x:d.screenX,y:d.screenY};k=CKEDITOR.document.getWindow().getViewPaneSize(); -CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);CKEDITOR.env.ie6Compat&&(g=x.getChild(0).getFrameDocument(),g.on("mousemove",b),g.on("mouseup",c));d.preventDefault&&d.preventDefault()});a.on("load",function(){var b="";g==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":g==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+b+" cke_resizer_"+e.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(e.lang.common.resize)+ -'" onmousedown\x3d"CKEDITOR.tools.callFunction('+q+', event )"\x3e'+("ltr"==e.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});e.on("destroy",function(){CKEDITOR.tools.removeFunction(q)})}}function n(a){a.data.preventDefault(1)}function w(a){var b=CKEDITOR.document.getWindow(),c=a.config,d=CKEDITOR.skinName||a.config.skin,g=c.dialog_backgroundCoverColor||("moono-lisa"==d?"black":"white"),d=c.dialog_backgroundCoverOpacity,e=c.baseFloatZIndex,c=CKEDITOR.tools.genKey(g,d,e),f=y[c];f?f.show(): -(e=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",e,"; top: 0px; left: 0px; ",CKEDITOR.env.ie6Compat?"":"background-color: "+g,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(g="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+g+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",e.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),e.push("void((function(){"+encodeURIComponent("document.open();("+ -CKEDITOR.tools.fixDomain+")();document.write( '"+g+"' );document.close();")+"})())"),e.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),e.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(e.join("")),f.setOpacity(void 0!==d?d:.5),f.on("keydown",n),f.on("keypress",n),f.on("keyup",n),f.appendTo(CKEDITOR.document.getBody()),y[c]=f);a.focusManager.add(f);x=f;a=function(){var a=b.getViewPaneSize(); -f.setStyles({width:a.width+"px",height:a.height+"px"})};var h=function(){var a=b.getScrollPosition(),c=CKEDITOR.dialog._.currentTop;f.setStyles({left:a.x+"px",top:a.y+"px"});if(c){do a=c.getPosition(),c.move(a.x,a.y);while(c=c._.parentDialog)}};u=a;b.on("resize",a);a();CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus();if(CKEDITOR.env.ie6Compat){var k=function(){h();arguments.callee.prevScrollHandler.apply(this,arguments)};b.$.setTimeout(function(){k.prevScrollHandler=window.onscroll||function(){}; -window.onscroll=k},0);h()}}function v(a){x&&(a.focusManager.remove(x),a=CKEDITOR.document.getWindow(),x.hide(),a.removeListener("resize",u),CKEDITOR.env.ie6Compat&&a.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0),u=null)}var t=CKEDITOR.tools.cssLength,p='\x3cdiv class\x3d"cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog '+ +return function(c,h){var b=e(c.uiColor,.4),b={id:"."+c.id,defaultBorder:e(b,-.2),toolbarElementsBorder:e(b,-.25),defaultBackground:b,lightBackground:e(b,.8),darkBackground:e(b,-.15),ckeButtonOn:e(b,.4),ckeResizer:e(b,-.4),ckeColorauto:e(b,.8),dialogBody:e(b,.7),dialogTab:e(b,.65),dialogTabSelected:"#FFF",dialogTabSelectedBorder:"#FFF",elementsPathColor:e(b,-.6),menubuttonHover:e(b,.1),menubuttonIcon:e(b,.5),menubuttonIconHover:e(b,.3)};return f[h].output(b).replace(/\[/g,"{").replace(/\]/g,"}")}}(), +CKEDITOR.plugins.add("dialogui",{onLoad:function(){var e=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var d=[this._],a=1;aarguments.length)){var f=e.call(this,d);f.labelId=CKEDITOR.tools.getNextId()+ +"_label";this._.children=[];var h={role:d.role||"presentation"};d.includeLabel&&(h["aria-labelledby"]=f.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,d,a,"div",null,h,function(){var a=[],e=d.required?" cke_required":"";"horizontal"!=d.labelLayout?a.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+e+'" ',' id\x3d"'+f.labelId+'"',f.inputId?' for\x3d"'+f.inputId+'"':"",(d.labelStyle?' style\x3d"'+d.labelStyle+'"':"")+"\x3e",d.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"', +d.controlStyle?' style\x3d"'+d.controlStyle+'"':"",' role\x3d"presentation"\x3e',c.call(this,b,d),"\x3c/div\x3e"):(e={type:"hbox",widths:d.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+e+'" id\x3d"'+f.labelId+'" for\x3d"'+f.inputId+'"'+(d.labelStyle?' style\x3d"'+d.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(d.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+(d.controlStyle?' style\x3d"'+d.controlStyle+ +'"':"")+"\x3e"+c.call(this,b,d)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,e,a));return a.join("")})}},textInput:function(b,c,a){if(!(3>arguments.length)){e.call(this,c);var f=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",h={"class":"cke_dialog_ui_input_"+c.type,id:f,type:c.type};c.validate&&(this.validate=c.validate);c.maxLength&&(h.maxlength=c.maxLength);c.size&&(h.size=c.size);c.inputStyle&&(h.style=c.inputStyle);var k=this,l=!1;b.on("load",function(){k.getInputElement().on("keydown", +function(a){13==a.data.getKeystroke()&&(l=!0)});k.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&l&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),l=!1);k.bidi&&d.call(k,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,a,function(){var a=['\x3cdiv class\x3d"cke_dialog_ui_input_',c.type,'" role\x3d"presentation"'];c.width&&a.push('style\x3d"width:'+c.width+'" ');a.push("\x3e\x3cinput ");h["aria-labelledby"]=this._.labelId;this._.required&& +(h["aria-required"]=this._.required);for(var b in h)a.push(b+'\x3d"'+h[b]+'" ');a.push(" /\x3e\x3c/div\x3e");return a.join("")})}},textarea:function(b,c,a){if(!(3>arguments.length)){e.call(this,c);var f=this,h=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",k={};c.validate&&(this.validate=c.validate);k.rows=c.rows||5;k.cols=c.cols||20;k["class"]="cke_dialog_ui_input_textarea "+(c["class"]||"");"undefined"!=typeof c.inputStyle&&(k.style=c.inputStyle);c.dir&&(k.dir=c.dir);if(f.bidi)b.on("load", +function(){f.getInputElement().on("keyup",d)},f);CKEDITOR.ui.dialog.labeledElement.call(this,b,c,a,function(){k["aria-labelledby"]=this._.labelId;this._.required&&(k["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',h,'" '],b;for(b in k)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(k[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(f._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b, +d,a){if(!(3>arguments.length)){var c=e.call(this,d,{"default":!!d["default"]});d.validate&&(this.validate=d.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,d,a,"span",null,null,function(){var a=CKEDITOR.tools.extend({},d,{id:d.id?d.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),e=[],f=CKEDITOR.tools.getNextId()+"_label",h={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":f};k(a);d["default"]&&(h.checked="checked");"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle); +c.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,e,"input",null,h);e.push(' \x3clabel id\x3d"',f,'" for\x3d"',h.id,'"'+(d.labelStyle?' style\x3d"'+d.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(d.label),"\x3c/label\x3e");return e.join("")})}},radio:function(b,d,a){if(!(3>arguments.length)){e.call(this,d);this._["default"]||(this._["default"]=this._.initValue=d.items[0][1]);d.validate&&(this.validate=d.validate);var c=[],f=this;d.role="radiogroup";d.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this, +b,d,a,function(){for(var a=[],e=[],h=(d.id?d.id:CKEDITOR.tools.getNextId())+"_radio",l=0;larguments.length)){var c=e.call(this,d);d.validate&&(this.validate=d.validate);c.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,d,a,function(){var a=CKEDITOR.tools.extend({},d,{id:d.id?d.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),e=[],f=[],h={id:c.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};e.push('\x3cdiv class\x3d"cke_dialog_ui_input_', +d.type,'" role\x3d"presentation"');d.width&&e.push('style\x3d"width:'+d.width+'" ');e.push("\x3e");void 0!==d.size&&(h.size=d.size);void 0!==d.multiple&&(h.multiple=d.multiple);k(a);for(var l=0,v;larguments.length)){void 0===d["default"]&&(d["default"]="");var c=CKEDITOR.tools.extend(e.call(this,d),{definition:d,buttons:[]});d.validate&&(this.validate=d.validate);b.on("load",function(){CKEDITOR.document.getById(c.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,d,a,function(){c.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var a=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"', +c.frameId,'" title\x3d"',d.label,'" src\x3d"javascript:void('];a.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");a.push(')"\x3e\x3c/iframe\x3e');return a.join("")})}},fileButton:function(b,d,a){var c=this;if(!(3>arguments.length)){e.call(this,d);d.validate&&(this.validate=d.validate);var f=CKEDITOR.tools.extend({},d),h=f.onClick;f.className=(f.className?f.className+" ":"")+"cke_dialog_ui_button";f.onClick=function(a){var c= +d["for"];a=h?h.call(this,a):!1;!1!==a&&("xhr"!==a&&b.getContentElement(c[0],c[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(d["for"][0],d["for"][1])._.buttons.push(c)});CKEDITOR.ui.dialog.button.call(this,b,f,a)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,d=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,a=/\/$/;return function(c,e,f){if(!(3>arguments.length)){var h=[],k=e.html;"\x3c"!=k.charAt(0)&&(k="\x3cspan\x3e"+k+"\x3c/span\x3e");var l=e.focus;if(l){var v=this.focus; +this.focus=function(){("function"==typeof l?l:v).call(this);this.fire("focus")};e.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,c,e,h,"span",null,null,"");h=h.join("").match(b);k=k.match(d)||["","",""];a.test(k[1])&&(k[1]=k[1].slice(0,-1),k[2]="/"+k[2]);f.push([k[1]," ",h[1]||"",k[2]].join(""))}}}(),fieldset:function(b,d,a,c,e){var f=e.label;this._={children:d};CKEDITOR.ui.dialog.uiElement.call(this,b,e,c,"fieldset",null,null,function(){var b= +[];f&&b.push("\x3clegend"+(e.labelStyle?' style\x3d"'+e.labelStyle+'"':"")+"\x3e"+f+"\x3c/legend\x3e");for(var d=0;dd.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(d):d.getChild(0).$.nodeValue= +b;return this},getLabel:function(){var b=CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:b},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var b=this.getElement();b&&b.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")}, +isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(b,d){this.on("click",function(){d.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)}, +focus:function(){var b=this.selectParentTab();setTimeout(function(){var d=b.getInputElement();d&&d.$.focus()},0)},select:function(){var b=this.selectParentTab();setTimeout(function(){var d=b.getInputElement();d&&(d.$.focus(),d.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(b){if(this.bidi){var d=b&&b.charAt(0);(d="‪"==d?"ltr":"‫"==d?"rtl":null)&&(b=b.slice(1));this.setDirectionMarker(d)}b||(b="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)}, +getValue:function(){var b=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&b){var d=this.getDirectionMarker();d&&(b=("ltr"==d?"‪":"‫")+b)}return b},setDirectionMarker:function(b){var d=this.getInputElement();b?d.setAttributes({dir:b,"data-cke-dir-marker":b}):this.getDirectionMarker()&&d.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},h,!0);CKEDITOR.ui.dialog.textarea.prototype= +new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(b,d,a){var c=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),e=this.getInputElement().$;c.$.text=b;c.$.value=void 0===d||null===d?b:d;void 0===a||null===a?CKEDITOR.env.ie?e.add(c.$):e.add(c.$,null):e.add(c.$,a);return this},remove:function(b){this.getInputElement().$.remove(b); +return this},clear:function(){for(var b=this.getInputElement().$;0b-a;d--)if(this._.tabs[this._.tabIdList[d%a]][0].$.offsetHeight)return this._.tabIdList[d%a];return null}function f(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),d=b+1;dm.width-k.width-f?m.width-k.width+("rtl"==g.lang.dir?0:h[1]):e.x,e.y+h[0]m.height-k.height-f?m.height-k.height+h[2]:e.y,1);d.data.preventDefault()} +function d(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",d);if(CKEDITOR.env.ie6Compat){var a=D.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",d)}}var c=null,e=null,g=a.getParentEditor(),f=g.config.dialog_magnetDistance,h=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof f&&(f=20);a.parts.title.on("mousedown",function(g){c={x:g.data.$.screenX,y:g.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup", +d);e=a.getPosition();if(CKEDITOR.env.ie6Compat){var f=D.getChild(0).getFrameDocument();f.on("mousemove",b);f.on("mouseup",d)}g.data.preventDefault()},a)}function a(a){function b(d){var n="rtl"==g.lang.dir,r=l.width,q=l.height,p=r+(d.data.$.screenX-m.x)*(n?-1:1)*(a._.moved?1:2),w=q+(d.data.$.screenY-m.y)*(a._.moved?1:2),v=a._.element.getFirst(),v=n&&v.getComputedStyle("right"),x=a.getPosition();x.y+w>k.height&&(w=k.height-x.y);(n?v:x.x)+p>k.width&&(p=k.width-(n?v:x.x));if(e==CKEDITOR.DIALOG_RESIZE_WIDTH|| +e==CKEDITOR.DIALOG_RESIZE_BOTH)r=Math.max(c.minWidth||0,p-f);if(e==CKEDITOR.DIALOG_RESIZE_HEIGHT||e==CKEDITOR.DIALOG_RESIZE_BOTH)q=Math.max(c.minHeight||0,w-h);a.resize(r,q);a._.moved||a.layout();d.data.preventDefault()}function d(){CKEDITOR.document.removeListener("mouseup",d);CKEDITOR.document.removeListener("mousemove",b);n&&(n.remove(),n=null);if(CKEDITOR.env.ie6Compat){var a=D.getChild(0).getFrameDocument();a.removeListener("mouseup",d);a.removeListener("mousemove",b)}}var c=a.definition,e=c.resizable; +if(e!=CKEDITOR.DIALOG_RESIZE_NONE){var g=a.getParentEditor(),f,h,k,m,l,n,r=CKEDITOR.tools.addFunction(function(c){l=a.getSize();var e=a.parts.contents;e.$.getElementsByTagName("iframe").length&&(n=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%;"\x3e\x3c/div\x3e'),e.append(n));h=l.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks));f=l.width-a.parts.contents.getSize("width", +1);m={x:c.screenX,y:c.screenY};k=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",d);CKEDITOR.env.ie6Compat&&(e=D.getChild(0).getFrameDocument(),e.on("mousemove",b),e.on("mouseup",d));c.preventDefault&&c.preventDefault()});a.on("load",function(){var b="";e==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":e==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+ +b+" cke_resizer_"+g.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(g.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+r+', event )"\x3e'+("ltr"==g.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});g.on("destroy",function(){CKEDITOR.tools.removeFunction(r)})}}function n(a){a.data.preventDefault(1)}function w(a){var b=CKEDITOR.document.getWindow(),d=a.config,c=CKEDITOR.skinName||a.config.skin,e=d.dialog_backgroundCoverColor||("moono-lisa"==c?"black":"white"),c=d.dialog_backgroundCoverOpacity, +g=d.baseFloatZIndex,d=CKEDITOR.tools.genKey(e,c,g),f=A[d];f?f.show():(g=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",g,"; top: 0px; left: 0px; ",CKEDITOR.env.ie6Compat?"":"background-color: "+e,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(e="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+e+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",g.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'), +g.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+e+"' );document.close();")+"})())"),g.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),g.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(g.join("")),f.setOpacity(void 0!==c?c:.5),f.on("keydown",n),f.on("keypress",n),f.on("keyup",n),f.appendTo(CKEDITOR.document.getBody()), +A[d]=f);a.focusManager.add(f);D=f;a=function(){var a=b.getViewPaneSize();f.setStyles({width:a.width+"px",height:a.height+"px"})};var h=function(){var a=b.getScrollPosition(),d=CKEDITOR.dialog._.currentTop;f.setStyles({left:a.x+"px",top:a.y+"px"});if(d){do a=d.getPosition(),d.move(a.x,a.y);while(d=d._.parentDialog)}};y=a;b.on("resize",a);a();CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus();if(CKEDITOR.env.ie6Compat){var k=function(){h();arguments.callee.prevScrollHandler.apply(this,arguments)};b.$.setTimeout(function(){k.prevScrollHandler= +window.onscroll||function(){};window.onscroll=k},0);h()}}function u(a){D&&(a.focusManager.remove(D),a=CKEDITOR.document.getWindow(),D.hide(),a.removeListener("resize",y),CKEDITOR.env.ie6Compat&&a.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0),y=null)}var t=CKEDITOR.tools.cssLength,p='\x3cdiv class\x3d"cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog '+ CKEDITOR.env.cssClass+' cke_{langDir}" style\x3d"position:absolute" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e'; -CKEDITOR.dialog=function(b,g){function e(){var a=z._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;cb.length)){var c=z._.currentFocusIndex;z._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(d){}var g=c,e=1b.length)){var d=z._.currentFocusIndex;z._.tabBarMode&&0>a&&(d=0);try{b[d].getInputElement().$.blur()}catch(c){}var e=d,g=1c.height||b.width+(0c.width?a.setStyle("position","absolute"):a.setStyle("position","fixed"));this.move(this._.moved?this._.position.x:d,this._.moved?this._.position.y:g)},foreach:function(a){for(var b in this._.contents)for(var c in this._.contents[b])a.call(this,this._.contents[b][c]);return this},reset:function(){var a=function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(), +2),CKEDITOR.dialog._.currentTop=this);a.on("keydown",J);a.on("keyup",E);this._.hasFocus=!1;for(var c in b.contents)if(b.contents[c]){var a=b.contents[c],e=this._.tabs[a.id],g=a.requiredContent,f=0;if(e){for(var h in this._.contents[a.id]){var k=this._.contents[a.id][h];"hbox"!=k.type&&"vbox"!=k.type&&k.getInputElement()&&(k.requiredContent&&!this._.editor.activeFilter.check(k.requiredContent)?k.disable():(k.enable(),f++))}!f||g&&!this._.editor.activeFilter.check(g)?e[0].addClass("cke_dialog_tab_disabled"): +e[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout();d(this);this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});CKEDITOR.ui.fire("ready",this);this.fire("show",{});this._.editor.fire("dialogShow",this);this._.parentDialog||this._.editor.focusManager.lock();this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=this.parts.dialog,b=this.getSize(),d=CKEDITOR.document.getWindow().getViewPaneSize(),c= +(d.width-b.width)/2,e=(d.height-b.height)/2;CKEDITOR.env.ie6Compat||(b.height+(0d.height||b.width+(0d.width?a.setStyle("position","absolute"):a.setStyle("position","fixed"));this.move(this._.moved?this._.position.x:c,this._.moved?this._.position.y:e)},foreach:function(a){for(var b in this._.contents)for(var d in this._.contents[b])a.call(this,this._.contents[b][d]);return this},reset:function(){var a=function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(), setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",this);this.selectPage(this._.tabIdList[0]);var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility", -"hidden");for(H(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else v(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",I);a.removeListener("keyup",F);var c=this._.editor; -c.focus();setTimeout(function(){c.focusManager.unlock();CKEDITOR.env.iOS&&c.window.focus()},0)}delete this._.parentDialog;this.foreach(function(a){a.resetInitValue&&a.resetInitValue()});this.setState(CKEDITOR.DIALOG_STATE_IDLE)}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],c=a.label?' title\x3d"'+CKEDITOR.tools.htmlEncode(a.label)+'"':"",d=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents", -children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),g=this._.contents[a.id]={},e=d.getChild(),f=0;d=e.shift();)d.notAllowed||"hbox"==d.type||"vbox"==d.type||f++,g[d.id]=d,"function"==typeof d.getChild&&e.push.apply(e,d.getChild());f||(a.hidden=!0);b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");d=CKEDITOR.env;g="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();c=CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"', -0arguments.length)){var h=(d.call?d(b):d)||"div",k=["\x3c",h," "],n=(g&&g.call?g(b):g)||{},l=(e&&e.call?e(b):e)||{},m=(f&&f.call?f.call(this,a,b):f)||"",q=this.domId=l.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(n.display="none",this.notAllowed=!0);l.id=q;var p={};b.type&&(p["cke_dialog_ui_"+ -b.type]=1);b.className&&(p[b.className]=1);b.disabled&&(p.cke_disabled=1);for(var r=l["class"]&&l["class"].split?l["class"].split(" "):[],q=0;qCKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;u.fire("focus"); -c&&this.addClass(c)});b.on("blur",function(){u.fire("blur");c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=u.focusIndex}))}},hbox:function(a,b,c,d,g){if(!(4>arguments.length)){this._||(this._={});var e=this._.children=b,f=g&&g.widths||null,h=g&&g.height||null,k,n={role:"presentation"};g&&g.align&&(n.align=g.align);CKEDITOR.ui.dialog.uiElement.call(this, -a,g||{type:"hbox"},d,"table",{},n,function(){var a=['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(k=0;karguments.length)){this._||(this._={});var e=this._.children=b,f=g&&g.width||null,h=g&&g.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,g||{type:"vbox"},d,"div",null,{role:"presentation"},function(){var b=['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" ']; -b.push('style\x3d"');g&&g.expand&&b.push("height:100%;");b.push("width:"+t(f||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align\x3d"',CKEDITOR.tools.htmlEncode(g&&g.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("\x3e\x3ctbody\x3e");for(var d=0;darguments.length)){var h=(c.call?c(b):c)||"div",k=["\x3c",h," "],m=(e&&e.call?e(b):e)||{},l=(g&&g.call?g(b):g)||{},n=(f&&f.call?f.call(this,a,b):f)||"",r=this.domId=l.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(m.display="none",this.notAllowed=!0);l.id=r;var q={};b.type&&(q["cke_dialog_ui_"+ +b.type]=1);b.className&&(q[b.className]=1);b.disabled&&(q.cke_disabled=1);for(var p=l["class"]&&l["class"].split?l["class"].split(" "):[],r=0;rCKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;w.fire("focus"); +d&&this.addClass(d)});b.on("blur",function(){w.fire("blur");d&&this.removeClass(d)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=w.focusIndex}))}},hbox:function(a,b,d,c,e){if(!(4>arguments.length)){this._||(this._={});var g=this._.children=b,f=e&&e.widths||null,h=e&&e.height||null,k,m={role:"presentation"};e&&e.align&&(m.align=e.align);CKEDITOR.ui.dialog.uiElement.call(this, +a,e||{type:"hbox"},c,"table",{},m,function(){var a=['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(k=0;karguments.length)){this._||(this._={});var g=this._.children=b,f=e&&e.width||null,h=e&&e.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"vbox"},c,"div",null,{role:"presentation"},function(){var b=['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" ']; +b.push('style\x3d"');e&&e.expand&&b.push("height:100%;");b.push("width:"+t(f||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align\x3d"',CKEDITOR.tools.htmlEncode(e&&e.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("\x3e\x3ctbody\x3e");for(var c=0;carguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a,b,c){for(var d=b.children,g,e=[],f=[],h=0;hb.$.clientHeight?b.setStyle("overflow-y","hidden"):b.removeStyle("overflow-y"))}var d,l,m,b,g,c=f.config.autoGrow_bottomSpace|| -0,a=void 0!==f.config.autoGrow_minHeight?f.config.autoGrow_minHeight:200,n=f.config.autoGrow_maxHeight||Infinity,w=!f.config.autoGrow_maxHeight;f.addCommand("autogrow",{exec:k,modes:{wysiwyg:1},readOnly:1,canUndo:!1,editorFocus:!1});var v={contentDom:1,key:1,selectionChange:1,insertElement:1,mode:1},t;for(t in v)f.on(t,function(a){"wysiwyg"==a.editor.mode&&setTimeout(function(){var a=f.getCommand("maximize");!f.window||a&&a.state==CKEDITOR.TRISTATE_ON?d=null:(k(),w||k())},100)});f.on("afterCommandExec", -function(a){"maximize"==a.data.name&&"wysiwyg"==a.editor.mode&&(a.data.command.state==CKEDITOR.TRISTATE_ON?b.removeStyle("overflow-y"):k())});f.on("contentDom",e);e();f.config.autoGrow_onStartup&&f.editable().isVisible()&&f.execCommand("autogrow")}CKEDITOR.plugins.add("autogrow",{init:function(h){if(h.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE)h.on("instanceReady",function(){h.editable().isInline()?h.ui.space("contents").setStyle("height","auto"):f(h)})}})}(),CKEDITOR.plugins.add("basicstyles",{init:function(f){var h= -0,e=function(d,b,g,c){if(c){c=new CKEDITOR.style(c);var a=k[g];a.unshift(c);f.attachStyleStateChange(c,function(a){!f.readOnly&&f.getCommand(g).setState(a)});f.addCommand(g,new CKEDITOR.styleCommand(c,{contentForms:a}));f.ui.addButton&&f.ui.addButton(d,{label:b,command:g,toolbar:"basicstyles,"+(h+=10)})}},k={bold:["strong","b",["span",function(d){d=d.styles["font-weight"];return"bold"==d||700<=+d}]],italic:["em","i",["span",function(d){return"italic"==d.styles["font-style"]}]],underline:["u",["span", -function(d){return"underline"==d.styles["text-decoration"]}]],strike:["s","strike",["span",function(d){return"line-through"==d.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},d=f.config,l=f.lang.basicstyles;e("Bold",l.bold,"bold",d.coreStyles_bold);e("Italic",l.italic,"italic",d.coreStyles_italic);e("Underline",l.underline,"underline",d.coreStyles_underline);e("Strike",l.strike,"strike",d.coreStyles_strike);e("Subscript",l.subscript,"subscript",d.coreStyles_subscript);e("Superscript", -l.superscript,"superscript",d.coreStyles_superscript);f.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}}),CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"},CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"},CKEDITOR.config.coreStyles_underline={element:"u"},CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"},CKEDITOR.config.coreStyles_subscript={element:"sub"},CKEDITOR.config.coreStyles_superscript={element:"sup"}, -function(){var f={exec:function(f){var e=f.getCommand("blockquote").state,k=f.getSelection(),d=k&&k.getRanges()[0];if(d){var l=k.createBookmarks();if(CKEDITOR.env.ie){var m=l[0].startNode,b=l[0].endNode,g;if(m&&"blockquote"==m.getParent().getName())for(g=m;g=g.getNext();)if(g.type==CKEDITOR.NODE_ELEMENT&&g.isBlockBoundary()){m.move(g,!0);break}if(b&&"blockquote"==b.getParent().getName())for(g=b;g=g.getPrevious();)if(g.type==CKEDITOR.NODE_ELEMENT&&g.isBlockBoundary()){b.move(g);break}}var c=d.createIterator(); -c.enlargeBr=f.config.enterMode!=CKEDITOR.ENTER_BR;if(e==CKEDITOR.TRISTATE_OFF){for(m=[];e=c.getNextParagraph();)m.push(e);1>m.length&&(e=f.document.createElement(f.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),b=l.shift(),d.insertNode(e),e.append(new CKEDITOR.dom.text("",f.document)),d.moveToBookmark(b),d.selectNodeContents(e),d.collapse(!0),b=d.createBookmark(),m.push(e),l.unshift(b));g=m[0].getParent();d=[];for(b=0;bf||(this.notifications.splice(f,1),e.element.remove(),this.element.getChildCount()||(this._removeListeners(),this.element.remove()))},_createElement:function(){var e=this.editor,f=e.config,d=new CKEDITOR.dom.element("div");d.addClass("cke_notifications_area"); -d.setAttribute("id","cke_notifications_area_"+e.name);d.setStyle("z-index",f.baseFloatZIndex-2);return d},_attachListeners:function(){var e=CKEDITOR.document.getWindow(),f=this.editor;e.on("scroll",this._uiBuffer.input);e.on("resize",this._uiBuffer.input);f.on("change",this._changeBuffer.input);f.on("floatingSpaceLayout",this._layout,this,null,20);f.on("blur",this._layout,this,null,20)},_removeListeners:function(){var e=CKEDITOR.document.getWindow(),f=this.editor;e.removeListener("scroll",this._uiBuffer.input); -e.removeListener("resize",this._uiBuffer.input);f.removeListener("change",this._changeBuffer.input);f.removeListener("floatingSpaceLayout",this._layout);f.removeListener("blur",this._layout)},_layout:function(){function e(){f.setStyle("left",A(r+h.width-n-w))}var f=this.element,d=this.editor,h=d.ui.contentsElement.getClientRect(),m=d.ui.contentsElement.getDocumentPosition(),b,g,c=f.getClientRect(),a,n=this._notificationWidth,w=this._notificationMargin;a=CKEDITOR.document.getWindow();var v=a.getScrollPosition(), -t=a.getViewPaneSize(),p=CKEDITOR.document.getBody(),q=p.getDocumentPosition(),A=CKEDITOR.tools.cssLength;n&&w||(a=this.element.getChild(0),n=this._notificationWidth=a.getClientRect().width,w=this._notificationMargin=parseInt(a.getComputedStyle("margin-left"),10)+parseInt(a.getComputedStyle("margin-right"),10));d.toolbar&&(b=d.ui.space("top"),g=b.getClientRect());b&&b.isVisible()&&g.bottom>h.top&&g.bottomv.y?f.setStyles({position:"fixed",top:0}):f.setStyles({position:"absolute",top:A(m.y+h.height-c.height)});var r="fixed"==f.getStyle("position")?h.left:"static"!=p.getComputedStyle("position")?m.x-q.x:m.x;h.widthv.x+t.width?e():f.setStyle("left",A(r)):m.x+n+w>v.x+t.width?f.setStyle("left",A(r)):m.x+h.width/2+n/2+w>v.x+t.width?f.setStyle("left",A(r-m.x+v.x+t.width-n-w)):0>h.left+h.width-n-w?e():0>h.left+h.width/2-n/2?f.setStyle("left",A(r-m.x+v.x)):f.setStyle("left", -A(r+h.width/2-n/2-w/2))}};CKEDITOR.plugins.notification=f}(),function(){var f='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(f+= -' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(f+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var f=f+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick")+'\x3d"CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"'),f=f+'\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e', -h=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),e=CKEDITOR.addTemplate("button",f);CKEDITOR.plugins.add("button",{beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(e){CKEDITOR.tools.extend(this,e,{title:e.label,click:e.click||function(d){d.execCommand(e.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(e){return new CKEDITOR.ui.button(e)}}; -CKEDITOR.ui.button.prototype={render:function(f,d){function l(){var a=f.mode;a&&(a=this.modes[a]?void 0!==m[a]?m[a]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,a=f.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:a,this.setState(a),this.refresh&&this.refresh())}var m=null,b=CKEDITOR.env,g=this._.id=CKEDITOR.tools.getNextId(),c="",a=this.command,n,w,v;this._.editor=f;var t={id:g,button:this,editor:f,focus:function(){CKEDITOR.document.getById(g).focus()},execute:function(){this.button.click(f)}, -attach:function(a){this.button.attach(a)}},p=CKEDITOR.tools.addFunction(function(a){if(t.onkey)return a=new CKEDITOR.dom.event(a),!1!==t.onkey(t,a.getKeystroke())}),q=CKEDITOR.tools.addFunction(function(a){var b;t.onfocus&&(b=!1!==t.onfocus(t,new CKEDITOR.dom.event(a)));return b}),A=0;t.clickFn=n=CKEDITOR.tools.addFunction(function(){A&&(f.unlockSelection(1),A=0);t.execute();b.iOS&&f.focus()});this.modes?(m={},f.on("beforeModeUnload",function(){f.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(m[f.mode]= -this._.state)},this),f.on("activeFilterChange",l,this),f.on("mode",l,this),!this.readOnly&&f.on("readOnly",l,this)):a&&(a=f.getCommand(a))&&(a.on("state",function(){this.setState(a.state)},this),c+=a.state==CKEDITOR.TRISTATE_ON?"on":a.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var r;if(this.directional)f.on("contentDirChanged",function(a){var b=CKEDITOR.document.getById(this._.id),c=b.getFirst();a=a.data;a!=f.lang.dir?b.addClass("cke_"+a):b.removeClass("cke_ltr").removeClass("cke_rtl");c.setAttribute("style", -CKEDITOR.skin.getIconStyle(r,"rtl"==a,this.icon,this.iconOffset))},this);a?(w=f.getCommandKeystroke(a))&&(v=CKEDITOR.tools.keystrokeToString(f.lang.common.keyboard,w)):c+="off";w=this.name||this.command;var C=null,B=this.icon;r=w;this.icon&&!/\./.test(this.icon)?(r=this.icon,B=null):(this.icon&&(C=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(C=this.iconHiDpi));C?(CKEDITOR.skin.addIcon(C,C),B=null):C=r;c={id:g,name:w,iconName:r,label:this.label,cls:this.className||"",state:c,ariaDisabled:"disabled"== -c?"true":"false",title:this.title+(v?" ("+v.display+")":""),ariaShortcut:v?f.lang.common.keyboardShortcut+" "+v.aria:"",titleJs:b.gecko&&!b.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:p,focusFn:q,clickFn:n,style:CKEDITOR.skin.getIconStyle(C,"rtl"==f.lang.dir,B,this.iconOffset),arrowHtml:this.hasArrow?h.output():""};e.output(c,d);if(this.onRender)this.onRender();return t},setState:function(e){if(this._.state==e)return!1;this._.state=e;var d=CKEDITOR.document.getById(this._.id); -return d?(d.setState(e,"cke_button"),e==CKEDITOR.TRISTATE_DISABLED?d.setAttribute("aria-disabled",!0):d.removeAttribute("aria-disabled"),this.hasArrow?(e=e==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(e)):e==CKEDITOR.TRISTATE_ON?d.setAttribute("aria-pressed",!0):d.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(e){if(this._.feature)return this._.feature; -var d=this;this.allowedContent||this.requiredContent||!this.command||(d=e.getCommand(this.command)||d);return this._.feature=d}};CKEDITOR.ui.prototype.addButton=function(e,d){this.add(e,CKEDITOR.UI_BUTTON,d)}}(),function(){function f(d){function e(){for(var a=f(),c=CKEDITOR.tools.clone(d.config.toolbarGroups)||h(d),g=0;gb.order?-1:0>a.order?1:a.order]+data-cke-bookmark[^<]*?<\/span>/ig,"");d&&f(a,c)})}function y(){if("wysiwyg"==a.mode){var b=x("paste");a.getCommand("cut").setState(x("cut"));a.getCommand("copy").setState(x("copy"));a.getCommand("paste").setState(b);a.fire("pasteState",b)}}function x(b){if(E&&b in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==b)return CKEDITOR.TRISTATE_OFF;b=a.getSelection();var c=b.getRanges();return b.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed?CKEDITOR.TRISTATE_DISABLED: -CKEDITOR.TRISTATE_OFF}var z=CKEDITOR.plugins.clipboard,I=0,F=0,E=0;(function(){a.on("key",B);a.on("contentDom",b);a.on("selectionChange",function(a){E=a.data.selection.getRanges()[0].checkReadOnly();y()});if(a.contextMenu){a.contextMenu.addListener(function(a,b){E=b.getRanges()[0].checkReadOnly();return{cut:x("cut"),copy:x("copy"),paste:x("paste")}});var c=null;a.on("menuShow",function(){c&&(c.removeListener(),c=null);var b=a.contextMenu.findItemByCommandName("paste");b&&b.element&&(c=b.element.on("touchend", -function(){a._.forcePasteDialog=!0}))})}if(a.ui.addButton)a.once("instanceReady",function(){a._.pasteButtons&&CKEDITOR.tools.array.forEach(a._.pasteButtons,function(b){if(b=a.ui.get(b))if(b=CKEDITOR.document.getById(b._.id))b.on("touchend",function(){a._.forcePasteDialog=!0})})})})();(function(){function b(c,d,g,e,f){var h=a.lang.clipboard[d];a.addCommand(d,g);a.ui.addButton&&a.ui.addButton(c,{label:h,command:d,toolbar:"clipboard,"+e});a.addMenuItems&&a.addMenuItem(d,{label:h,command:d,group:"clipboard", -order:f})}b("Cut","cut",c("cut"),10,1);b("Copy","copy",c("copy"),20,4);b("Paste","paste",d(),30,8);a._.pasteButtons||(a._.pasteButtons=[]);a._.pasteButtons.push("Paste")})();a.getClipboardData=function(b,c){function d(a){a.removeListener();a.cancel();c(a.data)}function g(a){a.removeListener();a.cancel();c({type:f,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var e=!1,f="auto";c||(c=b,b=null);a.on("beforePaste",function(a){a.removeListener();e=!0;f=a.data.type},null, -null,1E3);a.on("paste",d,null,null,0);!1===m()&&(a.removeListener("paste",d),a._.forcePasteDialog&&e&&a.fire("pasteDialog")?(a.on("pasteDialogCommit",g),a.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",g);a.data._.committed||c(null)})):c(null))}}function e(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&!a.match(/^(
<\/div>|
[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|)*$/gi)&&!a.match(/^(

([^<]|)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!a.match(/^([^<]|)*$/gi))return"html"}else return"html"; -return"htmlifiedtext"}function k(a,b){function c(a){return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e",~~(a/2))+(1==a%2?"\x3cbr\x3e":"")}b=b.replace(/(?!\u3000)\s+/g," ").replace(/> +/gi,"\x3cbr\x3e");b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(b.match(/^[^<]$/))return b;CKEDITOR.env.webkit&&-1(
|)<\/div>)(?!$|(

(
|)<\/div>))/g,"\x3cbr\x3e").replace(/^(
(
|)<\/div>){2}(?!$)/g,"\x3cdiv\x3e\x3c/div\x3e"), -b.match(/
(
|)<\/div>/)&&(b="\x3cp\x3e"+b.replace(/(
(
|)<\/div>)+/g,function(a){return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length+1)})+"\x3c/p\x3e"),b=b.replace(/<\/div>
/g,"\x3cbr\x3e"),b=b.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^

$/,"\x3cbr\x3e")),-1){2,}/g,function(a){return c(a.length/4)})+"\x3c/p\x3e"));return m(a,b)}function d(){function a(){var a= -{},b;for(b in CKEDITOR.dtd)"$"!=b.charAt(0)&&"div"!=b&&"span"!=b&&(a[b]=1);return a}var b={};return{get:function(c){return"plain-text"==c?b.plainText||(b.plainText=new CKEDITOR.filter("br")):"semantic-content"==c?((c=b.semanticContent)||(c=new CKEDITOR.filter,c.allow({$1:{elements:a(),attributes:!0,styles:!1,classes:!1}}),c=b.semanticContent=c),c):c?new CKEDITOR.filter(c):null}}}function l(a,b,c){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var d=new CKEDITOR.htmlParser.basicWriter;c.applyTo(b,!0,!1, -a.activeEnterMode);b.writeHtml(d);return d.getHtml()}function m(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p>

)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e",a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function b(a){a.data.preventDefault();a.data.$.dataTransfer.dropEffect="none"}function g(a){var b=CKEDITOR.plugins.clipboard;a.on("contentDom",function(){function c(b,d,g){d.select();f(a,{dataTransfer:g, -method:"drop"},1);g.sourceEditor.fire("saveSnapshot");g.sourceEditor.editable().extractHtmlFromRange(b);g.sourceEditor.getSelection().selectRanges([b]);g.sourceEditor.fire("saveSnapshot")}function d(c,g){c.select();f(a,{dataTransfer:g,method:"drop"},1);b.resetDragDataTransfer()}function g(b,c,d){var e={$:b.data.$,target:b.data.getTarget()};c&&(e.dragRange=c);d&&(e.dropRange=d);!1===a.fire(b.name,e)&&b.data.preventDefault()}function e(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()} -var h=a.editable(),k=CKEDITOR.plugins.clipboard.getDropTarget(a),l=a.ui.space("top"),m=a.ui.space("bottom");b.preventDefaultDropOnElement(l);b.preventDefaultDropOnElement(m);h.attachListener(k,"dragstart",g);h.attachListener(a,"dragstart",b.resetDragDataTransfer,b,null,1);h.attachListener(a,"dragstart",function(c){b.initDragDataTransfer(c,a)},null,null,2);h.attachListener(a,"dragstart",function(){var c=b.dragRange=a.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(b.dragStartContainerChildCount= -c?e(c.startContainer):null,b.dragEndContainerChildCount=c?e(c.endContainer):null)},null,null,100);h.attachListener(k,"dragend",g);h.attachListener(a,"dragend",b.initDragDataTransfer,b,null,1);h.attachListener(a,"dragend",b.resetDragDataTransfer,b,null,100);h.attachListener(k,"dragover",function(a){if(CKEDITOR.env.edge)a.data.preventDefault();else{var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&& -a.data.preventDefault()}});h.attachListener(k,"drop",function(c){if(!c.data.$.defaultPrevented){c.data.preventDefault();var d=c.data.getTarget();if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=b.getRangeAtDropPosition(c,a),e=b.dragRange;d&&g(c,e,d)}}},null,null,9999);h.attachListener(a,"drop",b.initDragDataTransfer,b,null,1);h.attachListener(a,"drop",function(g){if(g=g.data){var e=g.dropRange,f=g.dragRange,h=g.dataTransfer;h.getTransferType(a)==CKEDITOR.DATA_TRANSFER_INTERNAL? -setTimeout(function(){b.internalDrop(f,e,h,a)},0):h.getTransferType(a)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?c(f,e,h):d(e,h)}},null,null,9999)})}var c;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){var b,c=d();a.config.forcePasteAsPlainText?b="plain-text":a.config.pasteFilter?b=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(b="semantic-content");a.pasteFilter=c.get(b);h(a);g(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+ -"dialogs/paste.js"));if(CKEDITOR.env.gecko){var f=["image/png","image/jpeg","image/gif"],m;a.on("paste",function(b){var c=b.data,d=c.dataTransfer;if(!c.dataValue&&"paste"==c.method&&d&&1==d.getFilesCount()&&m!=d.id&&(d=d.getFile(0),-1!=CKEDITOR.tools.indexOf(f,d.type))){var g=new FileReader;g.addEventListener("load",function(){b.data.dataValue='\x3cimg src\x3d"'+g.result+'" /\x3e';a.fire("paste",b.data)},!1);g.addEventListener("abort",function(){a.fire("paste",b.data)},!1);g.addEventListener("error", -function(){a.fire("paste",b.data)},!1);g.readAsDataURL(d);m=c.dataTransfer.id;b.stop()}},null,null,1)}a.on("paste",function(b){b.data.dataTransfer||(b.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!b.data.dataValue){var c=b.data.dataTransfer,d=c.getData("text/html");if(d)b.data.dataValue=d,b.data.type="html";else if(d=c.getData("text/plain"))b.data.dataValue=a.editable().transformPlainTextToHtml(d),b.data.type="text"}},null,null,1);a.on("paste",function(a){var b=a.data.dataValue, -c=CKEDITOR.dtd.$block;-1 <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1")); -if(b.match(/^<[^<]+cke_(editable|contents)/i)){var d,g,e=new CKEDITOR.dom.element("div");for(e.setHtml(b);1==e.getChildCount()&&(d=e.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)e=g=d;g&&(b=g.getHtml().replace(/
$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,d){return d.toLowerCase()in c?(a.data.preSniffing="html","\x3c"+d):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)>


<\/div>$/,function(b,d){return d in -c?(a.data.endsWithEOL=1,"\x3c/"+d+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)
$/,"$1"));a.data.dataValue=b},null,null,3);a.on("paste",function(b){b=b.data;var d=a._.nextPasteType||b.type,g=b.dataValue,f,h=a.config.clipboard_defaultContentType||"html",m=b.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,n=!0===a.config.forcePasteAsPlainText;f="html"==d||"html"==b.preSniffing?"html":e(g);delete a._.nextPasteType;"htmlifiedtext"==f&&(g=k(a.config,g));if("text"==d&&"html"==f)g= -l(a,g,c.get("plain-text"));else if(m&&a.pasteFilter&&!b.dontFilter||n)g=l(a,g,a.pasteFilter);b.startsWithEOL&&(g='\x3cbr data-cke-eol\x3d"1"\x3e'+g);b.endsWithEOL&&(g+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==d&&(d="html"==f||"html"==h?"html":"text");b.type=d;b.dataValue=g;delete b.preSniffing;delete b.startsWithEOL;delete b.endsWithEOL},null,null,6);a.on("paste",function(b){b=b.data;b.dataValue&&(a.insertHtml(b.dataValue,b.type,b.range),setTimeout(function(){a.fire("afterPaste")},0))},null,null, -1E3);a.on("pasteDialog",function(b){setTimeout(function(){a.openDialog("paste",b.data)},0)})}});CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:(!CKEDITOR.env.ie||16<=CKEDITOR.env.version)&&!CKEDITOR.env.iOS,isCustomDataTypesSupported:!CKEDITOR.env.ie||16<=CKEDITOR.env.version,isFileApiSupported:!CKEDITOR.env.ie||9CKEDITOR.env.version||b.isInline()?b:a.document},fixSplitNodesAfterDrop:function(a, -b,c,d){function g(a,c,d){var e=a;e.type==CKEDITOR.NODE_TEXT&&(e=a.getParent());if(e.equals(c)&&d!=c.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),c=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&c&&c.type==CKEDITOR.NODE_TEXT&&(d=a.getLength(),a.setText(a.getText()+c.getText()),c.remove(),b.setStart(a,d),b.collapse(!0)),!0}var e=b.startContainer;"number"==typeof d&&"number"==typeof c&&e.type==CKEDITOR.NODE_ELEMENT&&(g(a.startContainer,e,c)||g(a.endContainer, -e,d))},isDropRangeAffectedByDragRange:function(a,b){var c=b.startContainer,d=b.endOffset;return a.endContainer.equals(c)&&a.endOffset<=d||a.startContainer.getParent().equals(c)&&a.startContainer.getIndex()CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(a,b,g.dragStartContainerChildCount, -g.dragEndContainerChildCount);(k=this.isDropRangeAffectedByDragRange(a,b))||(h=a.createBookmark(!1));g=b.clone().createBookmark(!1);k&&(h=a.createBookmark(!1));a=h.startNode;b=h.endNode;k=g.startNode;b&&a.getPosition(k)&CKEDITOR.POSITION_PRECEDING&&b.getPosition(k)&CKEDITOR.POSITION_FOLLOWING&&k.insertBefore(a);a=d.createRange();a.moveToBookmark(h);e.extractHtmlFromRange(a,1);b=d.createRange();b.moveToBookmark(g);f(d,{dataTransfer:c,method:"drop",range:b},1);d.fire("unlockSnapshot")},getRangeAtDropPosition:function(a, -b){var c=a.data.$,d=c.clientX,g=c.clientY,e=b.getSelection(!0).getRanges()[0],f=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&&b.document.$.caretRangeFromPoint(d,g))c=b.document.$.caretRangeFromPoint(d,g),f.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),f.collapse(!0);else if(c.rangeParent)f.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),f.collapse(!0);else{if(CKEDITOR.env.ie&&8k&&!h;k++){if(!h)try{c.moveToPoint(d,g-k),h=!0}catch(l){}if(!h)try{c.moveToPoint(d,g+k),h=!0}catch(m){}}if(h){var u="cke-temp-"+(new Date).getTime();c.pasteHTML('\x3cspan id\x3d"'+u+'"\x3e​\x3c/span\x3e');var y=b.document.getById(u);f.moveToPosition(y,CKEDITOR.POSITION_BEFORE_START);y.remove()}else{var x=b.document.$.elementFromPoint(d,g),z=new CKEDITOR.dom.element(x),I;if(z.equals(b.editable())|| -"html"==z.getName())return e&&e.startContainer&&!e.startContainer.equals(b.editable())?e:null;I=z.getClientRect();d/i,bodyRegExp:/([\s\S]*)<\/body>/i,fragmentRegExp:/\x3c!--(?:Start|End)Fragment--\x3e/g,data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==a?"Text":"url"==a? -"URL":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(c);this.id||(this.id="Text"==c?"":"cke-"+CKEDITOR.tools.getUniqueId());b&&(this.sourceEditor=b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==c||this.getData("text/plain")||this.setData("text/plain",b.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype= -{getData:function(a,b){a=this._.normalizeType(a);var c="text/html"==a&&b?this._.nativeHtmlCache:this._.data[a];if(void 0===c||null===c||""===c){if(this._.fallbackDataTransfer.isRequired())c=this._.fallbackDataTransfer.getData(a,b);else try{c=this.$.getData(a)||""}catch(d){c=""}"text/html"!=a||b||(c=this._stripHtml(c))}"Text"==a&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==c.substring(0,7)&&(c="");if("string"===typeof c)var g=c.indexOf("\x3c/html\x3e"),c=-1!==g?c.substring(0,g+7):c;return c}, -setData:function(a,b){a=this._.normalizeType(a);"text/html"==a?(this._.data[a]=this._stripHtml(b),this._.nativeHtmlCache=b):this._.data[a]=b;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==a||"Text"==a)if("Text"==c&&"Text"==a&&(this.id=b),this._.fallbackDataTransfer.isRequired())this._.fallbackDataTransfer.setData(a,b);else try{this.$.setData(a,b)}catch(d){}},storeId:function(){"Text"!==c&&this.setData(c,this.id)},getTransferType:function(a){return this.sourceEditor?this.sourceEditor== -a?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function a(a){a=b._.normalizeType(a);var c=b.getData(a);"text/html"==a&&(b._.nativeHtmlCache=b.getData(a,!0),c=b._stripHtml(c));c&&(b._.data[a]=c)}if(this.$){var b=this,c,d;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c=0;ce?q+e:d.width>e?q-a.left:q-a.right+d.width):he?q-e:d.width>e?q-a.right+d.width:q-a.left);e=a.top;d.height- -a.topf?A-f:d.height>f?A-a.bottom+d.height:A-a.top);CKEDITOR.env.ie&&(d=a=new CKEDITOR.dom.element(n.$.offsetParent),"html"==d.getName()&&(d=d.getDocument().getBody()),"rtl"==d.getComputedStyle("direction")&&(q=CKEDITOR.env.ie8Compat?q-2*n.getDocument().getDocumentElement().$.scrollLeft:q-(a.$.scrollWidth-a.$.clientWidth)));var a=n.getFirst(),l;(l=a.getCustomData("activePanel"))&&l.onHide&&l.onHide.call(this,1);a.setCustomData("activePanel",this);n.setStyles({top:A+"px",left:q+"px"});n.setOpacity(1); -b&&b()},this);g.isLoaded?a():g.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();c.element.focus();CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);CKEDITOR.env.ie?CKEDITOR.tools.setTimeout(function(){c.markFirstDisplayed?c.markFirstDisplayed():c._.markFirstDisplayed()},0):c.markFirstDisplayed?c.markFirstDisplayed():c._.markFirstDisplayed();this._.editor.fire("panelShow",this)}, -0,this)},CKEDITOR.env.air?200:0,this);this.visible=1;this.onShow&&this.onShow.call(this)},reposition:function(){var e=this._.showBlockParams;this.visible&&this._.showBlockParams&&(this.hide(),this.showBlock.apply(this,e))},focus:function(){if(CKEDITOR.env.webkit){var e=CKEDITOR.document.getActive();e&&!e.equals(this._.iframe)&&e.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var e=this._.iframe.getFrameDocument().getActive();e&&e.is("a")&&(this._.lastFocused= -e)},hide:function(e){if(this.visible&&(!this.onHide||!0!==this.onHide.call(this))){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel");if(e=e&&this._.returnFocus)CKEDITOR.env.webkit&&e.type&&e.getWindow().$.focus(),e.focus();delete this._.lastFocused;this._.showBlockParams=null;this._.editor.fire("panelHide",this)}},allowBlur:function(e){var f=this._.panel; -void 0!==e&&(f.allowBlur=e);return f.allowBlur},showAsChild:function(e,f,d,h,m,b){if(this._.activeChild!=e||e._.panel._.offsetParentId!=d.getId())this.hideChild(),e.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=e,this._.focused=!1,e.showBlock(f,d,h,m,b),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){e.element.getChild(0).$.style.cssText+=""},100)},hideChild:function(e){var f= -this._.activeChild;f&&(delete f.onHide,delete this._.activeChild,f.hide(),e&&this.focus())}}});CKEDITOR.on("instanceDestroyed",function(){var e=CKEDITOR.tools.isEmpty(CKEDITOR.instances),f;for(f in h){var d=h[f];e?d.destroy():d.element.hide()}e&&(h={})})}(),CKEDITOR.plugins.add("menu",{requires:"floatpanel",beforeInit:function(f){for(var h=f.config.menu_groups.split(","),e=f._.menuGroups={},k=f._.menuItems={},d=0;db.group?1:d.orderb.order?1:0})}var h='\x3cspan class\x3d"cke_menuitem"\x3e\x3ca id\x3d"{id}" class\x3d"cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href\x3d"{href}" title\x3d"{title}" tabindex\x3d"-1" _cke_focus\x3d1 hidefocus\x3d"true" role\x3d"{role}" aria-label\x3d"{label}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked} draggable\x3d"false"'; -CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(h+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(h+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');var h=h+(' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" '+(CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick")+'\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e'),e=CKEDITOR.addTemplate("menuItem", -h+'\x3cspan class\x3d"cke_menubutton_inner"\x3e\x3cspan class\x3d"cke_menubutton_icon"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{iconStyle}"\x3e\x3c/span\x3e\x3c/span\x3e\x3cspan class\x3d"cke_menubutton_label"\x3e{label}\x3c/span\x3e{shortcutHtml}{arrowHtml}\x3c/span\x3e\x3c/a\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_voice_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e\x3c/span\x3e'),k=CKEDITOR.addTemplate("menuArrow",'\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'), -d=CKEDITOR.addTemplate("menuShortcut",'\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(d,e){e=this._.definition=e||{};this.id=CKEDITOR.tools.getNextId();this.editor=d;this.items=[];this._.listeners=[];this._.level=e.level||1;var b=CKEDITOR.tools.extend({},e.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),g=b.block.attributes=b.attributes||{};!g.role&&(g.role="menu");this._.panelDefinition= -b},_:{onShow:function(){var d=this.editor.getSelection(),e=d&&d.getStartElement(),b=this.editor.elementPath(),g=this._.listeners;this.removeAll();for(var c=0;cCKEDITOR.env.version?f.createText("\r"):f.createElement("br"),d.deleteContents(),d.insertNode(c),CKEDITOR.env.needsBrFiller?(f.createText("").insertAfter(c),k&&(m||l.blockLimit).appendBogus(),c.getNext().$.nodeValue="",d.setStartAt(c.getNext(),CKEDITOR.POSITION_AFTER_START)):d.setStartAt(c,CKEDITOR.POSITION_AFTER_END)),d.collapse(!0),d.select(),d.scrollIntoView()):b(c,a,d,e)}}};l=CKEDITOR.plugins.enterkey; -m=l.enterBr;b=l.enterBlock;g=/^h[1-6]$/}(),function(){function f(f,e){var k={},d=[],l={nbsp:" ",shy:"­",gt:"\x3e",lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};f=f.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(b,a){var g=e?"\x26"+a+";":l[a];k[g]=e?l[a]:"\x26"+a+";";d.push(g);return""});if(!e&&f){f=f.split(",");var m=document.createElement("div"),b;m.innerHTML="\x26"+f.join(";\x26")+";";b=m.innerHTML;m=null;for(m=0;mh&&(h=640);420>e&&(e=420);var d=parseInt((window.screen.height-e)/2,10),l=parseInt((window.screen.width- -h)/2,10);k=(k||"location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes")+",width\x3d"+h+",height\x3d"+e+",top\x3d"+d+",left\x3d"+l;var m=window.open("",null,k,!0);if(!m)return!1;try{-1==navigator.userAgent.toLowerCase().indexOf(" chrome/")&&(m.moveTo(l,d),m.resizeTo(h,e)),m.focus(),m.location.href=f}catch(b){window.open(f,null,k,!0)}return!0}}),"use strict",function(){function f(d){this.editor=d;this.loaders= -[]}function h(d,f,h){var b=d.config.fileTools_defaultFileName;this.editor=d;this.lang=d.lang;"string"===typeof f?(this.data=f,this.file=e(this.data),this.loaded=this.total=this.file.size):(this.data=null,this.file=f,this.total=this.file.size,this.loaded=0);h?this.fileName=h:this.file.name?this.fileName=this.file.name:(d=this.file.type.split("/"),b&&(d[0]=b),this.fileName=d.join("."));this.uploaded=0;this.responseData=this.uploadTotal=null;this.status="created";this.abort=function(){this.changeStatus("abort")}} -function e(d){var e=d.match(k)[1];d=d.replace(k,"");d=atob(d);var f=[],b,g,c,a;for(b=0;bb.status||299A.height-q.bottom?b("pin"):b("bottom"),a=A.width/2,a=d.floatSpacePreferRight?"right":0p.width?"rtl"==d.contentsLangDirection?"right":"left":a-q.left>q.right-a?"left":"right",p.width>A.width?(a="left",n=0):(n="left"==a?0A.width&&(a="left"==a?"right":"left",n=0)),g.setStyle(a,e(("pin"==c?y:B)+n+("pin"==c?0:"left"==a?C:-C)))):(c="pin",b("pin"),m(a))}}}();if(l){var b=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+ -CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+(CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(f.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(f.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),g=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(b.output({content:l, -id:f.id,langDir:f.lang.dir,langCode:f.langCode,name:f.name,style:"display:none;z-index:"+(d.baseFloatZIndex-1),topId:f.ui.spaceId("top"),voiceLabel:f.title}))),c=CKEDITOR.tools.eventsBuffer(500,m),a=CKEDITOR.tools.eventsBuffer(100,m);g.unselectable();g.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});f.on("focus",function(b){m(b);f.on("change",c.input);h.on("scroll",a.input);h.on("resize",a.input)});f.on("blur",function(){g.hide();f.removeListener("change", -c.input);h.removeListener("scroll",a.input);h.removeListener("resize",a.input)});f.on("destroy",function(){h.removeListener("scroll",a.input);h.removeListener("resize",a.input);g.clearCustomData();g.remove()});f.focusManager.hasFocus&&g.show();f.focusManager.add(g,1)}}var h=CKEDITOR.document.getWindow(),e=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(e){e.on("loaded",function(){f(this)},null,null,20)}})}(),CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var f= -CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),h=CKEDITOR.addTemplate("panel-list-item",'\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" href\x3d"javascript:void(\'{val}\')" {onclick}\x3d"CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'),e=CKEDITOR.addTemplate("panel-list-group", -'\x3ch1 id\x3d"{id}" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),k=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(d,e){return this.addBlock(d,new CKEDITOR.ui.listBlock(this.getHolderElement(),e))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(d,e){e=e||{};var f=e.attributes||(e.attributes={});(this.multiSelect=!!e.multiSelect)&&(f["aria-multiselectable"]=!0);!f.role&&(f.role="listbox");this.base.apply(this,arguments); -this.element.setAttribute("role",f.role);f=this.keys;f[40]="next";f[9]="next";f[38]="prev";f[CKEDITOR.SHIFT+9]="prev";f[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(f[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var d=f.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(d);delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(d){var e= -this.toggle(d);if(this.onClick)this.onClick(d,e)},this));return this._.click}},proto:{add:function(d,e,f){var b=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[d]=b;var g;g=CKEDITOR.tools.htmlEncodeAttr(d).replace(k,"\\'");d={id:b,val:g,onclick:CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(f||d),text:e||d};this._.pendingList.push(h.output(d))},startGroup:function(d){this._.close(); -var f=CKEDITOR.tools.getNextId();this._.groups[d]=f;this._.pendingHtml.push(e.output({id:f,label:d}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(d){var e=this.isMarked(d);e?this.unmark(d):this.mark(d);return!e},hideGroup:function(d){var e=(d=this.element.getDocument().getById(this._.groups[d]))&&d.getNext();d&&(d.setStyle("display","none"),e&&"ul"==e.getName()&&e.setStyle("display","none"))},hideItem:function(d){this.element.getDocument().getById(this._.items[d]).setStyle("display", -"none")},showAll:function(){var d=this._.items,e=this._.groups,f=this.element.getDocument(),b;for(b in d)f.getById(d[b]).setStyle("display","");for(var g in e)d=f.getById(e[g]),b=d.getNext(),d.setStyle("display",""),b&&"ul"==b.getName()&&b.setStyle("display","")},mark:function(d){this.multiSelect||this.unmarkAll();d=this._.items[d];var e=this.element.getDocument().getById(d);e.addClass("cke_selected");this.element.getDocument().getById(d+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(e)}, -markFirstDisplayed:function(){var d=this;this._.markFirstDisplayed(function(){d.multiSelect||d.unmarkAll()})},unmark:function(d){var e=this.element.getDocument();d=this._.items[d];var f=e.getById(d);f.removeClass("cke_selected");e.getById(d+"_option").removeAttribute("aria-selected");this.onUnmark&&this.onUnmark(f)},unmarkAll:function(){var d=this._.items,e=this.element.getDocument(),f;for(f in d){var b=d[f];e.getById(b).removeClass("cke_selected");e.getById(b+"_option").removeAttribute("aria-selected")}this.onUnmark&& -this.onUnmark()},isMarked:function(d){return this.element.getDocument().getById(this._.items[d]).hasClass("cke_selected")},focus:function(d){this._.focusIndex=-1;var e=this.element.getElementsByTag("a"),f,b=-1;if(d)for(f=this.element.getDocument().getById(this._.items[d]).getFirst();d=e.getItem(++b);){if(d.equals(f)){this._.focusIndex=b;break}}else this.element.focus();f&&setTimeout(function(){f.focus()},0)}}})}}),CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(f){f.ui.addHandler(CKEDITOR.UI_RICHCOMBO, -CKEDITOR.ui.richCombo.handler)}}),function(){var f='\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"true"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&& -(f+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(f+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var f=f+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick")+'\x3d"CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e'+ -(CKEDITOR.env.hc?"\x26#9660;":CKEDITOR.env.air?"\x26nbsp;":"")+"\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),h=CKEDITOR.addTemplate("combo",f);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(e){CKEDITOR.tools.extend(this,e,{canGroup:!1,title:e.label,modes:{wysiwyg:1},editorFocus:1});e=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=e.parent&&e.parent.getDocument()||CKEDITOR.document;e.className="cke_combopanel"; -e.block={multiSelect:e.multiSelect,attributes:e.attributes};e.toolbarRelated=!0;this._={panelDefinition:e,items:{}}},proto:{renderHtml:function(e){var f=[];this.render(e,f);return f.join("")},render:function(e,f){function d(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var a=this.modes[e.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;e.readOnly&&!this.readOnly&&(a=CKEDITOR.TRISTATE_DISABLED);this.setState(a);this.setValue("");a!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var l= -CKEDITOR.env,m="cke_"+this.id,b=CKEDITOR.tools.addFunction(function(a){w&&(e.unlockSelection(1),w=0);c.execute(a)},this),g=this,c={id:m,combo:this,focus:function(){CKEDITOR.document.getById(m).getChild(1).focus()},execute:function(a){var b=g._;if(b.state!=CKEDITOR.TRISTATE_DISABLED)if(g.createPanel(e),b.on)b.panel.hide();else{g.commit();var c=g.getValue();c?b.list.mark(c):b.list.unmarkAll();b.panel.showBlock(g.id,new CKEDITOR.dom.element(a),4)}},clickFn:b};e.on("activeFilterChange",d,this);e.on("mode", -d,this);e.on("selectionChange",d,this);!this.readOnly&&e.on("readOnly",d,this);var a=CKEDITOR.tools.addFunction(function(a,d){a=new CKEDITOR.dom.event(a);var e=a.getKeystroke();switch(e){case 13:case 32:case 40:CKEDITOR.tools.callFunction(b,d);break;default:c.onkey(c,e)}a.preventDefault()}),n=CKEDITOR.tools.addFunction(function(){c.onfocus&&c.onfocus()}),w=0;c.keyDownFn=a;l={id:m,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:l.gecko&&!l.hc?"":(this.title|| -"").replace("'",""),keydownFn:a,focusFn:n,clickFn:b};h.output(l,f);if(this.onRender)this.onRender();return c},createPanel:function(e){if(!this._.panel){var f=this._.panelDefinition,d=this._.panelDefinition.block,h=f.parent||CKEDITOR.document.getBody(),m="cke_combopanel__"+this.name,b=new CKEDITOR.ui.floatPanel(e,h,f),f=b.addListBlock(this.id,d),g=this;b.onShow=function(){this.element.addClass(m);g.setState(CKEDITOR.TRISTATE_ON);g._.on=1;g.editorFocus&&!e.focusManager.hasFocus&&e.focus();if(g.onOpen)g.onOpen()}; -b.onHide=function(b){this.element.removeClass(m);g.setState(g.modes&&g.modes[e.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);g._.on=0;if(!b&&g.onClose)g.onClose()};b.onEscape=function(){b.hide(1)};f.onClick=function(c,a){g.onClick&&g.onClick.call(g,c,a);b.hide()};this._.panel=b;this._.list=f;b.getBlock(this.id).onHide=function(){g._.on=0;g.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(e,f){this._.value=e;var d=this.document.getById("cke_"+this.id+"_text");d&& -(e||f?d.removeClass("cke_combo_inlinelabel"):(f=this.label,d.addClass("cke_combo_inlinelabel")),d.setText("undefined"!=typeof f?f:e))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(e){this._.list.mark(e)},hideItem:function(e){this._.list.hideItem(e)},hideGroup:function(e){this._.list.hideGroup(e)},showAll:function(){this._.list.showAll()},add:function(e,f,d){this._.items[e]=d||e;this._.list.add(e,f,d)},startGroup:function(e){this._.list.startGroup(e)}, -commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(e){if(this._.state!=e){var f=this.document.getById("cke_"+this.id);f.setState(e,"cke_combo");e==CKEDITOR.TRISTATE_DISABLED?f.setAttribute("aria-disabled",!0):f.removeAttribute("aria-disabled");this._.state=e}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!= -CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))}},statics:{handler:{create:function(e){return new CKEDITOR.ui.richCombo(e)}}}});CKEDITOR.ui.prototype.addRichCombo=function(e,f){this.add(e,CKEDITOR.UI_RICHCOMBO,f)}}(),CKEDITOR.plugins.add("format",{requires:"richcombo",init:function(f){if(!f.blockless){for(var h=f.config,e=f.lang.format,k=h.format_tags.split(";"),d={},l=0,m=[],b=0;b=this.rect.right||a<=this.rect.top||a>=this.rect.bottom)&&this.hideVisible();(0>=b||b>=this.winTopPane.width||0>=a||a>=this.winTopPane.height)&&this.hideVisible()},this);a.attachListener(b,"resize",e);a.attachListener(b,"mode",h);b.on("destroy",h);this.lineTpl=(new CKEDITOR.template('\x3cdiv data-cke-lineutils-line\x3d"1" class\x3d"cke_reset_all" style\x3d"{lineStyle}"\x3e\x3cspan style\x3d"{tipLeftStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3cspan style\x3d"{tipRightStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3c/div\x3e')).output({lineStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, -l,this.lineStyle,!0)),tipLeftStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},d,{left:"0px","border-left-color":"red","border-width":"6px 0 6px 6px"},this.tipCss,this.tipLeftStyle,!0)),tipRightStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},d,{right:"0px","border-right-color":"red","border-width":"6px 6px 6px 0"},this.tipCss,this.tipRightStyle,!0))})}function k(d){var c;if(c=d&&d.type==CKEDITOR.NODE_ELEMENT)c=!(m[d.getComputedStyle("float")]||m[d.getAttribute("align")]);return c&& -!b[d.getComputedStyle("position")]}CKEDITOR.plugins.add("lineutils");CKEDITOR.LINEUTILS_BEFORE=1;CKEDITOR.LINEUTILS_AFTER=2;CKEDITOR.LINEUTILS_INSIDE=4;f.prototype={start:function(b){var c=this,a=this.editor,d=this.doc,e,f,h,k,l=CKEDITOR.tools.eventsBuffer(50,function(){a.readOnly||"wysiwyg"!=a.mode||(c.relations={},(f=d.$.elementFromPoint(h,k))&&f.nodeType&&(e=new CKEDITOR.dom.element(f),c.traverseSearch(e),isNaN(h+k)||c.pixelSearch(e,h,k),b&&b(c.relations,h,k)))});this.listener=this.editable.attachListener(this.target, -"mousemove",function(a){h=a.data.$.clientX;k=a.data.$.clientY;l.input()});this.editable.attachListener(this.inline?this.editable:this.frame,"mouseout",function(){l.reset()})},stop:function(){this.listener&&this.listener.removeListener()},getRange:function(){var b={};b[CKEDITOR.LINEUTILS_BEFORE]=CKEDITOR.POSITION_BEFORE_START;b[CKEDITOR.LINEUTILS_AFTER]=CKEDITOR.POSITION_AFTER_END;b[CKEDITOR.LINEUTILS_INSIDE]=CKEDITOR.POSITION_AFTER_START;return function(c){var a=this.editor.createRange();a.moveToPosition(this.relations[c.uid].element, -b[c.type]);return a}}(),store:function(){function b(c,a,d){var e=c.getUniqueId();e in d?d[e].type|=a:d[e]={element:c,type:a}}return function(c,a){var d;a&CKEDITOR.LINEUTILS_AFTER&&k(d=c.getNext())&&d.isVisible()&&(b(d,CKEDITOR.LINEUTILS_BEFORE,this.relations),a^=CKEDITOR.LINEUTILS_AFTER);a&CKEDITOR.LINEUTILS_INSIDE&&k(d=c.getFirst())&&d.isVisible()&&(b(d,CKEDITOR.LINEUTILS_BEFORE,this.relations),a^=CKEDITOR.LINEUTILS_INSIDE);b(c,a,this.relations)}}(),traverseSearch:function(b){var c,a,d;do if(d=b.$["data-cke-expando"], -!(d&&d in this.relations)){if(b.equals(this.editable))break;if(k(b))for(c in this.lookups)(a=this.lookups[c](b))&&this.store(b,a)}while((!b||b.type!=CKEDITOR.NODE_ELEMENT||"true"!=b.getAttribute("contenteditable"))&&(b=b.getParent()))},pixelSearch:function(){function b(a,d,e,f,g){for(var h=0,l;g(e);){e+=f;if(25==++h)break;if(l=this.doc.$.elementFromPoint(d,e))if(l==a)h=0;else if(c(a,l)&&(h=0,k(l=new CKEDITOR.dom.element(l))))return l}}var c=CKEDITOR.env.ie||CKEDITOR.env.webkit?function(a,b){return a.contains(b)}: -function(a,b){return!!(a.compareDocumentPosition(b)&16)};return function(a,c,d){var e=this.win.getViewPaneSize().height,f=b.call(this,a.$,c,d,-1,function(a){return 0this.rect.bottom)return!1;this.inline? -e.left=a.elementRect.left-this.rect.relativeX:(0[^<]*e});0>f&&(f=a._.upcasts.length);a._.upcasts.splice(f,0,[CKEDITOR.tools.bind(b,c),c.name,e])}var e=b.upcast,f=b.upcastPriority||10;e&&("string"==typeof e?d(c, -b,f):d(e,b,f))}function l(a,b){a.focused=null;if(b.isInited()){var c=b.editor.checkDirty();a.fire("widgetBlurred",{widget:b});b.setFocused(!1);!c&&b.editor.resetDirty()}}function m(a){a=a.data;if("wysiwyg"==this.editor.mode){var b=this.editor.editable(),c=this.instances,d,e,f,g;if(b){for(d in c)c[d].isReady()&&!b.contains(c[d].wrapper)&&this.destroy(c[d],!0);if(a&&a.initOnlyNew)c=this.initOnAll();else{var k=b.find(".cke_widget_wrapper"),c=[];d=0;for(e=k.count();dCKEDITOR.tools.indexOf(b,a)&&c.push(a);a=CKEDITOR.tools.indexOf(d,a);0<=a&&d.splice(a,1);return this},focus:function(a){e=a;return this}, -commit:function(){var f=a.focused!==e,g,h;a.editor.fire("lockSnapshot");for(f&&(g=a.focused)&&l(a,g);g=d.pop();)b.splice(CKEDITOR.tools.indexOf(b,g),1),g.isInited()&&(h=g.editor.checkDirty(),g.setSelected(!1),!h&&g.editor.resetDirty());f&&e&&(h=a.editor.checkDirty(),a.focused=e,a.fire("widgetFocused",{widget:e}),e.setFocused(!0),!h&&a.editor.resetDirty());for(;g=c.pop();)b.push(g),g.setSelected(!0);a.editor.fire("unlockSnapshot")}}}function E(a,b,c){var d=0;b=L(b);var e=a.data.classes||{},f;if(b){for(e= -CKEDITOR.tools.clone(e);f=b.pop();)c?e[f]||(d=e[f]=1):e[f]&&(delete e[f],d=1);d&&a.setData("classes",e)}}function H(a){a.cancel()}function G(a,b){var c=a.editor,d=c.document,e=CKEDITOR.env.edge&&16<=CKEDITOR.env.version;if(!d.getById("cke_copybin")){var f=!c.blockless&&!CKEDITOR.env.ie||e?"div":"span",e=d.createElement(f),g=d.createElement(f),f=CKEDITOR.env.ie&&9>CKEDITOR.env.version;g.setAttributes({id:"cke_copybin","data-cke-temp":"1"});e.setStyles({position:"absolute",width:"1px",height:"1px", -overflow:"hidden"});e.setStyle("ltr"==c.config.contentsLangDirection?"left":"right","-5000px");var h=c.createRange();h.setStartBefore(a.wrapper);h.setEndAfter(a.wrapper);e.setHtml('\x3cspan data-cke-copybin-start\x3d"1"\x3e​\x3c/span\x3e'+c.editable().getHtmlFromRange(h).getHtml()+'\x3cspan data-cke-copybin-end\x3d"1"\x3e​\x3c/span\x3e');c.fire("saveSnapshot");c.fire("lockSnapshot");g.append(e);c.editable().append(g);var k=c.on("selectionChange",H,null,null,0),l=a.repository.on("checkSelection",H, -null,null,0);if(f)var m=d.getDocumentElement().$,q=m.scrollTop;h=c.createRange();h.selectNodeContents(e);h.select();f&&(m.scrollTop=q);setTimeout(function(){b||a.focus();g.remove();k.removeListener();l.removeListener();c.fire("unlockSnapshot");b&&!c.readOnly&&(a.repository.del(a),c.fire("saveSnapshot"))},100)}}function L(a){return(a=(a=a.getDefinition().attributes)&&a["class"])?a.split(/\s+/):null}function O(){var a=CKEDITOR.document.getActive(),b=this.editor,c=b.editable();(c.isInline()?c:b.document.getWindow().getFrame()).equals(a)&& -b.focusManager.focus(c)}function D(){CKEDITOR.env.gecko&&this.editor.unlockSelection();CKEDITOR.env.webkit||(this.editor.forceNextSelectionCheck(),this.editor.selectionChange(1))}function S(a){var b=null;a.on("data",function(){var a=this.data.classes,c;if(b!=a){for(c in b)a&&a[c]||this.removeClass(c);for(c in a)this.addClass(c);b=a}})}function J(a){a.on("data",function(){if(a.wrapper){var b=this.getLabel?this.getLabel():this.editor.lang.widget.label.replace(/%1/,this.pathName||this.element.getName()); -a.wrapper.setAttribute("role","region");a.wrapper.setAttribute("aria-label",b)}},null,null,9999)}function R(a){if(a.draggable){var b=a.editor,c=a.wrapper.getLast(h.isDomDragHandlerContainer),d;c?d=c.findOne("img"):(c=new CKEDITOR.dom.element("span",b.document),c.setAttributes({"class":"cke_reset cke_widget_drag_handler_container",style:"background:rgba(220,220,220,0.5);background-image:url("+b.plugins.widget.path+"images/handle.png)"}),d=new CKEDITOR.dom.element("img",b.document),d.setAttributes({"class":"cke_reset cke_widget_drag_handler", -"data-cke-widget-drag-handler":"1",src:CKEDITOR.tools.transparentImageData,width:15,title:b.lang.widget.move,height:15,role:"presentation"}),a.inline&&d.setAttribute("draggable","true"),c.append(d),a.wrapper.append(c));a.wrapper.on("dragover",function(a){a.data.preventDefault()});a.wrapper.on("mouseenter",a.updateDragHandlerPosition,a);setTimeout(function(){a.on("data",a.updateDragHandlerPosition,a)},50);if(!a.inline&&(d.on("mousedown",K,a),CKEDITOR.env.ie&&9>CKEDITOR.env.version))d.on("dragstart", -function(a){a.data.preventDefault(!0)});a.dragHandlerContainer=c}}function K(a){function b(){var c;for(r.reset();c=h.pop();)c.removeListener();var d=k;c=a.sender;var e=this.repository.finder,f=this.repository.liner,g=this.editor,l=this.editor.editable();CKEDITOR.tools.isEmpty(f.visible)||(d=e.getRange(d[0]),this.focus(),g.fire("drop",{dropRange:d,target:d.startContainer}));l.removeClass("cke_widget_dragging");f.hideVisible();g.fire("dragend",{target:c})}if(CKEDITOR.tools.getMouseButton(a)===CKEDITOR.MOUSE_BUTTON_LEFT){var c= -this.repository.finder,d=this.repository.locator,e=this.repository.liner,f=this.editor,g=f.editable(),h=[],k=[],l,m;this.repository._.draggedWidget=this;var q=c.greedySearch(),r=CKEDITOR.tools.eventsBuffer(50,function(){l=d.locate(q);k=d.sort(m,1);k.length&&(e.prepare(q,l),e.placeLine(k[0]),e.cleanup())});g.addClass("cke_widget_dragging");h.push(g.on("mousemove",function(a){m=a.data.$.clientY;r.input()}));f.fire("dragstart",{target:a.sender});h.push(f.document.once("mouseup",b,this));g.isInline()|| -h.push(CKEDITOR.document.once("mouseup",b,this))}}function U(a){var b,c,d=a.editables;a.editables={};if(a.editables)for(b in d)c=d[b],a.initEditable(b,"string"==typeof c?{selector:c}:c)}function X(a){if(a.mask){var b=a.wrapper.findOne(".cke_widget_mask");b||(b=new CKEDITOR.dom.element("img",a.editor.document),b.setAttributes({src:CKEDITOR.tools.transparentImageData,"class":"cke_reset cke_widget_mask"}),a.wrapper.append(b));a.mask=b}}function Y(a){if(a.parts){var b={},c,d;for(d in a.parts)c=a.wrapper.findOne(a.parts[d]), -b[d]=c;a.parts=b}}function Z(a,b){M(a);Y(a);U(a);X(a);R(a);S(a);J(a);if(CKEDITOR.env.ie&&9>CKEDITOR.env.version)a.wrapper.on("dragstart",function(b){var c=b.data.getTarget();h.getNestedEditable(a,c)||a.inline&&h.isDomDragHandler(c)||b.data.preventDefault()});a.wrapper.removeClass("cke_widget_new");a.element.addClass("cke_widget_element");a.on("key",function(b){b=b.data.keyCode;if(13==b)a.edit();else{if(b==CKEDITOR.CTRL+67||b==CKEDITOR.CTRL+88){G(a,b==CKEDITOR.CTRL+88);return}if(b in T||CKEDITOR.CTRL& -b||CKEDITOR.ALT&b)return}return!1},null,null,999);a.on("doubleclick",function(b){a.edit()&&b.cancel()});if(b.data)a.on("data",b.data);if(b.edit)a.on("edit",b.edit)}function M(a){(a.wrapper=a.element.getParent()).setAttribute("data-cke-widget-id",a.id)}function Q(a){a.element.data("cke-widget-data",encodeURIComponent(JSON.stringify(a.data)))}function N(){function a(){}function b(a,c,d){return d&&this.checkElement(a)?(a=d.widgets.getByElement(a,!0))&&a.checkStyleActive(this):!1}var c={};CKEDITOR.style.addCustomHandler({type:"widget", -setup:function(a){this.widget=a.widget;if(this.group="string"==typeof a.group?[a.group]:a.group){a=this.widget;var b;c[a]||(c[a]={});for(var d=0,e=this.group.length;d)?(?:<(?:div|span)(?: style="[^"]+")?>)?]*data-cke-copybin-start="1"[^>]*>.?<\/span>([\s\S]+)]*data-cke-copybin-end="1"[^>]*>.?<\/span>(?:<\/(?:div|span)>)?(?:<\/(?:div|span)>)?$/i, -T={37:1,38:1,39:1,40:1,8:1,46:1};CKEDITOR.plugins.widget=h;h.repository=f;h.nestedEditable=e}(),"use strict",function(){function f(b){function d(){this.deflated||(b.widgets.focused==this.widget&&(this.focused=!0),b.widgets.destroy(this.widget),this.deflated=!0)}function f(){var a=b.editable(),c=b.document;if(this.deflated)this.widget=b.widgets.initOn(this.element,"image",this.widget.data),this.widget.inline&&!(new CKEDITOR.dom.elementPath(this.widget.wrapper,a)).block&&(a=c.createElement(b.activeEnterMode== -CKEDITOR.ENTER_P?"p":"div"),a.replace(this.widget.wrapper),this.widget.wrapper.move(a)),this.focused&&(this.widget.focus(),delete this.focused),delete this.deflated;else{var d=this.widget,a=g,c=d.wrapper,e=d.data.align,d=d.data.hasCaption;if(a){for(var h=3;h--;)c.removeClass(a[h]);"center"==e?d&&c.addClass(a[1]):"none"!=e&&c.addClass(a[v[e]])}else"center"==e?(d?c.setStyle("text-align","center"):c.removeStyle("text-align"),c.removeStyle("float")):("none"==e?c.removeStyle("float"):c.setStyle("float", -e),c.removeStyle("text-align"))}}var g=b.config.image2_alignClasses,k=b.config.image2_captionedClass;return{allowedContent:c(b),requiredContent:"img[src,alt]",features:a(b),styleableElements:"img figure",contentTransformations:[["img[width]: sizeToAttribute"]],editables:{caption:{selector:"figcaption",allowedContent:"br em strong sub sup u s; a[!href,target]"}},parts:{image:"img",caption:"figcaption"},dialog:"image2",template:'\x3cimg alt\x3d"" src\x3d"" /\x3e',data:function(){var a=this.features; -this.data.hasCaption&&!b.filter.checkFeature(a.caption)&&(this.data.hasCaption=!1);"none"==this.data.align||b.filter.checkFeature(a.align)||(this.data.align="none");this.shiftState({widget:this,element:this.element,oldData:this.oldData,newData:this.data,deflate:d,inflate:f});this.data.link?this.parts.link||(this.parts.link=this.parts.image.getParent()):this.parts.link&&delete this.parts.link;this.parts.image.setAttributes({src:this.data.src,"data-cke-saved-src":this.data.src,alt:this.data.alt});if(this.oldData&& -!this.oldData.hasCaption&&this.data.hasCaption)for(var c in this.data.classes)this.parts.image.removeClass(c);if(b.filter.checkFeature(a.dimension)){a=this.data;a={width:a.width,height:a.height};c=this.parts.image;for(var e in a)a[e]?c.setAttribute(e,a[e]):c.removeAttribute(e)}this.oldData=CKEDITOR.tools.extend({},this.data)},init:function(){var a=CKEDITOR.plugins.image2,c=this.parts.image,d={hasCaption:!!this.parts.caption,src:c.getAttribute("src"),alt:c.getAttribute("alt")||"",width:c.getAttribute("width")|| -"",height:c.getAttribute("height")||"",lock:this.ready?a.checkHasNaturalRatio(c):!0},e=c.getAscendant("a");e&&this.wrapper.contains(e)&&(this.parts.link=e);d.align||(c=d.hasCaption?this.element:c,g?(c.hasClass(g[0])?d.align="left":c.hasClass(g[2])&&(d.align="right"),d.align?c.removeClass(g[v[d.align]]):d.align="none"):(d.align=c.getStyle("float")||"none",c.removeStyle("float")));b.plugins.link&&this.parts.link&&(d.link=a.getLinkAttributesParser()(b,this.parts.link),(c=d.link.advanced)&&c.advCSSClasses&& -(c.advCSSClasses=CKEDITOR.tools.trim(c.advCSSClasses.replace(/cke_\S+/,""))));this.wrapper[(d.hasCaption?"remove":"add")+"Class"]("cke_image_nocaption");this.setData(d);b.filter.checkFeature(this.features.dimension)&&!0!==b.config.image2_disableResizer&&1!=b.readOnly&&l(this);this.shiftState=a.stateShifter(this.editor);this.on("contextMenu",function(a){a.data.image=CKEDITOR.TRISTATE_OFF;if(this.parts.link||this.wrapper.getAscendant("a"))a.data.link=a.data.unlink=CKEDITOR.TRISTATE_OFF});this.on("dialog", -function(a){a.data.widget=this},this)},addClass:function(a){n(this).addClass(a)},hasClass:function(a){return n(this).hasClass(a)},removeClass:function(a){n(this).removeClass(a)},getClasses:function(){var a=new RegExp("^("+[].concat(k,g).join("|")+")$");return function(){var b=this.repository.parseElementClasses(n(this).getAttribute("class")),c;for(c in b)a.test(c)&&delete b[c];return b}}(),upcast:h(b),downcast:e(b),getLabel:function(){return this.editor.lang.widget.label.replace(/%1/,(this.data.alt|| -"")+" "+this.pathName)}}}function h(a){var b=k(a),c=a.config.image2_captionedClass;return function(a,e){var f={width:1,height:1},g=a.name,h;if(!a.attributes["data-cke-realelement"]&&(b(a)?("div"==g&&(h=a.getFirst("figure"))&&(a.replaceWith(h),a=h),e.align="center",h=a.getFirst("img")||a.getFirst("a").getFirst("img")):"figure"==g&&a.hasClass(c)?h=a.getFirst("img")||a.getFirst("a").getFirst("img"):d(a)&&(h="a"==a.name?a.children[0]:a),h)){for(var k in f)(f=h.attributes[k])&&f.match(t)&&delete h.attributes[k]; -return a}}}function e(a){var b=a.config.image2_alignClasses;return function(a){var c="a"==a.name?a.getFirst():a,d=c.attributes,e=this.data.align;if(!this.inline){var f=a.getFirst("span");f&&f.replaceWith(f.getFirst({img:1,a:1}))}e&&"none"!=e&&(f=CKEDITOR.tools.parseCssText(d.style||""),"center"==e&&"figure"==a.name?a=a.wrapWith(new CKEDITOR.htmlParser.element("div",b?{"class":b[1]}:{style:"text-align:center"})):e in{left:1,right:1}&&(b?c.addClass(b[v[e]]):f["float"]=e),b||CKEDITOR.tools.isEmpty(f)|| -(d.style=CKEDITOR.tools.writeCssText(f)));return a}}function k(a){var b=a.config.image2_captionedClass,c=a.config.image2_alignClasses,e={figure:1,a:1,img:1};return function(f){if(!(f.name in{div:1,p:1}))return!1;var g=f.children;if(1!==g.length)return!1;g=g[0];if(!(g.name in e))return!1;if("p"==f.name){if(!d(g))return!1}else if("figure"==g.name){if(!g.hasClass(b))return!1}else if(a.enterMode==CKEDITOR.ENTER_P||!d(g))return!1;return(c?f.hasClass(c[1]):"center"==CKEDITOR.tools.parseCssText(f.attributes.style|| -"",!0)["text-align"])?!0:!1}}function d(a){return"img"==a.name?!0:"a"==a.name?1==a.children.length&&a.getFirst("img"):!1}function l(a){var b=a.editor,c=b.editable(),d=b.document,e=a.resizer=d.createElement("span");e.addClass("cke_image_resizer");e.setAttribute("title",b.lang.image2.resizer);e.append(new CKEDITOR.dom.text("​",d));if(a.inline)a.wrapper.append(e);else{var f=a.parts.link||a.parts.image,g=f.getParent(),h=d.createElement("span");h.addClass("cke_image_resizer_wrapper");h.append(f);h.append(e); -a.element.append(h,!0);g.is("span")&&g.remove()}e.on("mousedown",function(f){function g(a,b,c){var e=CKEDITOR.document,f=[];d.equals(e)||f.push(e.on(a,b));f.push(d.on(a,b));if(c)for(a=f.length;a--;)c.push(f.pop())}function h(){U=t+m*Z;X=Math.round(U/y)}function k(){X=B-M;U=Math.round(X*y)}var l=a.parts.image,m="right"==a.data.align?-1:1,n=f.data.$.screenX,u=f.data.$.screenY,t=l.$.clientWidth,B=l.$.clientHeight,y=t/B,w=[],v="cke_image_s"+(~m?"e":"w"),K,U,X,Y,Z,M,Q;b.fire("saveSnapshot");g("mousemove", -function(a){K=a.data.$;Z=K.screenX-n;M=u-K.screenY;Q=Math.abs(Z/M);1==m?0>=Z?0>=M?h():Q>=y?h():k():0>=M?Q>=y?k():h():k():0>=Z?0>=M?Q>=y?k():h():k():0>=M?h():Q>=y?h():k();15<=U&&15<=X?(l.setAttributes({width:U,height:X}),Y=!0):Y=!1},w);g("mouseup",function(){for(var d;d=w.pop();)d.removeListener();c.removeClass(v);e.removeClass("cke_image_resizing");Y&&(a.setData({width:U,height:X}),b.fire("saveSnapshot"));Y=!1},w);c.addClass(v);e.addClass("cke_image_resizing")});a.on("data",function(){e["right"== -a.data.align?"addClass":"removeClass"]("cke_image_resizer_left")})}function m(a){var b=[],c;return function(d){var e=a.getCommand("justify"+d);if(e){b.push(function(){e.refresh(a,a.elementPath())});if(d in{right:1,left:1,center:1})e.on("exec",function(c){var e=g(a);if(e){e.setData("align",d);for(e=b.length;e--;)b[e]();c.cancel()}});e.on("refresh",function(b){var e=g(a),f={right:1,left:1,center:1};e&&(void 0===c&&(c=a.filter.checkFeature(a.widgets.registered.image.features.align)),c?this.setState(e.data.align== -d?CKEDITOR.TRISTATE_ON:d in f?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED):this.setState(CKEDITOR.TRISTATE_DISABLED),b.cancel())})}}}function b(a){a.plugins.link&&(CKEDITOR.on("dialogDefinition",function(b){b=b.data;if("link"==b.name){b=b.definition;var c=b.onShow,d=b.onOk;b.onShow=function(){var b=g(a),d=this.getContentElement("info","linkDisplayText").getElement().getParent().getParent();b&&(b.inline?!b.wrapper.getAscendant("a"):1)?(this.setupContent(b.data.link||{}),d.hide()):(d.show(),c.apply(this, -arguments))};b.onOk=function(){var b=g(a);if(b&&(b.inline?!b.wrapper.getAscendant("a"):1)){var c={};this.commitContent(c);b.setData("link",c)}else d.apply(this,arguments)}}}),a.getCommand("unlink").on("exec",function(b){var c=g(a);c&&c.parts.link&&(c.setData("link",null),this.refresh(a,a.elementPath()),b.cancel())}),a.getCommand("unlink").on("refresh",function(b){var c=g(a);c&&(this.setState(c.data.link||c.wrapper.getAscendant("a")?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),b.cancel())}))} -function g(a){return(a=a.widgets.focused)&&"image"==a.name?a:null}function c(a){var b=a.config.image2_alignClasses;a={div:{match:k(a)},p:{match:k(a)},img:{attributes:"!src,alt,width,height"},figure:{classes:"!"+a.config.image2_captionedClass},figcaption:!0};b?(a.div.classes=b[1],a.p.classes=a.div.classes,a.img.classes=b[0]+","+b[2],a.figure.classes+=","+a.img.classes):(a.div.styles="text-align",a.p.styles="text-align",a.img.styles="float",a.figure.styles="float,display");return a}function a(a){a= -a.config.image2_alignClasses;return{dimension:{requiredContent:"img[width,height]"},align:{requiredContent:"img"+(a?"("+a[0]+")":"{float}")},caption:{requiredContent:"figcaption"}}}function n(a){return a.data.hasCaption?a.element:a.parts.image}var w=new CKEDITOR.template('\x3cfigure class\x3d"{captionedClass}"\x3e\x3cimg alt\x3d"" src\x3d"" /\x3e\x3cfigcaption\x3e{captionPlaceholder}\x3c/figcaption\x3e\x3c/figure\x3e'),v={left:0,center:1,right:2},t=/^\s*(\d+\%)\s*$/i;CKEDITOR.plugins.add("image2", -{requires:"widget,dialog",icons:"image",hidpi:!0,onLoad:function(){CKEDITOR.addCss(".cke_image_nocaption{line-height:0}.cke_editable.cke_image_sw, .cke_editable.cke_image_sw *{cursor:sw-resize !important}.cke_editable.cke_image_se, .cke_editable.cke_image_se *{cursor:se-resize !important}.cke_image_resizer{display:none;position:absolute;width:10px;height:10px;bottom:-5px;right:-5px;background:#000;outline:1px solid #fff;line-height:0;cursor:se-resize;}.cke_image_resizer_wrapper{position:relative;display:inline-block;line-height:0;}.cke_image_resizer.cke_image_resizer_left{right:auto;left:-5px;cursor:sw-resize;}.cke_widget_wrapper:hover .cke_image_resizer,.cke_image_resizer.cke_image_resizing{display:block}.cke_widget_wrapper\x3ea{display:inline-block}")}, -init:function(a){if(!a.plugins.detectConflict("image2",["easyimage"])){var b=a.config,c=a.lang.image2,d=f(a);b.filebrowserImage2BrowseUrl=b.filebrowserImageBrowseUrl;b.filebrowserImage2UploadUrl=b.filebrowserImageUploadUrl;d.pathName=c.pathName;d.editables.caption.pathName=c.pathNameCaption;a.widgets.add("image",d);a.ui.addButton&&a.ui.addButton("Image",{label:a.lang.common.image,command:"image",toolbar:"insert,10"});a.contextMenu&&(a.addMenuGroup("image",10),a.addMenuItem("image",{label:c.menu,command:"image", -group:"image"}));CKEDITOR.dialog.add("image2",this.path+"dialogs/image2.js")}},afterInit:function(a){var c={left:1,right:1,center:1,block:1},d=m(a),e;for(e in c)d(e);b(a)}});CKEDITOR.plugins.image2={stateShifter:function(a){function b(a,f){var g={};e?g.attributes={"class":e[1]}:g.styles={"text-align":"center"};g=d.createElement(a.activeEnterMode==CKEDITOR.ENTER_P?"p":"div",g);c(g,f);f.move(g);return g}function c(b,d){if(d.getParent()){var e=a.createRange();e.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START); -d.remove();g.insertElementIntoRange(b,e)}else b.replace(d)}var d=a.document,e=a.config.image2_alignClasses,f=a.config.image2_captionedClass,g=a.editable(),h=["hasCaption","align","link"],k={align:function(c,d,f){var g=c.element;c.changed.align?c.newData.hasCaption||("center"==f&&(c.deflate(),c.element=b(a,g)),c.changed.hasCaption||"center"!=d||"center"==f||(c.deflate(),d=g.findOne("a,img"),d.replace(g),c.element=d)):"center"==f&&c.changed.hasCaption&&!c.newData.hasCaption&&(c.deflate(),c.element= -b(a,g));!e&&g.is("figure")&&("center"==f?g.setStyle("display","inline-block"):g.removeStyle("display"))},hasCaption:function(b,e,g){b.changed.hasCaption&&(e=b.element.is({img:1,a:1})?b.element:b.element.findOne("a,img"),b.deflate(),g?(g=CKEDITOR.dom.element.createFromHtml(w.output({captionedClass:f,captionPlaceholder:a.lang.image2.captionPlaceholder}),d),c(g,b.element),e.replace(g.findOne("img")),b.element=g):(e.replace(b.element),b.element=e))},link:function(b,c,e){if(b.changed.link){var f=b.element.is("img")? -b.element:b.element.findOne("img"),g=b.element.is("a")?b.element:b.element.findOne("a"),h=b.element.is("a")&&!e||b.element.is("img")&&e,k;h&&b.deflate();e?(c||(k=d.createElement("a",{attributes:{href:b.newData.link.url}}),k.replace(f),f.move(k)),e=CKEDITOR.plugins.image2.getLinkAttributesGetter()(a,e),CKEDITOR.tools.isEmpty(e.set)||(k||g).setAttributes(e.set),e.removed.length&&(k||g).removeAttributes(e.removed)):(e=g.findOne("img"),e.replace(g),k=e);h&&(b.element=k)}}};return function(a){var b,c; -a.changed={};for(c=0;cm.length)return!1;h=g.getParents(!0);for(l=0;lu;l++)t[l].indent+=h;h=CKEDITOR.plugins.list.arrayToList(t,a,null,b.config.enterMode,g.getDirection());if(!c.isIndent){var z;if((z=g.getParent())&&z.is("li"))for(var m=h.listNode.getChildren(),v=[],F,l=m.count()-1;0<=l;l--)(F=m.getItem(l))&& -F.is&&F.is("li")&&v.push(F)}h&&h.listNode.replace(g);if(v&&v.length)for(l=0;le[g-1].indent+1){f=e[g-1].indent+1-e[g].indent;for(h=e[g].indent;e[g]&&e[g].indent>=h;)e[g].indent+=f,g++;g--}var k=CKEDITOR.plugins.list.arrayToList(e,c,null,a.config.enterMode,b.root.getAttribute("dir")).listNode,l,m;d(!0);d();k.replace(b.root);a.fire("contentDomInvalidated")}function h(a,b){this.name=a;this.context=this.type=b;this.allowedContent=b+" li";this.requiredContent=b}function e(a,b,c,d){for(var e,f;e=a[d?"getLast":"getFirst"](v);)(f=e.getDirection(1))!== -b.getDirection(1)&&e.setAttribute("dir",f),e.remove(),c?e[d?"insertBefore":"insertAfter"](c):b.append(e,d)}function k(b){function c(d){var f=b[d?"getPrevious":"getNext"](a);f&&f.type==CKEDITOR.NODE_ELEMENT&&f.is(b.getName())&&(e(b,f,null,!d),b.remove(),b=f)}c();c(1)}function d(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function l(b,c,d){b.fire("saveSnapshot");d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS); -var f=d.extractContents();c.trim(!1,!0);var g=c.createBookmark(),h=new CKEDITOR.dom.elementPath(c.startContainer),l=h.block,h=h.lastElement.getAscendant("li",1)||l,u=new CKEDITOR.dom.elementPath(d.startContainer),y=u.contains(CKEDITOR.dtd.$listItem),u=u.contains(CKEDITOR.dtd.$list);l?(l=l.getBogus())&&l.remove():u&&(l=u.getPrevious(a))&&n(l)&&l.remove();(l=f.getLast())&&l.type==CKEDITOR.NODE_ELEMENT&&l.is("br")&&l.remove();(l=c.startContainer.getChild(c.startOffset))?f.insertBefore(l):c.startContainer.append(f); -y&&(f=m(y))&&(h.contains(y)?(e(f,y.getParent(),y),f.remove()):h.append(f));for(;d.checkStartOfBlock()&&d.checkEndOfBlock();){u=d.startPath();f=u.block;if(!f)break;f.is("li")&&(h=f.getParent(),f.equals(h.getLast(a))&&f.equals(h.getFirst(a))&&(f=h));d.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove()}d=d.clone();f=b.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(b){return a(b)&&!n(b)};(d=d.next())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in -CKEDITOR.dtd.$list&&k(d);c.moveToBookmark(g);c.select();b.fire("saveSnapshot")}function m(c){return(c=c.getLast(a))&&c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in b?c:null}var b={ol:1,ul:1},g=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(),a=function(a){return!(g(a)||c(a))},n=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(a,c,d,e,f){if(!b[a.getName()])return[];e||(e=0);d||(d=[]);for(var g=0,h=a.getChildCount();g=l.$.documentMode&&w.append(l.createText(" ")),w.append(x.listNode),x=x.nextIndex;else if(-1==G.indent&&!f&&k){b[k.getName()]?(w=G.element.clone(!1,!0),v!=k.getDirection(1)&&w.setAttribute("dir",v)):w=new CKEDITOR.dom.documentFragment(l); -var n=k.getDirection(1)!=v,L=G.element,O=L.getAttribute("class"),D=L.getAttribute("style"),S=w.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(g!=CKEDITOR.ENTER_BR||n||D||O),J,R=G.contents.length,K;for(k=0;kn.length)){v=n[n.length-1].getNext();E=g.createElement(this.type);y.push(E);for(H=y=void 0;n.length;)y=n.shift(),H=g.createElement("li"), -G=y,G.is("pre")||w.test(G.getName())||"false"==G.getAttribute("contenteditable")?y.appendTo(H):(y.copyAttributes(H),x&&y.getDirection()&&(H.removeStyle("direction"),H.removeAttribute("dir")),y.moveChildren(H),y.remove()),H.appendTo(E);x&&z&&E.setAttribute("dir",x);v?E.insertBefore(v):E.appendTo(l)}}else this.state==CKEDITOR.TRISTATE_ON&&b[x.root.getName()]&&f.call(this,c,x,m);for(E=0;Eb&&aE.version?" ":X,f=a.hotNode&&a.hotNode.getText()==e&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!b;g(a,function(c){f&& -a.hotNode&&a.hotNode.remove();c[b?"insertAfter":"insertBefore"](d);c.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!b});a.lastCmdDirection=!!b});E.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();a.line.detach()}return function(f){f=f.getSelection().getStartElement();var g;f=f.getAscendant(Q,1);if(!p(a,f)&&f&&!f.equals(a.editable)&&!f.contains(a.editable)){(g=m(f))&&"false"==g.getAttribute("contenteditable")&&(f=g);a.element=f;g=d(a,f,!b);var h;n(g)&&g.is(a.triggers)&& -g.is(M)&&(!d(a,g,!b)||(h=d(a,g,!b))&&n(h)&&h.is(a.triggers))?c(g):(h=e(a,f),n(h)&&(d(a,h,!b)?(f=d(a,h,!b))&&n(f)&&f.is(a.triggers)&&c(h):c(h)))}}}()}}function a(a,b){if(!b||b.type!=CKEDITOR.NODE_ELEMENT||!b.$)return!1;var c=a.line;return c.wrap.equals(b)||c.wrap.contains(b)}function n(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.$}function w(a){if(!n(a))return!1;var b;(b=v(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1);return b}function v(a){return!!{absolute:1, -fixed:1}[a.getComputedStyle("position")]}function t(a,b){return n(b)?b.is(a.triggers):null}function p(a,b){if(!b)return!1;for(var c=b.getParents(1),d=c.length;d--;)for(var e=a.tabuList.length;e--;)if(c[d].hasAttribute(a.tabuList[e]))return!0;return!1}function q(a,b,c){b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&!b.is(Z)});if(!b)return!1;B(a,b);return c?b.size.top>a.mouse.y:b.size.bottom -(b.inInlineMode?e.editable.top+e.editable.height/2:Math.min(e.editable.height,e.pane.height)/2),c=c[g?"getLast":"getFirst"](function(a){return!(ba(a)||ca(a))});if(!c)return null;a(b,c)&&(c=b.line.wrap[g?"getPrevious":"getNext"](function(a){return!(ba(a)||ca(a))}));if(!n(c)||w(c)||!t(b,c))return null;B(b,c);return!g&&0<=c.size.top&&l(d.y,0,c.size.top+f)?(b=b.inInlineMode||0===e.scroll.y?R:U,new h([null,c,O,J,b])):g&&c.size.bottom<=e.pane.height&&l(d.y,c.size.bottom-f,e.pane.height)?(b=b.inInlineMode|| -l(c.size.bottom,e.pane.height-f,e.pane.height)?K:U,new h([c,null,D,J,b])):null}function r(a){var b=a.mouse,c=a.view,f=a.triggerOffset,g=e(a);if(!g)return null;B(a,g);var f=Math.min(f,0|g.size.outerHeight/2),k=[],m,r;if(l(b.y,g.size.top-1,g.size.top+f))r=!1;else if(l(b.y,g.size.bottom-f,g.size.bottom+1))r=!0;else return null;if(w(g)||q(a,g,r)||g.getParent().is(Y))return null;var p=d(a,g,!r);if(p){if(p&&p.type==CKEDITOR.NODE_TEXT)return null;if(n(p)){if(w(p)||!t(a,p)||p.getParent().is(Y))return null; -k=[p,g][r?"reverse":"concat"]().concat([S,J])}}else g.equals(a.editable[r?"getLast":"getFirst"](a.isRelevant))?(u(a),r&&l(b.y,g.size.bottom-f,c.pane.height)&&l(g.size.bottom,c.pane.height-f,c.pane.height)?m=K:l(b.y,0,g.size.top+f)&&(m=R)):m=U,k=[null,g][r?"reverse":"concat"]().concat([r?D:O,J,m,g.equals(a.editable[r?"getLast":"getFirst"](a.isRelevant))?r?K:R:U]);return 0 in k?new h(k):null}function C(a,b,c,d){for(var e=b.getDocumentPosition(),f={},g={},h={},k={},l=da.length;l--;)f[da[l]]=parseInt(b.getComputedStyle.call(b, -"border-"+da[l]+"-width"),10)||0,h[da[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+da[l]),10)||0,g[da[l]]=parseInt(b.getComputedStyle.call(b,"margin-"+da[l]),10)||0;c&&!d||y(a,d);k.top=e.y-(c?0:a.view.scroll.y);k.left=e.x-(c?0:a.view.scroll.x);k.outerWidth=b.$.offsetWidth;k.outerHeight=b.$.offsetHeight;k.height=k.outerHeight-(h.top+h.bottom+f.top+f.bottom);k.width=k.outerWidth-(h.left+h.right+f.left+f.right);k.bottom=k.top+k.outerHeight;k.right=k.left+k.outerWidth;a.inInlineMode&&(k.scroll={top:b.$.scrollTop, -left:b.$.scrollLeft});return z({border:f,padding:h,margin:g,ignoreScroll:c},k,!0)}function B(a,b,c){if(!n(b))return b.size=null;if(!b.size)b.size={};else if(b.size.ignoreScroll==c&&b.size.date>new Date-N)return null;return z(b.size,C(a,b,c),{date:+new Date},!0)}function u(a,b){a.view.editable=C(a,a.editable,b,!0)}function y(a,b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-N)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();z(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth- -d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function x(a,b,c,d){for(var e=d,f=d,g=0,k=!1,l=!1,m=a.view.pane.height,n=a.mouse;n.y+gc.left-d.x&&bc.top-d.y&&aCKEDITOR.env.version, -G=CKEDITOR.dtd,L={},O=128,D=64,S=32,J=16,R=4,K=2,U=1,X=" ",Y=G.$listItem,Z=G.$tableContent,M=z({},G.$nonEditable,G.$empty),Q=G.$block,N=100,V="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",T=V+"border-color:transparent;display:block;border-style:solid;",P="\x3cspan\x3e"+X+"\x3c/span\x3e";L[CKEDITOR.ENTER_BR]="br";L[CKEDITOR.ENTER_P]="p";L[CKEDITOR.ENTER_DIV]="div";h.prototype={set:function(a,b,c){this.properties= -a+b+(c||U);return this},is:function(a){return(this.properties&a)==a}};var W=function(){function b(a,c){var d=a.$.elementFromPoint(c.x,c.y);return d&&d.nodeType?new CKEDITOR.dom.element(d):null}return function(c,d,e){if(!c.mouse)return null;var f=c.doc,g=c.line.wrap;e=e||c.mouse;var h=b(f,e);d&&a(c,h)&&(g.hide(),h=b(f,e),g.show());return!h||h.type!=CKEDITOR.NODE_ELEMENT||!h.$||E.ie&&9>E.version&&!c.boundary.equals(h)&&!c.boundary.contains(h)?null:h}}(),ba=CKEDITOR.dom.walker.whitespaces(),ca=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT), -aa=function(){function b(a){var d=a.element,e,g,h;if(!n(d)||d.contains(a.editable)||d.isReadOnly())return null;h=x(a,function(a,b){return!b.equals(a)},function(a,b){return W(a,!0,b)},d);e=h.upper;g=h.lower;if(f(a,e,g))return h.set(S,8);if(e&&d.contains(e))for(;!e.getParent().equals(d);)e=e.getParent();else e=d.getFirst(function(b){return c(a,b)});if(g&&d.contains(g))for(;!g.getParent().equals(d);)g=g.getParent();else g=d.getLast(function(b){return c(a,b)});if(!e||!g)return null;B(a,e);B(a,g);if(!l(a.mouse.y, -e.size.top,g.size.bottom))return null;for(var d=Number.MAX_VALUE,m,q,u,r;g&&!g.equals(e)&&(q=e.getNext(a.isRelevant));)m=Math.abs(k(a,e,q)-a.mouse.y),m|<\/font>)/,c=/CKEDITOR.env.version),g=b?":not([contenteditable\x3dfalse]):not(.cke_show_blocks_off)":"",c,a; -for(e=k=d=l="";c=f.pop();)a=f.length?",":"",e+=".cke_show_blocks "+c+g+a,d+=".cke_show_blocks.cke_contents_ltr "+c+g+a,l+=".cke_show_blocks.cke_contents_rtl "+c+g+a,k+=".cke_show_blocks "+c+g+"{background-image:url("+CKEDITOR.getUrl(m+"images/block_"+c+".png")+")}";CKEDITOR.addCss((e+"{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(k,d+"{background-position:top left;padding-left:8px}",l+"{background-position:top right;padding-right:8px}"));b||CKEDITOR.addCss(".cke_show_blocks [contenteditable\x3dfalse],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}")}, -init:function(h){function e(){k.refresh(h)}if(!h.blockless){var k=h.addCommand("showblocks",f);k.canUndo=!1;h.config.startupOutlineBlocks&&k.setState(CKEDITOR.TRISTATE_ON);h.ui.addButton&&h.ui.addButton("ShowBlocks",{label:h.lang.showblocks.toolbar,command:"showblocks",toolbar:"tools,20"});h.on("mode",function(){k.state!=CKEDITOR.TRISTATE_DISABLED&&k.refresh(h)});h.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(h.on("focus",e),h.on("blur",e));h.on("contentDom",function(){k.state!=CKEDITOR.TRISTATE_DISABLED&& -k.refresh(h)})}}})}(),function(){var f={preserveState:!0,editorFocus:!1,readOnly:1,exec:function(f){this.toggleState();this.refresh(f)},refresh:function(f){if(f.document){var e=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";f.editable()[e]("cke_show_borders")}}};CKEDITOR.plugins.add("showborders",{modes:{wysiwyg:1},onLoad:function(){var f;f=(CKEDITOR.env.ie6Compat?[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th","{","border : #d3d3d3 1px dotted","}"]:".%1 table.%2,;.%1 table.%2 \x3e tr \x3e td, .%1 table.%2 \x3e tr \x3e th,;.%1 table.%2 \x3e tbody \x3e tr \x3e td, .%1 table.%2 \x3e tbody \x3e tr \x3e th,;.%1 table.%2 \x3e thead \x3e tr \x3e td, .%1 table.%2 \x3e thead \x3e tr \x3e th,;.%1 table.%2 \x3e tfoot \x3e tr \x3e td, .%1 table.%2 \x3e tfoot \x3e tr \x3e th;{;border : #d3d3d3 1px dotted;}".split(";")).join("").replace(/%2/g, -"cke_show_border").replace(/%1/g,"cke_show_borders ");CKEDITOR.addCss(f)},init:function(h){var e=h.addCommand("showborders",f);e.canUndo=!1;!1!==h.config.startupShowBorders&&e.setState(CKEDITOR.TRISTATE_ON);h.on("mode",function(){e.state!=CKEDITOR.TRISTATE_DISABLED&&e.refresh(h)},null,null,100);h.on("contentDom",function(){e.state!=CKEDITOR.TRISTATE_DISABLED&&e.refresh(h)});h.on("removeFormatCleanup",function(e){e=e.data;h.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&e.is("table")&&(!e.hasAttribute("border")|| -0>=parseInt(e.getAttribute("border"),10))&&e.addClass("cke_show_border")})},afterInit:function(f){var e=f.dataProcessor;f=e&&e.dataFilter;e=e&&e.htmlFilter;f&&f.addRules({elements:{table:function(e){e=e.attributes;var d=e["class"],f=parseInt(e.border,10);f&&!(0>=f)||d&&-1!=d.indexOf("cke_show_border")||(e["class"]=(d||"")+" cke_show_border")}}});e&&e.addRules({elements:{table:function(e){e=e.attributes;var d=e["class"];d&&(e["class"]=d.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/, -""))}}})}});CKEDITOR.on("dialogDefinition",function(f){var e=f.data.name;if("table"==e||"tableProperties"==e)if(f=f.data.definition,e=f.getContents("info").get("txtBorder"),e.commit=CKEDITOR.tools.override(e.commit,function(e){return function(d,f){e.apply(this,arguments);var h=parseInt(this.getValue(),10);f[!h||0>=h?"addClass":"removeClass"]("cke_show_border")}}),f=(f=f.getContents("advanced"))&&f.get("advCSSClasses"))f.setup=CKEDITOR.tools.override(f.setup,function(e){return function(){e.apply(this, -arguments);this.setValue(this.getValue().replace(/cke_show_border/,""))}}),f.commit=CKEDITOR.tools.override(f.commit,function(e){return function(d,f){e.apply(this,arguments);parseInt(f.getAttribute("border"),10)||f.addClass("cke_show_border")}})})}(),function(){CKEDITOR.plugins.add("sourcearea",{init:function(h){function e(){var e=d&&this.equals(CKEDITOR.document.getActive());this.hide();this.setStyle("height",this.getParent().$.clientHeight+"px");this.setStyle("width",this.getParent().$.clientWidth+ -"px");this.show();e&&this.focus()}if(h.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var k=CKEDITOR.plugins.sourcearea;h.addMode("source",function(d){var k=h.ui.space("contents").getDocument().createElement("textarea");k.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",h.config.sourceAreaTabSize||4)));k.setAttribute("dir","ltr");k.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu"); -h.ui.space("contents").append(k);k=h.editable(new f(h,k));k.setData(h.getData(1));CKEDITOR.env.ie&&(k.attachListener(h,"resize",e,k),k.attachListener(CKEDITOR.document.getWindow(),"resize",e,k),CKEDITOR.tools.setTimeout(e,0,k));h.fire("ariaWidget",this);d()});h.addCommand("source",k.commands.source);h.ui.addButton&&h.ui.addButton("Source",{label:h.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});h.on("mode",function(){h.getCommand("source").setState("source"==h.mode?CKEDITOR.TRISTATE_ON: -CKEDITOR.TRISTATE_OFF)});var d=CKEDITOR.env.ie&&9==CKEDITOR.env.version}}});var f=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(f){this.setValue(f);this.status="ready";this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(f){this[(f?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){f.baseProto.detach.call(this);this.clearCustomData(); -this.remove()}}})}(),CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(f){"wysiwyg"==f.mode&&f.fire("saveSnapshot");f.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);f.setMode("source"==f.mode?"wysiwyg":"source")},canUndo:!1}}},CKEDITOR.plugins.add("sourcedialog",{requires:"dialog",init:function(f){f.addCommand("sourcedialog",new CKEDITOR.dialogCommand("sourcedialog"));CKEDITOR.dialog.add("sourcedialog",this.path+"dialogs/sourcedialog.js"); -f.ui.addButton&&f.ui.addButton("Sourcedialog",{label:f.lang.sourcedialog.toolbar,command:"sourcedialog",toolbar:"mode,10"})}}),CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-au":1,"en-ca":1,"en-gb":1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1}, -requires:"dialog",init:function(f){var h=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js");f.addCommand("specialchar",{exec:function(){var e=f.langCode,e=h.availableLangs[e]?e:h.availableLangs[e.replace(/-.*/,"")]?e.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(h.path+"dialogs/lang/"+e+".js"),function(){CKEDITOR.tools.extend(f.lang.specialchar,h.langEntries[e]);f.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1});f.ui.addButton&&f.ui.addButton("SpecialChar", -{label:f.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}}),CKEDITOR.config.specialChars="! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;".split(" "), -function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(f){var h=f.config,e=f.lang.stylescombo,k={},d=[],l=[];f.on("stylesSet",function(e){if(e=e.data.styles){for(var b,g,c,a=0,n=e.length;a=e)for(b=this.getNextSourceNode(f,CKEDITOR.NODE_ELEMENT);b;){if(b.isVisible()&&0===b.getTabIndex()){l=b;break}b=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(b=this.getDocument().getBody().getFirst();b=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!k)if(!d&&b.equals(this)){if(d=!0,f){if(!(b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;k=1}}else d&&!this.contains(b)&&(k=1);if(b.isVisible()&&!(0>(g=b.getTabIndex()))){if(k&&g==e){l= -b;break}g>e&&(!l||!m||g(b=g.getTabIndex())))if(0>=e){if(k&&0===b){l=g;break}b>m&& -(l=g,m=b)}else{if(k&&b==e){l=g;break}bm)&&(l=g,m=b)}}l&&l.focus()},CKEDITOR.plugins.add("table",{requires:"dialog",init:function(f){function h(e){return CKEDITOR.tools.extend(e||{},{contextSensitive:1,refresh:function(d,e){this.setState(e.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!f.blockless){var e=f.lang.table;f.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];"+ -(f.plugins.dialogadvtab?"table"+f.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"],["td: splitBorderShorthand"],[{element:"table",right:function(e){if(e.styles){var d;if(e.styles.border)d=CKEDITOR.tools.style.parse.border(e.styles.border);else if(CKEDITOR.env.ie&&8===CKEDITOR.env.version){var f=e.styles;f["border-left"]&&f["border-left"]===f["border-right"]&&f["border-right"]===f["border-top"]&& -f["border-top"]===f["border-bottom"]&&(d=CKEDITOR.tools.style.parse.border(f["border-top"]))}d&&d.style&&"solid"===d.style&&d.width&&0!==parseFloat(d.width)&&(e.attributes.border=1);"collapse"==e.styles["border-collapse"]&&(e.attributes.cellspacing=0)}}}]]}));f.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",h()));f.addCommand("tableDelete",h({exec:function(e){var d=e.elementPath().contains("table",1);if(d){var f=d.getParent(),h=e.editable();1!=f.getChildCount()||f.is("td", -"th")||f.equals(h)||(d=f);e=e.createRange();e.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START);d.remove();e.select()}}}));f.ui.addButton&&f.ui.addButton("Table",{label:e.toolbar,command:"table",toolbar:"insert,30"});CKEDITOR.dialog.add("table",this.path+"dialogs/table.js");CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js");f.addMenuItems&&f.addMenuItems({table:{label:e.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:e.deleteTable,command:"tableDelete",group:"table", -order:1}});f.on("doubleclick",function(e){e.data.element.is("table")&&(e.data.dialog="tableProperties")});f.contextMenu&&f.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}}),function(){function f(a,b){function c(a){return b?b.contains(a)&&a.getAscendant("table",!0).equals(b):!0}function d(a){0c)c=e}return c}function l(a,b){for(var c=p(a)?a:f(a),e=c[0].getAscendant("table"),g=d(c,1),c=d(c),h=b?g:c,k=CKEDITOR.tools.buildTableMap(e),e=[],g=[],c=[],l=k.length,m=0;ml?new CKEDITOR.dom.element(h[0][l+1]):k&&-1!==h[0][k-1].cellIndex?new CKEDITOR.dom.element(h[0][k-1]):new CKEDITOR.dom.element(d.$.parentNode);m.length==a&&(c[0].moveToPosition(d,CKEDITOR.POSITION_AFTER_END),c[0].select(),d.remove());return k}function b(a,b){var c=a.getStartElement().getAscendant({td:1,th:1},!0);if(c){var d=c.clone();d.appendBogus();b?d.insertBefore(c):d.insertAfter(c)}}function g(a){if(a instanceof CKEDITOR.dom.selection){var b= -a.getRanges(),d=f(a),e=d[0]&&d[0].getAscendant("table"),h;a:{var k=0;h=d.length-1;for(var l={},m,n;m=d[k++];)CKEDITOR.dom.element.setMarker(l,m,"delete_cell",!0);for(k=0;m=d[k++];)if((n=m.getPrevious())&&!n.getCustomData("delete_cell")||(n=m.getNext())&&!n.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(l);h=n;break a}CKEDITOR.dom.element.clearAllMarkers(l);k=d[0].getParent();(k=k.getPrevious())?h=k.getLast():(k=d[h].getParent(),h=(k=k.getNext())?k.getChild(0):null)}a.reset();for(a= -d.length-1;0<=a;a--)g(d[a]);h?c(h,!0):e&&(b[0].moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),b[0].select(),e.remove())}else a instanceof CKEDITOR.dom.element&&(b=a.getParent(),1==b.getChildCount()?b.remove():a.remove())}function c(a,b){var c=a.getDocument(),d=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(d.focus(),c.focus());c=new CKEDITOR.dom.range(c);c["moveToElementEdit"+(b?"End":"Start")](a)||(c.selectNodeContents(a),c.collapse(b?!1:!0));c.select(!0)}function a(a,b,c){a=a[b]; -if("undefined"==typeof c)return a;for(b=0;a&&be.length)||(g=b.getCommonAncestor())&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("table"))return!1;var h;b=e[0];g=b.getAscendant("table");var k=CKEDITOR.tools.buildTableMap(g),l=k.length,m=k[0].length,n=b.getParent().$.rowIndex,p=a(k,n,b);if(c){var t;try{var v=parseInt(b.getAttribute("rowspan"),10)||1; -h=parseInt(b.getAttribute("colspan"),10)||1;t=k["up"==c?n-v:"down"==c?n+v:n]["left"==c?p-h:"right"==c?p+h:p]}catch(w){return!1}if(!t||b.$==t)return!1;e["up"==c||"left"==c?"unshift":"push"](new CKEDITOR.dom.element(t))}c=b.getDocument();var L=n,v=t=0,O=!d&&new CKEDITOR.dom.documentFragment(c),D=0;for(c=0;c=m?b.removeAttribute("rowSpan"):b.$.rowSpan=t;t>=l?b.removeAttribute("colSpan"):b.$.colSpan=v;d=new CKEDITOR.dom.nodeList(g.$.rows);e=d.count();for(c=e-1;0<=c;c--)g=d.getItem(c),g.$.cells.length||(g.remove(),e++);return b} -function w(b,c){var d=f(b);if(1l){e.insertBefore(new CKEDITOR.dom.element(p));break}else p=null;p||g.append(e)}else for(m=n=1,g=e.clone(),g.insertAfter(e),g.append(e=d.clone()), -p=a(h,k),l=0;lk);n++){m[l+n]||(m[l+n]=[]);for(var w=0;w=d)break}}return m},function(){function f(b){return CKEDITOR.env.ie?b.$.clientWidth:parseInt(b.getComputedStyle("width"),10)}function h(b,c){var a=b.getComputedStyle("border-"+c+"-width"),d={thin:"0px",medium:"1px",thick:"2px"};0>a.indexOf("px")&&(a=a in d&&"none"!=b.getComputedStyle("border-style")? -d[a]:0);return parseInt(a,10)}function e(b){var c=[],a={},d="rtl"==b.getComputedStyle("direction");CKEDITOR.tools.array.forEach(b.$.rows,function(e,f){var k=-1,l=0,m=null;e?(l=new CKEDITOR.dom.element(e),m={height:l.$.offsetHeight,position:l.getDocumentPosition()}):m=void 0;for(var l=m.height,m=m.position,A=0,r=e.cells.length;A=t.x&&a<=t.x+t.width&&c>=t.y&&c<=t.y+t.height))return t= -null,A=C=0,p.removeListener("mouseup",l),q.removeListener("mousedown",e),q.removeListener("mousemove",v),p.getBody().setStyle("cursor","auto"),b?q.remove():q.hide(),0;var d=a-Math.round(q.$.offsetWidth/2);if(A){if(d==x||d==z)return 1;d=Math.max(d,x);d=Math.min(d,z);C=d-r}q.setStyle("left",m(d));return 1}}function l(b){var c=b.data.getTarget();if("mouseout"==b.name){if(!c.is("table"))return;for(var a=new CKEDITOR.dom.element(b.data.$.relatedTarget||b.data.$.toElement);a&&a.$&&!a.equals(c)&&!a.is("body");)a= -a.getParent();if(!a||a.equals(c))return}c.getAscendant("table",1).removeCustomData("_cke_table_pillars");b.removeListener()}var m=CKEDITOR.tools.cssLength,b=CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks);CKEDITOR.plugins.add("tableresize",{requires:"tabletools",init:function(b){b.on("contentDom",function(){var c,a=b.editable();a.attachListener(a.isInline()?a:b.document,"mousemove",function(a){a=a.data;var f=a.getTarget();if(f.type==CKEDITOR.NODE_ELEMENT){var h=a.getPageOffset().x, -m=a.getPageOffset().y;if(c&&c.move(h,m))k(a);else if(f.is("table")||f.getAscendant({thead:1,tbody:1,tfoot:1},1))if(a=f.getAscendant("table",1),b.editable().contains(a)){(f=a.getCustomData("_cke_table_pillars"))||(a.setCustomData("_cke_table_pillars",f=e(a)),a.on("mouseout",l),a.on("mousedown",l));a:{a=f;for(var f=0,p=a.length;f=q.x&&h<=q.x+q.width&&m>=q.y&&m<=q.y+q.height){h=q;break a}}h=null}h&&(!c&&(c=new d(b)),c.attachTo(h))}}})})}})}(),"use strict",function(){var f=[CKEDITOR.CTRL+ -90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],h={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(b){function d(b){a.enabled&&!1!==b.data.command.canUndo&&a.save()}function c(){a.enabled=b.readOnly?!1:"wysiwyg"==b.mode;a.onChange()}var a=b.undoManager=new e(b),h=a.editingHandler=new l(a),k=b.addCommand("undo",{exec:function(){a.undo()&&(b.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),m=b.addCommand("redo",{exec:function(){a.redo()&&(b.selectionChange(),this.fire("afterRedo"))}, -startDisabled:!0,canUndo:!1});b.setKeystroke([[f[0],"undo"],[f[1],"redo"],[f[2],"redo"]]);a.onChange=function(){k.setState(a.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);m.setState(a.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};b.on("beforeCommandExec",d);b.on("afterCommandExec",d);b.on("saveSnapshot",function(b){a.save(b.data&&b.data.contentOnly)});b.on("contentDom",h.attachListeners,h);b.on("instanceReady",function(){b.fire("saveSnapshot")});b.on("beforeModeUnload", -function(){"wysiwyg"==b.mode&&a.save(!0)});b.on("mode",c);b.on("readOnly",c);b.ui.addButton&&(b.ui.addButton("Undo",{label:b.lang.undo.undo,command:"undo",toolbar:"undo,10"}),b.ui.addButton("Redo",{label:b.lang.undo.redo,command:"redo",toolbar:"undo,20"}));b.resetUndo=function(){a.reset();b.fire("saveSnapshot")};b.on("updateSnapshot",function(){a.currentImage&&a.update()});b.on("lockSnapshot",function(b){b=b.data;a.lock(b&&b.dontUpdate,b&&b.forceUpdate)});b.on("unlockSnapshot",a.unlock,a)}});CKEDITOR.plugins.undo= -{};var e=CKEDITOR.plugins.undo.UndoManager=function(b){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=b.config.undoStackSize||20;this.strokesLimit=25;this.editor=b;this.reset()};e.prototype={type:function(b,d){var c=e.getKeyGroup(b),a=this.strokesRecorded[c]+1;d=d||a>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());d?(a=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[c]=a;this.previousKeyGroup= -c},keyGroupChanged:function(b){return e.getKeyGroup(b)!=this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(b,d,c){var a=this.editor;if(this.locked||"ready"!=a.status|| -"wysiwyg"!=a.mode)return!1;var e=a.editable();if(!e||"ready"!=e.status)return!1;e=this.snapshots;d||(d=new k(a));if(!1===d.contents)return!1;if(this.currentImage)if(d.equalsContent(this.currentImage)){if(b||d.equalsSelection(this.currentImage))return!1}else!1!==c&&a.fire("change");e.splice(this.index+1,e.length-this.index-1);e.length==this.limit&&e.shift();this.index=e.push(d)-1;this.currentImage=d;!1!==c&&this.refreshState();return!0},restoreImage:function(b){var d=this.editor,c;b.bookmarks&&(d.focus(), -c=d.getSelection());this.locked={level:999};this.editor.loadSnapshot(b.contents);b.bookmarks?c.selectBookmarks(b.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select());this.locked=null;this.index=b.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();d.fire("change")},getNextImage:function(b){var d=this.snapshots,c=this.currentImage,a;if(c)if(b)for(a=this.index-1;0<=a;a--){if(b=d[a],!c.equalsContent(b))return b.index= -a,b}else for(a=this.index+1;a=this.undoManager.strokesLimit&&(this.undoManager.type(b.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(b){var d=this.undoManager; -b=b.data.getKey();var c=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(b);if(!(e.ieFunctionalKeysBug(b)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new k(d.editor,!0))))if(0CKEDITOR.env.version&&f.enterMode!=CKEDITOR.ENTER_DIV&&e("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10this.$.offsetHeight){var c=f.createRange();c[33==b?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(b,"blur",function(){try{b.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(b,"touchend",function(){d.focus()});g=f.document.getElementsByTag("title").getItem(0); -g.data("cke-title",g.getText());CKEDITOR.env.ie&&(f.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");f.fire("contentDom");this._.isPendingFocus&&(f.focus(),this._.isPendingFocus=!1);setTimeout(function(){f.fire("dataReady")},0)},0,this)}function h(d){function e(){var b;d.editable().attachListener(d,"selectionChange",function(){var a=d.getSelection().getSelectedElement();a&&(b&&(b.detachEvent("onresizestart",f),b=null),a.$.attachEvent("onresizestart", -f),b=a.$)})}function f(b){b.returnValue=!1}if(CKEDITOR.env.gecko)try{var b=d.document.$;b.execCommand("enableObjectResizing",!1,!d.config.disableObjectResizing);b.execCommand("enableInlineTableEditing",!1,!d.config.disableNativeTableHandles)}catch(g){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&d.config.disableObjectResizing&&e(d)}function e(){var d=[];if(8<=CKEDITOR.document.$.documentMode){d.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");var e=[],f;for(f in CKEDITOR.dtd.$removeEmpty)e.push("html.CSS1Compat "+ -f+"[contenteditable\x3dfalse]");d.push(e.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(d.push("html{height:100% !important}"),d.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));d.push("html{cursor:text;*cursor:auto}");d.push("img,input,textarea{cursor:default}");return d.join("\n")}var k;CKEDITOR.plugins.add("wysiwygarea",{init:function(d){d.config.fullPage&&d.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]", -requiredContent:"body"});d.addMode("wysiwyg",function(e){function f(a){a&&a.removeListener();d.editable(new k(d,g.$.contentWindow.document.body));d.setData(d.getData(1),e)}var b="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",b=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(b)+"}())":"",g=CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"'+b+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e'); -g.setStyles({width:"100%",height:"100%"});g.addClass("cke_wysiwyg_frame").addClass("cke_reset");b=d.ui.space("contents");b.append(g);var c=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(c)g.on("load",f);var a=d.title,h=d.fire("ariaEditorHelpLabel",{}).label;a&&(CKEDITOR.env.ie&&h&&(a+=", "+h),g.setAttribute("title",a));if(h){var a=CKEDITOR.tools.getNextId(),w=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+a+'" class\x3d"cke_voice_label"\x3e'+h+"\x3c/span\x3e");b.append(w,1);g.setAttribute("aria-describedby", -a)}d.on("beforeModeUnload",function(a){a.removeListener();w&&w.remove()});g.setAttributes({tabIndex:d.tabIndex,allowTransparency:"true"});!c&&f();d.fire("ariaWidget",g)})}});CKEDITOR.editor.prototype.addContentsCss=function(d){var e=this.config,f=e.contentsCss;CKEDITOR.tools.isArray(f)||(e.contentsCss=f?[f]:[]);e.contentsCss.push(d)};k=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(d){CKEDITOR.tools.setTimeout(f, -0,this,d)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(d,f){var h=this.editor;if(f)this.setHtml(d),this.fixInitialSelection(),h.fire("dataReady");else{this._.isLoadingData=!0;h._.dataStore={id:1};var b=h.config,g=b.fullPage,c=b.docType,a=CKEDITOR.tools.buildStyleHtml(e()).replace(/ - - -bar - -EOT; - $test->_setRawContent($raw_content); - $this->assertNotContains('foo', $test->_getTextContent()); - $this->assertNotContains('', $test->_getTextContent()); - $this->assertContains('bar', $test->_getTextContent()); - } - -} - -class TestClass { - use AssertContentTrait; - - public function _setRawContent($content) { - $this->setRawContent($content); - } - - public function _getTextContent() { - return $this->getTextContent(); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/modules/simpletest/tests/src/Unit/PhpUnitAutoloaderTest.php --- a/core/modules/simpletest/tests/src/Unit/PhpUnitAutoloaderTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -assertTrue(class_exists('\Drupal\phpunit_test\PhpUnitTestDummyClass'), 'Class provided by test module was not autoloaded.'); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/modules/simpletest/tests/src/Unit/SimpletestUiPrinterTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/simpletest/tests/src/Unit/SimpletestUiPrinterTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,45 @@ +write(). + * - Buffer to pass into SimpletestUiPrinter->write(). + */ + public function provideBuffer() { + return [ + ['&"'<>', '&"\'<>'], + ['http:////www.example.com', 'http:////www.example.com'], + ['this is some text http://www.example.com/ with a link in it.', 'this is some text http://www.example.com/ with a link in it.'], + ["HTML output was generated
\n", "HTML output was generated\n"], + ]; + } + + /** + * @covers ::write + * + * @dataProvider provideBuffer + */ + public function testWrite($expected, $buffer) { + $printer = new SimpletestUiPrinter(); + // Set up our expectation. + $this->expectOutputString($expected); + // Write the buffer. + $printer->write($buffer); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/modules/simpletest/tests/src/Unit/TestBaseTest.php --- a/core/modules/simpletest/tests/src/Unit/TestBaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/simpletest/tests/src/Unit/TestBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -8,6 +8,7 @@ * @requires extension curl * @coversDefaultClass \Drupal\simpletest\TestBase * @group simpletest + * @group TestBase */ class TestBaseTest extends UnitTestCase { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php --- a/core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,8 @@ namespace Drupal\Tests\simpletest\Unit; use Composer\Autoload\ClassLoader; +use Drupal\Core\DependencyInjection\Container; +use Drupal\Core\DrupalKernel; use Drupal\Core\Extension\Extension; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\simpletest\Exception\MissingGroupException; @@ -30,13 +32,14 @@ $tests[] = [ // Expected result. [ - 'name' => 'Drupal\Tests\simpletest\Unit\TestDiscoveryTest', + 'name' => static::class, 'group' => 'simpletest', + 'groups' => ['simpletest'], 'description' => 'Tests \Drupal\simpletest\TestDiscovery.', 'type' => 'PHPUnit-Unit', ], // Classname. - 'Drupal\Tests\simpletest\Unit\TestDiscoveryTest', + static::class, ]; // A core unit test. @@ -45,6 +48,7 @@ [ 'name' => 'Drupal\Tests\Core\DrupalTest', 'group' => 'DrupalTest', + 'groups' => ['DrupalTest'], 'description' => 'Tests \Drupal.', 'type' => 'PHPUnit-Unit', ], @@ -58,6 +62,7 @@ [ 'name' => 'Drupal\FunctionalTests\BrowserTestBaseTest', 'group' => 'browsertestbase', + 'groups' => ['browsertestbase'], 'description' => 'Tests BrowserTestBase functionality.', 'type' => 'PHPUnit-Functional', ], @@ -71,6 +76,7 @@ [ 'name' => '\Drupal\Tests\file\Kernel\FileItemValidationTest', 'group' => 'file', + 'groups' => ['file'], 'description' => 'Tests that files referenced in file and image fields are always validated.', 'type' => 'PHPUnit-Kernel', ], @@ -85,6 +91,7 @@ [ 'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest', 'group' => 'simpletest', + 'groups' => ['simpletest'], 'description' => 'Tests the Simpletest UI internal browser.', 'type' => 'Simpletest', ], @@ -105,6 +112,7 @@ [ 'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest', 'group' => 'simpletest', + 'groups' => ['simpletest'], 'description' => 'Tests the Simpletest UI internal browser.', 'type' => 'Simpletest', ], @@ -127,6 +135,7 @@ [ 'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest', 'group' => 'simpletest', + 'groups' => ['simpletest'], 'description' => 'Tests the Simpletest UI internal browser. * @', 'type' => 'Simpletest', ], @@ -147,6 +156,7 @@ [ 'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest', 'group' => 'Test', + 'groups' => ['Test', 'simpletest'], 'description' => 'Tests the Simpletest UI internal browser.', 'type' => 'Simpletest', ], @@ -162,6 +172,33 @@ ", ]; + // A great number of @group annotations. + $tests['many-group-annotations'] = [ + // Expected result. + [ + 'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest', + 'group' => 'Test', + 'groups' => ['Test', 'simpletest', 'another', 'more', 'many', 'enough', 'whoa'], + 'description' => 'Tests the Simpletest UI internal browser.', + 'type' => 'Simpletest', + ], + // Classname. + 'Drupal\simpletest\Tests\ExampleSimpleTest', + // Doc block. + "/** + * Tests the Simpletest UI internal browser. + * + * @group Test + * @group simpletest + * @group another + * @group more + * @group many + * @group enough + * @group whoa + */ + ", + ]; + // @dependencies annotation. $tests[] = [ // Expected result. @@ -171,6 +208,7 @@ 'type' => 'Simpletest', 'requires' => ['module' => ['test']], 'group' => 'simpletest', + 'groups' => ['simpletest'], ], // Classname. 'Drupal\simpletest\Tests\ExampleSimpleTest', @@ -193,6 +231,7 @@ 'type' => 'Simpletest', 'requires' => ['module' => ['test', 'test1', 'test2']], 'group' => 'simpletest', + 'groups' => ['simpletest'], ], // Classname. 'Drupal\simpletest\Tests\ExampleSimpleTest', @@ -214,6 +253,7 @@ 'description' => 'Tests the Simpletest UI internal browser. And the summary line continues an there is no gap to the annotation.', 'type' => 'Simpletest', 'group' => 'simpletest', + 'groups' => ['simpletest'], ], // Classname. 'Drupal\simpletest\Tests\ExampleSimpleTest', @@ -270,6 +310,18 @@ class FunctionalExampleTest {} EOF; + $test_profile_info = << [ 'test_module' => [ @@ -280,7 +332,7 @@ 'FunctionalExampleTest2.php' => str_replace(['FunctionalExampleTest', '@group example'], ['FunctionalExampleTest2', '@group example2'], $test_file), ], 'Kernel' => [ - 'KernelExampleTest3.php' => str_replace(['FunctionalExampleTest', '@group example'], ['KernelExampleTest3', '@group example2'], $test_file), + 'KernelExampleTest3.php' => str_replace(['FunctionalExampleTest', '@group example'], ['KernelExampleTest3', "@group example2\n * @group kernel\n"], $test_file), 'KernelExampleTestBase.php' => str_replace(['FunctionalExampleTest', '@group example'], ['KernelExampleTestBase', '@group example2'], $test_file), 'KernelExampleTrait.php' => str_replace(['FunctionalExampleTest', '@group example'], ['KernelExampleTrait', '@group example2'], $test_file), 'KernelExampleInterface.php' => str_replace(['FunctionalExampleTest', '@group example'], ['KernelExampleInterface', '@group example2'], $test_file), @@ -289,6 +341,23 @@ ], ], ], + 'profiles' => [ + 'test_profile' => [ + 'test_profile.info.yml' => $test_profile_info, + 'modules' => [ + 'test_profile_module' => [ + 'test_profile_module.info.yml' => $test_module_info, + 'tests' => [ + 'src' => [ + 'Kernel' => [ + 'KernelExampleTest4.php' => str_replace(['FunctionalExampleTest', '@group example'], ['KernelExampleTest4', '@group example3'], $test_file), + ], + ], + ], + ], + ], + ], + ], ]); } @@ -307,13 +376,14 @@ ]; $test_discovery->setExtensions($extensions); $result = $test_discovery->getTestClasses(); - $this->assertCount(2, $result); + $this->assertCount(3, $result); $this->assertEquals([ 'example' => [ 'Drupal\Tests\test_module\Functional\FunctionalExampleTest' => [ 'name' => 'Drupal\Tests\test_module\Functional\FunctionalExampleTest', 'description' => 'Test description', 'group' => 'example', + 'groups' => ['example'], 'type' => 'PHPUnit-Functional', ], ], @@ -322,12 +392,23 @@ 'name' => 'Drupal\Tests\test_module\Functional\FunctionalExampleTest2', 'description' => 'Test description', 'group' => 'example2', + 'groups' => ['example2'], 'type' => 'PHPUnit-Functional', ], 'Drupal\Tests\test_module\Kernel\KernelExampleTest3' => [ 'name' => 'Drupal\Tests\test_module\Kernel\KernelExampleTest3', 'description' => 'Test description', 'group' => 'example2', + 'groups' => ['example2', 'kernel'], + 'type' => 'PHPUnit-Kernel', + ], + ], + 'kernel' => [ + 'Drupal\Tests\test_module\Kernel\KernelExampleTest3' => [ + 'name' => 'Drupal\Tests\test_module\Kernel\KernelExampleTest3', + 'description' => 'Test description', + 'group' => 'example2', + 'groups' => ['example2', 'kernel'], 'type' => 'PHPUnit-Kernel', ], ], @@ -346,10 +427,11 @@ $extensions = [ 'test_module' => new Extension('vfs://drupal', 'module', 'modules/test_module/test_module.info.yml'), + 'test_profile_module' => new Extension('vfs://drupal', 'profile', 'profiles/test_profile/modules/test_profile_module/test_profile_module.info.yml'), ]; $test_discovery->setExtensions($extensions); $result = $test_discovery->getTestClasses(NULL, ['PHPUnit-Kernel']); - $this->assertCount(2, $result); + $this->assertCount(4, $result); $this->assertEquals([ 'example' => [], 'example2' => [ @@ -357,6 +439,25 @@ 'name' => 'Drupal\Tests\test_module\Kernel\KernelExampleTest3', 'description' => 'Test description', 'group' => 'example2', + 'groups' => ['example2', 'kernel'], + 'type' => 'PHPUnit-Kernel', + ], + ], + 'kernel' => [ + 'Drupal\Tests\test_module\Kernel\KernelExampleTest3' => [ + 'name' => 'Drupal\Tests\test_module\Kernel\KernelExampleTest3', + 'description' => 'Test description', + 'group' => 'example2', + 'groups' => ['example2', 'kernel'], + 'type' => 'PHPUnit-Kernel', + ], + ], + 'example3' => [ + 'Drupal\Tests\test_profile_module\Kernel\KernelExampleTest4' => [ + 'name' => 'Drupal\Tests\test_profile_module\Kernel\KernelExampleTest4', + 'description' => 'Test description', + 'group' => 'example3', + 'groups' => ['example3'], 'type' => 'PHPUnit-Kernel', ], ], @@ -364,6 +465,36 @@ } /** + * @covers ::getTestClasses + */ + public function testGetTestsInProfiles() { + $this->setupVfsWithTestClasses(); + $class_loader = $this->prophesize(ClassLoader::class); + $module_handler = $this->prophesize(ModuleHandlerInterface::class); + + $container = new Container(); + $container->set('kernel', new DrupalKernel('prod', new ClassLoader())); + $container->set('site.path', 'sites/default'); + \Drupal::setContainer($container); + + $test_discovery = new TestDiscovery('vfs://drupal', $class_loader->reveal(), $module_handler->reveal()); + + $result = $test_discovery->getTestClasses(NULL, ['PHPUnit-Kernel']); + $expected = [ + 'example3' => [ + 'Drupal\Tests\test_profile_module\Kernel\KernelExampleTest4' => [ + 'name' => 'Drupal\Tests\test_profile_module\Kernel\KernelExampleTest4', + 'description' => 'Test description', + 'group' => 'example3', + 'groups' => ['example3'], + 'type' => 'PHPUnit-Kernel', + ], + ], + ]; + $this->assertEquals($expected, $result); + } + + /** * @covers ::getPhpunitTestSuite * @dataProvider providerTestGetPhpunitTestSuite */ @@ -439,15 +570,3 @@ } } - -namespace Drupal\simpletest\Tests; - -use Drupal\simpletest\WebTestBase; - -/** - * Tests the Simpletest UI internal browser. - * - * @group simpletest - */ -class ExampleSimpleTest extends WebTestBase { -} diff -r 129ea1e6d783 -r af1871eacc83 core/modules/simpletest/tests/src/Unit/TraitAccessTest.php --- a/core/modules/simpletest/tests/src/Unit/TraitAccessTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -getStuff(); - $this->assertSame($stuff, 'stuff', "Same old stuff"); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/modules/simpletest/tests/src/Unit/WebTestBaseTest.php --- a/core/modules/simpletest/tests/src/Unit/WebTestBaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/simpletest/tests/src/Unit/WebTestBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -8,6 +8,7 @@ * @requires extension curl * @coversDefaultClass \Drupal\simpletest\WebTestBase * @group simpletest + * @group WebTestBase */ class WebTestBaseTest extends UnitTestCase { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/statistics/src/Tests/StatisticsTestBase.php --- a/core/modules/statistics/src/Tests/StatisticsTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/src/Tests/StatisticsTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,8 @@ namespace Drupal\statistics\Tests; +@trigger_error(__NAMESPACE__ . '\StatisticsTestBase is deprecated for removal before Drupal 9.0.0. Use \Drupal\Tests\statistics\Functional\StatisticsTestBase instead. See https://www.drupal.org/node/2999939', E_USER_DEPRECATED); + use Drupal\simpletest\WebTestBase; /** @@ -9,6 +11,8 @@ * * @deprecated Scheduled for removal in Drupal 9.0.0. * Use \Drupal\Tests\statistics\Functional\StatisticsTestBase instead. + * + * @see https://www.drupal.org/node/2999939 */ abstract class StatisticsTestBase extends WebTestBase { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/statistics/statistics.module --- a/core/modules/statistics/statistics.module Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/statistics.module Thu May 09 15:33:08 2019 +0100 @@ -24,9 +24,9 @@ $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Displaying popular content') . '
'; - $output .= '
' . t('The module includes a Popular content block that displays the most viewed pages today and for all time, and the last content viewed. To use the block, enable Count content views on the Statistics page, and then you can enable and configure the block on the Block layout page.', [':statistics-settings' => \Drupal::url('statistics.settings'), ':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#']) . '
'; + $output .= '
' . t('The module includes a Popular content block that displays the most viewed pages today and for all time, and the last content viewed. To use the block, enable Count content views on the Statistics page, and then you can enable and configure the block on the Block layout page.', [':statistics-settings' => Url::fromRoute('statistics.settings')->toString(), ':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? Url::fromRoute('block.admin_display')->toString() : '#']) . '
'; $output .= '
' . t('Page view counter') . '
'; - $output .= '
' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable Count content views on the Statistics page, and set the necessary permissions (View content hits) so that the counter is visible to the users.', [':statistics-settings' => \Drupal::url('statistics.settings'), ':permissions' => \Drupal::url('user.admin_permissions', [], ['fragment' => 'module-statistics'])]) . '
'; + $output .= '
' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable Count content views on the Statistics page, and set the necessary permissions (View content hits) so that the counter is visible to the users.', [':statistics-settings' => Url::fromRoute('statistics.settings')->toString(), ':permissions' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-statistics'])->toString()]) . '
'; $output .= '
'; return $output; @@ -92,10 +92,14 @@ * A query result containing the node ID, title, user ID that owns the node, * and the username for the selected node(s), or FALSE if the query could not * be executed correctly. + * + * @deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. + * Use \Drupal\statistics\NodeStatisticsDatabaseStorage::fetchAll() instead. */ function statistics_title_list($dbfield, $dbrows) { + @trigger_error('statistics_title_list() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use \Drupal\statistics\NodeStatisticsDatabaseStorage::fetchAll() instead.', E_USER_DEPRECATED); if (in_array($dbfield, ['totalcount', 'daycount', 'timestamp'])) { - $query = db_select('node_field_data', 'n'); + $query = \Drupal::database()->select('node_field_data', 'n'); $query->addTag('node_access'); $query->join('node_counter', 's', 'n.nid = s.nid'); $query->join('users_field_data', 'u', 'n.uid = u.uid'); diff -r 129ea1e6d783 -r af1871eacc83 core/modules/statistics/statistics.tokens.inc --- a/core/modules/statistics/statistics.tokens.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/statistics.tokens.inc Thu May 09 15:33:08 2019 +0100 @@ -52,7 +52,7 @@ } elseif ($name == 'last-view') { $statistics = statistics_get($node->id()); - $replacements[$original] = format_date($statistics['timestamp']); + $replacements[$original] = \Drupal::service('date.formatter')->format($statistics['timestamp']); } } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php --- a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,7 @@ namespace Drupal\Tests\statistics\Functional; +use Drupal\Core\Database\Database; use Drupal\Tests\BrowserTestBase; use Drupal\Tests\Traits\Core\CronRunTrait; @@ -115,7 +116,8 @@ $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php'; $this->client->post($stats_path, ['form_params' => $post]); - $result = db_select('node_counter', 'n') + $connection = Database::getConnection(); + $result = $connection->select('node_counter', 'n') ->fields('n', ['nid']) ->condition('n.nid', $this->testNode->id()) ->execute() @@ -124,7 +126,7 @@ $this->testNode->delete(); - $result = db_select('node_counter', 'n') + $result = $connection->select('node_counter', 'n') ->fields('n', ['nid']) ->condition('n.nid', $this->testNode->id()) ->execute() @@ -162,7 +164,7 @@ $this->drupalGet('admin/reports/pages'); $this->assertNoText('node/' . $this->testNode->id(), 'No hit URL found.'); - $result = db_select('node_counter', 'nc') + $result = Database::getConnection()->select('node_counter', 'nc') ->fields('nc', ['daycount']) ->condition('nid', $this->testNode->id(), '=') ->execute() diff -r 129ea1e6d783 -r af1871eacc83 core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php --- a/core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/tests/src/Functional/StatisticsLoggingTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,7 @@ namespace Drupal\Tests\statistics\Functional; +use Drupal\Core\Database\Database; use Drupal\Tests\BrowserTestBase; use Drupal\node\Entity\Node; @@ -82,7 +83,7 @@ ->save(); // Clear the logs. - db_truncate('node_counter'); + Database::getConnection()->truncate('node_counter'); $this->client = \Drupal::httpClient(); } @@ -99,13 +100,13 @@ // Verify that logging scripts are not found on a non-node page. $this->drupalGet('node'); $settings = $this->getDrupalSettings(); - $this->assertNoPattern($expected_library, 'Statistics library JS not found on node page.'); + $this->assertSession()->responseNotMatches($expected_library, 'Statistics library JS not found on node page.'); $this->assertFalse(isset($settings['statistics']), 'Statistics settings not found on node page.'); // Verify that logging scripts are not found on a non-existent node page. $this->drupalGet('node/9999'); $settings = $this->getDrupalSettings(); - $this->assertNoPattern($expected_library, 'Statistics library JS not found on non-existent node page.'); + $this->assertSession()->responseNotMatches($expected_library, 'Statistics library JS not found on non-existent node page.'); $this->assertFalse(isset($settings['statistics']), 'Statistics settings not found on node page.'); // Verify that logging scripts are found on a valid node page. diff -r 129ea1e6d783 -r af1871eacc83 core/modules/statistics/tests/src/Functional/StatisticsReportsTest.php --- a/core/modules/statistics/tests/src/Functional/StatisticsReportsTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/tests/src/Functional/StatisticsReportsTest.php Thu May 09 15:33:08 2019 +0100 @@ -57,7 +57,7 @@ $this->assertCacheContexts($contexts); // Check if the node link is displayed. - $this->assertRaw(\Drupal::l($node->label(), $node->urlInfo('canonical')), 'Found link to visited node.'); + $this->assertRaw(\Drupal::l($node->label(), $node->toUrl('canonical')), 'Found link to visited node.'); } } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php --- a/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php Thu May 09 15:33:08 2019 +0100 @@ -37,8 +37,10 @@ $tests = []; $tests['[node:total-count]'] = 1; $tests['[node:day-count]'] = 1; - $tests['[node:last-view]'] = format_date($statistics['timestamp']); - $tests['[node:last-view:short]'] = format_date($statistics['timestamp'], 'short'); + /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ + $date_formatter = $this->container->get('date.formatter'); + $tests['[node:last-view]'] = $date_formatter->format($statistics['timestamp']); + $tests['[node:last-view:short]'] = $date_formatter->format($statistics['timestamp'], 'short'); // Test to make sure that we generated something for each token. $this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.'); diff -r 129ea1e6d783 -r af1871eacc83 core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php --- a/core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php Thu May 09 15:33:08 2019 +0100 @@ -31,16 +31,13 @@ protected function setUp() { parent::setUp(); - $this->installEntitySchema('node'); - $this->installConfig('node'); $this->installSchema('node', ['node_access']); $this->installSchema('statistics', ['node_counter']); + $this->migrateUsers(FALSE); + $this->migrateContentTypes(); $this->executeMigrations([ 'language', - 'd7_user_role', - 'd7_user', - 'd7_node_type', 'd7_language_content_settings', 'd7_node', 'd7_node_translation', diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/config/schema/system.schema.yml --- a/core/modules/system/config/schema/system.schema.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/config/schema/system.schema.yml Thu May 09 15:33:08 2019 +0100 @@ -337,6 +337,9 @@ depth: type: integer label: 'Maximum number of levels' + expand_all_items: + type: boolean + label: 'Expand all items' block.settings.local_tasks_block: type: block_settings diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/ajax-progress.module.css --- a/core/modules/system/css/components/ajax-progress.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/ajax-progress.module.css Thu May 09 15:33:08 2019 +0100 @@ -11,9 +11,9 @@ float: right; } .ajax-progress-throbber .throbber { - background: transparent url(../../../../misc/throbber-active.gif) no-repeat 0 center; display: inline; padding: 1px 5px 2px; + background: transparent url(../../../../misc/throbber-active.gif) no-repeat 0 center; } .ajax-progress-throbber .message { display: inline; @@ -28,22 +28,22 @@ /* Full screen throbber */ .ajax-progress-fullscreen { + position: fixed; + z-index: 1000; + top: 48.5%; /* Can't do center:50% middle: 50%, so approximate it for a typical window size. */ left: 49%; /* LTR */ - position: fixed; - top: 48.5%; - z-index: 1000; + width: 24px; + height: 24px; + padding: 4px; + opacity: 0.9; + border-radius: 7px; background-color: #232323; background-image: url(../../../../misc/loading-small.gif); + background-repeat: no-repeat; background-position: center center; - background-repeat: no-repeat; - border-radius: 7px; - height: 24px; - opacity: 0.9; - padding: 4px; - width: 24px; } [dir="rtl"] .ajax-progress-fullscreen { + right: 49%; left: auto; - right: 49%; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/align.module.css --- a/core/modules/system/css/components/align.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/align.module.css Thu May 09 15:33:08 2019 +0100 @@ -27,6 +27,6 @@ } .align-center { display: block; + margin-right: auto; margin-left: auto; - margin-right: auto; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/autocomplete-loading.module.css --- a/core/modules/system/css/components/autocomplete-loading.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/autocomplete-loading.module.css Thu May 09 15:33:08 2019 +0100 @@ -7,8 +7,8 @@ .js input.form-autocomplete { background-image: url(../../../../misc/throbber-inactive.png); + background-repeat: no-repeat; background-position: 100% center; /* LTR */ - background-repeat: no-repeat; } .js[dir="rtl"] input.form-autocomplete { background-position: 0% center; diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/clearfix.module.css --- a/core/modules/system/css/components/clearfix.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/clearfix.module.css Thu May 09 15:33:08 2019 +0100 @@ -9,7 +9,7 @@ */ .clearfix:after { - content: ""; display: table; clear: both; + content: ""; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/fieldgroup.module.css --- a/core/modules/system/css/components/fieldgroup.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/fieldgroup.module.css Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,6 @@ */ .fieldgroup { + padding: 0; border-width: 0; - padding: 0; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/hidden.module.css --- a/core/modules/system/css/components/hidden.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/hidden.module.css Thu May 09 15:33:08 2019 +0100 @@ -25,10 +25,10 @@ */ .visually-hidden { position: absolute !important; + overflow: hidden; clip: rect(1px, 1px, 1px, 1px); - overflow: hidden; + width: 1px; height: 1px; - width: 1px; word-wrap: normal; } @@ -39,10 +39,10 @@ .visually-hidden.focusable:active, .visually-hidden.focusable:focus { position: static !important; + overflow: visible; clip: auto; - overflow: visible; + width: auto; height: auto; - width: auto; } /** diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/progress.module.css --- a/core/modules/system/css/components/progress.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/progress.module.css Thu May 09 15:33:08 2019 +0100 @@ -9,26 +9,26 @@ position: relative; } .progress__track { + min-width: 100px; + max-width: 100%; + height: 16px; + margin-top: 5px; + border: 1px solid; background-color: #fff; - border: 1px solid; - margin-top: 5px; - max-width: 100%; - min-width: 100px; - height: 16px; } .progress__bar { - background-color: #000; - height: 16px; width: 3%; min-width: 3%; max-width: 100%; + height: 16px; + background-color: #000; } .progress__description, .progress__percentage { + overflow: hidden; + margin-top: 0.2em; color: #555; - overflow: hidden; font-size: 0.875em; - margin-top: 0.2em; } .progress__description { float: left; /* LTR */ diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/reset-appearance.module.css --- a/core/modules/system/css/components/reset-appearance.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/reset-appearance.module.css Thu May 09 15:33:08 2019 +0100 @@ -4,12 +4,12 @@ */ .reset-appearance { + margin: 0; + padding: 0; + border: 0 none; + background: transparent; + line-height: inherit; -webkit-appearance: none; -moz-appearance: none; appearance: none; - border: 0 none; - background: transparent; - padding: 0; - margin: 0; - line-height: inherit; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/resize.module.css --- a/core/modules/system/css/components/resize.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/resize.module.css Thu May 09 15:33:08 2019 +0100 @@ -7,15 +7,15 @@ resize: none; } .resize-vertical { + min-height: 2em; resize: vertical; - min-height: 2em; } .resize-horizontal { + max-width: 100%; resize: horizontal; - max-width: 100%; } .resize-both { - resize: both; max-width: 100%; min-height: 2em; + resize: both; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/sticky-header.module.css --- a/core/modules/system/css/components/sticky-header.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/sticky-header.module.css Thu May 09 15:33:08 2019 +0100 @@ -6,8 +6,8 @@ */ table.sticky-header { - background-color: #fff; - margin-top: 0; z-index: 500; top: 0; + margin-top: 0; + background-color: #fff; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/system-status-counter.css --- a/core/modules/system/css/components/system-status-counter.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/system-status-counter.css Thu May 09 15:33:08 2019 +0100 @@ -5,18 +5,18 @@ .system-status-counter__status-icon { display: inline-block; + width: 25px; height: 25px; - width: 25px; vertical-align: middle; } .system-status-counter__status-icon:before { - content: ""; - background-size: 16px; - background-position: center 2px; - background-repeat: no-repeat; + display: block; width: 100%; height: 100%; - display: block; + content: ""; + background-repeat: no-repeat; + background-position: center 2px; + background-size: 16px; } .system-status-counter__status-icon--error:before { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/system-status-report-counters.css --- a/core/modules/system/css/components/system-status-report-counters.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/system-status-report-counters.css Thu May 09 15:33:08 2019 +0100 @@ -5,17 +5,17 @@ .system-status-report-counters__item { width: 100%; + margin-bottom: 0.5em; padding: 0.5em 0; text-align: center; white-space: nowrap; background-color: rgba(0, 0, 0, 0.063); - margin-bottom: 0.5em; } @media screen and (min-width: 60em) { .system-status-report-counters { + display: flex; flex-wrap: wrap; - display: flex; justify-content: space-between; } .system-status-report-counters__item--half-width { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/system-status-report-general-info.css --- a/core/modules/system/css/components/system-status-report-general-info.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/system-status-report-general-info.css Thu May 09 15:33:08 2019 +0100 @@ -4,9 +4,9 @@ */ .system-status-general-info__item { - border: 1px solid #ccc; margin-top: 1em; padding: 0 1em 1em; + border: 1px solid #ccc; } .system-status-general-info__item-title { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/tabledrag.module.css --- a/core/modules/system/css/components/tabledrag.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/tabledrag.module.css Thu May 09 15:33:08 2019 +0100 @@ -21,11 +21,11 @@ display: none; } .draggable a.tabledrag-handle { - cursor: move; float: left; /* LTR */ + overflow: hidden; height: 1.7em; margin-left: -1em; /* LTR */ - overflow: hidden; + cursor: move; text-decoration: none; } [dir="rtl"] .draggable a.tabledrag-handle { @@ -37,11 +37,11 @@ text-decoration: none; } a.tabledrag-handle .handle { - background: url(../../../../misc/icons/787878/move.svg) no-repeat 6px 7px; + width: 14px; height: 14px; margin: -0.4em 0.5em 0; padding: 0.42em 0.5em; - width: 14px; + background: url(../../../../misc/icons/787878/move.svg) no-repeat 6px 7px; } a.tabledrag-handle:hover .handle, a.tabledrag-handle:focus .handle { @@ -55,12 +55,12 @@ padding: 10px 0; } .touchevents a.tabledrag-handle { + width: 40px; height: 44px; - width: 40px; } .touchevents a.tabledrag-handle .handle { + height: 21px; background-position: 40% 19px; /* LTR */ - height: 21px; } [dir="rtl"] .touch a.tabledrag-handle .handle { background-position: right 40% top 19px; @@ -76,10 +76,10 @@ } .indentation { float: left; /* LTR */ + width: 20px; height: 1.7em; margin: -0.4em 0.2em -0.4em -0.4em; /* LTR */ padding: 0.42em 0 0.42em 0.6em; /* LTR */ - width: 20px; } [dir="rtl"] .indentation { float: right; diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/components/tablesort.module.css --- a/core/modules/system/css/components/tablesort.module.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/components/tablesort.module.css Thu May 09 15:33:08 2019 +0100 @@ -6,9 +6,9 @@ */ .tablesort { + display: inline-block; width: 16px; height: 16px; - display: inline-block; background-size: 100%; } .tablesort--asc { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/system.admin.css --- a/core/modules/system/css/system.admin.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/system.admin.css Thu May 09 15:33:08 2019 +0100 @@ -10,9 +10,9 @@ margin: 0 1.5em; } .layout-container:after { - content: ""; display: table; clear: both; + content: ""; } @media screen and (min-width: 38em) { @@ -67,10 +67,10 @@ * Quick inline admin links. */ small .admin-link:before { - content: ' ['; + content: " ["; } small .admin-link:after { - content: ']'; + content: "]"; } /** @@ -83,8 +83,8 @@ font-weight: bold; } .system-modules td.checkbox { + width: 4%; min-width: 25px; - width: 4%; } .system-modules td.module { width: 25%; @@ -98,45 +98,45 @@ font-size: 1.15em; } .system-modules details { + overflow: hidden; /* truncates descriptions if too long */ + white-space: nowrap; + text-overflow: ellipsis; color: #5c5c5b; line-height: 20px; - overflow: hidden; /* truncates descriptions if too long */ - text-overflow: ellipsis; - white-space: nowrap; } .system-modules details[open] { + overflow: visible; height: auto; - overflow: visible; white-space: normal; } .system-modules details[open] summary .text { + text-transform: none; -webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; hyphens: auto; - text-transform: none; } .system-modules td details a { color: #5c5c5b; border: 0; } .system-modules td details { + height: 20px; + margin: 0; border: 0; - margin: 0; - height: 20px; } .system-modules td details summary { padding: 0; + cursor: default; text-transform: none; font-weight: normal; - cursor: default; } .system-modules td { padding-left: 0; /* LTR */ } [dir="rtl"] .system-modules td { + padding-right: 0; padding-left: 12px; - padding-right: 0; } @media screen and (max-width: 40em) { @@ -148,8 +148,8 @@ } } .system-modules .requirements { + max-width: 490px; padding: 5px 0; - max-width: 490px; } .system-modules .links { overflow: hidden; /* prevents collapse */ @@ -162,8 +162,8 @@ } .admin-requirements, .admin-required { + color: #666; font-size: 0.9em; - color: #666; } .admin-enabled { color: #080; @@ -173,10 +173,10 @@ } .module-link { display: block; + float: left; /* LTR */ + margin-top: 2px; padding: 2px 20px; white-space: nowrap; - margin-top: 2px; - float: left; /* LTR */ } [dir="rtl"] .module-link { float: right; @@ -203,29 +203,29 @@ /* Status report. */ .system-status-report__status-title { position: relative; - vertical-align: top; + box-sizing: border-box; width: 100%; padding: 10px 6px 10px 40px; /* LTR */ - box-sizing: border-box; + vertical-align: top; + background-color: transparent; font-weight: normal; - background-color: transparent; } [dir="rtl"] .system-status-report__status-title { padding: 10px 40px 10px 6px; } .system-status-report__status-icon:before { + position: absolute; + top: 12px; + left: 12px; /* LTR */ + display: block; + width: 16px; + height: 16px; content: ""; background-repeat: no-repeat; - height: 16px; - width: 16px; - display: block; - position: absolute; - left: 12px; /* LTR */ - top: 12px; } [dir="rtl"] .system-status-report__status-icon:before { + right: 12px; left: auto; - right: 12px; } .system-status-report__status-icon--error:before { background-image: url(../../../misc/icons/e32700/error.svg); @@ -254,8 +254,8 @@ margin-bottom: 20px; } .system-themes-list-uninstalled { + padding-top: 20px; border-top: 1px solid #cdcdcd; - padding-top: 20px; } .system-themes-list__header { margin: 0; @@ -266,12 +266,12 @@ } .theme-selector .screenshot, .theme-selector .no-screenshot { - border: 1px solid #e0e0d8; - padding: 2px; - vertical-align: bottom; max-width: 100%; height: auto; + padding: 2px; text-align: center; + vertical-align: bottom; + border: 1px solid #e0e0d8; } .theme-default .screenshot { border: 1px solid #aaa; @@ -289,8 +289,8 @@ body:not(.toolbar-vertical) .system-themes-list-installed .screenshot, body:not(.toolbar-vertical) .system-themes-list-installed .no-screenshot { float: left; /* LTR */ + width: 294px; margin: 0 20px 0 0; /* LTR */ - width: 294px; } [dir="rtl"] body:not(.toolbar-vertical) .system-themes-list-installed .screenshot, [dir="rtl"] body:not(.toolbar-vertical) .system-themes-list-installed .no-screenshot { @@ -301,9 +301,9 @@ margin-top: 0; } body:not(.toolbar-vertical) .system-themes-list-uninstalled .theme-selector { + float: left; /* LTR */ box-sizing: border-box; width: 31.25%; - float: left; /* LTR */ padding: 20px 20px 20px 0; /* LTR */ } [dir="rtl"] body:not(.toolbar-vertical) .system-themes-list-uninstalled .theme-selector { @@ -322,8 +322,8 @@ .toolbar-vertical .system-themes-list-installed .screenshot, .toolbar-vertical .system-themes-list-installed .no-screenshot { float: left; /* LTR */ + width: 294px; margin: 0 20px 0 0; /* LTR */ - width: 294px; } [dir="rtl"] .toolbar-vertical .system-themes-list-installed .screenshot, [dir="rtl"] .toolbar-vertical .system-themes-list-installed .no-screenshot { @@ -334,9 +334,9 @@ margin-top: 0; } .toolbar-vertical .system-themes-list-uninstalled .theme-selector { + float: left; /* LTR */ box-sizing: border-box; width: 31.25%; - float: left; /* LTR */ padding: 20px 20px 20px 0; /* LTR */ } [dir="rtl"] .toolbar-vertical .system-themes-list-uninstalled .theme-selector { @@ -368,8 +368,8 @@ } [dir="rtl"] .theme-selector .operations li { float: right; + border-right: none; border-left: 1px solid #cdcdcd; - border-right: none; } .theme-selector .operations li:last-child { padding: 0 0 0 0.7em; /* LTR */ diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/system.diff.css --- a/core/modules/system/css/system.diff.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/system.diff.css Thu May 09 15:33:08 2019 +0100 @@ -2,20 +2,20 @@ * Traditional split diff theming */ table.diff { + width: 100%; + margin-bottom: 20px; border-spacing: 4px; - margin-bottom: 20px; - width: 100%; } table.diff .diff-context { background-color: #fafafa; } table.diff .diff-deletedline { + width: 50%; background-color: #ffa; - width: 50%; } table.diff .diff-addedline { + width: 50%; background-color: #afa; - width: 50%; } table.diff .diffchange { color: #f00; diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/css/system.maintenance.css --- a/core/modules/system/css/system.maintenance.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/css/system.maintenance.css Thu May 09 15:33:08 2019 +0100 @@ -44,8 +44,8 @@ margin: 2.6em 0.5em 0 1em; /* LTR */ } [dir="rtl"] #edit-connection-settings-change-connection-type { + margin-right: 1em; margin-left: 0.5em; - margin-right: 1em; } /** diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/DateFormatListBuilder.php --- a/core/modules/system/src/DateFormatListBuilder.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/DateFormatListBuilder.php Thu May 09 15:33:08 2019 +0100 @@ -45,7 +45,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), + $container->get('entity_type.manager')->getStorage($entity_type->id()), $container->get('date.formatter') ); } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Element/StatusReportPage.php --- a/core/modules/system/src/Element/StatusReportPage.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Element/StatusReportPage.php Thu May 09 15:33:08 2019 +0100 @@ -86,8 +86,8 @@ ], 'checked' => [ 'amount' => 0, - 'text' => t('Checked'), - 'text_plural' => t('Checked'), + 'text' => t('Checked', [], ['context' => 'Examined']), + 'text_plural' => t('Checked', [], ['context' => 'Examined']), ], ]; diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Entity/Action.php --- a/core/modules/system/src/Entity/Action.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Entity/Action.php Thu May 09 15:33:08 2019 +0100 @@ -2,12 +2,12 @@ namespace Drupal\system\Entity; +use Drupal\Component\Plugin\PluginHelper; use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Entity\EntityWithPluginCollectionInterface; use Drupal\system\ActionConfigEntityInterface; use Drupal\Core\Action\ActionPluginCollection; -use Drupal\Component\Plugin\ConfigurablePluginInterface; /** * Defines the configured action entity. @@ -133,7 +133,7 @@ * {@inheritdoc} */ public function isConfigurable() { - return $this->getPlugin() instanceof ConfigurablePluginInterface; + return PluginHelper::isConfigurable($this->getPlugin()); } /** diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/EventSubscriber/ConfigCacheTag.php --- a/core/modules/system/src/EventSubscriber/ConfigCacheTag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/EventSubscriber/ConfigCacheTag.php Thu May 09 15:33:08 2019 +0100 @@ -47,24 +47,25 @@ * The Event to process. */ public function onSave(ConfigCrudEvent $event) { + $config_name = $event->getConfig()->getName(); // Changing the site settings may mean a different route is selected for the // front page. Additionally a change to the site name or similar must // invalidate the render cache since this could be used anywhere. - if ($event->getConfig()->getName() === 'system.site') { + if ($config_name === 'system.site') { $this->cacheTagsInvalidator->invalidateTags(['route_match', 'rendered']); } // Theme configuration and global theme settings. - if (in_array($event->getConfig()->getName(), ['system.theme', 'system.theme.global'], TRUE)) { + if (in_array($config_name, ['system.theme', 'system.theme.global'], TRUE)) { $this->cacheTagsInvalidator->invalidateTags(['rendered']); } // Theme-specific settings, check if this matches a theme settings - // configuration object, in that case, clear the rendered cache tag. - foreach (array_keys($this->themeHandler->listInfo()) as $theme_name) { - if ($theme_name == $event->getConfig()->getName()) { + // configuration object (THEME_NAME.settings), in that case, clear the + // rendered cache tag. + if (preg_match('/^([^\.]*)\.settings$/', $config_name, $matches)) { + if ($this->themeHandler->themeExists($matches[1])) { $this->cacheTagsInvalidator->invalidateTags(['rendered']); - break; } } } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Form/DateFormatFormBase.php --- a/core/modules/system/src/Form/DateFormatFormBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Form/DateFormatFormBase.php Thu May 09 15:33:08 2019 +0100 @@ -154,7 +154,7 @@ else { $this->messenger()->addStatus($this->t('Custom date format added.')); } - $form_state->setRedirectUrl($this->entity->urlInfo('collection')); + $form_state->setRedirectUrl($this->entity->toUrl('collection')); } } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Form/FileSystemForm.php --- a/core/modules/system/src/Form/FileSystemForm.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Form/FileSystemForm.php Thu May 09 15:33:08 2019 +0100 @@ -53,7 +53,7 @@ * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static ( + return new static( $container->get('config.factory'), $container->get('date.formatter'), $container->get('stream_wrapper_manager') diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Form/ModulesListForm.php --- a/core/modules/system/src/Form/ModulesListForm.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Form/ModulesListForm.php Thu May 09 15:33:08 2019 +0100 @@ -307,7 +307,8 @@ } // If this module requires other modules, add them to the array. - foreach ($module->requires as $dependency => $version) { + /** @var \Drupal\Core\Extension\Dependency $dependency_object */ + foreach ($module->requires as $dependency => $dependency_object) { if (!isset($modules[$dependency])) { $row['#requires'][$dependency] = $this->t('@module (missing)', ['@module' => Unicode::ucfirst($dependency)]); $row['enable']['#disabled'] = TRUE; @@ -317,9 +318,10 @@ $name = $modules[$dependency]->info['name']; // Disable the module's checkbox if it is incompatible with the // dependency's version. - if ($incompatible_version = drupal_check_incompatibility($version, str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $modules[$dependency]->info['version']))) { - $row['#requires'][$dependency] = $this->t('@module (incompatible with version @version)', [ - '@module' => $name . $incompatible_version, + if (!$dependency_object->isCompatible(str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $modules[$dependency]->info['version']))) { + $row['#requires'][$dependency] = $this->t('@module (@constraint) (incompatible with version @version)', [ + '@module' => $name, + '@constraint' => $dependency_object->getConstraintString(), '@version' => $modules[$dependency]->info['version'], ]); $row['enable']['#disabled'] = TRUE; diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Form/ModulesUninstallConfirmForm.php --- a/core/modules/system/src/Form/ModulesUninstallConfirmForm.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Form/ModulesUninstallConfirmForm.php Thu May 09 15:33:08 2019 +0100 @@ -4,7 +4,8 @@ use Drupal\Core\Config\ConfigManagerInterface; use Drupal\Core\Config\Entity\ConfigDependencyDeleteFormTrait; -use Drupal\Core\Entity\EntityManagerInterface; +use Drupal\Core\DependencyInjection\DeprecatedServicePropertyTrait; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleInstallerInterface; use Drupal\Core\Form\ConfirmFormBase; use Drupal\Core\Form\FormStateInterface; @@ -19,6 +20,14 @@ */ class ModulesUninstallConfirmForm extends ConfirmFormBase { use ConfigDependencyDeleteFormTrait; + use DeprecatedServicePropertyTrait; + + /** + * {@inheritdoc} + */ + protected $deprecatedProperties = [ + 'entityManager' => 'entity.manager', + ]; /** * The module installer service. @@ -42,11 +51,11 @@ protected $configManager; /** - * The entity manager. + * The entity type manager. * - * @var \Drupal\Core\Entity\EntityManagerInterface + * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ - protected $entityManager; + protected $entityTypeManager; /** * An array of modules to uninstall. @@ -64,14 +73,14 @@ * The key value expirable factory. * @param \Drupal\Core\Config\ConfigManagerInterface $config_manager * The configuration manager. - * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager - * The entity manager. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * The entity type manager. */ - public function __construct(ModuleInstallerInterface $module_installer, KeyValueStoreExpirableInterface $key_value_expirable, ConfigManagerInterface $config_manager, EntityManagerInterface $entity_manager) { + public function __construct(ModuleInstallerInterface $module_installer, KeyValueStoreExpirableInterface $key_value_expirable, ConfigManagerInterface $config_manager, EntityTypeManagerInterface $entity_type_manager) { $this->moduleInstaller = $module_installer; $this->keyValueExpirable = $key_value_expirable; $this->configManager = $config_manager; - $this->entityManager = $entity_manager; + $this->entityTypeManager = $entity_type_manager; } /** @@ -82,7 +91,7 @@ $container->get('module_installer'), $container->get('keyvalue.expirable')->get('modules_uninstall'), $container->get('config.manager'), - $container->get('entity.manager') + $container->get('entity_type.manager') ); } @@ -145,7 +154,7 @@ ]; // List the dependent entities. - $this->addDependencyListsToForm($form, 'module', $this->modules, $this->configManager, $this->entityManager); + $this->addDependencyListsToForm($form, 'module', $this->modules, $this->configManager, $this->entityTypeManager); return parent::buildForm($form, $form_state); } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Form/ThemeSettingsForm.php --- a/core/modules/system/src/Form/ThemeSettingsForm.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Form/ThemeSettingsForm.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,8 @@ namespace Drupal\system\Form; use Drupal\Core\Extension\ThemeHandlerInterface; +use Drupal\Core\File\Exception\FileException; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; use Drupal\Core\StreamWrapper\PublicStream; @@ -57,6 +59,13 @@ protected $themeManager; /** + * The file system. + * + * @var \Drupal\Core\File\FileSystemInterface + */ + protected $fileSystem; + + /** * Constructs a ThemeSettingsForm object. * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory @@ -67,14 +76,23 @@ * The theme handler. * @param \Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface $mime_type_guesser * The MIME type guesser instance to use. + * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager + * The theme manager. + * @param \Drupal\Core\File\FileSystemInterface $file_system + * The file system. */ - public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, MimeTypeGuesserInterface $mime_type_guesser, ThemeManagerInterface $theme_manager) { + public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, MimeTypeGuesserInterface $mime_type_guesser, ThemeManagerInterface $theme_manager, FileSystemInterface $file_system = NULL) { parent::__construct($config_factory); $this->moduleHandler = $module_handler; $this->themeHandler = $theme_handler; $this->mimeTypeGuesser = $mime_type_guesser; $this->themeManager = $theme_manager; + if (!$file_system) { + @trigger_error('The file_system service must be passed to ThemeSettingsForm::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/3006851.', E_USER_DEPRECATED); + $file_system = \Drupal::service('file_system'); + } + $this->fileSystem = $file_system; } /** @@ -86,7 +104,8 @@ $container->get('module_handler'), $container->get('theme_handler'), $container->get('file.mime_type.guesser'), - $container->get('theme.manager') + $container->get('theme.manager'), + $container->get('file_system') ); } @@ -442,16 +461,26 @@ // If the user uploaded a new logo or favicon, save it to a permanent location // and use it in place of the default theme-provided file. - if (!empty($values['logo_upload'])) { - $filename = file_unmanaged_copy($values['logo_upload']->getFileUri()); - $values['default_logo'] = 0; - $values['logo_path'] = $filename; + try { + if (!empty($values['logo_upload'])) { + $filename = $this->fileSystem->copy($values['logo_upload']->getFileUri(), file_default_scheme() . '://'); + $values['default_logo'] = 0; + $values['logo_path'] = $filename; + } } - if (!empty($values['favicon_upload'])) { - $filename = file_unmanaged_copy($values['favicon_upload']->getFileUri()); - $values['default_favicon'] = 0; - $values['favicon_path'] = $filename; - $values['toggle_favicon'] = 1; + catch (FileException $e) { + // Ignore. + } + try { + if (!empty($values['favicon_upload'])) { + $filename = $this->fileSystem->copy($values['favicon_upload']->getFileUri(), file_default_scheme() . '://'); + $values['default_favicon'] = 0; + $values['favicon_path'] = $filename; + $values['toggle_favicon'] = 1; + } + } + catch (FileException $e) { + // Ignore. } unset($values['logo_upload']); unset($values['favicon_upload']); @@ -488,7 +517,7 @@ */ protected function validatePath($path) { // Absolute local file paths are invalid. - if (\Drupal::service('file_system')->realpath($path) == $path) { + if ($this->fileSystem->realpath($path) == $path) { return FALSE; } // A path relative to the Drupal root or a fully qualified URI is valid. diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Plugin/Block/SystemMenuBlock.php --- a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php Thu May 09 15:33:08 2019 +0100 @@ -5,7 +5,9 @@ use Drupal\Core\Block\BlockBase; use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Menu\MenuActiveTrailInterface; use Drupal\Core\Menu\MenuLinkTreeInterface; +use Drupal\Core\Menu\MenuTreeParameters; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -32,6 +34,13 @@ protected $menuTree; /** + * The active menu trail service. + * + * @var \Drupal\Core\Menu\MenuActiveTrailInterface + */ + protected $menuActiveTrail; + + /** * Constructs a new SystemMenuBlock. * * @param array $configuration @@ -42,10 +51,17 @@ * The plugin implementation definition. * @param \Drupal\Core\Menu\MenuLinkTreeInterface $menu_tree * The menu tree service. + * @param \Drupal\Core\Menu\MenuActiveTrailInterface $menu_active_trail + * The active menu trail service. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkTreeInterface $menu_tree) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkTreeInterface $menu_tree, MenuActiveTrailInterface $menu_active_trail = NULL) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->menuTree = $menu_tree; + if ($menu_active_trail === NULL) { + @trigger_error('The menu.active_trail service must be passed to SystemMenuBlock::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/2669550.', E_USER_DEPRECATED); + $menu_active_trail = \Drupal::service('menu.active_trail'); + } + $this->menuActiveTrail = $menu_active_trail; } /** @@ -56,7 +72,8 @@ $configuration, $plugin_id, $plugin_definition, - $container->get('menu.link_tree') + $container->get('menu.link_tree'), + $container->get('menu.active_trail') ); } @@ -98,6 +115,13 @@ '#required' => TRUE, ]; + $form['menu_levels']['expand_all_items'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Expand all menu items'), + '#default_value' => !empty($config['expand_all_items']), + '#description' => $this->t('Override the option found on each menu link used for expanding children and instead display the whole menu tree as expanded.'), + ]; + return $form; } @@ -117,6 +141,7 @@ public function blockSubmit($form, FormStateInterface $form_state) { $this->configuration['level'] = $form_state->getValue('level'); $this->configuration['depth'] = $form_state->getValue('depth'); + $this->configuration['expand_all_items'] = $form_state->getValue('expand_all_items'); } /** @@ -124,7 +149,14 @@ */ public function build() { $menu_name = $this->getDerivativeId(); - $parameters = $this->menuTree->getCurrentRouteMenuTreeParameters($menu_name); + if ($this->configuration['expand_all_items']) { + $parameters = new MenuTreeParameters(); + $active_trail = $this->menuActiveTrail->getActiveTrailIds($menu_name); + $parameters->setActiveTrail($active_trail); + } + else { + $parameters = $this->menuTree->getCurrentRouteMenuTreeParameters($menu_name); + } // Adjust the menu tree parameters based on the block's configuration. $level = $this->configuration['level']; @@ -173,6 +205,7 @@ return [ 'level' => 1, 'depth' => 0, + 'expand_all_items' => FALSE, ]; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Plugin/Block/SystemMessagesBlock.php --- a/core/modules/system/src/Plugin/Block/SystemMessagesBlock.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Plugin/Block/SystemMessagesBlock.php Thu May 09 15:33:08 2019 +0100 @@ -31,7 +31,10 @@ * {@inheritdoc} */ public function build() { - return ['#type' => 'status_messages']; + return [ + '#type' => 'status_messages', + '#include_fallback' => TRUE, + ]; } /** diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php --- a/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,8 @@ use Drupal\Component\Utility\Color; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\File\Exception\FileException; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\ImageToolkit\ImageToolkitBase; use Drupal\Core\ImageToolkit\ImageToolkitOperationManagerInterface; @@ -59,6 +61,13 @@ protected $streamWrapperManager; /** + * The file system. + * + * @var \Drupal\Core\File\FileSystemInterface + */ + protected $fileSystem; + + /** * Constructs a GDToolkit object. * * @param array $configuration @@ -75,10 +84,17 @@ * The config factory. * @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager * The StreamWrapper manager. + * @param \Drupal\Core\File\FileSystemInterface $file_system + * The file system. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, ImageToolkitOperationManagerInterface $operation_manager, LoggerInterface $logger, ConfigFactoryInterface $config_factory, StreamWrapperManagerInterface $stream_wrapper_manager) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, ImageToolkitOperationManagerInterface $operation_manager, LoggerInterface $logger, ConfigFactoryInterface $config_factory, StreamWrapperManagerInterface $stream_wrapper_manager, FileSystemInterface $file_system = NULL) { parent::__construct($configuration, $plugin_id, $plugin_definition, $operation_manager, $logger, $config_factory); $this->streamWrapperManager = $stream_wrapper_manager; + if (!$file_system) { + @trigger_error('The file_system service must be passed to GDToolkit::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/3006851.', E_USER_DEPRECATED); + $file_system = \Drupal::service('file_system'); + } + $this->fileSystem = $file_system; } /** @@ -103,7 +119,8 @@ $container->get('image.toolkit.operation.manager'), $container->get('logger.channel.image'), $container->get('config.factory'), - $container->get('stream_wrapper_manager') + $container->get('stream_wrapper_manager'), + $container->get('file_system') ); } @@ -220,10 +237,10 @@ $local_wrappers = $this->streamWrapperManager->getWrappers(StreamWrapperInterface::LOCAL); if (!isset($local_wrappers[$scheme])) { $permanent_destination = $destination; - $destination = drupal_tempnam('temporary://', 'gd_'); + $destination = $this->fileSystem->tempnam('temporary://', 'gd_'); } // Convert stream wrapper URI to normal path. - $destination = \Drupal::service('file_system')->realpath($destination); + $destination = $this->fileSystem->realpath($destination); } $function = 'image' . image_type_to_extension($this->getType(), FALSE); @@ -243,7 +260,13 @@ } // Move temporary local file to remote destination. if (isset($permanent_destination) && $success) { - return (bool) file_unmanaged_move($destination, $permanent_destination, FILE_EXISTS_REPLACE); + try { + $this->fileSystem->move($destination, $permanent_destination, FileSystemInterface::EXISTS_REPLACE); + return TRUE; + } + catch (FileException $e) { + return FALSE; + } } return $success; } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Tests/Cache/CacheTestBase.php --- a/core/modules/system/src/Tests/Cache/CacheTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Tests/Cache/CacheTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,8 @@ namespace Drupal\system\Tests\Cache; +@trigger_error(__NAMESPACE__ . '\CacheTestBase is deprecated for removal before Drupal 9.0.0. Use \Drupal\Tests\system\Functional\Cache\CacheTestBase instead. See https://www.drupal.org/node/2999939', E_USER_DEPRECATED); + use Drupal\simpletest\WebTestBase; /** @@ -9,6 +11,8 @@ * * @deprecated Scheduled for removal in Drupal 9.0.0. * Use \Drupal\Tests\system\Functional\Cache\CacheTestBase instead. + * + * @see https://www.drupal.org/node/2999939 */ abstract class CacheTestBase extends WebTestBase { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php --- a/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,8 @@ namespace Drupal\system\Tests\Cache; +@trigger_error(__NAMESPACE__ . '\GenericCacheBackendUnitTestBase is deprecated for removal before Drupal 9.0.0. Use \Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase instead.', E_USER_DEPRECATED); + use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\simpletest\KernelTestBase; diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php --- a/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,8 @@ namespace Drupal\system\Tests\Cache; +@trigger_error(__NAMESPACE__ . '\PageCacheTagsTestBase is deprecated for removal before Drupal 9.0.0. Use \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase instead. See https://www.drupal.org/node/2999939', E_USER_DEPRECATED); + use Drupal\Core\Url; use Drupal\simpletest\WebTestBase; use Drupal\Component\Render\FormattableMarkup; @@ -11,6 +13,8 @@ * * @deprecated Scheduled for removal in Drupal 9.0.0. * Use \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase instead. + * + * @see https://www.drupal.org/node/2999939 */ abstract class PageCacheTagsTestBase extends WebTestBase { diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php --- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -331,8 +331,8 @@ */ public function testReferencedEntity() { $entity_type = $this->entity->getEntityTypeId(); - $referencing_entity_url = $this->referencingEntity->urlInfo('canonical'); - $non_referencing_entity_url = $this->nonReferencingEntity->urlInfo('canonical'); + $referencing_entity_url = $this->referencingEntity->toUrl('canonical'); + $non_referencing_entity_url = $this->nonReferencingEntity->toUrl('canonical'); $listing_url = Url::fromRoute('entity.entity_test.collection_referencing_entities', [ 'entity_reference_field_name' => $entity_type . '_reference', 'referenced_entity_type' => $entity_type, diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php --- a/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -27,7 +27,7 @@ * - ":" */ public function testEntityUri() { - $entity_url = $this->entity->urlInfo(); + $entity_url = $this->entity->toUrl(); $entity_type = $this->entity->getEntityTypeId(); // Selects the view mode that will be used. diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Tests/JsMessageTestCases.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/src/Tests/JsMessageTestCases.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,32 @@ +prefixTables('{' . $base_table . '}') . '%'); + $connection = Database::getConnection(); + $tables = $connection->schema()->findTables($connection->prefixTables('{' . $base_table . '}') . '%'); if ($count) { return $this->assertTrue($tables, format_string('Tables matching "@base_table" found.', ['@base_table' => $base_table])); @@ -186,7 +191,7 @@ * A link to associate with the message. */ public function assertLogMessage($type, $message, $variables = [], $severity = RfcLogLevel::NOTICE, $link = '') { - $count = db_select('watchdog', 'w') + $count = Database::getConnection()->select('watchdog', 'w') ->condition('type', $type) ->condition('message', $message) ->condition('variables', serialize($variables)) diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Tests/Session/SessionHttpsTest.php --- a/core/modules/system/src/Tests/Session/SessionHttpsTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -isSecure()) { - $this->secureSessionName = $this->getSessionName(); - $this->insecureSessionName = substr($this->getSessionName(), 1); - } - else { - $this->secureSessionName = 'S' . $this->getSessionName(); - $this->insecureSessionName = $this->getSessionName(); - } - } - - public function testHttpsSession() { - $user = $this->drupalCreateUser(['access administration pages']); - - // Test HTTPS session handling by altering the form action to submit the - // login form through https.php, which creates a mock HTTPS request. - $this->loginHttps($user); - - // Test a second concurrent session. - $this->curlClose(); - $this->curlCookies = []; - $this->loginHttps($user); - - // Check secure cookie on secure page. - $this->assertTrue($this->cookies[$this->secureSessionName]['secure'], 'The secure cookie has the secure attribute'); - // Check insecure cookie is not set. - $this->assertFalse(isset($this->cookies[$this->insecureSessionName])); - $ssid = $this->cookies[$this->secureSessionName]['value']; - $this->assertSessionIds($ssid, 'Session has a non-empty SID and a correct secure SID.'); - - // Verify that user is logged in on secure URL. - $this->drupalGet($this->httpsUrl('admin/config')); - $this->assertText(t('Configuration')); - $this->assertResponse(200); - - // Verify that user is not logged in on non-secure URL. - $this->drupalGet($this->httpUrl('admin/config')); - $this->assertNoText(t('Configuration')); - $this->assertResponse(403); - - // Verify that empty SID cannot be used on the non-secure site. - $this->curlClose(); - $this->curlCookies = [$this->insecureSessionName . '=']; - $this->drupalGet($this->httpUrl('admin/config')); - $this->assertResponse(403); - - // Test HTTP session handling by altering the form action to submit the - // login form through http.php, which creates a mock HTTP request on HTTPS - // test environments. - $this->curlClose(); - $this->curlCookies = []; - $this->loginHttp($user); - $this->drupalGet($this->httpUrl('admin/config')); - $this->assertResponse(200); - $sid = $this->cookies[$this->insecureSessionName]['value']; - $this->assertSessionIds($sid, '', 'Session has the correct SID and an empty secure SID.'); - - // Verify that empty secure SID cannot be used on the secure site. - $this->curlClose(); - $this->curlCookies = [$this->secureSessionName . '=']; - $this->drupalGet($this->httpsUrl('admin/config')); - $this->assertResponse(403); - - // Clear browser cookie jar. - $this->cookies = []; - } - - /** - * Log in a user via HTTP. - * - * Note that the parents $session_id and $loggedInUser is not updated. - */ - protected function loginHttp(AccountInterface $account) { - $this->drupalGet('user/login'); - - // Alter the form action to submit the login form through http.php, which - // creates a mock HTTP request on HTTPS test environments. - $form = $this->xpath('//form[@id="user-login-form"]'); - $form[0]['action'] = $this->httpUrl('user/login'); - $edit = ['name' => $account->getUsername(), 'pass' => $account->pass_raw]; - - // When posting directly to the HTTP or HTTPS mock front controller, the - // location header on the returned response is an absolute URL. That URL - // needs to be converted into a request to the respective mock front - // controller in order to retrieve the target page. Because the URL in the - // location header needs to be modified, it is necessary to disable the - // automatic redirects normally performed by parent::curlExec(). - $maximum_redirects = $this->maximumRedirects; - $this->maximumRedirects = 0; - $this->drupalPostForm(NULL, $edit, t('Log in')); - $this->maximumRedirects = $maximum_redirects; - - // Follow the location header. - $path = $this->getPathFromLocationHeader(FALSE); - $this->drupalGet($this->httpUrl($path)); - $this->assertResponse(200); - } - - /** - * Log in a user via HTTPS. - * - * Note that the parents $session_id and $loggedInUser is not updated. - */ - protected function loginHttps(AccountInterface $account) { - $this->drupalGet('user/login'); - - // Alter the form action to submit the login form through https.php, which - // creates a mock HTTPS request on HTTP test environments. - $form = $this->xpath('//form[@id="user-login-form"]'); - $form[0]['action'] = $this->httpsUrl('user/login'); - $edit = ['name' => $account->getUsername(), 'pass' => $account->pass_raw]; - - // When posting directly to the HTTP or HTTPS mock front controller, the - // location header on the returned response is an absolute URL. That URL - // needs to be converted into a request to the respective mock front - // controller in order to retrieve the target page. Because the URL in the - // location header needs to be modified, it is necessary to disable the - // automatic redirects normally performed by parent::curlExec(). - $maximum_redirects = $this->maximumRedirects; - $this->maximumRedirects = 0; - $this->drupalPostForm(NULL, $edit, t('Log in')); - $this->maximumRedirects = $maximum_redirects; - - // When logging in via the HTTPS mock, the child site will issue a session - // cookie with the secure attribute set. While this cookie will be stored in - // the curl handle, it will not be used on subsequent requests via the HTTPS - // mock, unless when operating in a true HTTPS environment. Therefore it is - // necessary to manually collect the session cookie and add it to the - // curlCookies property such that it will be used on subsequent requests via - // the HTTPS mock. - $this->curlCookies = [$this->secureSessionName . '=' . $this->cookies[$this->secureSessionName]['value']]; - - // Follow the location header. - $path = $this->getPathFromLocationHeader(TRUE); - $this->drupalGet($this->httpsUrl($path)); - $this->assertResponse(200); - } - - /** - * Extract internal path from the location header on the response. - */ - protected function getPathFromLocationHeader($https = FALSE, $response_code = 303) { - // Generate the base_url. - $base_url = $this->container->get('url_generator')->generateFromRoute('', [], ['absolute' => TRUE]); - if ($https) { - $base_url = str_replace('http://', 'https://', $base_url); - } - else { - $base_url = str_replace('https://', 'http://', $base_url); - } - - // The mock front controllers (http.php and https.php) add the script name - // to $_SERVER['REQUEST_URI'] and friends. Therefore it is necessary to - // strip that also. - $base_url .= 'index.php/'; - - // Extract relative path from location header. - $this->assertResponse($response_code); - $location = $this->drupalGetHeader('location'); - - $this->assertIdentical(strpos($location, $base_url), 0, 'Location header contains expected base URL'); - return substr($location, strlen($base_url)); - } - - /** - * Test that there exists a session with two specific session IDs. - * - * @param $sid - * The insecure session ID to search for. - * @param $assertion_text - * The text to display when we perform the assertion. - * - * @return - * The result of assertTrue() that there's a session in the system that - * has the given insecure and secure session IDs. - */ - protected function assertSessionIds($sid, $assertion_text) { - $args = [ - ':sid' => Crypt::hashBase64($sid), - ]; - return $this->assertTrue(db_query('SELECT timestamp FROM {sessions} WHERE sid = :sid', $args)->fetchField(), $assertion_text); - } - - /** - * Builds a URL for submitting a mock HTTPS request to HTTP test environments. - * - * @param $url - * A Drupal path such as 'user/login'. - * - * @return - * URL prepared for the https.php mock front controller. - */ - protected function httpsUrl($url) { - return 'core/modules/system/tests/https.php/' . $url; - } - - /** - * Builds a URL for submitting a mock HTTP request to HTTPS test environments. - * - * @param $url - * A Drupal path such as 'user/login'. - * - * @return - * URL prepared for the http.php mock front controller. - */ - protected function httpUrl($url) { - return 'core/modules/system/tests/http.php/' . $url; - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/src/Tests/Update/UpdatePathTestBase.php --- a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -345,7 +345,7 @@ $account = User::load(1); $account->setPassword($this->rootUser->pass_raw); $account->setEmail($this->rootUser->getEmail()); - $account->setUsername($this->rootUser->getUsername()); + $account->setUsername($this->rootUser->getAccountName()); $account->save(); } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/system.install --- a/core/modules/system/system.install Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/system.install Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ use Drupal\Component\Utility\OpCodeCache; use Drupal\Component\Utility\Unicode; use Drupal\Core\Cache\Cache; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Path\AliasStorage; use Drupal\Core\Url; use Drupal\Core\Database\Database; @@ -23,7 +24,6 @@ use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\PrivateStream; use Drupal\Core\StreamWrapper\PublicStream; -use Drupal\system\SystemRequirements; use Symfony\Component\HttpFoundation\Request; /** @@ -145,7 +145,7 @@ 'title' => t('Apache version'), 'value' => $apache_version_string, 'severity' => REQUIREMENT_ERROR, - 'description' => t('The minimum version of Apache needed to run Drupal without mod_rewrite enabled is 2.2.16. See the enabling clean URLs page for more information on mod_rewrite.', [':link' => 'http://drupal.org/node/15365']), + 'description' => t('The minimum version of Apache needed to run Drupal without mod_rewrite enabled is 2.2.16. See the enabling clean URLs page for more information on mod_rewrite.', [':link' => 'http://drupal.org/docs/8/clean-urls-in-drupal-8']), ]; } @@ -154,7 +154,7 @@ 'title' => t('Clean URLs'), 'value' => t('Disabled'), 'severity' => REQUIREMENT_WARNING, - 'description' => t('Your server is capable of using clean URLs, but it is not enabled. Using clean URLs gives an improved user experience and is recommended. Enable clean URLs', [':link' => 'http://drupal.org/node/15365']), + 'description' => t('Your server is capable of using clean URLs, but it is not enabled. Using clean URLs gives an improved user experience and is recommended. Enable clean URLs', [':link' => 'http://drupal.org/docs/8/clean-urls-in-drupal-8']), ]; } } @@ -185,36 +185,43 @@ ]; } - if (version_compare($phpversion, DRUPAL_MINIMUM_PHP) < 0) { - $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', ['%version' => DRUPAL_MINIMUM_PHP]); + // Check if the PHP version is below what Drupal supports. + if (version_compare($phpversion, DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) { + $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version. It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support. See PHP\'s version support documentation and the Drupal 8 PHP requirements handbook page for more information.', + [ + '%version' => DRUPAL_MINIMUM_SUPPORTED_PHP, + '%recommended' => DRUPAL_RECOMMENDED_PHP, + ':php_requirements' => 'https://www.drupal.org/docs/8/system-requirements/php', + ] + ); $requirements['php']['severity'] = REQUIREMENT_ERROR; - // If PHP is old, it's not safe to continue with the requirements check. - return $requirements; - } - if ((version_compare($phpversion, DRUPAL_RECOMMENDED_PHP) < 0) && ($phase === 'install' || $phase === 'runtime')) { - // Warn if still on PHP 5. If at least PHP 7.0, relax from "warning" to - // "info", and show it at runtime only, to not scare users while installing. - if (version_compare($phpversion, '7.0') < 0) { - $requirements['php']['description'] = t('Drupal will drop support for this version on March 6, 2019. Upgrade to PHP version %recommended or higher to ensure your site can receive updates and remain secure. See PHP\'s version support documentation and the Drupal 8 PHP requirements handbook page for more information.', ['%recommended' => DRUPAL_RECOMMENDED_PHP, ':php_requirements' => 'https://www.drupal.org/docs/8/system-requirements/php']); + + // If the PHP version is also below the absolute minimum allowed, it's not + // safe to continue with the requirements check. + if (version_compare($phpversion, DRUPAL_MINIMUM_PHP) < 0) { + return $requirements; + } + // Otherwise downgrade the error to a warning during updates. Even if there + // are some problems with the site's PHP version, it's still better for the + // site to keep its Drupal codebase up to date. + elseif ($phase === 'update') { $requirements['php']['severity'] = REQUIREMENT_WARNING; } - else { - if ($phase === 'runtime') { - $requirements['php']['description'] = t('It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support. See PHP\'s version support documentation and the Drupal 8 PHP requirements handbook page for more information.', ['%recommended' => DRUPAL_RECOMMENDED_PHP, ':php_requirements' => 'https://www.drupal.org/docs/8/system-requirements/php']); - $requirements['php']['severity'] = REQUIREMENT_INFO; - } + // Since we allow sites with unsupported PHP versions to still run Drupal + // updates, we also need to be able to run tests with those PHP versions, + // which requires the ability to install test sites. Not all tests are + // required to pass on these PHP versions, but we want to monitor which + // ones do and don't. + elseif ($phase === 'install' && drupal_valid_test_ua()) { + $requirements['php']['severity'] = REQUIREMENT_INFO; } } - - // Suggest to update to at least 5.5.21 or 5.6.5 for disabling multiple - // statements. - if (($phase === 'install' || \Drupal::database()->driver() === 'mysql') && !SystemRequirements::phpVersionWithPdoDisallowMultipleStatements($phpversion)) { - $requirements['php_multiple_statement'] = [ - 'title' => t('PHP (multiple statement disabling)'), - 'value' => $phpversion_label, - 'description' => t('PHP versions higher than 5.6.5 or 5.5.21 provide built-in SQL injection protection for mysql databases. It is recommended to update.'), - 'severity' => REQUIREMENT_INFO, - ]; + // For PHP versions that are still supported but no longer recommended, + // inform users of what's recommended, allowing them to take action before it + // becomes urgent. + elseif ($phase === 'runtime' && version_compare($phpversion, DRUPAL_RECOMMENDED_PHP) < 0) { + $requirements['php']['description'] = t('It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support. See PHP\'s version support documentation and the Drupal 8 PHP requirements handbook page for more information.', ['%recommended' => DRUPAL_RECOMMENDED_PHP, ':php_requirements' => 'https://www.drupal.org/docs/8/system-requirements/php']); + $requirements['php']['severity'] = REQUIREMENT_INFO; } // Test for PHP extensions. @@ -309,7 +316,7 @@ } } $args = [ - ':drupal-php' => 'https://www.drupal.org/docs/7/system-requirements/php#csprng', + ':drupal-php' => 'https://www.drupal.org/docs/8/system-requirements/php-requirements', '%exception_message' => $e->getMessage(), ]; if ($open_basedir_blocks_urandom) { @@ -628,7 +635,7 @@ $directory = config_get_config_directory($type); // If we're installing Drupal try and create the config sync directory. if (!is_dir($directory) && $phase == 'install') { - file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); + \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS); } if (!is_dir($directory)) { if ($phase == 'install') { @@ -665,7 +672,7 @@ continue; } if ($phase == 'install') { - file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); + \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS); } $is_writable = is_writable($directory); $is_directory = is_dir($directory); @@ -680,7 +687,7 @@ } // The files directory requirement check is done only during install and runtime. if ($phase == 'runtime') { - $description = t('You may need to set the correct directory at the file system settings page or change the current directory\'s permissions so that it is writable.', [':admin-file-system' => \Drupal::url('system.file_system_settings')]); + $description = t('You may need to set the correct directory at the file system settings page or change the current directory\'s permissions so that it is writable.', [':admin-file-system' => Url::fromRoute('system.file_system_settings')->toString()]); } elseif ($phase == 'install') { // For the installer UI, we need different wording. 'value' will @@ -744,7 +751,7 @@ if ($has_pending_updates) { $requirements['update']['severity'] = REQUIREMENT_ERROR; $requirements['update']['value'] = t('Out of date'); - $requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the database update script immediately.', [':update' => \Drupal::url('system.db_update')]); + $requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the database update script immediately.', [':update' => Url::fromRoute('system.db_update')->toString()]); } $requirements['entity_update'] = [ @@ -804,8 +811,9 @@ $requirements['php']['severity'] = REQUIREMENT_ERROR; } // Check the module's required modules. + /** @var \Drupal\Core\Extension\Dependency $requirement */ foreach ($file->requires as $requirement) { - $required_module = $requirement['name']; + $required_module = $requirement->getName(); // Check if the module exists. if (!isset($files[$required_module])) { $requirements["$module-$required_module"] = [ @@ -820,13 +828,11 @@ $required_file = $files[$required_module]; $required_name = $required_file->info['name']; $version = str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $required_file->info['version']); - $compatibility = drupal_check_incompatibility($requirement, $version); - if ($compatibility) { - $compatibility = rtrim(substr($compatibility, 2), ')'); + if (!$requirement->isCompatible($version)) { $requirements["$module-$required_module"] = [ 'title' => t('Unresolved dependency'), 'description' => t('@name requires this module and version. Currently using @required_name version @version', ['@name' => $name, '@required_name' => $required_name, '@version' => $version]), - 'value' => t('@required_name (Version @compatibility required)', ['@required_name' => $required_name, '@compatibility' => $compatibility]), + 'value' => t('@required_name (Version @compatibility required)', ['@required_name' => $required_name, '@compatibility' => $requirement->getConstraintString()]), 'severity' => REQUIREMENT_ERROR, ]; continue; @@ -884,7 +890,7 @@ 'severity' => REQUIREMENT_WARNING, 'description' => t('Update notifications are not enabled. It is highly recommended that you enable the Update Manager module from the module administration page in order to stay up-to-date on new releases. For more information, Update status handbook page.', [ ':update' => 'https://www.drupal.org/documentation/modules/update', - ':module' => \Drupal::url('system.modules_list'), + ':module' => Url::fromRoute('system.modules_list')->toString(), ]), ]; } @@ -913,7 +919,7 @@ $requirements['trusted_host_patterns'] = [ 'title' => t('Trusted Host Settings'), 'value' => t('Not enabled'), - 'description' => t('The trusted_host_patterns setting is not configured in settings.php. This can lead to security vulnerabilities. It is highly recommended that you configure this. See Protecting against HTTP HOST Header attacks for more information.', [':url' => 'https://www.drupal.org/node/1992030']), + 'description' => t('The trusted_host_patterns setting is not configured in settings.php. This can lead to security vulnerabilities. It is highly recommended that you configure this. See Protecting against HTTP HOST Header attacks for more information.', [':url' => 'https://www.drupal.org/docs/8/install/trusted-host-settings']), 'severity' => REQUIREMENT_ERROR, ]; } @@ -1831,7 +1837,8 @@ $theme_handler->refreshInfo(); foreach ($theme_handler->listInfo() as $theme) { // We first check that a base theme is set because if it's set to false then - // it's unset in \Drupal\Core\Extension\ThemeHandler::rebuildThemeData(). + // it's unset in + // \Drupal\Core\Extension\ThemeExtensionList::createExtensionInfo(). if (isset($theme->info['base theme']) && $theme->info['base theme'] == 'stable') { $theme_handler->install(['stable']); return; @@ -2238,3 +2245,43 @@ return t('The %install_profile install profile has been added to the installed module list.', ['%install_profile' => $install_profile]); } + +/** + * Remove the unused 'system.theme.data' from state. + */ +function system_update_8701() { + // The system.theme.data key is no longer used in Drupal 8.7.x. + \Drupal::state()->delete('system.theme.data'); +} + +/** + * Add the 'revision_translation_affected' entity key. + */ +function system_update_8702() { + $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); + + // Get a list of revisionable and translatable entity types. + /** @var \Drupal\Core\Entity\EntityTypeInterface[] $last_installed_definitions */ + $last_installed_definitions = array_filter($entity_definition_update_manager->getEntityTypes(), function (EntityTypeInterface $entity_type) { + return $entity_type->isRevisionable() && $entity_type->isTranslatable(); + }); + + // Ensure that we don't use the cached in-code definitions to support sites + // that might be updating from 8.3.x straight to 8.7.x. + \Drupal::entityTypeManager()->useCaches(FALSE); + $live_definitions = \Drupal::entityTypeManager()->getDefinitions(); + + // Update the 'revision_translation_affected' entity key of the last installed + // definitions to use the value of the live (in-code) entity type definitions + // in cases when the key has not been populated yet. + foreach ($last_installed_definitions as $entity_type_id => $entity_type) { + $revision_translation_affected_key = $live_definitions[$entity_type_id]->getKey('revision_translation_affected'); + if (!$entity_type->hasKey('revision_translation_affected') && !empty($revision_translation_affected_key) && $entity_definition_update_manager->getFieldStorageDefinition($revision_translation_affected_key, $entity_type_id)) { + $entity_keys = $entity_type->getKeys(); + $entity_keys['revision_translation_affected'] = $revision_translation_affected_key; + $entity_type->set('entity_keys', $entity_keys); + $entity_definition_update_manager->updateEntityType($entity_type); + } + } + \Drupal::entityTypeManager()->useCaches(TRUE); +} diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/system.module --- a/core/modules/system/system.module Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/system.module Thu May 09 15:33:08 2019 +0100 @@ -5,23 +5,24 @@ * Configuration system that lets administrators modify the workings of the site. */ +use Drupal\Component\Gettext\PoItem; +use Drupal\Core\Extension\Dependency; use Drupal\Component\Render\PlainTextOutput; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Asset\AttachedAssetsInterface; use Drupal\Core\Cache\Cache; -use Drupal\Core\Extension\Exception\UnknownExtensionException; +use Drupal\Core\File\Exception\FileException; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Queue\QueueGarbageCollectionInterface; use Drupal\Core\Database\Query\AlterableInterface; use Drupal\Core\Extension\Extension; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory; use Drupal\Core\PageCache\RequestPolicyInterface; -use Drupal\Core\PhpStorage\PhpStorageFactory; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\StackedRouteMatchInterface; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Menu\MenuTreeParameters; -use Drupal\Core\Extension\ModuleHandler; use Drupal\Core\Url; use Drupal\Core\Block\BlockPluginInterface; use Drupal\user\UserInterface; @@ -107,25 +108,25 @@ $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Managing modules') . '
'; - $output .= '
' . t('Users with appropriate permission can install and uninstall modules from the Extend page. Depending on which distribution or installation profile you choose when you install your site, several modules are installed and others are provided but not installed. Each module provides a discrete set of features; modules may be installed or uninstalled depending on the needs of the site. Many additional modules contributed by members of the Drupal community are available for download from the Drupal.org module page. Note that uninstalling a module is a destructive action: when you uninstall a module, you will permanently lose all data connected to the module.', [':modules' => \Drupal::url('system.modules_list'), ':drupal-modules' => 'https://www.drupal.org/project/modules']) . '
'; + $output .= '
' . t('Users with appropriate permission can install and uninstall modules from the Extend page. Depending on which distribution or installation profile you choose when you install your site, several modules are installed and others are provided but not installed. Each module provides a discrete set of features; modules may be installed or uninstalled depending on the needs of the site. Many additional modules contributed by members of the Drupal community are available for download from the Drupal.org module page. Note that uninstalling a module is a destructive action: when you uninstall a module, you will permanently lose all data connected to the module.', [':modules' => Url::fromRoute('system.modules_list')->toString(), ':drupal-modules' => 'https://www.drupal.org/project/modules']) . '
'; $output .= '
' . t('Managing themes') . '
'; - $output .= '
' . t('Users with appropriate permission can install and uninstall themes on the Appearance page. Themes determine the design and presentation of your site. Depending on which distribution or installation profile you choose when you install your site, a default theme is installed, and possibly a different theme for administration pages. Other themes are provided but not installed, and additional contributed themes are available at the Drupal.org theme page.', [':themes' => \Drupal::url('system.themes_page'), ':drupal-themes' => 'https://www.drupal.org/project/themes']) . '
'; + $output .= '
' . t('Users with appropriate permission can install and uninstall themes on the Appearance page. Themes determine the design and presentation of your site. Depending on which distribution or installation profile you choose when you install your site, a default theme is installed, and possibly a different theme for administration pages. Other themes are provided but not installed, and additional contributed themes are available at the Drupal.org theme page.', [':themes' => Url::fromRoute('system.themes_page')->toString(), ':drupal-themes' => 'https://www.drupal.org/project/themes']) . '
'; $output .= '
' . t('Disabling drag-and-drop functionality') . '
'; $output .= '
' . t('The default drag-and-drop user interface for ordering tables in the administrative interface presents a challenge for some users, including users of screen readers and other assistive technology. The drag-and-drop interface can be disabled in a table by clicking a link labeled "Show row weights" above the table. The replacement interface allows users to order the table by choosing numerical weights instead of dragging table rows.') . '
'; $output .= '
' . t('Configuring basic site settings') . '
'; - $output .= '
' . t('The System module provides pages for managing basic site configuration, including Date and time formats and Basic site settings (site name, email address to send mail from, home page, and error pages). Additional configuration pages are listed on the main Configuration page.', [':date-time-settings' => \Drupal::url('entity.date_format.collection'), ':site-info' => \Drupal::url('system.site_information_settings'), ':config' => \Drupal::url('system.admin_config')]) . '
'; + $output .= '
' . t('The System module provides pages for managing basic site configuration, including Date and time formats and Basic site settings (site name, email address to send mail from, home page, and error pages). Additional configuration pages are listed on the main Configuration page.', [':date-time-settings' => Url::fromRoute('entity.date_format.collection')->toString(), ':site-info' => Url::fromRoute('system.site_information_settings')->toString(), ':config' => Url::fromRoute('system.admin_config')->toString()]) . '
'; $output .= '
' . t('Checking site status') . '
'; - $output .= '
' . t('The Status report provides an overview of the configuration, status, and health of your site. Review this report to make sure there are not any problems to address, and to find information about the software your site and web server are using.', [':status' => \Drupal::url('system.status')]) . '
'; + $output .= '
' . t('The Status report provides an overview of the configuration, status, and health of your site. Review this report to make sure there are not any problems to address, and to find information about the software your site and web server are using.', [':status' => Url::fromRoute('system.status')->toString()]) . '
'; $output .= '
' . t('Using maintenance mode') . '
'; - $output .= '
' . t('When you are performing site maintenance, you can prevent non-administrative users (including anonymous visitors) from viewing your site by putting it in Maintenance mode. This will prevent unauthorized users from making changes to the site while you are performing maintenance, or from seeing a broken site while updates are in progress.', [':maintenance-mode' => \Drupal::url('system.site_maintenance_mode')]) . '
'; + $output .= '
' . t('When you are performing site maintenance, you can prevent non-administrative users (including anonymous visitors) from viewing your site by putting it in Maintenance mode. This will prevent unauthorized users from making changes to the site while you are performing maintenance, or from seeing a broken site while updates are in progress.', [':maintenance-mode' => Url::fromRoute('system.site_maintenance_mode')->toString()]) . '
'; $output .= '
' . t('Configuring for performance') . '
'; - $output .= '
' . t('On the Performance page, the site can be configured to aggregate CSS and JavaScript files, making the total request size smaller. Note that, for small- to medium-sized websites, the Internal Page Cache module should be installed so that pages are efficiently cached and reused for anonymous users. Finally, for websites of all sizes, the Dynamic Page Cache module should also be installed so that the non-personalized parts of pages are efficiently cached (for all users).', [':performance-page' => \Drupal::url('system.performance_settings'), ':page-cache' => (\Drupal::moduleHandler()->moduleExists('page_cache')) ? \Drupal::url('help.page', ['name' => 'page_cache']) : '#', ':dynamic-page-cache' => (\Drupal::moduleHandler()->moduleExists('dynamic_page_cache')) ? \Drupal::url('help.page', ['name' => 'dynamic_page_cache']) : '#']) . '
'; + $output .= '
' . t('On the Performance page, the site can be configured to aggregate CSS and JavaScript files, making the total request size smaller. Note that, for small- to medium-sized websites, the Internal Page Cache module should be installed so that pages are efficiently cached and reused for anonymous users. Finally, for websites of all sizes, the Dynamic Page Cache module should also be installed so that the non-personalized parts of pages are efficiently cached (for all users).', [':performance-page' => Url::fromRoute('system.performance_settings')->toString(), ':page-cache' => (\Drupal::moduleHandler()->moduleExists('page_cache')) ? Url::fromRoute('help.page', ['name' => 'page_cache'])->toString() : '#', ':dynamic-page-cache' => (\Drupal::moduleHandler()->moduleExists('dynamic_page_cache')) ? Url::fromRoute('help.page', ['name' => 'dynamic_page_cache'])->toString() : '#']) . '
'; $output .= '
' . t('Configuring cron') . '
'; - $output .= '
' . t('In order for the site and its modules to continue to operate well, a set of routine administrative operations must run on a regular basis; these operations are known as cron tasks. On the Cron page, you can configure cron to run periodically as part of server responses by installing the Automated Cron module, or you can turn this off and trigger cron from an outside process on your web server. You can verify the status of cron tasks by visiting the Status report page. For more information, see the online documentation for configuring cron jobs.', [':status' => \Drupal::url('system.status'), ':handbook' => 'https://www.drupal.org/cron', ':cron' => \Drupal::url('system.cron_settings')]) . '
'; + $output .= '
' . t('In order for the site and its modules to continue to operate well, a set of routine administrative operations must run on a regular basis; these operations are known as cron tasks. On the Cron page, you can configure cron to run periodically as part of server responses by installing the Automated Cron module, or you can turn this off and trigger cron from an outside process on your web server. You can verify the status of cron tasks by visiting the Status report page. For more information, see the online documentation for configuring cron jobs.', [':status' => Url::fromRoute('system.status')->toString(), ':handbook' => 'https://www.drupal.org/cron', ':cron' => Url::fromRoute('system.cron_settings')->toString()]) . '
'; $output .= '
' . t('Configuring the file system') . '
'; - $output .= '
' . t('Your site has several file directories, which are used to store and process uploaded and generated files. The public file directory, which is configured in your settings.php file, is the default place for storing uploaded files. Links to files in this directory contain the direct file URL, so when the files are requested, the web server will send them directly without invoking your site code. This means that the files can be downloaded by anyone with the file URL, so requests are not access-controlled but they are efficient. The private file directory, also configured in your settings.php file and ideally located outside the site web root, is access controlled. Links to files in this directory are not direct, so requests to these files are mediated by your site code. This means that your site can check file access permission for each file before deciding to fulfill the request, so the requests are more secure, but less efficient. You should only use the private storage for files that need access control, not for files like your site logo and background images used on every page. The temporary file directory is used internally by your site code for various operations, and is configured on the File system settings page. You can also see the configured public and private file directories on this page, and choose whether public or private should be the default for uploaded files.', [':file-system' => \Drupal::url('system.file_system_settings')]) . '
'; + $output .= '
' . t('Your site has several file directories, which are used to store and process uploaded and generated files. The public file directory, which is configured in your settings.php file, is the default place for storing uploaded files. Links to files in this directory contain the direct file URL, so when the files are requested, the web server will send them directly without invoking your site code. This means that the files can be downloaded by anyone with the file URL, so requests are not access-controlled but they are efficient. The private file directory, also configured in your settings.php file and ideally located outside the site web root, is access controlled. Links to files in this directory are not direct, so requests to these files are mediated by your site code. This means that your site can check file access permission for each file before deciding to fulfill the request, so the requests are more secure, but less efficient. You should only use the private storage for files that need access control, not for files like your site logo and background images used on every page. The temporary file directory is used internally by your site code for various operations, and is configured on the File system settings page. You can also see the configured public and private file directories on this page, and choose whether public or private should be the default for uploaded files.', [':file-system' => Url::fromRoute('system.file_system_settings')->toString()]) . '
'; $output .= '
' . t('Configuring the image toolkit') . '
'; - $output .= '
' . t('On the Image toolkit page, you can select and configure the PHP toolkit used to manipulate images. Depending on which distribution or installation profile you choose when you install your site, the GD2 toolkit and possibly others are included; other toolkits may be provided by contributed modules.', [':toolkit' => \Drupal::url('system.image_toolkit_settings')]) . '
'; + $output .= '
' . t('On the Image toolkit page, you can select and configure the PHP toolkit used to manipulate images. Depending on which distribution or installation profile you choose when you install your site, the GD2 toolkit and possibly others are included; other toolkits may be provided by contributed modules.', [':toolkit' => Url::fromRoute('system.image_toolkit_settings')->toString()]) . '
'; $output .= '
'; return $output; @@ -135,7 +136,7 @@ case 'system.themes_page': $output = '

' . t('Set and configure the default theme for your website. Alternative themes are available.', [':themes' => 'https://www.drupal.org/project/themes']) . '

'; if (\Drupal::moduleHandler()->moduleExists('block')) { - $output .= '

' . t('You can place blocks for each theme on the block layout page.', [':blocks' => \Drupal::url('block.admin_display')]) . '

'; + $output .= '

' . t('You can place blocks for each theme on the block layout page.', [':blocks' => Url::fromRoute('block.admin_display')->toString()]) . '

'; } return $output; @@ -150,7 +151,7 @@ case 'system.modules_list': $output = '

' . t('Download additional contributed modules to extend your site\'s functionality.', [':modules' => 'https://www.drupal.org/project/modules']) . '

'; if (!\Drupal::moduleHandler()->moduleExists('update')) { - $output .= '

' . t('Regularly review available updates to maintain a secure and current site. Always run the update script each time a module is updated. Enable the Update Manager module to update and install modules and themes.', [':update-php' => \Drupal::url('system.db_update'), ':update-manager' => \Drupal::url('system.modules_list', [], ['fragment' => 'module-update'])]) . '

'; + $output .= '

' . t('Regularly review available updates to maintain a secure and current site. Always run the update script each time a module is updated. Enable the Update Manager module to update and install modules and themes.', [':update-php' => Url::fromRoute('system.db_update')->toString(), ':update-manager' => Url::fromRoute('system.modules_list', [], ['fragment' => 'module-update'])->toString()]) . '

'; } return $output; @@ -748,7 +749,7 @@ } } if (!isset($settings['pluralDelimiter'])) { - $settings['pluralDelimiter'] = LOCALE_PLURAL_DELIMITER; + $settings['pluralDelimiter'] = PoItem::DELIMITER; } // Add the theme token to ajaxPageState, ensuring the database is available // before doing so. Also add the loaded libraries to ajaxPageState. @@ -837,10 +838,10 @@ if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) { \Drupal::messenger() ->addStatus(t('Configure your account time zone setting.', [ - ':user-edit' => $account->url('edit-form', [ + ':user-edit' => $account->toUrl('edit-form', [ 'query' => \Drupal::destination()->getAsArray(), 'fragment' => 'edit-timezone', - ]), + ])->toString(), ])); } } @@ -918,13 +919,15 @@ } $logger = \Drupal::logger('file system'); - if (!is_dir($directory) && !drupal_mkdir($directory, NULL, TRUE)) { + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + if (!is_dir($directory) && !$file_system->mkdir($directory, NULL, TRUE)) { // If the directory does not exist and cannot be created. $form_state->setErrorByName($form_element['#parents'][0], t('The directory %directory does not exist and could not be created.', ['%directory' => $directory])); $logger->error('The directory %directory does not exist and could not be created.', ['%directory' => $directory]); } - if (is_dir($directory) && !is_writable($directory) && !drupal_chmod($directory)) { + if (is_dir($directory) && !is_writable($directory) && !$file_system->chmod($directory)) { // If the directory is not writable and cannot be made so. $form_state->setErrorByName($form_element['#parents'][0], t('The directory %directory exists but is not writable and could not be made writable.', ['%directory' => $directory])); $logger->error('The directory %directory exists but is not writable and could not be made writable.', ['%directory' => $directory]); @@ -963,38 +966,20 @@ * array is returned. * * @see system_rebuild_module_data() - * @see \Drupal\Core\Extension\ThemeHandlerInterface::rebuildThemeData() + * @see \Drupal\Core\Extension\ThemeExtensionList */ function system_get_info($type, $name = NULL) { - if ($type == 'module') { - /** @var \Drupal\Core\Extension\ModuleExtensionList $module_list */ - $module_list = \Drupal::service('extension.list.module'); - if (isset($name)) { - try { - return $module_list->getExtensionInfo($name); - } - catch (UnknownExtensionException $e) { - return []; - } + /** @var \Drupal\Core\Extension\ExtensionList $extension_list */ + $extension_list = \Drupal::service('extension.list.' . $type); + if (isset($name)) { + try { + return $extension_list->getExtensionInfo($name); } - else { - return $module_list->getAllInstalledInfo(); + catch (\InvalidArgumentException $e) { + return []; } } - else { - // @todo move into ThemeExtensionList https://www.drupal.org/node/2659940 - $info = []; - $list = system_list($type); - foreach ($list as $shortname => $item) { - if (!empty($item->status)) { - $info[$shortname] = $item->info; - } - } - if (isset($name)) { - return isset($info[$name]) ? $info[$name] : []; - } - return $info; - } + return $extension_list->getAllInstalledInfo(); } /** @@ -1014,7 +999,7 @@ @trigger_error("_system_rebuild_module_data_ensure_required() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. This function is no longer used in Drupal core. See https://www.drupal.org/node/2709919", E_USER_DEPRECATED); if (!empty($module->info['required'])) { foreach ($module->info['dependencies'] as $dependency) { - $dependency_name = ModuleHandler::parseDependency($dependency)['name']; + $dependency_name = Dependency::createFromString($dependency)->getName(); if (!isset($modules[$dependency_name]->info['required'])) { $modules[$dependency_name]->info['required'] = TRUE; $modules[$dependency_name]->info['explanation'] = t('Dependency of required module @module', ['@module' => $module->info['name']]); @@ -1254,10 +1239,6 @@ $queue->garbageCollection(); } } - - // Clean up PHP storage. - PhpStorageFactory::get('container')->garbageCollection(); - PhpStorageFactory::get('service_container')->garbageCollection(); } /** @@ -1353,15 +1334,17 @@ * object which describes the file. * - If it fails, FALSE. */ -function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FILE_EXISTS_RENAME) { +function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FileSystemInterface::EXISTS_RENAME) { $parsed_url = parse_url($url); + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); if (!isset($destination)) { - $path = file_build_uri(drupal_basename($parsed_url['path'])); + $path = file_build_uri(\Drupal::service('file_system')->basename($parsed_url['path'])); } else { - if (is_dir(\Drupal::service('file_system')->realpath($destination))) { + if (is_dir($file_system->realpath($destination))) { // Prevent URIs with triple slashes when glueing parts together. - $path = str_replace('///', '//', "$destination/") . drupal_basename($parsed_url['path']); + $path = str_replace('///', '//', "$destination/") . \Drupal::service('file_system')->basename($parsed_url['path']); } else { $path = $destination; @@ -1371,12 +1354,16 @@ $data = (string) \Drupal::httpClient() ->get($url) ->getBody(); - $local = $managed ? file_save_data($data, $path, $replace) : file_unmanaged_save_data($data, $path, $replace); + $local = $managed ? file_save_data($data, $path, $replace) : $file_system->saveData($data, $path, $replace); } catch (RequestException $exception) { \Drupal::messenger()->addError(t('Failed to fetch file due to error "%error"', ['%error' => $exception->getMessage()])); return FALSE; } + catch (FileException $e) { + \Drupal::messenger()->addError(t('Failed to save file due to error "%error"', ['%error' => $e->getMessage()])); + return FALSE; + } if (!$local) { \Drupal::messenger()->addError(t('@remote could not be saved to @path.', ['@remote' => $url, '@path' => $path])); } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/system.post_update.php --- a/core/modules/system/system.post_update.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/system.post_update.php Thu May 09 15:33:08 2019 +0100 @@ -91,6 +91,13 @@ } /** + * Clear the library cache and ensure aggregate files are regenerated. + */ +function system_post_update_fix_jquery_extend() { + // Empty post-update hook. +} + +/** * Change plugin IDs of actions. */ function system_post_update_change_action_plugins() { @@ -178,3 +185,24 @@ function system_post_update_states_clear_cache() { // Empty post-update hook. } + +/** + * Initialize 'expand_all_items' values to system_menu_block. + */ +function system_post_update_add_expand_all_items_key_in_system_menu_block(&$sandbox = NULL) { + if (!\Drupal::moduleHandler()->moduleExists('block')) { + return; + } + \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'block', function ($block) { + return strpos($block->getPluginId(), 'system_menu_block:') === 0; + }); +} + +/** + * Clear the menu cache. + * + * @see https://www.drupal.org/project/drupal/issues/3044364 + */ +function system_post_update_clear_menu_cache() { + // Empty post-update hook. +} diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/system.tokens.inc --- a/core/modules/system/system.tokens.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/system.tokens.inc Thu May 09 15:33:08 2019 +0100 @@ -7,6 +7,7 @@ * This file handles tokens for the global 'site' and 'date' tokens. */ +use Drupal\Core\Url; use Drupal\Core\Datetime\Entity\DateFormat; use Drupal\Core\Render\BubbleableMetadata; @@ -49,18 +50,21 @@ 'description' => t("The URL of the site's login page."), ]; + /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ + $date_formatter = \Drupal::service('date.formatter'); + // Date related tokens. $date['short'] = [ 'name' => t("Short format"), - 'description' => t("A date in 'short' format. (%date)", ['%date' => format_date(REQUEST_TIME, 'short')]), + 'description' => t("A date in 'short' format. (%date)", ['%date' => $date_formatter->format(REQUEST_TIME, 'short')]), ]; $date['medium'] = [ 'name' => t("Medium format"), - 'description' => t("A date in 'medium' format. (%date)", ['%date' => format_date(REQUEST_TIME, 'medium')]), + 'description' => t("A date in 'medium' format. (%date)", ['%date' => $date_formatter->format(REQUEST_TIME, 'medium')]), ]; $date['long'] = [ 'name' => t("Long format"), - 'description' => t("A date in 'long' format. (%date)", ['%date' => format_date(REQUEST_TIME, 'long')]), + 'description' => t("A date in 'long' format. (%date)", ['%date' => $date_formatter->format(REQUEST_TIME, 'long')]), ]; $date['custom'] = [ 'name' => t("Custom format"), @@ -68,7 +72,7 @@ ]; $date['since'] = [ 'name' => t("Time-since"), - 'description' => t("A date in 'time-since' format. (%date)", ['%date' => \Drupal::service('date.formatter')->formatTimeDiffSince(REQUEST_TIME - 360)]), + 'description' => t("A date in 'time-since' format. (%date)", ['%date' => $date_formatter->formatTimeDiffSince(REQUEST_TIME - 360)]), ]; $date['raw'] = [ 'name' => t("Raw timestamp"), @@ -129,21 +133,21 @@ case 'url': /** @var \Drupal\Core\GeneratedUrl $result */ - $result = \Drupal::url('', [], $url_options, TRUE); + $result = Url::fromRoute('', [], $url_options)->toString(TRUE); $bubbleable_metadata->addCacheableDependency($result); $replacements[$original] = $result->getGeneratedUrl(); break; case 'url-brief': /** @var \Drupal\Core\GeneratedUrl $result */ - $result = \Drupal::url('', [], $url_options, TRUE); + $result = Url::fromRoute('', [], $url_options)->toString(TRUE); $bubbleable_metadata->addCacheableDependency($result); $replacements[$original] = preg_replace(['!^https?://!', '!/$!'], '', $result->getGeneratedUrl()); break; case 'login-url': /** @var \Drupal\Core\GeneratedUrl $result */ - $result = \Drupal::url('user.page', [], $url_options, TRUE); + $result = Url::fromRoute('user.page', [], $url_options)->toString(TRUE); $bubbleable_metadata->addCacheableDependency($result); $replacements[$original] = $result->getGeneratedUrl(); break; @@ -169,7 +173,7 @@ case 'long': $date_format = DateFormat::load($name); $bubbleable_metadata->addCacheableDependency($date_format); - $replacements[$original] = format_date($date, $name, '', NULL, $langcode); + $replacements[$original] = \Drupal::service('date.formatter')->format($date, $name, '', NULL, $langcode); break; case 'since': @@ -185,7 +189,7 @@ if ($created_tokens = $token_service->findWithPrefix($tokens, 'custom')) { foreach ($created_tokens as $name => $original) { - $replacements[$original] = format_date($date, 'custom', $name, NULL, $langcode); + $replacements[$original] = \Drupal::service('date.formatter')->format($date, 'custom', $name, NULL, $langcode); } } } diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/templates/field-multiple-value-form.html.twig --- a/core/modules/system/templates/field-multiple-value-form.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/templates/field-multiple-value-form.html.twig Thu May 09 15:33:08 2019 +0100 @@ -22,7 +22,13 @@ */ #} {% if multiple %} -
+ {% + set classes = [ + 'js-form-item', + 'form-item' + ] + %} + {{ table }} {% if description.content %} {{ description.content }}
diff -r 129ea1e6d783 -r af1871eacc83 core/modules/system/templates/pager.html.twig --- a/core/modules/system/templates/pager.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/system/templates/pager.html.twig Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,7 @@ * Default theme implementation to display a pager. * * Available variables: + * - heading_id: Pagination heading ID. * - items: List of pager items. * The list is keyed by the following elements: * - first: Item for the first page; not present on the first page of results. @@ -32,8 +33,8 @@ */ #} {% if items %} -
diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/demo_umami/themes/umami/templates/content/node--recipe--full.html.twig --- a/core/profiles/demo_umami/themes/umami/templates/content/node--recipe--full.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -{# -/** - * @file - * Theme override to display a node. - * - * Available variables: - * - node: The node entity with limited access to object properties and methods. - * Only method names starting with "get", "has", or "is" and a few common - * methods such as "id", "label", and "bundle" are available. For example: - * - node.getCreatedTime() will return the node creation timestamp. - * - node.hasField('field_example') returns TRUE if the node bundle includes - * field_example. (This does not indicate the presence of a value in this - * field.) - * - node.isPublished() will return whether the node is published or not. - * Calling other methods, such as node.delete(), will result in an exception. - * See \Drupal\node\Entity\Node for a full list of public properties and - * methods for the node object. - * - label: The title of the node. - * - content: All node items. Use {{ content }} to print them all, - * or print a subset such as {{ content.field_example }}. Use - * {{ content|without('field_example') }} to temporarily suppress the printing - * of a given child element. - * - author_picture: The node author user entity, rendered using the "compact" - * view mode. - * - metadata: Metadata for this node. - * - date: Themed creation date field. - * - author_name: Themed author name field. - * - url: Direct URL of the current node. - * - display_submitted: Whether submission information should be displayed. - * - attributes: HTML attributes for the containing element. - * The attributes.class element may contain one or more of the following - * classes: - * - node: The current template type (also known as a "theming hook"). - * - node--type-[type]: The current node type. For example, if the node is an - * "Article" it would result in "node--type-article". Note that the machine - * name will often be in a short form of the human readable label. - * - node--view-mode-[view_mode]: The View Mode of the node; for example, a - * teaser would result in: "node--view-mode-teaser", and - * full: "node--view-mode-full". - * The following are controlled through the node publishing options. - * - node--promoted: Appears on nodes promoted to the front page. - * - node--sticky: Appears on nodes ordered above other non-sticky nodes in - * teaser listings. - * - node--unpublished: Appears on unpublished nodes visible only to site - * admins. - * - title_attributes: Same as attributes, except applied to the main title - * tag that appears in the template. - * - content_attributes: Same as attributes, except applied to the main - * content tag that appears in the template. - * - author_attributes: Same as attributes, except applied to the author of - * the node tag that appears in the template. - * - title_prefix: Additional output populated by modules, intended to be - * displayed in front of the main title tag that appears in the template. - * - title_suffix: Additional output populated by modules, intended to be - * displayed after the main title tag that appears in the template. - * - view_mode: View mode; for example, "teaser" or "full". - * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. - * - page: Flag for the full page state. Will be true if view_mode is 'full'. - * - readmore: Flag for more state. Will be true if the teaser content of the - * node cannot hold the main body content. - * - logged_in: Flag for authenticated user status. Will be true when the - * current user is a logged-in member. - * - is_admin: Flag for admin user status. Will be true when the current user - * is an administrator. - * - * @see template_preprocess_node() - */ -#} -{% -set classes = [ -'node', -'node--type-' ~ node.bundle|clean_class, -node.isPromoted() ? 'node--promoted', -node.isSticky() ? 'node--sticky', -not node.isPublished() ? 'node--unpublished', -view_mode ? 'node--view-mode-' ~ view_mode|clean_class, -] -%} -{% set created_date = node.getCreatedTime|format_date('umami_dates') %} -{{ attach_library('classy/node') }} - - - {{ title_prefix }} -
-

- {{ label }} -

-
- {{ title_suffix }} - - {% if display_submitted %} -
- - {% trans %}by {{ author_name }} {{ created_date }}{% endtrans %} - {{ metadata }} -
- - {% endif %} - - - {{ content }} -
- - diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/demo_umami/themes/umami/templates/content/node.html.twig --- a/core/profiles/demo_umami/themes/umami/templates/content/node.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/demo_umami/themes/umami/templates/content/node.html.twig Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,7 @@ * Calling other methods, such as node.delete(), will result in an exception. * See \Drupal\node\Entity\Node for a full list of public properties and * methods for the node object. - * - label: The title of the node. + * - label: (optional) The title of the node. * - content: All node items. Use {{ content }} to print them all, * or print a subset such as {{ content.field_example }}. Use * {{ content|without('field_example') }} to temporarily suppress the printing @@ -23,8 +23,8 @@ * - author_picture: The node author user entity, rendered using the "compact" * view mode. * - metadata: Metadata for this node. - * - date: Themed creation date field. - * - author_name: Themed author name field. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. * - display_submitted: Whether submission information should be displayed. * - attributes: HTML attributes for the containing element. @@ -82,16 +82,18 @@ {{ title_prefix }} - {% if page %} -
-

- {{ label }} -

-
- {% else %} - - {{ label }} - + {% if label %} + {% if page %} +
+

+ {{ label }} +

+
+ {% else %} + + {{ label }} + + {% endif %} {% endif %} {{ title_suffix }} diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/demo_umami/themes/umami/templates/layout/page.html.twig --- a/core/profiles/demo_umami/themes/umami/templates/layout/page.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/demo_umami/themes/umami/templates/layout/page.html.twig Thu May 09 15:33:08 2019 +0100 @@ -58,11 +58,13 @@ {% endif %} - -
- {{ page.highlighted }} -
- + {% if page.highlighted %} +
+
+ {{ page.highlighted }} +
+
+ {% endif %} {% if page.tabs %}
diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/demo_umami/themes/umami/umami.info.yml --- a/core/profiles/demo_umami/themes/umami/umami.info.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/demo_umami/themes/umami/umami.info.yml Thu May 09 15:33:08 2019 +0100 @@ -7,11 +7,16 @@ libraries: - umami/global - umami/messages - - umami/webfonts + - umami/webfonts-open-sans + - umami/webfonts-scope-one libraries-override: classy/messages: false +libraries-extend: + tour/tour-styling: + - umami/demo-umami-tour + regions: pre_header: Pre-header header: Header diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/demo_umami/themes/umami/umami.libraries.yml --- a/core/profiles/demo_umami/themes/umami/umami.libraries.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/demo_umami/themes/umami/umami.libraries.yml Thu May 09 15:33:08 2019 +0100 @@ -7,8 +7,10 @@ css/components/blocks/banner/banner.css: {} css/components/blocks/branding/branding.css: {} css/components/blocks/disclaimer/disclaimer.css: {} + css/components/blocks/help/help.css: {} css/components/blocks/page-title/page-title.css: {} css/components/blocks/footer-promo/footer-promo.css: {} + css/components/blocks/language-switcher/language-switcher.css: {} css/components/blocks/search/search.css: {} css/components/blocks/search/search-results.css: {} css/components/blocks/articles-aside/articles-aside.css: {} @@ -33,7 +35,10 @@ css/components/regions/bottom/bottom.css: {} css/components/regions/footer/footer.css: {} css/components/regions/header/header.css: {} + css/components/regions/highlighted/highlighted.css: {} css/components/regions/pre-header/pre-header.css: {} + css/components/toolbar/toolbar.css: {} + css/components/layout_builder/layout-builder.css: {} layout: css/layout/grid-2.css: {} css/layout/grid-3.css: {} @@ -41,6 +46,8 @@ css/layout/layout.css: {} js: js/components/navigation/menu-main/menu-main.js: {} + dependencies: + - umami/demo-umami-tour messages: css: @@ -67,11 +74,25 @@ layout: css/layout/layout-2-col.css: {} - -webfonts: +webfonts-open-sans: + remote: https://fonts.google.com + license: + name: Apache License, Version 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0 + gpl-compatible: false css: theme: - 'https://fonts.googleapis.com/css?family=Open+Sans|Scope+One': { type: external, minified: true } + 'https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i': { type: external, minified: true } + +webfonts-scope-one: + remote: https://fonts.google.com + license: + name: SIL Open Font License, Version 1.1 + url: http://scripts.sil.org/OFL_web + gpl-compatible: false + css: + theme: + 'https://fonts.googleapis.com/css?family=Scope+One': { type: external, minified: true } view-mode-card: css: @@ -95,3 +116,10 @@ css/components/content/card-common-alt/card-common-alt.css: {} dependencies: - umami/more-link + +demo-umami-tour: + css: + theme: + css/components/tour/tour.theme.css: {} + dependencies: + - seven/tour-styling diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/demo_umami/themes/umami/umami.theme --- a/core/profiles/demo_umami/themes/umami/umami.theme Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/demo_umami/themes/umami/umami.theme Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,7 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Form\FormStateInterface; -use Symfony\Cmf\Component\Routing\RouteObjectInterface; +use Drupal\search\SearchPageInterface; /** * Implements hook_preprocess_HOOK() for HTML document templates. @@ -68,19 +68,18 @@ function umami_preprocess_breadcrumb(&$variables) { // We are creating a variable for the Current Page Title, to allow us to print // it after the breadcrumbs loop has run. - $request = \Drupal::request(); - if ($route = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT)) { - // Search page titles aren't resolved using the title_resolver service - it - // will always return 'Search' instead of 'Search for [term]', which would - // give us a breadcrumb of Home >> Search >> Search. - // @see https://www.drupal.org/project/drupal/issues/2359901 - // @see https://www.drupal.org/project/drupal/issues/2403359 - if (($entity = $request->attributes->get('entity')) && $entity->getEntityTypeId() === 'search_page') { - $variables['current_page_title'] = $entity->getPlugin()->suggestedTitle(); - } - else { - $variables['current_page_title'] = \Drupal::service('title_resolver')->getTitle($request, $route); - } + $route_match = \Drupal::routeMatch(); + // Search page titles aren't resolved using the title_resolver service - it + // will always return 'Search' instead of 'Search for [term]', which would + // give us a breadcrumb of Home >> Search >> Search. + // @todo Revisit after https://www.drupal.org/project/drupal/issues/2359901 + // @todo Revisit after https://www.drupal.org/project/drupal/issues/2403359 + $entity = $route_match->getParameter('entity'); + if ($entity instanceof SearchPageInterface) { + $variables['current_page_title'] = $entity->getPlugin()->suggestedTitle(); + } + else { + $variables['current_page_title'] = \Drupal::service('title_resolver')->getTitle(\Drupal::request(), $route_match->getRouteObject()); } // Since we are printing the 'Current Page Title', add the URL cache context. // If we don't, then we might end up with something like diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/minimal/config/install/block.block.stark_admin.yml --- a/core/profiles/minimal/config/install/block.block.stark_admin.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/minimal/config/install/block.block.stark_admin.yml Thu May 09 15:33:08 2019 +0100 @@ -20,4 +20,5 @@ label_display: visible level: 1 depth: 0 + expand_all_items: false visibility: { } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/minimal/config/install/block.block.stark_login.yml --- a/core/profiles/minimal/config/install/block.block.stark_login.yml Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - user - theme: - - stark -id: stark_login -theme: stark -region: sidebar_first -weight: 0 -provider: null -plugin: user_login_block -settings: - id: user_login_block - label: 'User login' - provider: user - label_display: visible -visibility: { } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/minimal/config/install/block.block.stark_tools.yml --- a/core/profiles/minimal/config/install/block.block.stark_tools.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/minimal/config/install/block.block.stark_tools.yml Thu May 09 15:33:08 2019 +0100 @@ -20,4 +20,5 @@ label_display: visible level: 1 depth: 0 + expand_all_items: false visibility: { } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/minimal/tests/src/Functional/MinimalTest.php --- a/core/profiles/minimal/tests/src/Functional/MinimalTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/minimal/tests/src/Functional/MinimalTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,8 @@ namespace Drupal\Tests\minimal\Functional; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\RequirementsPageTrait; +use Drupal\user\UserInterface; /** * Tests Minimal installation profile expectations. @@ -11,6 +13,8 @@ */ class MinimalTest extends BrowserTestBase { + use RequirementsPageTrait; + protected $profile = 'minimal'; /** @@ -33,6 +37,8 @@ // Ensure that there are no pending updates after installation. $this->drupalLogin($this->rootUser); $this->drupalGet('update.php/selection'); + $this->updateRequirementsProblem(); + $this->drupalGet('update.php/selection'); $this->assertText('No pending updates.'); // Ensure that there are no pending entity updates after installation. @@ -40,7 +46,7 @@ // Ensure special configuration overrides are correct. $this->assertFalse($this->config('system.theme.global')->get('features.node_user_picture'), 'Configuration system.theme.global:features.node_user_picture is FALSE.'); - $this->assertEquals(USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL, $this->config('user.settings')->get('register')); + $this->assertEquals(UserInterface::REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL, $this->config('user.settings')->get('register')); } } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/block.block.bartik_account_menu.yml --- a/core/profiles/standard/config/install/block.block.bartik_account_menu.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/install/block.block.bartik_account_menu.yml Thu May 09 15:33:08 2019 +0100 @@ -20,4 +20,5 @@ label_display: '0' level: 1 depth: 1 + expand_all_items: false visibility: { } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/block.block.bartik_footer.yml --- a/core/profiles/standard/config/install/block.block.bartik_footer.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/install/block.block.bartik_footer.yml Thu May 09 15:33:08 2019 +0100 @@ -20,4 +20,5 @@ label_display: '0' level: 1 depth: 0 + expand_all_items: false visibility: { } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/block.block.bartik_main_menu.yml --- a/core/profiles/standard/config/install/block.block.bartik_main_menu.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/install/block.block.bartik_main_menu.yml Thu May 09 15:33:08 2019 +0100 @@ -20,4 +20,5 @@ label_display: '0' level: 1 depth: 1 + expand_all_items: false visibility: { } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/block.block.bartik_tools.yml --- a/core/profiles/standard/config/install/block.block.bartik_tools.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/install/block.block.bartik_tools.yml Thu May 09 15:33:08 2019 +0100 @@ -20,4 +20,5 @@ label_display: visible level: 1 depth: 0 + expand_all_items: false visibility: { } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/block.block.seven_login.yml --- a/core/profiles/standard/config/install/block.block.seven_login.yml Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - user - theme: - - seven -id: seven_login -theme: seven -region: content -weight: 10 -provider: null -plugin: user_login_block -settings: - id: user_login_block - label: 'User login' - provider: user - label_display: visible -visibility: { } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/core.menu.static_menu_link_overrides.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/profiles/standard/config/install/core.menu.static_menu_link_overrides.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,7 @@ +definitions: + contact__site_page: + enabled: true + menu_name: footer + parent: '' + weight: 0 + expanded: false diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/filter.format.full_html.yml --- a/core/profiles/standard/config/install/filter.format.full_html.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/install/filter.format.full_html.yml Thu May 09 15:33:08 2019 +0100 @@ -5,7 +5,7 @@ - editor name: 'Full HTML' format: full_html -weight: 1 +weight: 2 roles: - administrator filters: diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/filter.format.restricted_html.yml --- a/core/profiles/standard/config/install/filter.format.restricted_html.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/install/filter.format.restricted_html.yml Thu May 09 15:33:08 2019 +0100 @@ -3,7 +3,7 @@ dependencies: { } name: 'Restricted HTML' format: restricted_html -weight: 0 +weight: 1 roles: - anonymous filters: diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/node.settings.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/profiles/standard/config/install/node.settings.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +use_admin_theme: true diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/system.site.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/profiles/standard/config/install/system.site.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,12 @@ +uuid: '' +name: '' +mail: '' +slogan: '' +page: + 403: '' + 404: '' + front: /node +admin_compact_mode: false +weight_select_max: 100 +langcode: en +default_langcode: en diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/taxonomy.vocabulary.tags.yml --- a/core/profiles/standard/config/install/taxonomy.vocabulary.tags.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/install/taxonomy.vocabulary.tags.yml Thu May 09 15:33:08 2019 +0100 @@ -4,5 +4,4 @@ name: Tags vid: tags description: 'Use tags to group articles on similar topics into categories.' -hierarchy: 0 weight: 0 diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/user.role.anonymous.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/profiles/standard/config/install/user.role.anonymous.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +langcode: en +status: true +dependencies: { } +id: anonymous +label: 'Anonymous user' +weight: 0 +is_admin: false +permissions: + - 'access comments' + - 'access content' + - 'access site-wide contact form' + - 'search content' + - 'use text format restricted_html' diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/user.role.authenticated.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/profiles/standard/config/install/user.role.authenticated.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,16 @@ +langcode: en +status: true +dependencies: { } +id: authenticated +label: 'Authenticated user' +weight: 1 +is_admin: false +permissions: + - 'access comments' + - 'access content' + - 'access shortcuts' + - 'access site-wide contact form' + - 'post comments' + - 'search content' + - 'skip comment approval' + - 'use text format basic_html' diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/install/user.settings.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/profiles/standard/config/install/user.settings.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,16 @@ +anonymous: Anonymous +verify_mail: true +notify: + cancel_confirm: true + password_reset: true + status_activated: true + status_blocked: false + status_canceled: false + register_admin_created: true + register_no_approval_required: true + register_pending_approval: true +register: visitors_admin_approval +cancel_method: user_cancel_block +password_reset_timeout: 86400 +password_strength: true +langcode: en diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/core.entity_form_display.media.audio.default.yml --- a/core/profiles/standard/config/optional/core.entity_form_display.media.audio.default.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/core.entity_form_display.media.audio.default.yml Thu May 09 15:33:08 2019 +0100 @@ -25,14 +25,6 @@ third_party_settings: { } type: file_generic region: content - name: - type: string_textfield - weight: -5 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } path: type: path weight: 30 @@ -55,4 +47,5 @@ placeholder: '' region: content third_party_settings: { } -hidden: { } +hidden: + name: true diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/core.entity_form_display.media.file.default.yml --- a/core/profiles/standard/config/optional/core.entity_form_display.media.file.default.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/core.entity_form_display.media.file.default.yml Thu May 09 15:33:08 2019 +0100 @@ -24,14 +24,6 @@ type: file_generic weight: 0 region: content - name: - type: string_textfield - weight: -5 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } status: type: boolean_checkbox settings: @@ -48,4 +40,5 @@ placeholder: '' region: content third_party_settings: { } -hidden: { } +hidden: + name: true diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/core.entity_form_display.media.image.default.yml --- a/core/profiles/standard/config/optional/core.entity_form_display.media.image.default.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/core.entity_form_display.media.image.default.yml Thu May 09 15:33:08 2019 +0100 @@ -26,14 +26,6 @@ type: image_image weight: 0 region: content - name: - type: string_textfield - weight: -5 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } status: type: boolean_checkbox settings: @@ -50,4 +42,5 @@ placeholder: '' region: content third_party_settings: { } -hidden: { } +hidden: + name: true diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/core.entity_form_display.media.video.default.yml --- a/core/profiles/standard/config/optional/core.entity_form_display.media.video.default.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/core.entity_form_display.media.video.default.yml Thu May 09 15:33:08 2019 +0100 @@ -25,14 +25,6 @@ third_party_settings: { } type: file_generic region: content - name: - type: string_textfield - weight: -5 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } path: type: path weight: 30 @@ -55,4 +47,5 @@ placeholder: '' region: content third_party_settings: { } -hidden: { } +hidden: + name: true diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/media.type.audio.yml --- a/core/profiles/standard/config/optional/media.type.audio.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/media.type.audio.yml Thu May 09 15:33:08 2019 +0100 @@ -9,4 +9,5 @@ new_revision: true source_configuration: source_field: field_media_audio_file -field_map: { } +field_map: + name: name diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/media.type.file.yml --- a/core/profiles/standard/config/optional/media.type.file.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/media.type.file.yml Thu May 09 15:33:08 2019 +0100 @@ -9,4 +9,5 @@ new_revision: true source_configuration: source_field: field_media_file -field_map: { } +field_map: + name: name diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/media.type.image.yml --- a/core/profiles/standard/config/optional/media.type.image.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/media.type.image.yml Thu May 09 15:33:08 2019 +0100 @@ -9,4 +9,5 @@ new_revision: true source_configuration: source_field: field_media_image -field_map: { } +field_map: + name: name diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/media.type.remote_video.yml --- a/core/profiles/standard/config/optional/media.type.remote_video.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/media.type.remote_video.yml Thu May 09 15:33:08 2019 +0100 @@ -13,4 +13,5 @@ - YouTube - Vimeo source_field: field_media_oembed_video -field_map: { } +field_map: + title: name diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/media.type.video.yml --- a/core/profiles/standard/config/optional/media.type.video.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/media.type.video.yml Thu May 09 15:33:08 2019 +0100 @@ -9,4 +9,5 @@ new_revision: true source_configuration: source_field: field_media_video_file -field_map: { } +field_map: + name: name diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/config/optional/workflows.workflow.editorial.yml --- a/core/profiles/standard/config/optional/workflows.workflow.editorial.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/config/optional/workflows.workflow.editorial.yml Thu May 09 15:33:08 2019 +0100 @@ -57,3 +57,4 @@ - draft - published entity_types: { } + default_moderation_state: draft diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/standard.install --- a/core/profiles/standard/standard.install Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/standard.install Thu May 09 15:33:08 2019 +0100 @@ -6,7 +6,6 @@ */ use Drupal\user\Entity\User; -use Drupal\user\RoleInterface; use Drupal\shortcut\Entity\Shortcut; /** @@ -17,17 +16,6 @@ * @see system_install() */ function standard_install() { - // Set front page to "node". - \Drupal::configFactory()->getEditable('system.site')->set('page.front', '/node')->save(TRUE); - - // Allow visitor account creation with administrative approval. - $user_settings = \Drupal::configFactory()->getEditable('user.settings'); - $user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save(TRUE); - - // Enable default permissions for system roles. - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access comments']); - user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access comments', 'post comments', 'skip comment approval']); - // Assign user 1 the "administrator" role. $user = User::load(1); $user->roles[] = 'administrator'; @@ -37,17 +25,6 @@ // menu links are valid. \Drupal::service('router.builder')->rebuildIfNeeded(); - // Enable the Contact link in the footer menu. - /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */ - $menu_link_manager = \Drupal::service('plugin.manager.menu.link'); - $menu_link_manager->updateDefinition('contact.site_page', ['enabled' => TRUE]); - - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access site-wide contact form']); - user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access site-wide contact form']); - - // Allow authenticated users to use shortcuts. - user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access shortcuts']); - // Populate the default shortcut set. $shortcut = Shortcut::create([ 'shortcut_set' => 'default', @@ -64,11 +41,4 @@ 'link' => ['uri' => 'internal:/admin/content'], ]); $shortcut->save(); - - // Allow all users to use search. - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['search content']); - user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['search content']); - - // Enable the admin theme. - \Drupal::configFactory()->getEditable('node.settings')->set('use_admin_theme', TRUE)->save(TRUE); } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/tests/src/Functional/StandardTest.php --- a/core/profiles/standard/tests/src/Functional/StandardTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/tests/src/Functional/StandardTest.php Thu May 09 15:33:08 2019 +0100 @@ -10,6 +10,7 @@ use Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber; use Drupal\filter\Entity\FilterFormat; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\RequirementsPageTrait; use Drupal\user\Entity\Role; /** @@ -20,6 +21,7 @@ class StandardTest extends BrowserTestBase { use SchemaCheckTestTrait; + use RequirementsPageTrait; protected $profile = 'standard'; @@ -155,6 +157,8 @@ // Ensure that there are no pending updates after installation. $this->drupalLogin($this->rootUser); $this->drupalGet('update.php/selection'); + $this->updateRequirementsProblem(); + $this->drupalGet('update.php/selection'); $this->assertText('No pending updates.'); // Ensure that there are no pending entity updates after installation. @@ -242,18 +246,15 @@ $form = $assert_session->elementExists('css', $form_selector); $form_html = $form->getOuterHtml(); - // The name field (if it exists) should come before the source field, - // which should itself come before the vertical tabs. + // The name field should be hidden. + $assert_session->fieldNotExists('Name', $form); + // The source field should be shown before the vertical tabs. $test_source_field = $assert_session->fieldExists($media_type->getSource()->getSourceFieldDefinition($media_type)->getLabel(), $form)->getOuterHtml(); $vertical_tabs = $assert_session->elementExists('css', '.form-type-vertical-tabs', $form)->getOuterHtml(); + $this->assertTrue(strpos($form_html, $vertical_tabs) > strpos($form_html, $test_source_field)); + // The "Published" checkbox should be the last element. $date_field = $assert_session->fieldExists('Date', $form)->getOuterHtml(); $published_checkbox = $assert_session->fieldExists('Published', $form)->getOuterHtml(); - if ($page->findField('Name')) { - $name_field = $assert_session->fieldExists('Name', $form)->getOuterHtml(); - $this->assertTrue(strpos($form_html, $test_source_field) > strpos($form_html, $name_field)); - } - $this->assertTrue(strpos($form_html, $vertical_tabs) > strpos($form_html, $test_source_field)); - // The "Published" checkbox should be the last element. $this->assertTrue(strpos($form_html, $published_checkbox) > strpos($form_html, $date_field)); } } diff -r 129ea1e6d783 -r af1871eacc83 core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php --- a/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php Thu May 09 15:33:08 2019 +0100 @@ -37,12 +37,11 @@ $this->drupalGet(''); $this->assertBigPipePlaceholderReplacementCount(1); - // Node page: 3 placeholders: + // Node page: 2 placeholders: // 1. messages - // 2. local tasks block - // 3. comment form + // 2. comment form $this->drupalGet($node->toUrl()); - $this->assertBigPipePlaceholderReplacementCount(3); + $this->assertBigPipePlaceholderReplacementCount(2); } /** diff -r 129ea1e6d783 -r af1871eacc83 core/rebuild.php --- a/core/rebuild.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/rebuild.php Thu May 09 15:33:08 2019 +0100 @@ -54,4 +54,4 @@ \Drupal::messenger()->addStatus('Cache rebuild complete.'); } $base_path = dirname(dirname($request->getBaseUrl())); -header('Location: ' . $base_path); +header('Location: ' . $request->getSchemeAndHttpHost() . $base_path); diff -r 129ea1e6d783 -r af1871eacc83 core/scripts/run-tests.sh --- a/core/scripts/run-tests.sh Thu Feb 28 13:21:36 2019 +0000 +++ b/core/scripts/run-tests.sh Thu May 09 15:33:08 2019 +0100 @@ -12,6 +12,8 @@ use Drupal\Core\Composer\Composer; use Drupal\Core\Asset\AttachedAssets; use Drupal\Core\Database\Database; +use Drupal\Core\File\Exception\FileException; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\Test\TestDatabase; use Drupal\Core\Test\TestRunnerKernel; @@ -60,7 +62,7 @@ } if ($args['list']) { - // Display all available tests. + // Display all available tests organized by one @group annotation. echo "\nAvailable test groups & classes\n"; echo "-------------------------------\n\n"; try { @@ -71,11 +73,18 @@ echo (string) $e; exit(SIMPLETEST_SCRIPT_EXIT_EXCEPTION); } + + // A given class can appear in multiple groups. For historical reasons, we + // need to present each test only once. The test is shown in the group that is + // printed first. + $printed_tests = []; foreach ($groups as $group => $tests) { echo $group . "\n"; - foreach ($tests as $class => $info) { - echo " - $class\n"; + $tests = array_diff(array_keys($tests), $printed_tests); + foreach ($tests as $test) { + echo " - $test\n"; } + $printed_tests = array_merge($printed_tests, $tests); } exit(SIMPLETEST_SCRIPT_EXIT_SUCCESS); } @@ -962,8 +971,13 @@ // simpletest_clean_temporary_directories() cannot be used here, since it // would also delete file directories of other tests that are potentially // running concurrently. - file_unmanaged_delete_recursive($test_directory, ['Drupal\simpletest\TestBase', 'filePreDeleteCallback']); - $messages[] = "- Removed test site directory."; + try { + \Drupal::service('file_system')->deleteRecursive($test_directory, ['Drupal\simpletest\TestBase', 'filePreDeleteCallback']); + $messages[] = "- Removed test site directory."; + } + catch (FileException $e) { + // Ignore failed deletes. + } } // Clear out all database tables from the test. @@ -1019,7 +1033,7 @@ foreach ($groups as $group => $tests) { $all_tests = array_merge($all_tests, array_keys($tests)); } - $test_list = $all_tests; + $test_list = array_unique($all_tests); } else { if ($args['class']) { @@ -1139,16 +1153,20 @@ echo (string) $e; exit(SIMPLETEST_SCRIPT_EXIT_EXCEPTION); } + // Store all the groups so we can suggest alternatives if we need to. + $all_groups = array_keys($groups); + // Verify that the groups exist. + if (!empty($unknown_groups = array_diff($args['test_names'], $all_groups))) { + $first_group = reset($unknown_groups); + simpletest_script_print_error('Test group not found: ' . $first_group); + simpletest_script_print_alternatives($first_group, $all_groups); + exit(SIMPLETEST_SCRIPT_EXIT_FAILURE); + } + // Ensure our list of tests contains only one entry for each test. foreach ($args['test_names'] as $group_name) { - if (isset($groups[$group_name])) { - $test_list = array_merge($test_list, array_keys($groups[$group_name])); - } - else { - simpletest_script_print_error('Test group not found: ' . $group_name); - simpletest_script_print_alternatives($group_name, array_keys($groups)); - exit(SIMPLETEST_SCRIPT_EXIT_FAILURE); - } + $test_list = array_merge($test_list, array_flip(array_keys($groups[$group_name]))); } + $test_list = array_flip($test_list); } } @@ -1565,7 +1583,7 @@ // Ensure we have assets verbose directory - tests with no verbose output will // not have created one. $directory = PublicStream::basePath() . '/simpletest/verbose'; - file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); + \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS); $php = new Php(); $uuid = $php->generate(); $filename = $directory . '/results-' . $uuid . '.html'; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php --- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php Thu May 09 15:33:08 2019 +0100 @@ -19,22 +19,14 @@ /** * Tests image buttons can be operated with the keyboard ENTER key. */ - public function testAjaxImageButton() { + public function testAjaxImageButtonKeypressEnter() { // Get a Field UI manage-display page. $this->drupalGet('ajax_forms_image_button_form'); $assertSession = $this->assertSession(); $session = $this->getSession(); - $enter_key_event = <<executeScript($enter_key_event); + $button = $session->getPage()->findButton('Edit'); + $button->keyPress(13); $this->assertNotEmpty($assertSession->waitForElementVisible('css', '#ajax-1-more-div'), 'Page updated after image button pressed'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php --- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php Thu May 09 15:33:08 2019 +0100 @@ -52,6 +52,22 @@ $this->assertEquals('Alert', $alert_text); $this->getSession()->getDriver()->getWebDriverSession()->accept_alert(); + $this->drupalGet($form_path); + $page->pressButton("AJAX 'Announce': Click to announce"); + $this->assertWaitPageContains('
Default announcement.
'); + + $this->drupalGet($form_path); + $page->pressButton("AJAX 'Announce': Click to announce with 'polite' priority"); + $this->assertWaitPageContains('
Polite announcement.
'); + + $this->drupalGet($form_path); + $page->pressButton("AJAX 'Announce': Click to announce with 'assertive' priority"); + $this->assertWaitPageContains('
Assertive announcement.
'); + + $this->drupalGet($form_path); + $page->pressButton("AJAX 'Announce': Click to announce twice"); + $this->assertWaitPageContains('
Assertive announcement.' . "\nAnother announcement.
"); + // Tests the 'append' command. $page->pressButton("AJAX 'Append': Click to append something"); $this->assertWaitPageContains('
Append inside this divAppended text
'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,119 @@ +install(['test_messages']); + $theme_config = \Drupal::configFactory()->getEditable('system.theme'); + $theme_config->set('default', 'test_messages'); + $theme_config->save(); + } + + /** + * Test click on links to show messages and remove messages. + */ + public function testAddRemoveMessages() { + $web_assert = $this->assertSession(); + $this->drupalGet('js_message_test_link'); + + $current_messages = []; + foreach (JsMessageTestCases::getMessagesSelectors() as $messagesSelector) { + $web_assert->elementExists('css', $messagesSelector); + foreach (JsMessageTestCases::getTypes() as $type) { + $this->click('[id="add-' . $messagesSelector . '-' . $type . '"]'); + $selector = "$messagesSelector .messages.messages--$type"; + $msg_element = $web_assert->waitForElementVisible('css', $selector); + $this->assertNotEmpty($msg_element, "Message element visible: $selector"); + $web_assert->elementContains('css', $selector, "This is a message of the type, $type. You be the the judge of its importance."); + $current_messages[$selector] = "This is a message of the type, $type. You be the the judge of its importance."; + $this->assertCurrentMessages($current_messages, $messagesSelector); + } + // Remove messages 1 by 1 and confirm the messages are expected. + foreach (JsMessageTestCases::getTypes() as $type) { + $this->click('[id="remove-' . $messagesSelector . '-' . $type . '"]'); + $selector = "$messagesSelector .messages.messages--$type"; + // The message for this selector should not be on the page. + unset($current_messages[$selector]); + $this->assertCurrentMessages($current_messages, $messagesSelector); + } + } + + $messagesSelector = JsMessageTestCases::getMessagesSelectors()[0]; + $current_messages = []; + $types = JsMessageTestCases::getTypes(); + $nb_messages = count($types) * 2; + for ($i = 0; $i < $nb_messages; $i++) { + $current_messages[] = "This is message number $i of the type, {$types[$i % count($types)]}. You be the the judge of its importance."; + } + // Test adding multiple messages at once. + // @see processMessages() + $this->click('[id="add-multiple"]'); + $this->assertCurrentMessages($current_messages, $messagesSelector); + $this->click('[id="remove-multiple"]'); + $this->assertCurrentMessages([], $messagesSelector); + + $current_messages = []; + for ($i = 0; $i < $nb_messages; $i++) { + $current_messages[] = "Msg-$i"; + } + // The last message is of a different type and shouldn't get cleared. + $last_message = 'Msg-' . count($current_messages); + $current_messages[] = $last_message; + $this->click('[id="add-multiple-error"]'); + $this->assertCurrentMessages($current_messages, $messagesSelector); + $this->click('[id="remove-type"]'); + $this->assertCurrentMessages([$last_message], $messagesSelector); + $this->click('[id="clear-all"]'); + $this->assertCurrentMessages([], $messagesSelector); + + // Confirm that when adding a message with an "id" specified but no status + // that it receives the default status. + $this->click('[id="id-no-status"]'); + $no_status_msg = 'Msg-id-no-status'; + $this->assertCurrentMessages([$no_status_msg], $messagesSelector); + $web_assert->elementTextContains('css', "$messagesSelector .messages--status[data-drupal-message-id=\"my-special-id\"]", $no_status_msg); + + } + + /** + * Asserts that currently shown messages match expected messages. + * + * @param array $expected_messages + * Expected messages. + * @param string $messagesSelector + * The css selector for the containing messages element. + */ + protected function assertCurrentMessages(array $expected_messages, $messagesSelector) { + $expected_messages = array_values($expected_messages); + $current_messages = []; + if ($message_divs = $this->getSession()->getPage()->findAll('css', "$messagesSelector .messages")) { + foreach ($message_divs as $message_div) { + /** @var \Behat\Mink\Element\NodeElement $message_div */ + $current_messages[] = $message_div->getText(); + } + } + $this->assertEquals($expected_messages, $current_messages); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php --- a/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,8 @@ namespace Drupal\FunctionalJavascriptTests; use Behat\Mink\Driver\Selenium2Driver; +use Behat\Mink\Exception\DriverException; +use WebDriver\Exception\UnknownError; use WebDriver\ServiceFactory; /** @@ -41,4 +43,69 @@ $this->getWebDriverSession()->setCookie($cookieArray); } + /** + * Uploads a file to the Selenium instance and returns the remote path. + * + * \Behat\Mink\Driver\Selenium2Driver::uploadFile() is a private method so + * that can't be used inside a test, but we need the remote path that is + * generated when uploading to make sure the file reference exists on the + * container running selenium. + * + * @param string $path + * The path to the file to upload. + * + * @return string + * The remote path. + * + * @throws \Behat\Mink\Exception\DriverException + * When PHP is compiled without zip support, or the file doesn't exist. + * @throws \WebDriver\Exception\UnknownError + * When an unknown error occurred during file upload. + * @throws \Exception + * When a known error occurred during file upload. + */ + public function uploadFileAndGetRemoteFilePath($path) { + if (!is_file($path)) { + throw new DriverException('File does not exist locally and cannot be uploaded to the remote instance.'); + } + + if (!class_exists('ZipArchive')) { + throw new DriverException('Could not compress file, PHP is compiled without zip support.'); + } + + // Selenium only accepts uploads that are compressed as a Zip archive. + $tempFilename = tempnam('', 'WebDriverZip'); + + $archive = new \ZipArchive(); + $result = $archive->open($tempFilename, \ZipArchive::CREATE); + if (!$result) { + throw new DriverException('Zip archive could not be created. Error ' . $result); + } + $result = $archive->addFile($path, basename($path)); + if (!$result) { + throw new DriverException('File could not be added to zip archive.'); + } + $result = $archive->close(); + if (!$result) { + throw new DriverException('Zip archive could not be closed.'); + } + + try { + $remotePath = $this->getWebDriverSession()->file(['file' => base64_encode(file_get_contents($tempFilename))]); + + // If no path is returned the file upload failed silently. + if (empty($remotePath)) { + throw new UnknownError(); + } + } + catch (\Exception $e) { + throw $e; + } + finally { + unlink($tempFilename); + } + + return $remotePath; + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php --- a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,9 +3,9 @@ namespace Drupal\FunctionalJavascriptTests\EntityReference; use Drupal\FunctionalJavascriptTests\WebDriverTestBase; -use Drupal\simpletest\ContentTypeCreationTrait; -use Drupal\simpletest\NodeCreationTrait; use Drupal\Tests\field\Traits\EntityReferenceTestTrait; +use Drupal\Tests\node\Traits\ContentTypeCreationTrait; +use Drupal\Tests\node\Traits\NodeCreationTrait; /** * Tests the output of entity reference autocomplete widgets. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php --- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -15,6 +15,8 @@ * Use \Drupal\FunctionalJavascriptTests\WebDriverTestBase instead * * @see https://www.drupal.org/node/2945059 + * + * @ingroup testing */ abstract class JavascriptTestBase extends WebDriverTestBase { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalJavascriptTests/Tests/DrupalSelenium2DriverTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalJavascriptTests/Tests/DrupalSelenium2DriverTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,68 @@ + 3]; + $this->createFileField('field_file', 'entity_test', 'entity_test', $storage_settings); + $this->drupalLogin($this->drupalCreateUser([ + 'administer entity_test content', + 'access content', + ])); + } + + /** + * Tests uploading remote files. + */ + public function testGetRemoteFilePath() { + $web_driver = $this->getSession()->getDriver(); + $file_system = \Drupal::service('file_system'); + $entity = EntityTest::create(); + $entity->save(); + + $files = array_slice($this->getTestFiles('text'), 0, 3); + $real_paths = []; + foreach ($files as $file) { + $real_paths[] = $file_system->realpath($file->uri); + } + $remote_paths = []; + foreach ($real_paths as $path) { + $remote_paths[] = $web_driver->uploadFileAndGetRemoteFilePath($path); + } + + // Tests that uploading multiple remote files works with remote path. + $this->drupalGet($entity->toUrl('edit-form')); + $multiple_field = $this->xpath('//input[@multiple]')[0]; + $multiple_field->setValue(implode("\n", $remote_paths)); + $this->assertSession()->assertWaitOnAjaxRequest(); + $this->getSession()->getPage()->findButton('Save')->click(); + $entity = EntityTest::load($entity->id()); + $this->assertCount(3, $entity->field_file); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php --- a/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,8 @@ * Runs a browser test using a driver that supports Javascript. * * Base class for testing browser interaction implemented in JavaScript. + * + * @ingroup testing */ abstract class WebDriverTestBase extends BrowserTestBase { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php --- a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php Thu May 09 15:33:08 2019 +0100 @@ -1,5 +1,5 @@ assertSession()->statusCodeEquals(200); * @endcode + * + * @todo https://www.drupal.org/project/drupal/issues/3031580 Note that + * deprecations in this file do not use the @ symbol in Drupal 8 because this + * will be removed in Drupal 10.0.0. Adding the @ back should re-enable coding + * stanadrds checks. */ trait AssertLegacyTrait { @@ -28,7 +33,7 @@ * @param string $css_selector * The CSS selector identifying the element to check. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->elementExists() instead. */ protected function assertElementPresent($css_selector) { @@ -41,7 +46,7 @@ * @param string $css_selector * The CSS selector identifying the element to check. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->elementNotExists() instead. */ protected function assertElementNotPresent($css_selector) { @@ -57,7 +62,7 @@ * @param string $text * Plain text to look for. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use instead: * - $this->assertSession()->responseContains() for non-HTML responses, * like XML or Json. @@ -89,7 +94,7 @@ * @param string $text * Plain text to look for. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use instead: * - $this->assertSession()->responseNotContains() for non-HTML responses, * like XML or Json. @@ -155,7 +160,7 @@ * (optional) A message to display with the assertion. Do not translate * messages with t(). If left blank, a default message will be displayed. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->getSession()->getPage()->getText() and substr_count() instead. */ protected function assertUniqueText($text, $message = NULL) { @@ -181,7 +186,7 @@ * (optional) A message to display with the assertion. Do not translate * messages with t(). If left blank, a default message will be displayed. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->getSession()->getPage()->getText() and substr_count() instead. */ protected function assertNoUniqueText($text, $message = '') { @@ -201,7 +206,7 @@ * Response code. For example 200 is a successful page request. For a list * of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->statusCodeEquals() instead. */ protected function assertResponse($code) { @@ -218,7 +223,7 @@ * to skip checking the actual value, while still checking that the field * exists. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->fieldExists() or * $this->assertSession()->buttonExists() or * $this->assertSession()->fieldValueEquals() instead. @@ -238,7 +243,7 @@ * value, while still checking that the field does not exist. However, the * default value ('') asserts that the field value is not an empty string. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->fieldNotExists() or * $this->assertSession()->buttonNotExists() or * $this->assertSession()->fieldValueNotEquals() instead. @@ -260,7 +265,7 @@ * * @throws \Behat\Mink\Exception\ElementNotFoundException * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->fieldExists() or * $this->assertSession()->buttonExists() or * $this->assertSession()->fieldValueEquals() instead. @@ -275,7 +280,7 @@ * @param string $field * Name or ID of field to assert. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->fieldExists() or * $this->assertSession()->buttonExists() instead. */ @@ -289,7 +294,7 @@ * @param string $field * Name or ID of field to assert. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->fieldNotExists() or * $this->assertSession()->buttonNotExists() instead. */ @@ -305,7 +310,7 @@ * @param string $raw * Raw (HTML) string to look for. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->responseContains() instead. */ protected function assertRaw($raw) { @@ -320,7 +325,7 @@ * @param string $raw * Raw (HTML) string to look for. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->responseNotContains() instead. */ protected function assertNoRaw($raw) { @@ -333,7 +338,7 @@ * @param string $expected_title * The string the page title should be. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->titleEquals() instead. */ protected function assertTitle($expected_title) { @@ -352,7 +357,7 @@ * @param int $index * Link position counting from zero. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->linkExists() instead. */ protected function assertLink($label, $index = 0) { @@ -365,7 +370,7 @@ * @param string|\Drupal\Component\Render\MarkupInterface $label * Text between the anchor tags. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->linkNotExists() instead. */ protected function assertNoLink($label) { @@ -380,7 +385,7 @@ * @param int $index * Link position counting from zero. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->linkByHrefExists() instead. */ protected function assertLinkByHref($href, $index = 0) { @@ -393,7 +398,7 @@ * @param string $href * The full or partial value of the 'href' attribute of the anchor tag. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->linkByHrefNotExists() instead. */ protected function assertNoLinkByHref($href) { @@ -413,7 +418,7 @@ * * @throws \Behat\Mink\Exception\ExpectationException * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->fieldNotExists() or * $this->assertSession()->buttonNotExists() or * $this->assertSession()->fieldValueNotEquals() instead. @@ -428,7 +433,7 @@ * @param \Drupal\Core\Url|string $path * The expected system path or URL. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->addressEquals() instead. */ protected function assertUrl($path) { @@ -443,7 +448,7 @@ * @param string $option * Option to assert. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->optionExists() instead. */ protected function assertOption($id, $option) { @@ -458,7 +463,7 @@ * @param string $text * The text for the option tag to assert. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->optionExists() instead. */ protected function assertOptionByText($id, $text) { @@ -473,7 +478,7 @@ * @param string $option * Option to assert. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->optionNotExists() instead. */ protected function assertNoOption($id, $option) { @@ -491,7 +496,7 @@ * (optional) A message to display with the assertion. Do not translate * messages with t(). If left blank, a default message will be displayed. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->optionExists() instead and check the * "selected" attribute yourself. */ @@ -507,7 +512,7 @@ * @param string $id * ID of field to assert. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->checkboxChecked() instead. */ protected function assertFieldChecked($id) { @@ -520,7 +525,7 @@ * @param string $id * ID of field to assert. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->checkboxNotChecked() instead. */ protected function assertNoFieldChecked($id) { @@ -540,7 +545,7 @@ * (optional) A message to display with the assertion. Do not translate * messages with t(). * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->xpath() instead and check the values directly in the test. */ protected function assertFieldByXPath($xpath, $value = NULL, $message = '') { @@ -563,7 +568,7 @@ * * @throws \Behat\Mink\Exception\ExpectationException * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->xpath() instead and assert that the result is empty. */ protected function assertNoFieldByXPath($xpath, $value = NULL, $message = '') { @@ -601,7 +606,7 @@ * (optional) A message to display with the assertion. Do not translate * messages with t(). * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Iterate over the fields yourself instead and directly check the values in * the test. */ @@ -650,7 +655,7 @@ * @param string $raw * Raw (HTML) string to look for. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->assertEscaped() instead. */ protected function assertEscaped($raw) { @@ -665,7 +670,7 @@ * @param string $raw * Raw (HTML) string to look for. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->assertNoEscaped() instead. */ protected function assertNoEscaped($raw) { @@ -678,7 +683,7 @@ * @param string $pattern * Perl regex to look for including the regex delimiters. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->responseMatches() instead. */ protected function assertPattern($pattern) { @@ -691,7 +696,7 @@ * @param string $pattern * Perl regex to look for including the regex delimiters. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->responseNotMatches() instead. * * @see https://www.drupal.org/node/2864262 @@ -707,7 +712,7 @@ * @param string $expected_cache_tag * The expected cache tag. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->responseHeaderContains() instead. */ protected function assertCacheTag($expected_cache_tag) { @@ -720,7 +725,7 @@ * @param string $cache_tag * The cache tag to check. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->responseHeaderNotContains() instead. * * @see https://www.drupal.org/node/2864029 @@ -738,7 +743,7 @@ * @param string $value * Value of the header to assert * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->responseHeaderEquals() instead. */ protected function assertHeader($name, $value) { @@ -776,7 +781,7 @@ * @return string * An XPath query with arguments replaced. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->assertSession()->buildXPathQuery() instead. */ protected function buildXPathQuery($xpath, array $args = []) { @@ -794,7 +799,7 @@ * @return string * XPath for specified values. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->getSession()->getPage()->findField() instead. */ protected function constructFieldXpath($attribute, $value) { @@ -805,7 +810,7 @@ /** * Gets the current raw content. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $this->getSession()->getPage()->getContent() instead. */ protected function getRawContent() { @@ -822,7 +827,7 @@ * @return \Behat\Mink\Element\NodeElement[] * Option elements in select. * - * @deprecated Scheduled for removal in Drupal 9.0.0. + * Deprecated Scheduled for removal in Drupal 10.0.0. * Use $element->findAll('xpath', 'option') instead. */ protected function getAllOptions(NodeElement $element) { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php --- a/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php Thu May 09 15:33:08 2019 +0100 @@ -2,7 +2,7 @@ namespace Drupal\FunctionalTests\Breadcrumb; -use Drupal\simpletest\BlockCreationTrait; +use Drupal\Tests\block\Traits\BlockCreationTrait; use Drupal\Tests\BrowserTestBase; /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -474,9 +474,6 @@ $this->pass($e->getMessage()); } - // Test \Drupal\FunctionalTests\AssertLegacyTrait::getAllOptions. - $this->drupalGet('/form-test/select'); - $this->assertCount(6, $this->getAllOptions($this->cssSelect('select[name="opt_groups"]')[0])); } /** @@ -644,14 +641,20 @@ * Tests the assumption that local time is in 'Australia/Sydney'. */ public function testLocalTimeZone() { + $expected = 'Australia/Sydney'; // The 'Australia/Sydney' time zone is set in core/tests/bootstrap.php - $this->assertEquals('Australia/Sydney', date_default_timezone_get()); + $this->assertEquals($expected, date_default_timezone_get()); // The 'Australia/Sydney' time zone is also set in // FunctionalTestSetupTrait::initConfig(). $config_factory = $this->container->get('config.factory'); $value = $config_factory->get('system.date')->get('timezone.default'); - $this->assertEquals('Australia/Sydney', $value); + $this->assertEquals($expected, $value); + + // Test that users have the correct time zone set. + $this->assertEquals($expected, $this->rootUser->getTimeZone()); + $admin_user = $this->drupalCreateUser(['administer site configuration']); + $this->assertEquals($expected, $admin_user->getTimeZone()); } /** @@ -687,4 +690,21 @@ \Drupal::service('extension.list.module')->getPathname('demo_umami_content'); } + /** + * Test the protections provided by .htkey. + */ + public function testHtkey() { + // Remove the Simpletest private key file so we can test the protection + // against requests that forge a valid testing user agent to gain access + // to the installer. + // @see drupal_valid_test_ua() + // Not using File API; a potential error must trigger a PHP warning. + $install_url = Url::fromUri('base:core/install.php', ['external' => TRUE, 'absolute' => TRUE])->toString(); + $this->drupalGet($install_url); + $this->assertSession()->statusCodeEquals(200); + unlink($this->siteDirectory . '/.htkey'); + $this->drupalGet($install_url); + $this->assertSession()->statusCodeEquals(403); + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,68 @@ +assertSession(); + $system_path = $this->buildUrl(drupal_get_path('module', 'system')); + $http_path = $system_path . '/tests/http.php/user/login'; + $https_path = $system_path . '/tests/https.php/user/login'; + // Generate a valid simpletest User-Agent to pass validation. + $this->assertTrue(preg_match('/test\d+/', $this->databasePrefix, $matches), 'Database prefix contains test prefix.'); + $this->agent = drupal_generate_test_ua($matches[0]); + + // Test pages only available for testing. + $this->drupalGet($http_path); + $assert_session->statusCodeEquals(200); + $this->drupalGet($https_path); + $assert_session->statusCodeEquals(200); + + // Now slightly modify the HMAC on the header, which should not validate. + $this->agent = 'X'; + $this->drupalGet($http_path); + $assert_session->statusCodeEquals(403); + $this->drupalGet($https_path); + $assert_session->statusCodeEquals(403); + + // Use a real User-Agent and verify that the special files http.php and + // https.php can't be accessed. + $this->agent = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'; + $this->drupalGet($http_path); + $assert_session->statusCodeEquals(403); + $this->drupalGet($https_path); + $assert_session->statusCodeEquals(403); + } + + /** + * {@inheritdoc} + */ + protected function prepareRequest() { + $session = $this->getSession(); + if ($this->agent) { + $session->setCookie('SIMPLETEST_USER_AGENT', $this->agent); + } + else { + $session->setCookie('SIMPLETEST_USER_AGENT', drupal_generate_test_ua($this->databasePrefix)); + } + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Core/Test/AssertLegacyTraitDeprecatedTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/Core/Test/AssertLegacyTraitDeprecatedTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,32 @@ +findAll('xpath', 'option') instead. + */ + public function testGetAllOptions() { + $this->drupalGet('/form-test/select'); + $this->assertCount(6, $this->getAllOptions($this->cssSelect('select[name="opt_groups"]')[0])); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Core/Test/ModuleInstallBatchTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/Core/Test/ModuleInstallBatchTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,37 @@ +assertNotNull(EntityTest::load($id), 'Successfully loaded entity ' . $id); + } + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Datetime/TimestampAgoFormatterTest.php --- a/core/tests/Drupal/FunctionalTests/Datetime/TimestampAgoFormatterTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Datetime/TimestampAgoFormatterTest.php Thu May 09 15:33:08 2019 +0100 @@ -110,13 +110,13 @@ $edit = [ 'fields[field_timestamp][settings_edit_form][settings][future_format]' => 'ends in @interval', 'fields[field_timestamp][settings_edit_form][settings][past_format]' => 'started @interval ago', - 'fields[field_timestamp][settings_edit_form][settings][granularity]' => 3, + 'fields[field_timestamp][settings_edit_form][settings][granularity]' => 1, ]; $this->drupalPostForm(NULL, $edit, 'Update'); $this->drupalPostForm(NULL, [], 'Save'); - $this->assertSession()->pageTextContains('ends in 1 year 1 month 1 week'); - $this->assertSession()->pageTextContains('started 1 year 1 month 1 week ago'); + $this->assertSession()->pageTextContains('ends in 1 year'); + $this->assertSession()->pageTextContains('started 1 year ago'); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/FolderTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/FolderTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,28 @@ +assertTrue(\Drupal::service('file_system')->prepareDirectory($directory, FALSE), 'Directory created.'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php --- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php Thu May 09 15:33:08 2019 +0100 @@ -115,7 +115,7 @@ $this->assertUrl('user/1'); $this->assertResponse(200); // Confirm that we are logged-in after installation. - $this->assertText($this->rootUser->getUsername()); + $this->assertText($this->rootUser->getAccountName()); // Confirm that Drupal recognizes this distribution as the current profile. $this->assertEqual(\Drupal::installProfile(), 'mydistro'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php --- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php Thu May 09 15:33:08 2019 +0100 @@ -69,7 +69,7 @@ $this->assertUrl('myrootuser'); $this->assertResponse(200); // Confirm that we are logged-in after installation. - $this->assertText($this->rootUser->getUsername()); + $this->assertText($this->rootUser->getAccountName()); // Confirm that Drupal recognizes this distribution as the current profile. $this->assertEqual(\Drupal::installProfile(), 'mydistro'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php Thu May 09 15:33:08 2019 +0100 @@ -16,7 +16,7 @@ $this->assertUrl('user/1'); $this->assertResponse(200); // Confirm that we are logged-in after installation. - $this->assertText($this->rootUser->getUsername()); + $this->assertText($this->rootUser->getAccountName()); // Verify that the confirmation message appears. require_once $this->root . '/core/includes/install.inc'; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -8,6 +8,7 @@ use Drupal\Core\Site\Settings; use Drupal\Core\Test\HttpClientMiddleware\TestHttpClientMiddleware; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\RequirementsPageTrait; use GuzzleHttp\HandlerStack; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; @@ -19,6 +20,8 @@ */ abstract class InstallerTestBase extends BrowserTestBase { + use RequirementsPageTrait; + /** * Custom settings.php values to write for a test run. * @@ -244,12 +247,7 @@ * @see system_requirements() */ protected function setUpRequirementsProblem() { - // By default, skip the "recommended PHP version" warning on older test - // environments. This allows the installer to be tested consistently on - // both recommended PHP versions and older (but still supported) versions. - if (version_compare(phpversion(), '7.0') < 0) { - $this->continueOnExpectedWarnings(['PHP']); - } + // Do nothing. } /** @@ -275,45 +273,4 @@ } } - /** - * Continues installation when an expected warning is found. - * - * @param string[] $expected_warnings - * A list of warning summaries to expect on the requirements screen (e.g. - * 'PHP', 'PHP OPcode caching', etc.). If only the expected warnings - * are found, the test will click the "continue anyway" link to go to the - * next screen of the installer. If an expected warning is not found, or if - * a warning not in the list is present, a fail is raised. - */ - protected function continueOnExpectedWarnings($expected_warnings = []) { - // Don't try to continue if there are errors. - if (strpos($this->getTextContent(), 'Errors found') !== FALSE) { - return; - } - // Allow only details elements that are directly after the warning header - // or each other. There is no guaranteed wrapper we can rely on across - // distributions. When there are multiple warnings, the selectors will be: - // - h3#warning+details summary - // - h3#warning+details+details summary - // - etc. - // We add one more selector than expected warnings to confirm that there - // isn't any other warning before clicking the link. - // @todo Make this more reliable in - // https://www.drupal.org/project/drupal/issues/2927345. - $selectors = []; - for ($i = 0; $i <= count($expected_warnings); $i++) { - $selectors[] = 'h3#warning' . implode('', array_fill(0, $i + 1, '+details')) . ' summary'; - } - $warning_elements = $this->cssSelect(implode(', ', $selectors)); - - // Confirm that there are only the expected warnings. - $warnings = []; - foreach ($warning_elements as $warning) { - $warnings[] = trim($warning->getText()); - } - $this->assertEquals($expected_warnings, $warnings); - $this->clickLink('continue anyway'); - $this->checkForMetaRefresh(); - } - } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php Thu May 09 15:33:08 2019 +0100 @@ -52,7 +52,7 @@ parent::setUpSettings(); // Ensure that the error message translation is working. - $this->assertRaw('Beheben Sie alle Probleme unten, um die Installation fortzusetzen. Informationen zur Konfiguration der Datenbankserver finden Sie in der Installationshandbuch, oder kontaktieren Sie Ihren Hosting-Anbieter.'); + $this->assertRaw('Beheben Sie alle Probleme unten, um die Installation fortzusetzen. Informationen zur Konfiguration der Datenbankserver finden Sie in der Installationshandbuch, oder kontaktieren Sie Ihren Hosting-Anbieter.'); $this->assertRaw('CREATE ein Test-Tabelle auf Ihrem Datenbankserver mit dem Befehl CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY) fehlgeschlagen.'); // Now do it successfully. @@ -143,8 +143,8 @@ msgid "Anonymous" msgstr "Anonymous $langcode" -msgid "Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider." -msgstr "Beheben Sie alle Probleme unten, um die Installation fortzusetzen. Informationen zur Konfiguration der Datenbankserver finden Sie in der Installationshandbuch, oder kontaktieren Sie Ihren Hosting-Anbieter." +msgid "Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider." +msgstr "Beheben Sie alle Probleme unten, um die Installation fortzusetzen. Informationen zur Konfiguration der Datenbankserver finden Sie in der Installationshandbuch, oder kontaktieren Sie Ihren Hosting-Anbieter." msgid "Failed to CREATE a test table on your database server with the command %query. The server reports the following message: %error.

Are you sure the configured username has the necessary permissions to create tables in the database?

" msgstr "CREATE ein Test-Tabelle auf Ihrem Datenbankserver mit dem Befehl %query fehlgeschlagen." diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php --- a/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php Thu May 09 15:33:08 2019 +0100 @@ -73,7 +73,7 @@ $this->assertUrl('user/1'); $this->assertResponse(200); // Confirm that we are logged-in after installation. - $this->assertText($this->rootUser->getUsername()); + $this->assertText($this->rootUser->getAccountName()); // Confirm that Drupal recognizes this distribution as the current profile. $this->assertEqual(\Drupal::installProfile(), 'distribution_one'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php --- a/core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php Thu May 09 15:33:08 2019 +0100 @@ -54,7 +54,7 @@ $this->assertUrl('user/1'); $this->assertResponse(200); // Confirm that we are logged-in after installation. - $this->assertText($this->rootUser->getUsername()); + $this->assertText($this->rootUser->getAccountName()); // Confirm that the minimal profile was installed. $this->assertEqual(drupal_get_profile(), 'minimal'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php --- a/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php Thu May 09 15:33:08 2019 +0100 @@ -50,8 +50,10 @@ */ public function testStandardConfig() { $skipped_config = []; - // FunctionalTestSetupTrait::installParameters() uses - // simpletest@example.com as mail address. + // FunctionalTestSetupTrait::installParameters() uses Drupal as site name + // and simpletest@example.com as mail address. + $skipped_config['system.site'][] = 'name: Drupal'; + $skipped_config['system.site'][] = 'mail: simpletest@example.com'; $skipped_config['contact.form.feedback'][] = '- simpletest@example.com'; // \Drupal\filter\Entity\FilterFormat::toArray() drops the roles of filter // formats. @@ -61,6 +63,8 @@ $skipped_config['filter.format.full_html'][] = '- administrator'; $skipped_config['filter.format.restricted_html'][] = 'roles:'; $skipped_config['filter.format.restricted_html'][] = '- anonymous'; + // The site UUID is set dynamically for each installation. + $skipped_config['system.site'][] = 'uuid: ' . $this->config('system.site')->get('uuid'); $this->assertInstalledConfig($skipped_config); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,38 @@ +assertTrue( + \Drupal::moduleHandler()->moduleExists('update') && \Drupal::moduleHandler()->moduleExists('file') && \Drupal::moduleHandler()->moduleExists('field'), + 'The Update module and its dependencies are installed.' + ); + } + + /** + * {@inheritdoc} + */ + protected function installParameters() { + $params = parent::installParameters(); + $params['forms']['install_configure_form']['enable_update_status_module'] = TRUE; + return $params; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/MailCaptureTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/MailCaptureTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,83 @@ +randomString(64); + $body = $this->randomString(128); + $message = [ + 'id' => 'drupal_mail_test', + 'headers' => ['Content-type' => 'text/html'], + 'subject' => $subject, + 'to' => 'foobar@example.com', + 'body' => $body, + ]; + + // Before we send the email, drupalGetMails should return an empty array. + $captured_emails = $this->drupalGetMails(); + $this->assertEqual(count($captured_emails), 0, 'The captured emails queue is empty.', 'Email'); + + // Send the email. + \Drupal::service('plugin.manager.mail')->getInstance(['module' => 'simpletest', 'key' => 'drupal_mail_test'])->mail($message); + + // Ensure that there is one email in the captured emails array. + $captured_emails = $this->drupalGetMails(); + $this->assertEqual(count($captured_emails), 1, 'One email was captured.', 'Email'); + + // Assert that the email was sent by iterating over the message properties + // and ensuring that they are captured intact. + foreach ($message as $field => $value) { + $this->assertMail($field, $value, format_string('The email was sent and the value for property @field is intact.', ['@field' => $field]), 'Email'); + } + + // Send additional emails so more than one email is captured. + for ($index = 0; $index < 5; $index++) { + $message = [ + 'id' => 'drupal_mail_test_' . $index, + 'headers' => ['Content-type' => 'text/html'], + 'subject' => $this->randomString(64), + 'to' => $this->randomMachineName(32) . '@example.com', + 'body' => $this->randomString(512), + ]; + \Drupal::service('plugin.manager.mail')->getInstance(['module' => 'drupal_mail_test', 'key' => $index])->mail($message); + } + + // There should now be 6 emails captured. + $captured_emails = $this->drupalGetMails(); + $this->assertEqual(count($captured_emails), 6, 'All emails were captured.', 'Email'); + + // Test different ways of getting filtered emails via drupalGetMails(). + $captured_emails = $this->drupalGetMails(['id' => 'drupal_mail_test']); + $this->assertEqual(count($captured_emails), 1, 'Only one email is returned when filtering by id.', 'Email'); + $captured_emails = $this->drupalGetMails(['id' => 'drupal_mail_test', 'subject' => $subject]); + $this->assertEqual(count($captured_emails), 1, 'Only one email is returned when filtering by id and subject.', 'Email'); + $captured_emails = $this->drupalGetMails(['id' => 'drupal_mail_test', 'subject' => $subject, 'from' => 'this_was_not_used@example.com']); + $this->assertEqual(count($captured_emails), 0, 'No emails are returned when querying with an unused from address.', 'Email'); + + // Send the last email again, so we can confirm that the + // drupalGetMails-filter correctly returns all emails with a given + // property/value. + \Drupal::service('plugin.manager.mail')->getInstance(['module' => 'drupal_mail_test', 'key' => $index])->mail($message); + $captured_emails = $this->drupalGetMails(['id' => 'drupal_mail_test_4']); + $this->assertEqual(count($captured_emails), 2, 'All emails with the same id are returned when filtering by id.', 'Email'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php --- a/core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php Thu May 09 15:33:08 2019 +0100 @@ -18,10 +18,16 @@ $this->drupalGet('/default_format_test/human'); $this->assertSame('format:html', $this->getSession()->getPage()->getContent()); $this->assertSame('MISS', $this->drupalGetHeader('X-Drupal-Cache')); + $this->drupalGet('/default_format_test/human'); + $this->assertSame('format:html', $this->getSession()->getPage()->getContent()); + $this->assertSame('HIT', $this->drupalGetHeader('X-Drupal-Cache')); $this->drupalGet('/default_format_test/machine'); $this->assertSame('format:json', $this->getSession()->getPage()->getContent()); $this->assertSame('MISS', $this->drupalGetHeader('X-Drupal-Cache')); + $this->drupalGet('/default_format_test/machine'); + $this->assertSame('format:json', $this->getSession()->getPage()->getContent()); + $this->assertSame('HIT', $this->drupalGetHeader('X-Drupal-Cache')); } public function testMultipleRoutesWithSameSingleFormat() { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php --- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -10,6 +10,7 @@ use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Language\Language; use Drupal\Core\Url; +use Drupal\Tests\RequirementsPageTrait; use Drupal\user\Entity\User; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpFoundation\Request; @@ -42,6 +43,7 @@ abstract class UpdatePathTestBase extends BrowserTestBase { use SchemaCheckTestTrait; + use RequirementsPageTrait; /** * Modules to enable after the database is loaded. @@ -160,8 +162,10 @@ // Set the update url. This must be set here rather than in // self::__construct() or the old URL generator will leak additional test - // sites. - $this->updateUrl = Url::fromRoute('system.db_update'); + // sites. Additionally, we need to prevent the path alias processor from + // running because we might not have a working alias system before running + // the updates. + $this->updateUrl = Url::fromRoute('system.db_update', [], ['path_processing' => FALSE]); $this->setupBaseUrl(); @@ -264,6 +268,12 @@ 'required' => TRUE, ]; + // Force every update hook to only run one entity per batch. + $settings['entity_update_batch_size'] = (object) [ + 'value' => 1, + 'required' => TRUE, + ]; + $this->writeSettings($settings); } @@ -287,6 +297,7 @@ ]); $this->drupalGet($this->updateUrl); + $this->updateRequirementsProblem(); $this->clickLink(t('Continue')); $this->doSelectionTest(); @@ -319,9 +330,38 @@ } } } - // Reset the static cache of drupal_get_installed_schema_version() so that - // more complex update path testing works. - drupal_static_reset('drupal_get_installed_schema_version'); + + // Ensure that the container is updated if any modules are installed or + // uninstalled during the update. + /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */ + $module_handler = $this->container->get('module_handler'); + $config_module_list = $this->config('core.extension')->get('module'); + $module_handler_list = $module_handler->getModuleList(); + $modules_installed = FALSE; + // Modules that are in configuration but not the module handler have been + // installed. + foreach (array_keys(array_diff_key($config_module_list, $module_handler_list)) as $module) { + $module_handler->addModule($module, drupal_get_path('module', $module)); + $modules_installed = TRUE; + } + $modules_uninstalled = FALSE; + $module_handler_list = $module_handler->getModuleList(); + // Modules that are in the module handler but not configuration have been + // uninstalled. + foreach (array_keys(array_diff_key($module_handler_list, $config_module_list)) as $module) { + $modules_uninstalled = TRUE; + unset($module_handler_list[$module]); + } + if ($modules_installed || $modules_uninstalled) { + // Note that resetAll() does not reset the kernel module list so we + // have to do that manually. + $this->kernel->updateModules($module_handler_list, $module_handler_list); + } + + // If we have successfully clicked 'Apply pending updates' then we need to + // clear the caches in the update test runner as this has occurred as part + // of the updates. + $this->resetAll(); // The config schema can be incorrect while the update functions are being // executed. But once the update has been completed, it needs to be valid @@ -329,7 +369,6 @@ $names = $this->container->get('config.storage')->listAll(); /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */ $typed_config = $this->container->get('config.typed'); - $typed_config->clearCachedDefinitions(); foreach ($names as $name) { $config = $this->config($name); $this->assertConfigSchema($typed_config, $name, $config->get()); @@ -385,7 +424,7 @@ $account = User::load(1); $account->setPassword($this->rootUser->pass_raw); $account->setEmail($this->rootUser->getEmail()); - $account->setUsername($this->rootUser->getUsername()); + $account->setUsername($this->rootUser->getAccountName()); $account->save(); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php --- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,7 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Render\FormattableMarkup; +use Drupal\Core\Database\Database; /** * Tests the update path base class. @@ -32,6 +33,9 @@ * Tests that the database was properly loaded. */ public function testDatabaseLoaded() { + // Set a value in the cache to prove caches are cleared. + \Drupal::service('cache.default')->set(__CLASS__, 'Test'); + foreach (['user', 'node', 'system', 'update_test_schema'] as $module) { $this->assertEqual(drupal_get_installed_schema_version($module), 8000, new FormattableMarkup('Module @module schema is 8000', ['@module' => $module])); } @@ -69,17 +73,21 @@ $this->assertEqual('on', $database->query("SHOW standard_conforming_strings")->fetchField()); $this->assertEqual('escape', $database->query("SHOW bytea_output")->fetchField()); } + // Ensure the test runners cache has been cleared. + $this->assertFalse(\Drupal::service('cache.default')->get(__CLASS__)); } /** * Test that updates are properly run. */ public function testUpdateHookN() { + $connection = Database::getConnection(); + // Increment the schema version. \Drupal::state()->set('update_test_schema_version', 8001); $this->runUpdates(); - $select = \Drupal::database()->select('watchdog'); + $select = $connection->select('watchdog'); $select->orderBy('wid', 'DESC'); $select->range(0, 5); $select->fields('watchdog', ['message']); @@ -92,7 +100,86 @@ // Ensure schema has changed. $this->assertEqual(drupal_get_installed_schema_version('update_test_schema', TRUE), 8001); // Ensure the index was added for column a. - $this->assertTrue(db_index_exists('update_test_schema_table', 'test'), 'Version 8001 of the update_test_schema module is installed.'); + $this->assertTrue($connection->schema()->indexExists('update_test_schema_table', 'test'), 'Version 8001 of the update_test_schema module is installed.'); + } + + /** + * Tests that path aliases are not processed during database updates. + */ + public function testPathAliasProcessing() { + // Add a path alias for the '/admin' system path. + $database = \Drupal::database(); + $database->insert('url_alias') + ->fields(['source', 'alias', 'langcode']) + ->values([ + 'source' => '/admin/structure', + 'alias' => '/admin-structure-alias', + 'langcode' => 'und', + ]) + ->execute(); + + // Increment the schema version. + \Drupal::state()->set('update_test_schema_version', 8002); + $this->runUpdates(); + + // Check that the alias defined earlier is not used during the update + // process. + $this->assertSession()->linkByHrefExists('/admin/structure'); + $this->assertSession()->linkByHrefNotExists('/admin-structure-alias'); + + $account = $this->createUser(['administer site configuration', 'access administration pages', 'access site reports']); + $this->drupalLogin($account); + + // Go to the status report page and check that the alias is used. + $this->drupalGet('admin/reports/status'); + $this->assertSession()->linkByHrefNotExists('/admin/structure'); + $this->assertSession()->linkByHrefExists('/admin-structure-alias'); + } + + /** + * Tests that test running environment is updated when module list changes. + * + * @see update_test_schema_update_8003() + */ + public function testModuleListChange() { + // Set a value in the cache to prove caches are cleared. + \Drupal::service('cache.default')->set(__CLASS__, 'Test'); + + // Ensure that modules are installed and uninstalled as expected prior to + // running updates. + $extension_config = $this->config('core.extension')->get(); + $this->assertArrayHasKey('page_cache', $extension_config['module']); + $this->assertArrayNotHasKey('module_test', $extension_config['module']); + + $module_list = \Drupal::moduleHandler()->getModuleList(); + $this->assertArrayHasKey('page_cache', $module_list); + $this->assertArrayNotHasKey('module_test', $module_list); + + $namespaces = \Drupal::getContainer()->getParameter('container.namespaces'); + $this->assertArrayHasKey('Drupal\page_cache', $namespaces); + $this->assertArrayNotHasKey('Drupal\module_test', $namespaces); + + // Increment the schema version so that update_test_schema_update_8003() + // runs. + \Drupal::state()->set('update_test_schema_version', 8003); + $this->runUpdates(); + + // Ensure that test running environment has been updated with the changes to + // the module list. + $extension_config = $this->config('core.extension')->get(); + $this->assertArrayNotHasKey('page_cache', $extension_config['module']); + $this->assertArrayHasKey('module_test', $extension_config['module']); + + $module_list = \Drupal::moduleHandler()->getModuleList(); + $this->assertArrayNotHasKey('page_cache', $module_list); + $this->assertArrayHasKey('module_test', $module_list); + + $namespaces = \Drupal::getContainer()->getParameter('container.namespaces'); + $this->assertArrayNotHasKey('Drupal\page_cache', $namespaces); + $this->assertArrayHasKey('Drupal\module_test', $namespaces); + + // Ensure the test runners cache has been cleared. + $this->assertFalse(\Drupal::service('cache.default')->get(__CLASS__)); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/FunctionalTests/UserHelpersTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/UserHelpersTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,52 @@ +drupalCreateUser(); + $second_user = $this->drupalCreateUser(); + + // After logging in, the first user should be logged in, the second not. + $this->drupalLogin($first_user); + $this->assertTrue($this->drupalUserIsLoggedIn($first_user)); + $this->assertFalse($this->drupalUserIsLoggedIn($second_user)); + + // Verify that logged in state is retained across pages. + $this->drupalGet(''); + $this->assertTrue($this->drupalUserIsLoggedIn($first_user)); + $this->assertFalse($this->drupalUserIsLoggedIn($second_user)); + + // After logging out, both users should be logged out. + $this->drupalLogout(); + $this->assertFalse($this->drupalUserIsLoggedIn($first_user)); + $this->assertFalse($this->drupalUserIsLoggedIn($second_user)); + + // After logging back in, the second user should still be logged out. + $this->drupalLogin($first_user); + $this->assertTrue($this->drupalUserIsLoggedIn($first_user)); + $this->assertFalse($this->drupalUserIsLoggedIn($second_user)); + + // After logging in the second user, the first one should be logged out. + $this->drupalLogin($second_user); + $this->assertTrue($this->drupalUserIsLoggedIn($second_user)); + $this->assertFalse($this->drupalUserIsLoggedIn($first_user)); + + // After logging out, both should be logged out. + $this->drupalLogout(); + $this->assertFalse($this->drupalUserIsLoggedIn($first_user)); + $this->assertFalse($this->drupalUserIsLoggedIn($second_user)); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/AssertLegacyTrait.php --- a/core/tests/Drupal/KernelTests/AssertLegacyTrait.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/AssertLegacyTrait.php Thu May 09 15:33:08 2019 +0100 @@ -8,15 +8,19 @@ * Protected methods are custom. Public static methods override methods of * \PHPUnit\Framework\Assert. * - * @deprecated Scheduled for removal in Drupal 9.0.0. Use PHPUnit's native + * Deprecated Scheduled for removal in Drupal 10.0.0. Use PHPUnit's native * assert methods instead. + * + * @todo https://www.drupal.org/project/drupal/issues/3031580 Note that + * deprecations in this file do not use the @ symbol in Drupal 8 because this + * will be removed in Drupal 10.0.0. */ trait AssertLegacyTrait { /** * @see \Drupal\simpletest\TestBase::assert() * - * @deprecated Scheduled for removal in Drupal 9.0.0. Use self::assertTrue() + * Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertTrue() * instead. */ protected function assert($actual, $message = '') { @@ -50,7 +54,7 @@ /** * @see \Drupal\simpletest\TestBase::assertEqual() * - * @deprecated Scheduled for removal in Drupal 9.0.0. Use self::assertEquals() + * Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertEquals() * instead. */ protected function assertEqual($actual, $expected, $message = '') { @@ -60,7 +64,7 @@ /** * @see \Drupal\simpletest\TestBase::assertNotEqual() * - * @deprecated Scheduled for removal in Drupal 9.0.0. Use + * Deprecated Scheduled for removal in Drupal 10.0.0. Use * self::assertNotEquals() instead. */ protected function assertNotEqual($actual, $expected, $message = '') { @@ -70,7 +74,7 @@ /** * @see \Drupal\simpletest\TestBase::assertIdentical() * - * @deprecated Scheduled for removal in Drupal 9.0.0. Use self::assertSame() + * Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertSame() * instead. */ protected function assertIdentical($actual, $expected, $message = '') { @@ -80,7 +84,7 @@ /** * @see \Drupal\simpletest\TestBase::assertNotIdentical() * - * @deprecated Scheduled for removal in Drupal 9.0.0. Use + * Deprecated Scheduled for removal in Drupal 10.0.0. Use * self::assertNotSame() instead. */ protected function assertNotIdentical($actual, $expected, $message = '') { @@ -90,7 +94,7 @@ /** * @see \Drupal\simpletest\TestBase::assertIdenticalObject() * - * @deprecated Scheduled for removal in Drupal 9.0.0. Use self::assertEquals() + * Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertEquals() * instead. */ protected function assertIdenticalObject($actual, $expected, $message = '') { @@ -103,7 +107,7 @@ /** * @see \Drupal\simpletest\TestBase::pass() * - * @deprecated Scheduled for removal in Drupal 9.0.0. Use self::assertTrue() + * Deprecated Scheduled for removal in Drupal 10.0.0. Use self::assertTrue() * instead. */ protected function pass($message) { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php --- a/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php Thu May 09 15:33:08 2019 +0100 @@ -45,22 +45,6 @@ ]; /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // @todo ModuleInstaller calls system_rebuild_module_data which is part of - // system.module, see https://www.drupal.org/node/2208429. - include_once $this->root . '/core/modules/system/system.module'; - - // Set up the state values so we know where to find the files when running - // drupal_get_filename(). - // @todo Remove as part of https://www.drupal.org/node/2186491 - system_rebuild_module_data(); - } - - /** * Tests if installed config is equal to the exported config. * * @dataProvider coreModuleListDataProvider @@ -126,7 +110,7 @@ // recalculation of dependencies does not cause config change. if ($entity_type = $config_manager->getEntityTypeIdByName($config_name)) { $entity_storage = $config_manager - ->getEntityManager() + ->getEntityTypeManager() ->getStorage($entity_type); $id = $entity_storage->getIDFromConfigName($config_name, $entity_storage->getEntityType() ->getConfigPrefix()); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,65 @@ +installEntitySchema('user'); + $this->installSchema('dblog', ['watchdog']); + } + + /** + * Test the email action plugin. + */ + public function testEmailAction() { + /** @var \Drupal\Core\Action\ActionManager $plugin_manager */ + $plugin_manager = $this->container->get('plugin.manager.action'); + $configuration = [ + 'recipient' => 'test@example.com', + 'subject' => 'Test subject', + 'message' => 'Test message', + ]; + $plugin_manager + ->createInstance('action_send_email_action', $configuration) + ->execute(); + + $mails = $this->getMails(); + $this->assertCount(1, $this->getMails()); + $this->assertEquals('test@example.com', $mails[0]['to']); + $this->assertEquals('Test subject', $mails[0]['subject']); + $this->assertEquals("Test message\n", $mails[0]['body']); + + // Ensure that the email sending is logged. + $log = \Drupal::database() + ->select('watchdog', 'w') + ->fields('w', ['message', 'variables']) + ->orderBy('wid', 'DESC') + ->range(0, 1) + ->execute() + ->fetch(); + + $this->assertEquals($log->message, 'Sent email to %recipient'); + $variables = unserialize($log->variables); + $this->assertEquals($variables['%recipient'], 'test@example.com'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php --- a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php Thu May 09 15:33:08 2019 +0100 @@ -89,7 +89,7 @@ $rendered_css = $this->renderer->renderPlain($css_render_array); $rendered_js = $this->renderer->renderPlain($js_render_array); $query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0'; - $this->assertNotIdentical(strpos($rendered_css, ''), FALSE, 'Rendering an external CSS file.'); + $this->assertNotIdentical(strpos($rendered_css, ''), FALSE, 'Rendering an external CSS file.'); $this->assertNotIdentical(strpos($rendered_js, ''), FALSE, 'Rendering an external JavaScript file.'); } @@ -128,7 +128,7 @@ $js_render_array = \Drupal::service('asset.js.collection_renderer')->render($js); $rendered_css = $this->renderer->renderPlain($css_render_array); $rendered_js = $this->renderer->renderPlain($js_render_array); - $this->assertNotIdentical(strpos($rendered_css, ''), FALSE, 'Rendering an external CSS file.'); + $this->assertNotIdentical(strpos($rendered_css, ''), FALSE, 'Rendering an external CSS file.'); $this->assertNotIdentical(strpos($rendered_js, ''), FALSE, 'Rendering an external JavaScript file.'); } @@ -473,7 +473,7 @@ $js_render_array = \Drupal::service('asset.js.collection_renderer')->render($js); $rendered_js = $this->renderer->renderPlain($js_render_array); $query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0'; - $this->assertNotIdentical(strpos($rendered_css, ''), FALSE, 'CSS file with query string gets version query string correctly appended..'); + $this->assertNotIdentical(strpos($rendered_css, ''), FALSE, 'CSS file with query string gets version query string correctly appended..'); $this->assertNotIdentical(strpos($rendered_js, ''), FALSE, 'JavaScript file with query string gets version query string correctly appended.'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php --- a/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php Thu May 09 15:33:08 2019 +0100 @@ -86,7 +86,7 @@ /** * {@inheritdoc} */ - public static $modules = ['system']; + public static $modules = ['system', 'user']; /** * {@inheritdoc} @@ -108,12 +108,22 @@ } return TRUE; }); + + // Install the 'user' entity schema because the workspaces module's install + // hook creates a workspace with default uid of 1. Then the layout_builder + // module's implementation of hook_entity_presave will cause + // \Drupal\Core\TypedData\Validation\RecursiveValidator::validate() to run + // on the workspace which will fail because the user table is not present. + // @todo Remove this in https://www.drupal.org/node/3039217. + $this->installEntitySchema('user'); + // Remove demo_umami_content module as its install hook creates content // that relies on the presence of entity tables and various other elements // not present in a kernel test. unset($all_modules['demo_umami_content']); $this->allModules = array_keys($all_modules); $this->allModules[] = 'system'; + $this->allModules[] = 'user'; sort($this->allModules); $this->container->get('module_installer')->install($this->allModules); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php --- a/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,7 +3,7 @@ namespace Drupal\KernelTests\Core\Cache; use Drupal\KernelTests\KernelTestBase; -use Drupal\simpletest\UserCreationTrait; +use Drupal\Tests\user\Traits\UserCreationTrait; use Drupal\user\Entity\Role; /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php --- a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,7 @@ namespace Drupal\KernelTests\Core\Cache; use Drupal\Core\Cache\Cache; +use Drupal\Core\Database\Database; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\KernelTests\KernelTestBase; use Symfony\Component\DependencyInjection\Reference; @@ -43,7 +44,8 @@ $this->assertTrue($bin->get('test'), 'Cache item was set in bin.'); } - $invalidations_before = intval(db_select('cachetags')->fields('cachetags', ['invalidations'])->condition('tag', 'test_tag:2')->execute()->fetchField()); + $connection = Database::getConnection(); + $invalidations_before = intval($connection->select('cachetags')->fields('cachetags', ['invalidations'])->condition('tag', 'test_tag:2')->execute()->fetchField()); Cache::invalidateTags(['test_tag:2']); // Test that cache entry has been invalidated in multiple bins. @@ -53,7 +55,7 @@ } // Test that only one tag invalidation has occurred. - $invalidations_after = intval(db_select('cachetags')->fields('cachetags', ['invalidations'])->condition('tag', 'test_tag:2')->execute()->fetchField()); + $invalidations_after = intval($connection->select('cachetags')->fields('cachetags', ['invalidations'])->condition('tag', 'test_tag:2')->execute()->fetchField()); $this->assertEqual($invalidations_after, $invalidations_before + 1, 'Only one addition cache tag invalidation has occurred after invalidating a tag used in multiple bins.'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php --- a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php Thu May 09 15:33:08 2019 +0100 @@ -130,6 +130,8 @@ 'key_value_expire', 'menu_link_content', 'menu_link_content_data', + 'menu_link_content_revision', + 'menu_link_content_field_revision', 'sequences', 'sessions', 'url_alias', diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Common/DrupalCheckIncompatibilityTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Common/DrupalCheckIncompatibilityTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,47 @@ +assertSame($result, drupal_check_incompatibility($version_info, $version_to_check)); + } + + /** + * Data provider for testDrupalCheckIncompatibility. + */ + public function providerDrupalCheckIncompatibility() { + $module_data = [ + 'name' => 'views_ui', + 'original_version' => ' (8.x-1.0)', + 'versions' => [['op' => '=', 'version' => '1.0']], + ]; + + $data = []; + $data['is compatible'] = [$module_data, '1.0', NULL]; + $data['not compatible'] = [$module_data, '1.1', ' (8.x-1.0)']; + // Prove that the BC layer using ArrayAccess works with + // drupal_check_incompatibility(). + $dependency = new Dependency('views', 'drupal', '8.x-1.2'); + $data['dependency object'] = [$dependency, '1.1', ' (8.x-1.2)']; + return $data; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Common/LegacyFunctionsTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Common/LegacyFunctionsTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,33 @@ +format() instead. See https://www.drupal.org/node/1876852 + */ + public function testFormatDate() { + // Provide arguments otherwise the system module configuration is required. + $date = format_date(0, 'custom', 'Y-m-d'); + $this->assertEquals('1970-01-01', $date); + } + + /** + * @expectedDeprecation drupal_set_time_limit() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Environment::setTimeLimit() instead. See https://www.drupal.org/node/3000058. + */ + public function testDrupalSetTimeLimit() { + drupal_set_time_limit(1000); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php --- a/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -48,10 +48,21 @@ $url = 'javascript:http://www.example.com/?x=1&y=2'; $expected_plain = 'http://www.example.com/?x=1&y=2'; $expected_html = 'http://www.example.com/?x=1&y=2'; - $this->assertIdentical(check_url($url), $expected_html, 'check_url() filters a URL and encodes it for HTML.'); $this->assertIdentical(UrlHelper::filterBadProtocol($url), $expected_html, '\Drupal\Component\Utility\UrlHelper::filterBadProtocol() filters a URL and encodes it for HTML.'); $this->assertIdentical(UrlHelper::stripDangerousProtocols($url), $expected_plain, '\Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() filters a URL and returns plain text.'); } + /** + * Tests deprecation of the check_url() function. + * + * @group legacy + * @expectedDeprecation check_url() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use UrlHelper::stripDangerousProtocols() or UrlHelper::filterBadProtocol() instead. See https://www.drupal.org/node/2560027 + */ + public function testCheckUrl() { + $url = 'javascript:http://www.example.com/?x=1&y=2'; + $expected_html = 'http://www.example.com/?x=1&y=2'; + $this->assertSame($expected_html, check_url($url)); + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php Thu May 09 15:33:08 2019 +0100 @@ -117,7 +117,7 @@ 'type' => 'entity_test', ]); $entity_test->save(); - $entity2->setEnforcedDependencies(['config' => [$entity1->getConfigDependencyName()], 'content' => [$entity_test->getConfigDependencyName()]])->save();; + $entity2->setEnforcedDependencies(['config' => [$entity1->getConfigDependencyName()], 'content' => [$entity_test->getConfigDependencyName()]])->save(); $dependents = $config_manager->findConfigEntityDependents('content', [$entity_test->getConfigDependencyName()]); $this->assertFalse(isset($dependents['config_test.dynamic.entity1']), 'config_test.dynamic.entity1 does not have a dependency on the content entity.'); $this->assertTrue(isset($dependents['config_test.dynamic.entity2']), 'config_test.dynamic.entity2 has a dependency on the content entity.'); @@ -175,7 +175,7 @@ // Add a fake missing dependency to ensure multiple missing dependencies // work. - $entity1->setEnforcedDependencies(['content' => [$entity_test->getConfigDependencyName(), 'entity_test:bundle:uuid']])->save();; + $entity1->setEnforcedDependencies(['content' => [$entity_test->getConfigDependencyName(), 'entity_test:bundle:uuid']])->save(); $expected['uuid'] = [ 'entity_type' => 'entity_test', 'bundle' => 'bundle', diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php Thu May 09 15:33:08 2019 +0100 @@ -35,8 +35,7 @@ ] + $config->getRawData(); $config->setData($data)->save(); $this->assertNotIdentical($config_entity->toArray(), $config->getRawData(), 'Stored config entity is not is equivalent to config schema.'); - - $config_entity = entity_load('config_test', 'system', TRUE); + $config_entity = \Drupal::entityTypeManager()->getStorage('config_test')->load('system'); $config_entity->save(); $config = $this->config('config_test.dynamic.system'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php Thu May 09 15:33:08 2019 +0100 @@ -35,7 +35,7 @@ $entity->enable()->save(); $this->assertTrue($entity->status(), 'Entity is enabled after enabling.'); - $entity = entity_load('config_test', $entity->id()); + $entity = \Drupal::entityTypeManager()->getStorage('config_test')->load($entity->id()); $this->assertTrue($entity->status(), 'Status is enabled after reload.'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -47,7 +47,7 @@ } // Ensure that the config entity was not corrupted. - $entity = entity_load('config_test', $entity->id(), TRUE); + $entity = $storage->loadUnchanged($entity->id()); $this->assertIdentical($entity->toArray(), $original_properties); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -73,7 +73,7 @@ $entity->save(); // Ensure that the configuration entity can be loaded by UUID. - $entity_loaded_by_uuid = \Drupal::entityManager()->loadEntityByUuid($entity_type->id(), $entity->uuid()); + $entity_loaded_by_uuid = \Drupal::service('entity.repository')->loadEntityByUuid($entity_type->id(), $entity->uuid()); if (!$entity_loaded_by_uuid) { $this->fail(sprintf("Failed to load '%s' entity ID '%s' by UUID '%s'.", $entity_type->id(), $entity->id(), $entity->uuid())); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php Thu May 09 15:33:08 2019 +0100 @@ -39,8 +39,7 @@ // Set up the ConfigImporter object for testing. $storage_comparer = new StorageComparer( $this->container->get('config.storage.sync'), - $this->container->get('config.storage'), - $this->container->get('config.manager') + $this->container->get('config.storage') ); $this->configImporter = new ConfigImporter( $storage_comparer->createChangelist(), diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php Thu May 09 15:33:08 2019 +0100 @@ -44,8 +44,7 @@ // Set up the ConfigImporter object for testing. $storage_comparer = new StorageComparer( $this->container->get('config.storage.sync'), - $this->container->get('config.storage'), - $this->container->get('config.manager') + $this->container->get('config.storage') ); $this->configImporter = new ConfigImporter( $storage_comparer->createChangelist(), diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php Thu May 09 15:33:08 2019 +0100 @@ -44,8 +44,7 @@ // Set up the ConfigImporter object for testing. $storage_comparer = new StorageComparer( $this->container->get('config.storage.sync'), - $this->container->get('config.storage'), - $this->container->get('config.manager') + $this->container->get('config.storage') ); $this->configImporter = new ConfigImporter( $storage_comparer->createChangelist(), diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php Thu May 09 15:33:08 2019 +0100 @@ -49,8 +49,7 @@ // Set up the ConfigImporter object for testing. $storage_comparer = new StorageComparer( $this->container->get('config.storage.sync'), - $this->container->get('config.storage'), - $this->container->get('config.manager') + $this->container->get('config.storage') ); $this->configImporter = new ConfigImporter( $storage_comparer->createChangelist(), diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php Thu May 09 15:33:08 2019 +0100 @@ -38,13 +38,12 @@ $active = $this->container->get('config.storage'); $sync = $this->container->get('config.storage.sync'); $snapshot = $this->container->get('config.storage.snapshot'); - $config_manager = $this->container->get('config.manager'); $config_name = 'config_test.system'; $config_key = 'foo'; $new_data = 'foobar'; - $active_snapshot_comparer = new StorageComparer($active, $snapshot, $config_manager); - $sync_snapshot_comparer = new StorageComparer($sync, $snapshot, $config_manager); + $active_snapshot_comparer = new StorageComparer($active, $snapshot); + $sync_snapshot_comparer = new StorageComparer($sync, $snapshot); // Verify that we have an initial snapshot that matches the active // configuration. This has to be true as no config should be installed. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php --- a/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -95,28 +95,22 @@ $this->storage->write($name, $data); } + // Test that deleting a prefix that returns no configuration returns FALSE + // because nothing is deleted. + $this->assertFalse($this->storage->deleteAll('some_thing_that_cannot_exist')); + $result = $this->storage->deleteAll('config_test.'); $names = $this->storage->listAll('config_test.'); $this->assertIdentical($result, TRUE); $this->assertIdentical($names, []); - // Test renaming an object that does not exist throws an exception. - try { - $this->storage->rename('config_test.storage_does_not_exist', 'config_test.storage_does_not_exist_rename'); - } - catch (\Exception $e) { - $class = get_class($e); - $this->pass($class . ' thrown upon renaming a nonexistent storage bin.'); - } + // Test renaming an object that does not exist returns FALSE. + $this->assertFalse($this->storage->rename('config_test.storage_does_not_exist', 'config_test.storage_does_not_exist_rename')); - // Test renaming to an object that already exists throws an exception. - try { - $this->storage->rename('system.cron', 'system.performance'); - } - catch (\Exception $e) { - $class = get_class($e); - $this->pass($class . ' thrown upon renaming a nonexistent storage bin.'); - } + // Test renaming to an object that already returns FALSE. + $data = ['foo' => 'bar']; + $this->assertTrue($this->storage->write($name, $data)); + $this->assertFalse($this->storage->rename('config_test.storage_does_not_exist', $name)); } /** @@ -200,6 +194,10 @@ $new_storage = $this->storage->createCollection('collection.sub.new'); $this->assertFalse($new_storage->exists($name)); $this->assertEqual([], $new_storage->listAll()); + $this->assertFalse($new_storage->delete($name)); + $this->assertFalse($new_storage->deleteAll('config_test.')); + $this->assertFalse($new_storage->deleteAll()); + $this->assertFalse($new_storage->rename($name, 'config_test.another_name')); $new_storage->write($name, $data); $this->assertIdentical($result, TRUE); $this->assertSame($data, $new_storage->read($name)); @@ -252,6 +250,14 @@ $parent_storage->deleteAll(); $this->assertSame(['collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); + // Test operations on a collection emptied through deletion. + $this->assertFalse($parent_storage->exists($name)); + $this->assertEqual([], $parent_storage->listAll()); + $this->assertFalse($parent_storage->delete($name)); + $this->assertFalse($parent_storage->deleteAll('config_test.')); + $this->assertFalse($parent_storage->deleteAll()); + $this->assertFalse($parent_storage->rename($name, 'config_test.another_name')); + // Check that the having an empty collection-less storage does not break // anything. Before deleting check that the previous delete did not affect // data in another collection. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,7 @@ namespace Drupal\KernelTests\Core\Config\Storage; use Drupal\Core\Config\DatabaseStorage; +use Drupal\Core\Database\Database; /** * Tests DatabaseStorage operations. @@ -30,15 +31,15 @@ } protected function insert($name, $data) { - db_insert('config')->fields(['name' => $name, 'data' => $data])->execute(); + Database::getConnection()->insert('config')->fields(['name' => $name, 'data' => $data])->execute(); } protected function update($name, $data) { - db_update('config')->fields(['data' => $data])->condition('name', $name)->execute(); + Database::getConnection()->update('config')->fields(['data' => $data])->condition('name', $name)->execute(); } protected function delete($name) { - db_delete('config')->condition('name', $name)->execute(); + Database::getConnection()->delete('config')->condition('name', $name)->execute(); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,59 @@ +storage = new MemoryStorage(); + // ::listAll() verifications require other configuration data to exist. + $this->storage->write('system.performance', []); + } + + /** + * {@inheritdoc} + */ + protected function read($name) { + return $this->storage->read($name); + } + + /** + * {@inheritdoc} + */ + protected function insert($name, $data) { + $this->storage->write($name, $data); + } + + /** + * {@inheritdoc} + */ + protected function update($name, $data) { + $this->storage->write($name, $data); + } + + /** + * {@inheritdoc} + */ + protected function delete($name) { + $this->storage->delete($name); + } + + /** + * {@inheritdoc} + */ + public function testInvalidStorage() { + $this->markTestSkipped('MemoryStorage cannot be invalid.'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/AlterTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/AlterTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/AlterTest.php Thu May 09 15:33:08 2019 +0100 @@ -14,7 +14,7 @@ * Tests that we can do basic alters. */ public function testSimpleAlter() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); $query->addTag('database_test_alter_add_range'); @@ -28,7 +28,7 @@ * Tests that we can alter the joins on a query. */ public function testAlterWithJoin() { - $query = db_select('test_task'); + $query = $this->connection->select('test_task'); $tid_field = $query->addField('test_task', 'tid'); $task_field = $query->addField('test_task', 'task'); $query->orderBy($task_field); @@ -52,7 +52,7 @@ * Tests that we can alter a query's conditionals. */ public function testAlterChangeConditional() { - $query = db_select('test_task'); + $query = $this->connection->select('test_task'); $tid_field = $query->addField('test_task', 'tid'); $pid_field = $query->addField('test_task', 'pid'); $task_field = $query->addField('test_task', 'task'); @@ -77,7 +77,7 @@ * Tests that we can alter the fields of a query. */ public function testAlterChangeFields() { - $query = db_select('test'); + $query = $this->connection->select('test'); $name_field = $query->addField('test', 'name'); $age_field = $query->addField('test', 'age', 'age'); $query->orderBy('name'); @@ -92,7 +92,7 @@ * Tests that we can alter expressions in the query. */ public function testAlterExpression() { - $query = db_select('test'); + $query = $this->connection->select('test'); $name_field = $query->addField('test', 'name'); $age_field = $query->addExpression("age*2", 'double_age'); $query->condition('age', 27); @@ -112,7 +112,7 @@ * This also tests hook_query_TAG_alter(). */ public function testAlterRemoveRange() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); $query->range(0, 2); @@ -128,7 +128,7 @@ */ public function testSimpleAlterSubquery() { // Create a sub-query with an alter tag. - $subquery = db_select('test', 'p'); + $subquery = $this->connection->select('test', 'p'); $subquery->addField('p', 'name'); $subquery->addField('p', 'id'); // Pick out George. @@ -138,7 +138,7 @@ $subquery->addTag('database_test_alter_change_expressions'); // Create a main query and join to sub-query. - $query = db_select('test_task', 'tt'); + $query = $this->connection->select('test_task', 'tt'); $query->join($subquery, 'pq', 'pq.id = tt.pid'); $age_field = $query->addField('pq', 'double_age'); $name_field = $query->addField('pq', 'name'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php Thu May 09 15:33:08 2019 +0100 @@ -76,22 +76,22 @@ * Tests escaping of LIKE wildcards. */ public function testLikeEscape() { - db_insert('test') + $this->connection->insert('test') ->fields([ 'name' => 'Ring_', ]) ->execute(); // Match both "Ringo" and "Ring_". - $num_matches = db_select('test', 't') + $num_matches = $this->connection->select('test', 't') ->condition('name', 'Ring_', 'LIKE') ->countQuery() ->execute() ->fetchField(); $this->assertIdentical($num_matches, '2', 'Found 2 records.'); // Match only "Ring_" using a LIKE expression with no wildcards. - $num_matches = db_select('test', 't') - ->condition('name', db_like('Ring_'), 'LIKE') + $num_matches = $this->connection->select('test', 't') + ->condition('name', $this->connection->escapeLike('Ring_'), 'LIKE') ->countQuery() ->execute() ->fetchField(); @@ -102,7 +102,7 @@ * Tests a LIKE query containing a backslash. */ public function testLikeBackslash() { - db_insert('test') + $this->connection->insert('test') ->fields(['name']) ->values([ 'name' => 'abcde\f', @@ -114,15 +114,15 @@ // Match both rows using a LIKE expression with two wildcards and a verbatim // backslash. - $num_matches = db_select('test', 't') + $num_matches = $this->connection->select('test', 't') ->condition('name', 'abc%\\\\_', 'LIKE') ->countQuery() ->execute() ->fetchField(); $this->assertIdentical($num_matches, '2', 'Found 2 records.'); // Match only the former using a LIKE expression with no wildcards. - $num_matches = db_select('test', 't') - ->condition('name', db_like('abc%\_'), 'LIKE') + $num_matches = $this->connection->select('test', 't') + ->condition('name', $this->connection->escapeLike('abc%\_'), 'LIKE') ->countQuery() ->execute() ->fetchField(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,7 @@ public function testCaseSensitiveInsert() { $num_records_before = db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - db_insert('test') + $this->connection->insert('test') ->fields([ // A record already exists with name 'John'. 'name' => 'john', diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,17 @@ namespace Drupal\KernelTests\Core\Database; +use Drupal\Core\Database\Query\Condition; +use Drupal\Core\Database\Query\Delete; +use Drupal\Core\Database\Query\Insert; +use Drupal\Core\Database\Query\Merge; +use Drupal\Core\Database\Query\Select; +use Drupal\Core\Database\Query\Truncate; +use Drupal\Core\Database\Query\Update; +use Drupal\Core\Database\Transaction; +use Drupal\Core\Database\Database; +use Drupal\Core\Database\DatabaseException; + /** * Deprecation tests cases for the database layer. * @@ -10,6 +21,49 @@ class DatabaseLegacyTest extends DatabaseTestBase { /** + * The modules to enable. + * + * @var array + */ + public static $modules = ['database_test', 'system']; + + /** + * Tests deprecation of the db_and() function. + * + * @expectedDeprecation db_and() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an AND conjunction: new Condition('AND'), instead. See https://www.drupal.org/node/2993033. + */ + public function testDbAnd() { + $this->assertInstanceOf(Condition::class, db_and()); + } + + /** + * Tests deprecation of the db_condition() function. + * + * @expectedDeprecation db_condition() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying the desired conjunction: new Condition($conjunction), instead. See https://www.drupal.org/node/2993033. + */ + public function testDbCondition() { + $this->assertInstanceOf(Condition::class, db_condition('AND')); + } + + /** + * Tests deprecation of the db_or() function. + * + * @expectedDeprecation db_or() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an OR conjunction: new Condition('OR'), instead. See https://www.drupal.org/node/2993033. + */ + public function testDbOr() { + $this->assertInstanceOf(Condition::class, db_or()); + } + + /** + * Tests deprecation of the db_xor() function. + * + * @expectedDeprecation db_xor() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying a XOR conjunction: new Condition('XOR'), instead. See https://www.drupal.org/node/2993033. + */ + public function testDbXor() { + $this->assertInstanceOf(Condition::class, db_xor()); + } + + /** * Tests the db_table_exists() function. * * @expectedDeprecation db_table_exists() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use $injected_database->schema()->tableExists($table) instead. See https://www.drupal.org/node/2947929. @@ -19,6 +73,19 @@ } /** + * Tests the db_find_tables() function. + * + * @expectedDeprecation db_find_tables() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use $injected_database->schema()->findTables($table_expression) instead. See https://www.drupal.org/node/2993033 + */ + public function testDbFindTables() { + $expected = [ + 'test_people' => 'test_people', + 'test_people_copy' => 'test_people_copy', + ]; + $this->assertEquals($expected, db_find_tables('test_people%')); + } + + /** * Tests the db_set_active() function. * * @expectedDeprecation db_set_active() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Database\Database::setActiveConnection() instead. See https://www.drupal.org/node/2944084. @@ -37,4 +104,402 @@ $this->assertFalse(db_drop_table('temp_test_table')); } + /** + * Tests deprecation of the db_next_id() function. + * + * @expectedDeprecation db_next_id() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call nextId() on it. For example, $injected_database->nextId($existing_id). See https://www.drupal.org/node/2993033 + */ + public function testDbNextId() { + $this->installSchema('system', 'sequences'); + $this->assertEquals(1001, db_next_id(1000)); + } + + /** + * Tests the db_change_field() function is deprecated. + * + * @expectedDeprecation Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it. For example, $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new). See https://www.drupal.org/node/2993033 + */ + public function testDbChangeField() { + $spec = [ + 'description' => "A new person's name", + 'type' => 'varchar_ascii', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'binary' => TRUE, + ]; + db_change_field('test', 'name', 'nosuchcolumn', $spec); + } + + /** + * Tests deprecation of the db_field_set_default() function. + * + * @expectedDeprecation db_field_set_default() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new). See https://www.drupal.org/node/2993033 + * @expectedDeprecation fieldSetDefault() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Instead, call ::changeField() passing a full field specification. See https://www.drupal.org/node/2999035 + */ + public function testDbFieldSetDefault() { + db_field_set_default('test', 'job', 'baz'); + } + + /** + * Tests deprecation of the db_field_set_no_default() function. + * + * @expectedDeprecation db_field_set_no_default() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new). See https://www.drupal.org/node/2993033 + * @expectedDeprecation fieldSetNoDefault() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Instead, call ::changeField() passing a full field specification. See https://www.drupal.org/node/2999035 + */ + public function testDbFieldSetNoDefault() { + db_field_set_no_default('test_null', 'age'); + } + + /** + * Tests Schema::fieldSetDefault and Schema::fieldSetNoDefault. + * + * @expectedDeprecation fieldSetDefault() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Instead, call ::changeField() passing a full field specification. See https://www.drupal.org/node/2999035 + * @expectedDeprecation fieldSetNoDefault() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Instead, call ::changeField() passing a full field specification. See https://www.drupal.org/node/2999035 + */ + public function testSchemaFieldDefaultChange() { + // Create a table. + $table_specification = [ + 'description' => 'Schema table description.', + 'fields' => [ + 'id' => [ + 'type' => 'int', + 'default' => NULL, + ], + 'test_field' => [ + 'type' => 'int', + 'not null' => TRUE, + 'description' => 'Test field', + ], + ], + ]; + $this->connection->schema()->createTable('test_table', $table_specification); + + // An insert without a value for the column 'test_field' should fail. + try { + $this->connection->insert('test_table')->fields(['id' => 1])->execute(); + $this->fail('Expected DatabaseException, none was thrown.'); + } + catch (DatabaseException $e) { + $this->assertEquals(0, $this->connection->select('test_table')->countQuery()->execute()->fetchField()); + } + + // Add a default value to the column. + $this->connection->schema()->fieldSetDefault('test_table', 'test_field', 0); + + // The insert should now succeed. + $this->connection->insert('test_table')->fields(['id' => 1])->execute(); + $this->assertEquals(1, $this->connection->select('test_table')->countQuery()->execute()->fetchField()); + + // Remove the default. + $this->connection->schema()->fieldSetNoDefault('test_table', 'test_field'); + + // The insert should fail again. + try { + $this->connection->insert('test_table')->fields(['id' => 2])->execute(); + $this->fail('Expected DatabaseException, none was thrown.'); + } + catch (DatabaseException $e) { + $this->assertEquals(1, $this->connection->select('test_table')->countQuery()->execute()->fetchField()); + } + } + + /** + * Tests deprecation of the db_transaction() function. + * + * @expectedDeprecation db_transaction is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call startTransaction() on it. For example, $injected_database->startTransaction($name). See https://www.drupal.org/node/2993033 + */ + public function testDbTransaction() { + $this->assertInstanceOf(Transaction::class, db_transaction()); + } + + /** + * Tests the db_close() function. + * + * @expectedDeprecation db_close() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Database\Database::closeConnection() instead. See https://www.drupal.org/node/2993033. + */ + public function testDbClose() { + $this->assertTrue(Database::isActiveConnection(), 'Database connection is active'); + db_close(); + $this->assertFalse(Database::isActiveConnection(), 'Database connection is not active'); + } + + /** + * Tests deprecation of the db_add_field() function. + * + * @expectedDeprecation db_add_field() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addField() on it. For example, $injected_database->schema()->addField($table, $field, $spec, $keys_new). See https://www.drupal.org/node/2993033 + */ + public function testDbAddField() { + $this->assertFalse($this->connection->schema()->fieldExists('test', 'anint')); + db_add_field('test', 'anint', [ + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Added int column.', + ]); + $this->assertTrue($this->connection->schema()->fieldExists('test', 'anint')); + } + + /** + * Tests deprecation of the db_drop_field() function. + * + * @expectedDeprecation db_drop_field() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropField() on it. For example, $injected_database->schema()->dropField($table, $field). See https://www.drupal.org/node/2993033 + */ + public function testDbDropField() { + $this->assertTrue($this->connection->schema()->fieldExists('test', 'age')); + $this->assertTrue(db_drop_field('test', 'age')); + $this->assertFalse($this->connection->schema()->fieldExists('test', 'age')); + } + + /** + * Tests deprecation of the db_field_exists() function. + * + * @expectedDeprecation db_field_exists() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call fieldExists() on it. For example, $injected_database->schema()->fieldExists($table, $field). See https://www.drupal.org/node/2993033 + */ + public function testDbFieldExists() { + $this->assertTrue(db_field_exists('test', 'age')); + } + + /** + * Tests deprecation of the db_field_names() function. + * + * @expectedDeprecation db_field_names() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call fieldNames() on it. For example, $injected_database->schema()->fieldNames($fields). See https://www.drupal.org/node/2993033 + */ + public function testDbFieldNames() { + $this->assertSame(['test_field'], db_field_names(['test_field'])); + } + + /** + * Tests deprecation of the db_create_table() function. + * + * @expectedDeprecation db_create_table() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call createTable() on it. For example, $injected_database->schema()->createTable($name, $table). See https://www.drupal.org/node/2993033 + */ + public function testDbCreateTable() { + $name = 'test_create_table'; + $table = [ + 'fields' => [ + 'id' => [ + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ], + ], + 'primary key' => ['id'], + ]; + db_create_table($name, $table); + $this->assertTrue($this->connection->schema()->tableExists($name)); + } + + /** + * Tests deprecation of the db_merge() function. + * + * @expectedDeprecation db_merge() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call merge() on it. For example, $injected_database->merge($table, $options). See https://www.drupal.org/node/2993033 + */ + public function testDbMerge() { + $this->assertInstanceOf(Merge::class, db_merge('test')); + } + + /** + * Tests deprecation of the db_driver() function. + * + * @expectedDeprecation db_driver() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call driver() on it. For example, $injected_database->driver($string). See https://www.drupal.org/node/2993033 + */ + public function testDbDriver() { + $this->assertNotNull(db_driver()); + } + + /** + * Tests deprecation of the db_escape_field() function. + * + * @expectedDeprecation db_escape_field() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call escapeField() on it. For example, $injected_database->escapeField($field). See https://www.drupal.org/node/2993033 + */ + public function testDbEscapeField() { + $this->assertNotNull(db_escape_field('test')); + } + + /** + * Tests deprecation of the db_like() function. + * + * @expectedDeprecation db_like() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call escapeLike() on it. For example, $injected_database->escapeLike($string). See https://www.drupal.org/node/2993033 + */ + public function testDbLike() { + $this->assertSame('test\%', db_like('test%')); + } + + /** + * Tests deprecation of the db_escape_table() function. + * + * @expectedDeprecation db_escape_table() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call escapeTable() on it. For example, $injected_database->escapeTable($table). See https://www.drupal.org/node/2993033 + */ + public function testDbEscapeTable() { + $this->assertNotNull(db_escape_table('test')); + } + + /** + * Tests deprecation of the db_rename_table() function. + * + * @expectedDeprecation db_rename_table() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call renameTable() on it. For example, $injected_database->schema()->renameTable($table, $new_name). See https://www.drupal.org/node/2993033 + */ + public function testDbRenameTable() { + $this->assertTrue($this->connection->schema()->tableExists('test')); + db_rename_table('test', 'test_rename'); + $this->assertTrue($this->connection->schema()->tableExists('test_rename')); + } + + /** + * Tests deprecation of the db_drop_index() function. + * + * @expectedDeprecation db_drop_index() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropIndex() on it. For example, $injected_database->schema()->dropIndex($table, $name). See https://www.drupal.org/node/2993033 + */ + public function testDbDropIndex() { + $this->assertFalse(db_drop_index('test', 'no_such_index')); + } + + /** + * Tests deprecation of the db_index_exists() function. + * + * @expectedDeprecation db_index_exists() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call indexExists() on it. For example, $injected_database->schema()->indexExists($table, $name). See https://www.drupal.org/node/2993033 + */ + public function testDbIndexExists() { + $this->assertFalse(db_index_exists('test', 'no_such_index')); + } + + /** + * Tests deprecation of the db_drop_unique_key() function. + * + * @expectedDeprecation db_drop_unique_key() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropUniqueKey() on it. For example, $injected_database->schema()->dropUniqueKey($table, $name). See https://www.drupal.org/node/2993033 + */ + public function testDbDropUniqueKey() { + $this->assertTrue(db_drop_unique_key('test', 'name')); + } + + /** + * Tests deprecation of the db_add_unique_key() function. + * + * @expectedDeprecation db_add_unique_key() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addUniqueKey() on it. For example, $injected_database->schema()->addUniqueKey($table, $name, $fields). See https://www.drupal.org/node/2993033 + */ + public function testDbAddUniqueKey() { + db_add_unique_key('test', 'age', ['age']); + } + + /** + * Tests deprecation of the db_drop_primary_key() function. + * + * @expectedDeprecation db_drop_primary_key() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropPrimaryKey() on it. For example, $injected_database->schema()->dropPrimaryKey($table). See https://www.drupal.org/node/2993033 + */ + public function testDbDropPrimaryKey() { + $this->assertTrue(db_drop_primary_key('test_people')); + } + + /** + * Tests deprecation of the db_add_primary_key() function. + * + * @expectedDeprecation db_add_primary_key() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addPrimaryKey() on it. For example, $injected_database->schema()->addPrimaryKey($table, $fields). See https://www.drupal.org/node/2993033 + */ + public function testDbAddPrimaryKey() { + $this->connection->schema()->dropPrimaryKey('test_people'); + db_add_primary_key('test_people', ['job']); + } + + /** + * Tests the db_update() function. + * + * @expectedDeprecation db_update() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call call update() on it. For example, $injected_database->update($table, $options); See https://www.drupal.org/node/2993033 + */ + public function testDbUpdate() { + $this->assertInstanceOf(Update::class, db_update('test')); + } + + /** + * Tests deprecation of the db_delete() function. + * + * @expectedDeprecation db_delete is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call delete() on it. For example, $injected_database->delete($table, $options). See https://www.drupal.org/node/2993033 + */ + public function testDbDelete() { + $this->assertInstanceOf(Delete::class, db_delete('test')); + } + + /** + * Tests deprecation of the db_truncate() function. + * + * @expectedDeprecation db_truncate() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call truncate() on it. For example, $injected_database->truncate($table, $options). See https://www.drupal.org/node/2993033 + */ + public function testDbTruncate() { + $this->assertInstanceOf(Truncate::class, db_truncate('test')); + } + + /** + * Tests deprecation of the db_query_temporary() function. + * + * @expectedDeprecation db_query_temporary() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call queryTemporary() on it. For example, $injected_database->queryTemporary($query, $args, $options). See https://www.drupal.org/node/2993033 + */ + public function testDbQueryTemporary() { + $expected = $this->connection->select('test')->countQuery()->execute()->fetchField(); + $name = db_query_temporary('SELECT name FROM {test}'); + $count = $this->connection->select($name)->countQuery()->execute()->fetchField(); + $this->assertSame($expected, $count); + } + + /** + * Tests deprecation of the db_query_range() function. + * + * @expectedDeprecation db_query_range() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call queryRange() on it. For example, $injected_database->queryRange($query, $from, $count, $args, $options). See https://www.drupal.org/node/2993033 + */ + public function testDbQueryRange() { + $count = count(db_query_range('SELECT name FROM {test}', 1, 3)->fetchAll()); + $this->assertSame(3, $count); + } + + /** + * Tests deprecation of the db_add_index() function. + * + * @expectedDeprecation db_add_index() is deprecated in Drupal 8.0.x and will be removed in Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addIndex() on it. For example, $injected_database->schema()->addIndex($table, $name, $fields, $spec). See https://www.drupal.org/node/2993033 + */ + public function testDbAddIndex() { + $table_specification = [ + 'fields' => [ + 'age' => [ + 'description' => "The person's age", + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ], + ], + ]; + $this->assertNull(db_add_index('test', 'test', ['age'], $table_specification)); + } + + /** + * Tests the db_insert() function. + * + * @expectedDeprecation db_insert() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call insert() on it. For example, $injected_database->insert($table, $options); See https://www.drupal.org/node/2993033 + */ + public function testDbInsert() { + $this->assertInstanceOf(Insert::class, db_insert('test')); + } + + /** + * Tests the db_select() function. + * + * @expectedDeprecation db_select() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call call select() on it. For example, $injected_database->db_select($table, $alias, $options); See https://www.drupal.org/node/2993033 + */ + public function testDbSelect() { + $this->assertInstanceOf(Select::class, db_select('test')); + } + + /** + * Tests the db_ignore_replica() function. + * + * @expectedDeprecation db_ignore_replica() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Database\ReplicaKillSwitch::trigger() instead. See https://www.drupal.org/node/2997500 + */ + public function testDbIgnoreReplica() { + $connection = Database::getConnectionInfo('default'); + Database::addConnectionInfo('default', 'replica', $connection['default']); + db_ignore_replica(); + /** @var \Symfony\Component\HttpFoundation\Session\SessionInterface $session */ + $session = \Drupal::service('session'); + $this->assertTrue($session->has('ignore_replica_server')); + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php Thu May 09 15:33:08 2019 +0100 @@ -24,10 +24,10 @@ $num_records_before = db_query('SELECT COUNT(*) FROM {test_task}')->fetchField(); $pid_to_delete = db_query("SELECT * FROM {test_task} WHERE task = 'sleep'")->fetchField(); - $subquery = db_select('test', 't') + $subquery = $this->connection->select('test', 't') ->fields('t', ['id']) ->condition('t.id', [$pid_to_delete], 'IN'); - $delete = db_delete('test_task') + $delete = $this->connection->delete('test_task') ->condition('task', 'sleep') ->condition('pid', $subquery, 'IN'); @@ -44,7 +44,7 @@ public function testSimpleDelete() { $num_records_before = db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $num_deleted = db_delete('test') + $num_deleted = $this->connection->delete('test') ->condition('id', 1) ->execute(); $this->assertIdentical($num_deleted, 1, 'Deleted 1 record.'); @@ -60,7 +60,7 @@ $num_records_before = db_query("SELECT COUNT(*) FROM {test}")->fetchField(); $this->assertTrue($num_records_before > 0, 'The table is not empty.'); - db_truncate('test')->execute(); + $this->connection->truncate('test')->execute(); $num_records_after = db_query("SELECT COUNT(*) FROM {test}")->fetchField(); $this->assertEqual(0, $num_records_after, 'Truncate really deletes everything.'); @@ -150,7 +150,7 @@ public function testSpecialColumnDelete() { $num_records_before = db_query('SELECT COUNT(*) FROM {test_special_columns}')->fetchField(); - $num_deleted = db_delete('test_special_columns') + $num_deleted = $this->connection->delete('test_special_columns') ->condition('id', 1) ->execute(); $this->assertIdentical($num_deleted, 1, 'Deleted 1 special column record.'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/FetchTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php Thu May 09 15:33:08 2019 +0100 @@ -117,7 +117,7 @@ * Confirms that we can fetch all records into an array explicitly. */ public function testQueryFetchAllColumn() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->orderBy('name'); $query_result = $query->execute()->fetchAll(\PDO::FETCH_COLUMN); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,7 @@ * Tests that we can run a query that uses default values for everything. */ public function testDefaultInsert() { - $query = db_insert('test')->useDefaults(['job']); + $query = $this->connection->insert('test')->useDefaults(['job']); $id = $query->execute(); $schema = drupal_get_module_schema('database_test', 'test'); @@ -31,7 +31,7 @@ $num_records_before = (int) db_query('SELECT COUNT(*) FROM {test}')->fetchField(); try { - db_insert('test')->execute(); + $this->connection->insert('test')->execute(); // This is only executed if no exception has been thrown. $this->fail('Expected exception NoFieldsException has not been thrown.'); } @@ -47,7 +47,7 @@ * Tests that we can insert fields with values and defaults in the same query. */ public function testDefaultInsertWithFields() { - $query = db_insert('test') + $query = $this->connection->insert('test') ->fields(['name' => 'Bob']) ->useDefaults(['job']); $id = $query->execute(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,7 @@ public function testInsertOneBlob() { $data = "This is\000a test."; $this->assertTrue(strlen($data) === 15, 'Test data contains a NULL.'); - $id = db_insert('test_one_blob') + $id = $this->connection->insert('test_one_blob') ->fields(['blob1' => $data]) ->execute(); $r = db_query('SELECT * FROM {test_one_blob} WHERE id = :id', [':id' => $id])->fetchAssoc(); @@ -26,7 +26,7 @@ * Tests that we can insert multiple blob fields in the same query. */ public function testInsertMultipleBlob() { - $id = db_insert('test_two_blobs') + $id = $this->connection->insert('test_two_blobs') ->fields([ 'blob1' => 'This is', 'blob2' => 'a test', diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/InsertTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,7 @@ public function testSimpleInsert() { $num_records_before = db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $query = db_insert('test'); + $query = $this->connection->insert('test'); $query->fields([ 'name' => 'Yoko', 'age' => '29', @@ -37,7 +37,7 @@ public function testMultiInsert() { $num_records_before = (int) db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $query = db_insert('test'); + $query = $this->connection->insert('test'); $query->fields([ 'name' => 'Larry', 'age' => '30', @@ -76,7 +76,7 @@ public function testRepeatedInsert() { $num_records_before = db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $query = db_insert('test'); + $query = $this->connection->insert('test'); $query->fields([ 'name' => 'Larry', @@ -119,7 +119,7 @@ public function testInsertFieldOnlyDefinition() { // This is useful for importers, when we want to create a query and define // its fields once, then loop over a multi-insert execution. - db_insert('test') + $this->connection->insert('test') ->fields(['name', 'age']) ->values(['Larry', '30']) ->values(['Curly', '31']) @@ -137,7 +137,7 @@ * Tests that inserts return the proper auto-increment ID. */ public function testInsertLastInsertID() { - $id = db_insert('test') + $id = $this->connection->insert('test') ->fields([ 'name' => 'Larry', 'age' => '30', @@ -151,7 +151,7 @@ * Tests that the INSERT INTO ... SELECT (fields) ... syntax works. */ public function testInsertSelectFields() { - $query = db_select('test_people', 'tp'); + $query = $this->connection->select('test_people', 'tp'); // The query builder will always append expressions after fields. // Add the expression first to test that the insert fields are correctly // re-ordered. @@ -165,7 +165,7 @@ // SELECT tp.age AS age, tp.name AS name, tp.job AS job // FROM test_people tp // WHERE tp.name = 'Meredith' - db_insert('test') + $this->connection->insert('test') ->from($query) ->execute(); @@ -177,7 +177,7 @@ * Tests that the INSERT INTO ... SELECT * ... syntax works. */ public function testInsertSelectAll() { - $query = db_select('test_people', 'tp') + $query = $this->connection->select('test_people', 'tp') ->fields('tp') ->condition('tp.name', 'Meredith'); @@ -186,7 +186,7 @@ // SELECT * // FROM test_people tp // WHERE tp.name = 'Meredith' - db_insert('test_people_copy') + $this->connection->insert('test_people_copy') ->from($query) ->execute(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/InvalidDataTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/InvalidDataTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/InvalidDataTest.php Thu May 09 15:33:08 2019 +0100 @@ -18,7 +18,7 @@ public function testInsertDuplicateData() { // Try to insert multiple records where at least one has bad data. try { - db_insert('test') + $this->connection->insert('test') ->fields(['name', 'age', 'job']) ->values([ 'name' => 'Elvis', @@ -59,7 +59,7 @@ } // Ensure the other values were not inserted. - $record = db_select('test') + $record = $this->connection->select('test') ->fields('test', ['name', 'age']) ->condition('age', [17, 75], 'IN') ->execute()->fetchObject(); @@ -75,7 +75,7 @@ // Insert multiple records in 'test_people' where one has bad data // (duplicate key). A 'Meredith' record has already been inserted // in ::setUp. - db_insert('test_people') + $this->connection->insert('test_people') ->fields(['name', 'age', 'job']) ->values([ 'name' => 'Elvis', @@ -104,12 +104,12 @@ // 3 => [name] => Meredith, [age] => 30, [job] => Speaker // Records 0 and 1 should pass, record 2 should lead to integrity // constraint violation. - $query = db_select('test_people', 'tp') + $query = $this->connection->select('test_people', 'tp') ->fields('tp', ['name', 'age', 'job']) ->orderBy('name'); // Try inserting from the subselect. - db_insert('test') + $this->connection->insert('test') ->from($query) ->execute(); @@ -136,7 +136,7 @@ } // Ensure the values for records 2 and 3 were not inserted. - $record = db_select('test') + $record = $this->connection->select('test') ->fields('test', ['name', 'age']) ->condition('age', [17, 30], 'IN') ->execute()->fetchObject(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/MergeTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/MergeTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/MergeTest.php Thu May 09 15:33:08 2019 +0100 @@ -18,7 +18,7 @@ public function testMergeInsert() { $num_records_before = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField(); - $result = db_merge('test_people') + $result = $this->connection->merge('test_people') ->key('job', 'Presenter') ->fields([ 'age' => 31, @@ -43,7 +43,7 @@ public function testMergeUpdate() { $num_records_before = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField(); - $result = db_merge('test_people') + $result = $this->connection->merge('test_people') ->key('job', 'Speaker') ->fields([ 'age' => 31, @@ -71,7 +71,7 @@ public function testMergeUpdateExcept() { $num_records_before = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField(); - db_merge('test_people') + $this->connection->merge('test_people') ->key('job', 'Speaker') ->insertFields(['age' => 31]) ->updateFields(['name' => 'Tiffany']) @@ -92,7 +92,7 @@ public function testMergeUpdateExplicit() { $num_records_before = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField(); - db_merge('test_people') + $this->connection->merge('test_people') ->key('job', 'Speaker') ->insertFields([ 'age' => 31, @@ -125,7 +125,7 @@ // Note that we are also double-setting age here, once as a literal and // once as an expression. This test will only pass if the expression wins, // which is what is supposed to happen. - db_merge('test_people') + $this->connection->merge('test_people') ->key('job', 'Speaker') ->fields(['name' => 'Tiffany']) ->insertFields(['age' => 31]) @@ -147,7 +147,7 @@ public function testMergeInsertWithoutUpdate() { $num_records_before = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField(); - db_merge('test_people') + $this->connection->merge('test_people') ->key('job', 'Presenter') ->execute(); @@ -166,7 +166,7 @@ public function testMergeUpdateWithoutUpdate() { $num_records_before = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField(); - db_merge('test_people') + $this->connection->merge('test_people') ->key('job', 'Speaker') ->execute(); @@ -178,7 +178,7 @@ $this->assertEqual($person->age, 30, 'Age skipped correctly.'); $this->assertEqual($person->job, 'Speaker', 'Job skipped correctly.'); - db_merge('test_people') + $this->connection->merge('test_people') ->key('job', 'Speaker') ->insertFields(['age' => 31]) ->execute(); @@ -201,7 +201,7 @@ // Normally it would throw an exception but we are suppressing it with // the throw_exception option. $options['throw_exception'] = FALSE; - db_merge('test_people', $options) + $this->connection->merge('test_people', $options) ->fields([ 'age' => 31, 'name' => 'Tiffany', @@ -216,7 +216,7 @@ try { // This query will fail because there is no key field specified. - db_merge('test_people') + $this->connection->merge('test_people') ->fields([ 'age' => 31, 'name' => 'Tiffany', diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,21 +2,23 @@ namespace Drupal\KernelTests\Core\Database; -use Drupal\KernelTests\KernelTestBase; - /** * Tests the sequences API. * * @group Database */ -class NextIdTest extends KernelTestBase { +class NextIdTest extends DatabaseTestBase { /** * The modules to enable. + * * @var array */ - public static $modules = ['system']; + public static $modules = ['database_test', 'system']; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); $this->installSchema('system', 'sequences'); @@ -26,13 +28,13 @@ * Tests that the sequences API works. */ public function testDbNextId() { - $first = db_next_id(); - $second = db_next_id(); + $first = $this->connection->nextId(); + $second = $this->connection->nextId(); // We can test for exact increase in here because we know there is no // other process operating on these tables -- normally we could only // expect $second > $first. $this->assertEqual($first + 1, $second, 'The second call from a sequence provides a number increased by one.'); - $result = db_next_id(1000); + $result = $this->connection->nextId(1000); $this->assertEqual($result, 1001, 'Sequence provides a larger number than the existing ID.'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/QueryTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php Thu May 09 15:33:08 2019 +0100 @@ -53,7 +53,7 @@ // Test that the insert query that was used in the SQL injection attempt did // not result in a row being inserted in the database. - $result = db_select('test') + $result = $this->connection->select('test') ->condition('name', 'test12345678') ->countQuery() ->execute() @@ -78,7 +78,7 @@ } }); try { - $result = db_select('test', 't') + $result = $this->connection->select('test', 't') ->fields('t') ->condition('name', 1, $injection) ->execute(); @@ -90,7 +90,7 @@ // Test that the insert query that was used in the SQL injection attempt did // not result in a row being inserted in the database. - $result = db_select('test') + $result = $this->connection->select('test') ->condition('name', 'test12345678') ->countQuery() ->execute() @@ -100,13 +100,13 @@ // Attempt SQLi via union query with no unsafe characters. $this->enableModules(['user']); $this->installEntitySchema('user'); - db_insert('test') + $this->connection->insert('test') ->fields(['name' => '123456']) ->execute(); $injection = "= 1 UNION ALL SELECT password FROM user WHERE uid ="; try { - $result = db_select('test', 't') + $result = $this->connection->select('test', 't') ->fields('t', ['name', 'name']) ->condition('name', 1, $injection) ->execute(); @@ -117,13 +117,13 @@ } // Attempt SQLi via union query - uppercase tablename. - db_insert('TEST_UPPERCASE') + $this->connection->insert('TEST_UPPERCASE') ->fields(['name' => 'secrets']) ->execute(); $injection = "IS NOT NULL) UNION ALL SELECT name FROM {TEST_UPPERCASE} -- "; try { - $result = db_select('test', 't') + $result = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('name', 1, $injection) ->execute(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php Thu May 09 15:33:08 2019 +0100 @@ -14,7 +14,7 @@ */ public function testRangeQuery() { // Test if return correct number of rows. - $range_rows = db_query_range("SELECT name FROM {test} ORDER BY name", 1, 3)->fetchAll(); + $range_rows = $this->connection->queryRange("SELECT name FROM {test} ORDER BY name", 1, 3)->fetchAll(); $this->assertEqual(count($range_rows), 3, 'Range query work and return correct number of rows.'); // Test if return target data. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php Thu May 09 15:33:08 2019 +0100 @@ -22,7 +22,8 @@ public function testRegression_310447() { // That's a 255 character UTF-8 string. $job = str_repeat("é", 255); - db_insert('test') + $this->connection + ->insert('test') ->fields([ 'name' => $this->randomMachineName(), 'age' => 20, @@ -42,19 +43,20 @@ } /** - * Tests the db_field_exists() function. + * Tests the \Drupal\Core\Database\Schema::fieldExists() method. */ public function testDBFieldExists() { - $this->assertSame(TRUE, db_field_exists('test', 'name'), 'Returns true for existent column.'); - $this->assertSame(FALSE, db_field_exists('test', 'nosuchcolumn'), 'Returns false for nonexistent column.'); + $schema = $this->connection->schema(); + $this->assertSame(TRUE, $schema->fieldExists('test', 'name'), 'Returns true for existent column.'); + $this->assertSame(FALSE, $schema->fieldExists('test', 'nosuchcolumn'), 'Returns false for nonexistent column.'); } /** - * Tests the db_index_exists() function. + * Tests the Schema::indexExists() method. */ public function testDBIndexExists() { - $this->assertSame(TRUE, db_index_exists('test', 'ages'), 'Returns true for existent index.'); - $this->assertSame(FALSE, db_index_exists('test', 'nosuchindex'), 'Returns false for nonexistent index.'); + $this->assertSame(TRUE, $this->connection->schema()->indexExists('test', 'ages'), 'Returns true for existent index.'); + $this->assertSame(FALSE, $this->connection->schema()->indexExists('test', 'nosuchindex'), 'Returns false for nonexistent index.'); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,50 @@ +trigger(); + $class_loader = require $this->root . '/autoload.php'; + $kernel = new DrupalKernel('testing', $class_loader, FALSE); + $event = new GetResponseEvent($kernel, Request::create('http://example.com'), HttpKernelInterface::MASTER_REQUEST); + $service->checkReplicaServer($event); + + $db1 = Database::getConnection('default', 'default'); + $db2 = Database::getConnection('replica', 'default'); + + $this->assertSame($db1, $db2, 'System Init ignores secondaries when requested.'); + + // Makes sure that session value set right. + $session = \Drupal::service('session'); + $this->assertTrue($session->has('ignore_replica_server')); + $expected = \Drupal::time()->getRequestTime() + Settings::get('maximum_replication_lag', 300); + $this->assertEquals($expected, $session->get('ignore_replica_server')); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php Thu May 09 15:33:08 2019 +0100 @@ -8,6 +8,7 @@ use Drupal\Core\Database\SchemaObjectExistsException; use Drupal\KernelTests\KernelTestBase; use Drupal\Component\Utility\Unicode; +use Drupal\Tests\Core\Database\SchemaIntrospectionTestTrait; /** * Tests table creation and modification via the schema API. @@ -18,6 +19,8 @@ */ class SchemaTest extends KernelTestBase { + use SchemaIntrospectionTestTrait; + /** * A global counter for table and field creation. * @@ -109,12 +112,12 @@ $this->assertFalse($this->tryInsert(), 'Insert without a default failed.'); // Add a default value to the column. - $this->schema->fieldSetDefault('test_table', 'test_field', 0); + $this->schema->changeField('test_table', 'test_field', 'test_field', ['type' => 'int', 'not null' => TRUE, 'default' => 0]); // The insert should now succeed. $this->assertTrue($this->tryInsert(), 'Insert with a default succeeded.'); // Remove the default. - $this->schema->fieldSetNoDefault('test_table', 'test_field'); + $this->schema->changeField('test_table', 'test_field', 'test_field', ['type' => 'int', 'not null' => TRUE]); // The insert should fail again. $this->assertFalse($this->tryInsert(), 'Insert without a default failed.'); @@ -128,14 +131,14 @@ $this->assertIdentical($index_exists, TRUE, 'Index created.'); // Rename the table. - $this->schema->renameTable('test_table', 'test_table2'); + $this->assertNull($this->schema->renameTable('test_table', 'test_table2')); // Index should be renamed. $index_exists = $this->schema->indexExists('test_table2', 'test_field'); $this->assertTrue($index_exists, 'Index was renamed.'); // We need the default so that we can insert after the rename. - $this->schema->fieldSetDefault('test_table2', 'test_field', 0); + $this->schema->changeField('test_table2', 'test_field', 'test_field', ['type' => 'int', 'not null' => TRUE, 'default' => 0]); $this->assertFalse($this->tryInsert(), 'Insert into the old table failed.'); $this->assertTrue($this->tryInsert('test_table2'), 'Insert into the new table succeeded.'); @@ -149,7 +152,7 @@ // Recreate the table. $this->schema->createTable('test_table', $table_specification); - $this->schema->fieldSetDefault('test_table', 'test_field', 0); + $this->schema->changeField('test_table', 'test_field', 'test_field', ['type' => 'int', 'not null' => TRUE, 'default' => 0]); $this->schema->addField('test_table', 'test_serial', ['type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'Added column description.']); // Assert that the column comment has been set. @@ -173,7 +176,7 @@ // Test adding a serial field to an existing table. $this->schema->dropTable('test_table'); $this->schema->createTable('test_table', $table_specification); - $this->schema->fieldSetDefault('test_table', 'test_field', 0); + $this->schema->changeField('test_table', 'test_field', 'test_field', ['type' => 'int', 'not null' => TRUE, 'default' => 0]); $this->schema->addField('test_table', 'test_serial', ['type' => 'serial', 'not null' => TRUE], ['primary key' => ['test_serial']]); // Test the primary key columns. @@ -214,61 +217,40 @@ 'test_field' => ['test_field'], ], ]; - $this->schema->createTable('test_table', $table_specification); - // Tests for indexes are Database specific. - $db_type = $this->connection->databaseType(); + // PostgreSQL has a max identifier length of 63 characters, MySQL has 64 and + // SQLite does not have any limit. Use the lowest common value and create a + // table name as long as possible in order to cover edge cases around + // identifier names for the table's primary or unique key constraints. + $table_name = strtolower($this->getRandomGenerator()->name(63 - strlen($this->getDatabasePrefix()))); + $this->schema->createTable($table_name, $table_specification); - // Test for existing primary and unique keys. - switch ($db_type) { - case 'pgsql': - $primary_key_exists = $this->schema->constraintExists('test_table', '__pkey'); - $unique_key_exists = $this->schema->constraintExists('test_table', 'test_field' . '__key'); - break; + $this->assertIndexOnColumns($table_name, ['id'], 'primary'); + $this->assertIndexOnColumns($table_name, ['test_field'], 'unique'); - case 'sqlite': - // SQLite does not create a standalone index for primary keys. - $primary_key_exists = TRUE; - $unique_key_exists = $this->schema->indexExists('test_table', 'test_field'); - break; - - default: - $primary_key_exists = $this->schema->indexExists('test_table', 'PRIMARY'); - $unique_key_exists = $this->schema->indexExists('test_table', 'test_field'); - break; - } - $this->assertIdentical($primary_key_exists, TRUE, 'Primary key created.'); - $this->assertIdentical($unique_key_exists, TRUE, 'Unique key created.'); - - $this->schema->renameTable('test_table', 'test_table2'); + $new_table_name = strtolower($this->getRandomGenerator()->name(63 - strlen($this->getDatabasePrefix()))); + $this->assertNull($this->schema->renameTable($table_name, $new_table_name)); // Test for renamed primary and unique keys. - switch ($db_type) { - case 'pgsql': - $renamed_primary_key_exists = $this->schema->constraintExists('test_table2', '__pkey'); - $renamed_unique_key_exists = $this->schema->constraintExists('test_table2', 'test_field' . '__key'); - break; + $this->assertIndexOnColumns($new_table_name, ['id'], 'primary'); + $this->assertIndexOnColumns($new_table_name, ['test_field'], 'unique'); - case 'sqlite': - // SQLite does not create a standalone index for primary keys. - $renamed_primary_key_exists = TRUE; - $renamed_unique_key_exists = $this->schema->indexExists('test_table2', 'test_field'); - break; + // For PostgreSQL, we also need to check that the sequence has been renamed. + // The initial name of the sequence has been generated automatically by + // PostgreSQL when the table was created, however, on subsequent table + // renames the name is generated by Drupal and can not be easily + // re-constructed. Hence we can only check that we still have a sequence on + // the new table name. + if ($this->connection->databaseType() == 'pgsql') { + $sequence_exists = (bool) $this->connection->query("SELECT pg_get_serial_sequence('{" . $new_table_name . "}', 'id')")->fetchField(); + $this->assertTrue($sequence_exists, 'Sequence was renamed.'); - default: - $renamed_primary_key_exists = $this->schema->indexExists('test_table2', 'PRIMARY'); - $renamed_unique_key_exists = $this->schema->indexExists('test_table2', 'test_field'); - break; - } - $this->assertIdentical($renamed_primary_key_exists, TRUE, 'Primary key was renamed.'); - $this->assertIdentical($renamed_unique_key_exists, TRUE, 'Unique key was renamed.'); + // Rename the table again and repeat the check. + $another_table_name = strtolower($this->getRandomGenerator()->name(63 - strlen($this->getDatabasePrefix()))); + $this->schema->renameTable($new_table_name, $another_table_name); - // For PostgreSQL check in addition that sequence was renamed. - if ($db_type == 'pgsql') { - // Get information about new table. - $info = $this->schema->queryTableInformation('test_table2'); - $sequence_name = $this->schema->prefixNonTable('test_table2', 'id', 'seq'); - $this->assertEqual($sequence_name, current($info->sequences), 'Sequence was renamed.'); + $sequence_exists = (bool) $this->connection->query("SELECT pg_get_serial_sequence('{" . $another_table_name . "}', 'id')")->fetchField(); + $this->assertTrue($sequence_exists, 'Sequence was renamed.'); } // Use database specific data type and ensure that table is created. @@ -293,6 +275,83 @@ } /** + * @covers \Drupal\Core\Database\Driver\mysql\Schema::introspectIndexSchema + * @covers \Drupal\Core\Database\Driver\pgsql\Schema::introspectIndexSchema + * @covers \Drupal\Core\Database\Driver\sqlite\Schema::introspectIndexSchema + */ + public function testIntrospectIndexSchema() { + $table_specification = [ + 'fields' => [ + 'id' => [ + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ], + 'test_field_1' => [ + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ], + 'test_field_2' => [ + 'type' => 'int', + 'default' => 0, + ], + 'test_field_3' => [ + 'type' => 'int', + 'default' => 0, + ], + 'test_field_4' => [ + 'type' => 'int', + 'default' => 0, + ], + 'test_field_5' => [ + 'type' => 'int', + 'default' => 0, + ], + ], + 'primary key' => ['id', 'test_field_1'], + 'unique keys' => [ + 'test_field_2' => ['test_field_2'], + 'test_field_3_test_field_4' => ['test_field_3', 'test_field_4'], + ], + 'indexes' => [ + 'test_field_4' => ['test_field_4'], + 'test_field_4_test_field_5' => ['test_field_4', 'test_field_5'], + ], + ]; + + $table_name = strtolower($this->getRandomGenerator()->name()); + $this->schema->createTable($table_name, $table_specification); + + unset($table_specification['fields']); + + $introspect_index_schema = new \ReflectionMethod(get_class($this->schema), 'introspectIndexSchema'); + $introspect_index_schema->setAccessible(TRUE); + $index_schema = $introspect_index_schema->invoke($this->schema, $table_name); + + // The PostgreSQL driver is using a custom naming scheme for its indexes, so + // we need to adjust the initial table specification. + if ($this->connection->databaseType() === 'pgsql') { + $ensure_identifier_length = new \ReflectionMethod(get_class($this->schema), 'ensureIdentifiersLength'); + $ensure_identifier_length->setAccessible(TRUE); + + foreach ($table_specification['unique keys'] as $original_index_name => $columns) { + unset($table_specification['unique keys'][$original_index_name]); + $new_index_name = $ensure_identifier_length->invoke($this->schema, $table_name, $original_index_name, 'key'); + $table_specification['unique keys'][$new_index_name] = $columns; + } + + foreach ($table_specification['indexes'] as $original_index_name => $columns) { + unset($table_specification['indexes'][$original_index_name]); + $new_index_name = $ensure_identifier_length->invoke($this->schema, $table_name, $original_index_name, 'idx'); + $table_specification['indexes'][$new_index_name] = $columns; + } + } + + $this->assertEquals($table_specification, $index_schema); + } + + /** * Tests that indexes on string fields are limited to 191 characters on MySQL. * * @see \Drupal\Core\Database\Driver\mysql\Schema::getNormalizedIndexes() diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php Thu May 09 15:33:08 2019 +0100 @@ -13,11 +13,11 @@ * Test that subqueries as value within conditions are cloned properly. */ public function testSelectConditionSubQueryCloning() { - $subquery = db_select('test', 't'); + $subquery = $this->connection->select('test', 't'); $subquery->addField('t', 'id', 'id'); $subquery->condition('age', 28, '<'); - $query = db_select('test', 't'); + $query = $this->connection->select('test', 't'); $query->addField('t', 'name', 'name'); $query->condition('id', $subquery, 'IN'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php Thu May 09 15:33:08 2019 +0100 @@ -25,7 +25,7 @@ * Tests simple JOIN statements. */ public function testDefaultJoin() { - $query = db_select('test_task', 't'); + $query = $this->connection->select('test_task', 't'); $people_alias = $query->join('test', 'p', 't.pid = p.id'); $name_field = $query->addField($people_alias, 'name', 'name'); $query->addField('t', 'task', 'task'); @@ -50,7 +50,7 @@ * Tests LEFT OUTER joins. */ public function testLeftOuterJoin() { - $query = db_select('test', 'p'); + $query = $this->connection->select('test', 'p'); $people_alias = $query->leftJoin('test_task', 't', 't.pid = p.id'); $name_field = $query->addField('p', 'name', 'name'); $query->addField($people_alias, 'task', 'task'); @@ -74,7 +74,7 @@ * Tests GROUP BY clauses. */ public function testGroupBy() { - $query = db_select('test_task', 't'); + $query = $this->connection->select('test_task', 't'); $count_field = $query->addExpression('COUNT(task)', 'num'); $task_field = $query->addField('t', 'task'); $query->orderBy($count_field); @@ -110,7 +110,7 @@ * Tests GROUP BY and HAVING clauses together. */ public function testGroupByAndHaving() { - $query = db_select('test_task', 't'); + $query = $this->connection->select('test_task', 't'); $count_field = $query->addExpression('COUNT(task)', 'num'); $task_field = $query->addField('t', 'task'); $query->orderBy($count_field); @@ -146,7 +146,7 @@ * The SQL clause varies with the database. */ public function testRange() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); $query->range(0, 2); @@ -159,7 +159,7 @@ * Test whether the range property of a select clause can be undone. */ public function testRangeUndo() { - $query = db_select('test'); + $query = $this->connection->select('test'); $name_field = $query->addField('test', 'name'); $age_field = $query->addField('test', 'age', 'age'); $query->range(0, 2); @@ -173,7 +173,7 @@ * Tests distinct queries. */ public function testDistinct() { - $query = db_select('test_task'); + $query = $this->connection->select('test_task'); $query->addField('test_task', 'task'); $query->distinct(); $query_result = $query->countQuery()->execute()->fetchField(); @@ -185,7 +185,7 @@ * Tests that we can generate a count query from a built query. */ public function testCountQuery() { - $query = db_select('test'); + $query = $this->connection->select('test'); $name_field = $query->addField('test', 'name'); $age_field = $query->addField('test', 'age', 'age'); $query->orderBy('name'); @@ -205,7 +205,7 @@ * Tests having queries. */ public function testHavingCountQuery() { - $query = db_select('test') + $query = $this->connection->select('test') ->extend('Drupal\Core\Database\Query\PagerSelectExtender') ->groupBy('age') ->having('age + 1 > 0'); @@ -219,7 +219,7 @@ * Tests that countQuery removes 'all_fields' statements and ordering clauses. */ public function testCountQueryRemovals() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->fields('test'); $query->orderBy('name'); $count = $query->countQuery(); @@ -254,11 +254,11 @@ // up in the query, an error will be thrown. If not, it will return the // number of records, which in this case happens to be 4 (there are four // records in the {test} table). - $query = db_select('test'); + $query = $this->connection->select('test'); $query->fields('test', ['fail']); $this->assertEqual(4, $query->countQuery()->execute()->fetchField(), 'Count Query removed fields'); - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addExpression('fail'); $this->assertEqual(4, $query->countQuery()->execute()->fetchField(), 'Count Query removed expressions'); } @@ -267,7 +267,7 @@ * Tests that we can generate a count query from a query with distinct. */ public function testCountQueryDistinct() { - $query = db_select('test_task'); + $query = $this->connection->select('test_task'); $query->addField('test_task', 'task'); $query->distinct(); @@ -280,7 +280,7 @@ * Tests that we can generate a count query from a query with GROUP BY. */ public function testCountQueryGroupBy() { - $query = db_select('test_task'); + $query = $this->connection->select('test_task'); $query->addField('test_task', 'pid'); $query->groupBy('pid'); @@ -290,7 +290,7 @@ // Use a column alias as, without one, the query can succeed for the wrong // reason. - $query = db_select('test_task'); + $query = $this->connection->select('test_task'); $query->addField('test_task', 'pid', 'pid_alias'); $query->addExpression('COUNT(test_task.task)', 'count'); $query->groupBy('pid_alias'); @@ -309,7 +309,7 @@ // "SELECT job FROM {test} WHERE name = 'Paul' AND (age = 26 OR age = 27)" // That should find only one record. Yes it's a non-optimal way of writing // that query but that's not the point! - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'job'); $query->condition('name', 'Paul'); $query->condition((new Condition('OR'))->condition('age', 26)->condition('age', 27)); @@ -322,7 +322,7 @@ * Confirms we can join on a single table twice with a dynamic alias. */ public function testJoinTwice() { - $query = db_select('test')->fields('test'); + $query = $this->connection->select('test')->fields('test'); $alias = $query->join('test', 'test', 'test.job = %alias.job'); $query->addField($alias, 'name', 'othername'); $query->addField($alias, 'job', 'otherjob'); @@ -343,12 +343,12 @@ 'mail' => $this->randomMachineName() . '@example.com', ]); - $query = db_select('test_task', 'tt', ['target' => 'replica']); + $query = Database::getConnection('replica')->select('test_task', 'tt'); $query->addExpression('tt.pid + 1', 'abc'); $query->condition('priority', 1, '>'); $query->condition('priority', 100, '<'); - $subquery = db_select('test', 'tp'); + $subquery = $this->connection->select('test', 'tp'); $subquery->join('test_one_blob', 'tpb', 'tp.id = tpb.id'); $subquery->join('node', 'n', 'tp.id = n.nid'); $subquery->addTag('node_access'); @@ -376,7 +376,7 @@ * Tests that rowCount() throws exception on SELECT query. */ public function testSelectWithRowCount() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $result = $query->execute(); try { @@ -394,7 +394,7 @@ */ public function testJoinConditionObject() { // Same test as testDefaultJoin, but with a Condition object. - $query = db_select('test_task', 't'); + $query = $this->connection->select('test_task', 't'); $join_cond = (new Condition('AND'))->where('t.pid = p.id'); $people_alias = $query->join('test', 'p', $join_cond); $name_field = $query->addField($people_alias, 'name', 'name'); @@ -421,7 +421,7 @@ $join_cond = (new Condition('AND')) ->condition('t1.name', $t1_name) ->condition('t2.name', $t2_name); - $query = db_select('test', 't1'); + $query = $this->connection->select('test', 't1'); $query->innerJoin('test', 't2', $join_cond); $query->addField('t1', 'name', 't1_name'); $query->addField('t2', 'name', 't2_name'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/SelectOrderedTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/SelectOrderedTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectOrderedTest.php Thu May 09 15:33:08 2019 +0100 @@ -13,7 +13,7 @@ * Tests basic ORDER BY. */ public function testSimpleSelectOrdered() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $age_field = $query->addField('test', 'age', 'age'); $query->orderBy($age_field); @@ -34,7 +34,7 @@ * Tests multiple ORDER BY. */ public function testSimpleSelectMultiOrdered() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $age_field = $query->addField('test', 'age', 'age'); $job_field = $query->addField('test', 'job'); @@ -65,7 +65,7 @@ * Tests ORDER BY descending. */ public function testSimpleSelectOrderedDesc() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $age_field = $query->addField('test', 'age', 'age'); $query->orderBy($age_field, 'DESC'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php Thu May 09 15:33:08 2019 +0100 @@ -14,7 +14,7 @@ */ public function testFromSubquerySelect() { // Create a subquery, which is just a normal query object. - $subquery = db_select('test_task', 'tt'); + $subquery = $this->connection->select('test_task', 'tt'); $subquery->addField('tt', 'pid', 'pid'); $subquery->addField('tt', 'task', 'task'); $subquery->condition('priority', 1); @@ -22,7 +22,7 @@ for ($i = 0; $i < 2; $i++) { // Create another query that joins against the virtual table resulting // from the subquery. - $select = db_select($subquery, 'tt2'); + $select = $this->connection->select($subquery, 'tt2'); $select->join('test', 't', 't.id=tt2.pid'); $select->addField('t', 'name'); if ($i) { @@ -48,7 +48,7 @@ */ public function testFromSubquerySelectWithLimit() { // Create a subquery, which is just a normal query object. - $subquery = db_select('test_task', 'tt'); + $subquery = $this->connection->select('test_task', 'tt'); $subquery->addField('tt', 'pid', 'pid'); $subquery->addField('tt', 'task', 'task'); $subquery->orderBy('priority', 'DESC'); @@ -56,7 +56,7 @@ // Create another query that joins against the virtual table resulting // from the subquery. - $select = db_select($subquery, 'tt2'); + $select = $this->connection->select($subquery, 'tt2'); $select->join('test', 't', 't.id=tt2.pid'); $select->addField('t', 'name'); @@ -74,13 +74,13 @@ */ public function testConditionSubquerySelect() { // Create a subquery, which is just a normal query object. - $subquery = db_select('test_task', 'tt'); + $subquery = $this->connection->select('test_task', 'tt'); $subquery->addField('tt', 'pid', 'pid'); $subquery->condition('tt.priority', 1); // Create another query that joins against the virtual table resulting // from the subquery. - $select = db_select('test_task', 'tt2'); + $select = $this->connection->select('test_task', 'tt2'); $select->addField('tt2', 'task'); $select->condition('tt2.pid', $subquery, 'IN'); @@ -97,11 +97,11 @@ */ public function testConditionSubquerySelect2() { // Create a subquery, which is just a normal query object. - $subquery = db_select('test', 't2'); + $subquery = $this->connection->select('test', 't2'); $subquery->addExpression('AVG(t2.age)'); // Create another query that adds a clause using the subquery. - $select = db_select('test', 't'); + $select = $this->connection->select('test', 't'); $select->addField('t', 'name'); $select->condition('t.age', $subquery, '<'); @@ -118,16 +118,16 @@ */ public function testConditionSubquerySelect3() { // Create subquery 1, which is just a normal query object. - $subquery1 = db_select('test_task', 'tt'); + $subquery1 = $this->connection->select('test_task', 'tt'); $subquery1->addExpression('AVG(tt.priority)'); $subquery1->where('tt.pid = t.id'); // Create subquery 2, which is just a normal query object. - $subquery2 = db_select('test_task', 'tt2'); + $subquery2 = $this->connection->select('test_task', 'tt2'); $subquery2->addExpression('AVG(tt2.priority)'); // Create another query that adds a clause using the subqueries. - $select = db_select('test', 't'); + $select = $this->connection->select('test', 't'); $select->addField('t', 'name'); $select->condition($subquery1, $subquery2, '>'); @@ -148,22 +148,22 @@ */ public function testConditionSubquerySelect4() { // Create subquery 1, which is just a normal query object. - $subquery1 = db_select('test_task', 'tt'); + $subquery1 = $this->connection->select('test_task', 'tt'); $subquery1->addExpression('AVG(tt.priority)'); $subquery1->where('tt.pid = t.id'); // Create subquery 2, which is just a normal query object. - $subquery2 = db_select('test_task', 'tt2'); + $subquery2 = $this->connection->select('test_task', 'tt2'); $subquery2->addExpression('MIN(tt2.priority)'); $subquery2->where('tt2.pid <> t.id'); // Create subquery 3, which is just a normal query object. - $subquery3 = db_select('test_task', 'tt3'); + $subquery3 = $this->connection->select('test_task', 'tt3'); $subquery3->addExpression('AVG(tt3.priority)'); $subquery3->where('tt3.pid <> t.id'); // Create another query that adds a clause using the subqueries. - $select = db_select('test', 't'); + $select = $this->connection->select('test', 't'); $select->addField('t', 'name'); $select->condition($subquery1, [$subquery2, $subquery3], 'BETWEEN'); @@ -182,13 +182,13 @@ */ public function testJoinSubquerySelect() { // Create a subquery, which is just a normal query object. - $subquery = db_select('test_task', 'tt'); + $subquery = $this->connection->select('test_task', 'tt'); $subquery->addField('tt', 'pid', 'pid'); $subquery->condition('priority', 1); // Create another query that joins against the virtual table resulting // from the subquery. - $select = db_select('test', 't'); + $select = $this->connection->select('test', 't'); $select->join($subquery, 'tt', 't.id=tt.pid'); $select->addField('t', 'name'); @@ -209,7 +209,7 @@ */ public function testExistsSubquerySelect() { // Put George into {test_people}. - db_insert('test_people') + $this->connection->insert('test_people') ->fields([ 'name' => 'George', 'age' => 27, @@ -217,10 +217,10 @@ ]) ->execute(); // Base query to {test}. - $query = db_select('test', 't') + $query = $this->connection->select('test', 't') ->fields('t', ['name']); // Subquery to {test_people}. - $subquery = db_select('test_people', 'tp') + $subquery = $this->connection->select('test_people', 'tp') ->fields('tp', ['name']) ->where('tp.name = t.name'); $query->exists($subquery); @@ -239,7 +239,7 @@ */ public function testNotExistsSubquerySelect() { // Put George into {test_people}. - db_insert('test_people') + $this->connection->insert('test_people') ->fields([ 'name' => 'George', 'age' => 27, @@ -248,10 +248,10 @@ ->execute(); // Base query to {test}. - $query = db_select('test', 't') + $query = $this->connection->select('test', 't') ->fields('t', ['name']); // Subquery to {test_people}. - $subquery = db_select('test_people', 'tp') + $subquery = $this->connection->select('test_people', 'tp') ->fields('tp', ['name']) ->where('tp.name = t.name'); $query->notExists($subquery); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/SelectTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php Thu May 09 15:33:08 2019 +0100 @@ -16,7 +16,7 @@ * Tests rudimentary SELECT statements. */ public function testSimpleSelect() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); $num_records = $query->countQuery()->execute()->fetchField(); @@ -28,7 +28,7 @@ * Tests rudimentary SELECT statement with a COMMENT. */ public function testSimpleComment() { - $query = db_select('test')->comment('Testing query comments'); + $query = $this->connection->select('test')->comment('Testing query comments'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); $result = $query->execute(); @@ -46,7 +46,7 @@ * Tests query COMMENT system against vulnerabilities. */ public function testVulnerableComment() { - $query = db_select('test')->comment('Testing query comments */ SELECT nid FROM {node}; --'); + $query = $this->connection->select('test')->comment('Testing query comments */ SELECT nid FROM {node}; --'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); $result = $query->execute(); @@ -101,7 +101,7 @@ * Tests basic conditionals on SELECT statements. */ public function testSimpleSelectConditional() { - $query = db_select('test'); + $query = $this->connection->select('test'); $name_field = $query->addField('test', 'name'); $age_field = $query->addField('test', 'age', 'age'); $query->condition('age', 27); @@ -121,7 +121,7 @@ * Tests SELECT statements with expressions. */ public function testSimpleSelectExpression() { - $query = db_select('test'); + $query = $this->connection->select('test'); $name_field = $query->addField('test', 'name'); $age_field = $query->addExpression("age*2", 'double_age'); $query->condition('age', 27); @@ -141,7 +141,7 @@ * Tests SELECT statements with multiple expressions. */ public function testSimpleSelectExpressionMultiple() { - $query = db_select('test'); + $query = $this->connection->select('test'); $name_field = $query->addField('test', 'name'); $age_double_field = $query->addExpression("age*2"); $age_triple_field = $query->addExpression("age*3"); @@ -163,7 +163,7 @@ * Tests adding multiple fields to a SELECT statement at the same time. */ public function testSimpleSelectMultipleFields() { - $record = db_select('test') + $record = $this->connection->select('test') ->fields('test', ['id', 'name', 'age', 'job']) ->condition('age', 27) ->execute()->fetchObject(); @@ -186,7 +186,7 @@ * Tests adding all fields from a given table to a SELECT statement. */ public function testSimpleSelectAllFields() { - $record = db_select('test') + $record = $this->connection->select('test') ->fields('test') ->condition('age', 27) ->execute()->fetchObject(); @@ -211,7 +211,7 @@ public function testNullCondition() { $this->ensureSampleDataNull(); - $names = db_select('test_null', 'tn') + $names = $this->connection->select('test_null', 'tn') ->fields('tn', ['name']) ->condition('age', NULL) ->execute()->fetchCol(); @@ -225,7 +225,7 @@ public function testIsNullCondition() { $this->ensureSampleDataNull(); - $names = db_select('test_null', 'tn') + $names = $this->connection->select('test_null', 'tn') ->fields('tn', ['name']) ->isNull('age') ->execute()->fetchCol(); @@ -240,7 +240,7 @@ public function testIsNotNullCondition() { $this->ensureSampleDataNull(); - $names = db_select('test_null', 'tn') + $names = $this->connection->select('test_null', 'tn') ->fields('tn', ['name']) ->isNotNull('tn.age') ->orderBy('name') @@ -252,17 +252,61 @@ } /** + * Tests that we can force a query to return an empty result. + */ + public function testAlwaysFalseCondition() { + $names = $this->connection->select('test', 'test') + ->fields('test', ['name']) + ->condition('age', 27) + ->execute()->fetchCol(); + + $this->assertCount(1, $names); + $this->assertSame($names[0], 'George'); + + $names = $this->connection->select('test', 'test') + ->fields('test', ['name']) + ->condition('age', 27) + ->alwaysFalse() + ->execute()->fetchCol(); + + $this->assertCount(0, $names); + } + + /** + * Tests that we can force an extended query to return an empty result. + */ + public function testExtenderAlwaysFalseCondition() { + $names = $this->connection->select('test', 'test') + ->extend('Drupal\Core\Database\Query\SelectExtender') + ->fields('test', ['name']) + ->condition('age', 27) + ->execute()->fetchCol(); + + $this->assertCount(1, $names); + $this->assertSame($names[0], 'George'); + + $names = $this->connection->select('test', 'test') + ->extend('Drupal\Core\Database\Query\SelectExtender') + ->fields('test', ['name']) + ->condition('age', 27) + ->alwaysFalse() + ->execute()->fetchCol(); + + $this->assertCount(0, $names); + } + + /** * Tests that we can UNION multiple Select queries together. * * This is semantically equal to UNION DISTINCT, so we don't explicitly test * that. */ public function testUnion() { - $query_1 = db_select('test', 't') + $query_1 = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('age', [27, 28], 'IN'); - $query_2 = db_select('test', 't') + $query_2 = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('age', 28); @@ -281,11 +325,11 @@ * Tests that we can UNION ALL multiple SELECT queries together. */ public function testUnionAll() { - $query_1 = db_select('test', 't') + $query_1 = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('age', [27, 28], 'IN'); - $query_2 = db_select('test', 't') + $query_2 = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('age', 28); @@ -305,11 +349,11 @@ * Tests that we can get a count query for a UNION Select query. */ public function testUnionCount() { - $query_1 = db_select('test', 't') + $query_1 = $this->connection->select('test', 't') ->fields('t', ['name', 'age']) ->condition('age', [27, 28], 'IN'); - $query_2 = db_select('test', 't') + $query_2 = $this->connection->select('test', 't') ->fields('t', ['name', 'age']) ->condition('age', 28); @@ -328,12 +372,12 @@ */ public function testUnionOrder() { // This gives George and Ringo. - $query_1 = db_select('test', 't') + $query_1 = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('age', [27, 28], 'IN'); // This gives Paul. - $query_2 = db_select('test', 't') + $query_2 = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('age', 26); @@ -357,12 +401,12 @@ */ public function testUnionOrderLimit() { // This gives George and Ringo. - $query_1 = db_select('test', 't') + $query_1 = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('age', [27, 28], 'IN'); // This gives Paul. - $query_2 = db_select('test', 't') + $query_2 = $this->connection->select('test', 't') ->fields('t', ['name']) ->condition('age', 26); @@ -402,12 +446,12 @@ // after shuffling it (in other words, nearly impossible). $number_of_items = 52; while (db_query("SELECT MAX(id) FROM {test}")->fetchField() < $number_of_items) { - db_insert('test')->fields(['name' => $this->randomMachineName()])->execute(); + $this->connection->insert('test')->fields(['name' => $this->randomMachineName()])->execute(); } // First select the items in order and make sure we get an ordered list. $expected_ids = range(1, $number_of_items); - $ordered_ids = db_select('test', 't') + $ordered_ids = $this->connection->select('test', 't') ->fields('t', ['id']) ->range(0, $number_of_items) ->orderBy('id') @@ -418,7 +462,7 @@ // Now perform the same query, but instead choose a random ordering. We // expect this to contain a differently ordered version of the original // result. - $randomized_ids = db_select('test', 't') + $randomized_ids = $this->connection->select('test', 't') ->fields('t', ['id']) ->range(0, $number_of_items) ->orderRandom() @@ -431,7 +475,7 @@ // Now perform the exact same query again, and make sure the order is // different. - $randomized_ids_second_set = db_select('test', 't') + $randomized_ids_second_set = $this->connection->select('test', 't') ->fields('t', ['id']) ->range(0, $number_of_items) ->orderRandom() @@ -521,7 +565,7 @@ * Tests that aliases are renamed when they are duplicates. */ public function testSelectDuplicateAlias() { - $query = db_select('test', 't'); + $query = $this->connection->select('test', 't'); $alias1 = $query->addField('t', 'name', 'the_alias'); $alias2 = $query->addField('t', 'age', 'the_alias'); $this->assertNotIdentical($alias1, $alias2, 'Duplicate aliases are renamed.'); @@ -536,7 +580,7 @@ // Normally it would throw an exception but we are suppressing // it with the throw_exception option. $options['throw_exception'] = FALSE; - db_select('some_table_that_doesnt_exist', 't', $options) + $this->connection->select('some_table_that_doesnt_exist', 't', $options) ->fields('t') ->countQuery() ->execute(); @@ -550,7 +594,7 @@ try { // This query will fail because the table does not exist. - db_select('some_table_that_doesnt_exist', 't') + $this->connection->select('some_table_that_doesnt_exist', 't') ->fields('t') ->countQuery() ->execute(); @@ -567,7 +611,7 @@ */ public function testEmptyInCondition() { try { - db_select('test', 't') + $this->connection->select('test', 't') ->fields('t') ->condition('age', [], 'IN') ->execute(); @@ -579,7 +623,7 @@ } try { - db_select('test', 't') + $this->connection->select('test', 't') ->fields('t') ->condition('age', [], 'NOT IN') ->execute(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php Thu May 09 15:33:08 2019 +0100 @@ -13,7 +13,7 @@ * Confirms that a query can be serialized and unserialized. */ public function testSerializeQuery() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'age'); $query->condition('name', 'Ringo'); // If this doesn't work, it will throw an exception, so no need for an diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php Thu May 09 15:33:08 2019 +0100 @@ -16,7 +16,7 @@ * Confirms that a query has a tag added to it. */ public function testHasTag() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); @@ -30,7 +30,7 @@ * Tests query tagging "has all of these tags" functionality. */ public function testHasAllTags() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); @@ -45,7 +45,7 @@ * Tests query tagging "has at least one of these tags" functionality. */ public function testHasAnyTag() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); @@ -59,7 +59,7 @@ * Confirms that an extended query has a tag added to it. */ public function testExtenderHasTag() { - $query = db_select('test') + $query = $this->connection->select('test') ->extend('Drupal\Core\Database\Query\SelectExtender'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); @@ -74,7 +74,7 @@ * Tests extended query tagging "has all of these tags" functionality. */ public function testExtenderHasAllTags() { - $query = db_select('test') + $query = $this->connection->select('test') ->extend('Drupal\Core\Database\Query\SelectExtender'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); @@ -90,7 +90,7 @@ * Tests extended query tagging "has at least one of these tags" functionality. */ public function testExtenderHasAnyTag() { - $query = db_select('test') + $query = $this->connection->select('test') ->extend('Drupal\Core\Database\Query\SelectExtender'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); @@ -107,7 +107,7 @@ * This is how we pass additional context to alter hooks. */ public function testMetaData() { - $query = db_select('test'); + $query = $this->connection->select('test'); $query->addField('test', 'name'); $query->addField('test', 'age', 'age'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,7 +2,6 @@ namespace Drupal\KernelTests\Core\Database; -use Drupal\Core\Database\Database; use Drupal\Core\Database\TransactionOutOfOrderException; use Drupal\Core\Database\TransactionNoActiveException; @@ -52,31 +51,30 @@ * Whether to execute a DDL statement during the inner transaction. */ protected function transactionOuterLayer($suffix, $rollback = FALSE, $ddl_statement = FALSE) { - $connection = Database::getConnection(); - $depth = $connection->transactionDepth(); - $txn = db_transaction(); + $depth = $this->connection->transactionDepth(); + $txn = $this->connection->startTransaction(); // Insert a single row into the testing table. - db_insert('test') + $this->connection->insert('test') ->fields([ 'name' => 'David' . $suffix, 'age' => '24', ]) ->execute(); - $this->assertTrue($connection->inTransaction(), 'In transaction before calling nested transaction.'); + $this->assertTrue($this->connection->inTransaction(), 'In transaction before calling nested transaction.'); // We're already in a transaction, but we call ->transactionInnerLayer // to nest another transaction inside the current one. $this->transactionInnerLayer($suffix, $rollback, $ddl_statement); - $this->assertTrue($connection->inTransaction(), 'In transaction after calling nested transaction.'); + $this->assertTrue($this->connection->inTransaction(), 'In transaction after calling nested transaction.'); if ($rollback) { // Roll back the transaction, if requested. // This rollback should propagate to the last savepoint. $txn->rollBack(); - $this->assertTrue(($connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollBack().'); + $this->assertTrue(($this->connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollBack().'); } } @@ -94,27 +92,25 @@ * Whether to execute a DDL statement during the transaction. */ protected function transactionInnerLayer($suffix, $rollback = FALSE, $ddl_statement = FALSE) { - $connection = Database::getConnection(); - - $depth = $connection->transactionDepth(); + $depth = $this->connection->transactionDepth(); // Start a transaction. If we're being called from ->transactionOuterLayer, // then we're already in a transaction. Normally, that would make starting // a transaction here dangerous, but the database API handles this problem // for us by tracking the nesting and avoiding the danger. - $txn = db_transaction(); + $txn = $this->connection->startTransaction(); - $depth2 = $connection->transactionDepth(); + $depth2 = $this->connection->transactionDepth(); $this->assertTrue($depth < $depth2, 'Transaction depth is has increased with new transaction.'); // Insert a single row into the testing table. - db_insert('test') + $this->connection->insert('test') ->fields([ 'name' => 'Daniel' . $suffix, 'age' => '19', ]) ->execute(); - $this->assertTrue($connection->inTransaction(), 'In transaction inside nested transaction.'); + $this->assertTrue($this->connection->inTransaction(), 'In transaction inside nested transaction.'); if ($ddl_statement) { $table = [ @@ -127,16 +123,16 @@ ], 'primary key' => ['id'], ]; - db_create_table('database_test_1', $table); + $this->connection->schema()->createTable('database_test_1', $table); - $this->assertTrue($connection->inTransaction(), 'In transaction inside nested transaction.'); + $this->assertTrue($this->connection->inTransaction(), 'In transaction inside nested transaction.'); } if ($rollback) { // Roll back the transaction, if requested. // This rollback should propagate to the last savepoint. $txn->rollBack(); - $this->assertTrue(($connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollBack().'); + $this->assertTrue(($this->connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollBack().'); } } @@ -148,9 +144,10 @@ */ public function testTransactionRollBackSupported() { // This test won't work right if transactions are not supported. - if (!Database::getConnection()->supportsTransactions()) { - return; + if (!$this->connection->supportsTransactions()) { + $this->markTestSkipped("The '{$this->connection->driver()}' database driver does not support transactions."); } + try { // Create two nested transactions. Roll back from the inner one. $this->transactionOuterLayer('B', TRUE); @@ -174,9 +171,10 @@ */ public function testTransactionRollBackNotSupported() { // This test won't work right if transactions are supported. - if (Database::getConnection()->supportsTransactions()) { - return; + if ($this->connection->supportsTransactions()) { + $this->markTestSkipped("The '{$this->connection->driver()}' database driver supports transactions."); } + try { // Create two nested transactions. Attempt to roll back from the inner one. $this->transactionOuterLayer('B', TRUE); @@ -220,7 +218,7 @@ */ public function testTransactionWithDdlStatement() { // First, test that a commit works normally, even with DDL statements. - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->insertRow('row'); $this->executeDDLStatement(); unset($transaction); @@ -228,7 +226,7 @@ // Even in different order. $this->cleanUp(); - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->executeDDLStatement(); $this->insertRow('row'); unset($transaction); @@ -236,11 +234,11 @@ // Even with stacking. $this->cleanUp(); - $transaction = db_transaction(); - $transaction2 = db_transaction(); + $transaction = $this->connection->startTransaction(); + $transaction2 = $this->connection->startTransaction(); $this->executeDDLStatement(); unset($transaction2); - $transaction3 = db_transaction(); + $transaction3 = $this->connection->startTransaction(); $this->insertRow('row'); unset($transaction3); unset($transaction); @@ -248,11 +246,11 @@ // A transaction after a DDL statement should still work the same. $this->cleanUp(); - $transaction = db_transaction(); - $transaction2 = db_transaction(); + $transaction = $this->connection->startTransaction(); + $transaction2 = $this->connection->startTransaction(); $this->executeDDLStatement(); unset($transaction2); - $transaction3 = db_transaction(); + $transaction3 = $this->connection->startTransaction(); $this->insertRow('row'); $transaction3->rollBack(); unset($transaction3); @@ -260,11 +258,11 @@ $this->assertRowAbsent('row'); // The behavior of a rollback depends on the type of database server. - if (Database::getConnection()->supportsTransactionalDDL()) { + if ($this->connection->supportsTransactionalDDL()) { // For database servers that support transactional DDL, a rollback // of a transaction including DDL statements should be possible. $this->cleanUp(); - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->insertRow('row'); $this->executeDDLStatement(); $transaction->rollBack(); @@ -273,11 +271,11 @@ // Including with stacking. $this->cleanUp(); - $transaction = db_transaction(); - $transaction2 = db_transaction(); + $transaction = $this->connection->startTransaction(); + $transaction2 = $this->connection->startTransaction(); $this->executeDDLStatement(); unset($transaction2); - $transaction3 = db_transaction(); + $transaction3 = $this->connection->startTransaction(); $this->insertRow('row'); unset($transaction3); $transaction->rollBack(); @@ -288,7 +286,7 @@ // For database servers that do not support transactional DDL, // the DDL statement should commit the transaction stack. $this->cleanUp(); - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->insertRow('row'); $this->executeDDLStatement(); // Rollback the outer transaction. @@ -310,7 +308,7 @@ * Inserts a single row into the testing table. */ protected function insertRow($name) { - db_insert('test') + $this->connection->insert('test') ->fields([ 'name' => $name, ]) @@ -332,14 +330,14 @@ ], 'primary key' => ['id'], ]; - db_create_table('database_test_' . ++$count, $table); + $this->connection->schema()->createTable('database_test_' . ++$count, $table); } /** * Starts over for a new test. */ protected function cleanUp() { - db_truncate('test') + $this->connection->truncate('test') ->execute(); } @@ -380,74 +378,72 @@ */ public function testTransactionStacking() { // This test won't work right if transactions are not supported. - if (!Database::getConnection()->supportsTransactions()) { - return; + if (!$this->connection->supportsTransactions()) { + $this->markTestSkipped("The '{$this->connection->driver()}' database driver does not support transactions."); } - $database = Database::getConnection(); - // Standard case: pop the inner transaction before the outer transaction. - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->insertRow('outer'); - $transaction2 = db_transaction(); + $transaction2 = $this->connection->startTransaction(); $this->insertRow('inner'); // Pop the inner transaction. unset($transaction2); - $this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the inner transaction'); + $this->assertTrue($this->connection->inTransaction(), 'Still in a transaction after popping the inner transaction'); // Pop the outer transaction. unset($transaction); - $this->assertFalse($database->inTransaction(), 'Transaction closed after popping the outer transaction'); + $this->assertFalse($this->connection->inTransaction(), 'Transaction closed after popping the outer transaction'); $this->assertRowPresent('outer'); $this->assertRowPresent('inner'); // Pop the transaction in a different order they have been pushed. $this->cleanUp(); - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->insertRow('outer'); - $transaction2 = db_transaction(); + $transaction2 = $this->connection->startTransaction(); $this->insertRow('inner'); // Pop the outer transaction, nothing should happen. unset($transaction); $this->insertRow('inner-after-outer-commit'); - $this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the outer transaction'); + $this->assertTrue($this->connection->inTransaction(), 'Still in a transaction after popping the outer transaction'); // Pop the inner transaction, the whole transaction should commit. unset($transaction2); - $this->assertFalse($database->inTransaction(), 'Transaction closed after popping the inner transaction'); + $this->assertFalse($this->connection->inTransaction(), 'Transaction closed after popping the inner transaction'); $this->assertRowPresent('outer'); $this->assertRowPresent('inner'); $this->assertRowPresent('inner-after-outer-commit'); // Rollback the inner transaction. $this->cleanUp(); - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->insertRow('outer'); - $transaction2 = db_transaction(); + $transaction2 = $this->connection->startTransaction(); $this->insertRow('inner'); // Now rollback the inner transaction. $transaction2->rollBack(); unset($transaction2); - $this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the outer transaction'); + $this->assertTrue($this->connection->inTransaction(), 'Still in a transaction after popping the outer transaction'); // Pop the outer transaction, it should commit. $this->insertRow('outer-after-inner-rollback'); unset($transaction); - $this->assertFalse($database->inTransaction(), 'Transaction closed after popping the inner transaction'); + $this->assertFalse($this->connection->inTransaction(), 'Transaction closed after popping the inner transaction'); $this->assertRowPresent('outer'); $this->assertRowAbsent('inner'); $this->assertRowPresent('outer-after-inner-rollback'); // Rollback the inner transaction after committing the outer one. $this->cleanUp(); - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->insertRow('outer'); - $transaction2 = db_transaction(); + $transaction2 = $this->connection->startTransaction(); $this->insertRow('inner'); // Pop the outer transaction, nothing should happen. unset($transaction); - $this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the outer transaction'); + $this->assertTrue($this->connection->inTransaction(), 'Still in a transaction after popping the outer transaction'); // Now rollback the inner transaction, it should rollback. $transaction2->rollBack(); unset($transaction2); - $this->assertFalse($database->inTransaction(), 'Transaction closed after popping the inner transaction'); + $this->assertFalse($this->connection->inTransaction(), 'Transaction closed after popping the inner transaction'); $this->assertRowPresent('outer'); $this->assertRowAbsent('inner'); @@ -455,11 +451,11 @@ // In that case, an exception will be triggered because we cannot // ensure that the final result will have any meaning. $this->cleanUp(); - $transaction = db_transaction(); + $transaction = $this->connection->startTransaction(); $this->insertRow('outer'); - $transaction2 = db_transaction(); + $transaction2 = $this->connection->startTransaction(); $this->insertRow('inner'); - $transaction3 = db_transaction(); + $transaction3 = $this->connection->startTransaction(); $this->insertRow('inner2'); // Rollback the outer transaction. try { @@ -470,7 +466,7 @@ catch (TransactionOutOfOrderException $e) { $this->pass('Rolling back the outer transaction while the inner transaction is active resulted in an exception.'); } - $this->assertFalse($database->inTransaction(), 'No more in a transaction after rolling back the outer transaction'); + $this->assertFalse($this->connection->inTransaction(), 'No more in a transaction after rolling back the outer transaction'); // Try to commit one inner transaction. unset($transaction3); $this->pass('Trying to commit an inner transaction resulted in an exception.'); @@ -492,13 +488,12 @@ * Tests that transactions can continue to be used if a query fails. */ public function testQueryFailureInTransaction() { - $connection = Database::getConnection(); - $transaction = $connection->startTransaction('test_transaction'); - $connection->schema()->dropTable('test'); + $transaction = $this->connection->startTransaction('test_transaction'); + $this->connection->schema()->dropTable('test'); // Test a failed query using the query() method. try { - $connection->query('SELECT age FROM {test} WHERE name = :name', [':name' => 'David'])->fetchField(); + $this->connection->query('SELECT age FROM {test} WHERE name = :name', [':name' => 'David'])->fetchField(); $this->fail('Using the query method failed.'); } catch (\Exception $e) { @@ -507,7 +502,7 @@ // Test a failed select query. try { - $connection->select('test') + $this->connection->select('test') ->fields('test', ['name']) ->execute(); @@ -519,7 +514,7 @@ // Test a failed insert query. try { - $connection->insert('test') + $this->connection->insert('test') ->fields([ 'name' => 'David', 'age' => '24', @@ -534,7 +529,7 @@ // Test a failed update query. try { - $connection->update('test') + $this->connection->update('test') ->fields(['name' => 'Tiffany']) ->condition('id', 1) ->execute(); @@ -547,7 +542,7 @@ // Test a failed delete query. try { - $connection->delete('test') + $this->connection->delete('test') ->condition('id', 1) ->execute(); @@ -559,7 +554,7 @@ // Test a failed merge query. try { - $connection->merge('test') + $this->connection->merge('test') ->key('job', 'Presenter') ->fields([ 'age' => '31', @@ -575,7 +570,7 @@ // Test a failed upsert query. try { - $connection->upsert('test') + $this->connection->upsert('test') ->key('job') ->fields(['job', 'age', 'name']) ->values([ @@ -593,7 +588,7 @@ // Create the missing schema and insert a row. $this->installSchema('database_test', ['test']); - $connection->insert('test') + $this->connection->insert('test') ->fields([ 'name' => 'David', 'age' => '24', @@ -603,7 +598,7 @@ // Commit the transaction. unset($transaction); - $saved_age = $connection->query('SELECT age FROM {test} WHERE name = :name', [':name' => 'David'])->fetchField(); + $saved_age = $this->connection->query('SELECT age FROM {test} WHERE name = :name', [':name' => 'David'])->fetchField(); $this->assertEqual('24', $saved_age); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,7 @@ * Tests updates with OR conditionals. */ public function testOrConditionUpdate() { - $update = db_update('test') + $update = $this->connection->update('test') ->fields(['job' => 'Musician']) ->condition((new Condition('OR')) ->condition('name', 'John') @@ -32,7 +32,7 @@ * Tests WHERE IN clauses. */ public function testInConditionUpdate() { - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['job' => 'Musician']) ->condition('name', ['John', 'Paul'], 'IN') ->execute(); @@ -48,7 +48,7 @@ public function testNotInConditionUpdate() { // The o is lowercase in the 'NoT IN' operator, to make sure the operators // work in mixed case. - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['job' => 'Musician']) ->condition('name', ['John', 'Paul', 'George'], 'NoT IN') ->execute(); @@ -62,7 +62,7 @@ * Tests BETWEEN conditional clauses. */ public function testBetweenConditionUpdate() { - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['job' => 'Musician']) ->condition('age', [25, 26], 'BETWEEN') ->execute(); @@ -76,7 +76,7 @@ * Tests LIKE conditionals. */ public function testLikeConditionUpdate() { - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['job' => 'Musician']) ->condition('name', '%ge%', 'LIKE') ->execute(); @@ -91,7 +91,7 @@ */ public function testUpdateExpression() { $before_age = db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Ringo'])->fetchField(); - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->condition('name', 'Ringo') ->fields(['job' => 'Musician']) ->expression('age', 'age + :age', [':age' => 4]) @@ -112,7 +112,7 @@ */ public function testUpdateOnlyExpression() { $before_age = db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Ringo'])->fetchField(); - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->condition('name', 'Ringo') ->expression('age', 'age + :age', [':age' => 4]) ->execute(); @@ -126,12 +126,12 @@ * Test UPDATE with a subselect value. */ public function testSubSelectUpdate() { - $subselect = db_select('test_task', 't'); + $subselect = $this->connection->select('test_task', 't'); $subselect->addExpression('MAX(priority) + :increment', 'max_priority', [':increment' => 30]); // Clone this to make sure we are running a different query when // asserting. $select = clone $subselect; - $query = db_update('test') + $query = $this->connection->update('test') ->expression('age', $subselect) ->condition('name', 'Ringo'); // Save the number of rows that updated for assertion later. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php Thu May 09 15:33:08 2019 +0100 @@ -15,12 +15,12 @@ public function testUpdateOneBlob() { $data = "This is\000a test."; $this->assertTrue(strlen($data) === 15, 'Test data contains a NULL.'); - $id = db_insert('test_one_blob') + $id = $this->connection->insert('test_one_blob') ->fields(['blob1' => $data]) ->execute(); $data .= $data; - db_update('test_one_blob') + $this->connection->update('test_one_blob') ->condition('id', $id) ->fields(['blob1' => $data]) ->execute(); @@ -33,14 +33,14 @@ * Confirms that we can update two blob columns in the same table. */ public function testUpdateMultipleBlob() { - $id = db_insert('test_two_blobs') + $id = $this->connection->insert('test_two_blobs') ->fields([ 'blob1' => 'This is', 'blob2' => 'a test', ]) ->execute(); - db_update('test_two_blobs') + $this->connection->update('test_two_blobs') ->condition('id', $id) ->fields(['blob1' => 'and so', 'blob2' => 'is this']) ->execute(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php Thu May 09 15:33:08 2019 +0100 @@ -13,7 +13,7 @@ * Confirms that we can update a single record successfully. */ public function testSimpleUpdate() { - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['name' => 'Tiffany']) ->condition('id', 1) ->execute(); @@ -28,7 +28,7 @@ */ public function testSimpleNullUpdate() { $this->ensureSampleDataNull(); - $num_updated = db_update('test_null') + $num_updated = $this->connection->update('test_null') ->fields(['age' => NULL]) ->condition('name', 'Kermit') ->execute(); @@ -42,7 +42,7 @@ * Confirms that we can update multiple records successfully. */ public function testMultiUpdate() { - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['job' => 'Musician']) ->condition('job', 'Singer') ->execute(); @@ -56,7 +56,7 @@ * Confirms that we can update multiple records with a non-equality condition. */ public function testMultiGTUpdate() { - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['job' => 'Musician']) ->condition('age', 26, '>') ->execute(); @@ -70,7 +70,7 @@ * Confirms that we can update multiple records with a where call. */ public function testWhereUpdate() { - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['job' => 'Musician']) ->where('age > :age', [':age' => 26]) ->execute(); @@ -84,7 +84,7 @@ * Confirms that we can stack condition and where calls. */ public function testWhereAndConditionUpdate() { - $update = db_update('test') + $update = $this->connection->update('test') ->fields(['job' => 'Musician']) ->where('age > :age', [':age' => 26]) ->condition('name', 'Ringo'); @@ -101,7 +101,7 @@ public function testExpressionUpdate() { // Ensure that expressions are handled properly. This should set every // record's age to a square of itself. - $num_rows = db_update('test') + $num_rows = $this->connection->update('test') ->expression('age', 'age * age') ->execute(); $this->assertIdentical($num_rows, 4, 'Updated 4 records.'); @@ -120,7 +120,7 @@ // them actually don't have to be changed because their value was already // 'sleep'. Still, execute() should return 5 affected rows, not only 3, // because that's cross-db expected behavior. - $num_rows = db_update('test_task') + $num_rows = $this->connection->update('test_task') ->condition('priority', 1, '<>') ->fields(['task' => 'sleep']) ->execute(); @@ -131,7 +131,7 @@ * Confirm that we can update the primary key of a record successfully. */ public function testPrimaryKeyUpdate() { - $num_updated = db_update('test') + $num_updated = $this->connection->update('test') ->fields(['id' => 42, 'name' => 'John']) ->condition('id', 1) ->execute(); @@ -145,7 +145,7 @@ * Confirm that we can update values in a column with special name. */ public function testSpecialColumnUpdate() { - $num_updated = db_update('test_special_columns') + $num_updated = $this->connection->update('test_special_columns') ->fields(['offset' => 'New offset value']) ->condition('id', 1) ->execute(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,113 @@ +installConfig(['system']); + + $this->setSetting('locale_custom_strings_' . self::LANGCODE, [ + '' => ['Sunday' => 'domingo'], + 'Long month name' => ['March' => 'marzo'], + ]); + + $formats = $this->container->get('entity.manager') + ->getStorage('date_format') + ->loadMultiple(['long', 'medium', 'short']); + $formats['long']->setPattern('l, j. F Y - G:i')->save(); + $formats['medium']->setPattern('j. F Y - G:i')->save(); + $formats['short']->setPattern('Y M j - g:ia')->save(); + + ConfigurableLanguage::createFromLangcode(static::LANGCODE)->save(); + } + + /** + * Tests DateFormatter::format(). + * + * @covers ::format + */ + public function testFormat() { + /** @var \Drupal\Core\Datetime\DateFormatterInterface $formatter */ + $formatter = $this->container->get('date.formatter'); + /** @var \Drupal\Core\Language\LanguageManagerInterface $language_manager */ + $language_manager = $this->container->get('language_manager'); + + $timestamp = strtotime('2007-03-26T00:00:00+00:00'); + $this->assertSame('Sunday, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Test all parameters.'); + $this->assertSame('domingo, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', self::LANGCODE), 'Test translated format.'); + $this->assertSame('l, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', '\\l, d-M-y H:i:s T', 'America/Los_Angeles', self::LANGCODE), 'Test an escaped format string.'); + $this->assertSame('\\domingo, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', '\\\\l, d-M-y H:i:s T', 'America/Los_Angeles', self::LANGCODE), 'Test format containing backslash character.'); + $this->assertSame('\\l, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', '\\\\\\l, d-M-y H:i:s T', 'America/Los_Angeles', self::LANGCODE), 'Test format containing backslash followed by escaped format string.'); + $this->assertSame('Monday, 26-Mar-07 01:00:00 BST', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London', 'en'), 'Test a different time zone.'); + $this->assertSame('Thu, 01/01/1970 - 00:00', $formatter->format(0, 'custom', '', 'UTC', 'en'), 'Test custom format with empty string.'); + + // Make sure we didn't change the configuration override language. + $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); + + // Test bad format string will use the fallback format. + $this->assertSame($formatter->format($timestamp, 'fallback'), $formatter->format($timestamp, 'bad_format_string'), 'Test fallback format.'); + $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); + + // Change the default language and timezone. + $this->config('system.site')->set('default_langcode', static::LANGCODE)->save(); + date_default_timezone_set('America/Los_Angeles'); + + // Reset the language manager so new negotiations attempts will fall back on + // on the new language. + $language_manager->reset(); + $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); + + $this->assertSame('Sunday, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Test a different language.'); + $this->assertSame('Monday, 26-Mar-07 01:00:00 BST', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London'), 'Test a different time zone.'); + $this->assertSame('domingo, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T'), 'Test custom date format.'); + $this->assertSame('domingo, 25. marzo 2007 - 17:00', $formatter->format($timestamp, 'long'), 'Test long date format.'); + $this->assertSame('25. marzo 2007 - 17:00', $formatter->format($timestamp, 'medium'), 'Test medium date format.'); + $this->assertSame('2007 Mar 25 - 5:00pm', $formatter->format($timestamp, 'short'), 'Test short date format.'); + $this->assertSame('25. marzo 2007 - 17:00', $formatter->format($timestamp), 'Test default date format.'); + // Test HTML time element formats. + $this->assertSame('2007-03-25T17:00:00-0700', $formatter->format($timestamp, 'html_datetime'), 'Test html_datetime date format.'); + $this->assertSame('2007-03-25', $formatter->format($timestamp, 'html_date'), 'Test html_date date format.'); + $this->assertSame('17:00:00', $formatter->format($timestamp, 'html_time'), 'Test html_time date format.'); + $this->assertSame('03-25', $formatter->format($timestamp, 'html_yearless_date'), 'Test html_yearless_date date format.'); + $this->assertSame('2007-W12', $formatter->format($timestamp, 'html_week'), 'Test html_week date format.'); + $this->assertSame('2007-03', $formatter->format($timestamp, 'html_month'), 'Test html_month date format.'); + $this->assertSame('2007', $formatter->format($timestamp, 'html_year'), 'Test html_year date format.'); + + // Make sure we didn't change the configuration override language. + $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); + + // Test bad format string will use the fallback format. + $this->assertSame($formatter->format($timestamp, 'fallback'), $formatter->format($timestamp, 'bad_format_string'), 'Test fallback format.'); + $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); + + // HTML is not escaped by the date formatter, it must be escaped later. + $this->assertSame("", $formatter->format($timestamp, 'custom', '\<\s\c\r\i\p\t\>\a\l\e\r\t\(\'Y\'\)\;\<\/\s\c\r\i\p\t\>'), 'Script tags not removed from dates.'); + $this->assertSame('2007', $formatter->format($timestamp, 'custom', '\<\e\m\>Y\<\/\e\m\>'), 'Em tags are not removed from dates.'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,109 @@ +flag = 'Date time callback called.'; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + + $form['datetime_element'] = [ + '#title' => 'datelist test', + '#type' => 'datetime', + '#default_value' => new DrupalDateTime('2000-01-01 00:00:00'), + '#date_date_format' => ['Y-m-d'], + '#date_time_format' => ['H:i:s'], + '#date_date_element' => 'HTML Date', + '#date_time_element' => 'HTML Time', + '#date_increment' => 1, + '#date_date_callbacks' => [[$this, 'datetimecallback']], + ]; + + // Element without specifying the default value. + $form['simple_datetime_element'] = [ + '#type' => 'datetime', + '#date_date_format' => ['Y-m-d'], + '#date_time_format' => ['H:i:s'], + '#date_date_element' => 'HTML Date', + '#date_time_element' => 'HTML Time', + ]; + + $form['submit'] = [ + '#type' => 'submit', + '#value' => t('Submit'), + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) {} + + /** + * Form validation handler. + * + * @param array $form + * An associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + */ + public function validateForm(array &$form, FormStateInterface $form_state) {} + + /** + * Tests that default handlers are added even if custom are specified. + */ + public function testDatetimeElement() { + $form = \Drupal::formBuilder()->getForm($this); + $this->render($form); + + $this->assertEqual(t('Date time callback called.'), $this->flag); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,397 @@ + 'Pacific/Kwajalein', + // UTC-7, no DST. + 'zone B' => 'America/Phoenix', + // UTC+5:30, no DST. + 'user' => 'Asia/Kolkata', + 'UTC' => 'UTC', + ]; + + /** + * The test date formatted in various formats and timezones. + * + * @var array + */ + protected $formattedDates = []; + + /** + * HTML date format pattern. + * + * @var string + */ + protected $dateFormat; + + /** + * HTML time format pattern. + * + * @var string + */ + protected $timeFormat; + + /** + * The element type that is being tested ('datetime' or 'datelist'). + * + * @var string + */ + protected $elementType; + + /** + * The number of test elements on the form. + * + * @var int + */ + protected $testConditions; + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + + $form['test1'] = [ + '#title' => 'No default date, #date_timezone present', + '#type' => $this->elementType, + '#default_value' => '', + '#date_timezone' => $this->timezones['zone A'], + '#test_expect_timezone' => 'zone A', + ]; + + $form['test2'] = [ + '#title' => 'No default date, no #date_timezone', + '#type' => $this->elementType, + '#default_value' => '', + '#test_expect_timezone' => 'user', + ]; + + $form['test3'] = [ + '#title' => 'Default date present with default timezone, #date_timezone same', + '#type' => $this->elementType, + '#default_value' => $this->date, + '#date_timezone' => $this->timezones['user'], + '#test_expect_timezone' => 'user', + ]; + + $form['test4'] = [ + '#title' => 'Default date present with default timezone, #date_timezone different', + '#type' => $this->elementType, + '#default_value' => $this->date, + '#date_timezone' => $this->timezones['zone A'], + '#test_expect_timezone' => 'zone A', + ]; + + $form['test5'] = [ + '#title' => 'Default date present with default timezone, no #date_timezone', + '#type' => $this->elementType, + '#default_value' => $this->date, + '#test_expect_timezone' => 'user', + ]; + + $dateWithTimeZoneA = clone $this->date; + $dateWithTimeZoneA->setTimezone(new \DateTimeZone($this->timezones['zone A'])); + $form['test6'] = [ + '#title' => 'Default date present with unusual timezone, #date_timezone same', + '#type' => $this->elementType, + '#default_value' => $dateWithTimeZoneA, + '#date_timezone' => $this->timezones['zone A'], + '#test_expect_timezone' => 'zone A', + ]; + + $form['test7'] = [ + '#title' => 'Default date present with unusual timezone, #date_timezone different', + '#type' => $this->elementType, + '#default_value' => $dateWithTimeZoneA, + '#date_timezone' => $this->timezones['zone B'], + '#test_expect_timezone' => 'zone B', + ]; + + $form['test8'] = [ + '#title' => 'Default date present with unusual timezone, no #date_timezone', + '#type' => $this->elementType, + '#default_value' => $dateWithTimeZoneA, + '#test_expect_timezone' => 'user', + ]; + + $this->testConditions = 8; + return $form; + } + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + + $this->installConfig(['system']); + + // Setup the background time zones. + $this->timezones['php initial'] = date_default_timezone_get(); + $user = $this->createUser(); + $user->set('timezone', $this->timezones['user'])->save(); + // This also sets PHP's assumed time. + \Drupal::currentUser()->setAccount($user); + + // Set a reference date to use in tests. + $this->date = new DrupalDatetime('2000-01-01 12:00', NULL); + + // Create arrays listing the dates and times of $this->date formatted + // according to the various timezones of $this->timezones. + $this->dateFormat = DateFormat::load('html_date')->getPattern(); + $this->timeFormat = DateFormat::load('html_time')->getPattern(); + $date = clone $this->date; + foreach ($this->timezones as $label => $timezone) { + $date->setTimezone(new \DateTimeZone($timezone)); + $this->formattedDates['date'][$label] = $date->format($this->dateFormat); + $this->formattedDates['time'][$label] = $date->format($this->timeFormat); + $this->formattedDates['day'][$label] = $date->format('j'); + $this->formattedDates['month'][$label] = $date->format('n'); + $this->formattedDates['year'][$label] = $date->format('Y'); + $this->formattedDates['hour'][$label] = $date->format('G'); + $this->formattedDates['minute'][$label] = $date->format('i'); + $this->formattedDates['second'][$label] = $date->format('s'); + } + + // Validate the timezone setup. + $this->assertEquals($this->timezones['user'], drupal_get_user_timezone(), 'Subsequent tests assume specific value for drupal_get_user_timezone().'); + $this->assertEquals(drupal_get_user_timezone(), date_default_timezone_get(), "Subsequent tests may assume PHP's time is set to Drupal user's time zone."); + $this->assertEquals(drupal_get_user_timezone(), $this->date->getTimezone()->getName(), 'Subsequent tests assume DrupalDateTime objects default to Drupal user time zone if none specified'); + } + + /** + * Tests datetime elements interpret their times correctly when saving. + * + * Initial times are inevitably presented to the user using a timezone, and so + * the time must be interpreted using the same timezone when it is time to + * save the form, otherwise stored times may be changed without the user + * changing the element's values. + */ + public function testDatetimeElementTimesUnderstoodCorrectly() { + $this->assertTimesUnderstoodCorrectly('datetime', ['date', 'time']); + } + + /** + * Tests datelist elements interpret their times correctly when saving. + * + * See testDatetimeElementTimesUnderstoodCorrectly() for more explanation. + */ + public function testDatelistElementTimesUnderstoodCorrectly() { + $this->assertTimesUnderstoodCorrectly('datelist', [ + 'day', + 'month', + 'year', + 'hour', + 'minute', + 'second', + ]); + } + + /** + * On datetime elements test #date_timezone after ::processDatetime. + * + * The element's render array has a #date_timezone value that should + * accurately reflect the timezone that will be used to interpret times + * entered through the element. + */ + public function testDatetimeTimezonePropertyProcessed() { + $this->assertDateTimezonePropertyProcessed('datetime'); + } + + /** + * On datelist elements test #date_timezone after ::processDatetime. + * + * See testDatetimeTimezonePropertyProcessed() for more explanation. + */ + public function testDatelistTimezonePropertyProcessed() { + $this->assertDateTimezonePropertyProcessed('datelist'); + } + + /** + * Asserts that elements interpret dates using the expected time zones. + * + * @param string $elementType + * The element type to test. + * @param array $inputs + * The names of the default input elements used by this element type. + * + * @throws \Exception + */ + protected function assertTimesUnderstoodCorrectly($elementType, array $inputs) { + $this->elementType = $elementType; + + // Simulate the form being saved, with the user adding the date for any + // initially empty elements, but not changing other elements. + $form_state = new FormState(); + $form_builder = $this->container->get('form_builder'); + $form = $this->setupForm($form_state, $form_builder); + foreach ($form as $elementName => $element) { + if ( + isset($element['#type']) && + $element['#type'] === $this->elementType && + $element['#default_value'] === '' + ) { + $newValues = []; + // Build an array of new values for the initially empty elements, + // depending on the inputs required by the element type, and using + // the timezone that will be expected for that test element. + foreach ($inputs as $input) { + $newValues[$input] = $this->formattedDates[$input][$element['#test_expect_timezone']]; + } + $form_state->setValue([$elementName], $newValues); + } + } + $form_builder->submitForm($this, $form_state); + + // Examine the output of each test element. + $utc = new \DateTimeZone('UTC'); + $expectedDateUTC = clone $this->date; + $expectedDateUTC->setTimezone($utc)->format('Y-m-d H:i:s'); + $wrongDates = []; + $wrongTimezones = []; + $rightDates = 0; + foreach ($form_state->getCompleteForm() as $elementName => $element) { + if (isset($element['#type']) && $element['#type'] === $this->elementType) { + $actualDate = $form_state->getValue($elementName); + $actualTimezone = array_search($actualDate->getTimezone()->getName(), $this->timezones); + $actualDateUTC = $actualDate->setTimezone($utc)->format('Y-m-d H:i:s'); + + // Check that $this->date has not anywhere been accidentally changed + // from its default timezone, invalidating the test logic. + $this->assertEquals(drupal_get_user_timezone(), $this->date->getTimezone()->getName(), "Test date still set to user timezone."); + + // Build a list of cases where the result is not as expected. + // Check the time has been understood correctly. + if ($actualDate != $this->date) { + $wrongDates[$element['#title']] = $actualDateUTC; + } + else { + // Explicitly counting test passes prevents the test from seeming to + // pass just because the whole loop is being skipped. + $rightDates++; + } + // Check the correct timezone is set on the value object. + if ($element['#test_expect_timezone'] !== $actualTimezone) { + $wrongTimezones[$element['#title']] = [$element['#test_expect_timezone'], $actualTimezone]; + } + } + } + + $message = "On all elements the time should be understood correctly as $expectedDateUTC: \n" . print_r($wrongDates, TRUE); + $this->assertEquals($this->testConditions, $rightDates, $message); + $message = "On all elements the correct timezone should be set on the value object: (expected, actual) \n" . print_r($wrongTimezones, TRUE); + $this->assertCount(0, $wrongTimezones, $message); + } + + /** + * Asserts that elements set #date_timezone correctly. + * + * @param string $elementType + * The element type to test. + * + * @throws \Exception + */ + public function assertDateTimezonePropertyProcessed($elementType) { + $this->elementType = $elementType; + // Simulate form being loaded and default values displayed to user. + $form_state = new FormState(); + $form_builder = $this->container->get('form_builder'); + $this->setupForm($form_state, $form_builder); + + // Check the #date_timezone property on each processed test element. + $wrongTimezones = []; + foreach ($form_state->getCompleteForm() as $elementName => $element) { + if (isset($element['#type']) && $element['#type'] === $this->elementType) { + // Check the correct timezone is set on the value object. + $actualTimezone = array_search($element['#date_timezone'], $this->timezones, TRUE); + if ($element['#test_expect_timezone'] !== $actualTimezone) { + $wrongTimezones[$element['#title']] = [ + $element['#test_expect_timezone'], + $actualTimezone, + ]; + } + } + $this->assertEquals($this->timezones['user'], drupal_get_user_timezone(), 'Subsequent tests assume specific value for drupal_get_user_timezone().'); + $message = "The correct timezone should be set on the processed {$this->elementType} elements: (expected, actual) \n" . print_r($wrongTimezones, TRUE); + $this->assertCount(0, $wrongTimezones, $message); + } + } + + /** + * Simulate form being loaded and default values displayed to user. + * + * @param \Drupal\Core\Form\FormStateInterface $form_state + * A form_state object. + * @param \Drupal\Core\Form\FormBuilderInterface $form_builder + * A form_builder object. + * + * @return \Drupal\Core\Form\FormStateInterface + * The modified form state. + */ + protected function setupForm(FormStateInterface $form_state, FormBuilderInterface $form_builder) { + $form_id = $form_builder->getFormId($this, $form_state); + $form = $form_builder->retrieveForm($form_id, $form_state); + $form_state->setValidationEnforced(); + $form_state->clearErrors(); + $form_builder->prepareForm($form_id, $form, $form_state); + $form_builder->processForm($form_id, $form, $form_state); + return $form_builder->retrieveForm($form_id, $form_state); + } + + /** + * {@inheritdoc} + */ + public function getFormId() { + return 'test_datetime_elements'; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + } + + /** + * {@inheritdoc} + */ + public function validateForm(array &$form, FormStateInterface $form_state) { + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Datetime/FormatDateTest.php --- a/core/tests/Drupal/KernelTests/Core/Datetime/FormatDateTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -installConfig(['system']); - - $this->setSetting('locale_custom_strings_' . self::LANGCODE, [ - '' => ['Sunday' => 'domingo'], - 'Long month name' => ['March' => 'marzo'], - ]); - - $formats = $this->container->get('entity.manager') - ->getStorage('date_format') - ->loadMultiple(['long', 'medium', 'short']); - $formats['long']->setPattern('l, j. F Y - G:i')->save(); - $formats['medium']->setPattern('j. F Y - G:i')->save(); - $formats['short']->setPattern('Y M j - g:ia')->save(); - - ConfigurableLanguage::createFromLangcode(static::LANGCODE)->save(); - } - - /** - * Tests the format_date() function. - */ - public function testFormatDate() { - /** @var \Drupal\Core\Datetime\DateFormatterInterface $formatter */ - $formatter = $this->container->get('date.formatter'); - /** @var \Drupal\Core\Language\LanguageManagerInterface $language_manager */ - $language_manager = $this->container->get('language_manager'); - - $timestamp = strtotime('2007-03-26T00:00:00+00:00'); - $this->assertSame('Sunday, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Test all parameters.'); - $this->assertSame('domingo, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', self::LANGCODE), 'Test translated format.'); - $this->assertSame('l, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', '\\l, d-M-y H:i:s T', 'America/Los_Angeles', self::LANGCODE), 'Test an escaped format string.'); - $this->assertSame('\\domingo, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', '\\\\l, d-M-y H:i:s T', 'America/Los_Angeles', self::LANGCODE), 'Test format containing backslash character.'); - $this->assertSame('\\l, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', '\\\\\\l, d-M-y H:i:s T', 'America/Los_Angeles', self::LANGCODE), 'Test format containing backslash followed by escaped format string.'); - $this->assertSame('Monday, 26-Mar-07 01:00:00 BST', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London', 'en'), 'Test a different time zone.'); - $this->assertSame('Thu, 01/01/1970 - 00:00', $formatter->format(0, 'custom', '', 'UTC', 'en'), 'Test custom format with empty string.'); - - // Make sure we didn't change the configuration override language. - $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); - - // Test bad format string will use the fallback format. - $this->assertSame($formatter->format($timestamp, 'fallback'), $formatter->format($timestamp, 'bad_format_string'), 'Test fallback format.'); - $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); - - // Change the default language and timezone. - $this->config('system.site')->set('default_langcode', static::LANGCODE)->save(); - date_default_timezone_set('America/Los_Angeles'); - - // Reset the language manager so new negotiations attempts will fall back on - // on the new language. - $language_manager->reset(); - $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); - - $this->assertSame('Sunday, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Test a different language.'); - $this->assertSame('Monday, 26-Mar-07 01:00:00 BST', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London'), 'Test a different time zone.'); - $this->assertSame('domingo, 25-Mar-07 17:00:00 PDT', $formatter->format($timestamp, 'custom', 'l, d-M-y H:i:s T'), 'Test custom date format.'); - $this->assertSame('domingo, 25. marzo 2007 - 17:00', $formatter->format($timestamp, 'long'), 'Test long date format.'); - $this->assertSame('25. marzo 2007 - 17:00', $formatter->format($timestamp, 'medium'), 'Test medium date format.'); - $this->assertSame('2007 Mar 25 - 5:00pm', $formatter->format($timestamp, 'short'), 'Test short date format.'); - $this->assertSame('25. marzo 2007 - 17:00', $formatter->format($timestamp), 'Test default date format.'); - // Test HTML time element formats. - $this->assertSame('2007-03-25T17:00:00-0700', $formatter->format($timestamp, 'html_datetime'), 'Test html_datetime date format.'); - $this->assertSame('2007-03-25', $formatter->format($timestamp, 'html_date'), 'Test html_date date format.'); - $this->assertSame('17:00:00', $formatter->format($timestamp, 'html_time'), 'Test html_time date format.'); - $this->assertSame('03-25', $formatter->format($timestamp, 'html_yearless_date'), 'Test html_yearless_date date format.'); - $this->assertSame('2007-W12', $formatter->format($timestamp, 'html_week'), 'Test html_week date format.'); - $this->assertSame('2007-03', $formatter->format($timestamp, 'html_month'), 'Test html_month date format.'); - $this->assertSame('2007', $formatter->format($timestamp, 'html_year'), 'Test html_year date format.'); - - // Make sure we didn't change the configuration override language. - $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); - - // Test bad format string will use the fallback format. - $this->assertSame($formatter->format($timestamp, 'fallback'), $formatter->format($timestamp, 'bad_format_string'), 'Test fallback format.'); - $this->assertSame('en', $language_manager->getConfigOverrideLanguage()->getId(), 'Configuration override language not disturbed,'); - - // HTML is not escaped by the date formatter, it must be escaped later. - $this->assertSame("", $formatter->format($timestamp, 'custom', '\<\s\c\r\i\p\t\>\a\l\e\r\t\(\'Y\'\)\;\<\/\s\c\r\i\p\t\>'), 'Script tags not removed from dates.'); - $this->assertSame('2007', $formatter->format($timestamp, 'custom', '\<\e\m\>Y\<\/\e\m\>'), 'Em tags are not removed from dates.'); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Datetime/TimestampSchemaTest.php --- a/core/tests/Drupal/KernelTests/Core/Datetime/TimestampSchemaTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Datetime/TimestampSchemaTest.php Thu May 09 15:33:08 2019 +0100 @@ -14,7 +14,15 @@ /** * {@inheritdoc} */ - protected static $modules = ['entity_test', 'field', 'field_timestamp_test']; + protected static $modules = ['entity_test', 'field', 'field_timestamp_test', 'user']; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->installEntitySchema('entity_test'); + } /** * Tests if the timestamp field schema is validated. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php Thu May 09 15:33:08 2019 +0100 @@ -629,7 +629,7 @@ */ public function testLookupKeys() { \Drupal::service('state')->set('config_test.lookup_keys', TRUE); - \Drupal::entityManager()->clearCachedDefinitions(); + \Drupal::entityTypeManager()->clearCachedDefinitions(); $key_value = $this->container->get('keyvalue')->get(QueryFactory::CONFIG_LOOKUP_PREFIX . 'config_test'); $test_entities = []; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNonRevisionableFieldTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNonRevisionableFieldTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNonRevisionableFieldTest.php Thu May 09 15:33:08 2019 +0100 @@ -5,6 +5,7 @@ use Drupal\entity_test\Entity\EntityTestMulRev; use Drupal\entity_test\Entity\EntityTestRev; use Drupal\language\Entity\ConfigurableLanguage; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; /** * Tests non-revisionable fields on revisionable (and translatable) entities. @@ -13,6 +14,8 @@ */ class ContentEntityNonRevisionableFieldTest extends EntityKernelTestBase { + use EntityDefinitionTestTrait; + /** * Modules to enable. * @@ -179,7 +182,7 @@ */ public function testMultiColumnNonRevisionableBaseField() { \Drupal::state()->set('entity_test.multi_column', TRUE); - \Drupal::entityDefinitionUpdateManager()->applyUpdates(); + $this->applyEntityUpdates('entity_test_mulrev'); // Refresh the storage. $this->mulRev = $this->entityManager->getStorage('entity_test_mulrev'); $user1 = $this->createUser(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -52,8 +52,7 @@ // Set up the ConfigImporter object for testing. $storage_comparer = new StorageComparer( $this->container->get('config.storage.sync'), - $this->container->get('config.storage'), - $this->container->get('config.manager') + $this->container->get('config.storage') ); $config_importer = new ConfigImporter( $storage_comparer->createChangelist(), diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,7 @@ use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; /** * Tests the default table mapping class for content entities stored in SQL. @@ -16,6 +17,8 @@ */ class DefaultTableMappingIntegrationTest extends EntityKernelTestBase { + use EntityDefinitionTestTrait; + /** * The table mapping for the tested entity type. * @@ -46,11 +49,10 @@ ->setRevisionable(FALSE); $this->state->set('entity_test_mulrev.additional_base_field_definitions', $definitions); - $this->entityManager->clearCachedDefinitions(); - $this->tableMapping = $this->entityManager->getStorage('entity_test_mulrev')->getTableMapping(); + $this->tableMapping = $this->entityTypeManager->getStorage('entity_test_mulrev')->getTableMapping(); // Ensure that the tables for the new field are created. - \Drupal::entityDefinitionUpdateManager()->applyUpdates(); + $this->applyEntityUpdates('entity_test_mulrev'); } /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php Thu May 09 15:33:08 2019 +0100 @@ -135,6 +135,65 @@ } /** + * Tests that the Entity storage loads the entities in the correct order. + * + * Entities should be returned in the same order as the passed IDs. + */ + public function testLoadMultiple() { + // Entity load. + $storage = $this->container->get('entity_type.manager')->getStorage('entity_test'); + + $ids = []; + $entity = $storage->create(['name' => 'test']); + $entity->save(); + $ids[] = $entity->id(); + + $entity = $storage->create(['name' => 'test2']); + $entity->save(); + $ids[] = $entity->id(); + + // We load the entities in an initial and reverse order, with both static + // cache in place and reset, to ensure we always get the same result. + $entities = $storage->loadMultiple($ids); + $this->assertEquals($ids, array_keys($entities)); + // Reverse the order and load again. + $ids = array_reverse($ids); + $entities = $storage->loadMultiple($ids); + $this->assertEquals($ids, array_keys($entities)); + // Reverse the order again, reset the cache and load again. + $storage->resetCache(); + $ids = array_reverse($ids); + $entities = $storage->loadMultiple($ids); + $this->assertEquals($ids, array_keys($entities)); + + // Entity revision load. + $storage = $this->container->get('entity_type.manager')->getStorage('entity_test_rev'); + + $ids = []; + $entity = $storage->create(['name' => 'test_rev']); + $entity->save(); + $ids[] = $entity->getRevisionId(); + + $revision = $storage->createRevision($entity, TRUE); + $revision->save(); + $ids[] = $revision->getRevisionId(); + + $entities = $storage->loadMultipleRevisions($ids); + $this->assertEquals($ids, array_keys($entities)); + + // Reverse the order and load again. + $ids = array_reverse($ids); + $entities = $storage->loadMultipleRevisions($ids); + $this->assertEquals($ids, array_keys($entities)); + + // Reverse the order again, reset the cache and load again. + $ids = array_reverse($ids); + $storage->resetCache(); + $entities = $storage->loadMultipleRevisions($ids); + $this->assertEquals($ids, array_keys($entities)); + } + + /** * Tests that exceptions are thrown when saving or deleting an entity. */ public function testEntityStorageExceptionHandling() { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php Thu May 09 15:33:08 2019 +0100 @@ -14,7 +14,7 @@ * * @var array */ - public static $modules = ['entity_schema_test']; + public static $modules = ['entity_schema_test', 'entity_test_update']; /** * The module handler. @@ -36,6 +36,7 @@ protected function setUp() { parent::setUp(); $this->installSchema('user', ['users_data']); + $this->installEntitySchema('entity_test_update'); $this->moduleHandler = $this->container->get('module_handler'); $this->database = $this->container->get('database'); } @@ -44,13 +45,13 @@ * Tests making use of a custom bundle field. */ public function testCustomBundleFieldUsage() { - entity_test_create_bundle('custom'); + entity_test_create_bundle('custom', NULL, 'entity_test_update'); // Check that an entity with bundle entity_test does not have the custom // field. - $storage = $this->entityManager->getStorage('entity_test'); + $storage = $this->entityManager->getStorage('entity_test_update'); $entity = $storage->create([ - 'type' => 'entity_test', + 'type' => 'entity_test_update', ]); $this->assertFalse($entity->hasField('custom_bundle_field')); @@ -63,7 +64,7 @@ // Ensure that the field exists in the field map. $field_map = \Drupal::entityManager()->getFieldMap(); - $this->assertEqual($field_map['entity_test']['custom_bundle_field'], ['type' => 'string', 'bundles' => ['custom' => 'custom']]); + $this->assertEqual($field_map['entity_test_update']['custom_bundle_field'], ['type' => 'string', 'bundles' => ['custom' => 'custom']]); $entity->custom_bundle_field->value = 'swanky'; $entity->save(); @@ -80,7 +81,7 @@ $entity->delete(); /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */ $table_mapping = $storage->getTableMapping(); - $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_bundle_field')); + $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_bundle_field')->getFieldStorageDefinition()); $result = $this->database->select($table, 'f') ->fields('f') ->condition('f.entity_id', $entity->id()) @@ -91,9 +92,9 @@ // bundle is deleted. $entity = $storage->create(['type' => 'custom', 'custom_bundle_field' => 'new']); $entity->save(); - entity_test_delete_bundle('custom'); + entity_test_delete_bundle('custom', 'entity_test_update'); - $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_bundle_field'), TRUE); + $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_bundle_field')->getFieldStorageDefinition(), TRUE); $result = $this->database->select($table, 'f') ->condition('f.entity_id', $entity->id()) ->condition('deleted', 1) @@ -103,7 +104,7 @@ // Ensure that the field no longer exists in the field map. $field_map = \Drupal::entityManager()->getFieldMap(); - $this->assertFalse(isset($field_map['entity_test']['custom_bundle_field'])); + $this->assertFalse(isset($field_map['entity_test_update']['custom_bundle_field'])); // Purge field data, and check that the storage definition has been // completely removed once the data is purged. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php Thu May 09 15:33:08 2019 +0100 @@ -22,6 +22,7 @@ * * Tested hooks are: * - hook_entity_insert() and hook_ENTITY_TYPE_insert() + * - hook_entity_preload() * - hook_entity_load() and hook_ENTITY_TYPE_load() * - hook_entity_update() and hook_ENTITY_TYPE_update() * - hook_entity_predelete() and hook_ENTITY_TYPE_predelete() @@ -321,6 +322,7 @@ $node = Node::load($node->id()); $this->assertHookMessageOrder([ + 'entity_crud_hook_test_entity_preload called for type node', 'entity_crud_hook_test_entity_load called for type node', 'entity_crud_hook_test_node_load called', ]); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php Thu May 09 15:33:08 2019 +0100 @@ -91,10 +91,7 @@ // Ensure that the definition update manager reports no updates. $this->assertFalse($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that no updates are needed.'); $this->assertIdentical($this->entityDefinitionUpdateManager->getChangeSummary(), [], 'EntityDefinitionUpdateManager reports an empty change summary.'); - - // Ensure that applyUpdates() runs without error (it's not expected to do - // anything when there aren't updates). - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->assertIdentical($this->entityDefinitionUpdateManager->getChangeList(), [], 'EntityDefinitionUpdateManager reports an empty change list.'); } /** @@ -121,30 +118,86 @@ $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); // Run the update and ensure the revision table is created. - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->updateEntityTypeToRevisionable(TRUE); $this->assertTrue($this->database->schema()->tableExists('entity_test_update_revision'), 'Revision table created for entity_test_update.'); } /** - * Tests updating entity schema when there are existing entities. + * Tests updating entity schema when there are entity storage changes. */ - public function testEntityTypeUpdateWithData() { - // Save an entity. - $this->entityManager->getStorage('entity_test_update')->create()->save(); - + public function testEntityTypeUpdateWithEntityStorageChange() { // Update the entity type to be revisionable and try to apply the update. // It's expected to throw an exception. - $this->updateEntityTypeToRevisionable(); + $entity_type = $this->getUpdatedEntityTypeDefinition(TRUE, FALSE); try { - $this->entityDefinitionUpdateManager->applyUpdates(); - $this->fail('EntityStorageException thrown when trying to apply an update that requires data migration.'); + $this->entityDefinitionUpdateManager->updateEntityType($entity_type); + $this->fail('EntityStorageException thrown when trying to apply an update that requires shared table schema changes.'); } catch (EntityStorageException $e) { - $this->pass('EntityStorageException thrown when trying to apply an update that requires data migration.'); + $this->pass('EntityStorageException thrown when trying to apply an update that requires shared table schema changes.'); } } /** + * Tests updating an entity type that doesn't exist in code anymore. + * + * @covers ::updateEntityType + */ + public function testUpdateEntityTypeWithoutInCodeDefinition() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + // Remove the entity type definition. This is the same thing as removing the + // code that defines it. + $this->deleteEntityType(); + + // Add an entity index, update the entity type and check that the index has + // been created. + $this->addEntityIndex(); + $this->entityDefinitionUpdateManager->updateEntityType($entity_type); + + $this->assertTrue($this->database->schema()->indexExists('entity_test_update', 'entity_test_update__new_index'), 'Index created.'); + } + + /** + * Tests updating a fieldable entity type that doesn't exist in code anymore. + * + * @covers ::updateFieldableEntityType + */ + public function testUpdateFieldableEntityTypeWithoutInCodeDefinition() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + $field_storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_update'); + + // Remove the entity type definition. This is the same thing as removing the + // code that defines it. + $this->deleteEntityType(); + + // Rename the base table, update the fieldable entity type and check that + // the table has been renamed. + $entity_type->set('base_table', 'entity_test_update_new'); + $this->entityDefinitionUpdateManager->updateFieldableEntityType($entity_type, $field_storage_definitions); + + $this->assertTrue($this->database->schema()->tableExists('entity_test_update_new'), 'The base table has been renamed.'); + $this->assertFalse($this->database->schema()->tableExists('entity_test_update'), 'The old base table does not exist anymore.'); + } + + /** + * Tests uninstalling an entity type that doesn't exist in code anymore. + * + * @covers ::uninstallEntityType + */ + public function testUninstallEntityTypeWithoutInCodeDefinition() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + // Remove the entity type definition. This is the same thing as removing the + // code that defines it. + $this->deleteEntityType(); + + // Now uninstall it and check that the tables have been removed. + $this->entityDefinitionUpdateManager->uninstallEntityType($entity_type); + $this->assertFalse($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update does not exist anymore.'); + } + + /** * Tests creating, updating, and deleting a base field if no entities exist. */ public function testBaseFieldCreateUpdateDeleteWithoutData() { @@ -158,7 +211,7 @@ ], ]; $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertTrue($this->database->schema()->fieldExists('entity_test_update', 'new_base_field'), 'Column created in shared table for new_base_field.'); // Add an index on the base field, ensure the update manager reports it, @@ -171,7 +224,7 @@ ], ]; $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertTrue($this->database->schema()->indexExists('entity_test_update', 'entity_test_update_field__new_base_field'), 'Index created.'); // Remove the above index, ensure the update manager reports it, and the @@ -184,7 +237,7 @@ ], ]; $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertFalse($this->database->schema()->indexExists('entity_test_update', 'entity_test_update_field__new_base_field'), 'Index deleted.'); // Update the type of the base field from 'string' to 'text', ensure the @@ -198,7 +251,7 @@ ], ]; $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertFalse($this->database->schema()->fieldExists('entity_test_update', 'new_base_field'), 'Original column deleted in shared table for new_base_field.'); $this->assertTrue($this->database->schema()->fieldExists('entity_test_update', 'new_base_field__value'), 'Value column created in shared table for new_base_field.'); $this->assertTrue($this->database->schema()->fieldExists('entity_test_update', 'new_base_field__format'), 'Format column created in shared table for new_base_field.'); @@ -213,7 +266,7 @@ ], ]; $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertFalse($this->database->schema()->fieldExists('entity_test_update', 'new_base_field_value'), 'Value column deleted from shared table for new_base_field.'); $this->assertFalse($this->database->schema()->fieldExists('entity_test_update', 'new_base_field_format'), 'Format column deleted from shared table for new_base_field.'); } @@ -232,7 +285,7 @@ ], ]; $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertTrue($this->database->schema()->tableExists('entity_test_update__new_bundle_field'), 'Dedicated table created for new_bundle_field.'); // Update the type of the base field from 'string' to 'text', ensure the @@ -246,7 +299,7 @@ ], ]; $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertTrue($this->database->schema()->fieldExists('entity_test_update__new_bundle_field', 'new_bundle_field_format'), 'Format column created in dedicated table for new_base_field.'); // Remove the bundle field, ensure the update manager reports it, and the @@ -259,7 +312,7 @@ ], ]; $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertFalse($this->database->schema()->tableExists('entity_test_update__new_bundle_field'), 'Dedicated table deleted for new_bundle_field.'); } @@ -281,7 +334,7 @@ // Add a base field and run the update. Ensure the base field's column is // created and the prior saved entity data is still there. $this->addBaseField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $schema_handler = $this->database->schema(); $this->assertTrue($schema_handler->fieldExists('entity_test_update', 'new_base_field'), 'Column created in shared table for new_base_field.'); $entity = $this->entityManager->getStorage('entity_test_update')->load($entity->id()); @@ -290,7 +343,7 @@ // Remove the base field and run the update. Ensure the base field's column // is deleted and the prior saved entity data is still there. $this->removeBaseField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertFalse($schema_handler->fieldExists('entity_test_update', 'new_base_field'), 'Column deleted from shared table for new_base_field.'); $entity = $this->entityManager->getStorage('entity_test_update')->load($entity->id()); $this->assertIdentical($entity->name->value, $name, 'Entity data preserved during field deletion.'); @@ -298,7 +351,7 @@ // Add a base field with a required property and run the update. Ensure // 'not null' is not applied and thus no exception is thrown. $this->addBaseField('shape_required'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $assert = $schema_handler->fieldExists('entity_test_update', 'new_base_field__shape') && $schema_handler->fieldExists('entity_test_update', 'new_base_field__color'); $this->assertTrue($assert, 'Columns created in shared table for new_base_field.'); @@ -308,11 +361,11 @@ // definitions. See https://www.drupal.org/node/2390495. $entity->delete(); $this->removeBaseField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $assert = !$schema_handler->fieldExists('entity_test_update', 'new_base_field__shape') && !$schema_handler->fieldExists('entity_test_update', 'new_base_field__color'); $this->assert($assert, 'Columns removed from the shared table for new_base_field.'); $this->addBaseField('shape_required'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $assert = $schema_handler->fieldExists('entity_test_update', 'new_base_field__shape') && $schema_handler->fieldExists('entity_test_update', 'new_base_field__color'); $this->assertTrue($assert, 'Columns created again in shared table for new_base_field.'); $entity = $storage->create(['name' => $name]); @@ -338,7 +391,7 @@ // Add a bundle field and run the update. Ensure the bundle field's table // is created and the prior saved entity data is still there. $this->addBundleField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $schema_handler = $this->database->schema(); $this->assertTrue($schema_handler->tableExists('entity_test_update__new_bundle_field'), 'Dedicated table created for new_bundle_field.'); $entity = $this->entityManager->getStorage('entity_test_update')->load($entity->id()); @@ -347,14 +400,14 @@ // Remove the base field and run the update. Ensure the bundle field's // table is deleted and the prior saved entity data is still there. $this->removeBundleField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertFalse($schema_handler->tableExists('entity_test_update__new_bundle_field'), 'Dedicated table deleted for new_bundle_field.'); $entity = $this->entityManager->getStorage('entity_test_update')->load($entity->id()); $this->assertIdentical($entity->name->value, $name, 'Entity data preserved during field deletion.'); // Test that required columns are created as 'not null'. $this->addBundleField('shape_required'); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $message = 'The new_bundle_field_shape column is not nullable.'; $values = [ 'bundle' => $entity->bundle(), @@ -407,11 +460,11 @@ // Add the base field and run the update. $this->addBaseField('string', $entity_type_id, $base_field_revisionable); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */ $table_mapping = $storage->getTableMapping(); - $storage_definition = $this->entityManager->getLastInstalledFieldStorageDefinitions($entity_type_id)['new_base_field']; + $storage_definition = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions($entity_type_id)['new_base_field']; // Save an entity with the base field populated. $entity = $storage->create(['new_base_field' => 'foo']); @@ -425,7 +478,7 @@ // Remove the base field and apply updates. $this->removeBaseField($entity_type_id); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); // Check that the base field's column is deleted. $this->assertFalse($schema_handler->fieldExists($entity_type_id, 'new_base_field'), 'Column deleted from shared table for new_base_field.'); @@ -570,11 +623,11 @@ // Add the bundle field and run the update. $this->addBundleField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */ $table_mapping = $storage->getTableMapping(); - $storage_definition = $this->entityManager->getLastInstalledFieldStorageDefinitions('entity_test_update')['new_bundle_field']; + $storage_definition = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('entity_test_update')['new_bundle_field']; // Check that the bundle field has a dedicated table. $dedicated_table_name = $table_mapping->getDedicatedDataTableName($storage_definition); @@ -587,7 +640,7 @@ // Remove the bundle field and apply updates. $this->removeBundleField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); // Check that the table of the bundle field has been renamed to use a // 'deleted' table name. @@ -641,7 +694,7 @@ public function testBaseFieldUpdateWithExistingData() { // Add the base field and run the update. $this->addBaseField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); // Save an entity with the base field populated. $this->entityManager->getStorage('entity_test_update')->create(['new_base_field' => 'foo'])->save(); @@ -650,7 +703,7 @@ // throw an exception. $this->modifyBaseField(); try { - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->fail('FieldStorageDefinitionUpdateForbiddenException thrown when trying to update a field schema that has data.'); } catch (FieldStorageDefinitionUpdateForbiddenException $e) { @@ -664,7 +717,7 @@ public function testBundleFieldUpdateWithExistingData() { // Add the bundle field and run the update. $this->addBundleField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); // Save an entity with the bundle field populated. entity_test_create_bundle('custom'); @@ -674,7 +727,7 @@ // throw an exception. $this->modifyBundleField(); try { - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->fail('FieldStorageDefinitionUpdateForbiddenException thrown when trying to update a field schema that has data.'); } catch (FieldStorageDefinitionUpdateForbiddenException $e) { @@ -683,6 +736,25 @@ } /** + * Tests updating a bundle field when the entity type schema has changed. + */ + public function testBundleFieldUpdateWithEntityTypeSchemaUpdate() { + // Add the bundle field and run the update. + $this->addBundleField(); + $this->applyEntityUpdates(); + + // Update the entity type schema to revisionable but don't run the updates + // yet. + $this->updateEntityTypeToRevisionable(); + + // Perform a no-op update on the bundle field, which should work because + // both the storage and the storage schema are using the last installed + // entity type definition. + $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); + $entity_definition_update_manager->updateFieldStorageDefinition($entity_definition_update_manager->getFieldStorageDefinition('new_bundle_field', 'entity_test_update')); + } + + /** * Tests creating and deleting a multi-field index when there are no existing entities. */ public function testEntityIndexCreateDeleteWithoutData() { @@ -698,7 +770,9 @@ $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); // Run the update and ensure the new index is created. - $this->entityDefinitionUpdateManager->applyUpdates(); + $entity_type = \Drupal::entityTypeManager()->getDefinition('entity_test_update'); + $original = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledDefinition('entity_test_update'); + \Drupal::service('entity_type.listener')->onEntityTypeUpdate($entity_type, $original); $this->assertTrue($this->database->schema()->indexExists('entity_test_update', 'entity_test_update__new_index'), 'Index created.'); // Remove the index and ensure the update manager reports that as an @@ -713,13 +787,18 @@ $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.'); // Run the update and ensure the index is deleted. - $this->entityDefinitionUpdateManager->applyUpdates(); + $entity_type = \Drupal::entityTypeManager()->getDefinition('entity_test_update'); + $original = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledDefinition('entity_test_update'); + \Drupal::service('entity_type.listener')->onEntityTypeUpdate($entity_type, $original); $this->assertFalse($this->database->schema()->indexExists('entity_test_update', 'entity_test_update__new_index'), 'Index deleted.'); // Test that composite indexes are handled correctly when dropping and // re-creating one of their columns. $this->addEntityIndex(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $entity_type = \Drupal::entityTypeManager()->getDefinition('entity_test_update'); + $original = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledDefinition('entity_test_update'); + \Drupal::service('entity_type.listener')->onEntityTypeUpdate($entity_type, $original); + $storage_definition = $this->entityDefinitionUpdateManager->getFieldStorageDefinition('name', 'entity_test_update'); $this->entityDefinitionUpdateManager->updateFieldStorageDefinition($storage_definition); $this->assertTrue($this->database->schema()->indexExists('entity_test_update', 'entity_test_update__new_index'), 'Index created.'); @@ -741,7 +820,9 @@ // Add an entity index, run the update. Ensure that the index is created // despite having data. $this->addEntityIndex(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $entity_type = \Drupal::entityTypeManager()->getDefinition('entity_test_update'); + $original = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledDefinition('entity_test_update'); + \Drupal::service('entity_type.listener')->onEntityTypeUpdate($entity_type, $original); $this->assertTrue($this->database->schema()->indexExists('entity_test_update', 'entity_test_update__new_index'), 'Index added.'); } @@ -754,77 +835,31 @@ $event_subscriber->enableEventTracking(); // Test field storage definition events. - $storage_definition = current($this->entityManager->getFieldStorageDefinitions('entity_test_rev')); + $storage_definition = current(\Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_rev')); $this->assertFalse($event_subscriber->hasEventFired(FieldStorageDefinitionEvents::DELETE), 'Entity type delete was not dispatched yet.'); - $this->entityManager->onFieldStorageDefinitionDelete($storage_definition); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionDelete($storage_definition); $this->assertTrue($event_subscriber->hasEventFired(FieldStorageDefinitionEvents::DELETE), 'Entity type delete event successfully dispatched.'); $this->assertFalse($event_subscriber->hasEventFired(FieldStorageDefinitionEvents::CREATE), 'Entity type create was not dispatched yet.'); - $this->entityManager->onFieldStorageDefinitionCreate($storage_definition); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definition); $this->assertTrue($event_subscriber->hasEventFired(FieldStorageDefinitionEvents::CREATE), 'Entity type create event successfully dispatched.'); $this->assertFalse($event_subscriber->hasEventFired(FieldStorageDefinitionEvents::UPDATE), 'Entity type update was not dispatched yet.'); - $this->entityManager->onFieldStorageDefinitionUpdate($storage_definition, $storage_definition); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionUpdate($storage_definition, $storage_definition); $this->assertTrue($event_subscriber->hasEventFired(FieldStorageDefinitionEvents::UPDATE), 'Entity type update event successfully dispatched.'); // Test entity type events. - $entity_type = $this->entityManager->getDefinition('entity_test_rev'); + $entity_type = $this->entityTypeManager->getDefinition('entity_test_rev'); $this->assertFalse($event_subscriber->hasEventFired(EntityTypeEvents::CREATE), 'Entity type create was not dispatched yet.'); - $this->entityManager->onEntityTypeCreate($entity_type); + \Drupal::service('entity_type.listener')->onEntityTypeCreate($entity_type); $this->assertTrue($event_subscriber->hasEventFired(EntityTypeEvents::CREATE), 'Entity type create event successfully dispatched.'); $this->assertFalse($event_subscriber->hasEventFired(EntityTypeEvents::UPDATE), 'Entity type update was not dispatched yet.'); - $this->entityManager->onEntityTypeUpdate($entity_type, $entity_type); + \Drupal::service('entity_type.listener')->onEntityTypeUpdate($entity_type, $entity_type); $this->assertTrue($event_subscriber->hasEventFired(EntityTypeEvents::UPDATE), 'Entity type update event successfully dispatched.'); $this->assertFalse($event_subscriber->hasEventFired(EntityTypeEvents::DELETE), 'Entity type delete was not dispatched yet.'); - $this->entityManager->onEntityTypeDelete($entity_type); + \Drupal::service('entity_type.listener')->onEntityTypeDelete($entity_type); $this->assertTrue($event_subscriber->hasEventFired(EntityTypeEvents::DELETE), 'Entity type delete event successfully dispatched.'); } /** - * Tests updating entity schema and creating a base field. - * - * This tests updating entity schema and creating a base field at the same - * time when there are no existing entities. - */ - public function testEntityTypeSchemaUpdateAndBaseFieldCreateWithoutData() { - $this->updateEntityTypeToRevisionable(); - $this->addBaseField(); - $message = 'Successfully updated entity schema and created base field at the same time.'; - // Entity type updates create base fields as well, thus make sure doing both - // at the same time does not lead to errors due to the base field being - // created twice. - try { - $this->entityDefinitionUpdateManager->applyUpdates(); - $this->pass($message); - } - catch (\Exception $e) { - $this->fail($message); - throw $e; - } - } - - /** - * Tests updating entity schema and creating a revisionable base field. - * - * This tests updating entity schema and creating a revisionable base field - * at the same time when there are no existing entities. - */ - public function testEntityTypeSchemaUpdateAndRevisionableBaseFieldCreateWithoutData() { - $this->updateEntityTypeToRevisionable(); - $this->addRevisionableBaseField(); - $message = 'Successfully updated entity schema and created revisionable base field at the same time.'; - // Entity type updates create base fields as well, thus make sure doing both - // at the same time does not lead to errors due to the base field being - // created twice. - try { - $this->entityDefinitionUpdateManager->applyUpdates(); - $this->pass($message); - } - catch (\Exception $e) { - $this->fail($message); - throw $e; - } - } - - /** * Tests applying single updates. */ public function testSingleActionCalls() { @@ -853,13 +888,6 @@ $this->pass($message); } - // Ensure that a non-existing field cannot be installed. - $storage_definition = BaseFieldDefinition::create('string') - ->setLabel(t('A new revisionable base field')) - ->setRevisionable(TRUE); - $this->entityDefinitionUpdateManager->installFieldStorageDefinition('bar', 'entity_test_update', 'entity_test', $storage_definition); - $this->assertFalse($db_schema->fieldExists('entity_test_update', 'bar'), "A non-existing field cannot be installed."); - // Ensure that installing an existing entity type is a no-op. $entity_type = $this->entityDefinitionUpdateManager->getEntityType('entity_test_update'); $this->entityDefinitionUpdateManager->installEntityType($entity_type); @@ -902,11 +930,8 @@ // Make the entity type revisionable. $this->updateEntityTypeToRevisionable(); $this->assertFalse($db_schema->tableExists('entity_test_update_revision'), "The 'entity_test_update_revision' does not exist before applying the update."); - $entity_type = $this->entityDefinitionUpdateManager->getEntityType('entity_test_update'); - $keys = $entity_type->getKeys(); - $keys['revision'] = 'revision_id'; - $entity_type->set('entity_keys', $keys); - $this->entityDefinitionUpdateManager->updateEntityType($entity_type); + + $this->updateEntityTypeToRevisionable(TRUE); $this->assertTrue($db_schema->tableExists('entity_test_update_revision'), "The 'entity_test_update_revision' table has been created."); } @@ -918,7 +943,7 @@ public function testCreateFieldAndIndexOnSharedTable() { $this->addBaseField(); $this->addBaseFieldIndex(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->assertTrue($this->database->schema()->fieldExists('entity_test_update', 'new_base_field'), "New field 'new_base_field' has been created on the 'entity_test_update' table."); $this->assertTrue($this->database->schema()->indexExists('entity_test_update', 'entity_test_update_field__new_base_field'), "New index 'entity_test_update_field__new_base_field' has been created on the 'entity_test_update' table."); // Check index size in for MySQL. @@ -945,7 +970,10 @@ 'entity_test_update__type_index' => ['type'], ]; $this->state->set('entity_test_update.additional_entity_indexes', $indexes); - $this->entityDefinitionUpdateManager->applyUpdates(); + $entity_type = \Drupal::entityTypeManager()->getDefinition('entity_test_update'); + $original = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledDefinition('entity_test_update'); + \Drupal::service('entity_type.listener')->onEntityTypeUpdate($entity_type, $original); + $this->assertTrue($this->database->schema()->indexExists('entity_test_update', 'entity_test_update__type_index'), "New index 'entity_test_update__type_index' has been created on the 'entity_test_update' table."); // Check index size in for MySQL. if (Database::getConnection()->driver() == 'mysql') { @@ -960,7 +988,7 @@ public function testBaseFieldEntityKeyUpdateWithExistingData() { // Add the base field and run the update. $this->addBaseField(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); // Save an entity with the base field populated. $this->entityManager->getStorage('entity_test_update')->create(['new_base_field' => $this->randomString()])->save(); @@ -982,7 +1010,7 @@ // Try to apply the update and verify they fail since we have a NULL value. $message = 'An error occurs when trying to enabling NOT NULL constraints with NULL data.'; try { - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->fail($message); } catch (EntityStorageException $e) { @@ -992,7 +1020,7 @@ // Check that the update is correctly applied when no NULL data is left. $entity->set('new_base_field', $this->randomString()); $entity->save(); - $this->entityDefinitionUpdateManager->applyUpdates(); + $this->applyEntityUpdates(); $this->pass('The update is correctly performed when no NULL data exists.'); // Check that the update actually applied a NOT NULL constraint. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -18,7 +18,17 @@ /** * {@inheritdoc} */ - public static $modules = ['entity_test', 'entity_test_third_party', 'field', 'system', 'comment']; + public static $modules = ['entity_test', 'entity_test_third_party', 'field', 'system', 'comment', 'user']; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->installEntitySchema('comment'); + $this->installEntitySchema('entity_test'); + $this->installSchema('user', ['users_data']); + } /** * @covers ::preSave diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -118,8 +118,12 @@ }) ->shouldBeCalled(); - $form_object = new EntityViewDisplayEditForm($this->container->get('plugin.manager.field.field_type'), $this->container->get('plugin.manager.field.formatter')); - $form_object->setEntityManager($this->container->get('entity.manager')); + $form_object = new EntityViewDisplayEditForm( + $this->container->get('plugin.manager.field.field_type'), + $this->container->get('plugin.manager.field.formatter'), + $this->container->get('entity_display.repository'), + $this->container->get('entity_field.manager') + ); $form_object->setEntity($entity->reveal()); $form = [ diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php Thu May 09 15:33:08 2019 +0100 @@ -137,19 +137,19 @@ $this->assertTrue($entity->user_id[0] instanceof FieldItemInterface, format_string('%entity_type: Field item implements interface', ['%entity_type' => $entity_type])); $this->assertEqual($this->entityUser->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', ['%entity_type' => $entity_type])); - $this->assertEqual($this->entityUser->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', ['%entity_type' => $entity_type])); + $this->assertEqual($this->entityUser->getAccountName(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', ['%entity_type' => $entity_type])); // Change the assigned user by entity. $new_user1 = $this->createUser(); $entity->user_id->entity = $new_user1; $this->assertEqual($new_user1->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', ['%entity_type' => $entity_type])); - $this->assertEqual($new_user1->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', ['%entity_type' => $entity_type])); + $this->assertEqual($new_user1->getAccountName(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', ['%entity_type' => $entity_type])); // Change the assigned user by id. $new_user2 = $this->createUser(); $entity->user_id->target_id = $new_user2->id(); $this->assertEqual($new_user2->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', ['%entity_type' => $entity_type])); - $this->assertEqual($new_user2->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', ['%entity_type' => $entity_type])); + $this->assertEqual($new_user2->getAccountName(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', ['%entity_type' => $entity_type])); // Try unsetting a field property. $entity->name->value = NULL; @@ -162,12 +162,12 @@ // Change the assigned user by entity. $entity->user_id->first()->get('entity')->setValue($new_user2); $this->assertEqual($new_user2->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', ['%entity_type' => $entity_type])); - $this->assertEqual($new_user2->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', ['%entity_type' => $entity_type])); + $this->assertEqual($new_user2->getAccountName(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', ['%entity_type' => $entity_type])); // Change the assigned user by id. $entity->user_id->first()->get('target_id')->setValue($new_user2->id()); $this->assertEqual($new_user2->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', ['%entity_type' => $entity_type])); - $this->assertEqual($new_user2->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', ['%entity_type' => $entity_type])); + $this->assertEqual($new_user2->getAccountName(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', ['%entity_type' => $entity_type])); // Try unsetting a field. $entity->name->first()->get('value')->setValue(NULL); @@ -272,7 +272,7 @@ ]); $this->assertEqual($this->entityName, $entity->name->value, format_string('%entity_type: Name value can be read.', ['%entity_type' => $entity_type])); $this->assertEqual($this->entityUser->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', ['%entity_type' => $entity_type])); - $this->assertEqual($this->entityUser->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', ['%entity_type' => $entity_type])); + $this->assertEqual($this->entityUser->getAccountName(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', ['%entity_type' => $entity_type])); $this->assertEqual($this->entityFieldText, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', ['%entity_type' => $entity_type])); // Tests copying field values by assigning the TypedData objects. @@ -392,7 +392,7 @@ $this->assertEqual('en', $entity->{$langcode_key}->value, format_string('%entity_type: Language code can be read.', ['%entity_type' => $entity_type])); $this->assertEqual(\Drupal::languageManager()->getLanguage('en'), $entity->{$langcode_key}->language, format_string('%entity_type: Language object can be read.', ['%entity_type' => $entity_type])); $this->assertEqual($this->entityUser->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', ['%entity_type' => $entity_type])); - $this->assertEqual($this->entityUser->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', ['%entity_type' => $entity_type])); + $this->assertEqual($this->entityUser->getAccountName(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', ['%entity_type' => $entity_type])); $this->assertEqual($this->entityFieldText, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', ['%entity_type' => $entity_type])); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -4,14 +4,23 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\KernelTests\KernelTestBase; -use Drupal\user\Entity\Role; -use Drupal\user\Entity\User; +use Drupal\Tests\user\Traits\UserCreationTrait; /** * Defines an abstract test base for entity kernel tests. */ abstract class EntityKernelTestBase extends KernelTestBase { + use UserCreationTrait { + checkPermissions as drupalCheckPermissions; + createAdminRole as drupalCreateAdminRole; + createRole as drupalCreateRole; + createUser as drupalCreateUser; + grantPermissions as drupalGrantPermissions; + setCurrentUser as drupalSetCurrentUser; + setUpCurrentUser as drupalSetUpCurrentUser; + } + /** * Modules to enable. * @@ -27,6 +36,13 @@ protected $entityManager; /** + * The entity type manager service. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + + /** * A list of generated identifiers. * * @var array @@ -44,6 +60,7 @@ parent::setUp(); $this->entityManager = $this->container->get('entity.manager'); + $this->entityTypeManager = $this->container->get('entity_type.manager'); $this->state = $this->container->get('state'); $this->installSchema('system', 'sequences'); @@ -70,8 +87,8 @@ // enabled in. The comment, node and taxonomy config and the // taxonomy_term schema need to be installed before the forum config // which in turn needs to be installed before field config. + $this->installEntitySchema('taxonomy_term'); $this->installConfig(['comment', 'node', 'taxonomy']); - $this->installEntitySchema('taxonomy_term'); $this->installConfig(['forum']); } } @@ -94,24 +111,7 @@ * The created user entity. */ protected function createUser($values = [], $permissions = []) { - if ($permissions) { - // Create a new role and apply permissions to it. - $role = Role::create([ - 'id' => strtolower($this->randomMachineName(8)), - 'label' => $this->randomMachineName(8), - ]); - $role->save(); - user_role_grant_permissions($role->id(), $permissions); - $values['roles'][] = $role->id(); - } - - $account = User::create($values + [ - 'name' => $this->randomMachineName(), - 'status' => 1, - ]); - $account->enforceIsNew(); - $account->save(); - return $account; + return $this->drupalCreateUser($permissions ?: [], NULL, FALSE, $values ?: []); } /** @@ -170,6 +170,7 @@ protected function refreshServices() { $this->container = \Drupal::getContainer(); $this->entityManager = $this->container->get('entity.manager'); + $this->entityTypeManager = $this->container->get('entity_type.manager'); $this->state = $this->container->get('state'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,29 @@ +createUser(); + } + + /** + * Tests that the current user is set up correctly. + */ + public function testSetUpCurrentUser() { + $account = $this->setUpCurrentUser(); + $current_user = \Drupal::currentUser(); + $this->assertSame($account->id(), $current_user->id()); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityLegacyTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityLegacyTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,54 @@ +installEntitySchema('entity_test'); + $this->installEntitySchema('entity_test_mul'); + } + + /** + * @expectedDeprecation entity_load_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage's loadMultiple() method. See https://www.drupal.org/node/2266845 + * @expectedDeprecation entity_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage's load() method. See https://www.drupal.org/node/2266845 + */ + public function testEntityLegacyCode() { + $this->assertCount(0, entity_load_multiple('entity_test')); + $this->assertCount(0, entity_load_multiple('entity_test_mul')); + + EntityTest::create(['name' => 'published entity'])->save(); + $this->assertCount(1, entity_load_multiple('entity_test')); + $this->assertCount(0, entity_load_multiple('entity_test_mul')); + + EntityTest::create(['name' => 'published entity'])->save(); + EntityTestMul::create(['name' => 'published entity'])->save(); + $this->assertCount(2, entity_load_multiple('entity_test')); + $this->assertCount(1, entity_load_multiple('entity_test_mul')); + + $this->assertNull(entity_load('entity_test', 100)); + $this->assertInstanceOf(EntityInterface::class, entity_load('entity_test', 1)); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php Thu May 09 15:33:08 2019 +0100 @@ -542,6 +542,38 @@ } /** + * Tests preparing a query and executing twice. + */ + public function testRepeatedExecution() { + $query = $this->entityStorage->getAggregateQuery() + ->groupBy('user_id'); + + $this->queryResult = $query->execute(); + $this->assertResults([ + ['user_id' => 1], + ['user_id' => 2], + ['user_id' => 3], + ]); + + $entity = $this->entityStorage->create([ + 'id' => 7, + 'user_id' => 4, + 'field_test_1' => 42, + 'field_test_2' => 68, + ]); + $entity->enforceIsNew(); + $entity->save(); + + $this->queryResult = $query->execute(); + $this->assertResults([ + ['user_id' => 1], + ['user_id' => 2], + ['user_id' => 3], + ['user_id' => 4], + ]); + } + + /** * Asserts the results as expected regardless of order between and in rows. * * @param array $expected diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php Thu May 09 15:33:08 2019 +0100 @@ -114,12 +114,12 @@ // This returns the 0th entity as that's the only one pointing to the 0th // account. $this->queryResults = $storage->getQuery() - ->condition("user_id.entity.name", $this->accounts[0]->getUsername()) + ->condition("user_id.entity.name", $this->accounts[0]->getAccountName()) ->execute(); $this->assertResults([0]); // This returns the 1st and 2nd entity as those point to the 1st account. $this->queryResults = $storage->getQuery() - ->condition("user_id.entity.name", $this->accounts[0]->getUsername(), '<>') + ->condition("user_id.entity.name", $this->accounts[0]->getAccountName(), '<>') ->execute(); $this->assertResults([1, 2]); // This returns all three entities because all of them point to an @@ -153,12 +153,12 @@ // This returns the 0th entity as that's only one pointing to the 0th // account. $this->queryResults = $storage->getQuery() - ->condition("user_id.entity:user.name", $this->accounts[0]->getUsername()) + ->condition("user_id.entity:user.name", $this->accounts[0]->getAccountName()) ->execute(); $this->assertResults([0]); // This returns the 1st and 2nd entity as those point to the 1st account. $this->queryResults = $storage->getQuery() - ->condition("user_id.entity:user.name", $this->accounts[0]->getUsername(), '<>') + ->condition("user_id.entity:user.name", $this->accounts[0]->getAccountName(), '<>') ->execute(); $this->assertResults([1, 2]); // This returns all three entities because all of them point to an diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php Thu May 09 15:33:08 2019 +0100 @@ -384,7 +384,7 @@ ->setSetting('handler', 'default'), ]; $this->state->set('entity_test_update.additional_base_field_definitions', $definitions); - $this->entityManager->clearCachedDefinitions(); + $this->entityTypeManager->clearCachedDefinitions(); $this->installEntitySchema($entity_type->id()); // Create the target entity. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,325 @@ +entityTypeManager = $this->container->get('entity_type.manager'); + $this->entityRepository = $this->container->get('entity.repository'); + + $this->setUpCurrentUser(); + + $this->installEntitySchema('entity_test'); + $this->installEntitySchema('entity_test_rev'); + $this->installEntitySchema('entity_test_mul'); + $this->installEntitySchema('entity_test_mulrev'); + + $this->installConfig(['system', 'language']); + ConfigurableLanguage::createFromLangcode('it') + ->setWeight(1) + ->save(); + ConfigurableLanguage::createFromLangcode('ro') + ->setWeight(2) + ->save(); + + $this->container->get('state')->set('entity_test.translation', TRUE); + $this->container->get('entity_type.bundle.info')->clearCachedBundles(); + } + + /** + * Tests retrieving active variants. + * + * @covers ::getActive + * @covers ::getActiveMultiple + */ + public function testGetActive() { + $en_contexts = $this->getLanguageContexts('en'); + + // Check that when the entity does not exist NULL is returned. + $entity_type_id = 'entity_test'; + $active = $this->entityRepository->getActive($entity_type_id, -1); + $this->assertNull($active); + + // Check that the correct active variant is returned for a non-translatable, + // non-revisionable entity. + /** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */ + $storage = $this->entityTypeManager->getStorage($entity_type_id); + $values = ['name' => $this->randomString()]; + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ + $entity = $storage->create($values); + $storage->save($entity); + $entity = $storage->load($entity->id()); + /** @var \Drupal\Core\Entity\ContentEntityInterface $active */ + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $en_contexts); + $this->assertSame($entity, $active); + + // Check that the correct active variant is returned for a non-translatable + // revisionable entity. + $entity_type_id = 'entity_test_rev'; + $storage = $this->entityTypeManager->getStorage($entity_type_id); + $values = ['name' => $this->randomString()]; + $entity = $storage->create($values); + $storage->save($entity); + + /** @var \Drupal\Core\Entity\ContentEntityInterface $revision */ + $revision = $storage->createRevision($entity, FALSE); + $revision->save(); + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $en_contexts); + $this->assertEntityType($active, $entity_type_id); + $this->assertSame($revision->getLoadedRevisionId(), $active->getLoadedRevisionId()); + + /** @var \Drupal\Core\Entity\ContentEntityInterface $revision2 */ + $revision2 = $storage->createRevision($revision); + $revision2->save(); + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $en_contexts); + $this->assertSame($revision2->getLoadedRevisionId(), $active->getLoadedRevisionId()); + + // Check that the correct active variant is returned for a translatable + // non-revisionable entity. + $entity_type_id = 'entity_test_mul'; + $storage = $this->entityTypeManager->getStorage($entity_type_id); + $values = ['name' => $this->randomString()]; + $entity = $storage->create($values); + $storage->save($entity); + + $langcode = 'it'; + /** @var \Drupal\Core\Entity\ContentEntityInterface $translation */ + $translation = $entity->addTranslation($langcode, $values); + $storage->save($translation); + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $en_contexts); + $this->assertEntityType($active, $entity_type_id); + $this->assertSame($entity->language()->getId(), $active->language()->getId()); + + $it_contexts = $this->getLanguageContexts($langcode); + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $it_contexts); + $this->assertSame($translation->language()->getId(), $active->language()->getId()); + + // Check that the correct active variant is returned for a translatable and + // revisionable entity. + $entity_type_id = 'entity_test_mulrev'; + $storage = $this->entityTypeManager->getStorage($entity_type_id); + $values = ['name' => $this->randomString()]; + $entity = $storage->create($values); + $storage->save($entity); + + /** @var \Drupal\Core\Entity\ContentEntityInterface $en_revision */ + $en_revision = $storage->createRevision($entity, FALSE); + $storage->save($en_revision); + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $en_contexts); + $this->assertEntityType($active, $entity_type_id); + $this->assertSame($en_revision->getLoadedRevisionId(), $active->getLoadedRevisionId()); + + $revision_translation = $en_revision->addTranslation($langcode, $values); + /** @var \Drupal\Core\Entity\ContentEntityInterface $it_revision */ + $it_revision = $storage->createRevision($revision_translation, FALSE); + $storage->save($it_revision); + + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $en_contexts); + $this->assertSame($en_revision->getLoadedRevisionId(), $active->getLoadedRevisionId()); + $this->assertSame($en_revision->language()->getId(), $active->language()->getId()); + + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $it_contexts); + $this->assertSame($it_revision->getLoadedRevisionId(), $active->getLoadedRevisionId()); + $this->assertSame($it_revision->language()->getId(), $active->language()->getId()); + + /** @var \Drupal\Core\Entity\ContentEntityInterface $en_revision2 */ + $en_revision2 = $storage->createRevision($en_revision); + $storage->save($en_revision2); + + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $en_contexts); + $this->assertSame($en_revision2->getLoadedRevisionId(), $active->getLoadedRevisionId()); + $this->assertSame($en_revision2->language()->getId(), $active->language()->getId()); + + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $it_contexts); + $this->assertSame($it_revision->getLoadedRevisionId(), $active->getLoadedRevisionId()); + $this->assertSame($it_revision->language()->getId(), $active->language()->getId()); + + /** @var \Drupal\Core\Entity\ContentEntityInterface $it_revision2 */ + $it_revision2 = $storage->createRevision($it_revision); + $storage->save($it_revision2); + + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $en_contexts); + $this->assertSame($it_revision2->getLoadedRevisionId(), $active->getLoadedRevisionId()); + $this->assertSame($it_revision2->getUntranslated()->language()->getId(), $active->language()->getId()); + + $active = $this->entityRepository->getActive($entity_type_id, $entity->id(), $it_contexts); + $this->assertSame($it_revision2->getLoadedRevisionId(), $active->getLoadedRevisionId()); + $this->assertSame($it_revision2->language()->getId(), $active->language()->getId()); + + /** @var \Drupal\entity_test\Entity\EntityTestMulRev $entity2 */ + $entity2 = $storage->create($values); + $storage->save($entity2); + /** @var \Drupal\Core\Entity\ContentEntityInterface[] $active */ + $active = $this->entityRepository->getActiveMultiple($entity_type_id, [$entity->id(), $entity2->id()], $it_contexts); + $this->assertSame($it_revision2->getLoadedRevisionId(), $active[$entity->id()]->getLoadedRevisionId()); + $this->assertSame($it_revision2->language()->getId(), $active[$entity->id()]->language()->getId()); + $this->assertSame($entity2->getLoadedRevisionId(), $active[$entity2->id()]->getLoadedRevisionId()); + $this->assertSame($entity2->language()->getId(), $active[$entity2->id()]->language()->getId()); + + $this->doTestLanguageFallback('getActive'); + } + + /** + * Tests retrieving canonical variants. + * + * @covers ::getCanonical + * @covers ::getCanonicalMultiple + */ + public function testGetCanonical() { + // Check that when the entity does not exist NULL is returned. + $entity_type_id = 'entity_test_mul'; + $canonical = $this->entityRepository->getActive($entity_type_id, -1); + $this->assertNull($canonical); + + // Check that the correct language fallback rules are applied. + $storage = $this->entityTypeManager->getStorage($entity_type_id); + $values = ['name' => $this->randomString()]; + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ + $entity = $storage->create($values); + $storage->save($entity); + + $langcode = 'it'; + $it_contexts = $this->getLanguageContexts($langcode); + $canonical = $this->entityRepository->getCanonical($entity_type_id, $entity->id(), $it_contexts); + $this->assertSame($entity->getUntranslated()->language()->getId(), $canonical->language()->getId()); + + /** @var \Drupal\Core\Entity\ContentEntityInterface $translation */ + $translation = $entity->addTranslation($langcode, $values); + $storage->save($translation); + $canonical = $this->entityRepository->getCanonical($entity_type_id, $entity->id(), $it_contexts); + $this->assertSame($translation->language()->getId(), $canonical->language()->getId()); + + $canonical = $this->entityRepository->getCanonical($entity_type_id, $entity->id()); + $this->assertSame($entity->getUntranslated()->language()->getId(), $canonical->language()->getId()); + + /** @var \Drupal\entity_test\Entity\EntityTestMul $entity2 */ + $entity2 = $storage->create($values); + $storage->save($entity2); + /** @var \Drupal\Core\Entity\ContentEntityInterface[] $canonical */ + $canonical = $this->entityRepository->getCanonicalMultiple($entity_type_id, [$entity->id(), $entity2->id()], $it_contexts); + $this->assertSame($translation->language()->getId(), $canonical[$entity->id()]->language()->getId()); + $this->assertSame($entity2->language()->getId(), $canonical[$entity2->id()]->language()->getId()); + + $this->doTestLanguageFallback('getCanonical'); + } + + /** + * Check that language fallback is applied. + * + * @param string $method_name + * An entity repository method name. + */ + protected function doTestLanguageFallback($method_name) { + $entity_type_id = 'entity_test_mulrev'; + $en_contexts = $this->getLanguageContexts('en'); + $it_contexts = $this->getLanguageContexts('it'); + $ro_contexts = $this->getLanguageContexts('ro'); + + /** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */ + $storage = $this->entityTypeManager->getStorage($entity_type_id); + $values = ['name' => $this->randomString()]; + + /** @var \Drupal\entity_test\Entity\EntityTestMulRev $entity3 */ + $entity3 = $storage->create(['langcode' => 'it'] + $values); + $entity3->addTranslation('ro', $values); + $storage->save($entity3); + /** @var \Drupal\entity_test\Entity\EntityTestMulRev $active */ + $active = $this->entityRepository->{$method_name}($entity_type_id, $entity3->id(), $en_contexts); + $this->assertSame('it', $active->language()->getId()); + + $active = $this->entityRepository->{$method_name}($entity_type_id, $entity3->id(), $ro_contexts); + $this->assertSame('ro', $active->language()->getId()); + + /** @var \Drupal\entity_test\Entity\EntityTestMulRev $entity4 */ + $entity4 = $storage->create(['langcode' => 'ro'] + $values); + $entity4->addTranslation('en', $values); + $storage->save($entity4); + $active = $this->entityRepository->{$method_name}($entity_type_id, $entity4->id(), $it_contexts); + $this->assertSame('en', $active->language()->getId()); + + /** @var \Drupal\entity_test\Entity\EntityTestMulRev $entity5 */ + $entity5 = $storage->create(['langcode' => 'ro'] + $values); + $storage->save($entity5); + $active = $this->entityRepository->{$method_name}($entity_type_id, $entity5->id(), $it_contexts); + $this->assertSame('ro', $active->language()->getId()); + $active = $this->entityRepository->{$method_name}($entity_type_id, $entity5->id(), $en_contexts); + $this->assertSame('ro', $active->language()->getId()); + } + + /** + * Asserts that the entity has the expected entity type ID + * + * @param object|null $entity + * An entity object or NULL. + * @param string $expected_entity_type_id + * The expected entity type ID. + */ + protected function assertEntityType($entity, $expected_entity_type_id) { + $this->assertTrue($entity instanceof EntityTest && $entity->getEntityTypeId() === $expected_entity_type_id); + } + + /** + * Returns a set of language contexts matching the specified language. + * + * @param string $langcode + * A language code. + * + * @return \Drupal\Core\Plugin\Context\ContextInterface[] + * An array of contexts. + */ + protected function getLanguageContexts($langcode) { + $prefix = '@language.current_language_context:'; + return [ + $prefix . LanguageInterface::TYPE_INTERFACE => new Context(new ContextDefinition('language'), $langcode), + $prefix . LanguageInterface::TYPE_CONTENT => new Context(new ContextDefinition('language'), $langcode), + ]; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php Thu May 09 15:33:08 2019 +0100 @@ -169,6 +169,7 @@ // All revisionable entity variations have to have the same results. foreach (entity_test_entity_types(ENTITY_TEST_TYPES_REVISABLE) as $entity_type) { $this->installEntitySchema($entity_type); + $storage = \Drupal::entityTypeManager()->getStorage($entity_type); $entity = entity_create($entity_type, [ 'name' => 'foo', @@ -178,12 +179,12 @@ $entity->save(); $entity_id = $entity->id(); $entity_rev_id = $entity->getRevisionId(); - $entity = entity_load($entity_type, $entity_id, TRUE); + $entity = $storage->loadUnchanged($entity_id); $entity->setNewRevision(TRUE); $entity->setNewRevision(FALSE); $entity->save(); - $entity = entity_load($entity_type, $entity_id, TRUE); + $entity = $storage->loadUnchanged($entity_id); $this->assertEquals($entity_rev_id, $entity->getRevisionId(), 'A new entity revision was not created.'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php Thu May 09 15:33:08 2019 +0100 @@ -5,6 +5,7 @@ use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\BaseFieldDefinition; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; /** * Tests the default entity storage schema handler. @@ -13,6 +14,15 @@ */ class EntitySchemaTest extends EntityKernelTestBase { + use EntityDefinitionTestTrait; + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['entity_test_update']; + /** * The database connection used. * @@ -26,6 +36,7 @@ protected function setUp() { parent::setUp(); $this->installSchema('user', ['users_data']); + $this->installEntitySchema('entity_test_update'); $this->database = $this->container->get('database'); } @@ -35,16 +46,15 @@ public function testCustomFieldCreateDelete() { // Install the module which adds the field. $this->installModule('entity_schema_test'); - $this->entityManager->clearCachedDefinitions(); - $storage_definitions = $this->entityManager->getFieldStorageDefinitions('entity_test'); + $storage_definitions = $this->entityManager->getFieldStorageDefinitions('entity_test_update'); $this->assertNotNull($storage_definitions['custom_base_field'], 'Base field definition found.'); $this->assertNotNull($storage_definitions['custom_bundle_field'], 'Bundle field definition found.'); // Make sure the field schema can be created. - $this->entityManager->onFieldStorageDefinitionCreate($storage_definitions['custom_base_field']); - $this->entityManager->onFieldStorageDefinitionCreate($storage_definitions['custom_bundle_field']); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definitions['custom_base_field']); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definitions['custom_bundle_field']); /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */ - $table_mapping = $this->entityManager->getStorage('entity_test')->getTableMapping(); + $table_mapping = $this->entityTypeManager->getStorage('entity_test_update')->getTableMapping(); $base_table = current($table_mapping->getTableNames()); $base_column = current($table_mapping->getColumnNames('custom_base_field')); $this->assertTrue($this->database->schema()->fieldExists($base_table, $base_column), 'Table column created'); @@ -52,8 +62,8 @@ $this->assertTrue($this->database->schema()->tableExists($table), 'Table created'); // Make sure the field schema can be deleted. - $this->entityManager->onFieldStorageDefinitionDelete($storage_definitions['custom_base_field']); - $this->entityManager->onFieldStorageDefinitionDelete($storage_definitions['custom_bundle_field']); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionDelete($storage_definitions['custom_base_field']); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionDelete($storage_definitions['custom_bundle_field']); $this->assertFalse($this->database->schema()->fieldExists($base_table, $base_column), 'Table column dropped'); $this->assertFalse($this->database->schema()->tableExists($table), 'Table dropped'); } @@ -65,12 +75,10 @@ * Whether the original definition should be altered or not. */ protected function updateEntityType($alter) { - $entity_test_id = 'entity_test'; - $original = $this->entityManager->getDefinition($entity_test_id); - $this->entityManager->clearCachedDefinitions(); $this->state->set('entity_schema_update', $alter); - $entity_type = $this->entityManager->getDefinition($entity_test_id); - $this->entityManager->onEntityTypeUpdate($entity_type, $original); + $updated_entity_type = $this->getUpdatedEntityTypeDefinition($alter, $alter); + $updated_field_storage_definitions = $this->getUpdatedFieldStorageDefinitions($alter, $alter); + $this->container->get('entity.definition_update_manager')->updateFieldableEntityType($updated_entity_type, $updated_field_storage_definitions); } /** @@ -78,12 +86,12 @@ */ public function testEntitySchemaUpdate() { $this->installModule('entity_schema_test'); - $storage_definitions = $this->entityManager->getFieldStorageDefinitions('entity_test'); - $this->entityManager->onFieldStorageDefinitionCreate($storage_definitions['custom_base_field']); - $this->entityManager->onFieldStorageDefinitionCreate($storage_definitions['custom_bundle_field']); + $storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_update'); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definitions['custom_base_field']); + \Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definitions['custom_bundle_field']); $schema_handler = $this->database->schema(); - $tables = ['entity_test', 'entity_test_revision', 'entity_test_field_data', 'entity_test_field_revision']; - $dedicated_tables = ['entity_test__custom_bundle_field', 'entity_test_revision__custom_bundle_field']; + $tables = ['entity_test_update', 'entity_test_update_revision', 'entity_test_update_data', 'entity_test_update_revision_data']; + $dedicated_tables = ['entity_test_update__custom_bundle_field', 'entity_test_update_revision__custom_bundle_field']; // Initially only the base table and the dedicated field data table should // exist. @@ -299,10 +307,10 @@ $this->updateEntityType(TRUE); $fields = ['revision_log', 'uuid']; foreach ($fields as $field_name) { - $original_definition = $this->entityManager->getBaseFieldDefinitions('entity_test')[$field_name]; + $original_definition = $this->entityManager->getBaseFieldDefinitions('entity_test_update')[$field_name]; $new_definition = clone $original_definition; $new_definition->setLabel($original_definition->getLabel() . ', the other one'); - $this->assertTrue($this->entityManager->getStorage('entity_test') + $this->assertTrue($this->entityManager->getStorage('entity_test_update') ->requiresFieldDataMigration($new_definition, $original_definition)); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php Thu May 09 15:33:08 2019 +0100 @@ -632,21 +632,21 @@ // Check that retrieving the current translation works as expected. $entity = $this->reloadEntity($entity); - $translation = $this->entityManager->getTranslationFromContext($entity, $langcode2); + $translation = \Drupal::service('entity.repository')->getTranslationFromContext($entity, $langcode2); $this->assertEqual($translation->language()->getId(), $default_langcode, 'The current translation language matches the expected one.'); // Check that language fallback respects language weight by default. $language = ConfigurableLanguage::load($languages[$langcode]->getId()); $language->set('weight', -1); $language->save(); - $translation = $this->entityManager->getTranslationFromContext($entity, $langcode2); + $translation = \Drupal::service('entity.repository')->getTranslationFromContext($entity, $langcode2); $this->assertEqual($translation->language()->getId(), $langcode, 'The current translation language matches the expected one.'); // Check that the current translation is properly returned. - $translation = $this->entityManager->getTranslationFromContext($entity); + $translation = \Drupal::service('entity.repository')->getTranslationFromContext($entity); $this->assertEqual($langcode, $translation->language()->getId(), 'The current translation language matches the topmost language fallback candidate.'); $entity->addTranslation($current_langcode, $values[$current_langcode]); - $translation = $this->entityManager->getTranslationFromContext($entity); + $translation = \Drupal::service('entity.repository')->getTranslationFromContext($entity); $this->assertEqual($current_langcode, $translation->language()->getId(), 'The current translation language matches the current language.'); // Check that if the entity has no translation no fallback is applied. @@ -655,7 +655,7 @@ $controller = $this->entityManager->getViewBuilder($entity_type); $entity2_build = $controller->view($entity2); $entity2_output = (string) $renderer->renderRoot($entity2_build); - $translation = $this->entityManager->getTranslationFromContext($entity2, $default_langcode); + $translation = \Drupal::service('entity.repository')->getTranslationFromContext($entity2, $default_langcode); $translation_build = $controller->view($translation); $translation_output = (string) $renderer->renderRoot($translation_build); $this->assertSame($entity2_output, $translation_output, 'When the entity has no translation no fallback is applied.'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintsTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintsTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintsTest.php Thu May 09 15:33:08 2019 +0100 @@ -23,7 +23,7 @@ public function testConstraintDefinition() { // Test reading the annotation. There should be two constraints, the defined // constraint and the automatically added EntityChanged constraint. - $entity_type = $this->entityManager->getDefinition('entity_test_constraints'); + $entity_type = $this->entityTypeManager->getDefinition('entity_test_constraints'); $default_constraints = [ 'NotNull' => [], 'EntityChanged' => NULL, @@ -39,9 +39,9 @@ $this->state->set('entity_test_constraints.build', $extra_constraints); // Re-fetch the entity manager from the new container built after the new // modules were enabled. - $this->entityManager = $this->container->get('entity.manager'); - $this->entityManager->clearCachedDefinitions(); - $entity_type = $this->entityManager->getDefinition('entity_test_constraints'); + $this->entityTypeManager = $this->container->get('entity_type.manager'); + $this->entityTypeManager->clearCachedDefinitions(); + $entity_type = $this->entityTypeManager->getDefinition('entity_test_constraints'); $this->assertEqual($default_constraints + $extra_constraints, $entity_type->getConstraints()); // Test altering constraints. @@ -50,8 +50,8 @@ // Clear the cache in state instance in the Drupal container, so it can pick // up the modified value. \Drupal::state()->resetCache(); - $this->entityManager->clearCachedDefinitions(); - $entity_type = $this->entityManager->getDefinition('entity_test_constraints'); + $this->entityTypeManager->clearCachedDefinitions(); + $entity_type = $this->entityTypeManager->getDefinition('entity_test_constraints'); $this->assertEqual($altered_constraints, $entity_type->getConstraints()); } @@ -59,7 +59,7 @@ * Tests entity constraints are validated. */ public function testConstraintValidation() { - $entity = $this->entityManager->getStorage('entity_test_constraints')->create(); + $entity = $this->entityTypeManager->getStorage('entity_test_constraints')->create(); $entity->user_id->target_id = 0; $violations = $entity->validate(); $this->assertEqual($violations->count(), 0, 'Validation passed.'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php Thu May 09 15:33:08 2019 +0100 @@ -72,8 +72,8 @@ $entity_loaded = $storage->load($entity->id()); $this->assertIdentical($entity_loaded->uuid(), $uuid); - // Verify that \Drupal::entityManager()->loadEntityByUuid() loads the same entity. - $entity_loaded_by_uuid = \Drupal::entityManager()->loadEntityByUuid($entity_type, $uuid, TRUE); + // Verify that \Drupal::service('entity.repository')->loadEntityByUuid() loads the same entity. + $entity_loaded_by_uuid = \Drupal::service('entity.repository')->loadEntityByUuid($entity_type, $uuid, TRUE); $this->assertIdentical($entity_loaded_by_uuid->uuid(), $uuid); $this->assertEqual($entity_loaded_by_uuid->id(), $entity_loaded->id()); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php Thu May 09 15:33:08 2019 +0100 @@ -44,6 +44,13 @@ ConfigurableLanguage::createFromLangcode('de') ->save(); + $this->installEntitySchema('entity_test_mul'); + $this->installEntitySchema('entity_test_mul_langcode_key'); + $this->installEntitySchema('entity_test_mul_changed'); + $this->installEntitySchema('entity_test_rev'); + $this->installEntitySchema('entity_test_mulrev'); + $this->installEntitySchema('entity_test_mulrev_changed'); + // Create the test field. module_load_install('entity_test'); entity_test_install(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -123,7 +123,8 @@ // Generate values and insert them directly in the storage tables. $values = []; - $query = db_insert($this->revisionTable)->fields($columns); + $connection = Database::getConnection(); + $query = $connection->insert($this->revisionTable)->fields($columns); foreach ($revision_ids as $revision_id) { // Put one value too many. for ($delta = 0; $delta <= $this->fieldCardinality; $delta++) { @@ -133,7 +134,7 @@ } $query->execute(); } - $query = db_insert($this->table)->fields($columns); + $query = $connection->insert($this->table)->fields($columns); foreach ($values[$revision_id] as $delta => $value) { $query->values([$bundle, 0, $entity->id(), $revision_id, $delta, $entity->language()->getId(), $value]); } @@ -167,8 +168,8 @@ // loaded. $unavailable_langcode = 'xx'; $values = [$bundle, 0, $entity->id(), $entity->getRevisionId(), 0, $unavailable_langcode, mt_rand(1, 127)]; - db_insert($this->table)->fields($columns)->values($values)->execute(); - db_insert($this->revisionTable)->fields($columns)->values($values)->execute(); + $connection->insert($this->table)->fields($columns)->values($values)->execute(); + $connection->insert($this->revisionTable)->fields($columns)->values($values)->execute(); $entity = $storage->load($entity->id()); $this->assertFalse(array_key_exists($unavailable_langcode, $entity->{$this->fieldName})); } @@ -192,8 +193,9 @@ $entity->{$this->fieldName} = $values; $entity->save(); + $connection = Database::getConnection(); // Read the tables and check the correct values have been stored. - $rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC); + $rows = $connection->select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC); $this->assertEqual(count($rows), $this->fieldCardinality); foreach ($rows as $delta => $row) { $expected = [ @@ -216,7 +218,7 @@ } $entity->{$this->fieldName} = $values; $entity->save(); - $rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC); + $rows = $connection->select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC); $this->assertEqual(count($rows), count($values)); foreach ($rows as $delta => $row) { $expected = [ @@ -244,7 +246,7 @@ // Check that data for both revisions are in the revision table. foreach ($revision_values as $revision_id => $values) { - $rows = db_select($this->revisionTable, 't')->fields('t')->condition('revision_id', $revision_id)->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC); + $rows = $connection->select($this->revisionTable, 't')->fields('t')->condition('revision_id', $revision_id)->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC); $this->assertEqual(count($rows), min(count($values), $this->fieldCardinality)); foreach ($rows as $delta => $row) { $expected = [ @@ -263,7 +265,7 @@ // Test emptying the field. $entity->{$this->fieldName} = NULL; $entity->save(); - $rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC); + $rows = $connection->select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC); $this->assertEqual(count($rows), 0); } @@ -518,9 +520,9 @@ 'field_name' => $field_name, 'type' => 'test_field', ]); - $expected = 'long_entity_type_abcdefghijklmnopq__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); + $expected = 'long_entity_type_abcdefghijklmno__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage), $expected); - $expected = 'long_entity_type_abcdefghijklmnopq_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); + $expected = 'long_entity_type_abcdefghijklmno_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected); // Long entity type and field name. @@ -531,9 +533,9 @@ 'field_name' => $field_name, 'type' => 'test_field', ]); - $expected = 'long_entity_type_abcdefghijklmnopq__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); + $expected = 'long_entity_type_abcdefghijklmno__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage), $expected); - $expected = 'long_entity_type_abcdefghijklmnopq_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); + $expected = 'long_entity_type_abcdefghijklmno_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected); // Try creating a second field and check there are no clashes. $field_storage2 = FieldStorageConfig::create([ @@ -555,6 +557,20 @@ $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage, TRUE), $expected); $expected = 'field_deleted_revision_' . substr(hash('sha256', $field_storage->uuid()), 0, 10); $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage, TRUE), $expected); + + // Check that the table mapping is kept up-to-date in a request where a new + // field storage definition is added. Since the cardinality of the field is + // greater than 1, the table name retrieved from getFieldTableName() should + // be the dedicated table. + $field_storage = FieldStorageConfig::create([ + 'entity_type' => 'entity_test_rev', + 'field_name' => 'some_field_name', + 'type' => 'test_field', + 'cardinality' => 2, + ]); + $field_storage->save(); + $table_mapping = \Drupal::entityTypeManager()->getStorage('entity_test_rev')->getTableMapping(); + $this->assertEquals($table_mapping->getDedicatedDataTableName($field_storage), $table_mapping->getFieldTableName('some_field_name')); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,788 @@ +entityDefinitionUpdateManager = $this->container->get('entity.definition_update_manager'); + $this->lastInstalledSchemaRepository = $this->container->get('entity.last_installed_schema.repository'); + $this->installedStorageSchema = $this->container->get('keyvalue')->get('entity.storage_schema.sql'); + $this->entityTypeManager = $this->container->get('entity_type.manager'); + $this->entityFieldManager = $this->container->get('entity_field.manager'); + $this->database = $this->container->get('database'); + + // The 'changed' field type has a special behavior because it updates itself + // automatically if any of the other field values of an entity have been + // updated, so add it to the entity type that is being tested in order to + // provide test coverage for this special case. + $fields['changed'] = BaseFieldDefinition::create('changed') + ->setLabel(t('Changed')) + ->setDescription(t('The time that the custom block was last edited.')) + ->setTranslatable(TRUE) + ->setRevisionable(TRUE); + $this->state->set('entity_test_update.additional_base_field_definitions', $fields); + + $this->installEntitySchema($this->entityTypeId); + $this->installEntitySchema('configurable_language'); + + // Enable an additional language. + ConfigurableLanguage::createFromLangcode('ro')->save(); + + // Force the update function to convert one entity at a time. + $settings = Settings::getAll(); + $settings['entity_update_batch_size'] = 1; + new Settings($settings); + } + + /** + * @covers ::updateFieldableEntityType + * @dataProvider providerTestFieldableEntityTypeUpdates + */ + public function testFieldableEntityTypeUpdates($initial_rev, $initial_mul, $new_rev, $new_mul, $data_migration_supported) { + // The 'entity_test_update' entity type is neither revisionable nor + // translatable by default, so we need to get it into the initial testing + // state. This also covers the "no existing data" scenario for fieldable + // entity type updates. + if ($initial_rev || $initial_mul) { + $entity_type = $this->getUpdatedEntityTypeDefinition($initial_rev, $initial_mul); + $field_storage_definitions = $this->getUpdatedFieldStorageDefinitions($initial_rev, $initial_mul); + + $this->entityDefinitionUpdateManager->updateFieldableEntityType($entity_type, $field_storage_definitions); + $this->assertEntityTypeSchema($initial_rev, $initial_mul); + } + + // Add a few entities so we can test the data copying step. + $this->insertData($initial_rev, $initial_mul); + + $updated_entity_type = $this->getUpdatedEntityTypeDefinition($new_rev, $new_mul); + $updated_field_storage_definitions = $this->getUpdatedFieldStorageDefinitions($new_rev, $new_mul); + + if (!$data_migration_supported) { + $this->setExpectedException(EntityStorageException::class, 'Converting an entity type from revisionable to non-revisionable or from translatable to non-translatable is not supported.'); + } + + // Check that existing data can be retrieved from the storage before the + // entity schema is updated. + if ($data_migration_supported) { + $this->assertEntityData($initial_rev, $initial_mul); + } + + // Simulate a batch run since we are converting the entities one by one. + $sandbox = []; + do { + $this->entityDefinitionUpdateManager->updateFieldableEntityType($updated_entity_type, $updated_field_storage_definitions, $sandbox); + } while ($sandbox['#finished'] != 1); + + $this->assertEntityTypeSchema($new_rev, $new_mul); + $this->assertEntityData($initial_rev, $initial_mul); + + $change_list = $this->entityDefinitionUpdateManager->getChangeList(); + $this->assertArrayNotHasKey('entity_test_update', $change_list, "There are no remaining updates for the 'entity_test_update' entity type."); + + // Check that we can still save new entities after the schema has been + // updated. + $this->insertData($new_rev, $new_mul); + + // Check that the backup tables have been kept in place. + $this->assertBackupTables(); + } + + /** + * Data provider for testFieldableEntityTypeUpdates(). + */ + public function providerTestFieldableEntityTypeUpdates() { + return [ + 'no change' => [ + 'initial_rev' => FALSE, + 'initial_mul' => FALSE, + 'new_rev' => FALSE, + 'new_mul' => FALSE, + 'data_migration_supported' => TRUE, + ], + 'non_rev non_mul to rev non_mul' => [ + 'initial_rev' => FALSE, + 'initial_mul' => FALSE, + 'new_rev' => TRUE, + 'new_mul' => FALSE, + 'data_migration_supported' => TRUE, + ], + 'non_rev non_mul to rev mul' => [ + 'initial_rev' => FALSE, + 'initial_mul' => FALSE, + 'new_rev' => TRUE, + 'new_mul' => TRUE, + 'data_migration_supported' => TRUE, + ], + 'non_rev non_mul to non_rev mul' => [ + 'initial_rev' => FALSE, + 'initial_mul' => FALSE, + 'new_rev' => FALSE, + 'new_mul' => TRUE, + 'data_migration_supported' => TRUE, + ], + 'rev non_mul to non_rev non_mul' => [ + 'initial_rev' => TRUE, + 'initial_mul' => FALSE, + 'new_rev' => FALSE, + 'new_mul' => FALSE, + 'data_migration_supported' => FALSE, + ], + 'rev non_mul to non_rev mul' => [ + 'initial_rev' => TRUE, + 'initial_mul' => FALSE, + 'new_rev' => FALSE, + 'new_mul' => TRUE, + 'data_migration_supported' => FALSE, + ], + 'rev non_mul to rev mul' => [ + 'initial_rev' => TRUE, + 'initial_mul' => FALSE, + 'new_rev' => TRUE, + 'new_mul' => TRUE, + 'data_migration_supported' => TRUE, + ], + 'non_rev mul to non_rev non_mul' => [ + 'initial_rev' => FALSE, + 'initial_mul' => TRUE, + 'new_rev' => FALSE, + 'new_mul' => FALSE, + 'data_migration_supported' => FALSE, + ], + 'non_rev mul to rev non_mul' => [ + 'initial_rev' => FALSE, + 'initial_mul' => TRUE, + 'new_rev' => TRUE, + 'new_mul' => FALSE, + 'data_migration_supported' => FALSE, + ], + 'non_rev mul to rev mul' => [ + 'initial_rev' => FALSE, + 'initial_mul' => TRUE, + 'new_rev' => TRUE, + 'new_mul' => TRUE, + 'data_migration_supported' => TRUE, + ], + 'rev mul to non_rev non_mul' => [ + 'initial_rev' => TRUE, + 'initial_mul' => TRUE, + 'new_rev' => FALSE, + 'new_mul' => FALSE, + 'data_migration_supported' => FALSE, + ], + 'rev mul to rev non_mul' => [ + 'initial_rev' => TRUE, + 'initial_mul' => TRUE, + 'new_rev' => TRUE, + 'new_mul' => FALSE, + 'data_migration_supported' => FALSE, + ], + 'rev mul to non_rev mul' => [ + 'initial_rev' => TRUE, + 'initial_mul' => TRUE, + 'new_rev' => FALSE, + 'new_mul' => TRUE, + 'data_migration_supported' => FALSE, + ], + ]; + } + + /** + * Generates test entities for the 'entity_test_update' entity type. + * + * @param bool $revisionable + * Whether the entity type is revisionable or not. + * @param bool $translatable + * Whether the entity type is translatable or not. + */ + protected function insertData($revisionable, $translatable) { + // Add three test entities in order to make the "data copy" step run at + // least three times. + /** @var \Drupal\Core\Entity\TranslatableRevisionableStorageInterface|\Drupal\Core\Entity\EntityStorageInterface $storage */ + $storage = $this->entityTypeManager->getStorage($this->entityTypeId); + $next_id = $storage->getQuery()->count()->execute() + 1; + + // Create test entities with two translations and two revisions. + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ + for ($i = $next_id; $i <= $next_id + 2; $i++) { + $entity = $storage->create([ + 'id' => $i, + 'name' => 'test entity - ' . $i . ' - en', + 'test_multiple_properties' => [ + 'value1' => 'shared table - ' . $i . ' - value 1 - en', + 'value2' => 'shared table - ' . $i . ' - value 2 - en', + ], + 'test_multiple_properties_multiple_values' => [ + [ + 'value1' => 'dedicated table - ' . $i . ' - delta 0 - value 1 - en', + 'value2' => 'dedicated table - ' . $i . ' - delta 0 - value 2 - en', + ], + [ + 'value1' => 'dedicated table - ' . $i . ' - delta 1 - value 1 - en', + 'value2' => 'dedicated table - ' . $i . ' - delta 1 - value 2 - en', + ], + ], + ]); + $entity->save(); + + if ($translatable) { + $translation = $entity->addTranslation('ro', [ + 'name' => 'test entity - ' . $i . ' - ro', + 'test_multiple_properties' => [ + 'value1' => 'shared table - ' . $i . ' - value 1 - ro', + 'value2' => 'shared table - ' . $i . ' - value 2 - ro', + ], + 'test_multiple_properties_multiple_values' => [ + [ + 'value1' => 'dedicated table - ' . $i . ' - delta 0 - value 1 - ro', + 'value2' => 'dedicated table - ' . $i . ' - delta 0 - value 2 - ro', + ], + [ + 'value1' => 'dedicated table - ' . $i . ' - delta 1 - value 1 - ro', + 'value2' => 'dedicated table - ' . $i . ' - delta 1 - value 2 - ro', + ], + ], + ]); + $translation->save(); + } + $this->testEntities[$entity->id()] = $entity; + + if ($revisionable) { + // Create a new pending revision. + $revision_2 = $storage->createRevision($entity, FALSE); + $revision_2->name = 'test entity - ' . $i . ' - en - rev2'; + $revision_2->test_multiple_properties->value1 = 'shared table - ' . $i . ' - value 1 - en - rev2'; + $revision_2->test_multiple_properties->value2 = 'shared table - ' . $i . ' - value 2 - en - rev2'; + $revision_2->test_multiple_properties_multiple_values[0]->value1 = 'dedicated table - ' . $i . ' - delta 0 - value 1 - en - rev2'; + $revision_2->test_multiple_properties_multiple_values[0]->value2 = 'dedicated table - ' . $i . ' - delta 0 - value 2 - en - rev2'; + $revision_2->test_multiple_properties_multiple_values[1]->value1 = 'dedicated table - ' . $i . ' - delta 1 - value 1 - en - rev2'; + $revision_2->test_multiple_properties_multiple_values[1]->value2 = 'dedicated table - ' . $i . ' - delta 1 - value 2 - en - rev2'; + $revision_2->save(); + + if ($translatable) { + $revision_2_translation = $storage->createRevision($entity->getTranslation('ro'), FALSE); + $revision_2_translation->name = 'test entity - ' . $i . ' - ro - rev2'; + $revision_2->test_multiple_properties->value1 = 'shared table - ' . $i . ' - value 1 - ro - rev2'; + $revision_2->test_multiple_properties->value2 = 'shared table - ' . $i . ' - value 2 - ro - rev2'; + $revision_2_translation->test_multiple_properties_multiple_values[0]->value1 = 'dedicated table - ' . $i . ' - delta 0 - value 1 - ro - rev2'; + $revision_2_translation->test_multiple_properties_multiple_values[0]->value2 = 'dedicated table - ' . $i . ' - delta 0 - value 2 - ro - rev2'; + $revision_2_translation->test_multiple_properties_multiple_values[1]->value1 = 'dedicated table - ' . $i . ' - delta 1 - value 1 - ro - rev2'; + $revision_2_translation->test_multiple_properties_multiple_values[1]->value2 = 'dedicated table - ' . $i . ' - delta 1 - value 2 - ro - rev2'; + $revision_2_translation->save(); + } + } + } + } + + /** + * Asserts test entity data after a fieldable entity type update. + * + * @param bool $revisionable + * Whether the entity type was revisionable prior to the update. + * @param bool $translatable + * Whether the entity type was translatable prior to the update. + */ + protected function assertEntityData($revisionable, $translatable) { + $entities = $this->entityTypeManager->getStorage($this->entityTypeId)->loadMultiple(); + $this->assertCount(3, $entities); + foreach ($entities as $entity_id => $entity) { + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ + $this->assertEquals("test entity - {$entity->id()} - en", $entity->label()); + $this->assertEquals("shared table - {$entity->id()} - value 1 - en", $entity->test_multiple_properties->value1); + $this->assertEquals("shared table - {$entity->id()} - value 2 - en", $entity->test_multiple_properties->value2); + $this->assertEquals("dedicated table - {$entity->id()} - delta 0 - value 1 - en", $entity->test_multiple_properties_multiple_values[0]->value1); + $this->assertEquals("dedicated table - {$entity->id()} - delta 0 - value 2 - en", $entity->test_multiple_properties_multiple_values[0]->value2); + $this->assertEquals("dedicated table - {$entity->id()} - delta 1 - value 1 - en", $entity->test_multiple_properties_multiple_values[1]->value1); + $this->assertEquals("dedicated table - {$entity->id()} - delta 1 - value 2 - en", $entity->test_multiple_properties_multiple_values[1]->value2); + + if ($translatable) { + $translation = $entity->getTranslation('ro'); + $this->assertEquals("test entity - {$translation->id()} - ro", $translation->label()); + $this->assertEquals("shared table - {$translation->id()} - value 1 - ro", $translation->test_multiple_properties->value1); + $this->assertEquals("shared table - {$translation->id()} - value 2 - ro", $translation->test_multiple_properties->value2); + $this->assertEquals("dedicated table - {$translation->id()} - delta 0 - value 1 - ro", $translation->test_multiple_properties_multiple_values[0]->value1); + $this->assertEquals("dedicated table - {$translation->id()} - delta 0 - value 2 - ro", $translation->test_multiple_properties_multiple_values[0]->value2); + $this->assertEquals("dedicated table - {$translation->id()} - delta 1 - value 1 - ro", $translation->test_multiple_properties_multiple_values[1]->value1); + $this->assertEquals("dedicated table - {$translation->id()} - delta 1 - value 2 - ro", $translation->test_multiple_properties_multiple_values[1]->value2); + } + } + + if ($revisionable) { + $revisions_result = $this->entityTypeManager->getStorage($this->entityTypeId)->getQuery()->allRevisions()->execute(); + $revisions = $this->entityTypeManager->getStorage($this->entityTypeId)->loadMultipleRevisions(array_keys($revisions_result)); + $this->assertCount(6, $revisions); + + foreach ($revisions as $revision) { + /** @var \Drupal\Core\Entity\ContentEntityInterface $revision */ + $revision_label = $revision->isDefaultRevision() ? NULL : ' - rev2'; + $this->assertEquals("test entity - {$revision->id()} - en{$revision_label}", $revision->label()); + $this->assertEquals("shared table - {$revision->id()} - value 1 - en{$revision_label}", $revision->test_multiple_properties->value1); + $this->assertEquals("shared table - {$revision->id()} - value 2 - en{$revision_label}", $revision->test_multiple_properties->value2); + $this->assertEquals("dedicated table - {$revision->id()} - delta 0 - value 1 - en{$revision_label}", $revision->test_multiple_properties_multiple_values[0]->value1); + $this->assertEquals("dedicated table - {$revision->id()} - delta 0 - value 2 - en{$revision_label}", $revision->test_multiple_properties_multiple_values[0]->value2); + $this->assertEquals("dedicated table - {$revision->id()} - delta 1 - value 1 - en{$revision_label}", $revision->test_multiple_properties_multiple_values[1]->value1); + $this->assertEquals("dedicated table - {$revision->id()} - delta 1 - value 2 - en{$revision_label}", $revision->test_multiple_properties_multiple_values[1]->value2); + + if ($translatable) { + $translation = $revision->getTranslation('ro'); + $this->assertEquals("test entity - {$translation->id()} - ro{$revision_label}", $translation->label()); + $this->assertEquals("shared table - {$revision->id()} - value 1 - ro{$revision_label}", $translation->test_multiple_properties->value1); + $this->assertEquals("shared table - {$revision->id()} - value 2 - ro{$revision_label}", $translation->test_multiple_properties->value2); + $this->assertEquals("dedicated table - {$translation->id()} - delta 0 - value 1 - ro{$revision_label}", $translation->test_multiple_properties_multiple_values[0]->value1); + $this->assertEquals("dedicated table - {$translation->id()} - delta 0 - value 2 - ro{$revision_label}", $translation->test_multiple_properties_multiple_values[0]->value2); + $this->assertEquals("dedicated table - {$translation->id()} - delta 1 - value 1 - ro{$revision_label}", $translation->test_multiple_properties_multiple_values[1]->value1); + $this->assertEquals("dedicated table - {$translation->id()} - delta 1 - value 2 - ro{$revision_label}", $translation->test_multiple_properties_multiple_values[1]->value2); + } + } + } + } + + /** + * Asserts revisionable and/or translatable characteristics of an entity type. + * + * @param bool $revisionable + * Whether the entity type is revisionable or not. + * @param bool $translatable + * Whether the entity type is translatable or not. + */ + protected function assertEntityTypeSchema($revisionable, $translatable) { + if ($revisionable && $translatable) { + $this->assertRevisionableAndTranslatable(); + } + elseif ($revisionable) { + $this->assertRevisionable(); + } + elseif ($translatable) { + $this->assertTranslatable(); + } + else { + $this->assertNonRevisionableAndNonTranslatable(); + } + } + + /** + * Asserts the revisionable characteristics of an entity type. + */ + protected function assertRevisionable() { + /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */ + $entity_type = $this->entityDefinitionUpdateManager->getEntityType($this->entityTypeId); + $this->assertTrue($entity_type->isRevisionable()); + + // Check that the required field definitions of a revisionable entity type + // exists and are stored in the correct tables. + $revision_key = $entity_type->getKey('revision'); + $revision_default_key = $entity_type->getRevisionMetadataKey('revision_default'); + $revision_field = $this->entityDefinitionUpdateManager->getFieldStorageDefinition($revision_key, $entity_type->id()); + $revision_default_field = $this->entityDefinitionUpdateManager->getFieldStorageDefinition($revision_default_key, $entity_type->id()); + $this->assertNotNull($revision_field); + $this->assertNotNull($revision_default_field); + + $database_schema = $this->database->schema(); + $base_table = $entity_type->getBaseTable(); + $revision_table = $entity_type->getRevisionTable(); + $this->assertTrue($database_schema->tableExists($revision_table)); + + $this->assertTrue($database_schema->fieldExists($base_table, $revision_key)); + $this->assertTrue($database_schema->fieldExists($revision_table, $revision_key)); + + $this->assertFalse($database_schema->fieldExists($base_table, $revision_default_key)); + $this->assertTrue($database_schema->fieldExists($revision_table, $revision_default_key)); + + // Also check the revision metadata keys, if they exist. + foreach (['revision_log_message', 'revision_user', 'revision_created'] as $key) { + if ($revision_metadata_key = $entity_type->getRevisionMetadataKey($key)) { + $revision_metadata_field = $this->entityDefinitionUpdateManager->getFieldStorageDefinition($revision_metadata_key, $entity_type->id()); + $this->assertNotNull($revision_metadata_field); + $this->assertFalse($database_schema->fieldExists($base_table, $revision_metadata_key)); + $this->assertTrue($database_schema->fieldExists($revision_table, $revision_metadata_key)); + } + } + } + + /** + * Asserts the translatable characteristics of an entity type. + */ + protected function assertTranslatable() { + /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */ + $entity_type = $this->entityDefinitionUpdateManager->getEntityType($this->entityTypeId); + $this->assertTrue($entity_type->isTranslatable()); + + // Check that the required field definitions of a translatable entity type + // exists and are stored in the correct tables. + $langcode_key = $entity_type->getKey('langcode'); + $default_langcode_key = $entity_type->getKey('default_langcode'); + $langcode_field = $this->entityDefinitionUpdateManager->getFieldStorageDefinition($langcode_key, $entity_type->id()); + $default_langcode_field = $this->entityDefinitionUpdateManager->getFieldStorageDefinition($default_langcode_key, $entity_type->id()); + $this->assertNotNull($langcode_field); + $this->assertNotNull($default_langcode_field); + + $database_schema = $this->database->schema(); + $base_table = $entity_type->getBaseTable(); + $data_table = $entity_type->getDataTable(); + $this->assertTrue($database_schema->tableExists($data_table)); + + $this->assertTrue($database_schema->fieldExists($base_table, $langcode_key)); + $this->assertTrue($database_schema->fieldExists($data_table, $langcode_key)); + + $this->assertFalse($database_schema->fieldExists($base_table, $default_langcode_key)); + $this->assertTrue($database_schema->fieldExists($data_table, $default_langcode_key)); + } + + /** + * Asserts the revisionable / translatable characteristics of an entity type. + */ + protected function assertRevisionableAndTranslatable() { + $this->assertRevisionable(); + $this->assertTranslatable(); + + // Check that the required field definitions of a revisionable and + // translatable entity type exists and are stored in the correct tables. + /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */ + $entity_type = $this->entityDefinitionUpdateManager->getEntityType($this->entityTypeId); + $langcode_key = $entity_type->getKey('langcode'); + $revision_translation_affected_key = $entity_type->getKey('revision_translation_affected'); + $revision_translation_affected_field = $this->entityDefinitionUpdateManager->getFieldStorageDefinition($revision_translation_affected_key, $entity_type->id()); + $this->assertNotNull($revision_translation_affected_field); + + $database_schema = $this->database->schema(); + $base_table = $entity_type->getBaseTable(); + $data_table = $entity_type->getDataTable(); + $revision_table = $entity_type->getRevisionTable(); + $revision_data_table = $entity_type->getRevisionDataTable(); + $this->assertTrue($database_schema->tableExists($revision_data_table)); + + $this->assertTrue($database_schema->fieldExists($base_table, $langcode_key)); + $this->assertTrue($database_schema->fieldExists($data_table, $langcode_key)); + $this->assertTrue($database_schema->fieldExists($revision_table, $langcode_key)); + $this->assertTrue($database_schema->fieldExists($revision_data_table, $langcode_key)); + + $this->assertFalse($database_schema->fieldExists($base_table, $revision_translation_affected_key)); + $this->assertFalse($database_schema->fieldExists($revision_table, $revision_translation_affected_key)); + $this->assertTrue($database_schema->fieldExists($data_table, $revision_translation_affected_key)); + $this->assertTrue($database_schema->fieldExists($revision_data_table, $revision_translation_affected_key)); + + // Also check the revision metadata keys, if they exist. + foreach (['revision_log_message', 'revision_user', 'revision_created'] as $key) { + if ($revision_metadata_key = $entity_type->getRevisionMetadataKey($key)) { + $revision_metadata_field = $this->entityDefinitionUpdateManager->getFieldStorageDefinition($revision_metadata_key, $entity_type->id()); + $this->assertNotNull($revision_metadata_field); + $this->assertFalse($database_schema->fieldExists($base_table, $revision_metadata_key)); + $this->assertTrue($database_schema->fieldExists($revision_table, $revision_metadata_key)); + $this->assertFalse($database_schema->fieldExists($data_table, $revision_metadata_key)); + $this->assertFalse($database_schema->fieldExists($revision_data_table, $revision_metadata_key)); + } + } + } + + /** + * Asserts that an entity type is neither revisionable nor translatable. + */ + protected function assertNonRevisionableAndNonTranslatable() { + /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */ + $entity_type = $this->entityDefinitionUpdateManager->getEntityType($this->entityTypeId); + $this->assertFalse($entity_type->isRevisionable()); + $this->assertFalse($entity_type->isTranslatable()); + + $database_schema = $this->database->schema(); + $this->assertTrue($database_schema->tableExists($entity_type->getBaseTable())); + $this->assertFalse($database_schema->tableExists($entity_type->getDataTable())); + $this->assertFalse($database_schema->tableExists($entity_type->getRevisionTable())); + $this->assertFalse($database_schema->tableExists($entity_type->getRevisionDataTable())); + } + + /** + * Asserts that the backup tables have been kept after a successful update. + */ + protected function assertBackupTables() { + $backups = \Drupal::keyValue('entity.update_backup')->getAll(); + $backup = reset($backups); + + $schema = $this->database->schema(); + foreach ($backup['table_mapping']->getTableNames() as $table_name) { + $this->assertTrue($schema->tableExists($table_name)); + } + } + + /** + * Tests that a failed entity schema update preserves the existing data. + */ + public function testFieldableEntityTypeUpdatesErrorHandling() { + $schema = $this->database->schema(); + + // First, convert the entity type to be translatable for better coverage and + // insert some initial data. + $entity_type = $this->getUpdatedEntityTypeDefinition(FALSE, TRUE); + $field_storage_definitions = $this->getUpdatedFieldStorageDefinitions(FALSE, TRUE); + $this->entityDefinitionUpdateManager->updateFieldableEntityType($entity_type, $field_storage_definitions); + $this->assertEntityTypeSchema(FALSE, TRUE); + $this->insertData(FALSE, TRUE); + + $tables = $schema->findTables('old_%'); + $this->assertCount(3, $tables); + foreach ($tables as $table) { + $schema->dropTable($table); + } + + $original_entity_type = $this->lastInstalledSchemaRepository->getLastInstalledDefinition('entity_test_update'); + $original_storage_definitions = $this->lastInstalledSchemaRepository->getLastInstalledFieldStorageDefinitions('entity_test_update'); + + $original_entity_schema_data = $this->installedStorageSchema->get('entity_test_update.entity_schema_data', []); + $original_field_schema_data = []; + foreach ($original_storage_definitions as $storage_definition) { + $original_field_schema_data[$storage_definition->getName()] = $this->installedStorageSchema->get('entity_test_update.field_schema_data.' . $storage_definition->getName(), []); + } + + // Check that entity type is not revisionable prior to running the update + // process. + $this->assertFalse($entity_type->isRevisionable()); + + // Make the update throw an exception during the entity save process. + \Drupal::state()->set('entity_test_update.throw_exception', TRUE); + $this->setExpectedException(EntityStorageException::class, 'The entity update process failed while processing the entity type entity_test_update, ID: 1.'); + + try { + $updated_entity_type = $this->getUpdatedEntityTypeDefinition(TRUE, TRUE); + $updated_field_storage_definitions = $this->getUpdatedFieldStorageDefinitions(TRUE, TRUE); + + // Simulate a batch run since we are converting the entities one by one. + $sandbox = []; + do { + $this->entityDefinitionUpdateManager->updateFieldableEntityType($updated_entity_type, $updated_field_storage_definitions, $sandbox); + } while ($sandbox['#finished'] != 1); + } + catch (EntityStorageException $e) { + throw $e; + } + // Allow other tests to be performed after the exception has been thrown. + finally { + $this->assertSame('Peekaboo!', $e->getPrevious()->getMessage()); + + // Check that the last installed entity type definition is kept as + // non-revisionable. + $new_entity_type = $this->lastInstalledSchemaRepository->getLastInstalledDefinition('entity_test_update'); + $this->assertFalse($new_entity_type->isRevisionable(), 'The entity type is kept unchanged.'); + + // Check that the last installed field storage definitions did not change by + // looking at the 'langcode' field, which is updated automatically. + $new_storage_definitions = $this->lastInstalledSchemaRepository->getLastInstalledFieldStorageDefinitions('entity_test_update'); + $langcode_key = $original_entity_type->getKey('langcode'); + $this->assertEquals($original_storage_definitions[$langcode_key]->isRevisionable(), $new_storage_definitions[$langcode_key]->isRevisionable(), "The 'langcode' field is kept unchanged."); + + /** @var \Drupal\Core\Entity\Sql\SqlEntityStorageInterface $storage */ + $storage = $this->entityTypeManager->getStorage('entity_test_update'); + $table_mapping = $storage->getTableMapping(); + + // Check that installed storage schema did not change. + $new_entity_schema_data = $this->installedStorageSchema->get('entity_test_update.entity_schema_data', []); + $this->assertEquals($original_entity_schema_data, $new_entity_schema_data); + + foreach ($new_storage_definitions as $storage_definition) { + $new_field_schema_data[$storage_definition->getName()] = $this->installedStorageSchema->get('entity_test_update.field_schema_data.' . $storage_definition->getName(), []); + } + $this->assertEquals($original_field_schema_data, $new_field_schema_data); + + // Check that temporary tables have been removed. + $tables = $schema->findTables('tmp_%'); + $this->assertCount(0, $tables); + + $current_table_names = $storage->getCustomTableMapping($original_entity_type, $original_storage_definitions)->getTableNames(); + foreach ($current_table_names as $table_name) { + $this->assertTrue($schema->tableExists($table_name)); + } + + // Check that backup tables do not exist anymore, since they were + // restored/renamed. + $tables = $schema->findTables('old_%'); + $this->assertCount(0, $tables); + + // Check that the original tables still exist and their data is intact. + $this->assertTrue($schema->tableExists('entity_test_update')); + $this->assertTrue($schema->tableExists('entity_test_update_data')); + + // Check that the revision tables have not been created. + $this->assertFalse($schema->tableExists('entity_test_update_revision')); + $this->assertFalse($schema->tableExists('entity_test_update_revision_data')); + + $base_table_count = $this->database->select('entity_test_update') + ->countQuery() + ->execute() + ->fetchField(); + $this->assertEquals(3, $base_table_count); + + $data_table_count = $this->database->select('entity_test_update_data') + ->countQuery() + ->execute() + ->fetchField(); + // There are two records for each entity, one for English and one for + // Romanian. + $this->assertEquals(6, $data_table_count); + + $base_table_row = $this->database->select('entity_test_update') + ->fields('entity_test_update') + ->condition('id', 1, '=') + ->condition('langcode', 'en', '=') + ->execute() + ->fetchAllAssoc('id'); + $this->assertEquals($this->testEntities[1]->uuid(), $base_table_row[1]->uuid); + + $data_table_row = $this->database->select('entity_test_update_data') + ->fields('entity_test_update_data') + ->condition('id', 1, '=') + ->condition('langcode', 'en', '=') + ->execute() + ->fetchAllAssoc('id'); + $this->assertEquals('test entity - 1 - en', $data_table_row[1]->name); + $this->assertEquals('shared table - 1 - value 1 - en', $data_table_row[1]->test_multiple_properties__value1); + $this->assertEquals('shared table - 1 - value 2 - en', $data_table_row[1]->test_multiple_properties__value2); + + $data_table_row = $this->database->select('entity_test_update_data') + ->fields('entity_test_update_data') + ->condition('id', 1, '=') + ->condition('langcode', 'ro', '=') + ->execute() + ->fetchAllAssoc('id'); + $this->assertEquals('test entity - 1 - ro', $data_table_row[1]->name); + $this->assertEquals('shared table - 1 - value 1 - ro', $data_table_row[1]->test_multiple_properties__value1); + $this->assertEquals('shared table - 1 - value 2 - ro', $data_table_row[1]->test_multiple_properties__value2); + + $dedicated_table_name = $table_mapping->getFieldTableName('test_multiple_properties_multiple_values'); + $dedicated_table_row = $this->database->select($dedicated_table_name) + ->fields($dedicated_table_name) + ->condition('entity_id', 1, '=') + ->condition('langcode', 'en', '=') + ->execute() + ->fetchAllAssoc('delta'); + $this->assertEquals('dedicated table - 1 - delta 0 - value 1 - en', $dedicated_table_row[0]->test_multiple_properties_multiple_values_value1); + $this->assertEquals('dedicated table - 1 - delta 0 - value 2 - en', $dedicated_table_row[0]->test_multiple_properties_multiple_values_value2); + $this->assertEquals('dedicated table - 1 - delta 1 - value 1 - en', $dedicated_table_row[1]->test_multiple_properties_multiple_values_value1); + $this->assertEquals('dedicated table - 1 - delta 1 - value 2 - en', $dedicated_table_row[1]->test_multiple_properties_multiple_values_value2); + + $dedicated_table_row = $this->database->select($dedicated_table_name) + ->fields($dedicated_table_name) + ->condition('entity_id', 1, '=') + ->condition('langcode', 'ro', '=') + ->execute() + ->fetchAllAssoc('delta'); + $this->assertEquals('dedicated table - 1 - delta 0 - value 1 - ro', $dedicated_table_row[0]->test_multiple_properties_multiple_values_value1); + $this->assertEquals('dedicated table - 1 - delta 0 - value 2 - ro', $dedicated_table_row[0]->test_multiple_properties_multiple_values_value2); + $this->assertEquals('dedicated table - 1 - delta 1 - value 1 - ro', $dedicated_table_row[1]->test_multiple_properties_multiple_values_value1); + $this->assertEquals('dedicated table - 1 - delta 1 - value 2 - ro', $dedicated_table_row[1]->test_multiple_properties_multiple_values_value2); + } + } + + /** + * Tests the removal of the backup tables after a successful update. + */ + public function testFieldableEntityTypeUpdatesRemoveBackupTables() { + $schema = $this->database->schema(); + + // Convert the entity type to be revisionable. + $entity_type = $this->getUpdatedEntityTypeDefinition(TRUE, FALSE); + $field_storage_definitions = $this->getUpdatedFieldStorageDefinitions(TRUE, FALSE); + $this->entityDefinitionUpdateManager->updateFieldableEntityType($entity_type, $field_storage_definitions); + + // Check that backup tables are kept by default. + $tables = $schema->findTables('old_%'); + $this->assertCount(3, $tables); + foreach ($tables as $table) { + $schema->dropTable($table); + } + + // Make the entity update process drop the backup tables after a successful + // update. + $settings = Settings::getAll(); + $settings['entity_update_backup'] = FALSE; + new Settings($settings); + + $entity_type = $this->getUpdatedEntityTypeDefinition(TRUE, TRUE); + $field_storage_definitions = $this->getUpdatedFieldStorageDefinitions(TRUE, TRUE); + $this->entityDefinitionUpdateManager->updateFieldableEntityType($entity_type, $field_storage_definitions); + + // Check that backup tables have been dropped. + $tables = $schema->findTables('old_%'); + $this->assertCount(0, $tables); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -9,8 +9,14 @@ use Drupal\user\UserInterface; /** + * Test the revision system. + * + * This test uses the entity_test_revlog module, which intentionally omits the + * entity_metadata_keys fields. This causes deprecation errors. + * * @coversDefaultClass \Drupal\Core\Entity\RevisionableContentEntityBase * @group Entity + * @group legacy */ class RevisionableContentEntityBaseTest extends EntityKernelTestBase { @@ -29,6 +35,10 @@ /** * Tests the correct functionality CRUD operations of entity revisions. + * + * @expectedDeprecation The revision_user revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 + * @expectedDeprecation The revision_created revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 + * @expectedDeprecation The revision_log_message revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 */ public function testRevisionableContentEntity() { $entity_type = 'entity_test_mul_revlog'; @@ -89,6 +99,10 @@ * Tests the behavior of the "revision_default" flag. * * @covers \Drupal\Core\Entity\ContentEntityBase::wasDefaultRevision + * + * @expectedDeprecation The revision_user revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 + * @expectedDeprecation The revision_created revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 + * @expectedDeprecation The revision_log_message revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 */ public function testWasDefaultRevision() { $entity_type_id = 'entity_test_mul_revlog'; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php Thu May 09 15:33:08 2019 +0100 @@ -5,6 +5,7 @@ use Drupal\entity_test\Entity\EntityTestAdminRoutes; use Drupal\entity_test\Entity\EntityTestMul; use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\user\Traits\UserCreationTrait; use Drupal\user\Entity\Role; use Drupal\user\RoleInterface; use Symfony\Component\HttpFoundation\Request; @@ -17,6 +18,8 @@ */ class RouteProviderTest extends KernelTestBase { + use UserCreationTrait; + /** * {@inheritdoc} */ @@ -28,7 +31,8 @@ protected function setUp() { parent::setUp(); - $this->installEntitySchema('user'); + $this->setUpCurrentUser(['uid' => 1]); + $this->installEntitySchema('entity_test_mul'); $this->installEntitySchema('entity_test_admin_routes'); @@ -79,13 +83,13 @@ ]); $entity->save(); - $this->setRawContent($this->httpKernelHandle($entity->url())); + $this->setRawContent($this->httpKernelHandle($entity->toUrl()->toString())); $this->assertTitle('Test title | '); - $this->setRawContent($this->httpKernelHandle($entity->url('edit-form'))); + $this->setRawContent($this->httpKernelHandle($entity->toUrl('edit-form')->toString())); $this->assertTitle('Edit Test title | '); - $this->setRawContent($this->httpKernelHandle($entity->url('delete-form'))); + $this->setRawContent($this->httpKernelHandle($entity->toUrl('delete-form')->toString())); $this->assertTitle('Are you sure you want to delete the test entity - data table Test title? | '); } @@ -122,13 +126,13 @@ ]); $entity->save(); - $this->setRawContent($this->httpKernelHandle($entity->url())); + $this->setRawContent($this->httpKernelHandle($entity->toUrl()->toString())); $this->assertTitle('Test title | '); - $this->setRawContent($this->httpKernelHandle($entity->url('edit-form'))); + $this->setRawContent($this->httpKernelHandle($entity->toUrl('edit-form')->toString())); $this->assertTitle('Edit Test title | '); - $this->setRawContent($this->httpKernelHandle($entity->url('delete-form'))); + $this->setRawContent($this->httpKernelHandle($entity->toUrl('delete-form')->toString())); $this->assertTitle('Are you sure you want to delete the test entity - admin routes Test title? | '); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php --- a/core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -root . '/autoload.php'; - $kernel = new DrupalKernel('testing', $class_loader, FALSE); - $event = new GetResponseEvent($kernel, Request::create('http://example.com'), HttpKernelInterface::MASTER_REQUEST); - $subscriber = new ReplicaDatabaseIgnoreSubscriber(); - $subscriber->checkReplicaServer($event); - - $db1 = Database::getConnection('default', 'default'); - $db2 = Database::getConnection('replica', 'default'); - - $this->assertSame($db1, $db2, 'System Init ignores secondaries when requested.'); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php --- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php Thu May 09 15:33:08 2019 +0100 @@ -8,6 +8,7 @@ /** * Tests the configure route for core modules. * + * @group #slow * @group Module */ class ModuleConfigureRouteTest extends KernelTestBase { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php --- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php Thu May 09 15:33:08 2019 +0100 @@ -15,6 +15,8 @@ * Tests requesting the name of an invalid module. * * @covers ::getName + * @group legacy + * @expectedDeprecation Calling ModuleHandler::getName() with an unknown module is deprecated in Drupal 8.7.0 and support for this will be removed in Drupal 9.0.0, check that the module exists before calling this method. See https://www.drupal.org/node/3024541. */ public function testInvalidGetName() { $module_handler = $this->container->get('module_handler'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,29 @@ +getList(); + $this->assertArrayHasKey('twig', $theme_engines); + $this->assertArrayHasKey('nyan_cat', $theme_engines); + $this->assertCount(2, $theme_engines); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Extension/ThemeExtensionListTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Extension/ThemeExtensionListTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,38 @@ +getEditable('core.extension') + ->set('module.testing', 1000) + ->set('theme.test_theme', 0) + ->save(); + + // The installation profile is provided by a container parameter. + // Saving the configuration doesn't automatically trigger invalidation + $this->container->get('kernel')->rebuildContainer(); + + /** @var \Drupal\Core\Extension\ThemeExtensionList $theme_extension_list */ + $theme_extension_list = \Drupal::service('extension.list.theme'); + $extensions = $theme_extension_list->getList(); + + $this->assertArrayHasKey('test_theme', $extensions); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php --- a/core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php Thu May 09 15:33:08 2019 +0100 @@ -35,6 +35,15 @@ parent::setUp(); // Install field configuration. $this->installConfig(['field']); + + $this->installEntitySchema('entity_test'); + $this->installEntitySchema('entity_test_mul'); + $this->installEntitySchema('entity_test_mul_langcode_key'); + $this->installEntitySchema('entity_test_mul_changed'); + $this->installEntitySchema('entity_test_rev'); + $this->installEntitySchema('entity_test_mulrev'); + $this->installEntitySchema('entity_test_mulrev_changed'); + // The users table is needed for creating dummy user accounts. $this->installEntitySchema('user'); // Register entity_test text field. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php --- a/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php Thu May 09 15:33:08 2019 +0100 @@ -27,7 +27,7 @@ parent::setUp(); $this->container->get('state')->set('entity_test.field_test_item', TRUE); - $this->entityManager->clearCachedDefinitions(); + $this->entityTypeManager->clearCachedDefinitions(); $entity_type_id = 'entity_test_mulrev'; $this->installEntitySchema($entity_type_id); @@ -49,7 +49,7 @@ 'label' => 'Test field', ])->save(); - $this->entityManager->clearCachedDefinitions(); + $this->entityTypeManager->clearCachedDefinitions(); $definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id); $this->assertTrue(!empty($definitions[$this->fieldName])); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php --- a/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,8 @@ namespace Drupal\KernelTests\Core\File; use Drupal\Component\PhpStorage\FileStorage; +use Drupal\Core\File\Exception\FileException; +use Drupal\Core\File\FileSystemInterface; /** * Tests operations dealing with directories. @@ -31,7 +33,9 @@ // Create the directories. $parent_path = $directory . DIRECTORY_SEPARATOR . $parent; $child_path = $parent_path . DIRECTORY_SEPARATOR . $child; - $this->assertTrue(drupal_mkdir($child_path, 0775, TRUE), t('No error reported when creating new local directories.'), 'File'); + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $this->assertTrue($file_system->mkdir($child_path, 0775, TRUE), t('No error reported when creating new local directories.'), 'File'); // Ensure new directories also exist. $this->assertTrue(is_dir($parent_path), t('New parent directory actually exists.'), 'File'); @@ -45,8 +49,8 @@ $this->assertDirectoryPermissions($directory, $old_mode); // Check creating a directory using an absolute path. - $absolute_path = \Drupal::service('file_system')->realpath($directory) . DIRECTORY_SEPARATOR . $this->randomMachineName() . DIRECTORY_SEPARATOR . $this->randomMachineName(); - $this->assertTrue(drupal_mkdir($absolute_path, 0775, TRUE), 'No error reported when creating new absolute directories.', 'File'); + $absolute_path = $file_system->realpath($directory) . DIRECTORY_SEPARATOR . $this->randomMachineName() . DIRECTORY_SEPARATOR . $this->randomMachineName(); + $this->assertTrue($file_system->mkdir($absolute_path, 0775, TRUE), 'No error reported when creating new absolute directories.', 'File'); $this->assertDirectoryPermissions($absolute_path, 0775); } @@ -59,10 +63,12 @@ $this->assertFalse(is_dir($directory), 'Directory does not exist prior to testing.'); // Non-existent directory. - $this->assertFalse(file_prepare_directory($directory, 0), 'Error reported for non-existing directory.', 'File'); + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $this->assertFalse($file_system->prepareDirectory($directory, 0), 'Error reported for non-existing directory.', 'File'); // Make a directory. - $this->assertTrue(file_prepare_directory($directory, FILE_CREATE_DIRECTORY), 'No error reported when creating a new directory.', 'File'); + $this->assertTrue($file_system->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY), 'No error reported when creating a new directory.', 'File'); // Make sure directory actually exists. $this->assertTrue(is_dir($directory), 'Directory actually exists.', 'File'); @@ -74,12 +80,12 @@ // in the directory on any recent version of Windows. // Make directory read only. - @drupal_chmod($directory, 0444); - $this->assertFalse(file_prepare_directory($directory, 0), 'Error reported for a non-writeable directory.', 'File'); + @$file_system->chmod($directory, 0444); + $this->assertFalse($file_system->prepareDirectory($directory, 0), 'Error reported for a non-writeable directory.', 'File'); // Test directory permission modification. $this->setSetting('file_chmod_directory', 0777); - $this->assertTrue(file_prepare_directory($directory, FILE_MODIFY_PERMISSIONS), 'No error reported when making directory writeable.', 'File'); + $this->assertTrue($file_system->prepareDirectory($directory, FileSystemInterface::MODIFY_PERMISSIONS), 'No error reported when making directory writeable.', 'File'); } // Test that the directory has the correct permissions. @@ -105,14 +111,16 @@ $basename = 'xyz.txt'; $directory = 'core/misc'; $original = $directory . '/' . $basename; - $path = file_create_filename($basename, $directory); + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $path = $file_system->createFilename($basename, $directory); $this->assertEqual($path, $original, format_string('New filepath %new equals %original.', ['%new' => $path, '%original' => $original]), 'File'); // Then we test against a file that already exists within that directory. $basename = 'druplicon.png'; $original = $directory . '/' . $basename; $expected = $directory . '/druplicon_0.png'; - $path = file_create_filename($basename, $directory); + $path = $file_system->createFilename($basename, $directory); $this->assertEqual($path, $expected, format_string('Creating a new filepath from %original equals %new (expected %expected).', ['%new' => $path, '%original' => $original, '%expected' => $expected]), 'File'); // @TODO: Finally we copy a file into a directory several times, to ensure a properly iterating filename suffix. @@ -122,8 +130,8 @@ * This will test the filepath for a destination based on passed flags and * whether or not the file exists. * - * If a file exists, file_destination($destination, $replace) will either - * return: + * If a file exists, ::getDestinationFilename($destination, $replace) will + * either return: * - the existing filepath, if $replace is FILE_EXISTS_REPLACE * - a new filepath if FILE_EXISTS_RENAME * - an error (returning FALSE) if FILE_EXISTS_ERROR. @@ -133,20 +141,26 @@ public function testFileDestination() { // First test for non-existent file. $destination = 'core/misc/xyz.txt'; - $path = file_destination($destination, FILE_EXISTS_REPLACE); - $this->assertEqual($path, $destination, 'Non-existing filepath destination is correct with FILE_EXISTS_REPLACE.', 'File'); - $path = file_destination($destination, FILE_EXISTS_RENAME); - $this->assertEqual($path, $destination, 'Non-existing filepath destination is correct with FILE_EXISTS_RENAME.', 'File'); - $path = file_destination($destination, FILE_EXISTS_ERROR); - $this->assertEqual($path, $destination, 'Non-existing filepath destination is correct with FILE_EXISTS_ERROR.', 'File'); + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_REPLACE); + $this->assertEqual($path, $destination, 'Non-existing filepath destination is correct with FileSystemInterface::EXISTS_REPLACE.', 'File'); + $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_RENAME); + $this->assertEqual($path, $destination, 'Non-existing filepath destination is correct with FileSystemInterface::EXISTS_RENAME.', 'File'); + $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_ERROR); + $this->assertEqual($path, $destination, 'Non-existing filepath destination is correct with FileSystemInterface::EXISTS_ERROR.', 'File'); $destination = 'core/misc/druplicon.png'; - $path = file_destination($destination, FILE_EXISTS_REPLACE); - $this->assertEqual($path, $destination, 'Existing filepath destination remains the same with FILE_EXISTS_REPLACE.', 'File'); - $path = file_destination($destination, FILE_EXISTS_RENAME); - $this->assertNotEqual($path, $destination, 'A new filepath destination is created when filepath destination already exists with FILE_EXISTS_RENAME.', 'File'); - $path = file_destination($destination, FILE_EXISTS_ERROR); - $this->assertEqual($path, FALSE, 'An error is returned when filepath destination already exists with FILE_EXISTS_ERROR.', 'File'); + $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_REPLACE); + $this->assertEqual($path, $destination, 'Existing filepath destination remains the same with FileSystemInterface::EXISTS_REPLACE.', 'File'); + $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_RENAME); + $this->assertNotEqual($path, $destination, 'A new filepath destination is created when filepath destination already exists with FileSystemInterface::EXISTS_RENAME.', 'File'); + $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_ERROR); + $this->assertEqual($path, FALSE, 'An error is returned when filepath destination already exists with FileSystemInterface::EXISTS_ERROR.', 'File'); + + // Invalid UTF-8 causes an exception. + $this->setExpectedException(FileException::class, "Invalid filename 'a\xFFtest\x80€.txt'"); + $file_system->getDestinationFilename("core/misc/a\xFFtest\x80€.txt", FileSystemInterface::EXISTS_REPLACE); } /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,97 @@ +createUri(); + + // Copying to a new name. + $desired_filepath = 'public://' . $this->randomMachineName(); + $new_filepath = \Drupal::service('file_system')->copy($uri, $desired_filepath, FileSystemInterface::EXISTS_ERROR); + $this->assertTrue($new_filepath, 'Copy was successful.'); + $this->assertEqual($new_filepath, $desired_filepath, 'Returned expected filepath.'); + $this->assertTrue(file_exists($uri), 'Original file remains.'); + $this->assertTrue(file_exists($new_filepath), 'New file exists.'); + $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); + + // Copying with rename. + $desired_filepath = 'public://' . $this->randomMachineName(); + $this->assertTrue(file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.'); + $newer_filepath = \Drupal::service('file_system')->copy($uri, $desired_filepath, FileSystemInterface::EXISTS_RENAME); + $this->assertTrue($newer_filepath, 'Copy was successful.'); + $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.'); + $this->assertTrue(file_exists($uri), 'Original file remains.'); + $this->assertTrue(file_exists($newer_filepath), 'New file exists.'); + $this->assertFilePermissions($newer_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); + + // TODO: test copying to a directory (rather than full directory/file path) + // TODO: test copying normal files using normal paths (rather than only streams) + } + + /** + * Copy a non-existent file. + */ + public function testNonExistent() { + // Copy non-existent file + $desired_filepath = $this->randomMachineName(); + $this->assertFalse(file_exists($desired_filepath), "Randomly named file doesn't exist."); + $this->setExpectedException(FileNotExistsException::class); + $new_filepath = \Drupal::service('file_system')->copy($desired_filepath, $this->randomMachineName()); + $this->assertFalse($new_filepath, 'Copying a missing file fails.'); + } + + /** + * Copy a file onto itself. + */ + public function testOverwriteSelf() { + // Create a file for testing + $uri = $this->createUri(); + + // Copy the file onto itself with renaming works. + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $new_filepath = $file_system->copy($uri, $uri, FileSystemInterface::EXISTS_RENAME); + $this->assertTrue($new_filepath, 'Copying onto itself with renaming works.'); + $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); + $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.'); + $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.'); + $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); + + // Copy the file onto itself without renaming fails. + $this->setExpectedException(FileExistsException::class); + $new_filepath = $file_system->copy($uri, $uri, FileSystemInterface::EXISTS_ERROR); + $this->assertFalse($new_filepath, 'Copying onto itself without renaming fails.'); + $this->assertTrue(file_exists($uri), 'File exists after copying onto itself.'); + + // Copy the file into same directory without renaming fails. + $new_filepath = $file_system->copy($uri, $file_system->dirname($uri), FileSystemInterface::EXISTS_ERROR); + $this->assertFalse($new_filepath, 'Copying onto itself fails.'); + $this->assertTrue(file_exists($uri), 'File exists after copying onto itself.'); + + // Copy the file into same directory with renaming works. + $new_filepath = $file_system->copy($uri, $file_system->dirname($uri), FileSystemInterface::EXISTS_RENAME); + $this->assertTrue($new_filepath, 'Copying into same directory works.'); + $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); + $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.'); + $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.'); + $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,75 @@ +randomMachineName(); + file_put_contents($filepath, ''); + + // Delete the file. + $this->assertTrue(\Drupal::service('file_system')->deleteRecursive($filepath), 'Function reported success.'); + $this->assertFalse(file_exists($filepath), 'Test file has been deleted.'); + } + + /** + * Try deleting an empty directory. + */ + public function testEmptyDirectory() { + // A directory to operate on. + $directory = $this->createDirectory(); + + // Delete the directory. + $this->assertTrue(\Drupal::service('file_system')->deleteRecursive($directory), 'Function reported success.'); + $this->assertFalse(file_exists($directory), 'Directory has been deleted.'); + } + + /** + * Try deleting a directory with some files. + */ + public function testDirectory() { + // A directory to operate on. + $directory = $this->createDirectory(); + $filepathA = $directory . '/A'; + $filepathB = $directory . '/B'; + file_put_contents($filepathA, ''); + file_put_contents($filepathB, ''); + + // Delete the directory. + $this->assertTrue(\Drupal::service('file_system')->deleteRecursive($directory), 'Function reported success.'); + $this->assertFalse(file_exists($filepathA), 'Test file A has been deleted.'); + $this->assertFalse(file_exists($filepathB), 'Test file B has been deleted.'); + $this->assertFalse(file_exists($directory), 'Directory has been deleted.'); + } + + /** + * Try deleting subdirectories with some files. + */ + public function testSubDirectory() { + // A directory to operate on. + $directory = $this->createDirectory(); + $subdirectory = $this->createDirectory($directory . '/sub'); + $filepathA = $directory . '/A'; + $filepathB = $subdirectory . '/B'; + file_put_contents($filepathA, ''); + file_put_contents($filepathB, ''); + + // Delete the directory. + $this->assertTrue(\Drupal::service('file_system')->deleteRecursive($directory), 'Function reported success.'); + $this->assertFalse(file_exists($filepathA), 'Test file A has been deleted.'); + $this->assertFalse(file_exists($filepathB), 'Test file B has been deleted.'); + $this->assertFalse(file_exists($subdirectory), 'Subdirectory has been deleted.'); + $this->assertFalse(file_exists($directory), 'Directory has been deleted.'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,52 @@ +createUri(); + + // Delete a regular file + $this->assertTrue(\Drupal::service('file_system')->delete($uri), 'Deleted worked.'); + $this->assertFalse(file_exists($uri), 'Test file has actually been deleted.'); + } + + /** + * Try deleting a missing file. + */ + public function testMissing() { + // Try to delete a non-existing file + $this->assertTrue(\Drupal::service('file_system')->delete(file_default_scheme() . '/' . $this->randomMachineName()), 'Returns true when deleting a non-existent file.'); + } + + /** + * Try deleting a directory. + */ + public function testDirectory() { + // A directory to operate on. + $directory = $this->createDirectory(); + + // Try to delete a directory. + try { + \Drupal::service('file_system')->delete($directory); + $this->fail('Expected NotRegularFileException'); + } + catch (NotRegularFileException $e) { + // Ignore. + } + $this->assertTrue(file_exists($directory), 'Directory has not been deleted.'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,82 @@ +createUri(); + + // Moving to a new name. + $desired_filepath = 'public://' . $this->randomMachineName(); + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $new_filepath = $file_system->move($uri, $desired_filepath, FileSystemInterface::EXISTS_ERROR); + $this->assertTrue($new_filepath, 'Move was successful.'); + $this->assertEqual($new_filepath, $desired_filepath, 'Returned expected filepath.'); + $this->assertTrue(file_exists($new_filepath), 'File exists at the new location.'); + $this->assertFalse(file_exists($uri), 'No file remains at the old location.'); + $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); + + // Moving with rename. + $desired_filepath = 'public://' . $this->randomMachineName(); + $this->assertTrue(file_exists($new_filepath), 'File exists before moving.'); + $this->assertTrue(file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.'); + $newer_filepath = $file_system->move($new_filepath, $desired_filepath, FileSystemInterface::EXISTS_RENAME); + $this->assertTrue($newer_filepath, 'Move was successful.'); + $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.'); + $this->assertTrue(file_exists($newer_filepath), 'File exists at the new location.'); + $this->assertFalse(file_exists($new_filepath), 'No file remains at the old location.'); + $this->assertFilePermissions($newer_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); + + // TODO: test moving to a directory (rather than full directory/file path) + // TODO: test creating and moving normal files (rather than streams) + } + + /** + * Try to move a missing file. + */ + public function testMissing() { + // Move non-existent file. + $this->setExpectedException(FileNotExistsException::class); + \Drupal::service('file_system')->move($this->randomMachineName(), $this->randomMachineName()); + } + + /** + * Try to move a file onto itself. + */ + public function testOverwriteSelf() { + // Create a file for testing. + $uri = $this->createUri(); + + // Move the file onto itself without renaming shouldn't make changes. + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $this->setExpectedException(FileException::class); + $new_filepath = $file_system->move($uri, $uri, FileSystemInterface::EXISTS_REPLACE); + $this->assertFalse($new_filepath, 'Moving onto itself without renaming fails.'); + $this->assertTrue(file_exists($uri), 'File exists after moving onto itself.'); + + // Move the file onto itself with renaming will result in a new filename. + $new_filepath = $file_system->move($uri, $uri, FileSystemInterface::EXISTS_RENAME); + $this->assertTrue($new_filepath, 'Moving onto itself with renaming works.'); + $this->assertFalse(file_exists($uri), 'Original file has been removed.'); + $this->assertTrue(file_exists($new_filepath), 'File exists after moving onto itself.'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/FileSaveDataTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/FileSaveDataTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,31 @@ +randomMachineName(8); + $this->setSetting('file_chmod_file', 0777); + + // No filename. + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + + // Provide a filename. + $filepath = $file_system->saveData($contents, 'public://asdf.txt', FILE_EXISTS_REPLACE); + $this->assertTrue($filepath, 'Unnamed file saved correctly.'); + $this->assertEqual('asdf.txt', \Drupal::service('file_system')->basename($filepath), 'File was named correctly.'); + $this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.'); + $this->assertFilePermissions($filepath, 0777); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,149 @@ +assertNotNull(drupal_move_uploaded_file('', '')); + } + + /** + * @expectedDeprecation file_unmanaged_copy() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::copy(). See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedUnmanagedFileCopy() { + $source = file_directory_temp() . '/example.txt'; + file_put_contents($source, 'example'); + $filename = file_unmanaged_copy($source); + $this->assertEquals('public://example.txt', $filename); + } + + /** + * @expectedDeprecation file_unmanaged_delete() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::delete(). See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedUnmanagedFileDelete() { + $this->assertNotNull(file_unmanaged_delete(NULL)); + } + + /** + * @expectedDeprecation file_unmanaged_delete_recursive() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::deleteRecursive(). See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedUnmanagedFileDeleteRecursive() { + $this->assertNotNull(file_unmanaged_delete_recursive(NULL)); + } + + /** + * @expectedDeprecation file_unmanaged_move() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::move(). See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedUnmanagedFileMove() { + $source = file_directory_temp() . '/example.txt'; + file_put_contents($source, 'example'); + $filename = file_unmanaged_move($source); + $this->assertEquals('public://example.txt', $filename); + } + + /** + * @expectedDeprecation file_unmanaged_prepare() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::getDestinationFilename() instead. See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedUnmanagedPrepare() { + $this->assertNotNull(file_unmanaged_prepare(NULL)); + } + + /** + * @expectedDeprecation file_unmanaged_save_data() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::saveData(). See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedUnmanagedSaveData() { + $filename = file_unmanaged_save_data('example'); + $this->assertStringMatchesFormat('public://file%s', $filename); + } + + /** + * @expectedDeprecation file_prepare_directory() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::prepareDirectory(). See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedFilePrepareDirectory() { + $dir = NULL; + $this->assertNotNull(file_prepare_directory($dir)); + } + + /** + * @expectedDeprecation file_destination() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::getDestinationFilename(). See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedFileDestination() { + $this->assertNotNull(file_destination('', '')); + } + + /** + * @expectedDeprecation file_create_filename() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::createFilename(). See https://www.drupal.org/node/3006851. + */ + public function testDeprecatedFileCreate() { + $this->assertNotNull(file_create_filename('', '')); + } + + /** + * @expectedDeprecation file_upload_max_size() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Component\Utility\Environment::getUploadMaxSize() instead. See https://www.drupal.org/node/3000058. + */ + public function testDeprecatedFileUploadMaxSize() { + $this->assertNotNull(file_upload_max_size()); + } + + /** + * @expectedDeprecation drupal_chmod() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::chmod(). See https://www.drupal.org/node/2418133. + */ + public function testDeprecatedDrupalChmod() { + $this->assertNotNull(drupal_chmod('')); + } + + /** + * @expectedDeprecation drupal_dirname() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::dirname(). See https://www.drupal.org/node/2418133. + */ + public function testDeprecatedDrupalDirname() { + $this->assertNotNull(drupal_dirname('')); + } + + /** + * @expectedDeprecation drupal_basename() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::basename(). See https://www.drupal.org/node/2418133. + */ + public function testDeprecatedDrupalBasename() { + $this->assertNotNull(drupal_basename('')); + } + + /** + * @expectedDeprecation drupal_mkdir() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::mkdir(). See https://www.drupal.org/node/2418133. + */ + public function testDeprecatedDrupalMkdir() { + $this->assertNotNull(drupal_mkdir('public://test.txt')); + } + + /** + * @expectedDeprecation drupal_rmdir() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::rmdir(). See https://www.drupal.org/node/2418133. + */ + public function testDeprecatedDrupalRmdir() { + $this->assertNotNull(drupal_rmdir('public://test.txt')); + } + + /** + * @expectedDeprecation tempnam() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::tempnam(). See https://www.drupal.org/node/2418133. + */ + public function testDeprecatedDrupalTempnam() { + $this->assertNotNull(drupal_tempnam('temporary://', 'file')); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,102 @@ +fileSystem = $this->container->get('file_system'); + } + + /** + * @covers ::copy + */ + public function testEnsureFileExistsBeforeCopy() { + // We need to compute the exception message here because it will include + // the 'real' path to the file, which varies with $this->siteDirectory. + $this->setExpectedException( + FileNotExistsException::class, + "File 'public://test.txt' ('{$this->siteDirectory}/files/test.txt') could not be copied because it does not exist" + ); + + $this->fileSystem->copy('public://test.txt', 'public://test-copy.txt'); + } + + /** + * @covers ::copy + */ + public function testDestinationDirectoryFailureOnCopy() { + $this->setExpectedException(DirectoryNotReadyException::class, "The specified file 'public://test.txt' could not be copied because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions"); + touch('public://test.txt'); + // public://subdirectory has not been created, so \Drupal::service('file_system')->prepareDirectory() + // will fail, causing copy() to throw DirectoryNotReadyException. + $this->fileSystem->copy('public://test.txt', 'public://subdirectory/test.txt'); + } + + /** + * @covers ::copy + */ + public function testCopyFailureIfFileAlreadyExists() { + $this->setExpectedException(FileExistsException::class, "File 'public://test.txt' could not be copied because a file by that name already exists in the destination directory ('')"); + $uri = 'public://test.txt'; + touch($uri); + $this->fileSystem->copy($uri, $uri, FileSystemInterface::EXISTS_ERROR); + } + + /** + * @covers ::copy + */ + public function testCopyFailureIfSelfOverwrite() { + $this->setExpectedException(FileException::class, "'public://test.txt' could not be copied because it would overwrite itself"); + $uri = 'public://test.txt'; + touch($uri); + $this->fileSystem->copy($uri, $uri, FileSystemInterface::EXISTS_REPLACE); + } + + /** + * @covers ::copy + */ + public function testCopySelfRename() { + $uri = 'public://test.txt'; + touch($uri); + $this->fileSystem->copy($uri, $uri); + $this->assertFileExists('public://test_0.txt'); + } + + /** + * @covers ::copy + */ + public function testSuccessfulCopy() { + touch('public://test.txt'); + $this->fileSystem->copy('public://test.txt', 'public://test-copy.txt'); + $this->assertFileExists('public://test-copy.txt'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/FileTestBase.php --- a/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -164,7 +164,7 @@ if (!isset($path)) { $path = file_default_scheme() . '://' . $this->randomMachineName(); } - $this->assertTrue(drupal_mkdir($path) && is_dir($path), 'Directory was created successfully.'); + $this->assertTrue(\Drupal::service('file_system')->mkdir($path) && is_dir($path), 'Directory was created successfully.'); return $path; } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php --- a/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php Thu May 09 15:33:08 2019 +0100 @@ -86,13 +86,15 @@ $dirname = $this->randomMachineName(); $dir = $site_path . '/files/' . $dirname; $readonlydir = $this->scheme . '://' . $dirname; - $this->assertFalse(@drupal_mkdir($readonlydir, 0775, 0), 'Unable to create directory with read-only stream wrapper.'); + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $this->assertFalse(@$file_system->mkdir($readonlydir, 0775, 0), 'Unable to create directory with read-only stream wrapper.'); // Create a temporary directory for testing purposes - $this->assertTrue(drupal_mkdir($dir), 'Test directory created.'); + $this->assertTrue($file_system->mkdir($dir), 'Test directory created.'); // Test the rmdir() function by attempting to remove the directory. - $this->assertFalse(@drupal_rmdir($readonlydir), 'Unable to delete directory with read-only stream wrapper.'); + $this->assertFalse(@$file_system->rmdir($readonlydir), 'Unable to delete directory with read-only stream wrapper.'); // Remove the temporary directory. - drupal_rmdir($dir); + $file_system->rmdir($dir); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileDeleteRecursiveTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileDeleteRecursiveTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,38 @@ +config('system.file')->set('default_scheme', 'dummy-remote')->save(); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileDeleteTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileDeleteTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,38 @@ +config('system.file')->set('default_scheme', 'dummy-remote')->save(); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileMoveTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileMoveTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,38 @@ +config('system.file')->set('default_scheme', 'dummy-remote')->save(); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileSaveDataTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileSaveDataTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,38 @@ +config('system.file')->set('default_scheme', 'dummy-remote')->save(); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedCopyTest.php --- a/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedCopyTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedCopyTest.php Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,7 @@ * * @group File */ -class RemoteFileUnmanagedCopyTest extends UnmanagedCopyTest { +class RemoteFileUnmanagedCopyTest extends FileCopyTest { /** * Modules to enable. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteRecursiveTest.php --- a/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteRecursiveTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -config('system.file')->set('default_scheme', 'dummy-remote')->save(); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteTest.php --- a/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -config('system.file')->set('default_scheme', 'dummy-remote')->save(); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedMoveTest.php --- a/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedMoveTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -config('system.file')->set('default_scheme', 'dummy-remote')->save(); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedSaveDataTest.php --- a/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedSaveDataTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -config('system.file')->set('default_scheme', 'dummy-remote')->save(); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php --- a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php Thu May 09 15:33:08 2019 +0100 @@ -39,7 +39,7 @@ parent::setUp(); // Add file_private_path setting. - $request = Request::create('/');; + $request = Request::create('/'); $site_path = DrupalKernel::findSitePath($request); $this->setSetting('file_private_path', $site_path . '/private'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php --- a/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -createUri(); - - // Copying to a new name. - $desired_filepath = 'public://' . $this->randomMachineName(); - $new_filepath = file_unmanaged_copy($uri, $desired_filepath, FILE_EXISTS_ERROR); - $this->assertTrue($new_filepath, 'Copy was successful.'); - $this->assertEqual($new_filepath, $desired_filepath, 'Returned expected filepath.'); - $this->assertTrue(file_exists($uri), 'Original file remains.'); - $this->assertTrue(file_exists($new_filepath), 'New file exists.'); - $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); - - // Copying with rename. - $desired_filepath = 'public://' . $this->randomMachineName(); - $this->assertTrue(file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.'); - $newer_filepath = file_unmanaged_copy($uri, $desired_filepath, FILE_EXISTS_RENAME); - $this->assertTrue($newer_filepath, 'Copy was successful.'); - $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.'); - $this->assertTrue(file_exists($uri), 'Original file remains.'); - $this->assertTrue(file_exists($newer_filepath), 'New file exists.'); - $this->assertFilePermissions($newer_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); - - // TODO: test copying to a directory (rather than full directory/file path) - // TODO: test copying normal files using normal paths (rather than only streams) - } - - /** - * Copy a non-existent file. - */ - public function testNonExistent() { - // Copy non-existent file - $desired_filepath = $this->randomMachineName(); - $this->assertFalse(file_exists($desired_filepath), "Randomly named file doesn't exist."); - $new_filepath = file_unmanaged_copy($desired_filepath, $this->randomMachineName()); - $this->assertFalse($new_filepath, 'Copying a missing file fails.'); - } - - /** - * Copy a file onto itself. - */ - public function testOverwriteSelf() { - // Create a file for testing - $uri = $this->createUri(); - - // Copy the file onto itself with renaming works. - $new_filepath = file_unmanaged_copy($uri, $uri, FILE_EXISTS_RENAME); - $this->assertTrue($new_filepath, 'Copying onto itself with renaming works.'); - $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); - $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.'); - $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.'); - $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); - - // Copy the file onto itself without renaming fails. - $new_filepath = file_unmanaged_copy($uri, $uri, FILE_EXISTS_ERROR); - $this->assertFalse($new_filepath, 'Copying onto itself without renaming fails.'); - $this->assertTrue(file_exists($uri), 'File exists after copying onto itself.'); - - // Copy the file into same directory without renaming fails. - $new_filepath = file_unmanaged_copy($uri, drupal_dirname($uri), FILE_EXISTS_ERROR); - $this->assertFalse($new_filepath, 'Copying onto itself fails.'); - $this->assertTrue(file_exists($uri), 'File exists after copying onto itself.'); - - // Copy the file into same directory with renaming works. - $new_filepath = file_unmanaged_copy($uri, drupal_dirname($uri), FILE_EXISTS_RENAME); - $this->assertTrue($new_filepath, 'Copying into same directory works.'); - $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); - $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.'); - $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.'); - $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteRecursiveTest.php --- a/core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteRecursiveTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -randomMachineName(); - file_put_contents($filepath, ''); - - // Delete the file. - $this->assertTrue(file_unmanaged_delete_recursive($filepath), 'Function reported success.'); - $this->assertFalse(file_exists($filepath), 'Test file has been deleted.'); - } - - /** - * Try deleting an empty directory. - */ - public function testEmptyDirectory() { - // A directory to operate on. - $directory = $this->createDirectory(); - - // Delete the directory. - $this->assertTrue(file_unmanaged_delete_recursive($directory), 'Function reported success.'); - $this->assertFalse(file_exists($directory), 'Directory has been deleted.'); - } - - /** - * Try deleting a directory with some files. - */ - public function testDirectory() { - // A directory to operate on. - $directory = $this->createDirectory(); - $filepathA = $directory . '/A'; - $filepathB = $directory . '/B'; - file_put_contents($filepathA, ''); - file_put_contents($filepathB, ''); - - // Delete the directory. - $this->assertTrue(file_unmanaged_delete_recursive($directory), 'Function reported success.'); - $this->assertFalse(file_exists($filepathA), 'Test file A has been deleted.'); - $this->assertFalse(file_exists($filepathB), 'Test file B has been deleted.'); - $this->assertFalse(file_exists($directory), 'Directory has been deleted.'); - } - - /** - * Try deleting subdirectories with some files. - */ - public function testSubDirectory() { - // A directory to operate on. - $directory = $this->createDirectory(); - $subdirectory = $this->createDirectory($directory . '/sub'); - $filepathA = $directory . '/A'; - $filepathB = $subdirectory . '/B'; - file_put_contents($filepathA, ''); - file_put_contents($filepathB, ''); - - // Delete the directory. - $this->assertTrue(file_unmanaged_delete_recursive($directory), 'Function reported success.'); - $this->assertFalse(file_exists($filepathA), 'Test file A has been deleted.'); - $this->assertFalse(file_exists($filepathB), 'Test file B has been deleted.'); - $this->assertFalse(file_exists($subdirectory), 'Subdirectory has been deleted.'); - $this->assertFalse(file_exists($directory), 'Directory has been deleted.'); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteTest.php --- a/core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -createUri(); - - // Delete a regular file - $this->assertTrue(file_unmanaged_delete($uri), 'Deleted worked.'); - $this->assertFalse(file_exists($uri), 'Test file has actually been deleted.'); - } - - /** - * Try deleting a missing file. - */ - public function testMissing() { - // Try to delete a non-existing file - $this->assertTrue(file_unmanaged_delete(file_default_scheme() . '/' . $this->randomMachineName()), 'Returns true when deleting a non-existent file.'); - } - - /** - * Try deleting a directory. - */ - public function testDirectory() { - // A directory to operate on. - $directory = $this->createDirectory(); - - // Try to delete a directory - $this->assertFalse(file_unmanaged_delete($directory), 'Could not delete the delete directory.'); - $this->assertTrue(file_exists($directory), 'Directory has not been deleted.'); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php --- a/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -createUri(); - - // Moving to a new name. - $desired_filepath = 'public://' . $this->randomMachineName(); - $new_filepath = file_unmanaged_move($uri, $desired_filepath, FILE_EXISTS_ERROR); - $this->assertTrue($new_filepath, 'Move was successful.'); - $this->assertEqual($new_filepath, $desired_filepath, 'Returned expected filepath.'); - $this->assertTrue(file_exists($new_filepath), 'File exists at the new location.'); - $this->assertFalse(file_exists($uri), 'No file remains at the old location.'); - $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); - - // Moving with rename. - $desired_filepath = 'public://' . $this->randomMachineName(); - $this->assertTrue(file_exists($new_filepath), 'File exists before moving.'); - $this->assertTrue(file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.'); - $newer_filepath = file_unmanaged_move($new_filepath, $desired_filepath, FILE_EXISTS_RENAME); - $this->assertTrue($newer_filepath, 'Move was successful.'); - $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.'); - $this->assertTrue(file_exists($newer_filepath), 'File exists at the new location.'); - $this->assertFalse(file_exists($new_filepath), 'No file remains at the old location.'); - $this->assertFilePermissions($newer_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); - - // TODO: test moving to a directory (rather than full directory/file path) - // TODO: test creating and moving normal files (rather than streams) - } - - /** - * Try to move a missing file. - */ - public function testMissing() { - // Move non-existent file. - $new_filepath = file_unmanaged_move($this->randomMachineName(), $this->randomMachineName()); - $this->assertFalse($new_filepath, 'Moving a missing file fails.'); - } - - /** - * Try to move a file onto itself. - */ - public function testOverwriteSelf() { - // Create a file for testing. - $uri = $this->createUri(); - - // Move the file onto itself without renaming shouldn't make changes. - $new_filepath = file_unmanaged_move($uri, $uri, FILE_EXISTS_REPLACE); - $this->assertFalse($new_filepath, 'Moving onto itself without renaming fails.'); - $this->assertTrue(file_exists($uri), 'File exists after moving onto itself.'); - - // Move the file onto itself with renaming will result in a new filename. - $new_filepath = file_unmanaged_move($uri, $uri, FILE_EXISTS_RENAME); - $this->assertTrue($new_filepath, 'Moving onto itself with renaming works.'); - $this->assertFalse(file_exists($uri), 'Original file has been removed.'); - $this->assertTrue(file_exists($new_filepath), 'File exists after moving onto itself.'); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php --- a/core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -randomMachineName(8); - $this->setSetting('file_chmod_file', 0777); - - // No filename. - $filepath = file_unmanaged_save_data($contents); - $this->assertTrue($filepath, 'Unnamed file saved correctly.'); - $this->assertEqual(file_uri_scheme($filepath), file_default_scheme(), "File was placed in Drupal's files directory."); - $this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.'); - - // Provide a filename. - $filepath = file_unmanaged_save_data($contents, 'public://asdf.txt', FILE_EXISTS_REPLACE); - $this->assertTrue($filepath, 'Unnamed file saved correctly.'); - $this->assertEqual('asdf.txt', drupal_basename($filepath), 'File was named correctly.'); - $this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.'); - $this->assertFilePermissions($filepath, 0777); - } - -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php --- a/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php Thu May 09 15:33:08 2019 +0100 @@ -76,19 +76,21 @@ $uri = $this->createUri(); $url = file_create_url($uri); $public_directory_path = \Drupal::service('stream_wrapper_manager')->getViaScheme('public')->getDirectoryPath(); - $this->assertEqual(FILE_URL_TEST_CDN_2 . '/' . $public_directory_path . '/' . drupal_basename($uri), $url, 'Correctly generated a CDN URL for a created file.'); + /** @var \Drupal\Core\File\FileSystemInterface $file_system */ + $file_system = \Drupal::service('file_system'); + $this->assertEqual(FILE_URL_TEST_CDN_2 . '/' . $public_directory_path . '/' . $file_system->basename($uri), $url, 'Correctly generated a CDN URL for a created file.'); // Test alteration of file URLs to use root-relative URLs. \Drupal::state()->set('file_test.hook_file_url_alter', 'root-relative'); $uri = $this->createUri(); $url = file_create_url($uri); - $this->assertEqual(base_path() . '/' . $public_directory_path . '/' . drupal_basename($uri), $url, 'Correctly generated a root-relative URL for a created file.'); + $this->assertEqual(base_path() . '/' . $public_directory_path . '/' . $file_system->basename($uri), $url, 'Correctly generated a root-relative URL for a created file.'); // Test alteration of file URLs to use a protocol-relative URLs. \Drupal::state()->set('file_test.hook_file_url_alter', 'protocol-relative'); $uri = $this->createUri(); $url = file_create_url($uri); - $this->assertEqual('/' . base_path() . '/' . $public_directory_path . '/' . drupal_basename($uri), $url, 'Correctly generated a protocol-relative URL for a created file.'); + $this->assertEqual('/' . base_path() . '/' . $public_directory_path . '/' . $file_system->basename($uri), $url, 'Correctly generated a protocol-relative URL for a created file.'); } /** @@ -112,7 +114,7 @@ $uri = $this->createUri(); $url = file_create_url($uri); $public_directory_path = \Drupal::service('stream_wrapper_manager')->getViaScheme('public')->getDirectoryPath(); - $this->assertSame(base_path() . $public_directory_path . '/' . rawurlencode(drupal_basename($uri)), file_url_transform_relative($url)); + $this->assertSame(base_path() . $public_directory_path . '/' . rawurlencode(\Drupal::service('file_system')->basename($uri)), file_url_transform_relative($url)); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php --- a/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,7 @@ namespace Drupal\KernelTests\Core\Image; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Image\ImageInterface; use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Site\Settings; @@ -274,7 +275,7 @@ // Prepare a directory for test file results. $directory = Settings::get('file_public_path') . '/imagetest'; - file_prepare_directory($directory, FILE_CREATE_DIRECTORY); + \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY); foreach ($files as $file) { foreach ($operations as $op => $values) { @@ -450,7 +451,7 @@ public function testGifTransparentImages() { // Prepare a directory for test file results. $directory = Settings::get('file_public_path') . '/imagetest'; - file_prepare_directory($directory, FILE_CREATE_DIRECTORY); + \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY); // Test loading an indexed GIF image with transparent color set. // Color at top-right pixel should be fully transparent. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php --- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php Thu May 09 15:33:08 2019 +0100 @@ -33,7 +33,8 @@ */ public function testGarbageCollection() { $collection = $this->randomMachineName(); - $store = new DatabaseStorageExpirable($collection, new PhpSerialize(), Database::getConnection()); + $connection = Database::getConnection(); + $store = new DatabaseStorageExpirable($collection, new PhpSerialize(), $connection); // Insert some items and confirm that they're set. for ($i = 0; $i <= 3; $i++) { @@ -43,7 +44,7 @@ // Manually expire the data. for ($i = 0; $i <= 3; $i++) { - db_merge('key_value_expire') + $connection->merge('key_value_expire') ->keys([ 'name' => 'key_' . $i, 'collection' => $collection, diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php --- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -58,7 +58,7 @@ $this->assertIdentical($empty->getEntityTypeId(), 'entity_test_label'); // The URI can only be checked after saving. try { - $empty->urlInfo(); + $empty->toUrl(); $this->fail('EntityMalformedException was thrown.'); } catch (EntityMalformedException $e) { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php --- a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php Thu May 09 15:33:08 2019 +0100 @@ -41,6 +41,7 @@ 'menu_link_content', 'field', 'link', + 'user', ]; /** @@ -49,6 +50,7 @@ protected function setUp() { parent::setUp(); \Drupal::service('router.builder')->rebuild(); + $this->installEntitySchema('user'); $this->installEntitySchema('menu_link_content'); $this->linkTree = $this->container->get('menu.link_tree'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Messenger/MessengerLegacyTest.php --- a/core/tests/Drupal/KernelTests/Core/Messenger/MessengerLegacyTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Messenger/MessengerLegacyTest.php Thu May 09 15:33:08 2019 +0100 @@ -9,13 +9,16 @@ /** * @group Messenger + * @group legacy + * * @coversDefaultClass \Drupal\Core\Messenger\LegacyMessenger * - * Note: The Symphony PHPUnit Bridge automatically treats any test class that - * starts with "Legacy" as a deprecation. To subvert that, reverse it here. + * Normally this test class would be named LegacyMessengerTest, but test classes + * starting with 'Legacy' are treated as belonging to group legacy. We want to + * explicitly use group annotation for consistency with other legacy tests. * - * @see http://symfony.com/blog/new-in-symfony-2-7-phpunit-bridge * @see https://www.drupal.org/node/2931598#comment-12395743 + * @see https://www.drupal.org/node/2774931 */ class MessengerLegacyTest extends KernelTestBase { @@ -42,6 +45,8 @@ * @covers ::addError * @covers ::addStatus * @covers ::addWarning + * + * @expectedDeprecation Adding or retrieving messages prior to the container being initialized was deprecated in Drupal 8.5.0 and this functionality will be removed before Drupal 9.0.0. Please report this usage at https://www.drupal.org/node/2928994. */ public function testMessages() { // Save the current container for later use. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php --- a/core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php Thu May 09 15:33:08 2019 +0100 @@ -6,6 +6,7 @@ use Drupal\entity_test\Entity\EntityTestMulRev; use Drupal\KernelTests\KernelTestBase; use Drupal\language\Entity\ConfigurableLanguage; +use Drupal\Tests\user\Traits\UserCreationTrait; /** * Tests the entity converter when the "load_latest_revision" flag is set. @@ -15,6 +16,8 @@ */ class EntityConverterLatestRevisionTest extends KernelTestBase { + use UserCreationTrait; + /** * Modules to install. * @@ -40,7 +43,8 @@ protected function setUp() { parent::setUp(); - $this->installEntitySchema('user'); + $this->setUpCurrentUser(); + $this->installEntitySchema('entity_test_mulrev'); $this->installEntitySchema('entity_test'); $this->installConfig(['system', 'language']); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php --- a/core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php Thu May 09 15:33:08 2019 +0100 @@ -6,6 +6,7 @@ use Drupal\Core\Url; use Drupal\entity_test\Entity\EntityTest; use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\user\Traits\UserCreationTrait; /** * Tests the path validator. @@ -16,16 +17,19 @@ */ class PathValidatorTest extends KernelTestBase { + use UserCreationTrait; + /** * {@inheritdoc} */ - public static $modules = ['path', 'entity_test', 'user']; + public static $modules = ['path', 'entity_test', 'system', 'user']; /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); + $this->setUpCurrentUser(); $this->installEntitySchema('entity_test'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Plugin/Annotation/ContextDefinitionTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Plugin/Annotation/ContextDefinitionTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,30 @@ +container->get('plugin.manager.block')->getDefinition('test_context_aware'); + $this->assertArrayHasKey('context_definitions', $definition); + $this->assertArrayHasKey('user', $definition['context_definitions']); + $this->assertInstanceOf(ContextDefinition::class, $definition['context_definitions']['user']); + $this->assertEquals(['NotNull' => []], $definition['context_definitions']['user']->getConstraints()); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,71 @@ + ['a_context_id' => $context_definition]]; + $plugin = new TestContextAwarePlugin([], 'test_plugin_id', $definition); + (new ContextHandler())->applyContextMapping($plugin, ['a_context_id' => $context]); + + $result = $plugin->getContext('a_context_id'); + + $this->assertInstanceOf(EntityContext::class, $result); + $this->assertSame($context, $result); + } + + /** + * @covers ::applyContextMapping + */ + public function testApplyContextMappingAlreadyApplied() { + $entity = EntityTest::create([]); + $context_definition = EntityContextDefinition::fromEntity($entity); + $context = EntityContext::fromEntity($entity); + + $definition = ['context_definitions' => ['a_context_id' => $context_definition]]; + $plugin = new TestContextAwarePlugin([], 'test_plugin_id', $definition); + $plugin->setContext('a_context_id', $context); + (new ContextHandler())->applyContextMapping($plugin, []); + + $result = $plugin->getContext('a_context_id'); + + $this->assertInstanceOf(EntityContext::class, $result); + $this->assertSame($context, $result); + } + +} + +/** + * Provides a test implementation of a context-aware plugin. + */ +class TestContextAwarePlugin extends ContextAwarePluginBase { + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php --- a/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php Thu May 09 15:33:08 2019 +0100 @@ -72,7 +72,7 @@ $user = User::create(['name' => $name]); $plugin->setContextValue('user', $user); - $this->assertEqual($plugin->getContextValue('user')->getUsername(), $user->getUsername()); + $this->assertEqual($plugin->getContextValue('user')->getAccountName(), $user->getAccountName()); $this->assertEqual($user->label(), $plugin->getTitle()); // Test Optional context handling. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php --- a/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -92,7 +92,7 @@ 'id' => 'user_name', 'label' => 'User name', 'class' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockUserNameBlock', - 'context' => [ + 'context_definitions' => [ 'user' => EntityContextDefinition::fromEntityTypeId('user')->setLabel('User'), ], ], @@ -100,7 +100,7 @@ 'id' => 'user_name_optional', 'label' => 'User name optional', 'class' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockUserNameBlock', - 'context' => [ + 'context_definitions' => [ 'user' => EntityContextDefinition::fromEntityTypeId('user')->setLabel('User')->setRequired(FALSE), ], ], @@ -113,7 +113,7 @@ 'id' => 'complex_context', 'label' => 'Complex context', 'class' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockComplexContextBlock', - 'context' => [ + 'context_definitions' => [ 'user' => EntityContextDefinition::fromEntityTypeId('user')->setLabel('User'), 'node' => EntityContextDefinition::fromEntityTypeId('node')->setLabel('Node'), ], diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Render/Element/TableSortExtenderTest.php --- a/core/tests/Drupal/KernelTests/Core/Render/Element/TableSortExtenderTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Render/Element/TableSortExtenderTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,7 @@ namespace Drupal\KernelTests\Core\Render\Element; use Drupal\Component\Utility\Html; +use Drupal\Core\Utility\TableSort; use Drupal\KernelTests\KernelTestBase; use Symfony\Component\HttpFoundation\Request; @@ -14,7 +15,7 @@ class TableSortExtenderTest extends KernelTestBase { /** - * Tests tablesort_init(). + * Tests \Drupal\Core\Utility\TableSort::getContextFromRequest(). */ public function testTableSortInit() { @@ -32,7 +33,7 @@ $request = Request::createFromGlobals(); $request->query->replace([]); \Drupal::getContainer()->get('request_stack')->push($request); - $ts = tablesort_init($headers); + $ts = TableSort::getContextFromRequest($headers, $request); $this->verbose(strtr('$ts:
!ts
', ['!ts' => Html::escape(var_export($ts, TRUE))])); $this->assertEqual($ts, $expected_ts, 'Simple table headers sorted correctly.'); @@ -45,7 +46,7 @@ 'order' => 'bar', ]); \Drupal::getContainer()->get('request_stack')->push($request); - $ts = tablesort_init($headers); + $ts = TableSort::getContextFromRequest($headers, $request); $this->verbose(strtr('$ts:
!ts
', ['!ts' => Html::escape(var_export($ts, TRUE))])); $this->assertEqual($ts, $expected_ts, 'Simple table headers plus non-overriding $_GET parameters sorted correctly.'); @@ -61,7 +62,7 @@ \Drupal::getContainer()->get('request_stack')->push($request); $expected_ts['sort'] = 'desc'; $expected_ts['query'] = ['alpha' => 'beta']; - $ts = tablesort_init($headers); + $ts = TableSort::getContextFromRequest($headers, $request); $this->verbose(strtr('$ts:
!ts
', ['!ts' => Html::escape(var_export($ts, TRUE))])); $this->assertEqual($ts, $expected_ts, 'Simple table headers plus $_GET parameters sorted correctly.'); @@ -87,7 +88,7 @@ 'order' => '2', ]); \Drupal::getContainer()->get('request_stack')->push($request); - $ts = tablesort_init($headers); + $ts = TableSort::getContextFromRequest($headers, $request); $expected_ts = [ 'name' => '2', 'sql' => 'two', @@ -106,7 +107,7 @@ 'order' => 'bar', ]); \Drupal::getContainer()->get('request_stack')->push($request); - $ts = tablesort_init($headers); + $ts = TableSort::getContextFromRequest($headers, $request); $expected_ts = [ 'name' => '1', 'sql' => 'one', @@ -133,7 +134,7 @@ 'sort' => 'asc', 'query' => ['alpha' => 'beta'], ]; - $ts = tablesort_init($headers); + $ts = TableSort::getContextFromRequest($headers, $request); $this->verbose(strtr('$ts:
!ts
', ['!ts' => Html::escape(var_export($ts, TRUE))])); $this->assertEqual($ts, $expected_ts, 'Complex table headers plus $_GET parameters sorted correctly.'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php --- a/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,7 +3,7 @@ namespace Drupal\KernelTests\Core\Render; use Drupal\KernelTests\KernelTestBase; -use Drupal\simpletest\UserCreationTrait; +use Drupal\Tests\user\Traits\UserCreationTrait; /** * Tests the caching of render items via functional tests. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Render/RendererLegacyTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Render/RendererLegacyTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,40 @@ +assertSame($expected, drupal_http_header_attributes($attributes)); + $this->assertSame($expected, HtmlResponseAttachmentsProcessor::formatHttpHeaderAttributes($attributes)); + } + + /** + * Provides a list of attributes to test. + */ + public function providerAttributes() { + return [ + [' foo=""', ['foo' => '']], + [' foo=""', ['foo' => []]], + [' foo="bar"', ['foo' => 'bar']], + [' foo="bar"', ['foo' => ['bar']]], + [' foo="bar baz"', ['foo' => ['bar', 'baz']]], + ]; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php --- a/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,7 @@ namespace Drupal\KernelTests\Core\Routing; use Drupal\Core\KeyValueStore\KeyValueMemoryFactory; +use Drupal\Core\Routing\RouteCompiler; use Drupal\Core\State\State; use Drupal\KernelTests\KernelTestBase; use Symfony\Component\Routing\Route; @@ -115,7 +116,7 @@ $dumper = new MatcherDumper($connection, $this->state, 'test_routes'); $route = new Route('/test/{my}/path'); - $route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler'); + $route->setOption('compiler_class', RouteCompiler::class); $collection = new RouteCollection(); $collection->add('test_route', $route); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/TempStore/AnonymousPrivateTempStoreTest.php --- a/core/tests/Drupal/KernelTests/Core/TempStore/AnonymousPrivateTempStoreTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/TempStore/AnonymousPrivateTempStoreTest.php Thu May 09 15:33:08 2019 +0100 @@ -60,13 +60,13 @@ $metadata1 = $this->tempStore->getMetadata('foo'); $this->assertEquals('bar', $this->tempStore->get('foo')); - $this->assertNotEmpty($metadata1->owner); + $this->assertNotEmpty($metadata1->getOwnerId()); $this->tempStore->set('foo', 'bar2'); $metadata2 = $this->tempStore->getMetadata('foo'); $this->assertEquals('bar2', $this->tempStore->get('foo')); - $this->assertNotEmpty($metadata2->owner); - $this->assertEquals($metadata2->owner, $metadata1->owner); + $this->assertNotEmpty($metadata2->getOwnerId()); + $this->assertEquals($metadata2->getOwnerId(), $metadata1->getOwnerId()); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php --- a/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -63,7 +63,8 @@ */ public function testSharedTempStore() { // Create a key/value collection. - $factory = new SharedTempStoreFactory(new KeyValueExpirableFactory(\Drupal::getContainer()), new DatabaseLockBackend(Database::getConnection()), $this->container->get('request_stack')); + $database = Database::getConnection(); + $factory = new SharedTempStoreFactory(new KeyValueExpirableFactory(\Drupal::getContainer()), new DatabaseLockBackend($database), $this->container->get('request_stack')); $collection = $this->randomMachineName(); // Create two mock users. @@ -74,6 +75,7 @@ // fatal exception, because in that situation garbage collection is not // triggered until the test class itself is destructed, after tearDown() // has deleted the database tables. Store the objects locally instead. + /** @var \Drupal\Core\TempStore\SharedTempStore[] $stores */ $stores[$i] = $factory->get($collection, $users[$i]); } @@ -84,11 +86,11 @@ // FALSE the second time (when $i is 1). $this->assertEqual(!$i, $stores[0]->setIfNotExists($key, $this->objects[$i])); $metadata = $stores[0]->getMetadata($key); - $this->assertEqual($users[0], $metadata->owner); + $this->assertEqual($users[0], $metadata->getOwnerId()); $this->assertIdenticalObject($this->objects[0], $stores[0]->get($key)); // Another user should get the same result. $metadata = $stores[1]->getMetadata($key); - $this->assertEqual($users[0], $metadata->owner); + $this->assertEqual($users[0], $metadata->getOwnerId()); $this->assertIdenticalObject($this->objects[0], $stores[1]->get($key)); } @@ -114,11 +116,11 @@ $this->assertIdenticalObject($this->objects[3], $stores[0]->get($key)); $this->assertIdenticalObject($this->objects[3], $stores[1]->get($key)); $metadata = $stores[1]->getMetadata($key); - $this->assertEqual($users[1], $metadata->owner); + $this->assertEqual($users[1], $metadata->getOwnerId()); // The first user should be informed that the second now owns the data. $metadata = $stores[0]->getMetadata($key); - $this->assertEqual($users[1], $metadata->owner); + $this->assertEqual($users[1], $metadata->getOwnerId()); // The first user should no longer be allowed to get, update, delete. $this->assertNull($stores[0]->getIfOwner($key)); @@ -127,7 +129,7 @@ // Now manually expire the item (this is not exposed by the API) and then // assert it is no longer accessible. - db_update('key_value_expire') + $database->update('key_value_expire') ->fields(['expire' => REQUEST_TIME - 1]) ->condition('collection', "tempstore.shared.$collection") ->condition('name', $key) diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Theme/ActiveThemeLegacyTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/ActiveThemeLegacyTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,71 @@ +container->get('theme_installer')->install(['test_subsubtheme']); + $this->config('system.theme')->set('default', 'test_subsubtheme')->save(); + $active_theme = \Drupal::theme()->getActiveTheme(); + + // Ensure that active theme representations of base themes can be retrieved. + $base_themes = $active_theme->getBaseThemes(); + $this->assertInstanceOf(ActiveTheme::class, $base_themes['test_subtheme']); + $this->assertSame(['test_subtheme', 'test_basetheme'], array_keys($base_themes)); + + // Ensure that we can get base themes from base themes. + $test_subtheme_base_themes = $base_themes['test_subtheme']->getBaseThemes(); + $this->assertSame(['test_basetheme'], array_keys($test_subtheme_base_themes)); + $this->assertEmpty($test_subtheme_base_themes['test_basetheme']->getBaseThemes()); + } + + /** + * Tests BC layer in constructor. + * + * @covers ::__construct + * @expectedDeprecation The 'base_themes' key is deprecated in Drupal 8.7.0 and support for it will be removed in Drupal 9.0.0. Use 'base_theme_extensions' instead. See https://www.drupal.org/node/3019948 + */ + public function testConstructor() { + $themes = $this->container->get('extension.list.theme')->getList(); + + $values = [ + 'name' => $themes['test_basetheme']->getName(), + 'extension' => $themes['test_basetheme'], + ]; + $base_active_theme = new ActiveTheme($values); + + $values = [ + 'name' => $themes['test_subtheme']->getName(), + 'extension' => $themes['test_subtheme'], + 'base_themes' => ['test_basetheme' => $base_active_theme], + ]; + $active_theme = new ActiveTheme($values); + + $base_extensions = $active_theme->getBaseThemeExtensions(); + $this->assertSame($base_extensions['test_basetheme'], $themes['test_basetheme']); + $this->assertSame(['test_basetheme'], array_keys($base_extensions)); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php --- a/core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php Thu May 09 15:33:08 2019 +0100 @@ -25,14 +25,9 @@ $active_theme = \Drupal::theme()->getActiveTheme(); $this->assertEquals('seven', $active_theme->getName()); - $base_themes = $active_theme->getBaseThemes(); + $base_themes = $active_theme->getBaseThemeExtensions(); $base_theme_names = array_keys($base_themes); $this->assertSame(['classy', 'stable'], $base_theme_names); - - // Ensure Classy has the correct base themes and amount of base themes. - $classy_base_themes = $base_themes['classy']->getBaseThemes(); - $classy_base_theme_names = array_keys($classy_base_themes); - $this->assertSame(['stable'], $classy_base_theme_names); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php --- a/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php Thu May 09 15:33:08 2019 +0100 @@ -49,7 +49,7 @@ /** * {@inheritdoc} */ - public static $modules = ['system']; + public static $modules = ['system', 'user']; /** * {@inheritdoc} @@ -71,6 +71,7 @@ }); $this->allModules = array_keys($all_modules); $this->allModules[] = 'system'; + $this->allModules[] = 'user'; sort($this->allModules); $this->container->get('module_installer')->install($this->allModules); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php --- a/core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php Thu May 09 15:33:08 2019 +0100 @@ -49,8 +49,7 @@ $this->themeHandler->install(['test_stable']); $this->config('system.theme')->set('default', 'test_stable')->save(); $theme = $this->themeManager->getActiveTheme(); - /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ - $base_themes = $theme->getBaseThemes(); + $base_themes = $theme->getBaseThemeExtensions(); $base_theme = reset($base_themes); $this->assertTrue($base_theme->getName() == 'stable', "Stable theme is the base theme if a theme hasn't decided to opt out."); } @@ -63,7 +62,7 @@ $this->config('system.theme')->set('default', 'test_wild_west')->save(); $theme = $this->themeManager->getActiveTheme(); /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ - $base_themes = $theme->getBaseThemes(); + $base_themes = $theme->getBaseThemeExtensions(); $this->assertTrue(empty($base_themes), 'No base theme is set when a theme has opted out of using Stable.'); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Theme/SystemListTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/SystemListTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,72 @@ +register('router.dumper', NullMatcherDumper::class); + } + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->installConfig(['system']); + } + + /** + * Tests installing a theme. + * + * @expectedDeprecation system_list() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal::service('theme_handler')->listInfo() instead. See https://www.drupal.org/node/2709919 + * @expectedDeprecation system_list_reset() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. There is no direct replacement. Call each \Drupal::service('extension.list.TYPE')->reset() as necessary. See https://www.drupal.org/node/2709919. + */ + public function testSystemList() { + // Verifies that no themes are listed by default. + $this->assertEmpty(system_list('theme')); + $this->assertEmpty(system_list('filepaths')); + + $this->container->get('theme_installer')->install(['test_basetheme']); + + $themes = system_list('theme'); + $this->assertTrue(isset($themes['test_basetheme'])); + $this->assertEqual($themes['test_basetheme']->getName(), 'test_basetheme'); + $filepaths = system_list('filepaths'); + $this->assertEquals('test_basetheme', $filepaths[0]['name']); + $this->assertEquals('core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml', $filepaths[0]['filepath']); + $this->assertCount(1, $filepaths); + + $this->container->get('theme_installer')->uninstall(['test_basetheme']); + + $this->assertEmpty(system_list('theme')); + $this->assertEmpty(system_list('filepaths')); + + // Call system_list_reset() to test deprecation and ensure it is not broken. + system_list_reset(); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Theme/TableSortLegacyTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/TableSortLegacyTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,75 @@ +assertArrayHasKey('query', $context); + $this->assertArrayHasKey('sort', $context); + } + + /** + * Tests deprecation of the tablesort_header() function. + * + * @expectedDeprecation tablesort_header() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::header() instead. See https://www.drupal.org/node/3009182 + */ + public function testHeader() { + $cell_content = ''; + $cell_attributes = []; + tablesort_header($cell_content, $cell_attributes, [], []); + $this->assertEquals('', $cell_content); + } + + /** + * Tests deprecation of the tablesort_get_query_parameters() function. + * + * @expectedDeprecation tablesort_get_query_parameters() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::getQueryParameters() instead. See https://www.drupal.org/node/3009182 + */ + public function testQueryParameters() { + $parameters = tablesort_get_query_parameters(); + $this->assertArrayNotHasKey('sort', $parameters); + $this->assertArrayNotHasKey('order', $parameters); + } + + /** + * Tests deprecation of the tablesort_get_order() function. + * + * @expectedDeprecation tablesort_get_order() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::getOrder() instead. See https://www.drupal.org/node/3009182 + */ + public function testOrder() { + $this->assertEquals( + [ + 'name' => NULL, + 'sql' => NULL, + ], + tablesort_get_order([]) + ); + } + + /** + * Tests deprecation of the tablesort_get_sort() function. + * + * @expectedDeprecation tablesort_get_sort() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::getSort() instead. See https://www.drupal.org/node/3009182 + */ + public function testSort() { + $this->assertEquals(TableSort::ASC, tablesort_get_sort([])); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php --- a/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php Thu May 09 15:33:08 2019 +0100 @@ -44,7 +44,7 @@ $this->assertFalse($this->extensionConfig()->get('theme')); $this->assertFalse(array_keys($this->themeHandler()->listInfo())); - $this->assertFalse(array_keys(system_list('theme'))); + $this->assertFalse(array_keys(\Drupal::service('theme_handler')->listInfo())); // Rebuilding available themes should always yield results though. $this->assertTrue($this->themeHandler()->rebuildThemeData()['stark'], 'ThemeHandler::rebuildThemeData() yields all available themes.'); @@ -70,8 +70,6 @@ $this->assertTrue(isset($themes[$name])); $this->assertEqual($themes[$name]->getName(), $name); - $this->assertEqual(array_keys(system_list('theme')), array_keys($themes)); - // Verify that test_basetheme.settings is active. $this->assertIdentical(theme_get_setting('features.favicon', $name), FALSE); $this->assertEqual(theme_get_setting('base', $name), 'only'); @@ -272,7 +270,6 @@ $this->themeInstaller()->uninstall([$name]); $this->assertFalse(array_keys($this->themeHandler()->listInfo())); - $this->assertFalse(array_keys(system_list('theme'))); $this->assertFalse($this->config("$name.settings")->get()); @@ -281,7 +278,6 @@ $themes = $this->themeHandler()->listInfo(); $this->assertTrue(isset($themes[$name])); $this->assertEqual($themes[$name]->getName(), $name); - $this->assertEqual(array_keys(system_list('theme')), array_keys($themes)); $this->assertTrue($this->config("$name.settings")->get()); } @@ -331,8 +327,8 @@ $this->assertTrue(isset($info['regions']['test_region'])); $regions = system_region_list($name); $this->assertTrue(isset($regions['test_region'])); - $system_list = system_list('theme'); - $this->assertTrue(isset($system_list[$name]->info['regions']['test_region'])); + $theme_list = \Drupal::service('theme_handler')->listInfo(); + $this->assertTrue(isset($theme_list[$name]->info['regions']['test_region'])); $this->moduleInstaller()->uninstall(['module_test']); $this->assertFalse($this->moduleHandler()->moduleExists('module_test')); @@ -347,8 +343,8 @@ $this->assertFalse(isset($info['regions']['test_region'])); $regions = system_region_list($name); $this->assertFalse(isset($regions['test_region'])); - $system_list = system_list('theme'); - $this->assertFalse(isset($system_list[$name]->info['regions']['test_region'])); + $theme_list = \Drupal::service('theme_handler')->listInfo(); + $this->assertFalse(isset($theme_list[$name]->info['regions']['test_region'])); } /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php --- a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php Thu May 09 15:33:08 2019 +0100 @@ -148,6 +148,7 @@ // Note: Later we refetch the twig service in order to bypass its internal // static cache. $environment = \Drupal::service('twig'); + $template_path = 'core/modules/system/templates/container.html.twig'; // A template basename greater than the constant // TwigPhpStorageCache::SUFFIX_SUBSTRING_LENGTH should get truncated. @@ -163,12 +164,15 @@ $expected = strlen($prefix) + 2 + 2 * TwigPhpStorageCache::SUFFIX_SUBSTRING_LENGTH; $this->assertEquals($expected, strlen($key)); - $original_filename = $environment->getCacheFilename('core/modules/system/templates/container.html.twig'); - \Drupal::getContainer()->set('twig', NULL); + $cache = $environment->getCache(); + $class = $environment->getTemplateClass($template_path); + $original_filename = $cache->generateKey($template_path, $class); + \Drupal::service('module_installer')->install(['twig_extension_test']); - \Drupal::service('module_installer')->install(['twig_extension_test']); $environment = \Drupal::service('twig'); - $new_extension_filename = $environment->getCacheFilename('core/modules/system/templates/container.html.twig'); + $cache = $environment->getCache(); + $class = $environment->getTemplateClass($template_path); + $new_extension_filename = $cache->generateKey($template_path, $class); \Drupal::getContainer()->set('twig', NULL); $this->assertNotEqual($new_extension_filename, $original_filename); @@ -212,7 +216,7 @@ // Manually change $templateClassPrefix to force a different template // classname, as the other class is still loaded. This wouldn't be a problem // on a real site where you reload the page. - $reflection = new \ReflectionClass($environment); + $reflection = new \ReflectionClass(\Twig_Environment::class); $property_reflection = $reflection->getProperty('templateClassPrefix'); $property_reflection->setAccessible(TRUE); $property_reflection->setValue($environment, 'otherPrefix'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php --- a/core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,7 @@ use Drupal\Core\TypedData\DataDefinition; use Drupal\KernelTests\KernelTestBase; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; /** * Tests AllowedValues validation constraint with both valid and invalid values. @@ -49,6 +50,66 @@ $this->assertEqual($violation->getMessage(), t('The value you selected is not a valid choice.'), 'The message for invalid value is correct.'); $this->assertEqual($violation->getRoot(), $typed_data, 'Violation root is correct.'); $this->assertEqual($violation->getInvalidValue(), 4, 'The invalid value is set correctly in the violation.'); + + // Test the validation when a value of an incorrect type is passed. + $typed_data = $this->typedData->create($definition, '1'); + $violations = $typed_data->validate(); + $this->assertEquals(0, $violations->count(), 'Value is coerced to the correct type and is valid.'); + } + + /** + * Tests the AllowedValuesConstraintValidator with callbacks. + */ + public function testValidationCallback() { + // Create a definition that specifies some AllowedValues and a callback. + // This tests that callbacks have a higher priority than a supplied list of + // values and can be used to coerce the value to the correct type. + $definition = DataDefinition::create('string') + ->addConstraint('AllowedValues', ['choices' => [1, 2, 3], 'callback' => [static::class, 'allowedValueCallback']]); + $typed_data = $this->typedData->create($definition, 'a'); + $violations = $typed_data->validate(); + $this->assertEquals(0, $violations->count(), 'Validation passed for correct value.'); + + $typed_data = $this->typedData->create($definition, 1); + $violations = $typed_data->validate(); + $this->assertEquals(0, $violations->count(), 'Validation passed for value that will be cast to the correct type.'); + + $typed_data = $this->typedData->create($definition, 2); + $violations = $typed_data->validate(); + $this->assertEquals(1, $violations->count(), 'Validation failed for incorrect value.'); + + $typed_data = $this->typedData->create($definition, 'd'); + $violations = $typed_data->validate(); + $this->assertEquals(1, $violations->count(), 'Validation failed for incorrect value.'); + + $typed_data = $this->typedData->create($definition, 0); + $violations = $typed_data->validate(); + $this->assertEquals(1, $violations->count(), 'Validation failed for incorrect value.'); + } + + /** + * An AllowedValueConstraint callback. + * + * @return string[] + * A list of allowed values. + */ + public static function allowedValueCallback() { + return ['a', 'b', 'c', '1']; + } + + /** + * Tests the AllowedValuesConstraintValidator with an invalid callback. + */ + public function testValidationCallbackException() { + // Create a definition that specifies some AllowedValues and a callback. + // This tests that callbacks have a higher priority than a supplied list of + // values and can be used to coerce the value to the correct type. + $definition = DataDefinition::create('string') + ->addConstraint('AllowedValues', ['choices' => [1, 2, 3], 'callback' => [static::class, 'doesNotExist']]); + $typed_data = $this->typedData->create($definition, 1); + + $this->setExpectedException(ConstraintDefinitionException::class, 'The AllowedValuesConstraint constraint expects a valid callback'); + $typed_data->validate(); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php --- a/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php Thu May 09 15:33:08 2019 +0100 @@ -132,18 +132,20 @@ $typed_data->setValue('invalid'); $this->assertEqual($typed_data->validate()->count(), 1, 'Validation detected invalid value.'); - // Date Time type. + // Date Time type; values with timezone offset. $value = '2014-01-01T20:00:00+00:00'; $typed_data = $this->createTypedData(['type' => 'datetime_iso8601'], $value); $this->assertTrue($typed_data instanceof DateTimeInterface, 'Typed data object is an instance of DateTimeInterface.'); $this->assertTrue($typed_data->getValue() == $value, 'Date value was fetched.'); $this->assertEqual($typed_data->getValue(), $typed_data->getDateTime()->format('c'), 'Value representation of a date is ISO 8601'); + $this->assertSame('+00:00', $typed_data->getDateTime()->getTimezone()->getName()); $this->assertEqual($typed_data->validate()->count(), 0); $new_value = '2014-01-02T20:00:00+00:00'; $typed_data->setValue($new_value); $this->assertTrue($typed_data->getDateTime()->format('c') === $new_value, 'Date value was changed and set by an ISO8601 date.'); $this->assertEqual($typed_data->validate()->count(), 0); $this->assertTrue($typed_data->getDateTime()->format('Y-m-d') == '2014-01-02', 'Date value was changed and set by date string.'); + $this->assertSame('+00:00', $typed_data->getDateTime()->getTimezone()->getName()); $this->assertEqual($typed_data->validate()->count(), 0); $typed_data->setValue(NULL); $this->assertNull($typed_data->getDateTime(), 'Date wrapper is null-able.'); @@ -153,11 +155,49 @@ // Check implementation of DateTimeInterface. $typed_data = $this->createTypedData(['type' => 'datetime_iso8601'], '2014-01-01T20:00:00+00:00'); $this->assertTrue($typed_data->getDateTime() instanceof DrupalDateTime); + $this->assertSame('+00:00', $typed_data->getDateTime()->getTimezone()->getName()); $typed_data->setDateTime(new DrupalDateTime('2014-01-02T20:00:00+00:00')); + $this->assertSame('+00:00', $typed_data->getDateTime()->getTimezone()->getName()); $this->assertEqual($typed_data->getValue(), '2014-01-02T20:00:00+00:00'); $typed_data->setValue(NULL); $this->assertNull($typed_data->getDateTime()); + // Date Time type; values without timezone offset. + $value = '2014-01-01T20:00'; + $typed_data = $this->createTypedData(['type' => 'datetime_iso8601'], $value); + $this->assertTrue($typed_data instanceof DateTimeInterface, 'Typed data object is an instance of DateTimeInterface.'); + $this->assertTrue($typed_data->getValue() == $value, 'Date value was fetched.'); + // @todo Uncomment this assertion in https://www.drupal.org/project/drupal/issues/2716891. + // $this->assertEqual($typed_data->getValue(), $typed_data->getDateTime()->format('c'), 'Value representation of a date is ISO 8601'); + $this->assertSame('UTC', $typed_data->getDateTime()->getTimezone()->getName()); + $this->assertEqual($typed_data->validate()->count(), 0); + $new_value = '2014-01-02T20:00'; + $typed_data->setValue($new_value); + // @todo Uncomment this assertion in https://www.drupal.org/project/drupal/issues/2716891. + // $this->assertTrue($typed_data->getDateTime()->format('c') === $new_value, 'Date value was changed and set by an ISO8601 date.'); + $this->assertEqual($typed_data->validate()->count(), 0); + $this->assertTrue($typed_data->getDateTime()->format('Y-m-d') == '2014-01-02', 'Date value was changed and set by date string.'); + $this->assertSame('UTC', $typed_data->getDateTime()->getTimezone()->getName()); + $this->assertEqual($typed_data->validate()->count(), 0); + $typed_data->setValue(NULL); + $this->assertNull($typed_data->getDateTime(), 'Date wrapper is null-able.'); + $this->assertEqual($typed_data->validate()->count(), 0); + $typed_data->setValue('invalid'); + $this->assertEqual($typed_data->validate()->count(), 1, 'Validation detected invalid value.'); + // Check implementation of DateTimeInterface. + $typed_data = $this->createTypedData(['type' => 'datetime_iso8601'], '2014-01-01T20:00:00'); + $this->assertTrue($typed_data->getDateTime() instanceof DrupalDateTime); + $this->assertSame('UTC', $typed_data->getDateTime()->getTimezone()->getName()); + // When setting datetime without a timezone offset, the default timezone is + // used (Australia/Sydney). DateTimeIso8601::setDateTime() converts this + // DrupalDateTime object to a string using ::format('c'), it gets converted + // to an offset. The offset for Australia/Sydney is +11:00. + $typed_data->setDateTime(new DrupalDateTime('2014-01-02T20:00:00')); + $this->assertSame('+11:00', $typed_data->getDateTime()->getTimezone()->getName()); + $this->assertEqual($typed_data->getValue(), '2014-01-02T20:00:00+11:00'); + $typed_data->setValue(NULL); + $this->assertNull($typed_data->getDateTime()); + // Timestamp type. $value = REQUEST_TIME; $typed_data = $this->createTypedData(['type' => 'timestamp'], $value); @@ -250,7 +290,7 @@ $files = []; for ($i = 0; $i < 3; $i++) { $path = "public://example_$i.png"; - file_unmanaged_copy($this->root . '/core/misc/druplicon.png', $path); + \Drupal::service('file_system')->copy($this->root . '/core/misc/druplicon.png', $path); $image = File::create(['uri' => $path]); $image->save(); $files[] = $image; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,115 @@ +installEntitySchema('entity_test_string_id'); + + EntityTestStringId::create([ + 'id' => 'foo', + 'name' => $this->randomString(), + ])->save(); + + // Reload the entity. + $entity = EntityTestStringId::load('foo'); + + // Check that an existing entity validates when the value is preserved. + $violations = $entity->name->validate(); + $this->assertCount(0, $violations); + + // Create a new entity with a different ID and a different field value. + EntityTestStringId::create([ + 'id' => 'bar', + 'name' => $this->randomString(), + ]); + + // Check that a new entity with a different field value validates. + $violations = $entity->name->validate(); + $this->assertCount(0, $violations); + } + + /** + * Tests cases when validation raises violations for entities with string IDs. + * + * @param string|int|null $id + * The entity ID. + * + * @covers ::validate + * + * @dataProvider providerTestEntityWithStringIdWithViolation + */ + public function testEntityWithStringIdWithViolation($id) { + $this->installEntitySchema('entity_test_string_id'); + + $value = $this->randomString(); + + EntityTestStringId::create([ + 'id' => 'first_entity', + 'name' => $value, + ])->save(); + + $entity = EntityTestStringId::create([ + 'id' => $id, + 'name' => $value, + ]); + /** @var \Symfony\Component\Validator\ConstraintViolationList $violations */ + $violations = $entity->get('name')->validate(); + + $message = new FormattableMarkup('A @entity_type with @field_name %value already exists.', [ + '%value' => $value, + '@entity_type' => $entity->getEntityType()->getLowercaseLabel(), + '@field_name' => 'name', + ]); + + // Check that the validation has created the appropriate violation. + $this->assertCount(1, $violations); + $this->assertEquals($message, $violations[0]->getMessage()); + } + + /** + * Data provider for ::testEntityWithStringIdWithViolation(). + * + * @return array + * An array of test cases. + * + * @see self::testEntityWithStringIdWithViolation() + */ + public function providerTestEntityWithStringIdWithViolation() { + return [ + 'without an id' => [NULL], + 'zero as integer' => [0], + 'zero as string' => ["0"], + 'non-zero as integer' => [mt_rand(1, 127)], + 'non-zero as string' => [(string) mt_rand(1, 127)], + 'alphanumeric' => [$this->randomMachineName()], + ]; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/KernelTests/KernelTestBase.php --- a/core/tests/Drupal/KernelTests/KernelTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/KernelTests/KernelTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -66,6 +66,8 @@ * @see \Drupal\Tests\KernelTestBase::installEntitySchema() * @see \Drupal\Tests\KernelTestBase::installSchema() * @see \Drupal\Tests\BrowserTestBase + * + * @ingroup testing */ abstract class KernelTestBase extends TestCase implements ServiceProviderInterface { @@ -174,16 +176,6 @@ protected $vfsRoot; /** - * @var int - */ - protected $expectedLogSeverity; - - /** - * @var string - */ - protected $expectedLogMessage; - - /** * @todo Move into Config test base class. * @var \Drupal\Core\Config\ConfigImporter */ @@ -341,17 +333,6 @@ $modules = self::getModulesToEnable(get_class($this)); - // Prepare a precompiled container for all tests of this class. - // Substantially improves performance, since ContainerBuilder::compile() - // is very expensive. Encourages testing best practices (small tests). - // Normally a setUpBeforeClass() operation, but object scope is required to - // inject $this test class instance as a service provider (see above). - $rc = new \ReflectionClass(get_class($this)); - $test_method_count = count(array_filter($rc->getMethods(), function ($method) { - // PHPUnit's @test annotations are intentionally ignored/not supported. - return strpos($method->getName(), 'test') === 0; - })); - // Bootstrap the kernel. Do not use createFromRequest() to retain Settings. $kernel = new DrupalKernel('testing', $this->classLoader, FALSE); $kernel->setSitePath($this->siteDirectory); @@ -728,10 +709,8 @@ $schema = drupal_get_module_schema($module, $table); if (empty($schema)) { // BC layer to avoid some contrib tests to fail. - // @todo Remove the BC layer before 8.1.x release. - // @see https://www.drupal.org/node/2670360 - // @see https://www.drupal.org/node/2670454 if ($module == 'system') { + @trigger_error('Special handling of system module schemas in \Drupal\KernelTests\KernelTestBase::installSchema has been deprecated in Drupal 8.7.x, remove any calls to this method that use invalid schema names. See https://www.drupal.org/project/drupal/issues/2794347.', E_USER_DEPRECATED); continue; } throw new \LogicException("$module module does not define a schema for table '$table'."); @@ -747,14 +726,13 @@ * The ID of the entity type. */ protected function installEntitySchema($entity_type_id) { - /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */ - $entity_manager = $this->container->get('entity.manager'); - $entity_type = $entity_manager->getDefinition($entity_type_id); - $entity_manager->onEntityTypeCreate($entity_type); + $entity_type_manager = \Drupal::entityTypeManager(); + $entity_type = $entity_type_manager->getDefinition($entity_type_id); + \Drupal::service('entity_type.listener')->onEntityTypeCreate($entity_type); // For test runs, the most common storage backend is a SQL database. For // this case, ensure the tables got created. - $storage = $entity_manager->getStorage($entity_type_id); + $storage = $entity_type_manager->getStorage($entity_type_id); if ($storage instanceof SqlEntityStorageInterface) { $tables = $storage->getTableMapping()->getTableNames(); $db_schema = $this->container->get('database')->schema(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Nightwatch/Pages/TestPage.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Nightwatch/Pages/TestPage.js Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,11 @@ +module.exports = { + props: { + text: 'Test page text', + timeout: 1000, + }, + elements: { + body: { + selector: 'body', + }, + }, +}; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Nightwatch/Tests/exampleTest.js --- a/core/tests/Drupal/Nightwatch/Tests/exampleTest.js Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Nightwatch/Tests/exampleTest.js Thu May 09 15:33:08 2019 +0100 @@ -15,4 +15,13 @@ .assert.containsText('body', 'Test page text') .drupalLogAndEnd({ onlyOnError: false }); }, + 'Page objects test page': browser => { + const testPage = browser.page.TestPage(); + + testPage + .drupalRelativeURL('/test-page') + .waitForElementVisible('@body', testPage.props.timeout) + .assert.containsText('@body', testPage.props.text) + .drupalLogAndEnd({ onlyOnError: false }); + }, }; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Nightwatch/nightwatch.conf.js --- a/core/tests/Drupal/Nightwatch/nightwatch.conf.js Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Nightwatch/nightwatch.conf.js Thu May 09 15:33:08 2019 +0100 @@ -7,6 +7,7 @@ Tests: [], Commands: [], Assertions: [], + Pages: [], }; const searchDirectory = process.env.DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY || ''; @@ -45,7 +46,7 @@ output_folder: process.env.DRUPAL_NIGHTWATCH_OUTPUT, custom_commands_path: collectedFolders.Commands, custom_assertions_path: collectedFolders.Assertions, - page_objects_path: '', + page_objects_path: collectedFolders.Pages, globals_path: 'tests/Drupal/Nightwatch/globals.js', selenium: { start_process: false, diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php --- a/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php Thu May 09 15:33:08 2019 +0100 @@ -136,9 +136,12 @@ $this->htmlOutputClassName = str_replace("\\", "_", get_called_class()); $this->htmlOutputDirectory = DRUPAL_ROOT . '/sites/simpletest/browser_output'; // Do not use the file_system service so this method can be called before - // it is available. - if (!is_dir($this->htmlOutputDirectory)) { - mkdir($this->htmlOutputDirectory, 0775, TRUE); + // it is available. Checks !is_dir() twice around mkdir() because a + // concurrent test might have made the directory and caused mkdir() to + // fail. In this case we can still use the directory even though we failed + // to make it. + if (!is_dir($this->htmlOutputDirectory) && !mkdir($this->htmlOutputDirectory, 0775, TRUE) && !is_dir($this->htmlOutputDirectory)) { + throw new \RuntimeException(sprintf('Unable to create directory: %s', $this->htmlOutputDirectory)); } if (!file_exists($this->htmlOutputDirectory . '/.htaccess')) { file_put_contents($this->htmlOutputDirectory . '/.htaccess', "\nExpiresActive Off\n\n"); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/BrowserTestBase.php --- a/core/tests/Drupal/Tests/BrowserTestBase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/BrowserTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -415,7 +415,7 @@ } /** - * Ensures test files are deletable within file_unmanaged_delete_recursive(). + * Ensures test files are deletable. * * Some tests chmod generated files to be read only. During * BrowserTestBase::cleanupEnvironment() and other cleanup operations, @@ -423,6 +423,8 @@ * * @param string $path * The file path. + * + * @see \Drupal\Core\File\FileSystemInterface::deleteRecursive() */ public static function filePreDeleteCallback($path) { // When the webserver runs with the same system user as phpunit, we can @@ -451,7 +453,7 @@ } // Delete test site directory. - file_unmanaged_delete_recursive($this->siteDirectory, [$this, 'filePreDeleteCallback']); + \Drupal::service('file_system')->deleteRecursive($this->siteDirectory, [$this, 'filePreDeleteCallback']); } /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php --- a/core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php Thu May 09 15:33:08 2019 +0100 @@ -30,7 +30,7 @@ $redirect = new RedirectResponse('/magic_redirect_url', 301, ['x-cache-foobar' => 123]); $redirect->setProtocolVersion('2.0'); $redirect->setCharset('ibm-943_P14A-2000'); - $redirect->headers->setCookie(new Cookie('name', 'value')); + $redirect->headers->setCookie(new Cookie('name', 'value', 0, '/', NULL, FALSE, TRUE, FALSE, NULL)); // Make a cloned redirect. $secureRedirect = SecuredRedirectStub::createFromRedirectResponse($redirect); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Component/Plugin/ConfigurablePluginInterfaceTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Component/Plugin/ConfigurablePluginInterfaceTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,59 @@ +assertTrue($validator->isValid('example@example.com')); + $this->assertFalse($validator->isValid('example@example.com@')); + } + + /** + * @covers ::isValid + */ + public function testIsValidException() { + $validator = new EmailValidator(); + if (method_exists($this, 'expectException')) { + $this->expectException(\BadMethodCallException::class); + $this->expectExceptionMessage('Calling \Drupal\Component\Utility\EmailValidator::isValid() with the second argument is not supported. See https://www.drupal.org/node/2997196'); + } + else { + $this->setExpectedException(\BadMethodCallException::class, 'Calling \Drupal\Component\Utility\EmailValidator::isValid() with the second argument is not supported. See https://www.drupal.org/node/2997196'); + } + $validator->isValid('example@example.com', (new RFCValidation())); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Component/Version/ConstraintTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Component/Version/ConstraintTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,107 @@ +assertSame($result, $version_info->isCompatible($current_version)); + } + + /** + * Provider for testIsCompatible. + */ + public function providerIsCompatible() { + $tests = []; + + $tests['no-dependencies'] = [new Constraint('', '8.x'), '8.1.x', TRUE]; + + // Stable version. + $stable = new Constraint('8.x-1.0', '8.x'); + $tests['(=8.x-1.0)-1.0'] = [$stable, '1.0', TRUE]; + $tests['(=8.x-1.0)-1.1'] = [$stable, '1.1', FALSE]; + $tests['(=8.x-1.0)-0.9'] = [$stable, '0.9', FALSE]; + + // Alpha version. + $alpha = new Constraint('8.x-1.1-alpha12', '8.x'); + $tests['(8.x-1.1-alpha12)-alpha12'] = [$alpha, '1.1-alpha12', TRUE]; + $tests['(8.x-1.1-alpha12)-alpha10'] = [$alpha, '1.1-alpha10', FALSE]; + $tests['(8.x-1.1-alpha12)-beta1'] = [$alpha, '1.1-beta1', FALSE]; + + // Beta version. + $beta = new Constraint('8.x-1.1-beta8', '8.x'); + $tests['(8.x-1.1-beta8)-beta8'] = [$beta, '1.1-beta8', TRUE]; + $tests['(8.x-1.1-beta8)-beta4'] = [$beta, '1.1-beta4', FALSE]; + + // RC version. + $rc = new Constraint('8.x-1.1-rc11', '8.x'); + $tests['(8.x-1.1-rc11)-rc11'] = [$rc, '1.1-rc11', TRUE]; + $tests['(8.x-1.1-rc11)-rc2'] = [$rc, '1.1-rc2', FALSE]; + + // Test greater than. + $greater = new Constraint('>8.x-1.x', '8.x'); + $tests['(>8.x-1.x)-2.0'] = [$greater, '2.0', TRUE]; + $tests['(>8.x-1.x)-1.1'] = [$greater, '1.1', FALSE]; + $tests['(>8.x-1.x)-0.9'] = [$greater, '0.9', FALSE]; + + // Test greater than or equal. + $greater_or_equal = new Constraint('>=8.x-1.0', '8.x'); + $tests['(>=8.x-1.0)-1.1'] = [$greater_or_equal, '1.1', TRUE]; + $tests['(>=8.x-1.0)-1.0'] = [$greater_or_equal, '1.0', TRUE]; + $tests['(>=8.x-1.1)-1.0'] = [new Constraint('>=8.x-1.1', '8.x'), '1.0', FALSE]; + + // Test less than. + $less = new Constraint('<8.x-1.1', '8.x'); + $tests['(<8.x-1.1)-1.1'] = [$less, '1.1', FALSE]; + $tests['(<8.x-1.1)-1.1'] = [$less, '1.0', TRUE]; + $tests['(<8.x-1.0)-1.0'] = [new Constraint('<8.x-1.0', '8.x'), '1.1', FALSE]; + + // Test less than or equal. + $less_or_equal = new Constraint('<= 8.x-1.x', '8.x'); + $tests['(<= 8.x-1.x)-2.0'] = [$less_or_equal, '2.0', FALSE]; + $tests['(<= 8.x-1.x)-1.9'] = [$less_or_equal, '1.9', TRUE]; + $tests['(<= 8.x-1.x)-1.1'] = [$less_or_equal, '1.1', TRUE]; + $tests['(<= 8.x-1.x)-0.9'] = [$less_or_equal, '0.9', TRUE]; + + // Test greater than and less than. + $less_and_greater = new Constraint('<8.x-4.x,>8.x-1.x', '8.x'); + $tests['(<8.x-4.x,>8.x-1.x)-4.0'] = [$less_and_greater, '4.0', FALSE]; + $tests['(<8.x-4.x,>8.x-1.x)-3.9'] = [$less_and_greater, '3.9', TRUE]; + $tests['(<8.x-4.x,>8.x-1.x)-2.1'] = [$less_and_greater, '2.1', TRUE]; + $tests['(<8.x-4.x,>8.x-1.x)-1.9'] = [$less_and_greater, '1.9', FALSE]; + + // Test a nonsensical greater than and less than - no compatible versions. + $less_and_greater = new Constraint('>8.x-4.x,<8.x-1.x', '8.x'); + $tests['(<8.x-4.x,>8.x-1.x)-4.0'] = [$less_and_greater, '4.0', FALSE]; + $tests['(<8.x-4.x,>8.x-1.x)-3.9'] = [$less_and_greater, '3.9', FALSE]; + $tests['(<8.x-4.x,>8.x-1.x)-2.1'] = [$less_and_greater, '2.1', FALSE]; + $tests['(<8.x-4.x,>8.x-1.x)-1.9'] = [$less_and_greater, '1.9', FALSE]; + + return $tests; + } + + /** + * @covers ::toArray + * @group legacy + * @expectedDeprecation Drupal\Component\Version\Constraint::toArray() only exists to provide a backwards compatibility layer. See https://www.drupal.org/node/2756875 + */ + public function testToArray() { + $constraint = new Constraint('<8.x-4.x,>8.x-1.x', '8.x'); + $this->assertSame([ + ['op' => '<', 'version' => '4.x'], + ['op' => '>', 'version' => '2.x'], + ], $constraint->toArray()); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/ComposerIntegrationTest.php --- a/core/tests/Drupal/Tests/ComposerIntegrationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/ComposerIntegrationTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,8 +2,6 @@ namespace Drupal\Tests; -use Composer\Semver\Semver; - /** * Tests Composer integration. * @@ -12,15 +10,6 @@ class ComposerIntegrationTest extends UnitTestCase { /** - * The minimum PHP version supported by Drupal. - * - * @see https://www.drupal.org/docs/8/system-requirements/web-server - * - * @todo Remove as part of https://www.drupal.org/node/2908079 - */ - const MIN_PHP_VERSION = '5.5.9'; - - /** * Gets human-readable JSON error messages. * * @return string[] @@ -77,6 +66,7 @@ $this->root . '/core/lib/Drupal/Component/Transliteration', $this->root . '/core/lib/Drupal/Component/Utility', $this->root . '/core/lib/Drupal/Component/Uuid', + $this->root . '/core/lib/Drupal/Component/Version', ]; } @@ -182,34 +172,6 @@ } } - /** - * Tests package requirements for the minimum supported PHP version by Drupal. - * - * @todo This can be removed when DrupalCI supports dependency regression - * testing in https://www.drupal.org/node/2874198 - */ - public function testMinPHPVersion() { - // Check for lockfile in the application root. If the lockfile does not - // exist, then skip this test. - $lockfile = $this->root . '/composer.lock'; - if (!file_exists($lockfile)) { - $this->markTestSkipped('/composer.lock is not available.'); - } - - $lock = json_decode(file_get_contents($lockfile), TRUE); - - // Check the PHP version for each installed non-development package. The - // testing infrastructure uses the uses the development packages, and may - // update them for particular environment configurations. In particular, - // PHP 7.2+ require an updated version of phpunit, which is incompatible - // with Drupal's minimum PHP requirement. - foreach ($lock['packages'] as $package) { - if (isset($package['require']['php'])) { - $this->assertTrue(Semver::satisfies(static::MIN_PHP_VERSION, $package['require']['php']), $package['name'] . ' has a PHP dependency requirement of "' . $package['require']['php'] . '"'); - } - } - } - // @codingStandardsIgnoreStart /** * The following method is copied from \Composer\Package\Locker. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/ConfigTestTrait.php --- a/core/tests/Drupal/Tests/ConfigTestTrait.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/ConfigTestTrait.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,7 @@ use Drupal\Core\Config\ConfigImporter; use Drupal\Core\Config\StorageComparer; +use Drupal\Core\Config\StorageCopyTrait; use Drupal\Core\Config\StorageInterface; /** @@ -11,6 +12,8 @@ */ trait ConfigTestTrait { + use StorageCopyTrait; + /** * Returns a ConfigImporter object to import test configuration. * @@ -22,8 +25,7 @@ // Set up the ConfigImporter object for testing. $storage_comparer = new StorageComparer( $this->container->get('config.storage.sync'), - $this->container->get('config.storage'), - $this->container->get('config.manager') + $this->container->get('config.storage') ); $this->configImporter = new ConfigImporter( $storage_comparer, @@ -50,10 +52,7 @@ * The target config storage service. */ protected function copyConfig(StorageInterface $source_storage, StorageInterface $target_storage) { - $target_storage->deleteAll(); - foreach ($source_storage->listAll() as $name) { - $target_storage->write($name, $source_storage->read($name)); - } + static::replaceStorageContents($source_storage, $target_storage); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php --- a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,8 @@ namespace Drupal\Tests\Core\Ajax; +use Drupal\Core\Ajax\AnnounceCommand; +use Drupal\Core\Asset\AttachedAssets; use Drupal\Tests\UnitTestCase; use Drupal\Core\Ajax\AddCssCommand; use Drupal\Core\Ajax\AfterCommand; @@ -79,6 +81,61 @@ } /** + * @covers \Drupal\Core\Ajax\AnnounceCommand + * + * @dataProvider announceCommandProvider + */ + public function testAnnounceCommand($message, $priority, array $expected) { + if ($priority === NULL) { + $command = new AnnounceCommand($message); + } + else { + $command = new AnnounceCommand($message, $priority); + } + + $expected_assets = new AttachedAssets(); + $expected_assets->setLibraries(['core/drupal.announce']); + + $this->assertEquals($expected_assets, $command->getAttachedAssets()); + $this->assertSame($expected, $command->render()); + } + + /** + * Data provider for testAnnounceCommand(). + */ + public function announceCommandProvider() { + return [ + 'no priority' => [ + 'Things are going to change!', + NULL, + [ + 'command' => 'announce', + 'text' => 'Things are going to change!', + ], + ], + 'polite priority' => [ + 'Things are going to change!', + 'polite', + [ + 'command' => 'announce', + 'text' => 'Things are going to change!', + 'priority' => AnnounceCommand::PRIORITY_POLITE, + ], + + ], + 'assertive priority' => [ + 'Important!', + 'assertive', + [ + 'command' => 'announce', + 'text' => 'Important!', + 'priority' => AnnounceCommand::PRIORITY_ASSERTIVE, + ], + ], + ]; + } + + /** * @covers \Drupal\Core\Ajax\AppendCommand */ public function testAppendCommand() { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php --- a/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php Thu May 09 15:33:08 2019 +0100 @@ -156,6 +156,7 @@ /** * @covers ::assertNoPattern + * @expectedDeprecation assertNoPattern() is deprecated and scheduled for removal in Drupal 9.0.0. Use $this->assertSession()->responseNotMatches($pattern) instead. See https://www.drupal.org/node/2864262. */ public function testAssertNoPattern() { $this->webAssert diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php --- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -82,24 +82,12 @@ '#tag' => 'link', '#attributes' => [ 'rel' => 'stylesheet', + 'media' => $media, 'href' => $href, - 'media' => $media, ], '#browsers' => $browsers, ]; }; - $create_style_element = function ($value, $media, $browsers = []) { - $style_element = [ - '#type' => 'html_tag', - '#tag' => 'style', - '#value' => $value, - '#attributes' => [ - 'media' => $media, - ], - '#browsers' => $browsers, - ]; - return $style_element; - }; $create_file_css_asset = function ($data, $media = 'all', $preprocess = TRUE) { return ['group' => 0, 'type' => 'file', 'media' => $media, 'preprocess' => $preprocess, 'data' => $data, 'browsers' => []]; @@ -195,84 +183,8 @@ 30 => $create_link_element(file_url_transform_relative(file_create_url('public://css/31.css')) . '?0'), ], ], - // 32 file CSS assets with the same properties: expect 2 style elements. - 4 => [ - [ - 0 => $create_file_css_asset('public://css/1.css'), - 1 => $create_file_css_asset('public://css/2.css'), - 2 => $create_file_css_asset('public://css/3.css'), - 3 => $create_file_css_asset('public://css/4.css'), - 4 => $create_file_css_asset('public://css/5.css'), - 5 => $create_file_css_asset('public://css/6.css'), - 6 => $create_file_css_asset('public://css/7.css'), - 7 => $create_file_css_asset('public://css/8.css'), - 8 => $create_file_css_asset('public://css/9.css'), - 9 => $create_file_css_asset('public://css/10.css'), - 10 => $create_file_css_asset('public://css/11.css'), - 11 => $create_file_css_asset('public://css/12.css'), - 12 => $create_file_css_asset('public://css/13.css'), - 13 => $create_file_css_asset('public://css/14.css'), - 14 => $create_file_css_asset('public://css/15.css'), - 15 => $create_file_css_asset('public://css/16.css'), - 16 => $create_file_css_asset('public://css/17.css'), - 17 => $create_file_css_asset('public://css/18.css'), - 18 => $create_file_css_asset('public://css/19.css'), - 19 => $create_file_css_asset('public://css/20.css'), - 20 => $create_file_css_asset('public://css/21.css'), - 21 => $create_file_css_asset('public://css/22.css'), - 22 => $create_file_css_asset('public://css/23.css'), - 23 => $create_file_css_asset('public://css/24.css'), - 24 => $create_file_css_asset('public://css/25.css'), - 25 => $create_file_css_asset('public://css/26.css'), - 26 => $create_file_css_asset('public://css/27.css'), - 27 => $create_file_css_asset('public://css/28.css'), - 28 => $create_file_css_asset('public://css/29.css'), - 29 => $create_file_css_asset('public://css/30.css'), - 30 => $create_file_css_asset('public://css/31.css'), - 31 => $create_file_css_asset('public://css/32.css'), - ], - [ - 0 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/1.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/2.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/3.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/4.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/5.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/6.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/7.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/8.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/9.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/10.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/11.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/12.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/13.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/14.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/15.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/16.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/17.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/18.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/19.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/20.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/21.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/22.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/23.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/24.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/25.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/26.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/27.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/28.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/29.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/30.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/31.css')) . '?0"); -', 'all'), - 1 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/32.css')) . '?0"); -', 'all'), - ], - ], // 32 file CSS assets with the same properties, except for the 10th and - // 20th files, they have different 'media' properties. Expect 5 style - // elements. + // 20th files, they have different 'media' properties. 5 => [ [ 0 => $create_file_css_asset('public://css/1.css'), @@ -309,124 +221,38 @@ 31 => $create_file_css_asset('public://css/32.css'), ], [ - 0 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/1.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/2.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/3.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/4.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/5.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/6.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/7.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/8.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/9.css')) . '?0"); -', 'all'), - 1 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/10.css')) . '?0"); -', 'screen'), - 2 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/11.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/12.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/13.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/14.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/15.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/16.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/17.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/18.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/19.css')) . '?0"); -', 'all'), - 3 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/20.css')) . '?0"); -', 'print'), - 4 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/21.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/22.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/23.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/24.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/25.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/26.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/27.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/28.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/29.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/30.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/31.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/32.css')) . '?0"); -', 'all'), - ], - ], - // 32 file CSS assets with the same properties, except for the 15th, which - // has 'preprocess' = FALSE. Expect 1 link element and 2 style elements. - 6 => [ - [ - 0 => $create_file_css_asset('public://css/1.css'), - 1 => $create_file_css_asset('public://css/2.css'), - 2 => $create_file_css_asset('public://css/3.css'), - 3 => $create_file_css_asset('public://css/4.css'), - 4 => $create_file_css_asset('public://css/5.css'), - 5 => $create_file_css_asset('public://css/6.css'), - 6 => $create_file_css_asset('public://css/7.css'), - 7 => $create_file_css_asset('public://css/8.css'), - 8 => $create_file_css_asset('public://css/9.css'), - 9 => $create_file_css_asset('public://css/10.css'), - 10 => $create_file_css_asset('public://css/11.css'), - 11 => $create_file_css_asset('public://css/12.css'), - 12 => $create_file_css_asset('public://css/13.css'), - 13 => $create_file_css_asset('public://css/14.css'), - 14 => $create_file_css_asset('public://css/15.css', 'all', FALSE), - 15 => $create_file_css_asset('public://css/16.css'), - 16 => $create_file_css_asset('public://css/17.css'), - 17 => $create_file_css_asset('public://css/18.css'), - 18 => $create_file_css_asset('public://css/19.css'), - 19 => $create_file_css_asset('public://css/20.css'), - 20 => $create_file_css_asset('public://css/21.css'), - 21 => $create_file_css_asset('public://css/22.css'), - 22 => $create_file_css_asset('public://css/23.css'), - 23 => $create_file_css_asset('public://css/24.css'), - 24 => $create_file_css_asset('public://css/25.css'), - 25 => $create_file_css_asset('public://css/26.css'), - 26 => $create_file_css_asset('public://css/27.css'), - 27 => $create_file_css_asset('public://css/28.css'), - 28 => $create_file_css_asset('public://css/29.css'), - 29 => $create_file_css_asset('public://css/30.css'), - 30 => $create_file_css_asset('public://css/31.css'), - 31 => $create_file_css_asset('public://css/32.css'), - ], - [ - 0 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/1.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/2.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/3.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/4.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/5.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/6.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/7.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/8.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/9.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/10.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/11.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/12.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/13.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/14.css')) . '?0"); -', 'all'), - 1 => $create_link_element(file_url_transform_relative(file_create_url('public://css/15.css')) . '?0'), - 2 => $create_style_element(' -@import url("' . file_url_transform_relative(file_create_url('public://css/16.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/17.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/18.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/19.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/20.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/21.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/22.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/23.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/24.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/25.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/26.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/27.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/28.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/29.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/30.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/31.css')) . '?0"); -@import url("' . file_url_transform_relative(file_create_url('public://css/32.css')) . '?0"); -', 'all'), + 0 => $create_link_element(file_url_transform_relative(file_create_url('public://css/1.css')) . '?0'), + 1 => $create_link_element(file_url_transform_relative(file_create_url('public://css/2.css')) . '?0'), + 2 => $create_link_element(file_url_transform_relative(file_create_url('public://css/3.css')) . '?0'), + 3 => $create_link_element(file_url_transform_relative(file_create_url('public://css/4.css')) . '?0'), + 4 => $create_link_element(file_url_transform_relative(file_create_url('public://css/5.css')) . '?0'), + 5 => $create_link_element(file_url_transform_relative(file_create_url('public://css/6.css')) . '?0'), + 6 => $create_link_element(file_url_transform_relative(file_create_url('public://css/7.css')) . '?0'), + 7 => $create_link_element(file_url_transform_relative(file_create_url('public://css/8.css')) . '?0'), + 8 => $create_link_element(file_url_transform_relative(file_create_url('public://css/9.css')) . '?0'), + 9 => $create_link_element(file_url_transform_relative(file_create_url('public://css/10.css')) . '?0', 'screen'), + 10 => $create_link_element(file_url_transform_relative(file_create_url('public://css/11.css')) . '?0'), + 11 => $create_link_element(file_url_transform_relative(file_create_url('public://css/12.css')) . '?0'), + 12 => $create_link_element(file_url_transform_relative(file_create_url('public://css/13.css')) . '?0'), + 13 => $create_link_element(file_url_transform_relative(file_create_url('public://css/14.css')) . '?0'), + 14 => $create_link_element(file_url_transform_relative(file_create_url('public://css/15.css')) . '?0'), + 15 => $create_link_element(file_url_transform_relative(file_create_url('public://css/16.css')) . '?0'), + 16 => $create_link_element(file_url_transform_relative(file_create_url('public://css/17.css')) . '?0'), + 17 => $create_link_element(file_url_transform_relative(file_create_url('public://css/18.css')) . '?0'), + 18 => $create_link_element(file_url_transform_relative(file_create_url('public://css/19.css')) . '?0'), + 19 => $create_link_element(file_url_transform_relative(file_create_url('public://css/20.css')) . '?0', 'print'), + 20 => $create_link_element(file_url_transform_relative(file_create_url('public://css/21.css')) . '?0'), + 21 => $create_link_element(file_url_transform_relative(file_create_url('public://css/22.css')) . '?0'), + 22 => $create_link_element(file_url_transform_relative(file_create_url('public://css/23.css')) . '?0'), + 23 => $create_link_element(file_url_transform_relative(file_create_url('public://css/24.css')) . '?0'), + 24 => $create_link_element(file_url_transform_relative(file_create_url('public://css/25.css')) . '?0'), + 25 => $create_link_element(file_url_transform_relative(file_create_url('public://css/26.css')) . '?0'), + 26 => $create_link_element(file_url_transform_relative(file_create_url('public://css/27.css')) . '?0'), + 27 => $create_link_element(file_url_transform_relative(file_create_url('public://css/28.css')) . '?0'), + 28 => $create_link_element(file_url_transform_relative(file_create_url('public://css/29.css')) . '?0'), + 29 => $create_link_element(file_url_transform_relative(file_create_url('public://css/30.css')) . '?0'), + 30 => $create_link_element(file_url_transform_relative(file_create_url('public://css/31.css')) . '?0'), + 31 => $create_link_element(file_url_transform_relative(file_create_url('public://css/32.css')) . '?0'), ], ], ]; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Command/QuickStartTest.php --- a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php Thu May 09 15:33:08 2019 +0100 @@ -58,6 +58,7 @@ } // Get a lock and a valid site path. $this->testDb = new TestDatabase(); + include $this->root . '/core/includes/bootstrap.inc'; } /** @@ -83,6 +84,10 @@ * Tests the quick-start command. */ public function testQuickStartCommand() { + if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) { + $this->markTestSkipped(); + } + // Install a site using the standard profile to ensure the one time login // link generation works. @@ -117,7 +122,6 @@ $this->assertContains("127.0.0.1:$port/user/reset/1/", $process->getOutput()); // Generate a cookie so we can make a request against the installed site. - include $this->root . '/core/includes/bootstrap.inc'; define('DRUPAL_TEST_IN_CHILD_SITE', FALSE); chmod($this->testDb->getTestSitePath(), 0755); $cookieJar = CookieJar::fromArray([ @@ -133,9 +137,47 @@ } /** + * Tests that the installer throws a requirement error on older PHP versions. + */ + public function testPhpRequirement() { + if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) >= 0) { + $this->markTestSkipped(); + } + + $install_command = [ + $this->php, + 'core/scripts/drupal', + 'quick-start', + 'standard', + "--site-name='Test site {$this->testDb->getDatabasePrefix()}'", + '--suppress-login', + ]; + $process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]); + $process->inheritEnvironmentVariables(); + $process->setTimeout(500); + $process->start(); + while ($process->isRunning()) { + // Wait for more output. + sleep(1); + } + + $error_output = $process->getErrorOutput(); + $this->assertContains('Your PHP installation is too old.', $error_output); + $this->assertContains('Drupal requires at least PHP', $error_output); + $this->assertContains(DRUPAL_MINIMUM_SUPPORTED_PHP, $error_output); + + // Stop the web server. + $process->stop(); + } + + /** * Tests the quick-start commands. */ public function testQuickStartInstallAndServerCommands() { + if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) { + $this->markTestSkipped(); + } + // Install a site. $install_command = [ $this->php, @@ -180,7 +222,6 @@ sleep(2); // Generate a cookie so we can make a request against the installed site. - include $this->root . '/core/includes/bootstrap.inc'; define('DRUPAL_TEST_IN_CHILD_SITE', FALSE); chmod($this->testDb->getTestSitePath(), 0755); $cookieJar = CookieJar::fromArray([ diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,8 @@ use Drupal\Core\Config\Schema\SchemaIncompleteException; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Language\Language; use Drupal\Core\Plugin\DefaultLazyPluginCollection; use Drupal\Tests\Core\Config\Entity\Fixtures\ConfigEntityBaseWithPluginCollections; @@ -63,7 +65,7 @@ * * @var string */ - protected $provider; + protected $provider = 'the_provider_of_the_entity_type'; /** * The language manager. @@ -94,6 +96,20 @@ protected $typedConfigManager; /** + * The module handler. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface|\Prophecy\Prophecy\ProphecyInterface + */ + protected $moduleHandler; + + /** + * The theme handler. + * + * @var \Drupal\Core\Extension\ThemeHandlerInterface|\Prophecy\Prophecy\ProphecyInterface + */ + protected $themeHandler; + + /** * {@inheritdoc} */ protected function setUp() { @@ -104,7 +120,6 @@ 'uuid' => '3bb9ee60-bea5-4622-b89b-a63319d10b3a', ]; $this->entityTypeId = $this->randomMachineName(); - $this->provider = $this->randomMachineName(); $this->entityType = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityTypeInterface'); $this->entityType->expects($this->any()) ->method('getProvider') @@ -131,12 +146,17 @@ $this->typedConfigManager = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface'); + $this->moduleHandler = $this->prophesize(ModuleHandlerInterface::class); + $this->themeHandler = $this->prophesize(ThemeHandlerInterface::class); + $container = new ContainerBuilder(); $container->set('entity_type.manager', $this->entityTypeManager); $container->set('uuid', $this->uuid); $container->set('language_manager', $this->languageManager); $container->set('cache_tags.invalidator', $this->cacheTagsInvalidator); $container->set('config.typed', $this->typedConfigManager); + $container->set('module_handler', $this->moduleHandler->reveal()); + $container->set('theme_handler', $this->themeHandler->reveal()); \Drupal::setContainer($container); $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Config\Entity\ConfigEntityBase', [$values, $this->entityTypeId]); @@ -163,6 +183,8 @@ * @covers ::preSave */ public function testPreSaveDuringSync() { + $this->moduleHandler->moduleExists('node')->willReturn(TRUE); + $query = $this->getMock('\Drupal\Core\Entity\Query\QueryInterface'); $storage = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); @@ -224,6 +246,12 @@ * @dataProvider providerCalculateDependenciesWithPluginCollections */ public function testCalculateDependenciesWithPluginCollections($definition, $expected_dependencies) { + $this->moduleHandler->moduleExists('the_provider_of_the_entity_type')->willReturn(TRUE); + $this->moduleHandler->moduleExists('test')->willReturn(TRUE); + $this->moduleHandler->moduleExists('test_theme')->willReturn(FALSE); + + $this->themeHandler->themeExists('test_theme')->willReturn(TRUE); + $values = []; $this->entity = $this->getMockBuilder('\Drupal\Tests\Core\Config\Entity\Fixtures\ConfigEntityBaseWithPluginCollections') ->setConstructorArgs([$values, $this->entityTypeId]) @@ -269,11 +297,16 @@ ['provider' => 'test'], ['module' => ['test']], ], + // Tests that the plugin provider is a theme dependency. + [ + ['provider' => 'test_theme'], + ['theme' => ['test_theme']], + ], // Tests that a plugin that is provided by the same module as the config // entity is not added to the dependencies array. [ ['provider' => $this->provider], - ['module' => [NULL]], + [], ], // Tests that a config entity that has a plugin which provides config // dependencies in its definition has them. @@ -464,7 +497,7 @@ ->will($this->returnValue($new_uuid)); $duplicate = $this->entity->createDuplicate(); - $this->assertInstanceOf('\Drupal\Core\Entity\Entity', $duplicate); + $this->assertInstanceOf('\Drupal\Core\Entity\EntityBase', $duplicate); $this->assertNotSame($this->entity, $duplicate); $this->assertFalse($this->entity->isNew()); $this->assertTrue($duplicate->isNew()); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -118,6 +118,9 @@ 'uuid' => 'uuid', 'langcode' => 'langcode', ], + 'config_export' => [ + 'id', + ], 'list_cache_tags' => [$this->entityTypeId . '_list'], ]); @@ -254,7 +257,14 @@ $immutable_config_object->isNew()->willReturn(TRUE); $config_object = $this->prophesize(Config::class); - $config_object->setData(['id' => 'foo', 'uuid' => 'bar', 'dependencies' => []]) + $config_object + ->setData([ + 'id' => 'foo', + 'uuid' => 'bar', + 'dependencies' => [], + 'langcode' => 'hu', + 'status' => TRUE, + ]) ->shouldBeCalled(); $config_object->save(FALSE)->shouldBeCalled(); $config_object->get()->willReturn([]); @@ -299,7 +309,14 @@ $immutable_config_object->isNew()->willReturn(FALSE); $config_object = $this->prophesize(Config::class); - $config_object->setData(['id' => 'foo', 'uuid' => 'bar', 'dependencies' => []]) + $config_object + ->setData([ + 'id' => 'foo', + 'uuid' => 'bar', + 'dependencies' => [], + 'langcode' => 'hu', + 'status' => TRUE, + ]) ->shouldBeCalled(); $config_object->save(FALSE)->shouldBeCalled(); $config_object->get()->willReturn([]); @@ -347,7 +364,14 @@ $immutable_config_object->isNew()->willReturn(FALSE); $config_object = $this->prophesize(Config::class); - $config_object->setData(['id' => 'bar', 'uuid' => 'bar', 'dependencies' => []]) + $config_object + ->setData([ + 'id' => 'bar', + 'uuid' => 'bar', + 'dependencies' => [], + 'langcode' => 'hu', + 'status' => TRUE, + ]) ->shouldBeCalled(); $config_object->save(FALSE) ->shouldBeCalled(); @@ -443,7 +467,14 @@ $config_object = $this->prophesize(Config::class); $config_object->get()->willReturn([]); - $config_object->setData(['id' => 'foo', 'uuid' => NULL, 'dependencies' => []]) + $config_object + ->setData([ + 'id' => 'foo', + 'uuid' => NULL, + 'dependencies' => [], + 'langcode' => 'en', + 'status' => TRUE, + ]) ->shouldBeCalled(); $config_object->save(FALSE)->shouldBeCalled(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php Thu May 09 15:33:08 2019 +0100 @@ -193,6 +193,9 @@ /** * @covers ::getPropertiesToExport + * + * @group legacy + * @expectedDeprecation Entity type "example_config_entity_type" is using config schema as a fallback for a missing `config_export` definition is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. See https://www.drupal.org/node/2949023. */ public function testGetPropertiesToExportSchemaFallback() { $this->typedConfigManager->expects($this->once()) diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php --- a/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php Thu May 09 15:33:08 2019 +0100 @@ -23,11 +23,6 @@ protected $targetStorage; /** - * @var \Drupal\Core\Config\ConfigManager|\PHPUnit_Framework_MockObject_MockObject - */ - protected $configManager; - - /** * The storage comparer to test. * * @var \Drupal\Core\Config\StorageComparer @@ -44,8 +39,7 @@ protected function setUp() { $this->sourceStorage = $this->getMock('Drupal\Core\Config\StorageInterface'); $this->targetStorage = $this->getMock('Drupal\Core\Config\StorageInterface'); - $this->configManager = $this->getMock('Drupal\Core\Config\ConfigManagerInterface'); - $this->storageComparer = new StorageComparer($this->sourceStorage, $this->targetStorage, $this->configManager); + $this->storageComparer = new StorageComparer($this->sourceStorage, $this->targetStorage); } protected function getConfigData() { @@ -244,4 +238,13 @@ $this->assertEmpty($this->storageComparer->getChangelist('delete')); } + /** + * @expectedDeprecation The storage comparer does not need a config manager. The parameter is deprecated since version 8.7.0 and will be removed in 9.0.0. Omit the third parameter. See https://www.drupal.org/node/2993271. + * @group legacy + */ + public function testConfigManagerDeprecation() { + $configManager = $this->getMock('Drupal\Core\Config\ConfigManagerInterface'); + new StorageComparer($this->sourceStorage, $this->targetStorage, $configManager); + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,114 @@ +assertArrayEquals(self::toArray($source), self::toArray($target)); + + // When the source is populated, they are not the same any more. + $this->generateRandomData($source, $source_collections); + $this->assertNotEquals(self::toArray($source), self::toArray($target)); + + // When the target is filled with random data they are also not the same. + $this->generateRandomData($target, $target_collections); + $this->assertNotEquals(self::toArray($source), self::toArray($target)); + + // Set the active collection to a random one on both source and target. + if ($source_collections) { + $collections = $source->getAllCollectionNames(); + $source = $source->createCollection($collections[array_rand($collections)]); + } + if ($target_collections) { + $collections = $target->getAllCollectionNames(); + $target = $target->createCollection($collections[array_rand($collections)]); + } + + $source_data = self::toArray($source); + $source_name = $source->getCollectionName(); + + // After copying they are the same, this asserts that items not present + // in the source get removed from the target. + self::replaceStorageContents($source, $target); + $this->assertArrayEquals($source_data, self::toArray($target)); + // Assert that the copy method did indeed not change the source. + $this->assertArrayEquals($source_data, self::toArray($source)); + + // Assert that the active collection is the same as the original source. + $this->assertEquals($source_name, $source->getCollectionName()); + $this->assertEquals($source_name, $target->getCollectionName()); + } + + /** + * Provides data for testCheckRequirements(). + */ + public function providerTestReplaceStorageContents() { + $data = []; + $data[] = [TRUE, TRUE]; + $data[] = [TRUE, FALSE]; + $data[] = [FALSE, TRUE]; + $data[] = [FALSE, FALSE]; + + return $data; + } + + /** + * Get the protected config data out of a MemoryStorage. + * + * @param \Drupal\Core\Config\MemoryStorage $storage + * The config storage to extract the data from. + * + * @return array + */ + protected static function toArray(MemoryStorage $storage) { + $reflection = new \ReflectionObject($storage); + $property = $reflection->getProperty('config'); + $property->setAccessible(TRUE); + + return $property->getValue($storage)->getArrayCopy(); + } + + /** + * Generate random data in a config storage. + * + * @param \Drupal\Core\Config\StorageInterface $storage + * The storage to populate with random data. + * @param bool $collections + * Add random collections or not. + */ + protected function generateRandomData(StorageInterface $storage, $collections = TRUE) { + $generator = $this->getRandomGenerator(); + for ($i = 0; $i < rand(2, 10); $i++) { + $storage->write($this->randomMachineName(), (array) $generator->object()); + } + if ($collections) { + for ($i = 0; $i < rand(1, 5); $i++) { + $collection = $storage->createCollection($this->randomMachineName()); + for ($i = 0; $i < rand(2, 10); $i++) { + $collection->write($this->randomMachineName(), (array) $generator->object()); + } + } + } + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php --- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php Thu May 09 15:33:08 2019 +0100 @@ -75,9 +75,12 @@ * @expectedDeprecation Drupal\Core\Controller\ControllerResolver::doGetArguments is deprecated as of 8.6.0 and will be removed in 9.0. Inject the "http_kernel.controller.argument_resolver" service instead. */ public function testGetArguments() { + if (!in_array('Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface', class_implements('Symfony\Component\HttpKernel\Controller\ControllerResolver'))) { + $this->markTestSkipped("Do not test ::getArguments() method when it is not implemented by Symfony's ControllerResolver."); + } $controller = function (EntityInterface $entity, $user, RouteMatchInterface $route_match, ServerRequestInterface $psr_7) { }; - $mock_entity = $this->getMockBuilder('Drupal\Core\Entity\Entity') + $mock_entity = $this->getMockBuilder('Drupal\Core\Entity\EntityBase') ->disableOriginalConstructor() ->getMock(); $mock_account = $this->getMock('Drupal\Core\Session\AccountInterface'); @@ -171,6 +174,7 @@ * @dataProvider providerTestGetControllerFromDefinition */ public function testGetControllerFromDefinition($definition, $output) { + $this->container->set('invoke_service', new MockInvokeController()); $controller = $this->controllerResolver->getControllerFromDefinition($definition); $this->assertCallableController($controller, NULL, $output); } @@ -188,6 +192,8 @@ [new MockInvokeController(), 'This used __invoke().'], // Tests a class using __invoke(). ['Drupal\Tests\Core\Controller\MockInvokeController', 'This used __invoke().'], + // Tests a service from the container using __invoke(). + ['invoke_service', 'This used __invoke().'], ]; } @@ -222,12 +228,14 @@ /** * Tests getArguments with a route match and a request. * - * @covers ::getArguments * @covers ::doGetArguments * * @group legacy */ public function testGetArgumentsWithRouteMatchAndRequest() { + if (!in_array('Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface', class_implements('Symfony\Component\HttpKernel\Controller\ControllerResolver'))) { + $this->markTestSkipped("Do not test ::getArguments() method when it is not implemented by Symfony's ControllerResolver."); + } $request = Request::create('/test'); $mock_controller = new MockController(); $arguments = $this->controllerResolver->getArguments($request, [$mock_controller, 'getControllerWithRequestAndRouteMatch']); @@ -237,12 +245,14 @@ /** * Tests getArguments with a route match and a PSR-7 request. * - * @covers ::getArguments * @covers ::doGetArguments * * @group legacy */ public function testGetArgumentsWithRouteMatchAndPsr7Request() { + if (!in_array('Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface', class_implements('Symfony\Component\HttpKernel\Controller\ControllerResolver'))) { + $this->markTestSkipped("Do not test ::getArguments() method when it is not implemented by Symfony's ControllerResolver."); + } $request = Request::create('/test'); $mock_controller = new MockControllerPsr7(); $arguments = $this->controllerResolver->getArguments($request, [$mock_controller, 'getControllerWithRequestAndRouteMatch']); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Controller/FormControllerTest.php --- a/core/tests/Drupal/Tests/Core/Controller/FormControllerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Controller/FormControllerTest.php Thu May 09 15:33:08 2019 +0100 @@ -20,6 +20,9 @@ * @group legacy */ public function testControllerResolverDeprecation() { + if (!in_array('Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface', class_implements('Symfony\Component\HttpKernel\Controller\ControllerResolver'))) { + $this->markTestSkipped("Do not test ::getArguments() method when it is not implemented by Symfony's ControllerResolver."); + } $controller_resolver = $this->getMockBuilder(ControllerResolver::class)->disableOriginalConstructor()->getMock(); $form_builder = $this->getMockBuilder(FormBuilderInterface::class)->getMock(); $class_resolver = $this->getMockBuilder(ClassResolverInterface::class)->getMock(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Database/SchemaIntrospectionTestTrait.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Database/SchemaIntrospectionTestTrait.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,85 @@ +getIndexColumnNames($table_name, $index_type) as $index_columns) { + if ($column_names == $index_columns) { + $this->assertTrue(TRUE); + return; + } + } + $this->assertTrue(FALSE); + } + + /** + * Checks that an index covering exactly the given column names doesn't exist. + * + * @param string $table_name + * A non-prefixed table name. + * @param array $column_names + * An array of column names + * @param string $index_type + * (optional) The type of the index. Can be one of 'index', 'unique' or + * 'primary'. Defaults to 'index'. + */ + protected function assertNoIndexOnColumns($table_name, array $column_names, $index_type = 'index') { + foreach ($this->getIndexColumnNames($table_name, $index_type) as $index_columns) { + if ($column_names == $index_columns) { + $this->assertTrue(FALSE); + } + } + $this->assertTrue(TRUE); + } + + /** + * Returns the column names used by the indexes of a table. + * + * @param string $table_name + * A table name. + * @param string $index_type + * The type of the index. Can be one of 'index', 'unique' or 'primary'. + * + * @return array + * A multi-dimensional array containing the column names for each index of + * the given type. + */ + protected function getIndexColumnNames($table_name, $index_type) { + assert(in_array($index_type, ['index', 'unique', 'primary'], TRUE)); + + $schema = \Drupal::database()->schema(); + $introspect_index_schema = new \ReflectionMethod(get_class($schema), 'introspectIndexSchema'); + $introspect_index_schema->setAccessible(TRUE); + $index_schema = $introspect_index_schema->invoke($schema, $table_name); + + // Filter the indexes by type. + if ($index_type === 'primary') { + $indexes = [$index_schema['primary key']]; + } + elseif ($index_type === 'unique') { + $indexes = array_values($index_schema['unique keys']); + } + else { + $indexes = array_values($index_schema['indexes']); + } + + return $indexes; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Datetime/DateTest.php --- a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php Thu May 09 15:33:08 2019 +0100 @@ -19,9 +19,9 @@ /** * The mocked entity manager. * - * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $entityManager; + protected $entityTypeManager; /** * The mocked language manager. @@ -63,8 +63,8 @@ $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); - $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - $this->entityManager->expects($this->any())->method('getStorage')->with('date_format')->willReturn($entity_storage); + $this->entityTypeManager = $this->getMock('Drupal\Core\Entity\EntityTypeManagerInterface'); + $this->entityTypeManager->expects($this->any())->method('getStorage')->with('date_format')->willReturn($entity_storage); $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface'); $this->stringTranslation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface'); @@ -76,10 +76,10 @@ $container->set('string_translation', $this->getStringTranslationStub()); \Drupal::setContainer($container); - $this->dateFormatter = new DateFormatter($this->entityManager, $this->languageManager, $this->stringTranslation, $this->getConfigFactoryStub(), $this->requestStack); + $this->dateFormatter = new DateFormatter($this->entityTypeManager, $this->languageManager, $this->stringTranslation, $this->getConfigFactoryStub(), $this->requestStack); $this->dateFormatterStub = $this->getMockBuilder('\Drupal\Core\Datetime\DateFormatter') - ->setConstructorArgs([$this->entityManager, $this->languageManager, $this->stringTranslation, $this->getConfigFactoryStub(), $this->requestStack]) + ->setConstructorArgs([$this->entityTypeManager, $this->languageManager, $this->stringTranslation, $this->getConfigFactoryStub(), $this->requestStack]) ->setMethods(['formatDiff']) ->getMock(); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php --- a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php Thu May 09 15:33:08 2019 +0100 @@ -241,7 +241,6 @@ } } - namespace { if (!function_exists('drupal_valid_test_ua')) { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/DrupalTest.php --- a/core/tests/Drupal/Tests/Core/DrupalTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/DrupalTest.php Thu May 09 15:33:08 2019 +0100 @@ -358,6 +358,9 @@ * * @covers ::url * @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() + * + * @group legacy + * @expectedDeprecation Drupal::url() is deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Instead create a \Drupal\Core\Url object directly, for example using Url::fromRoute() */ public function testUrl() { $route_parameters = ['test_parameter' => 'test']; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php Thu May 09 15:33:08 2019 +0100 @@ -20,9 +20,9 @@ /** * The mocked entity manager. * - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ - public $entityManager; + public $entityTypeManager; /** * {@inheritdoc} @@ -36,6 +36,8 @@ $container = new Container(); $container->set('cache_contexts_manager', $cache_contexts_manager); \Drupal::setContainer($container); + + $this->entityTypeManager = $this->getMock('Drupal\Core\Entity\EntityTypeManagerInterface'); } /** @@ -78,8 +80,6 @@ $expected_access_result->setReason("Could not find '{bundle_argument}' request argument, therefore cannot check create access."); } - $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - // Don't expect a call to the access control handler when we have a bundle // argument requirement but no bundle is provided. if ($entity_bundle || strpos($requirement, '{') === FALSE) { @@ -89,12 +89,12 @@ ->with($entity_bundle) ->will($this->returnValue($access_result)); - $entity_manager->expects($this->any()) + $this->entityTypeManager->expects($this->any()) ->method('getAccessControlHandler') ->will($this->returnValue($access_control_handler)); } - $applies_check = new EntityCreateAccessCheck($entity_manager); + $applies_check = new EntityCreateAccessCheck($this->entityTypeManager); $route = $this->getMockBuilder('Symfony\Component\Routing\Route') ->disableOriginalConstructor() diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityDefinitionUpdateManagerTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityDefinitionUpdateManagerTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,35 @@ +prophesize(EntityTypeManagerInterface::class)->reveal(); + $entity_last_installed_schema_repository = $this->prophesize(EntityLastInstalledSchemaRepositoryInterface::class)->reveal(); + $entity_field_manager = $this->prophesize(EntityFieldManagerInterface::class)->reveal(); + $entity_type_listener = $this->prophesize(EntityTypeListenerInterface::class)->reveal(); + $field_storage_definition_listener = $this->prophesize(FieldStorageDefinitionListenerInterface::class)->reveal(); + + $entity_definition_update_manager = new EntityDefinitionUpdateManager($entity_type_manager, $entity_last_installed_schema_repository, $entity_field_manager, $entity_type_listener, $field_storage_definition_listener); + + $this->assertNull($entity_definition_update_manager->applyUpdates()); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php Thu May 09 15:33:08 2019 +0100 @@ -14,9 +14,9 @@ /** * The entity manager. * - * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $entityManager; + protected $entityTypeManager; /** * The form builder. @@ -39,8 +39,8 @@ parent::setUp(); $this->formBuilder = $this->getMock('Drupal\Core\Form\FormBuilderInterface'); - $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - $this->entityFormBuilder = new EntityFormBuilder($this->entityManager, $this->formBuilder); + $this->entityTypeManager = $this->getMock('Drupal\Core\Entity\EntityTypeManagerInterface'); + $this->entityFormBuilder = new EntityFormBuilder($this->entityTypeManager, $this->formBuilder); } /** @@ -53,7 +53,7 @@ $form_controller->expects($this->any()) ->method('getFormId') ->will($this->returnValue('the_form_id')); - $this->entityManager->expects($this->any()) + $this->entityTypeManager->expects($this->any()) ->method('getFormObject') ->with('the_entity_type', 'default') ->will($this->returnValue($form_controller)); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php Thu May 09 15:33:08 2019 +0100 @@ -52,7 +52,7 @@ public function testFormId($expected, $definition) { $this->entityType->set('entity_keys', ['bundle' => $definition['bundle']]); - $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\Entity', [[], $definition['entity_type']], '', TRUE, TRUE, TRUE, ['getEntityType', 'bundle']); + $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityBase', [[], $definition['entity_type']], '', TRUE, TRUE, TRUE, ['getEntityType', 'bundle']); $entity->expects($this->any()) ->method('getEntityType') diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php Thu May 09 15:33:08 2019 +0100 @@ -101,7 +101,7 @@ ->will($this->returnValue($entity_type)); /** @var \Drupal\Core\Entity\Entity $entity */ - $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\Entity', [ + $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityBase', [ ['id' => $entity_id, 'label' => $entity_label, 'langcode' => 'es'], $entity_type_id, ]); @@ -118,7 +118,7 @@ ->with($this->equalTo($expected_link)) ->willReturn($expected); - $this->assertSame($expected, $entity->link($link_text, $link_rel, $link_options)); + $this->assertSame($expected, $entity->toLink($link_text, $link_rel, $link_options)->toString()); } /** @@ -170,7 +170,7 @@ ->will($this->returnValue($entity_type)); /** @var \Drupal\Core\Entity\Entity $entity */ - $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\Entity', [ + $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityBase', [ ['id' => $entity_id, 'label' => $entity_label, 'langcode' => 'es'], $entity_type_id, ]); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,16 +3,22 @@ namespace Drupal\Tests\Core\Entity; use Drupal\Core\DependencyInjection\ContainerBuilder; -use Drupal\Core\Entity\EntityFieldManagerInterface; +use Drupal\Core\Entity\EntityDisplayRepositoryInterface; +use Drupal\Core\Entity\EntityFieldManager; +use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface; use Drupal\Core\Entity\EntityManager; +use Drupal\Core\Entity\EntityRepositoryInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Entity\EntityTypeBundleInfoInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Entity\EntityTypeRepositoryInterface; use Drupal\Tests\UnitTestCase; /** * @coversDefaultClass \Drupal\Core\Entity\EntityManager * @group Entity + * @group legacy */ class EntityManagerTest extends UnitTestCase { @@ -38,6 +44,13 @@ protected $entityTypeRepository; /** + * The entity display repository. + * + * @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface|\Prophecy\Prophecy\ProphecyInterface + */ + protected $entityDisplayRepository; + + /** * The entity type bundle info. * * @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface|\Prophecy\Prophecy\ProphecyInterface @@ -52,21 +65,41 @@ protected $entityFieldManager; /** + * The entity repository. + * + * @var \Drupal\Core\Entity\EntityRepositoryInterface|\Prophecy\Prophecy\ProphecyInterface + */ + protected $entityRepository; + + /** + * The entity last installed schema repository. + * + * @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepository|\Prophecy\Prophecy\ProphecyInterface + */ + protected $entityLastInstalledSchemaRepository; + + /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); - $this->entityTypeManager = $this->prophesize(EntityTypeManagerInterface::class); + $this->entityTypeManager = $this->prophesize(EntityTypeManager::class); $this->entityTypeRepository = $this->prophesize(EntityTypeRepositoryInterface::class); $this->entityTypeBundleInfo = $this->prophesize(EntityTypeBundleInfoInterface::class); - $this->entityFieldManager = $this->prophesize(EntityFieldManagerInterface::class); + $this->entityFieldManager = $this->prophesize(EntityFieldManager::class); + $this->entityRepository = $this->prophesize(EntityRepositoryInterface::class); + $this->entityDisplayRepository = $this->prophesize(EntityDisplayRepositoryInterface::class); + $this->entityLastInstalledSchemaRepository = $this->prophesize(EntityLastInstalledSchemaRepositoryInterface::class); $container = new ContainerBuilder(); $container->set('entity_type.manager', $this->entityTypeManager->reveal()); $container->set('entity_type.repository', $this->entityTypeRepository->reveal()); $container->set('entity_type.bundle.info', $this->entityTypeBundleInfo->reveal()); $container->set('entity_field.manager', $this->entityFieldManager->reveal()); + $container->set('entity.repository', $this->entityRepository->reveal()); + $container->set('entity_display.repository', $this->entityDisplayRepository->reveal()); + $container->set('entity.last_installed_schema.repository', $this->entityLastInstalledSchemaRepository->reveal()); $this->entityManager = new EntityManager(); $this->entityManager->setContainer($container); @@ -76,6 +109,8 @@ * Tests the clearCachedDefinitions() method. * * @covers ::clearCachedDefinitions + * + * @expectedDeprecation EntityManagerInterface::clearCachedDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::clearCachedDefinitions() instead. See https://www.drupal.org/node/2549139. */ public function testClearCachedDefinitions() { $this->entityTypeManager->clearCachedDefinitions()->shouldBeCalled(); @@ -86,4 +121,353 @@ $this->entityManager->clearCachedDefinitions(); } + /** + * Tests the getBundleInfo() method. + * + * @covers ::getBundleInfo + * + * @expectedDeprecation EntityManagerInterface::getBundleInfo() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetBundleInfo() { + $return = ['article' => ['label' => 'Article']]; + $this->entityTypeBundleInfo->getBundleInfo('node')->shouldBeCalled()->willReturn($return); + + $this->assertEquals($return, $this->entityManager->getBundleInfo('node')); + } + + /** + * Tests the getAllBundleInfo() method. + * + * @covers ::getAllBundleInfo + * + * @expectedDeprecation EntityManagerInterface::getAllBundleInfo() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetAllBundleInfo() { + $return = ['node' => ['article' => ['label' => 'Article']]]; + $this->entityTypeBundleInfo->getAllBundleInfo()->shouldBeCalled()->willReturn($return); + $this->assertEquals($return, $this->entityManager->getAllBundleInfo()); + } + + /** + * Tests the clearCachedBundles() method. + * + * @covers ::clearCachedBundles + * + * @expectedDeprecation EntityManagerInterface::clearCachedBundles() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::clearCachedBundles() instead. See https://www.drupal.org/node/2549139. + */ + public function testClearCachedBundles() { + $this->entityTypeBundleInfo->clearCachedBundles()->shouldBeCalled(); + $this->entityManager->clearCachedBundles(); + } + + /** + * Tests the getTranslationFromContext() method. + * + * @covers ::getTranslationFromContext + * + * @expectedDeprecation EntityManagerInterface::getTranslationFromContext() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::getTranslationFromContext() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetTranslationFromContext() { + $entity = $this->prophesize(EntityInterface::class); + $this->entityRepository->getTranslationFromContext($entity->reveal(), 'de', ['example' => 'context'])->shouldBeCalled(); + $this->entityManager->getTranslationFromContext($entity->reveal(), 'de', ['example' => 'context']); + } + + /** + * Tests the loadEntityByUuid() method. + * + * @covers ::loadEntityByUuid + * + * @expectedDeprecation EntityManagerInterface::loadEntityByUuid() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::loadEntityByUuid() instead. See https://www.drupal.org/node/2549139. + */ + public function testLoadEntityByUuid() { + $entity = $this->prophesize(EntityInterface::class); + $this->entityRepository->loadEntityByUuid('entity_test', '9a9a3d06-5d27-493b-965d-7f9cb0115817')->shouldBeCalled()->willReturn($entity->reveal()); + + $this->assertInstanceOf(EntityInterface::class, $this->entityManager->loadEntityByUuid('entity_test', '9a9a3d06-5d27-493b-965d-7f9cb0115817')); + } + + /** + * Tests the loadEntityByConfigTarget() method. + * + * @covers ::loadEntityByConfigTarget + * + * @expectedDeprecation EntityManagerInterface::loadEntityByConfigTarget() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::loadEntityByConfigTarget() instead. See https://www.drupal.org/node/2549139. + */ + public function testLoadEntityByConfigTarget() { + $entity = $this->prophesize(EntityInterface::class); + $this->entityRepository->loadEntityByConfigTarget('config_test', 'test')->shouldBeCalled()->willReturn($entity->reveal()); + + $this->assertInstanceOf(EntityInterface::class, $this->entityManager->loadEntityByConfigTarget('config_test', 'test')); + } + + /** + * Tests the getEntityTypeFromClass() method. + * + * @covers ::getEntityTypeFromClass + * + * @expectedDeprecation EntityManagerInterface::getEntityTypeFromClass() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeFromClass() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetEntityTypeFromClass() { + $class = '\Drupal\example\Entity\ExampleEntity'; + $this->entityTypeRepository->getEntityTypeFromClass($class)->shouldBeCalled()->willReturn('example_entity_type'); + + $this->assertEquals('example_entity_type', $this->entityManager->getEntityTypeFromClass($class)); + } + + /** + * Tests the getLastInstalledDefinition() method. + * + * @covers ::getLastInstalledDefinition + * + * @expectedDeprecation EntityManagerInterface::getLastInstalledDefinition() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinition() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetLastInstalledDefinition() { + $entity_type_id = 'example_entity_type'; + $entity_type = new EntityType(['id' => $entity_type_id]); + $this->entityLastInstalledSchemaRepository->getLastInstalledDefinition($entity_type_id)->shouldBeCalled()->willReturn($entity_type); + + $this->assertEquals($entity_type, $this->entityManager->getLastInstalledDefinition($entity_type_id)); + } + + /** + * Tests the getLastInstalledFieldStorageDefinitions() method. + * + * @covers ::getLastInstalledFieldStorageDefinitions + * + * @expectedDeprecation EntityManagerInterface::getLastInstalledFieldStorageDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledFieldStorageDefinitions() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetLastInstalledFieldStorageDefinitions() { + $entity_type_id = 'example_entity_type'; + $this->entityLastInstalledSchemaRepository->getLastInstalledFieldStorageDefinitions($entity_type_id)->shouldBeCalled()->willReturn([]); + + $this->assertEquals([], $this->entityManager->getLastInstalledFieldStorageDefinitions($entity_type_id)); + } + + /** + * Tests the getAllViewModes() method. + * + * @covers ::getAllViewModes + * + * @expectedDeprecation EntityManagerInterface::getAllViewModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetAllViewModes() { + $this->entityDisplayRepository->getAllViewModes()->shouldBeCalled()->willReturn([]); + $this->assertEquals([], $this->entityManager->getAllViewModes()); + } + + /** + * Tests the getViewModes() method. + * + * @covers ::getViewModes + * + * @expectedDeprecation EntityManagerInterface::getViewModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModes() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetViewModes() { + $this->entityDisplayRepository->getViewModes('entity_type')->shouldBeCalled()->willReturn([]); + $this->assertEquals([], $this->entityManager->getViewModes('entity_type')); + } + + /** + * Tests the getViewModeOptions() method. + * + * @covers ::getViewModeOptions + * + * @expectedDeprecation EntityManagerInterface::getViewModeOptions() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptions() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetViewModeOptions() { + $this->entityDisplayRepository->getViewModeOptions('entity_type')->shouldBeCalled()->willReturn([]); + $this->assertEquals([], $this->entityManager->getViewModeOptions('entity_type')); + } + + /** + * Tests the getViewModeOptionsByBundle() method. + * + * @covers ::getViewModeOptionsByBundle + * + * @expectedDeprecation EntityManagerInterface::getViewModeOptionsByBundle() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptionsByBundle() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetViewModeOptionsByBundle() { + $this->entityDisplayRepository->getViewModeOptionsByBundle('entity_type', 'bundle')->shouldBeCalled()->willReturn([]); + $this->assertEquals([], $this->entityManager->getViewModeOptionsByBundle('entity_type', 'bundle')); + } + + /** + * Tests the getAllFormModes() method. + * + * @covers ::getAllFormModes + * + * @expectedDeprecation EntityManagerInterface::getAllFormModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllFormModes() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetAllFormModes() { + $this->entityDisplayRepository->getAllFormModes()->shouldBeCalled()->willReturn([]); + $this->assertEquals([], $this->entityManager->getAllFormModes()); + } + + /** + * Tests the getFormModes() method. + * + * @covers ::getFormModes + * + * @expectedDeprecation EntityManagerInterface::getFormModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModes() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetFormModes() { + $this->entityDisplayRepository->getFormModes('entity_type')->shouldBeCalled()->willReturn([]); + $this->assertEquals([], $this->entityManager->getFormModes('entity_type')); + } + + /** + * Tests the getFormModeOptions() method. + * + * @covers ::getFormModeOptions + * + * @expectedDeprecation EntityManagerInterface::getFormModeOptions() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptions() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetFormModeOptions() { + $this->entityDisplayRepository->getFormModeOptions('entity_type')->shouldBeCalled()->willReturn([]); + $this->assertEquals([], $this->entityManager->getFormModeOptions('entity_type')); + } + + /** + * Tests the getFormModeOptionsByBundle() method. + * + * @covers ::getFormModeOptionsByBundle + * + * @expectedDeprecation EntityManagerInterface::getFormModeOptionsByBundle() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptionsByBundle() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetFormModeOptionsByBundle() { + $this->entityDisplayRepository->getFormModeOptionsByBundle('entity_type', 'bundle')->shouldBeCalled()->willReturn([]); + $this->assertEquals([], $this->entityManager->getFormModeOptionsByBundle('entity_type', 'bundle')); + } + + /** + * Tests the clearDisplayModeInfo() method. + * + * @covers ::clearDisplayModeInfo + * + * @expectedDeprecation EntityManagerInterface::clearDisplayModeInfo() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::clearDisplayModeInfo() instead. See https://www.drupal.org/node/2549139. + */ + public function testClearDisplayModeInfo() { + $this->entityDisplayRepository->clearDisplayModeInfo()->shouldBeCalled()->willReturn([]); + $this->entityManager->clearDisplayModeInfo(); + } + + /** + * Tests the useCaches() method. + * + * @covers ::useCaches + * + * @expectedDeprecation EntityManagerInterface::useCaches() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::useCaches() and/or Drupal\Core\Entity\EntityFieldManagerInterface::useCaches() instead. See https://www.drupal.org/node/2549139. + */ + public function testUseCaches() { + $this->entityTypeManager->useCaches(TRUE)->shouldBeCalled(); + $this->entityFieldManager->useCaches(TRUE)->shouldBeCalled(); + + $this->entityManager->useCaches(TRUE); + } + + /** + * Tests the createInstance() method. + * + * @covers ::createInstance + * + * @expectedDeprecation EntityManagerInterface::createInstance() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::createInstance() instead. See https://www.drupal.org/node/2549139. + */ + public function testCreateInstance() { + $this->entityTypeManager->createInstance('plugin_id', ['example' => TRUE])->shouldBeCalled(); + + $this->entityManager->createInstance('plugin_id', ['example' => TRUE]); + } + + /** + * Tests the getInstance() method. + * + * @covers ::getInstance + * + * @expectedDeprecation EntityManagerInterface::getInstance() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::getInstance() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetInstance() { + $this->entityTypeManager->getInstance(['example' => TRUE])->shouldBeCalled(); + + $this->entityManager->getInstance(['example' => TRUE]); + } + + /** + * Tests the getActive() method. + * + * @covers ::getActive + * + * @expectedDeprecation EntityManagerInterface::getActive() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getActive() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetActive() { + $entity_type_id = 'entity_test'; + $entity_id = 0; + $contexts = []; + $this->entityRepository->getActive($entity_type_id, $entity_id, $contexts)->shouldBeCalled($entity_type_id, $entity_id, $contexts); + $this->entityManager->getActive($entity_type_id, $entity_id, $contexts); + } + + /** + * Tests the getActiveMultiple() method. + * + * @covers ::getActiveMultiple + * + * @expectedDeprecation EntityManagerInterface::getActiveMultiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getActiveMultiple() instead. See https://www.drupal.org/node/2549139. + */ + public function testActiveMultiple() { + $entity_type_id = 'entity_test'; + $entity_ids = [0]; + $contexts = []; + $this->entityRepository->getActiveMultiple($entity_type_id, $entity_ids, $contexts)->shouldBeCalled($entity_type_id, $entity_ids, $contexts); + $this->entityManager->getActiveMultiple($entity_type_id, $entity_ids, $contexts); + } + + /** + * Tests the getCanonical() method. + * + * @covers ::getCanonical + * + * @expectedDeprecation EntityManagerInterface::getCanonical() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonical() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetCanonical() { + $entity_type_id = 'entity_test'; + $entity_id = ''; + $contexts = []; + $this->entityRepository->getCanonical($entity_type_id, $entity_id, $contexts)->shouldBeCalled($entity_type_id, $entity_id, $contexts); + $this->entityManager->getCanonical($entity_type_id, $entity_id, $contexts); + } + + /** + * Tests the getCanonicalMultiple() method. + * + * @covers ::getCanonicalMultiple + * + * @expectedDeprecation EntityManagerInterface::getCanonicalMultiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonicalMultiple() instead. See https://www.drupal.org/node/2549139. + */ + public function testGetCanonicalMultiple() { + $entity_type_id = 'entity_test'; + $entity_ids = [0]; + $contexts = []; + $this->entityRepository->getCanonicalMultiple($entity_type_id, $entity_ids, $contexts)->shouldBeCalled($entity_type_id, $entity_ids, $contexts); + $this->entityManager->getCanonicalMultiple($entity_type_id, $entity_ids, $contexts); + } + + /** + * @covers ::getActiveDefinition + * + * @expectedDeprecation EntityManagerInterface::getActiveDefinition() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::getActiveDefinition() instead. See https://www.drupal.org/node/3040966. + */ + public function testGetActiveDefinition() { + $this->entityManager->getActiveDefinition('entity_test'); + } + + /** + * @covers ::getActiveFieldStorageDefinitions + * + * @expectedDeprecation EntityManagerInterface::getActiveFieldStorageDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getActiveFieldStorageDefinitions() instead. See https://www.drupal.org/node/3040966. + */ + public function testGetActiveFieldStorageDefinitions() { + $this->entityManager->getActiveFieldStorageDefinitions('entity_test'); + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php Thu May 09 15:33:08 2019 +0100 @@ -8,6 +8,7 @@ use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageManagerInterface; +use Drupal\Core\Plugin\Context\ContextRepositoryInterface; use Drupal\Tests\UnitTestCase; use Prophecy\Argument; @@ -32,6 +33,13 @@ protected $languageManager; /** + * The context repository. + * + * @var \Drupal\Core\Plugin\Context\ContextRepositoryInterface|\Prophecy\Prophecy\ProphecyInterface + */ + protected $contextRepository; + + /** * The entity repository under test. * * @var \Drupal\Core\Entity\EntityRepository @@ -46,8 +54,9 @@ $this->entityTypeManager = $this->prophesize(EntityTypeManagerInterface::class); $this->languageManager = $this->prophesize(LanguageManagerInterface::class); + $this->contextRepository = $this->prophesize(ContextRepositoryInterface::class); - $this->entityRepository = new EntityRepository($this->entityTypeManager->reveal(), $this->languageManager->reveal()); + $this->entityRepository = new EntityRepository($this->entityTypeManager->reveal(), $this->languageManager->reveal(), $this->contextRepository->reveal()); } /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,7 @@ namespace Drupal\Tests\Core\Entity; -use Drupal\Core\Entity\Entity; +use Drupal\Core\Entity\EntityBase; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityResolverManager; use Drupal\Core\Form\FormBase; @@ -32,9 +32,9 @@ /** * The mocked entity manager. * - * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $entityManager; + protected $entityTypeManager; /** * The mocked class resolver. @@ -56,11 +56,11 @@ * @covers ::__construct */ protected function setUp() { - $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); + $this->entityTypeManager = $this->getMock('Drupal\Core\Entity\EntityTypeManagerInterface'); $this->container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); $this->classResolver = $this->getClassResolverStub(); - $this->entityResolverManager = new EntityResolverManager($this->entityManager, $this->classResolver); + $this->entityResolverManager = new EntityResolverManager($this->entityTypeManager, $this->classResolver); } /** @@ -455,13 +455,13 @@ $revisionable_definition->expects($this->any()) ->method('isRevisionable') ->willReturn(TRUE); - $this->entityManager->expects($this->any()) + $this->entityTypeManager->expects($this->any()) ->method('getDefinitions') ->will($this->returnValue([ 'entity_test' => $definition, 'entity_test_rev' => $revisionable_definition, ])); - $this->entityManager->expects($this->any()) + $this->entityTypeManager->expects($this->any()) ->method('getDefinition') ->will($this->returnCallback(function ($entity_type) use ($definition, $revisionable_definition) { if ($entity_type == 'entity_test') { @@ -500,7 +500,7 @@ /** * A concrete entity. */ -class SimpleTestEntity extends Entity { +class SimpleTestEntity extends EntityBase { } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php Thu May 09 15:33:08 2019 +0100 @@ -14,6 +14,7 @@ use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityHandlerBase; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManager; @@ -67,6 +68,13 @@ protected $cacheBackend; /** + * The entity last installed schema repository. + * + * @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface|\Prophecy\Prophecy\ProphecyInterface + */ + protected $entityLastInstalledSchemaRepository; + + /** * {@inheritdoc} */ protected function setUp() { @@ -78,8 +86,9 @@ $this->cacheBackend = $this->prophesize(CacheBackendInterface::class); $this->translationManager = $this->prophesize(TranslationInterface::class); + $this->entityLastInstalledSchemaRepository = $this->prophesize(EntityLastInstalledSchemaRepositoryInterface::class); - $this->entityTypeManager = new TestEntityTypeManager(new \ArrayObject(), $this->moduleHandler->reveal(), $this->cacheBackend->reveal(), $this->translationManager->reveal(), $this->getClassResolverStub()); + $this->entityTypeManager = new TestEntityTypeManager(new \ArrayObject(), $this->moduleHandler->reveal(), $this->cacheBackend->reveal(), $this->translationManager->reveal(), $this->getClassResolverStub(), $this->entityLastInstalledSchemaRepository->reveal()); $this->discovery = $this->prophesize(DiscoveryInterface::class); $this->entityTypeManager->setDiscovery($this->discovery->reveal()); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -123,7 +123,7 @@ $container->set('cache_tags.invalidator', $this->cacheTagsInvalidator); \Drupal::setContainer($container); - $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Entity\Entity', [$this->values, $this->entityTypeId]); + $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityBase', [$this->values, $this->entityTypeId]); } /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php Thu May 09 15:33:08 2019 +0100 @@ -3,13 +3,14 @@ namespace Drupal\Tests\Core\Entity; use Drupal\Core\DependencyInjection\ContainerBuilder; -use Drupal\Core\Entity\Entity; +use Drupal\Core\Entity\EntityBase; use Drupal\Core\Entity\EntityMalformedException; use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException; use Drupal\Core\Entity\RevisionableInterface; use Drupal\Core\GeneratedUrl; +use Drupal\Core\Link; use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\Core\Url; use Drupal\Tests\UnitTestCase; @@ -100,7 +101,7 @@ * @covers ::toUrl */ public function testToUrlNoId() { - $entity = $this->getEntity(Entity::class, []); + $entity = $this->getEntity(EntityBase::class, []); $this->setExpectedException(EntityMalformedException::class, 'The "' . $this->entityTypeId . '" entity cannot have a URI as it does not have an ID'); $entity->toUrl(); @@ -122,7 +123,7 @@ */ public function testToUrlLinkTemplates($link_template, $expected_route_name) { $values = ['id' => $this->entityId, 'langcode' => $this->langcode]; - $entity = $this->getEntity(Entity::class, $values); + $entity = $this->getEntity(EntityBase::class, $values); $this->registerLinkTemplate($link_template); /** @var \Drupal\Core\Url $url */ @@ -217,7 +218,7 @@ * @covers ::urlRouteParameters */ public function testToUrlLinkTemplateNoId($link_template, $expected_route_name) { - $entity = $this->getEntity(Entity::class, ['id' => $this->entityId]); + $entity = $this->getEntity(EntityBase::class, ['id' => $this->entityId]); $this->registerLinkTemplate($link_template); /** @var \Drupal\Core\Url $url */ @@ -262,7 +263,7 @@ */ public function testToUrlLinkTemplateAddForm($has_bundle_key, $bundle_entity_type, $bundle_key, $expected_route_parameters) { $values = ['id' => $this->entityId, 'langcode' => $this->langcode]; - $entity = $this->getEntity(Entity::class, $values); + $entity = $this->getEntity(EntityBase::class, $values); $this->entityType->hasKey('bundle')->willReturn($has_bundle_key); $this->entityType->getBundleEntityType()->willReturn($bundle_entity_type); $this->entityType->getKey('bundle')->willReturn($bundle_key); @@ -307,7 +308,7 @@ * @covers ::linkTemplates */ public function testToUrlUriCallbackUndefined(array $bundle_info, $uri_callback) { - $entity = $this->getEntity(Entity::class, ['id' => $this->entityId]); + $entity = $this->getEntity(EntityBase::class, ['id' => $this->entityId]); $this->registerBundleInfo($bundle_info); $this->entityType->getUriCallback()->willReturn($uri_callback); @@ -347,7 +348,7 @@ * @dataProvider providerTestToUrlUriCallback */ public function testToUrlUriCallback(array $bundle_info, $uri_callback) { - $entity = $this->getEntity(Entity::class, ['id' => $this->entityId, 'langcode' => $this->langcode]); + $entity = $this->getEntity(EntityBase::class, ['id' => $this->entityId, 'langcode' => $this->langcode]); $this->registerBundleInfo($bundle_info); $this->entityType->getUriCallback()->willReturn($uri_callback); @@ -386,9 +387,12 @@ * @covers ::urlInfo * * @dataProvider providerTestUrlInfo + * + * @group legacy + * @expectedDeprecation EntityInterface::urlInfo() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. EntityInterface::toUrl() instead. See https://www.drupal.org/node/2614344 */ public function testUrlInfo($rel, $options) { - $entity = $this->getEntity(Entity::class, [], ['toUrl']); + $entity = $this->getEntity(EntityBase::class, [], ['toUrl']); $entity->expects($this->once()) ->method('toUrl') ->with($rel, $options); @@ -397,6 +401,30 @@ } /** + * Tests the link() method. + * + * @covers ::urlInfo + * + * @group legacy + * @expectedDeprecation EntityInterface::link() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. EntityInterface::toLink() instead. Note, the default relationship for configuration entities changes from 'edit-form' to 'canonical'. See https://www.drupal.org/node/2614344 + */ + public function testLink() { + + $link = $this->createMock(Link::class); + $link->expects($this->once()) + ->method('toString') + ->willReturn('The link'); + + $entity = $this->getEntity(EntityBase::class, [], ['toLink']); + $entity->expects($this->once()) + ->method('toLink') + ->with(NULL, 'canonical') + ->willReturn($link); + + $this->assertEquals('The link', $entity->link()); + } + + /** * Provides data for testUrlInfo(). * * @return array @@ -423,9 +451,12 @@ * @covers ::linkTemplates * * @dataProvider providerTestUrl + * + * @group legacy + * @expectedDeprecation EntityInterface::url() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. EntityInterface::toUrl() instead. Note, a \Drupal\Core\Url object is returned. See https://www.drupal.org/node/2614344 */ public function testUrlEmpty($rel) { - $entity = $this->getEntity(Entity::class, []); + $entity = $this->getEntity(EntityBase::class, []); $this->assertEquals('', $entity->url($rel)); } @@ -461,9 +492,12 @@ * @covers ::linkTemplates * * @dataProvider providerTestUrl + * + * @group legacy + * @expectedDeprecation EntityInterface::url() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. EntityInterface::toUrl() instead. Note, a \Drupal\Core\Url object is returned. See https://www.drupal.org/node/2614344 */ public function testUrl($rel, $options, $default_options, $expected_options) { - $entity = $this->getEntity(Entity::class, ['id' => $this->entityId], ['toUrl']); + $entity = $this->getEntity(EntityBase::class, ['id' => $this->entityId], ['toUrl']); $this->registerLinkTemplate($rel); $uri = $this->prophesize(Url::class); @@ -506,7 +540,7 @@ * @covers ::uriRelationships */ public function testUriRelationships() { - $entity = $this->getEntity(Entity::class, ['id' => $this->entityId]); + $entity = $this->getEntity(EntityBase::class, ['id' => $this->entityId]); $container_builder = new ContainerBuilder(); $url_generator = $this->createMock(UrlGeneratorInterface::class); @@ -624,4 +658,4 @@ } -abstract class RevisionableEntity extends Entity implements RevisionableInterface {} +abstract class RevisionableEntity extends EntityBase implements RevisionableInterface {} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,390 @@ +fieldType = $this->randomMachineName(); + $this->fieldTypeDefinition = [ + 'id' => $this->fieldType, + 'field_settings' => [ + 'some_instance_setting' => 'value 2', + ], + 'storage_settings' => [ + 'some_storage_setting' => 'some value', + ], + ]; + $field_type_manager = $this->prophesize(FieldTypePluginManagerInterface::class); + $field_type_manager->getDefinitions()->willReturn([$this->fieldType => $this->fieldTypeDefinition]); + $field_type_manager->getDefinition()->willReturn($this->fieldTypeDefinition); + $field_type_manager->getDefaultFieldSettings($this->fieldType)->willReturn($this->fieldTypeDefinition['field_settings']); + $field_type_manager->getDefaultStorageSettings($this->fieldType)->willReturn($this->fieldTypeDefinition['storage_settings']); + + $storage_definition = $this->prophesize(FieldStorageDefinitionInterface::class); + $storage_definition->getMainPropertyName()->willReturn('value'); + $storage_definition->getType()->willReturn($this->fieldType); + $storage_definition->getName()->willReturn('test_field_name'); + $storage_supports_translation = &$this->storageSupportsTranslation; + $storage_definition->isTranslatable()->will(function () use (&$storage_supports_translation) { + return $storage_supports_translation; + }); + $storage_definition->getSettings()->willReturn($this->fieldTypeDefinition['storage_settings']); + $storage_definition->getSetting('some_storage_setting')->willReturn($this->fieldTypeDefinition['storage_settings']['some_storage_setting']); + + $this->storageDefinition = $storage_definition->reveal(); + + $entity_field_manager = $this->prophesize(EntityFieldManagerInterface::class); + $entity_field_manager->getFieldStorageDefinitions('entity_test')->willReturn([ + 'foo' => $storage_definition->reveal(), + ]); + + $typed_data_manager = $this->prophesize(TypedDataManager::class); + + $container = new ContainerBuilder(); + $container->set('plugin.manager.field.field_type', $field_type_manager->reveal()); + $container->set('entity_field.manager', $entity_field_manager->reveal()); + $container->set('typed_data_manager', $typed_data_manager->reveal()); + \Drupal::setContainer($container); + } + + /** + * @covers ::getName + * @dataProvider factoryTypeProvider + */ + public function testFieldName($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $this->assertEquals($this->storageDefinition->getName(), $definition->getName()); + } + + /** + * @covers ::getLabel + * @dataProvider factoryTypeProvider + */ + public function testFieldLabel($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $label = $this->randomMachineName(); + $definition->setLabel($label); + $this->assertEquals($label, $definition->getLabel()); + } + + /** + * @covers ::setTargetBundle + * @covers ::getTargetBundle + * @dataProvider factoryTypeProvider + */ + public function testBundle($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $bundle = $this->randomMachineName(); + $definition->setTargetBundle($bundle); + $this->assertEquals($bundle, $definition->getTargetBundle()); + } + + /** + * @covers ::getDescription + * @dataProvider factoryTypeProvider + */ + public function testFieldDescription($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $description = $this->randomMachineName(); + $definition->setDescription($description); + $this->assertEquals($description, $definition->getDescription()); + } + + /** + * @covers ::getType + * @dataProvider factoryTypeProvider + */ + public function testFieldType($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $this->assertEquals($this->fieldType, $definition->getType()); + } + + /** + * @covers ::getSetting + * @covers ::setSetting + * @covers ::getSettings + * @dataProvider factoryTypeProvider + */ + public function testFieldSettings($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $setting = $this->randomMachineName(); + $value = $this->randomMachineName(); + $definition->setSetting($setting, $value); + $this->assertEquals($value, $definition->getSetting($setting)); + $default_settings = $this->fieldTypeDefinition['field_settings'] + $this->fieldTypeDefinition['storage_settings']; + $this->assertEquals([$setting => $value] + $default_settings, $definition->getSettings()); + } + + /** + * @covers ::getSetting + * @covers ::setSetting + * @covers ::getSettings + * @dataProvider factoryTypeProvider + */ + public function testDefaultFieldSettings($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $expected_settings = $this->fieldTypeDefinition['field_settings'] + $this->fieldTypeDefinition['storage_settings']; + $this->assertEquals($expected_settings, $definition->getSettings()); + foreach ($expected_settings as $setting => $value) { + $this->assertEquals($value, $definition->getSetting($setting)); + } + } + + /** + * @covers ::getDefaultValue + * @covers ::setDefaultValue + * @dataProvider factoryTypeProvider + */ + public function testFieldDefaultValue($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + + $this->assertEquals([], $definition->getDefaultValueLiteral()); + + $default_value = [ + 'value' => $this->randomMachineName(), + ]; + $expected_default_value = [$default_value]; + $definition->setDefaultValue($default_value); + $entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase') + ->disableOriginalConstructor() + ->getMock(); + // Set the field item list class to be used to avoid requiring the typed + // data manager to retrieve it. + $definition->setClass('Drupal\Core\Field\FieldItemList'); + $this->assertEquals($expected_default_value, $definition->getDefaultValue($entity)); + + $data_definition = $this->getMockBuilder('Drupal\Core\TypedData\DataDefinition') + ->disableOriginalConstructor() + ->getMock(); + $data_definition->expects($this->any()) + ->method('getClass') + ->will($this->returnValue('Drupal\Core\Field\FieldItemBase')); + $definition->setItemDefinition($data_definition); + + // Set default value only with a literal. + $definition->setDefaultValue($default_value['value']); + $this->assertEquals($expected_default_value, $definition->getDefaultValue($entity)); + + // Set default value with an indexed array. + $definition->setDefaultValue($expected_default_value); + $this->assertEquals($expected_default_value, $definition->getDefaultValue($entity)); + + // Set default value with an empty array. + $definition->setDefaultValue([]); + $this->assertEquals([], $definition->getDefaultValue($entity)); + + // Set default value with NULL. + $definition->setDefaultValue(NULL); + $this->assertEquals([], $definition->getDefaultValue($entity)); + } + + /** + * Tests field translatable methods. + * + * @covers ::isTranslatable + * @covers ::setTranslatable + * @dataProvider factoryTypeProvider + */ + public function testFieldTranslatable($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $this->assertFalse($definition->isTranslatable()); + $definition->setTranslatable(TRUE); + $this->assertTrue($definition->isTranslatable()); + $definition->setTranslatable(FALSE); + $this->assertFalse($definition->isTranslatable()); + + $this->storageSupportsTranslation = FALSE; + $definition->setTranslatable(TRUE); + $this->assertFalse($this->storageDefinition->isTranslatable()); + $this->assertFalse($definition->isTranslatable()); + } + + /** + * Tests required. + * + * @covers ::isRequired + * @covers ::setRequired + * @dataProvider factoryTypeProvider + */ + public function testFieldRequired($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $this->assertFalse($definition->isRequired()); + $definition->setRequired(TRUE); + $this->assertTrue($definition->isRequired()); + $definition->setRequired(FALSE); + $this->assertFalse($definition->isRequired()); + } + + /** + * Tests default value callbacks. + * + * @covers ::setDefaultValueCallback + * @dataProvider factoryTypeProvider + */ + public function testDefaultValueCallback($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $callback = get_class($this) . '::mockDefaultValueCallback'; + // setDefaultValueCallback returns $this. + $this->assertSame($definition, $definition->setDefaultValueCallback($callback)); + $this->assertSame($callback, $definition->getDefaultValueCallback()); + } + + /** + * Tests invalid default value callbacks. + * + * @covers ::setDefaultValueCallback + * @dataProvider factoryTypeProvider + */ + public function testInvalidDefaultValueCallback($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + // setDefaultValueCallback returns $this. + $this->setExpectedException(\InvalidArgumentException::class); + $definition->setDefaultValueCallback([get_class($this), 'mockDefaultValueCallback']); + } + + /** + * Tests NULL default value callbacks. + * + * @covers ::setDefaultValueCallback + * @dataProvider factoryTypeProvider + */ + public function testNullDefaultValueCallback($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + // setDefaultValueCallback returns $this. + $this->assertSame($definition, $definition->setDefaultValueCallback(NULL)); + $this->assertSame(NULL, $definition->getDefaultValueCallback()); + } + + /** + * Tests the display configuration settings. + * + * @covers ::isDisplayConfigurable + * @covers ::getDisplayOptions + * @dataProvider factoryTypeProvider + */ + public function testDisplayConfigurationSettings($factory_name) { + $definition = $this->initializeFieldUsingFactory($factory_name); + $this->assertEquals(FALSE, $definition->isDisplayConfigurable('foo')); + $this->assertEquals(NULL, $definition->getDisplayOptions('foo')); + + $definition->setDisplayConfigurable('foo', TRUE); + $this->assertEquals(TRUE, $definition->isDisplayConfigurable('foo')); + $this->assertEquals(['region' => 'hidden'], $definition->getDisplayOptions('foo')); + + $definition->setDisplayOptions('foo', ['foo' => 'bar']); + $this->assertEquals(['foo' => 'bar'], $definition->getDisplayOptions('foo')); + } + + /** + * Provides a Mock base field default value callback. + * + * @param \Drupal\Core\Entity\EntityInterface $entity + * Entity interface. + * @param \Drupal\Core\Field\FieldDefinitionInterface $definition + * Field definition. + * + * @return string + * Default value. + */ + public static function mockDefaultValueCallback($entity, $definition) { + return 'a default value'; + } + + /** + * A data provider for all the types of factories that can create definitions. + */ + public function factoryTypeProvider() { + return [ + '::createFromFieldStorageDefinition factory' => [ + 'createFromFieldStorageDefinition', + ], + '::create factory' => [ + 'create', + ], + '::createFromDataType factory' => [ + 'createFromDataType', + ], + '::createFromItemType factory' => [ + 'createFromItemType', + ], + ]; + } + + /** + * Creates a bundle field using a specified factory. + * + * @param string $factory_name + * The factory name to use. + * + * @return \Drupal\Core\Field\FieldDefinition + */ + protected function initializeFieldUsingFactory($factory_name) { + switch ($factory_name) { + case 'createFromFieldStorageDefinition': + return FieldDefinition::createFromFieldStorageDefinition($this->storageDefinition); + + case 'create': + $definition = FieldDefinition::create($this->fieldType); + $definition->setFieldStorageDefinition($this->storageDefinition); + return $definition; + + case 'createFromDataType': + $definition = FieldDefinition::createFromDataType($this->fieldType); + $definition->setFieldStorageDefinition($this->storageDefinition); + return $definition; + + case 'createFromItemType': + $definition = FieldDefinition::createFromItemType($this->fieldType); + $definition->setFieldStorageDefinition($this->storageDefinition); + return $definition; + } + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php --- a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -217,7 +217,7 @@ * @return \Drupal\Core\Entity\EntityInterface */ public function testCreate() { - $entity = $this->getMockEntity('Drupal\Core\Entity\Entity', [], ['toArray']); + $entity = $this->getMockEntity('Drupal\Core\Entity\EntityBase', [], ['toArray']); $this->entityType->expects($this->once()) ->method('getClass') ->will($this->returnValue(get_class($entity))); @@ -490,7 +490,7 @@ public function testSaveDuplicate() { $this->setUpKeyValueEntityStorage(); - $entity = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'foo']]); + $entity = $this->getMockEntity('Drupal\Core\Entity\EntityBase', [['id' => 'foo']]); $entity->enforceIsNew(); $this->keyValueStore->expects($this->once()) ->method('has') @@ -556,8 +556,8 @@ * @covers ::doLoadMultiple */ public function testLoadMultipleAll() { - $expected['foo'] = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'foo']]); - $expected['bar'] = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'bar']]); + $expected['foo'] = $this->getMockEntity('Drupal\Core\Entity\EntityBase', [['id' => 'foo']]); + $expected['bar'] = $this->getMockEntity('Drupal\Core\Entity\EntityBase', [['id' => 'bar']]); $this->entityType->expects($this->once()) ->method('getClass') ->will($this->returnValue(get_class(reset($expected)))); @@ -589,7 +589,7 @@ * @covers ::doLoadMultiple */ public function testLoadMultipleIds() { - $entity = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'foo']]); + $entity = $this->getMockEntity('Drupal\Core\Entity\EntityBase', [['id' => 'foo']]); $this->entityType->expects($this->once()) ->method('getClass') ->will($this->returnValue(get_class($entity))); @@ -638,8 +638,8 @@ * @covers ::doDelete */ public function testDelete() { - $entities['foo'] = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'foo']]); - $entities['bar'] = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'bar']]); + $entities['foo'] = $this->getMockEntity('Drupal\Core\Entity\EntityBase', [['id' => 'foo']]); + $entities['bar'] = $this->getMockEntity('Drupal\Core\Entity\EntityBase', [['id' => 'bar']]); $this->entityType->expects($this->once()) ->method('getClass') ->will($this->returnValue(get_class(reset($entities)))); @@ -698,7 +698,7 @@ * * @param string $class * (optional) The concrete entity class to mock. Defaults to - * 'Drupal\Core\Entity\Entity'. + * 'Drupal\Core\Entity\EntityBase'. * @param array $arguments * (optional) Arguments to pass to the constructor. An empty set of values * and an entity type ID will be provided. @@ -707,7 +707,7 @@ * * @return \Drupal\Core\Entity\EntityInterface|\PHPUnit_Framework_MockObject_MockObject */ - public function getMockEntity($class = 'Drupal\Core\Entity\Entity', array $arguments = [], $methods = []) { + public function getMockEntity($class = 'Drupal\Core\Entity\EntityBase', array $arguments = [], $methods = []) { // Ensure the entity is passed at least an array of values and an entity // type ID if (!isset($arguments[0])) { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php --- a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php Thu May 09 15:33:08 2019 +0100 @@ -218,7 +218,7 @@ $entity_type1->hasLinkTemplate('canonical')->willReturn(FALSE); $data['no_canonical_link_template'] = [NULL, $entity_type1->reveal()]; - $entity_type2 = $this->getEntityType();; + $entity_type2 = $this->getEntityType(); $entity_type2->hasLinkTemplate('canonical')->willReturn(TRUE); $entity_type2->hasViewBuilderClass()->willReturn(FALSE); $data['no_view_builder'] = [NULL, $entity_type2->reveal()]; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php --- a/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,7 @@ use Drupal\Core\Entity\Sql\DefaultTableMapping; use Drupal\Core\Entity\Sql\SqlContentEntityStorageException; +use Drupal\Core\Entity\Sql\TemporaryTableMapping; use Drupal\Tests\UnitTestCase; /** @@ -445,6 +446,142 @@ } /** + * @covers ::getDedicatedDataTableName + * @covers ::getDedicatedRevisionTableName + * + * @dataProvider providerTestGetDedicatedTableName + */ + public function testGetDedicatedTableName($info, $expected_data_table, $expected_revision_table) { + $entity_type_id = $info['entity_type_id']; + $field_name = $info['field_name']; + + $definition = $this->setUpDefinition($field_name, []); + $definition->expects($this->any()) + ->method('getTargetEntityTypeId') + ->will($this->returnValue($entity_type_id)); + $definition->expects($this->any()) + ->method('getUniqueStorageIdentifier') + ->will($this->returnValue($entity_type_id . '-' . $field_name)); + + $this->entityType + ->expects($this->any()) + ->method('getBaseTable') + ->willReturn($info['entity_type_id']); + $this->entityType + ->expects($this->any()) + ->method('isTranslatable') + ->willReturn(FALSE); + $this->entityType + ->expects($this->any()) + ->method('isRevisionable') + ->willReturn(FALSE); + + $table_mapping = new DefaultTableMapping($this->entityType, [], $info['prefix']); + + $this->assertSame($expected_data_table, $table_mapping->getDedicatedDataTableName($definition)); + $this->assertSame($expected_revision_table, $table_mapping->getDedicatedRevisionTableName($definition)); + } + + /** + * Provides test data for testGetDedicatedTableName(). + * + * @return array[] + * A nested array where each inner array has the following values: an array + * consisting of the entity type ID, field name and a table prefix, followed + * by the expected data table name and the revision table name. + */ + public function providerTestGetDedicatedTableName() { + $data = []; + + $data['short entity type; short field name; no prefix'] = [ + [ + 'entity_type_id' => 'short_entity_type', + 'field_name' => 'short_field_name', + 'prefix' => '', + ], + 'short_entity_type__short_field_name', + 'short_entity_type_revision__short_field_name', + ]; + $data['short entity type; long field name; no prefix'] = [ + [ + 'entity_type_id' => 'short_entity_type', + 'field_name' => 'long_field_name_abcdefghijklmnopqrstuvwxyz', + 'prefix' => '', + ], + 'short_entity_type__28a01c7777', + 'short_entity_type_r__28a01c7777', + ]; + $data['long entity type; short field name; no prefix'] = [ + [ + 'entity_type_id' => 'long_entity_type_abcdefghijklmnopqrstuvwxyz', + 'field_name' => 'short_field_name', + 'prefix' => '', + ], + 'long_entity_type_abcdefghijklmno__a526e4e042', + 'long_entity_type_abcdefghijklmno_r__a526e4e042', + ]; + $data['long entity type; long field name; no prefix'] = [ + [ + 'entity_type_id' => 'long_entity_type_abcdefghijklmnopqrstuvwxyz', + 'field_name' => 'long_field_name_abcdefghijklmnopqrstuvwxyz', + 'prefix' => '', + ], + 'long_entity_type_abcdefghijklmno__7705d52d75', + 'long_entity_type_abcdefghijklmno_r__7705d52d75', + ]; + + $data['short entity type; short field name; with prefix'] = [ + [ + 'entity_type_id' => 'short_entity_type', + 'field_name' => 'short_field_name', + 'prefix' => 'prefix_', + ], + 'prefix_short_entity_type__short_field_name', + 'prefix_short_entity_type_r__a133cc765a', + ]; + $data['short entity type; long field name; with prefix'] = [ + [ + 'entity_type_id' => 'short_entity_type', + 'field_name' => 'long_field_name_abcdefghijklmnopqrstuvwxyz', + 'prefix' => 'prefix_', + ], + 'prefix_short_entity_type__28a01c7777', + 'prefix_short_entity_type_r__28a01c7777', + ]; + $data['long entity type; short field name; with prefix'] = [ + [ + 'entity_type_id' => 'long_entity_type_abcdefghijklmnopqrstuvwxyz', + 'field_name' => 'short_field_name', + 'prefix' => 'prefix_', + ], + 'prefix___a526e4e042', + 'prefix__r__a526e4e042', + ]; + $data['long entity type; long field name; with prefix'] = [ + [ + 'entity_type_id' => 'long_entity_type_abcdefghijklmnopqrstuvwxyz', + 'field_name' => 'long_field_name_abcdefghijklmnopqrstuvwxyz', + 'prefix' => 'prefix_', + ], + 'prefix___7705d52d75', + 'prefix__r__7705d52d75', + ]; + + return $data; + } + + /** + * @coversDefaultClass \Drupal\Core\Entity\Sql\TemporaryTableMapping + * + * @expectedDeprecation Drupal\Core\Entity\Sql\TemporaryTableMapping is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use the default table mapping with a prefix instead. + * @group legacy + */ + public function testTemporaryTableMapping() { + $table_mapping = new TemporaryTableMapping($this->entityType, [], ''); + $this->assertTrue($table_mapping instanceof DefaultTableMapping); + } + + /** * Sets up a field storage definition for the test. * * @param string $name diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php --- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,9 @@ use Drupal\Core\Entity\ContentEntityType; use Drupal\Core\Entity\ContentEntityTypeInterface; +use Drupal\Core\Entity\EntityFieldManager; +use Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface; +use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Entity\Sql\DefaultTableMapping; use Drupal\Tests\UnitTestCase; @@ -21,11 +24,25 @@ protected $dbSchemaHandler; /** - * The mocked entity manager used in this test. + * The mocked entity type manager used in this test. * - * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $entityManager; + protected $entityTypeManager; + + /** + * The mocked entity field manager used in this test. + * + * @var \Drupal\Core\Entity\EntityFieldManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $entityFieldManager; + + /** + * The mocked entity last installed schema repository used in this test. + * + * @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $entityLastInstalledSchemaRepository; /** * The mocked entity type used in this test. @@ -59,7 +76,9 @@ * {@inheritdoc} */ protected function setUp() { - $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); + $this->entityTypeManager = $this->createMock(EntityTypeManager::class); + $this->entityFieldManager = $this->createMock(EntityFieldManager::class); + $this->entityLastInstalledSchemaRepository = $this->createMock(EntityLastInstalledSchemaRepositoryInterface::class); $this->storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage') ->disableOriginalConstructor() ->getMock(); @@ -367,12 +386,9 @@ $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions)); $table_mapping->setExtraColumns('entity_test', ['default_langcode']); - $this->storage->expects($this->any()) + $this->storageSchema->expects($this->any()) ->method('getTableMapping') ->will($this->returnValue($table_mapping)); - $this->storage->expects($this->any()) - ->method('getCustomTableMapping') - ->will($this->returnValue($table_mapping)); $this->assertNull( $this->storageSchema->onEntityTypeCreate($this->entityType) @@ -409,7 +425,7 @@ ->method('getRevisionMetadataKeys') ->will($this->returnValue([])); - $this->storage->expects($this->exactly(2)) + $this->storage->expects($this->exactly(1)) ->method('getRevisionTable') ->will($this->returnValue('entity_test_revision')); @@ -478,12 +494,9 @@ $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions)); $table_mapping->setFieldNames('entity_test_revision', array_keys($this->storageDefinitions)); - $this->storage->expects($this->any()) + $this->storageSchema->expects($this->any()) ->method('getTableMapping') ->will($this->returnValue($table_mapping)); - $this->storage->expects($this->any()) - ->method('getCustomTableMapping') - ->will($this->returnValue($table_mapping)); $this->storageSchema->onEntityTypeCreate($this->entityType); } @@ -505,6 +518,7 @@ 'id' => 'id', 'langcode' => 'langcode', ], + 'translatable' => TRUE, ]); $this->storage->expects($this->any()) @@ -589,12 +603,9 @@ $table_mapping->setFieldNames('entity_test', $non_data_fields); $table_mapping->setFieldNames('entity_test_field_data', array_keys($this->storageDefinitions)); - $this->storage->expects($this->any()) + $this->storageSchema->expects($this->any()) ->method('getTableMapping') ->will($this->returnValue($table_mapping)); - $this->storage->expects($this->any()) - ->method('getCustomTableMapping') - ->will($this->returnValue($table_mapping)); $this->assertNull( $this->storageSchema->onEntityTypeCreate($this->entityType) @@ -622,24 +633,22 @@ 'revision' => 'revision_id', 'langcode' => 'langcode', ], + 'revision_data_table' => 'entity_test_revision_field_data', ], ]) - ->setMethods(['getRevisionMetadataKeys']) + ->setMethods(['isRevisionable', 'isTranslatable', 'getRevisionMetadataKeys']) ->getMock(); $this->entityType->expects($this->any()) - ->method('getRevisionMetadataKeys') - ->will($this->returnValue([])); + ->method('isRevisionable') + ->will($this->returnValue(TRUE)); + $this->entityType->expects($this->any()) + ->method('isTranslatable') + ->will($this->returnValue(TRUE)); - $this->storage->expects($this->exactly(3)) + $this->storage->expects($this->exactly(2)) ->method('getRevisionTable') ->will($this->returnValue('entity_test_revision')); - $this->storage->expects($this->once()) - ->method('getDataTable') - ->will($this->returnValue('entity_test_field_data')); - $this->storage->expects($this->once()) - ->method('getRevisionDataTable') - ->will($this->returnValue('entity_test_revision_field_data')); $this->setUpStorageDefinition('revision_id', [ 'columns' => [ @@ -812,12 +821,9 @@ $table_mapping->setFieldNames('entity_test_field_data', array_keys($this->storageDefinitions)); $table_mapping->setFieldNames('entity_test_revision_field_data', array_keys($this->storageDefinitions)); - $this->storage->expects($this->any()) + $this->storageSchema->expects($this->any()) ->method('getTableMapping') ->will($this->returnValue($table_mapping)); - $this->storage->expects($this->any()) - ->method('getCustomTableMapping') - ->will($this->returnValue($table_mapping)); $this->storageSchema->onEntityTypeCreate($this->entityType); } @@ -990,7 +996,7 @@ $table_mapping->setFieldNames($entity_type_id, array_keys($this->storageDefinitions)); $table_mapping->setExtraColumns($entity_type_id, ['default_langcode']); - $this->storage->expects($this->any()) + $this->storageSchema->expects($this->any()) ->method('getTableMapping') ->will($this->returnValue($table_mapping)); @@ -1135,7 +1141,7 @@ $table_mapping->setFieldNames($entity_type_id, array_keys($this->storageDefinitions)); $table_mapping->setExtraColumns($entity_type_id, ['default_langcode']); - $this->storage->expects($this->any()) + $this->storageSchema->expects($this->any()) ->method('getTableMapping') ->will($this->returnValue($table_mapping)); @@ -1197,28 +1203,25 @@ 'entity_keys' => ['id' => 'id'], ]); - $original_storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage') - ->disableOriginalConstructor() - ->getMock(); - - $original_storage->expects($this->exactly(is_null($original_storage_has_data) || !$shared_table_structure_changed ? 0 : 1)) + $this->storage->expects($this->exactly(is_null($original_storage_has_data) || !$shared_table_structure_changed ? 0 : 1)) ->method('hasData') ->willReturn($original_storage_has_data); - // Assert hasData() is never called on the new storage definition. - $this->storage->expects($this->never()) - ->method('hasData'); - $connection = $this->getMockBuilder('Drupal\Core\Database\Connection') ->disableOriginalConstructor() ->getMock(); - $this->entityManager->expects($this->any()) - ->method('createHandlerInstance') - ->willReturn($original_storage); + $this->entityLastInstalledSchemaRepository + ->expects($this->any()) + ->method('getLastInstalledDefinition') + ->willReturn($this->entityType); + $this->entityLastInstalledSchemaRepository + ->expects($this->any()) + ->method('getLastInstalledFieldStorageDefinitions') + ->willReturn($this->storageDefinitions); $this->storageSchema = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema') - ->setConstructorArgs([$this->entityManager, $this->entityType, $this->storage, $connection]) + ->setConstructorArgs([$this->entityTypeManager, $this->entityType, $this->storage, $connection, $this->entityFieldManager, $this->entityLastInstalledSchemaRepository]) ->setMethods(['installedStorageSchema', 'hasSharedTableStructureChange']) ->getMock(); @@ -1312,12 +1315,9 @@ $table_mapping = new DefaultTableMapping($this->entityType, $this->storageDefinitions); $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions)); $table_mapping->setExtraColumns('entity_test', ['default_langcode']); - $this->storage->expects($this->any()) + $this->storageSchema->expects($this->any()) ->method('getTableMapping') ->will($this->returnValue($table_mapping)); - $this->storage->expects($this->any()) - ->method('getCustomTableMapping') - ->will($this->returnValue($table_mapping)); // Setup storage schema. if ($change_schema) { @@ -1355,16 +1355,26 @@ * be created. Defaults to expecting nothing. */ protected function setUpStorageSchema(array $expected = []) { - $this->entityManager->expects($this->any()) + $this->entityTypeManager->expects($this->any()) ->method('getDefinition') ->with($this->entityType->id()) ->will($this->returnValue($this->entityType)); - $this->entityManager->expects($this->any()) + $this->entityTypeManager->expects($this->any()) + ->method('getActiveDefinition') + ->with($this->entityType->id()) + ->will($this->returnValue($this->entityType)); + + $this->entityFieldManager->expects($this->any()) ->method('getFieldStorageDefinitions') ->with($this->entityType->id()) ->will($this->returnValue($this->storageDefinitions)); + $this->entityFieldManager->expects($this->any()) + ->method('getActiveFieldStorageDefinitions') + ->with($this->entityType->id()) + ->will($this->returnValue($this->storageDefinitions)); + $this->dbSchemaHandler = $this->getMockBuilder('Drupal\Core\Database\Schema') ->disableOriginalConstructor() ->getMock(); @@ -1397,9 +1407,19 @@ ->will($this->returnValue($this->dbSchemaHandler)); $key_value = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreInterface'); + + $this->entityLastInstalledSchemaRepository + ->expects($this->any()) + ->method('getLastInstalledDefinition') + ->willReturn($this->entityType); + $this->entityLastInstalledSchemaRepository + ->expects($this->any()) + ->method('getLastInstalledFieldStorageDefinitions') + ->willReturn($this->storageDefinitions); + $this->storageSchema = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema') - ->setConstructorArgs([$this->entityManager, $this->entityType, $this->storage, $connection]) - ->setMethods(['installedStorageSchema', 'loadEntitySchemaData', 'hasSharedTableNameChanges', 'isTableEmpty']) + ->setConstructorArgs([$this->entityTypeManager, $this->entityType, $this->storage, $connection, $this->entityFieldManager, $this->entityLastInstalledSchemaRepository]) + ->setMethods(['installedStorageSchema', 'loadEntitySchemaData', 'hasSharedTableNameChanges', 'isTableEmpty', 'getTableMapping']) ->getMock(); $this->storageSchema ->expects($this->any()) @@ -1499,12 +1519,9 @@ $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions)); $table_mapping->setExtraColumns('entity_test', ['default_langcode']); - $this->storage->expects($this->any()) + $this->storageSchema->expects($this->any()) ->method('getTableMapping') ->will($this->returnValue($table_mapping)); - $this->storage->expects($this->any()) - ->method('getCustomTableMapping') - ->will($this->returnValue($table_mapping)); $this->storageSchema->expects($this->any()) ->method('loadEntitySchemaData') diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php --- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php Thu May 09 15:33:08 2019 +0100 @@ -9,17 +9,17 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\MemoryCache\MemoryCache; -use Drupal\Core\Entity\EntityFieldManagerInterface; +use Drupal\Core\DependencyInjection\ContainerBuilder; +use Drupal\Core\Entity\EntityFieldManager; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Entity\EntityTypeBundleInfoInterface; +use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Entity\Query\QueryFactoryInterface; use Drupal\Core\Entity\Sql\DefaultTableMapping; use Drupal\Core\Entity\Sql\SqlContentEntityStorage; use Drupal\Core\Language\Language; use Drupal\Tests\UnitTestCase; -use Symfony\Component\DependencyInjection\ContainerBuilder; /** * @coversDefaultClass \Drupal\Core\Entity\Sql\SqlContentEntityStorage @@ -49,13 +49,6 @@ protected $fieldDefinitions = []; /** - * The mocked entity manager used in this test. - * - * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $entityManager; - - /** * The mocked entity type manager used in this test. * * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject @@ -63,6 +56,13 @@ protected $entityTypeManager; /** + * The mocked entity type bundle info used in this test. + * + * @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $entityTypeBundleInfo; + + /** * The mocked entity field manager used in this test. * * @var \Drupal\Core\Entity\EntityFieldManagerInterface|\PHPUnit_Framework_MockObject_MockObject @@ -123,12 +123,9 @@ $this->container = new ContainerBuilder(); \Drupal::setContainer($this->container); - $this->entityManager = new EntityManager(); - // Inject the container into entity.manager so it can defer to - // entity_type.manager and other services. - $this->entityManager->setContainer($this->container); - $this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class); - $this->entityFieldManager = $this->getMock(EntityFieldManagerInterface::class); + $this->entityTypeManager = $this->createMock(EntityTypeManager::class); + $this->entityTypeBundleInfo = $this->createMock(EntityTypeBundleInfoInterface::class); + $this->entityFieldManager = $this->createMock(EntityFieldManager::class); $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface'); $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface'); @@ -139,7 +136,6 @@ ->disableOriginalConstructor() ->getMock(); - $this->container->set('entity.manager', $this->entityManager); $this->container->set('entity_type.manager', $this->entityTypeManager); $this->container->set('entity_field.manager', $this->entityFieldManager); } @@ -433,13 +429,13 @@ ->will($this->returnValue($schema_handler)); $storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage') - ->setConstructorArgs([$this->entityType, $this->connection, $this->entityManager, $this->cache, $this->languageManager, new MemoryCache()]) + ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager, $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager]) ->setMethods(['getStorageSchema']) ->getMock(); $key_value = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreInterface'); $schema_handler = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema') - ->setConstructorArgs([$this->entityManager, $this->entityType, $storage, $this->connection]) + ->setConstructorArgs([$this->entityTypeManager, $this->entityType, $storage, $this->connection, $this->entityFieldManager]) ->setMethods(['installedStorageSchema', 'createSharedTableSchema']) ->getMock(); $schema_handler @@ -870,6 +866,8 @@ ->method('getRevisionMetadataKeys') ->will($this->returnValue($revision_metadata_keys)); + $this->fieldDefinitions = $this->mockFieldDefinitions(array_values($revision_metadata_keys), ['isRevisionable' => TRUE]); + $this->setUpEntityStorage(); $mapping = $this->entityStorage->getTableMapping(); @@ -1075,9 +1073,6 @@ ->method('getCurrentLanguage') ->will($this->returnValue($language)); - $this->container->set('language_manager', $language_manager); - $this->container->set('module_handler', $this->moduleHandler); - $entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase') ->disableOriginalConstructor() ->setMethods(['id']) @@ -1170,15 +1165,20 @@ ->method('getDefinition') ->will($this->returnValue($this->entityType)); + $this->entityTypeManager->expects($this->any()) + ->method('getActiveDefinition') + ->will($this->returnValue($this->entityType)); + $this->entityFieldManager->expects($this->any()) ->method('getFieldStorageDefinitions') ->will($this->returnValue($this->fieldDefinitions)); $this->entityFieldManager->expects($this->any()) - ->method('getBaseFieldDefinitions') + ->method('getActiveFieldStorageDefinitions') ->will($this->returnValue($this->fieldDefinitions)); - $this->entityStorage = new SqlContentEntityStorage($this->entityType, $this->connection, $this->entityManager, $this->cache, $this->languageManager, new MemoryCache()); + $this->entityStorage = new SqlContentEntityStorage($this->entityType, $this->connection, $this->entityFieldManager, $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager); + $this->entityStorage->setModuleHandler($this->moduleHandler); } /** @@ -1252,8 +1252,12 @@ $this->cache->expects($this->never()) ->method('set'); + $this->entityTypeManager->expects($this->any()) + ->method('getActiveDefinition') + ->will($this->returnValue($this->entityType)); + $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage') - ->setConstructorArgs([$this->entityType, $this->connection, $this->entityManager, $this->cache, $this->languageManager, new MemoryCache()]) + ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager, $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager]) ->setMethods(['getFromStorage', 'invokeStorageLoadHook', 'initTableLayout']) ->getMock(); $entity_storage->method('invokeStorageLoadHook') @@ -1306,8 +1310,12 @@ ->method('set') ->with($key, $entity, CacheBackendInterface::CACHE_PERMANENT, [$this->entityTypeId . '_values', 'entity_field_info']); + $this->entityTypeManager->expects($this->any()) + ->method('getActiveDefinition') + ->will($this->returnValue($this->entityType)); + $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage') - ->setConstructorArgs([$this->entityType, $this->connection, $this->entityManager, $this->cache, $this->languageManager, new MemoryCache()]) + ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager, $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager]) ->setMethods(['getFromStorage', 'invokeStorageLoadHook', 'initTableLayout']) ->getMock(); $entity_storage->method('invokeStorageLoadHook') @@ -1356,15 +1364,19 @@ ->method('getDefinition') ->will($this->returnValue($this->entityType)); + $this->entityTypeManager->expects($this->any()) + ->method('getActiveDefinition') + ->will($this->returnValue($this->entityType)); + $this->entityFieldManager->expects($this->any()) ->method('getFieldStorageDefinitions') ->will($this->returnValue($this->fieldDefinitions)); $this->entityFieldManager->expects($this->any()) - ->method('getBaseFieldDefinitions') + ->method('getActiveFieldStorageDefinitions') ->will($this->returnValue($this->fieldDefinitions)); - $this->entityStorage = new SqlContentEntityStorage($this->entityType, $database, $this->entityManager, $this->cache, $this->languageManager, new MemoryCache()); + $this->entityStorage = new SqlContentEntityStorage($this->entityType, $database, $this->entityFieldManager, $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager); $result = $this->entityStorage->hasData(); @@ -1441,6 +1453,18 @@ } /** + * @covers ::getFieldStorageDefinitions + * + * @expectedDeprecation SqlContentEntityStorage::getFieldStorageDefinitions() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getActiveFieldStorageDefinitions() instead. See https://www.drupal.org/node/3040966. + * + * @group legacy + */ + public function testGetFieldStorageDefinitions() { + $this->setUpEntityStorage(); + $this->entityStorage->getFieldStorageDefinitions(); + } + + /** * Sets up the module handler with no implementations. */ protected function setUpModuleHandlerNoImplementations() { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php --- a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -285,6 +285,13 @@ } /** + * @covers ::getEntity + */ + public function testGetEntity() { + $this->assertSame($this->entity, $this->entityAdapter->getEntity()); + } + + /** * @covers ::setValue */ public function testSetValue() { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php --- a/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php Thu May 09 15:33:08 2019 +0100 @@ -14,6 +14,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\Routing\RequestContext; /** @@ -138,7 +139,7 @@ return new HtmlResponse($request->getMethod()); })); - $event = new GetResponseForExceptionEvent($this->kernel, $request, 'foo', new NotFoundHttpException('foo')); + $event = new GetResponseForExceptionEvent($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, new NotFoundHttpException('foo')); $this->customPageSubscriber->onException($event); @@ -165,7 +166,7 @@ return new Response($request->getMethod() . ' ' . UrlHelper::buildQuery($request->query->all())); })); - $event = new GetResponseForExceptionEvent($this->kernel, $request, 'foo', new NotFoundHttpException('foo')); + $event = new GetResponseForExceptionEvent($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, new NotFoundHttpException('foo')); $this->customPageSubscriber->onException($event); $response = $event->getResponse(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php --- a/core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php Thu May 09 15:33:08 2019 +0100 @@ -27,7 +27,7 @@ public function testOn4xx(HttpExceptionInterface $exception, $expected_response_class) { $kernel = $this->prophesize(HttpKernelInterface::class); $request = Request::create('/test'); - $event = new GetResponseForExceptionEvent($kernel->reveal(), $request, 'GET', $exception); + $event = new GetResponseForExceptionEvent($kernel->reveal(), $request, HttpKernelInterface::MASTER_REQUEST, $exception); $subscriber = new ExceptionJsonSubscriber(); $subscriber->on4xx($event); $response = $event->getResponse(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php --- a/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php Thu May 09 15:33:08 2019 +0100 @@ -28,7 +28,7 @@ // of this so we'll hard code it here. $request->setRequestFormat('bananas'); $e = new MethodNotAllowedHttpException(['POST', 'PUT'], 'test message'); - $event = new GetResponseForExceptionEvent($kernel->reveal(), $request, 'GET', $e); + $event = new GetResponseForExceptionEvent($kernel->reveal(), $request, HttpKernelInterface::MASTER_REQUEST, $e); $subscriber = new TestDefaultExceptionSubscriber($config_factory); $subscriber->setStringTranslation($this->getStringTranslationStub()); $subscriber->onException($event); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Extension/DependencyTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Extension/DependencyTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,119 @@ +assertSame($expected_name, $dependency->getName()); + $this->assertSame($expected_project, $dependency->getProject()); + $this->assertSame($expected_constraint, $dependency->getConstraintString()); + } + + /** + * Data provider for testCreateFromString. + */ + public function providerCreateFromString() { + $tests = []; + $tests['module_name_only'] = ['views', 'views', '', '']; + $tests['module_and_project_names'] = ['drupal:views', 'views', 'drupal', '']; + $tests['module_and_constraint'] = ['views (<8.x-3.1)', 'views', '', '<8.x-3.1']; + $tests['module_and_project_names_and_constraint'] = ['drupal:views (>8.x-1.1)', 'views', 'drupal', '>8.x-1.1']; + return $tests; + } + + /** + * @covers ::isCompatible + */ + public function testIsCompatible() { + $dependency = new Dependency('paragraphs_demo', 'paragraphs', '>8.x-1.1'); + $this->assertFalse($dependency->isCompatible('1.1')); + $this->assertTrue($dependency->isCompatible('1.2')); + } + + /** + * @covers ::offsetExists + * @group legacy + * @expectedDeprecation Array access to Drupal\Core\Extension\Dependency properties is deprecated. Use accessor methods instead. See https://www.drupal.org/node/2756875 + */ + public function testOffsetTest() { + $dependency = new Dependency('views', 'drupal', '>8.x-1.1'); + $this->assertTrue(isset($dependency['name'])); + $this->assertFalse(isset($dependency['foo'])); + } + + /** + * @covers ::offsetGet + * @group legacy + * @expectedDeprecation Array access to the Drupal\Core\Extension\Dependency name property is deprecated. Use Drupal\Core\Extension\Dependency::getName() instead. See https://www.drupal.org/node/2756875 + * @expectedDeprecation Array access to the Drupal\Core\Extension\Dependency project property is deprecated. Use Drupal\Core\Extension\Dependency::getProject() instead. See https://www.drupal.org/node/2756875 + * @expectedDeprecation Array access to the Drupal\Core\Extension\Dependency original_version property is deprecated. Use Drupal\Core\Extension\Dependency::getConstraintString() instead. See https://www.drupal.org/node/2756875 + * @expectedDeprecation Array access to the Drupal\Core\Extension\Dependency versions property is deprecated. See https://www.drupal.org/node/2756875 + */ + public function testOffsetGet() { + $dependency = new Dependency('views', 'drupal', '>8.x-1.1'); + $this->assertSame('views', $dependency['name']); + $this->assertSame('drupal', $dependency['project']); + $this->assertSame(' (>8.x-1.1)', $dependency['original_version']); + $this->assertSame([['op' => '>', 'version' => '1.1']], $dependency['versions']); + } + + /** + * @covers ::offsetGet + * @group legacy + */ + public function testOffsetGetException() { + $dependency = new Dependency('views', 'drupal', '>8.x-1.1'); + $this->setExpectedException(\InvalidArgumentException::class, 'The does_not_exist key is not supported'); + $dependency['does_not_exist']; + } + + /** + * @covers ::offsetUnset + * @group legacy + */ + public function testOffsetUnset() { + $dependency = new Dependency('views', 'drupal', '>8.x-1.1'); + $this->setExpectedException(\BadMethodCallException::class, 'Drupal\Core\Extension\Dependency::offsetUnset() is not supported'); + unset($dependency['name']); + } + + /** + * @covers ::offsetSet + * @group legacy + */ + public function testOffsetSet() { + $dependency = new Dependency('views', 'drupal', '>8.x-1.1'); + $this->setExpectedException(\BadMethodCallException::class, 'Drupal\Core\Extension\Dependency::offsetSet() is not supported'); + $dependency['name'] = 'foo'; + } + + /** + * Ensures that constraint objects are not serialized. + * + * @covers ::__sleep + */ + public function testSerialization() { + $dependency = new Dependency('paragraphs_demo', 'paragraphs', '>8.x-1.1'); + $this->assertTrue($dependency->isCompatible('1.2')); + $this->assertInstanceOf(Constraint::class, $this->getObjectAttribute($dependency, 'constraint')); + $dependency = unserialize(serialize($dependency)); + $this->assertNull($this->getObjectAttribute($dependency, 'constraint')); + $this->assertTrue($dependency->isCompatible('1.2')); + $this->assertInstanceOf(Constraint::class, $this->getObjectAttribute($dependency, 'constraint')); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Extension/DeprecatedModuleHandlerTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Extension/DeprecatedModuleHandlerTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,143 @@ +assertEquals($expected, $version); + } + + /** + * Provider for testing dependency parsing. + */ + public function dependencyProvider() { + return [ + ['system', ['name' => 'system']], + ['taxonomy', ['name' => 'taxonomy']], + ['views', ['name' => 'views']], + [ + 'views_ui(8.x-1.0)', + [ + 'name' => 'views_ui', + 'original_version' => ' (8.x-1.0)', + 'versions' => [['op' => '=', 'version' => '1.0']], + ], + ], + /* @todo Not supported? Fix this in + https://www.drupal.org/project/drupal/issues/3001344. + [ + 'views_ui(8.x-1.1-beta)', + [ + 'name' => 'views_ui', + 'original_version' => ' (8.x-1.1-beta)', + 'versions' => [['op' => '=', 'version' => '1.1-beta']], + ], + ],*/ + [ + 'views_ui(8.x-1.1-alpha12)', + [ + 'name' => 'views_ui', + 'original_version' => ' (8.x-1.1-alpha12)', + 'versions' => [['op' => '=', 'version' => '1.1-alpha12']], + ], + ], + [ + 'views_ui(8.x-1.1-beta8)', + [ + 'name' => 'views_ui', + 'original_version' => ' (8.x-1.1-beta8)', + 'versions' => [['op' => '=', 'version' => '1.1-beta8']], + ], + ], + [ + 'views_ui(8.x-1.1-rc11)', + [ + 'name' => 'views_ui', + 'original_version' => ' (8.x-1.1-rc11)', + 'versions' => [['op' => '=', 'version' => '1.1-rc11']], + ], + ], + [ + 'views_ui(8.x-1.12)', + [ + 'name' => 'views_ui', + 'original_version' => ' (8.x-1.12)', + 'versions' => [['op' => '=', 'version' => '1.12']], + ], + ], + [ + 'views_ui(8.x-1.x)', + [ + 'name' => 'views_ui', + 'original_version' => ' (8.x-1.x)', + 'versions' => [ + ['op' => '<', 'version' => '2.x'], + ['op' => '>=', 'version' => '1.x'], + ], + ], + ], + [ + 'views_ui( <= 8.x-1.x)', + [ + 'name' => 'views_ui', + 'original_version' => ' ( <= 8.x-1.x)', + 'versions' => [['op' => '<=', 'version' => '2.x']], + ], + ], + [ + 'views_ui(<= 8.x-1.x)', + [ + 'name' => 'views_ui', + 'original_version' => ' (<= 8.x-1.x)', + 'versions' => [['op' => '<=', 'version' => '2.x']], + ], + ], + [ + 'views_ui( <=8.x-1.x)', + [ + 'name' => 'views_ui', + 'original_version' => ' ( <=8.x-1.x)', + 'versions' => [['op' => '<=', 'version' => '2.x']], + ], + ], + [ + 'views_ui(>8.x-1.x)', + [ + 'name' => 'views_ui', + 'original_version' => ' (>8.x-1.x)', + 'versions' => [['op' => '>', 'version' => '2.x']], + ], + ], + [ + 'drupal:views_ui(>8.x-1.x)', + [ + 'project' => 'drupal', + 'name' => 'views_ui', + 'original_version' => ' (>8.x-1.x)', + 'versions' => [['op' => '>', 'version' => '2.x']], + ], + ], + ]; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php --- a/core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,7 @@ use Drupal\Tests\UnitTestCase; use Drupal\Core\Extension\Extension; +use Drupal\Core\DependencyInjection\ContainerBuilder; /** * Tests Extension serialization. @@ -14,15 +15,41 @@ class ExtensionSerializationTest extends UnitTestCase { /** + * Tests that the Extension class unserialize method uses the preferred root. + * + * When the Extension unserialize method is called on serialized Extension + * object data, test that the Extension object's root property is set to the + * container's app.root and not the DRUPAL_ROOT constant if the service + * container app.root is available. + * + * @covers ::__sleep + * @covers ::__wakeup + */ + public function testServiceAppRouteUsage() { + // The assumption of our test is that DRUPAL_ROOT is not defined. + $this->assertFalse(defined('DRUPAL_ROOT'), 'Constant DRUPAL_ROOT is defined.'); + $container = new ContainerBuilder(); + // Set a dummy container app.root to test against. + $container->set('app.root', '/dummy/app/root'); + \Drupal::setContainer($container); + // Instantiate an Extension object for testing unserialization. + $extension = new Extension($container->get('app.root'), 'module', 'core/modules/system/system.info.yml', 'system.module'); + $extension = unserialize(serialize($extension)); + $this->assertEquals('/dummy/app/root', $this->readAttribute($extension, 'root')); + } + + /** * Tests dynamically assigned public properties kept when serialized. * * @covers ::__sleep * @covers ::__wakeup - * @runInSeparateProcess */ public function testPublicProperties() { - define('DRUPAL_ROOT', '/dummy/app/root'); - $extension = new Extension('/dummy/app/root', 'module', 'core/modules/system/system.info.yml', 'system.module'); + $container = new ContainerBuilder(); + // Set a dummy container app.root to test against. + $container->set('app.root', '/dummy/app/root'); + \Drupal::setContainer($container); + $extension = new Extension($container->get('app.root'), 'module', 'core/modules/system/system.info.yml', 'system.module'); // Assign a public property dynamically. $extension->test = 'foo'; $extension = unserialize(serialize($extension)); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php --- a/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php Thu May 09 15:33:08 2019 +0100 @@ -497,39 +497,6 @@ } /** - * @dataProvider dependencyProvider - * @covers ::parseDependency - */ - public function testDependencyParsing($dependency, $expected) { - $version = ModuleHandler::parseDependency($dependency); - $this->assertEquals($expected, $version); - } - - /** - * Provider for testing dependency parsing. - */ - public function dependencyProvider() { - return [ - ['system', ['name' => 'system']], - ['taxonomy', ['name' => 'taxonomy']], - ['views', ['name' => 'views']], - ['views_ui(8.x-1.0)', ['name' => 'views_ui', 'original_version' => ' (8.x-1.0)', 'versions' => [['op' => '=', 'version' => '1.0']]]], - // Not supported?. - // array('views_ui(8.x-1.1-beta)', array('name' => 'views_ui', 'original_version' => ' (8.x-1.1-beta)', 'versions' => array(array('op' => '=', 'version' => '1.1-beta')))), - ['views_ui(8.x-1.1-alpha12)', ['name' => 'views_ui', 'original_version' => ' (8.x-1.1-alpha12)', 'versions' => [['op' => '=', 'version' => '1.1-alpha12']]]], - ['views_ui(8.x-1.1-beta8)', ['name' => 'views_ui', 'original_version' => ' (8.x-1.1-beta8)', 'versions' => [['op' => '=', 'version' => '1.1-beta8']]]], - ['views_ui(8.x-1.1-rc11)', ['name' => 'views_ui', 'original_version' => ' (8.x-1.1-rc11)', 'versions' => [['op' => '=', 'version' => '1.1-rc11']]]], - ['views_ui(8.x-1.12)', ['name' => 'views_ui', 'original_version' => ' (8.x-1.12)', 'versions' => [['op' => '=', 'version' => '1.12']]]], - ['views_ui(8.x-1.x)', ['name' => 'views_ui', 'original_version' => ' (8.x-1.x)', 'versions' => [['op' => '<', 'version' => '2.x'], ['op' => '>=', 'version' => '1.x']]]], - ['views_ui( <= 8.x-1.x)', ['name' => 'views_ui', 'original_version' => ' ( <= 8.x-1.x)', 'versions' => [['op' => '<=', 'version' => '2.x']]]], - ['views_ui(<= 8.x-1.x)', ['name' => 'views_ui', 'original_version' => ' (<= 8.x-1.x)', 'versions' => [['op' => '<=', 'version' => '2.x']]]], - ['views_ui( <=8.x-1.x)', ['name' => 'views_ui', 'original_version' => ' ( <=8.x-1.x)', 'versions' => [['op' => '<=', 'version' => '2.x']]]], - ['views_ui(>8.x-1.x)', ['name' => 'views_ui', 'original_version' => ' (>8.x-1.x)', 'versions' => [['op' => '>', 'version' => '2.x']]]], - ['drupal:views_ui(>8.x-1.x)', ['project' => 'drupal', 'name' => 'views_ui', 'original_version' => ' (>8.x-1.x)', 'versions' => [['op' => '>', 'version' => '2.x']]]], - ]; - } - - /** * @covers ::getModuleDirectories */ public function testGetModuleDirectories() { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php --- a/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,7 +2,7 @@ namespace Drupal\Tests\Core\Extension; -use Drupal\simpletest\AssertHelperTrait; +use Drupal\Tests\AssertHelperTrait; use Drupal\Tests\UnitTestCase; /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,264 @@ +prophesize(ExtensionDiscovery::class); + $extension_discovery + ->scan('theme') + ->willReturn([ + 'test_subtheme' => new Extension($this->root, 'theme', $this->root . '/core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml', 'test_subtheme.info.yml'), + 'test_basetheme' => new Extension($this->root, 'theme', $this->root . '/core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml', 'test_basetheme.info.yml'), + ]); + $extension_discovery + ->scan('theme_engine') + ->willReturn([ + 'twig' => new Extension($this->root, 'theme_engine', $this->root . '/core/themes/engines/twig/twig.info.yml', 'twig.engine'), + ]); + + // Verify that info parser is called with the specified paths. + $argument_condition = function ($path) { + return in_array($path, [ + $this->root . '/core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml', + $this->root . '/core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml', + $this->root . '/core/themes/engines/twig/twig.info.yml', + ], TRUE); + }; + $info_parser = $this->prophesize(InfoParserInterface::class); + $info_parser->parse(Argument::that($argument_condition)) + ->shouldBeCalled() + ->will(function ($file) { + $info_parser = new InfoParser(); + return $info_parser->parse($file[0]); + }); + + $module_handler = $this->prophesize(ModuleHandlerInterface::class); + $module_handler + ->buildModuleDependencies(Argument::type('array')) + ->willReturnArgument(0); + $module_handler + ->alter('system_info', Argument::type('array'), Argument::type(Extension::class), Argument::any()) + ->shouldBeCalled(); + + $state = new State(new KeyValueMemoryFactory(), new MemoryBackend(), new NullLockBackend()); + + $config_factory = $this->getConfigFactoryStub([ + 'core.extension' => [ + 'module' => [], + 'theme' => [], + 'disabled' => [ + 'theme' => [], + ], + 'theme_engine' => '', + ], + ]); + + $theme_engine_list = new TestThemeEngineExtensionList($this->root, 'theme_engine', new NullBackend('test'), $info_parser->reveal(), $module_handler->reveal(), $state, $config_factory, 'testing'); + $theme_engine_list->setExtensionDiscovery($extension_discovery->reveal()); + + $theme_list = new TestThemeExtensionList($this->root, 'theme', new NullBackend('test'), $info_parser->reveal(), $module_handler->reveal(), $state, $config_factory, $theme_engine_list, 'testing'); + $theme_list->setExtensionDiscovery($extension_discovery->reveal()); + + $theme_data = $theme_list->reset()->getList(); + $this->assertCount(2, $theme_data); + + $info_basetheme = $theme_data['test_basetheme']; + $info_subtheme = $theme_data['test_subtheme']; + + // Ensure some basic properties. + $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info_basetheme); + $this->assertEquals('test_basetheme', $info_basetheme->getName()); + $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info_subtheme); + $this->assertEquals('test_subtheme', $info_subtheme->getName()); + + // Test the parent/child-theme properties. + $info_subtheme->info['base theme'] = 'test_basetheme'; + $info_basetheme->sub_themes = ['test_subtheme']; + + $this->assertEquals($this->root . '/core/themes/engines/twig/twig.engine', $info_basetheme->owner); + $this->assertEquals('twig', $info_basetheme->prefix); + $this->assertEquals($this->root . '/core/themes/engines/twig/twig.engine', $info_subtheme->owner); + $this->assertEquals('twig', $info_subtheme->prefix); + } + + /** + * Tests getting the base themes for a set a defines themes. + * + * @param array $themes + * An array of available themes, keyed by the theme name. + * @param string $theme + * The theme name to find all its base themes. + * @param array $expected + * The expected base themes. + * + * @dataProvider providerTestGetBaseThemes + */ + public function testGetBaseThemes(array $themes, $theme, array $expected) { + // Mocks and stubs. + $module_handler = $this->prophesize(ModuleHandlerInterface::class); + $state = new State(new KeyValueMemoryFactory(), new MemoryBackend(), new NullLockBackend()); + $config_factory = $this->getConfigFactoryStub([]); + $theme_engine_list = $this->prophesize(ThemeEngineExtensionList::class); + $theme_listing = new ThemeExtensionList($this->root, 'theme', new NullBackend('test'), new InfoParser(), $module_handler->reveal(), $state, $config_factory, $theme_engine_list->reveal(), 'test'); + + $base_themes = $theme_listing->getBaseThemes($themes, $theme); + + $this->assertEquals($expected, $base_themes); + } + + /** + * Provides test data for testGetBaseThemes. + * + * @return array + * An array of theme test data. + */ + public function providerTestGetBaseThemes() { + $data = []; + + // Tests a theme without any base theme. + $themes = []; + $themes['test_1'] = (object) [ + 'name' => 'test_1', + 'info' => [ + 'name' => 'test_1', + ], + ]; + $data[] = [$themes, 'test_1', []]; + + // Tests a theme with a non existing base theme. + $themes = []; + $themes['test_1'] = (object) [ + 'name' => 'test_1', + 'info' => [ + 'name' => 'test_1', + 'base theme' => 'test_2', + ], + ]; + $data[] = [$themes, 'test_1', ['test_2' => NULL]]; + + // Tests a theme with a single existing base theme. + $themes = []; + $themes['test_1'] = (object) [ + 'name' => 'test_1', + 'info' => [ + 'name' => 'test_1', + 'base theme' => 'test_2', + ], + ]; + $themes['test_2'] = (object) [ + 'name' => 'test_2', + 'info' => [ + 'name' => 'test_2', + ], + ]; + $data[] = [$themes, 'test_1', ['test_2' => 'test_2']]; + + // Tests a theme with multiple base themes. + $themes = []; + $themes['test_1'] = (object) [ + 'name' => 'test_1', + 'info' => [ + 'name' => 'test_1', + 'base theme' => 'test_2', + ], + ]; + $themes['test_2'] = (object) [ + 'name' => 'test_2', + 'info' => [ + 'name' => 'test_2', + 'base theme' => 'test_3', + ], + ]; + $themes['test_3'] = (object) [ + 'name' => 'test_3', + 'info' => [ + 'name' => 'test_3', + ], + ]; + $data[] = [ + $themes, + 'test_1', + ['test_2' => 'test_2', 'test_3' => 'test_3'], + ]; + + return $data; + } + +} + +/** + * Trait that allows extension discovery to be set. + */ +trait SettableDiscoveryExtensionListTrait { + + /** + * The extension discovery for this extension list. + * + * @var \Drupal\Core\Extension\ExtensionDiscovery + */ + protected $extensionDiscovery; + + /** + * Sets the extension discovery. + * + * @param \Drupal\Core\Extension\ExtensionDiscovery $discovery + * The extension discovery. + */ + public function setExtensionDiscovery(ExtensionDiscovery $discovery) { + $this->extensionDiscovery = $discovery; + } + + /** + * {@inheritdoc} + */ + public function getExtensionDiscovery() { + return $this->extensionDiscovery; + } + +} + +/** + * Test theme extension list class. + */ +class TestThemeExtensionList extends ThemeExtensionList { + + use SettableDiscoveryExtensionListTrait; + +} + +/** + * Test theme engine extension list class. + */ +class TestThemeEngineExtensionList extends ThemeEngineExtensionList { + + use SettableDiscoveryExtensionListTrait; + +} + +if (!defined('DRUPAL_MINIMUM_PHP')) { + define('DRUPAL_MINIMUM_PHP', '5.5.9'); +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php --- a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php Thu May 09 15:33:08 2019 +0100 @@ -7,11 +7,10 @@ namespace Drupal\Tests\Core\Extension; +use Composer\Autoload\ClassLoader; use Drupal\Core\Extension\Extension; -use Drupal\Core\Extension\InfoParser; +use Drupal\Core\Extension\ThemeExtensionList; use Drupal\Core\Extension\ThemeHandler; -use Drupal\Core\KeyValueStore\KeyValueMemoryFactory; -use Drupal\Core\State\State; use Drupal\Tests\UnitTestCase; /** @@ -21,20 +20,6 @@ class ThemeHandlerTest extends UnitTestCase { /** - * The mocked info parser. - * - * @var \Drupal\Core\Extension\InfoParserInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $infoParser; - - /** - * The mocked state backend. - * - * @var \Drupal\Core\State\StateInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $state; - - /** * The mocked config factory. * * @var \Drupal\Core\Config\ConfigFactoryInterface|\PHPUnit_Framework_MockObject_MockObject @@ -42,18 +27,11 @@ protected $configFactory; /** - * The mocked module handler. + * The theme listing service. * - * @var \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Extension\ThemeExtensionList|\PHPUnit_Framework_MockObject_MockObject */ - protected $moduleHandler; - - /** - * The extension discovery. - * - * @var \Drupal\Core\Extension\ExtensionDiscovery|\PHPUnit_Framework_MockObject_MockObject - */ - protected $extensionDiscovery; + protected $themeList; /** * The tested theme handler. @@ -77,16 +55,17 @@ ], ], ]); - $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); - $this->state = new State(new KeyValueMemoryFactory()); - $this->infoParser = $this->getMock('Drupal\Core\Extension\InfoParserInterface'); - $this->extensionDiscovery = $this->getMockBuilder('Drupal\Core\Extension\ExtensionDiscovery') + $this->themeList = $this->getMockBuilder(ThemeExtensionList::class) ->disableOriginalConstructor() ->getMock(); - $this->themeHandler = new StubThemeHandler($this->root, $this->configFactory, $this->moduleHandler, $this->state, $this->infoParser, $this->extensionDiscovery); + $this->themeHandler = new StubThemeHandler($this->root, $this->configFactory, $this->themeList); - $cache_tags_invalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface'); - $this->getContainerWithCacheTagsInvalidator($cache_tags_invalidator); + $container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $container->expects($this->any()) + ->method('get') + ->with('class_loader') + ->will($this->returnValue($this->createMock(ClassLoader::class))); + \Drupal::setContainer($container); } /** @@ -95,31 +74,14 @@ * @see \Drupal\Core\Extension\ThemeHandler::rebuildThemeData() */ public function testRebuildThemeData() { - $this->extensionDiscovery->expects($this->at(0)) - ->method('scan') - ->with('theme') + $this->themeList->expects($this->at(0)) + ->method('reset') + ->willReturnSelf(); + $this->themeList->expects($this->at(1)) + ->method('getList') ->will($this->returnValue([ 'seven' => new Extension($this->root, 'theme', $this->root . '/core/themes/seven/seven.info.yml', 'seven.theme'), ])); - $this->extensionDiscovery->expects($this->at(1)) - ->method('scan') - ->with('theme_engine') - ->will($this->returnValue([ - 'twig' => new Extension($this->root, 'theme_engine', $this->root . '/core/themes/engines/twig/twig.info.yml', 'twig.engine'), - ])); - $this->infoParser->expects($this->once()) - ->method('parse') - ->with($this->root . '/core/themes/seven/seven.info.yml') - ->will($this->returnCallback(function ($file) { - $info_parser = new InfoParser(); - return $info_parser->parse($file); - })); - $this->moduleHandler->expects($this->once()) - ->method('buildModuleDependencies') - ->will($this->returnArgument(0)); - - $this->moduleHandler->expects($this->once()) - ->method('alter'); $theme_data = $this->themeHandler->rebuildThemeData(); $this->assertCount(1, $theme_data); @@ -130,11 +92,7 @@ $this->assertEquals('seven', $info->getName()); $this->assertEquals($this->root . '/core/themes/seven/seven.info.yml', $info->getPathname()); $this->assertEquals($this->root . '/core/themes/seven/seven.theme', $info->getExtensionPathname()); - $this->assertEquals($this->root . '/core/themes/engines/twig/twig.engine', $info->owner); - $this->assertEquals('twig', $info->prefix); - $this->assertEquals('twig', $info->info['engine']); - $this->assertEquals(['seven/global-styling'], $info->info['libraries']); } /** @@ -151,158 +109,6 @@ } } - /** - * Tests rebuild the theme data with theme parents. - */ - public function testRebuildThemeDataWithThemeParents() { - $this->extensionDiscovery->expects($this->at(0)) - ->method('scan') - ->with('theme') - ->will($this->returnValue([ - 'test_subtheme' => new Extension($this->root, 'theme', $this->root . '/core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml', 'test_subtheme.info.yml'), - 'test_basetheme' => new Extension($this->root, 'theme', $this->root . '/core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml', 'test_basetheme.info.yml'), - ])); - $this->extensionDiscovery->expects($this->at(1)) - ->method('scan') - ->with('theme_engine') - ->will($this->returnValue([ - 'twig' => new Extension($this->root, 'theme_engine', $this->root . '/core/themes/engines/twig/twig.info.yml', 'twig.engine'), - ])); - $this->infoParser->expects($this->at(0)) - ->method('parse') - ->with($this->root . '/core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml') - ->will($this->returnCallback(function ($file) { - $info_parser = new InfoParser(); - return $info_parser->parse($file); - })); - $this->infoParser->expects($this->at(1)) - ->method('parse') - ->with($this->root . '/core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml') - ->will($this->returnCallback(function ($file) { - $info_parser = new InfoParser(); - return $info_parser->parse($file); - })); - $this->moduleHandler->expects($this->once()) - ->method('buildModuleDependencies') - ->will($this->returnArgument(0)); - - $theme_data = $this->themeHandler->rebuildThemeData(); - $this->assertCount(2, $theme_data); - - $info_basetheme = $theme_data['test_basetheme']; - $info_subtheme = $theme_data['test_subtheme']; - - // Ensure some basic properties. - $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info_basetheme); - $this->assertEquals('test_basetheme', $info_basetheme->getName()); - $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info_subtheme); - $this->assertEquals('test_subtheme', $info_subtheme->getName()); - - // Test the parent/child-theme properties. - $info_subtheme->info['base theme'] = 'test_basetheme'; - $info_basetheme->sub_themes = ['test_subtheme']; - - $this->assertEquals($this->root . '/core/themes/engines/twig/twig.engine', $info_basetheme->owner); - $this->assertEquals('twig', $info_basetheme->prefix); - $this->assertEquals($this->root . '/core/themes/engines/twig/twig.engine', $info_subtheme->owner); - $this->assertEquals('twig', $info_subtheme->prefix); - } - - /** - * Tests getting the base themes for a set a defines themes. - * - * @param array $themes - * An array of available themes, keyed by the theme name. - * @param string $theme - * The theme name to find all its base themes. - * @param array $expected - * The expected base themes. - * - * @dataProvider providerTestGetBaseThemes - */ - public function testGetBaseThemes(array $themes, $theme, array $expected) { - $base_themes = $this->themeHandler->getBaseThemes($themes, $theme); - $this->assertEquals($expected, $base_themes); - } - - /** - * Provides test data for testGetBaseThemes. - * - * @return array - * An array of theme test data. - */ - public function providerTestGetBaseThemes() { - $data = []; - - // Tests a theme without any base theme. - $themes = []; - $themes['test_1'] = (object) [ - 'name' => 'test_1', - 'info' => [ - 'name' => 'test_1', - ], - ]; - $data[] = [$themes, 'test_1', []]; - - // Tests a theme with a non existing base theme. - $themes = []; - $themes['test_1'] = (object) [ - 'name' => 'test_1', - 'info' => [ - 'name' => 'test_1', - 'base theme' => 'test_2', - ], - ]; - $data[] = [$themes, 'test_1', ['test_2' => NULL]]; - - // Tests a theme with a single existing base theme. - $themes = []; - $themes['test_1'] = (object) [ - 'name' => 'test_1', - 'info' => [ - 'name' => 'test_1', - 'base theme' => 'test_2', - ], - ]; - $themes['test_2'] = (object) [ - 'name' => 'test_2', - 'info' => [ - 'name' => 'test_2', - ], - ]; - $data[] = [$themes, 'test_1', ['test_2' => 'test_2']]; - - // Tests a theme with multiple base themes. - $themes = []; - $themes['test_1'] = (object) [ - 'name' => 'test_1', - 'info' => [ - 'name' => 'test_1', - 'base theme' => 'test_2', - ], - ]; - $themes['test_2'] = (object) [ - 'name' => 'test_2', - 'info' => [ - 'name' => 'test_2', - 'base theme' => 'test_3', - ], - ]; - $themes['test_3'] = (object) [ - 'name' => 'test_3', - 'info' => [ - 'name' => 'test_3', - ], - ]; - $data[] = [ - $themes, - 'test_1', - ['test_2' => 'test_2', 'test_3' => 'test_3'], - ]; - - return $data; - } - } /** @@ -325,13 +131,6 @@ protected $registryRebuild; /** - * A list of themes keyed by name. - * - * @var array - */ - protected $systemList; - - /** * {@inheritdoc} */ protected function clearCssCache() { @@ -345,27 +144,8 @@ $this->registryRebuild = TRUE; } - /** - * {@inheritdoc} - */ - protected function systemThemeList() { - return $this->systemList; - } - - /** - * {@inheritdoc} - */ - protected function systemListReset() { - } - } -if (!defined('DRUPAL_EXTENSION_NAME_MAX_LENGTH')) { - define('DRUPAL_EXTENSION_NAME_MAX_LENGTH', 50); +if (!defined('DRUPAL_MINIMUM_PHP')) { + define('DRUPAL_MINIMUM_PHP', '5.5.9'); } -if (!defined('DRUPAL_PHP_FUNCTION_PATTERN')) { - define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'); -} -if (!defined('DRUPAL_MINIMUM_PHP')) { - define('DRUPAL_MINIMUM_PHP', '5.3.10'); -} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Field/MigrateFieldDeprecationTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Field/MigrateFieldDeprecationTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,45 @@ +assertSame($expected_mode, $actual_mode, $message); } + /** + * Tests that invalid UTF-8 results in an exception. + * + * @covers ::createFilename + */ + public function testInvalidUTF8() { + vfsStream::setup('dir'); + $filename = "a\xFFsdf\x80€" . '.txt'; + $this->setExpectedException(FileException::class, "Invalid filename '$filename'"); + $this->fileSystem->createFilename($filename, 'vfs://dir'); + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php --- a/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php Thu May 09 15:33:08 2019 +0100 @@ -1477,7 +1477,7 @@ $form = $this->getMock(FormInterface::class); $this->decoratedFormState->setFormObject($form) - ->shouldBeCalled();; + ->shouldBeCalled(); $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setFormObject($form)); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Image/ImageTest.php --- a/core/tests/Drupal/Tests/Core/Image/ImageTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Image/ImageTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,7 @@ namespace Drupal\Tests\Core\Image; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Image\Image; use Drupal\Core\ImageToolkit\ImageToolkitInterface; use Drupal\Tests\UnitTestCase; @@ -210,9 +211,19 @@ ->will($this->returnValue(TRUE)); $image = $this->getMock('Drupal\Core\Image\Image', ['chmod'], [$toolkit, $this->image->getSource()]); - $image->expects($this->any()) - ->method('chmod') - ->will($this->returnValue(TRUE)); + + $file_system = $this->prophesize(FileSystemInterface::class); + $file_system->chmod($this->image->getSource()) + ->willReturn(TRUE); + + $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder') + ->setMethods(['get']) + ->getMock(); + $container->expects($this->once()) + ->method('get') + ->with('file_system') + ->willReturn($file_system->reveal()); + \Drupal::setContainer($container); $image->save(); } @@ -242,9 +253,19 @@ ->will($this->returnValue(TRUE)); $image = $this->getMock('Drupal\Core\Image\Image', ['chmod'], [$toolkit, $this->image->getSource()]); - $image->expects($this->any()) - ->method('chmod') - ->will($this->returnValue(FALSE)); + + $file_system = $this->prophesize(FileSystemInterface::class); + $file_system->chmod($this->image->getSource()) + ->willReturn(FALSE); + + $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder') + ->setMethods(['get']) + ->getMock(); + $container->expects($this->once()) + ->method('get') + ->with('file_system') + ->willReturn($file_system->reveal()); + \Drupal::setContainer($container); $this->assertFalse($image->save()); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php --- a/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php Thu May 09 15:33:08 2019 +0100 @@ -386,6 +386,10 @@ * @group legacy */ public function testControllerResolverDeprecation() { + if (!in_array('Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface', class_implements('Symfony\Component\HttpKernel\Controller\ControllerResolver'))) { + $this->markTestSkipped("Do not test ::getArguments() method when it is not implemented by Symfony's ControllerResolver."); + } + $controller_resolver = $this->getMockBuilder(ControllerResolver::class)->disableOriginalConstructor()->getMock(); $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface'); $request_stack = new RequestStack(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php Thu May 09 15:33:08 2019 +0100 @@ -251,6 +251,10 @@ * @group legacy */ public function testControllerResolverDeprecation() { + if (!in_array('Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface', class_implements('Symfony\Component\HttpKernel\Controller\ControllerResolver'))) { + $this->markTestSkipped("Do not test ::getArguments() method when it is not implemented by Symfony's ControllerResolver."); + } + $controller_resolver = $this->getMockBuilder(ControllerResolver::class)->disableOriginalConstructor()->getMock(); $request_stack = new RequestStack(); $request_stack->push($this->request); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php --- a/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php Thu May 09 15:33:08 2019 +0100 @@ -142,4 +142,24 @@ $this->assertEquals(1, $parameters->minDepth); } + /** + * @covers ::serialize + * @covers ::unserialize + */ + public function testSerialize() { + $parameters = new MenuTreeParameters(); + $parameters->setRoot(1); + $parameters->setMinDepth('2'); + $parameters->setMaxDepth('9'); + $parameters->addExpandedParents(['', 'foo']); + $parameters->setActiveTrail(['', 'bar']); + + $after_serialize = unserialize(serialize($parameters)); + $this->assertSame('1', $after_serialize->root); + $this->assertSame(2, $after_serialize->minDepth); + $this->assertSame(9, $after_serialize->maxDepth); + $this->assertSame(['', 'foo'], $after_serialize->expandedParents); + $this->assertSame(['bar'], $after_serialize->activeTrail); + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php --- a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,14 +2,22 @@ namespace Drupal\Tests\Core\ParamConverter; -use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; +use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\ContentEntityStorageInterface; use Drupal\Core\Entity\ContentEntityTypeInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\ParamConverter\EntityConverter; use Drupal\Core\ParamConverter\ParamNotConvertedException; +use Drupal\Core\Plugin\Context\Context; +use Drupal\Core\Plugin\Context\ContextDefinition; +use Drupal\Core\Plugin\Context\ContextRepositoryInterface; +use Drupal\Core\TypedData\DataDefinition; +use Drupal\Core\TypedData\TypedDataInterface; +use Drupal\Core\TypedData\TypedDataManagerInterface; use Drupal\Tests\UnitTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Routing\Route; @@ -22,11 +30,18 @@ class EntityConverterTest extends UnitTestCase { /** - * The mocked entity manager. + * The mocked entity type manager. * - * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $entityManager; + protected $entityTypeManager; + + /** + * The mocked entities repository. + * + * @var \Drupal\Core\Entity\EntityRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $entityRepository; /** * The tested entity converter. @@ -41,9 +56,200 @@ protected function setUp() { parent::setUp(); - $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); + $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class); + $this->entityRepository = $this->createMock(EntityRepositoryInterface::class); - $this->entityConverter = new EntityConverter($this->entityManager); + $this->entityConverter = new EntityConverter($this->entityTypeManager, $this->entityRepository); + } + + /** + * Sets up mock services and class instances. + * + * @param object[] $service_map + * An associative array of service instances keyed by service name. + */ + protected function setUpMocks($service_map = []) { + $entity = $this->createMock(ContentEntityInterface::class); + $entity->expects($this->any()) + ->method('getEntityTypeId') + ->willReturn('entity_test'); + $entity->expects($this->any()) + ->method('id') + ->willReturn('id'); + $entity->expects($this->any()) + ->method('isTranslatable') + ->willReturn(FALSE); + $entity->expects($this->any()) + ->method('getLoadedRevisionId') + ->willReturn('revision_id'); + + $storage = $this->createMock(ContentEntityStorageInterface::class); + $storage->expects($this->any()) + ->method('load') + ->with('id') + ->willReturn($entity); + $storage->expects($this->any()) + ->method('getLatestRevisionId') + ->with('id') + ->willReturn('revision_id'); + + $this->entityTypeManager->expects($this->any()) + ->method('getStorage') + ->with('entity_test') + ->willReturn($storage); + + $entity_type = $this->createMock(ContentEntityTypeInterface::class); + $entity_type->expects($this->any()) + ->method('isRevisionable') + ->willReturn(TRUE); + + $this->entityTypeManager->expects($this->any()) + ->method('getDefinition') + ->with('entity_test') + ->willReturn($entity_type); + + $context_repository = $this->createMock(ContextRepositoryInterface::class); + $context_repository->expects($this->any()) + ->method('getAvailableContexts') + ->willReturn([]); + + $context_definition = $this->createMock(DataDefinition::class); + foreach (['setLabel', 'setDescription', 'setRequired', 'setConstraints'] as $method) { + $context_definition->expects($this->any()) + ->method($method) + ->willReturn($context_definition); + } + $context_definition->expects($this->any()) + ->method('getConstraints') + ->willReturn([]); + + $typed_data_manager = $this->createMock(TypedDataManagerInterface::class); + $typed_data_manager->expects($this->any()) + ->method('create') + ->willReturn($this->createMock(TypedDataInterface::class)); + $typed_data_manager->expects($this->any()) + ->method('createDataDefinition') + ->willReturn($context_definition); + + $service_map += [ + 'context.repository' => $context_repository, + 'typed_data_manager' => $typed_data_manager, + ]; + + /** @var \Symfony\Component\DependencyInjection\ContainerInterface|\PHPUnit_Framework_MockObject_MockObject $container */ + $container = $this->createMock(ContainerInterface::class); + $return_map = []; + foreach ($service_map as $name => $service) { + $return_map[] = [$name, 1, $service]; + } + $container + ->expects($this->any()) + ->method('get') + ->willReturnMap($return_map); + + \Drupal::setContainer($container); + } + + /** + * Tests that passing the language manager triggers a deprecation error. + * + * @group legacy + * + * @expectedDeprecation Calling EntityConverter::__construct() with the $entity_repository argument is supported in drupal:8.7.0 and will be required before drupal:9.0.0. See https://www.drupal.org/node/2549139. + */ + public function testDeprecatedLanguageManager() { + $container_entity_repository = clone $this->entityRepository; + $this->setUpMocks([ + 'entity.repository' => $container_entity_repository, + ]); + $language_manager = $this->createMock(LanguageManagerInterface::class); + + $this->entityConverter = new EntityConverter($this->entityTypeManager, $language_manager); + } + + /** + * Tests that retrieving the language manager triggers a deprecation error. + * + * @group legacy + * + * @expectedDeprecation The property languageManager (language_manager service) is deprecated in Drupal\Core\ParamConverter\EntityConverter and will be removed before Drupal 9.0.0. + */ + public function testDeprecatedLanguageManagerMethod() { + $this->setUpMocks([ + 'language_manager' => $this->createMock(LanguageManagerInterface::class), + ]); + $this->entityConverter = new EntityConverter($this->entityTypeManager, $this->entityRepository); + $reflector = new \ReflectionMethod(EntityConverter::class, 'languageManager'); + $reflector->setAccessible(TRUE); + $this->assertSame(\Drupal::service('language_manager'), $reflector->invoke($this->entityConverter)); + } + + /** + * Tests that retrieving the language manager triggers a deprecation error. + * + * @group legacy + * + * @expectedDeprecation The property languageManager (language_manager service) is deprecated in Drupal\Core\ParamConverter\EntityConverter and will be removed before Drupal 9.0.0. + */ + public function testDeprecatedLanguageManagerProperty() { + $this->setUpMocks([ + 'language_manager' => $this->createMock(LanguageManagerInterface::class), + ]); + $this->entityConverter = new EntityConverter($this->entityTypeManager, $this->entityRepository); + $this->assertSame(\Drupal::service('language_manager'), $this->entityConverter->__get('languageManager')); + } + + /** + * Tests that ::getLatestTranslationAffectedRevision() is deprecated. + * + * @group legacy + * + * @expectedDeprecation \Drupal\Core\ParamConverter\EntityConverter::getLatestTranslationAffectedRevision() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getActive() instead. + */ + public function testDeprecatedGetLatestTranslationAffectedRevision() { + $this->setUpMocks(); + + /** @var \Drupal\Core\Entity\ContentEntityInterface|\PHPUnit_Framework_MockObject_MockObject $revision */ + $revision = $this->createMock(ContentEntityInterface::class); + $revision->expects($this->any()) + ->method('getEntityTypeId') + ->willReturn('entity_test'); + $revision->expects($this->any()) + ->method('id') + ->willReturn('1'); + + /** @var static $test */ + $test = $this; + $this->entityRepository->expects($this->any()) + ->method('getActive') + ->willReturnCallback(function ($entity_type_id, $entity_id, $contexts) use ($test) { + $test->assertSame('entity_test', $entity_type_id); + $test->assertSame('1', $entity_id); + $context_id_prefix = '@language.current_language_context:'; + $test->assertTrue(isset($contexts[$context_id_prefix . LanguageInterface::TYPE_CONTENT])); + $test->assertTrue(isset($contexts[$context_id_prefix . LanguageInterface::TYPE_INTERFACE])); + }); + + $this->entityConverter = new EntityConverter($this->entityTypeManager, $this->entityRepository); + $reflector = new \ReflectionMethod(EntityConverter::class, 'getLatestTranslationAffectedRevision'); + $reflector->setAccessible(TRUE); + $reflector->invoke($this->entityConverter, $revision, NULL); + } + + /** + * Tests that ::loadRevision() is deprecated. + * + * @group legacy + * + * @expectedDeprecation \Drupal\Core\ParamConverter\EntityConverter::loadRevision() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. + */ + public function testDeprecatedLoadRevision() { + $this->setUpMocks(); + $this->entityConverter = new EntityConverter($this->entityTypeManager, $this->entityRepository); + $reflector = new \ReflectionMethod(EntityConverter::class, 'loadRevision'); + $reflector->setAccessible(TRUE); + $revision = $this->createMock(ContentEntityInterface::class); + $reflector->invoke($this->entityConverter, $revision, NULL); } /** @@ -54,7 +260,7 @@ * @covers ::applies */ public function testApplies(array $definition, $name, Route $route, $applies) { - $this->entityManager->expects($this->any()) + $this->entityTypeManager->expects($this->any()) ->method('hasDefinition') ->willReturnCallback(function ($entity_type) { return 'entity_test' == $entity_type; @@ -85,17 +291,13 @@ * @covers ::convert */ public function testConvert($value, array $definition, array $defaults, $expected_result) { - $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); - $this->entityManager->expects($this->once()) - ->method('getStorage') - ->with('entity_test') - ->willReturn($entity_storage); - $entity_storage->expects($this->any()) - ->method('load') - ->willReturnMap([ - ['valid_id', (object) ['id' => 'valid_id']], - ['invalid_id', NULL], - ]); + $this->setUpMocks(); + + $this->entityRepository->expects($this->any()) + ->method('getCanonical') + ->willReturnCallback(function ($entity_type_id, $entity_id) { + return $entity_type_id === 'entity_test' && $entity_id === 'valid_id' ? (object) ['id' => 'valid_id'] : NULL; + }); $this->assertEquals($expected_result, $this->entityConverter->convert($value, $definition, 'foo', $defaults)); } @@ -119,91 +321,29 @@ * Tests the convert() method with an invalid entity type. */ public function testConvertWithInvalidEntityType() { - $this->entityManager->expects($this->once()) - ->method('getStorage') - ->with('invalid_id') - ->willThrowException(new InvalidPluginDefinitionException('invalid_id')); + $this->setUpMocks(); - $this->setExpectedException(InvalidPluginDefinitionException::class); - $this->entityConverter->convert('id', ['type' => 'entity:invalid_id'], 'foo', ['foo' => 'id']); + $contexts = [ + EntityRepositoryInterface::CONTEXT_ID_LEGACY_CONTEXT_OPERATION => new Context(new ContextDefinition('string'), 'entity_upcast'), + ]; + + $plugin_id = 'invalid_id'; + $this->entityRepository->expects($this->once()) + ->method('getCanonical') + ->with($plugin_id, 'id', $contexts) + ->willThrowException(new PluginNotFoundException($plugin_id)); + + $this->setExpectedException(PluginNotFoundException::class); + + $this->entityConverter->convert('id', ['type' => 'entity:' . $plugin_id], 'foo', ['foo' => 'id']); } /** * Tests the convert() method with an invalid dynamic entity type. */ public function testConvertWithInvalidDynamicEntityType() { - $this->setExpectedException(ParamNotConvertedException::class, 'The "foo" parameter was not converted because the "invalid_id" parameter is missing'); + $this->setExpectedException(ParamNotConvertedException::class, 'The "foo" parameter was not converted because the "invalid_id" parameter is missing.'); $this->entityConverter->convert('id', ['type' => 'entity:{invalid_id}'], 'foo', ['foo' => 'id']); } - /** - * Tests that omitting the language manager triggers a deprecation error. - * - * @group legacy - * - * @expectedDeprecation The language manager parameter has been added to EntityConverter since version 8.5.0 and will be made required in version 9.0.0 when requesting the latest translation-affected revision of an entity. - */ - public function testDeprecatedOptionalLanguageManager() { - $entity = $this->createMock(ContentEntityInterface::class); - $entity->expects($this->any()) - ->method('getEntityTypeId') - ->willReturn('entity_test'); - $entity->expects($this->any()) - ->method('id') - ->willReturn('id'); - $entity->expects($this->any()) - ->method('isTranslatable') - ->willReturn(FALSE); - $entity->expects($this->any()) - ->method('getLoadedRevisionId') - ->willReturn('revision_id'); - - $storage = $this->createMock(ContentEntityStorageInterface::class); - $storage->expects($this->any()) - ->method('load') - ->with('id') - ->willReturn($entity); - $storage->expects($this->any()) - ->method('getLatestRevisionId') - ->with('id') - ->willReturn('revision_id'); - - $this->entityManager->expects($this->any()) - ->method('getStorage') - ->with('entity_test') - ->willReturn($storage); - - $entity_type = $this->createMock(ContentEntityTypeInterface::class); - $entity_type->expects($this->any()) - ->method('isRevisionable') - ->willReturn(TRUE); - - $this->entityManager->expects($this->any()) - ->method('getDefinition') - ->with('entity_test') - ->willReturn($entity_type); - - $language = $this->createMock(LanguageInterface::class); - $language->expects($this->any()) - ->method('getId') - ->willReturn('en'); - - $language_manager = $this->createMock(LanguageManagerInterface::class); - $language_manager->expects($this->any()) - ->method('getCurrentLanguage') - ->with(LanguageInterface::TYPE_CONTENT) - ->willReturn($language); - - /** @var \Symfony\Component\DependencyInjection\ContainerInterface|\PHPUnit_Framework_MockObject_MockObject $container */ - $container = $this->createMock(ContainerInterface::class); - $container->expects($this->any()) - ->method('get') - ->with('language_manager') - ->willReturn($language_manager); - - \Drupal::setContainer($container); - $definition = ['type' => 'entity:entity_test', 'load_latest_revision' => TRUE]; - $this->entityConverter->convert('id', $definition, 'foo', []); - } - } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php --- a/core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,11 +2,12 @@ namespace Drupal\Tests\Core\ParamConverter; -use Drupal\Core\Entity\EntityInterface; +use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\ParamConverter\EntityRevisionParamConverter; +use Drupal\Core\ParamConverter\ParamNotConvertedException; use Drupal\Tests\UnitTestCase; use Symfony\Component\Routing\Route; @@ -19,7 +20,7 @@ /** * The tested entity revision param converter. * - * @var \Drupal\entity\ParamConverter\EntityRevisionParamConverter + * @var \Drupal\Core\ParamConverter\EntityRevisionParamConverter */ protected $converter; @@ -62,22 +63,74 @@ } /** + * Tests the convert() method. + * + * @dataProvider providerTestConvert + * * @covers ::convert */ - public function testConvert() { - $entity = $this->prophesize(EntityInterface::class)->reveal(); + public function testConvert($value, array $definition, array $defaults, $expected_result) { $storage = $this->prophesize(EntityStorageInterface::class); - $storage->loadRevision(1)->willReturn($entity); + $storage->loadRevision('valid_id')->willReturn((object) ['revision_id' => 'valid_id']); + $storage->loadRevision('invalid_id')->willReturn(NULL); $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class); - $entity_type_manager->getStorage('test')->willReturn($storage->reveal()); + $entity_type_manager->getStorage('entity_test')->willReturn($storage->reveal()); $entity_repository = $this->prophesize(EntityRepositoryInterface::class); - $entity_repository->getTranslationFromContext($entity)->willReturn($entity); $converter = new EntityRevisionParamConverter($entity_type_manager->reveal(), $entity_repository->reveal()); - $route = $this->getTestRoute(); - $result = $converter->convert(1, $route->getOption('parameters')['test_revision'], 'test_revision', ['test_revision' => 1]); - $this->assertSame($entity, $result); + $result = $converter->convert($value, $definition, 'test_revision', $defaults); + $this->assertEquals($expected_result, $result); + } + + /** + * Provides test data for testConvert + */ + public function providerTestConvert() { + $data = []; + // Existing entity type. + $data[] = ['valid_id', ['type' => 'entity_revision:entity_test'], ['test_revision' => 'valid_id'], (object) ['revision_id' => 'valid_id']]; + // Invalid ID. + $data[] = ['invalid_id', ['type' => 'entity_revision:entity_test'], ['test_revision' => 'invalid_id'], NULL]; + // Entity type placeholder. + $data[] = ['valid_id', ['type' => 'entity_revision:{entity_type}'], ['test_revision' => 'valid_id', 'entity_type' => 'entity_test'], (object) ['revision_id' => 'valid_id']]; + + return $data; + } + + /** + * Tests the convert() method with an invalid entity type ID. + * + * @covers ::convert + */ + public function testConvertWithInvalidEntityType() { + $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class); + $entity_type_manager->getStorage('invalid_entity_type_id')->willThrow(new InvalidPluginDefinitionException('invalid_entity_type_id')); + $entity_repository = $this->prophesize(EntityRepositoryInterface::class); + $converter = new EntityRevisionParamConverter($entity_type_manager->reveal(), $entity_repository->reveal()); + + $this->setExpectedException(InvalidPluginDefinitionException::class); + $converter->convert('valid_id', ['type' => 'entity_revision:invalid_entity_type_id'], 'foo', ['foo' => 'valid_id']); + } + + /** + * Tests the convert() method with an invalid dynamic entity type ID. + * + * @covers ::convert + */ + public function testConvertWithInvalidType() { + $this->setExpectedException(ParamNotConvertedException::class, 'The type definition "entity_revision_{entity_type_id}" is invalid. The expected format is "entity_revision:".'); + $this->converter->convert('valid_id', ['type' => 'entity_revision_{entity_type_id}'], 'foo', ['foo' => 'valid_id']); + } + + /** + * Tests the convert() method with an invalid dynamic entity type ID. + * + * @covers ::convert + */ + public function testConvertWithInvalidDynamicEntityType() { + $this->setExpectedException(ParamNotConvertedException::class, 'The "foo" parameter was not converted because the "invalid_entity_type_id" parameter is missing.'); + $this->converter->convert('valid_id', ['type' => 'entity_revision:{invalid_entity_type_id}'], 'foo', ['foo' => 'valid_id']); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php --- a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php Thu May 09 15:33:08 2019 +0100 @@ -23,15 +23,17 @@ * @covers ::processInbound * @dataProvider providerProcessInbound */ - public function testProcessInbound($path, $expected) { + public function testProcessInbound($frontpage_path, $path, $expected, array $expected_query = []) { $config_factory = $this->prophesize(ConfigFactoryInterface::class); $config = $this->prophesize(ImmutableConfig::class); $config_factory->get('system.site') ->willReturn($config->reveal()); $config->get('page.front') - ->willReturn('/node'); + ->willReturn($frontpage_path); $processor = new PathProcessorFront($config_factory->reveal()); - $this->assertEquals($expected, $processor->processInbound($path, new Request())); + $request = new Request(); + $this->assertEquals($expected, $processor->processInbound($path, $request)); + $this->assertEquals($expected_query, $request->query->all()); } /** @@ -39,8 +41,13 @@ */ public function providerProcessInbound() { return [ - ['/', '/node'], - ['/user', '/user'], + 'accessing frontpage' => ['/node', '/', '/node'], + 'accessing non frontpage' => ['/node', '/user', '/user'], + 'accessing frontpage with query parameters' => ['/node?example=muh', + '/', + '/node', + ['example' => 'muh'], + ], ]; } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionIsSatisfiedTest.php --- a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionIsSatisfiedTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionIsSatisfiedTest.php Thu May 09 15:33:08 2019 +0100 @@ -6,8 +6,10 @@ use Drupal\Core\DependencyInjection\ClassResolverInterface; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Language\LanguageDefault; use Drupal\Core\Plugin\Context\Context; use Drupal\Core\Plugin\Context\ContextDefinition; +use Drupal\Core\StringTranslation\TranslationManager; use Drupal\Core\TypedData\TypedDataManager; use Drupal\Core\Validation\ConstraintManager; use Drupal\Tests\Core\Plugin\Fixtures\InheritedContextDefinition; @@ -29,6 +31,7 @@ $namespaces = new \ArrayObject([ 'Drupal\\Core\\TypedData' => $this->root . '/core/lib/Drupal/Core/TypedData', 'Drupal\\Core\\Validation' => $this->root . '/core/lib/Drupal/Core/Validation', + 'Drupal\\Tests\\Core\\Plugin\\Fixtures' => $this->root . '/core/tests/Drupal/Tests/Core/Plugin/Fixtures', ]); $cache_backend = new NullBackend('cache'); $module_handler = $this->prophesize(ModuleHandlerInterface::class); @@ -42,8 +45,11 @@ $type_data_manager = new TypedDataManager($namespaces, $cache_backend, $module_handler->reveal(), $class_resolver->reveal()); $type_data_manager->setValidationConstraintManager(new ConstraintManager($namespaces, $cache_backend, $module_handler->reveal())); + $string_translation = new TranslationManager(new LanguageDefault([])); + $container = new ContainerBuilder(); $container->set('typed_data_manager', $type_data_manager); + $container->set('string_translation', $string_translation); \Drupal::setContainer($container); } @@ -60,6 +66,7 @@ * (optional) The value to set on the context, defaults to NULL. * * @covers ::isSatisfiedBy + * @covers ::dataTypeMatches * @covers ::getSampleValues * @covers ::getConstraintObjects * @@ -116,6 +123,16 @@ new InheritedContextDefinition('any'), new ContextDefinition('any'), ]; + $data['specific definition, generic requirement'] = [ + TRUE, + new ContextDefinition('test_data_type'), + new ContextDefinition('test_data_type:a_variant'), + ]; + $data['generic definition, specific requirement'] = [ + FALSE, + new ContextDefinition('test_data_type:a_variant'), + new ContextDefinition('test_data_type'), + ]; return $data; } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php --- a/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php Thu May 09 15:33:08 2019 +0100 @@ -13,8 +13,11 @@ use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Language\LanguageDefault; +use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\Core\Plugin\Context\EntityContext; use Drupal\Core\Plugin\Context\EntityContextDefinition; +use Drupal\Core\StringTranslation\TranslationManager; use Drupal\Core\TypedData\TypedDataManager; use Drupal\Core\Validation\ConstraintManager; use Drupal\Tests\UnitTestCase; @@ -75,11 +78,14 @@ $this->entityTypeBundleInfo = $this->prophesize(EntityTypeBundleInfoInterface::class); + $string_translation = new TranslationManager(new LanguageDefault([])); + $container = new ContainerBuilder(); $container->set('typed_data_manager', $type_data_manager); $container->set('entity_type.manager', $this->entityTypeManager->reveal()); $container->set('entity.manager', $this->entityManager->reveal()); $container->set('entity_type.bundle.info', $this->entityTypeBundleInfo->reveal()); + $container->set('string_translation', $string_translation); \Drupal::setContainer($container); } @@ -95,19 +101,20 @@ * @param mixed $value * (optional) The value to set on the context, defaults to NULL. */ - protected function assertRequirementIsSatisfied($expected, EntityContextDefinition $requirement, EntityContextDefinition $definition, $value = NULL) { + protected function assertRequirementIsSatisfied($expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL) { $context = new EntityContext($definition, $value); $this->assertSame($expected, $requirement->isSatisfiedBy($context)); } /** * @covers ::isSatisfiedBy + * @covers ::dataTypeMatches * @covers ::getSampleValues * @covers ::getConstraintObjects * * @dataProvider providerTestIsSatisfiedBy */ - public function testIsSatisfiedBy($expected, EntityContextDefinition $requirement, EntityContextDefinition $definition, $value = NULL) { + public function testIsSatisfiedBy($expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL) { $entity_storage = $this->prophesize(EntityStorageInterface::class); $content_entity_storage = $this->prophesize(ContentEntityStorageInterface::class); $this->entityTypeManager->getStorage('test_config')->willReturn($entity_storage->reveal()); @@ -169,12 +176,23 @@ EntityContextDefinition::fromEntityType($config), EntityContextDefinition::fromEntityType($config), ]; + $data['generic entity requirement, specific context'] = [ + TRUE, + new ContextDefinition('entity'), + EntityContextDefinition::fromEntityType($config), + ]; + $data['specific requirement, generic entity context'] = [ + FALSE, + EntityContextDefinition::fromEntityType($content), + new ContextDefinition('entity'), + ]; return $data; } /** * @covers ::isSatisfiedBy + * @covers ::dataTypeMatches * @covers ::getSampleValues * @covers ::getConstraintObjects * @@ -271,6 +289,7 @@ /** * @covers ::isSatisfiedBy + * @covers ::dataTypeMatches * @covers ::getSampleValues * @covers ::getConstraintObjects * diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php --- a/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,8 @@ namespace Drupal\Tests\Core\Plugin; -use Drupal\Component\Plugin\ConfigurablePluginInterface; +use Drupal\Component\Plugin\ConfigurableInterface; +use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface; use Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionTrait; use Drupal\Component\Plugin\Definition\PluginDefinition; @@ -20,8 +21,6 @@ use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\Core\Plugin\Context\ContextHandler; use Drupal\Core\Plugin\ContextAwarePluginInterface; -use Drupal\Core\TypedData\DataDefinition; -use Drupal\Core\TypedData\Plugin\DataType\StringData; use Drupal\Core\TypedData\TypedDataManager; use Drupal\Core\Validation\ConstraintManager; use Drupal\Tests\UnitTestCase; @@ -220,7 +219,7 @@ $data[] = [FALSE, $plugins, $plugins]; $plugins = [ - 'expected_array_plugin' => ['context' => []], + 'expected_array_plugin' => ['context_definitions' => []], 'expected_object_plugin' => new ContextAwarePluginDefinition(), ]; // No context, all plugins available. @@ -228,7 +227,7 @@ $plugins = [ 'expected_array_plugin' => [ - 'context' => ['context1' => new ContextDefinition('string')], + 'context_definitions' => ['context1' => new ContextDefinition('string')], ], 'expected_object_plugin' => (new ContextAwarePluginDefinition()) ->addContextDefinition('context1', new ContextDefinition('string')), @@ -241,7 +240,7 @@ $mismatched_context_definition = (new ContextDefinition('expected_data_type'))->setConstraints(['mismatched_constraint_name' => 'mismatched_constraint_value']); $plugins = [ 'expected_array_plugin' => [ - 'context' => ['context1' => $mismatched_context_definition], + 'context_definitions' => ['context1' => $mismatched_context_definition], ], 'expected_object_plugin' => (new ContextAwarePluginDefinition()) ->addContextDefinition('context1', $mismatched_context_definition), @@ -253,7 +252,7 @@ $optional_mismatched_context_definition->setRequired(FALSE); $plugins = [ 'expected_array_plugin' => [ - 'context' => ['context1' => $optional_mismatched_context_definition], + 'context_definitions' => ['context1' => $optional_mismatched_context_definition], ], 'expected_object_plugin' => (new ContextAwarePluginDefinition()) ->addContextDefinition('context1', $optional_mismatched_context_definition), @@ -264,7 +263,7 @@ $expected_context_definition = (new ContextDefinition('string'))->setConstraints(['Blank' => []]); $plugins = [ 'expected_array_plugin' => [ - 'context' => ['context1' => $expected_context_definition], + 'context_definitions' => ['context1' => $expected_context_definition], ], 'expected_object_plugin' => (new ContextAwarePluginDefinition()) ->addContextDefinition('context1', $expected_context_definition), @@ -276,7 +275,7 @@ $optional_expected_context_definition->setRequired(FALSE); $plugins = [ 'expected_array_plugin' => [ - 'context' => ['context1' => $optional_expected_context_definition], + 'context_definitions' => ['context1' => $optional_expected_context_definition], ], 'expected_object_plugin' => (new ContextAwarePluginDefinition()) ->addContextDefinition('context1', $optional_expected_context_definition), @@ -287,10 +286,10 @@ $unexpected_context_definition = (new ContextDefinition('unexpected_data_type'))->setConstraints(['mismatched_constraint_name' => 'mismatched_constraint_value']); $plugins = [ 'unexpected_array_plugin' => [ - 'context' => ['context1' => $unexpected_context_definition], + 'context_definitions' => ['context1' => $unexpected_context_definition], ], 'expected_array_plugin' => [ - 'context' => ['context2' => new ContextDefinition('string')], + 'context_definitions' => ['context2' => new ContextDefinition('string')], ], 'unexpected_object_plugin' => (new ContextAwarePluginDefinition()) ->addContextDefinition('context1', $unexpected_context_definition), @@ -314,20 +313,11 @@ * @covers ::applyContextMapping */ public function testApplyContextMapping() { - $context_hit_data = StringData::createInstance(DataDefinition::create('string')); - $context_hit_data->setValue('foo'); $context_hit = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface'); $context_hit->expects($this->atLeastOnce()) - ->method('getContextData') - ->will($this->returnValue($context_hit_data)); - $context_miss_data = StringData::createInstance(DataDefinition::create('string')); - $context_miss_data->setValue('bar'); - $context_hit->expects($this->atLeastOnce()) ->method('hasContextValue') ->willReturn(TRUE); $context_miss = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface'); - $context_miss->expects($this->never()) - ->method('getContextData'); $contexts = [ 'hit' => $context_hit, @@ -344,8 +334,8 @@ ->method('getContextDefinitions') ->will($this->returnValue(['hit' => $context_definition])); $plugin->expects($this->once()) - ->method('setContextValue') - ->with('hit', $context_hit_data); + ->method('setContext') + ->with('hit', $context_hit); // Make sure that the cacheability metadata is passed to the plugin context. $plugin_context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface'); @@ -385,11 +375,12 @@ ->method('getContextDefinitions') ->will($this->returnValue(['hit' => $context_definition])); $plugin->expects($this->never()) - ->method('setContextValue'); + ->method('setContext'); // No context, so no cacheability metadata can be passed along. - $plugin->expects($this->never()) - ->method('getContext'); + $plugin->expects($this->any()) + ->method('getContext') + ->willThrowException(new ContextException()); $this->setExpectedException(MissingValueContextException::class, 'Required contexts without a value: hit'); $this->contextHandler->applyContextMapping($plugin, $contexts); @@ -420,11 +411,12 @@ ->method('getContextDefinitions') ->will($this->returnValue(['optional' => $context_definition])); $plugin->expects($this->never()) - ->method('setContextValue'); + ->method('setContext'); // No context, so no cacheability metadata can be passed along. - $plugin->expects($this->never()) - ->method('getContext'); + $plugin->expects($this->any()) + ->method('getContext') + ->willThrowException(new ContextException()); $this->contextHandler->applyContextMapping($plugin, $contexts); } @@ -457,7 +449,7 @@ ->method('getContextDefinitions') ->will($this->returnValue(['hit' => $context_definition])); $plugin->expects($this->never()) - ->method('setContextValue'); + ->method('setContext'); $this->setExpectedException(MissingValueContextException::class, 'Required contexts without a value: hit'); $this->contextHandler->applyContextMapping($plugin, $contexts); @@ -491,7 +483,7 @@ ->method('getContextDefinitions') ->will($this->returnValue(['hit' => $context_definition])); $plugin->expects($this->never()) - ->method('setContextValue'); + ->method('setContext'); $this->contextHandler->applyContextMapping($plugin, $contexts); } @@ -500,13 +492,8 @@ * @covers ::applyContextMapping */ public function testApplyContextMappingConfigurableAssigned() { - $context_data = StringData::createInstance(DataDefinition::create('string')); - $context_data->setValue('foo'); $context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface'); $context->expects($this->atLeastOnce()) - ->method('getContextData') - ->will($this->returnValue($context_data)); - $context->expects($this->atLeastOnce()) ->method('hasContextValue') ->willReturn(TRUE); @@ -524,8 +511,8 @@ ->method('getContextDefinitions') ->will($this->returnValue(['hit' => $context_definition])); $plugin->expects($this->once()) - ->method('setContextValue') - ->with('hit', $context_data); + ->method('setContext') + ->with('hit', $context); // Make sure that the cacheability metadata is passed to the plugin context. $plugin_context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface'); @@ -562,7 +549,7 @@ ->method('getContextDefinitions') ->will($this->returnValue(['hit' => $context_definition])); $plugin->expects($this->never()) - ->method('setContextValue'); + ->method('setContext'); $this->setExpectedException(ContextException::class, 'Assigned contexts were not satisfied: miss'); $this->contextHandler->applyContextMapping($plugin, $contexts, ['miss' => 'name']); @@ -570,7 +557,7 @@ } -interface TestConfigurableContextAwarePluginInterface extends ContextAwarePluginInterface, ConfigurablePluginInterface { +interface TestConfigurableContextAwarePluginInterface extends ContextAwarePluginInterface, ConfigurableInterface, DependentPluginInterface { } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php --- a/core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,7 +2,11 @@ namespace Drupal\Tests\Core\Plugin; +use Drupal\Component\Plugin\ConfigurableInterface; use Drupal\Component\Plugin\Exception\PluginNotFoundException; +use Drupal\Component\Plugin\PluginInspectionInterface; +use Drupal\Component\Plugin\PluginManagerInterface; +use Drupal\Core\Plugin\DefaultLazyPluginCollection; use Drupal\Tests\Core\Plugin\Fixtures\TestConfigurablePlugin; /** @@ -14,7 +18,7 @@ /** * Stores all setup plugin instances. * - * @var \Drupal\Component\Plugin\ConfigurablePluginInterface[] + * @var \Drupal\Component\Plugin\ConfigurableInterface[] */ protected $pluginInstances; @@ -234,4 +238,32 @@ } + /** + * Tests that plugin methods are correctly attached to interfaces. + * + * @covers ::getConfiguration + */ + public function testConfigurableInterface() { + $configurable_plugin = $this->prophesize(ConfigurableInterface::class); + $configurable_config = ['id' => 'configurable', 'foo' => 'bar']; + $configurable_plugin->getConfiguration()->willReturn($configurable_config); + + $nonconfigurable_plugin = $this->prophesize(PluginInspectionInterface::class); + $nonconfigurable_config = ['id' => 'non-configurable', 'baz' => 'qux']; + $nonconfigurable_plugin->configuration = $nonconfigurable_config; + + $configurations = [ + 'configurable' => $configurable_config, + 'non-configurable' => $nonconfigurable_config, + ]; + + $plugin_manager = $this->prophesize(PluginManagerInterface::class); + $plugin_manager->createInstance('configurable', $configurable_config)->willReturn($configurable_plugin->reveal()); + $plugin_manager->createInstance('non-configurable', $nonconfigurable_config)->willReturn($nonconfigurable_plugin->reveal()); + + $collection = new DefaultLazyPluginCollection($plugin_manager->reveal(), $configurations); + $this->assertSame($configurations, $collection->getConfiguration()); + + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php --- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php Thu May 09 15:33:08 2019 +0100 @@ -4,8 +4,10 @@ use Drupal\Component\Plugin\Definition\PluginDefinition; use Drupal\Component\Plugin\Exception\PluginException; +use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\Core\Plugin\PluginFormInterface; use Drupal\Tests\UnitTestCase; @@ -132,6 +134,16 @@ } /** + * Tests the plugin manager behavior for a missing plugin ID. + */ + public function testGetDefinitionPluginNotFoundException() { + $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions); + + $this->setExpectedException(PluginNotFoundException::class, 'The "missing" plugin does not exist. Valid plugin IDs for Drupal\Tests\Core\Plugin\TestPluginManager are: apple, banana'); + $plugin_manager->getDefinition('missing'); + } + + /** * Tests the plugin manager with no cache and altering. */ public function testDefaultPluginManager() { @@ -451,6 +463,35 @@ return $data; } + /** + * @covers ::fixContextAwareDefinitions + * + * @group legacy + * @expectedDeprecation Providing context definitions via the "context" key is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use the "context_definitions" key instead. + */ + public function testFixContextAwareDefinitions() { + $first_definition = new ContextDefinition('first'); + $second_definition = new ContextDefinition('bar'); + + $definitions = $this->expectedDefinitions; + $definitions['apple']['context'] = ['incorrect' => $first_definition]; + $definitions['apple']['context_definitions'] = ['correct' => $second_definition]; + + $expected = $this->expectedDefinitions; + $expected['apple']['context']['correct'] = $second_definition; + $expected['apple']['context']['incorrect'] = $first_definition; + $expected['apple']['context_definitions']['correct'] = $second_definition; + $expected['apple']['context_definitions']['incorrect'] = $first_definition; + + $module_handler = $this->prophesize(ModuleHandlerInterface::class); + $plugin_manager = new TestPluginManager($this->namespaces, $definitions, $module_handler->reveal(), NULL); + $reflection = new \ReflectionMethod($plugin_manager, 'fixContextAwareDefinitions'); + $reflection->setAccessible(TRUE); + $reflection->invokeArgs($plugin_manager, [&$definitions]); + + $this->assertSame($expected, $definitions); + } + } class TestPluginManagerWithDefaults extends TestPluginManager { diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php --- a/core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,7 +2,7 @@ namespace Drupal\Tests\Core\Plugin; -use Drupal\Component\Plugin\ConfigurablePluginInterface; +use Drupal\Component\Plugin\ConfigurableInterface; use Drupal\Component\Plugin\PluginBase; use Drupal\Core\Plugin\DefaultSingleLazyPluginCollection; @@ -71,7 +71,7 @@ } -class ConfigurablePlugin extends PluginBase implements ConfigurablePluginInterface { +class ConfigurablePlugin extends PluginBase implements ConfigurableInterface { public function __construct(array $configuration, $plugin_id, $plugin_definition) { parent::__construct($configuration, $plugin_id, $plugin_definition); @@ -91,8 +91,4 @@ $this->configuration = $configuration; } - public function calculateDependencies() { - return []; - } - } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/Fixtures/Plugin/DataType/TestDataType.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/Fixtures/Plugin/DataType/TestDataType.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,25 @@ +derivatives[$item] = $base_plugin_definition; + $this->derivatives[$item]['provider'] = 'core'; + } + return $this->derivatives; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/Fixtures/TestConfigurablePlugin.php --- a/core/tests/Drupal/Tests/Core/Plugin/Fixtures/TestConfigurablePlugin.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/Fixtures/TestConfigurablePlugin.php Thu May 09 15:33:08 2019 +0100 @@ -2,10 +2,11 @@ namespace Drupal\Tests\Core\Plugin\Fixtures; -use Drupal\Component\Plugin\ConfigurablePluginInterface; +use Drupal\Component\Plugin\ConfigurableInterface; +use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Component\Plugin\PluginBase; -class TestConfigurablePlugin extends PluginBase implements ConfigurablePluginInterface { +class TestConfigurablePlugin extends PluginBase implements ConfigurableInterface, DependentPluginInterface { /** * {@inheritdoc} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php --- a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php Thu May 09 15:33:08 2019 +0100 @@ -5,6 +5,8 @@ use Drupal\Component\Plugin\Definition\PluginDefinitionInterface; use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Component\Plugin\PluginInspectionInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Plugin\Definition\DependentPluginDefinitionInterface; use Drupal\Core\Plugin\PluginDependencyTrait; use Drupal\Tests\UnitTestCase; @@ -24,6 +26,16 @@ public function testGetPluginDependencies(ProphecyInterface $plugin, $definition, array $expected) { $test_class = new TestPluginDependency(); + $module_handler = $this->prophesize(ModuleHandlerInterface::class); + $module_handler->moduleExists('test_module1')->willReturn(TRUE); + $module_handler->moduleExists('test_theme1')->willReturn(FALSE); + $test_class->setModuleHandler($module_handler->reveal()); + + $theme_handler = $this->prophesize(ThemeHandlerInterface::class); + $theme_handler->themeExists('test_module1')->willReturn(FALSE); + $theme_handler->themeExists('test_theme1')->willReturn(TRUE); + $test_class->setThemeHandler($theme_handler->reveal()); + $plugin->getPluginDefinition()->willReturn($definition); $actual = $test_class->getPluginDependencies($plugin->reveal()); @@ -46,6 +58,16 @@ public function testCalculatePluginDependencies(ProphecyInterface $plugin, $definition, array $expected) { $test_class = new TestPluginDependency(); + $module_handler = $this->prophesize(ModuleHandlerInterface::class); + $module_handler->moduleExists('test_module1')->willReturn(TRUE); + $module_handler->moduleExists('test_theme1')->willReturn(FALSE); + $test_class->setModuleHandler($module_handler->reveal()); + + $theme_handler = $this->prophesize(ThemeHandlerInterface::class); + $theme_handler->themeExists('test_module1')->willReturn(FALSE); + $theme_handler->themeExists('test_theme1')->willReturn(TRUE); + $test_class->setThemeHandler($theme_handler->reveal()); + $plugin->getPluginDefinition()->willReturn($definition); $test_class->calculatePluginDependencies($plugin->reveal()); @@ -65,7 +87,7 @@ 'module' => ['test_module2'], ]); - $data['dependent_plugin'] = [ + $data['dependent_plugin_from_module'] = [ $dependent_plugin, ['provider' => 'test_module1'], [ @@ -75,6 +97,28 @@ ], ], ]; + $data['dependent_plugin_from_core'] = [ + $dependent_plugin, + ['provider' => 'core'], + [ + 'module' => [ + 'core', + 'test_module2', + ], + ], + ]; + $data['dependent_plugin_from_theme'] = [ + $dependent_plugin, + ['provider' => 'test_theme1'], + [ + 'module' => [ + 'test_module2', + ], + 'theme' => [ + 'test_theme1', + ], + ], + ]; $data['array_with_config_dependencies'] = [ $plugin, @@ -120,6 +164,38 @@ return $data; } + /** + * @covers ::getPluginDependencies + * + * @group legacy + * @expectedDeprecated Declaring a dependency on an uninstalled module is deprecated in Drupal 8.7.0 and will not be supported in Drupal 9.0.0. + */ + public function testNeitherThemeNorModule() { + $test_class = new TestPluginDependency(); + + $plugin = $this->prophesize(PluginInspectionInterface::class); + $definition = $this->prophesize(PluginDefinitionInterface::class); + $definition->getProvider()->willReturn('neither_theme_nor_module'); + + $module_handler = $this->prophesize(ModuleHandlerInterface::class); + $module_handler->moduleExists('neither_theme_nor_module')->willReturn(FALSE); + $test_class->setModuleHandler($module_handler->reveal()); + + $theme_handler = $this->prophesize(ThemeHandlerInterface::class); + $theme_handler->themeExists('neither_theme_nor_module')->willReturn(FALSE); + $test_class->setThemeHandler($theme_handler->reveal()); + + $plugin->getPluginDefinition()->willReturn($definition); + + $actual = $test_class->getPluginDependencies($plugin->reveal()); + $expected = [ + 'module' => [ + 'neither_theme_nor_module', + ], + ]; + $this->assertEquals($expected, $actual); + } + } class TestPluginDependency { @@ -129,6 +205,26 @@ getPluginDependencies as public; } + protected $moduleHandler; + + protected $themeHandler; + + public function setModuleHandler(ModuleHandlerInterface $module_handler) { + $this->moduleHandler = $module_handler; + } + + public function setThemeHandler(ThemeHandlerInterface $theme_handler) { + $this->themeHandler = $theme_handler; + } + + protected function moduleHandler() { + return $this->moduleHandler; + } + + protected function themeHandler() { + return $this->themeHandler; + } + /** * @return array[] */ diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php --- a/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ use Drupal\Core\Discovery\YamlDiscovery; use Drupal\Core\Routing\RouteBuilder; use Drupal\Core\Routing\RouteBuildEvent; +use Drupal\Core\Routing\RouteCompiler; use Drupal\Core\Routing\RoutingEvents; use Drupal\Tests\UnitTestCase; use Symfony\Component\Routing\Route; @@ -152,6 +153,9 @@ ->will($this->returnValue(['test_module' => $routes])); $route_collection = $routing_fixtures->sampleRouteCollection(); + foreach ($route_collection->all() as $route) { + $route->setOption('compiler_class', RouteCompiler::class); + } $route_build_event = new RouteBuildEvent($route_collection); // Ensure that the alter routes events are fired. @@ -274,6 +278,47 @@ $this->assertFalse($this->routeBuilder->rebuildIfNeeded()); } + /** + * Tests routes can use alternative compiler classes. + * + * @see \Drupal\Core\Routing\RouteBuilder::rebuild() + */ + public function testRebuildWithOverriddenRouteClass() { + $this->lock->expects($this->once()) + ->method('acquire') + ->with('router_rebuild') + ->will($this->returnValue(TRUE)); + $this->yamlDiscovery->expects($this->once()) + ->method('findAll') + ->will($this->returnValue([ + 'test_module' => [ + 'test_route.override' => [ + 'path' => '/test_route_override', + 'options' => [ + 'compiler_class' => 'Class\Does\Not\Exist', + ], + ], + 'test_route' => [ + 'path' => '/test_route', + ], + ], + ])); + + $container = new ContainerBuilder(); + $container->set('test_module.route_service', new TestRouteSubscriber()); + + // Test that routes can have alternative compiler classes. + $route_collection_filled = new RouteCollection(); + $route_collection_filled->add('test_route.override', new Route('/test_route_override', [], [], ['compiler_class' => 'Class\Does\Not\Exist'])); + $route_collection_filled->add('test_route', new Route('/test_route', [], [], ['compiler_class' => RouteCompiler::class])); + $route_build_event = new RouteBuildEvent($route_collection_filled); + $this->dispatcher->expects($this->at(0)) + ->method('dispatch') + ->with(RoutingEvents::DYNAMIC, $route_build_event); + + $this->assertTrue($this->routeBuilder->rebuild()); + } + } /** diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php --- a/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php Thu May 09 15:33:08 2019 +0100 @@ -54,7 +54,7 @@ */ public function testCompilation() { $route = new Route('/test/{something}/more'); - $route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler'); + $route->setOption('compiler_class', RouteCompiler::class); $compiled = $route->compile(); $this->assertEquals($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was incorrect.'); @@ -70,7 +70,7 @@ $route = new Route('/test/{something}/more/{here}', [ 'here' => 'there', ]); - $route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler'); + $route->setOption('compiler_class', RouteCompiler::class); $compiled = $route->compile(); $this->assertEquals($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was not correct.'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php --- a/core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,7 @@ use Drupal\Core\Site\Settings; use Drupal\Core\StackMiddleware\ReverseProxyMiddleware; +use Drupal\Tests\Traits\ExpectDeprecationTrait; use Drupal\Tests\UnitTestCase; use Symfony\Component\HttpFoundation\Request; @@ -13,6 +14,7 @@ * @group StackMiddleware */ class ReverseProxyMiddlewareTest extends UnitTestCase { + use ExpectDeprecationTrait; /** * @var \Symfony\Component\HttpKernel\HttpKernelInterface|\PHPUnit_Framework_MockObject_MockObject @@ -35,10 +37,10 @@ $middleware = new ReverseProxyMiddleware($this->mockHttpKernel, $settings); // Mock a request object. - $request = $this->getMock('Symfony\Component\HttpFoundation\Request', ['setTrustedHeaderName', 'setTrustedProxies']); - // setTrustedHeaderName() should never fire. + $request = $this->getMock('Symfony\Component\HttpFoundation\Request', ['setTrustedProxies']); + // setTrustedProxies() should never fire. $request->expects($this->never()) - ->method('setTrustedHeaderName'); + ->method('setTrustedProxies'); // Actually call the check method. $middleware->handle($request); } @@ -47,15 +49,11 @@ * Tests that subscriber sets trusted headers when reverse proxy is set. * * @dataProvider reverseProxyEnabledProvider - * - * @group legacy - * - * @expectedDeprecation The "Symfony\Component\HttpFoundation\Request::setTrustedHeaderName()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead. */ - public function testReverseProxyEnabled($provided_settings) { + public function testReverseProxyEnabled($provided_settings, $expected_trusted_header_set) { // Enable reverse proxy and add test values. $settings = new Settings(['reverse_proxy' => 1] + $provided_settings); - $this->trustedHeadersAreSet($settings); + $this->trustedHeadersAreSet($settings, $expected_trusted_header_set); } /** @@ -63,40 +61,98 @@ */ public function reverseProxyEnabledProvider() { return [ - [ + 'Proxy with default trusted headers' => [ + ['reverse_proxy_addresses' => ['127.0.0.2', '127.0.0.3']], + Request::HEADER_FORWARDED | Request::HEADER_X_FORWARDED_ALL, + ], + 'Proxy with AWS trusted headers' => [ [ - 'reverse_proxy_header' => 'X_FORWARDED_FOR_CUSTOMIZED', - 'reverse_proxy_proto_header' => 'X_FORWARDED_PROTO_CUSTOMIZED', - 'reverse_proxy_host_header' => 'X_FORWARDED_HOST_CUSTOMIZED', - 'reverse_proxy_port_header' => 'X_FORWARDED_PORT_CUSTOMIZED', - 'reverse_proxy_forwarded_header' => 'FORWARDED_CUSTOMIZED', 'reverse_proxy_addresses' => ['127.0.0.2', '127.0.0.3'], + 'reverse_proxy_trusted_headers' => Request::HEADER_X_FORWARDED_AWS_ELB, + ], + Request::HEADER_X_FORWARDED_AWS_ELB, + ], + 'Proxy with custom trusted headers' => [ + [ + 'reverse_proxy_addresses' => ['127.0.0.2', '127.0.0.3'], + 'reverse_proxy_trusted_headers' => Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST, + ], + Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST, + ], + ]; + } + + /** + * Tests that subscriber sets trusted headers when reverse proxy is set. + * + * @dataProvider reverseProxyEnabledProviderLegacy + * @group legacy + */ + public function testReverseProxyEnabledLegacy($provided_settings, $expected_trusted_header_set, array $expected_deprecations) { + if (!method_exists(Request::class, 'setTrustedHeaderName')) { + $this->markTestSkipped('The method \Symfony\Component\HttpFoundation\Request::setTrustedHeaderName() does not exist therefore testing on Symfony 4 or greater.'); + } + $this->expectedDeprecations($expected_deprecations); + // Enable reverse proxy and add test values. + $settings = new Settings(['reverse_proxy' => 1] + $provided_settings); + $this->trustedHeadersAreSet($settings, $expected_trusted_header_set); + } + + /** + * Data provider for testReverseProxyEnabled. + */ + public function reverseProxyEnabledProviderLegacy() { + return [ + 'Proxy with deprecated custom headers' => [ + [ + 'reverse_proxy_addresses' => ['127.0.0.2', '127.0.0.3'], + 'reverse_proxy_host_header' => NULL, + 'reverse_proxy_forwarded_header' => NULL, + ], + // For AWS configuration forwarded and x_forwarded_host headers are not + // trusted. + Request::HEADER_X_FORWARDED_AWS_ELB, + [ + 'The \'reverse_proxy_host_header\' setting in settings.php is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use the \'reverse_proxy_trusted_headers\' setting instead. See https://www.drupal.org/node/3030558', + 'The \'reverse_proxy_forwarded_header\' setting in settings.php is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use the \'reverse_proxy_trusted_headers\' setting instead. See https://www.drupal.org/node/3030558', + 'The "Symfony\Component\HttpFoundation\Request::setTrustedHeaderName()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.', + ], + ], + 'Proxy with deprecated custom header' => [ + [ + 'reverse_proxy_addresses' => ['127.0.0.2', '127.0.0.3'], + 'reverse_proxy_forwarded_header' => NULL, + ], + // The forwarded header is not trusted which is the same as trusting all + // the x_forwarded headers. + Request::HEADER_X_FORWARDED_ALL, + [ + 'The \'reverse_proxy_forwarded_header\' setting in settings.php is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use the \'reverse_proxy_trusted_headers\' setting instead. See https://www.drupal.org/node/3030558', + 'The "Symfony\Component\HttpFoundation\Request::setTrustedHeaderName()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.', ], ], ]; } /** - * Tests that trusted header methods are called. + * Tests that trusted headers are set correctly. * - * \Symfony\Component\HttpFoundation\Request::setTrustedHeaderName() and * \Symfony\Component\HttpFoundation\Request::setTrustedProxies() should * always be called when reverse proxy settings are enabled. * * @param \Drupal\Core\Site\Settings $settings * The settings object that holds reverse proxy configuration. + * @param int $expected_trusted_header_set + * The expected bit value returned by + * \Symfony\Component\HttpFoundation\Request::getTrustedHeaderSet() */ - protected function trustedHeadersAreSet(Settings $settings) { + protected function trustedHeadersAreSet(Settings $settings, $expected_trusted_header_set) { $middleware = new ReverseProxyMiddleware($this->mockHttpKernel, $settings); $request = new Request(); $middleware->handle($request); - $this->assertSame($settings->get('reverse_proxy_header'), $request->getTrustedHeaderName($request::HEADER_X_FORWARDED_FOR)); - $this->assertSame($settings->get('reverse_proxy_proto_header'), $request->getTrustedHeaderName($request::HEADER_X_FORWARDED_PROTO)); - $this->assertSame($settings->get('reverse_proxy_host_header'), $request->getTrustedHeaderName($request::HEADER_X_FORWARDED_HOST)); - $this->assertSame($settings->get('reverse_proxy_port_header'), $request->getTrustedHeaderName($request::HEADER_X_FORWARDED_PORT)); - $this->assertSame($settings->get('reverse_proxy_forwarded_header'), $request->getTrustedHeaderName($request::HEADER_FORWARDED)); $this->assertSame($settings->get('reverse_proxy_addresses'), $request->getTrustedProxies()); + $this->assertSame($expected_trusted_header_set, $request->getTrustedHeaderSet()); } } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php --- a/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,7 @@ namespace Drupal\Tests\Core\TempStore; +use Drupal\Core\TempStore\Lock; use Drupal\Tests\UnitTestCase; use Drupal\Core\TempStore\PrivateTempStore; use Drupal\Core\TempStore\TempStoreException; @@ -182,7 +183,9 @@ ->will($this->returnValue(FALSE)); $metadata = $this->tempStore->getMetadata('test'); - $this->assertObjectHasAttribute('owner', $metadata); + $this->assertInstanceOf(Lock::class, $metadata); + $this->assertObjectHasAttribute('ownerId', $metadata); + $this->assertObjectHasAttribute('updated', $metadata); // Data should get removed. $this->assertObjectNotHasAttribute('data', $metadata); @@ -190,6 +193,36 @@ } /** + * @covers ::getMetadata + * @expectedDeprecation Using the "owner" public property of a TempStore lock is deprecated in Drupal 8.7.0 and will not be allowed in Drupal 9.0.0. Use \Drupal\Core\TempStore\Lock::getOwnerId() instead. See https://www.drupal.org/node/3025869. + * @group legacy + */ + public function testGetMetadataOwner() { + $this->keyValue->expects($this->once()) + ->method('get') + ->with('1:test') + ->will($this->returnValue($this->ownObject)); + + $metadata = $this->tempStore->getMetadata('test'); + $this->assertSame(1, $metadata->owner); + } + + /** + * @covers ::getMetadata + * @expectedDeprecation Using the "updated" public property of a TempStore lock is deprecated in Drupal 8.7.0 and will not be allowed in Drupal 9.0.0. Use \Drupal\Core\TempStore\Lock::getUpdated() instead. See https://www.drupal.org/node/3025869. + * @group legacy + */ + public function testGetMetadataUpdated() { + $this->keyValue->expects($this->once()) + ->method('get') + ->with('1:test') + ->will($this->returnValue($this->ownObject)); + + $metadata = $this->tempStore->getMetadata('test'); + $this->assertSame($metadata->getUpdated(), $metadata->updated); + } + + /** * Tests the locking in the delete() method. * * @covers ::delete diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php --- a/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,7 @@ namespace Drupal\Tests\Core\TempStore; +use Drupal\Core\TempStore\Lock; use Drupal\Tests\UnitTestCase; use Drupal\Core\TempStore\SharedTempStore; use Drupal\Core\TempStore\TempStoreException; @@ -263,7 +264,8 @@ ->will($this->returnValue(FALSE)); $metadata = $this->tempStore->getMetadata('test'); - $this->assertObjectHasAttribute('owner', $metadata); + $this->assertInstanceOf(Lock::class, $metadata); + $this->assertObjectHasAttribute('updated', $metadata); // Data should get removed. $this->assertObjectNotHasAttribute('data', $metadata); @@ -271,6 +273,36 @@ } /** + * @covers ::getMetadata + * @expectedDeprecation Using the "owner" public property of a TempStore lock is deprecated in Drupal 8.7.0 and will not be allowed in Drupal 9.0.0. Use \Drupal\Core\TempStore\Lock::getOwnerId() instead. See https://www.drupal.org/node/3025869. + * @group legacy + */ + public function testGetMetadataOwner() { + $this->keyValue->expects($this->once()) + ->method('get') + ->with('test') + ->will($this->returnValue($this->ownObject)); + + $metadata = $this->tempStore->getMetadata('test'); + $this->assertSame(1, $metadata->owner); + } + + /** + * @covers ::getMetadata + * @expectedDeprecation Using the "updated" public property of a TempStore lock is deprecated in Drupal 8.7.0 and will not be allowed in Drupal 9.0.0. Use \Drupal\Core\TempStore\Lock::getUpdated() instead. See https://www.drupal.org/node/3025869. + * @group legacy + */ + public function testGetMetadataUpdated() { + $this->keyValue->expects($this->once()) + ->method('get') + ->with('test') + ->will($this->returnValue($this->ownObject)); + + $metadata = $this->tempStore->getMetadata('test'); + $this->assertSame($metadata->getUpdated(), $metadata->updated); + } + + /** * Tests the delete() method. * * @covers ::delete diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Template/AttributeTest.php --- a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php Thu May 09 15:33:08 2019 +0100 @@ -7,6 +7,7 @@ use Drupal\Core\Template\Attribute; use Drupal\Core\Template\AttributeArray; use Drupal\Core\Template\AttributeString; +use Drupal\Core\Template\Loader\StringLoader; use Drupal\Tests\UnitTestCase; use Drupal\Component\Render\MarkupInterface; @@ -261,14 +262,12 @@ * * @covers ::removeClass * @covers ::addClass - * - * @group legacy */ public function testTwigAddRemoveClasses($template, $expected, $seed_attributes = []) { - $loader = new \Twig_Loader_String(); + $loader = new StringLoader(); $twig = new \Twig_Environment($loader); $data = ['attributes' => new Attribute($seed_attributes)]; - $result = $twig->render($template, $data); + $result = $twig->createTemplate($template)->render($data); $this->assertEquals($expected, $result); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php --- a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,6 @@ * Tests the twig extension. * * @group Template - * @group legacy * * @coversDefaultClass \Drupal\Core\Template\TwigExtension */ @@ -74,11 +73,10 @@ * Tests the escaping * * @dataProvider providerTestEscaping - * - * @group legacy */ public function testEscaping($template, $expected) { - $twig = new \Twig_Environment(NULL, [ + $loader = new \Twig_Loader_Filesystem(); + $twig = new \Twig_Environment($loader, [ 'debug' => TRUE, 'cache' => FALSE, 'autoescape' => 'html', @@ -86,7 +84,8 @@ ]); $twig->addExtension($this->systemUnderTest); - $nodes = $twig->parse($twig->tokenize($template)); + $name = '__string_template_test__'; + $nodes = $twig->parse($twig->tokenize(new \Twig_Source($template, $name))); $this->assertSame($expected, $nodes->getNode('body') ->getNode(0) @@ -126,8 +125,6 @@ /** * Tests the active_theme function. - * - * @group legacy */ public function testActiveTheme() { $active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme') @@ -140,7 +137,7 @@ ->method('getActiveTheme') ->willReturn($active_theme); - $loader = new \Twig_Loader_String(); + $loader = new StringLoader(); $twig = new \Twig_Environment($loader); $twig->addExtension($this->systemUnderTest); $result = $twig->render('{{ active_theme() }}'); @@ -151,15 +148,18 @@ * Tests the format_date filter. */ public function testFormatDate() { - $this->dateFormatter->expects($this->exactly(2)) + $this->dateFormatter->expects($this->exactly(1)) ->method('format') - ->willReturn('1978-11-19'); + ->will($this->returnCallback(function ($timestamp) { + return date('Y-m-d', $timestamp); + })); $loader = new StringLoader(); $twig = new \Twig_Environment($loader); $twig->addExtension($this->systemUnderTest); - $result = $twig->render('{{ time|format_date("html_date") }}'); - $this->assertEquals($this->dateFormatter->format('html_date'), $result); + $timestamp = strtotime('1978-11-19'); + $result = $twig->render('{{ time|format_date("html_date") }}', ['time' => $timestamp]); + $this->assertEquals('1978-11-19', $result); } /** @@ -177,7 +177,7 @@ ->method('getActiveTheme') ->willReturn($active_theme); - $loader = new \Twig_Loader_String(); + $loader = new StringLoader(); $twig = new \Twig_Environment($loader); $twig->addExtension($this->systemUnderTest); $result = $twig->render('{{ active_theme_path() }}'); @@ -188,11 +188,10 @@ * Tests the escaping of objects implementing MarkupInterface. * * @covers ::escapeFilter - * - * @group legacy */ public function testSafeStringEscaping() { - $twig = new \Twig_Environment(NULL, [ + $loader = new \Twig_Loader_Filesystem(); + $twig = new \Twig_Environment($loader, [ 'debug' => TRUE, 'cache' => FALSE, 'autoescape' => 'html', @@ -274,11 +273,10 @@ /** * @covers ::escapeFilter * @covers ::bubbleArgMetadata - * - * @group legacy */ public function testEscapeWithGeneratedLink() { - $twig = new \Twig_Environment(NULL, [ + $loader = new \Twig_Loader_Filesystem(); + $twig = new \Twig_Environment($loader, [ 'debug' => TRUE, 'cache' => FALSE, 'autoescape' => 'html', @@ -336,7 +334,8 @@ * @covers ::createAttribute */ public function testCreateAttribute() { - $loader = new StringLoader(); + $name = '__string_template_test_1__'; + $loader = new \Twig_Loader_Array([$name => "{% for iteration in iterations %}
{% endfor %}"]); $twig = new \Twig_Environment($loader); $twig->addExtension($this->systemUnderTest); @@ -345,12 +344,15 @@ ['id' => 'puppies', 'data-value' => 'foo', 'data-lang' => 'en'], [], ]; - $result = $twig->render("{% for iteration in iterations %}
{% endfor %}", ['iterations' => $iterations]); + $result = $twig->render($name, ['iterations' => $iterations]); $expected = '
'; $this->assertEquals($expected, $result); // Test default creation of empty attribute object and using its method. - $result = $twig->render("
"); + $name = '__string_template_test_2__'; + $loader = new \Twig_Loader_Array([$name => "
"]); + $twig->setLoader($loader); + $result = $twig->render($name); $expected = '
'; $this->assertEquals($expected, $result); } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php --- a/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php Thu May 09 15:33:08 2019 +0100 @@ -16,7 +16,6 @@ * Tests the twig sandbox policy. * * @group Template - * @group legacy * * @coversDefaultClass \Drupal\Core\Template\TwigSandboxPolicy */ diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,49 @@ + + + + +bar + +EOT; + $test->_setRawContent($raw_content); + $this->assertNotContains('foo', $test->_getTextContent()); + $this->assertNotContains('', $test->_getTextContent()); + $this->assertContains('bar', $test->_getTextContent()); + } + +} + +class TestClass { + use AssertContentTrait; + + public function _setRawContent($content) { + $this->setRawContent($content); + } + + public function _getTextContent() { + return $this->getTextContent(); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,21 @@ +assertTrue(class_exists('\Drupal\phpunit_test\PhpUnitTestDummyClass'), 'Class provided by test module was not autoloaded.'); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Theme/RegistryTest.php --- a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php Thu May 09 15:33:08 2019 +0100 @@ -111,7 +111,7 @@ 'libraries_extend' => [], 'libraries' => [], 'extension' => '.twig', - 'base_themes' => [], + 'base_theme_extensions' => [], ]); $test_stable = new ActiveTheme([ @@ -124,7 +124,7 @@ 'libraries_extend' => [], 'libraries' => [], 'extension' => '.twig', - 'base_themes' => [], + 'base_theme_extensions' => [], ]); $this->themeManager->expects($this->exactly(2)) @@ -192,7 +192,7 @@ static::$functions['user'] = $defined_functions; $theme = $this->prophesize(ActiveTheme::class); - $theme->getBaseThemes()->willReturn([]); + $theme->getBaseThemeExtensions()->willReturn([]); $theme->getName()->willReturn('test'); $theme->getEngine()->willReturn('twig'); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php --- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php Thu May 09 15:33:08 2019 +0100 @@ -152,6 +152,9 @@ /** * Tests the generate() method with the route. * + * The set_active_class option is set to TRUE to ensure we do not get the + * active class and the data-drupal-link-system-path attribute. + * * @covers ::generate */ public function testGenerateNoLink() { @@ -163,6 +166,7 @@ $url = Url::fromRoute(''); $url->setUrlGenerator($this->urlGenerator); + $url->setOption('set_active_class', TRUE); $result = $this->linkGenerator->generate('Test', $url); $this->assertTrue($result instanceof GeneratedNoLink); @@ -170,6 +174,32 @@ } /** + * Tests the generate() method with the route. + * + * The set_active_class option is set to TRUE to ensure we do not get the + * active class and the data-drupal-link-system-path attribute. + * + * @covers ::generate + */ + public function testGenerateNone() { + $this->urlGenerator->expects($this->once()) + ->method('generateFromRoute') + ->with('', [], ['set_active_class' => TRUE] + $this->defaultOptions) + ->willReturn((new GeneratedUrl())->setGeneratedUrl('')); + + $this->moduleHandler->expects($this->once()) + ->method('alter') + ->with('link', $this->isType('array')); + + $url = Url::fromRoute(''); + $url->setUrlGenerator($this->urlGenerator); + $url->setOption('set_active_class', TRUE); + + $result = $this->linkGenerator->generate('Test', $url); + $this->assertSame('Test', (string) $result); + } + + /** * Tests the generate() method with an external URL. * * The set_active_class option is set to TRUE to ensure this does not cause diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Listeners/AfterSymfonyListener.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Listeners/AfterSymfonyListener.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,33 @@ +registerErrorHandler($test); + } if ($this->willBeIsolated($test)) { putenv('DRUPAL_EXPECTED_DEPRECATIONS_SERIALIZE=' . tempnam(sys_get_temp_dir(), 'exdep')); } @@ -107,57 +118,69 @@ */ public static function getSkippedDeprecations() { return [ - 'The Twig_Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', 'Install profile will be a mandatory parameter in Drupal 9.0.', - 'The revision_user revision metadata key is not set.', - 'The revision_created revision metadata key is not set.', - 'The revision_log_message revision metadata key is not set.', 'MigrateCckField is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Annotation\MigrateField instead.', 'MigrateCckFieldPluginManager is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Annotation\MigrateFieldPluginManager instead.', 'MigrateCckFieldPluginManagerInterface is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Annotation\MigrateFieldPluginManagerInterface instead.', 'The "plugin.manager.migrate.cckfield" service is deprecated. You should use the \'plugin.manager.migrate.field\' service instead. See https://www.drupal.org/node/2751897', 'Drupal\system\Tests\Update\DbUpdatesTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use \Drupal\FunctionalTests\Update\DbUpdatesTrait instead. See https://www.drupal.org/node/2896640.', - 'Using "null" for the value of node "count" of "Drupal\Core\Template\TwigNodeTrans" is deprecated since version 1.25 and will be removed in 2.0.', - 'Using "null" for the value of node "options" of "Drupal\Core\Template\TwigNodeTrans" is deprecated since version 1.25 and will be removed in 2.0.', - 'Using "null" for the value of node "plural" of "Drupal\Core\Template\TwigNodeTrans" is deprecated since version 1.25 and will be removed in 2.0.', 'Providing settings under \'handler_settings\' is deprecated and will be removed before 9.0.0. Move the settings in the root of the configuration array. See https://www.drupal.org/node/2870971.', - 'AssertLegacyTrait::getAllOptions() is scheduled for removal in Drupal 9.0.0. Use $element->findAll(\'xpath\', \'option\') instead.', - 'assertNoPattern() is deprecated and scheduled for removal in Drupal 9.0.0. Use $this->assertSession()->responseNotMatches($pattern) instead. See https://www.drupal.org/node/2864262.', - 'Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "/system-test/Ȅchȏ/meφΩ/{text}".', - 'Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "/somewhere/{item}/over/the/קainbow".', - 'Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "/place/meφω".', - 'Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "/PLACE/meφω".', 'The Drupal\editor\Plugin\EditorBase::settingsFormValidate method is deprecated since version 8.3.x and will be removed in 9.0.0.', 'The Drupal\migrate\Plugin\migrate\process\Migration is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use Drupal\migrate\Plugin\migrate\process\MigrationLookup', 'Drupal\system\Plugin\views\field\BulkForm is deprecated in Drupal 8.5.x, will be removed before Drupal 9.0.0. Use \Drupal\views\Plugin\views\field\BulkForm instead. See https://www.drupal.org/node/2916716.', 'The numeric plugin for watchdog.wid field is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Must use standard plugin instead. See https://www.drupal.org/node/2876378.', - 'Using an instance of "Twig_Filter_Function" for filter "testfilter" is deprecated since version 1.21. Use Twig_SimpleFilter instead.', - 'The Twig_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', - 'Using an instance of "Twig_Function_Function" for function "testfunc" is deprecated since version 1.21. Use Twig_SimpleFunction instead.', - 'The Twig_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', - 'The Twig_Filter_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', - 'The Twig_Filter class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', - 'The Twig_Function_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', - 'Referencing the "twig_extension_test.test_extension" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', 'Passing in arguments the legacy way is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Provide the right parameter names in the method, similar to controllers. See https://www.drupal.org/node/2894819', - 'DateField is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\datetime\Plugin\migrate\field\DateField instead.', 'The Drupal\editor\Plugin\EditorBase::settingsFormSubmit method is deprecated since version 8.3.x and will be removed in 9.0.0.', - 'CommentVariable is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\node\Plugin\migrate\source\d6\NodeType instead.', - 'CommentType is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\node\Plugin\migrate\source\d7\NodeType instead.', - 'CommentVariablePerCommentType is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\node\Plugin\migrate\source\d6\NodeType instead.', - 'The Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use Drupal\migrate_drupal\Plugin\migrate\source\d6\VariableTranslation', - 'Implicit cacheability metadata bubbling (onto the global render context) in normalizers is deprecated since Drupal 8.5.0 and will be removed in Drupal 9.0.0. Use the "cacheability" serialization context instead, for explicit cacheability metadata bubbling. See https://www.drupal.org/node/2918937', - 'Adding or retrieving messages prior to the container being initialized was deprecated in Drupal 8.5.0 and this functionality will be removed before Drupal 9.0.0. Please report this usage at https://www.drupal.org/node/2928994.', 'The "serializer.normalizer.file_entity.hal" normalizer service is deprecated: it is obsolete, it only remains available for backwards compatibility.', 'The Symfony\Component\ClassLoader\ApcClassLoader class is deprecated since Symfony 3.3 and will be removed in 4.0. Use `composer install --apcu-autoloader` instead.', // The following deprecation is not triggered by DrupalCI testing since it // is a Windows only deprecation. Remove when core no longer uses // WinCacheClassLoader in \Drupal\Core\DrupalKernel::initializeSettings(). 'The Symfony\Component\ClassLoader\WinCacheClassLoader class is deprecated since Symfony 3.3 and will be removed in 4.0. Use `composer install --apcu-autoloader` instead.', - 'The Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler class is deprecated since Symfony 3.4 and will be removed in 4.0. Implement `SessionUpdateTimestampHandlerInterface` or extend `AbstractSessionHandler` instead.', - 'The "session_handler.write_check" service relies on the deprecated "Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler" class. It should either be deprecated or its implementation upgraded.', - 'Not setting the strict option of the Choice constraint to true is deprecated since Symfony 3.4 and will throw an exception in 4.0.', + // The following deprecation message is skipped for testing purposes. + '\Drupal\Tests\SkippedDeprecationTest deprecation', + // These deprecations are triggered by symfony/psr-http-message-factory + // 1.2, which can be installed if you update dependencies on php 7 or + // higher + 'The "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class is deprecated since symfony/psr-http-message-bridge 1.2, use PsrHttpFactory instead.', + 'The "psr7.http_message_factory" service relies on the deprecated "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class. It should either be deprecated or its implementation upgraded.', ]; } + /** + * Registers an error handler that wraps Symfony's DeprecationErrorHandler. + * + * @see \Symfony\Bridge\PhpUnit\DeprecationErrorHandler + * @see \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait + */ + protected function registerErrorHandler($test) { + $deprecation_handler = function ($type, $msg, $file, $line, $context = []) { + // Skip listed deprecations. + if ($type === E_USER_DEPRECATED && in_array($msg, self::getSkippedDeprecations(), TRUE)) { + return; + } + return call_user_func($this->previousHandler, $type, $msg, $file, $line, $context); + }; + + if ($this->previousHandler) { + set_error_handler($deprecation_handler); + return; + } + $this->previousHandler = set_error_handler($deprecation_handler); + + // Register another listener so that we can remove the error handler before + // Symfony's DeprecationErrorHandler checks that it is the currently + // registered handler. Note this is done like this to ensure the error + // handler is removed after SymfonyTestsListenerTrait::endTest() is called. + // SymfonyTestsListenerTrait has its own error handler that needs to be + // removed before this one. + $test_result_object = $test->getTestResultObject(); + $reflection_class = new \ReflectionClass($test_result_object); + $reflection_property = $reflection_class->getProperty('listeners'); + $reflection_property->setAccessible(TRUE); + $listeners = $reflection_property->getValue($test_result_object); + $listeners[] = new AfterSymfonyListener(); + $reflection_property->setValue($test_result_object, $listeners); + } + } diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Listeners/DrupalComponentTestListenerTrait.php --- a/core/tests/Drupal/Tests/Listeners/DrupalComponentTestListenerTrait.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/Listeners/DrupalComponentTestListenerTrait.php Thu May 09 15:33:08 2019 +0100 @@ -2,8 +2,8 @@ namespace Drupal\Tests\Listeners; -use Drupal\KernelTests\KernelTestBase;; -use Drupal\Tests\BrowserTestBase;; +use Drupal\KernelTests\KernelTestBase; +use Drupal\Tests\BrowserTestBase; use Drupal\Tests\UnitTestCase; use PHPUnit\Framework\AssertionFailedError; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/Listeners/Legacy/AfterSymfonyListener.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/Listeners/Legacy/AfterSymfonyListener.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,19 @@ +setUpHtmlOutput(); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/RequirementsPageTrait.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/RequirementsPageTrait.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,79 @@ +assertNoText('Errors found'); + $this->assertWarningSummaries(['PHP']); + $this->clickLink('try again'); + $this->checkForMetaRefresh(); + } + } + + /** + * Continues installation when the expected warnings are found. + * + * This function is no longer called by any core test, but it is retained for + * use by contrib/custom tests. It is not deprecated, because it remains the + * recommended function to call for its purpose. + * + * @param string[] $expected_warnings + * A list of warning summaries to expect on the requirements screen (e.g. + * 'PHP', 'PHP OPcode caching', etc.). If only the expected warnings + * are found, the test will click the "continue anyway" link to go to the + * next screen of the installer. If an expected warning is not found, or if + * a warning not in the list is present, a fail is raised. + */ + protected function continueOnExpectedWarnings($expected_warnings = []) { + $this->assertNoText('Errors found'); + $this->assertWarningSummaries($expected_warnings); + $this->clickLink('continue anyway'); + $this->checkForMetaRefresh(); + } + + /** + * Assert the given warning summaries are present on the page. + * + * If an expected warning is not found, or if a warning not in the list is + * present, a fail is raised. + * + * @param string[] $warning_summaries + * A list of warning summaries to expect on the requirements screen (e.g. + * 'PHP', 'PHP OPcode caching', etc.). + */ + protected function assertWarningSummaries(array $warning_summaries) { + // Allow only details elements that are directly after the warning header + // or each other. There is no guaranteed wrapper we can rely on across + // distributions. When there are multiple warnings, the selectors will be: + // - h3#warning+details summary + // - h3#warning+details+details summary + // - etc. + // We add one more selector than expected warnings to confirm that there + // isn't any other warning before clicking the link. + // @todo Make this more reliable in + // https://www.drupal.org/project/drupal/issues/2927345. + $selectors = []; + for ($i = 0; $i <= count($warning_summaries); $i++) { + $selectors[] = 'h3#warning' . implode('', array_fill(0, $i + 1, '+details')) . ' summary'; + } + $warning_elements = $this->cssSelect(implode(', ', $selectors)); + + // Confirm that there are only the expected warnings. + $warnings = []; + foreach ($warning_elements as $warning) { + $warnings[] = trim($warning->getText()); + } + $this->assertEquals($warning_summaries, $warnings); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/SkippedDeprecationTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/SkippedDeprecationTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,30 @@ +addToAssertionCount(1); + } + + /** + * Tests skipping deprecations in unit tests multiple times. + * + * @see \Drupal\Tests\Listeners\DeprecationListenerTrait::getSkippedDeprecations() + */ + public function testSkippingDeprecationsAgain() { + @trigger_error('\Drupal\Tests\SkippedDeprecationTest deprecation', E_USER_DEPRECATED); + $this->addToAssertionCount(1); + } + +} diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/TestFileCreationTrait.php --- a/core/tests/Drupal/Tests/TestFileCreationTrait.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/TestFileCreationTrait.php Thu May 09 15:33:08 2019 +0100 @@ -71,7 +71,7 @@ $original = drupal_get_path('module', 'simpletest') . '/files'; $files = file_scan_directory($original, '/(html|image|javascript|php|sql)-.*/'); foreach ($files as $file) { - file_unmanaged_copy($file->uri, PublicStream::basePath()); + \Drupal::service('file_system')->copy($file->uri, PublicStream::basePath()); } $this->generatedTestFiles = TRUE; diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/UiHelperTrait.php --- a/core/tests/Drupal/Tests/UiHelperTrait.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/UiHelperTrait.php Thu May 09 15:33:08 2019 +0100 @@ -245,7 +245,7 @@ $this->drupalGet('user/login'); $this->submitForm([ - 'name' => $account->getUsername(), + 'name' => $account->getAccountName(), 'pass' => $account->passRaw, ], t('Log in')); diff -r 129ea1e6d783 -r af1871eacc83 core/tests/Drupal/Tests/WebAssert.php --- a/core/tests/Drupal/Tests/WebAssert.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/Drupal/Tests/WebAssert.php Thu May 09 15:33:08 2019 +0100 @@ -418,6 +418,30 @@ } /** + * Checks that page HTML (response content) contains text. + * + * @param string|object $text + * Text value. Any non-string value will be cast to string. + * + * @throws ExpectationException + */ + public function responseContains($text) { + parent::responseContains((string) $text); + } + + /** + * Checks that page HTML (response content) does not contains text. + * + * @param string|object $text + * Text value. Any non-string value will be cast to string. + * + * @throws ExpectationException + */ + public function responseNotContains($text) { + parent::responseNotContains((string) $text); + } + + /** * Asserts a condition. * * The parent method is overridden because it is a private method. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/README.md --- a/core/tests/README.md Thu Feb 28 13:21:36 2019 +0000 +++ b/core/tests/README.md Thu May 09 15:33:08 2019 +0100 @@ -1,140 +1,141 @@ # Running tests -## Functional tests +## Setting up -* Run the functional tests: - ``` - export SIMPLETEST_DB='mysql://root@localhost/dev_d8'; - export SIMPLETEST_BASE_URL='http://d8.dev'; - ./vendor/bin/phpunit -c core --testsuite functional; - ``` +### PHP dependencies -Note: functional tests have to be invoked with a user in the same group as the -web server user. You can either configure Apache (or nginx) to run as your own -system user or run tests as a privileged user instead. +You need the Drupal core development dependencies installed, in order to run +any tests. You can install them using Composer by running +``` +composer install +``` +in the Drupal root directory. These dependencies should not be installed on a +production site. -Invoking tests with a user that is in the same group as the web server will -require you to ensure Drupal keeps gid stickybits when creating new directories. +### Test directory -`$settings['file_chmod_directory'] = 02775;` +Create a directory called sites/simpletest and make sure that it is writable by +the web server and/or all users. -To develop locally, a straightforward - but also less secure - approach is to -run tests as your own system user. To achieve that, change the default Apache -user to run as your system user. Typically, you'd need to modify -`/etc/apache2/envvars` on Linux or `/etc/apache2/httpd.conf` on Mac. +### PHPUnit configuration -Example for Linux: +Copy the core/phpunit.xml.dist file to phpunit.xml, and place it somewhere +convenient (inside the core directory may not be the best spot, since that +directory may be managed by Composer or Git). You can use the -c option on the +command line to tell PHPUnit where this file is (use the full path). +Settings to change in this file: +* SIMPLETEST_BASE_URL: The URL of your site +* SIMPLETEST_DB: The URL of your Drupal database +* The bootstrap attribute of the top-level phpunit tag, to take into account + the location of the file +* BROWSERTEST_OUTPUT_DIRECTORY: Set to sites/simpletest/browser_output; + you will also want to uncomment the printerClass attribute of the + top-level phpunit tag. + +### Additional setup for JavaScript tests + +To run JavaScript tests based on the +\Drupal\FunctionalJavascriptTests\WebDriverTestBase base class, you will need +to install the following additional software: + +* Google Chrome or Chromium browser +* chromedriver (tested with version 2.45) -- see + https://sites.google.com/a/chromium.org/chromedriver/ +* PHP 7.1 or higher + +## Running unit, functional, and kernel tests + +The PHPUnit executable is vendor/bin/phpunit -- you will need to locate your +vendor directory (which may be outside the Drupal root). + +Here are commands to run one test class, list groups, and run all the tests in +a particular group: ``` -export APACHE_RUN_USER= -export APACHE_RUN_GROUP= +./vendor/bin/phpunit -c /path/to/your/phpunit.xml path/to/your/class/file.php +./vendor/bin/phpunit --list-groups +./vendor/bin/phpunit -c /path/to/your/phpunit.xml --group Groupname ``` -Example for Mac: +More information on running tests can be found at +https://www.drupal.org/docs/8/phpunit/running-phpunit-tests +## Running Functional JavaScript tests + +You can run JavaScript tests that are based on the +\Drupal\FunctionalJavascriptTests\WebDriverTestBase base class in the same way +as other PHPUnit tests, except that before you start, you will need to start +chromedriver using port 4444, and keep it running: ``` -User -Group +/path/to/chromedriver --port=4444 ``` -## Functional javascript tests +## Running Nightwatch tests -Javascript tests use the Selenium2Driver which allows you to control a -big range of browsers. By default Drupal uses chromedriver to run tests. -For help installing and starting selenium, see http://mink.behat.org/en/latest/drivers/selenium2.html +* Ensure your vendor directory is populated + (e.g. by running `composer install`) +* If you're running PHP 7.0 or greater you will need to upgrade PHPUnit with + `composer run-script drupal-phpunit-upgrade` +* Install [Node.js](https://nodejs.org/en/download/) and + [yarn](https://yarnpkg.com/en/docs/install). The versions required are + specificed inside core/package.json in the `engines` field +* Install + [Google Chrome](https://www.google.com/chrome/browser/desktop/index.html) +* Inside the `core` folder, run `yarn install` +* Configure the nightwatch settings by copying `.env.example` to `.env` and + editing as necessary. +* Ensure you have a web server running (as instructed in `.env`) +* Again inside the `core` folder, run `yarn test:nightwatch` to run the tests. + By default this will output reports to `core/reports` +* Nightwatch will run tests for core, as well as contrib and custom modules and + themes. It will search for tests located under folders with the pattern + `**/tests/**/Nightwatch/(Tests|Commands|Assertions)` +* To run only core tests, run `yarn test:nightwatch --tag core` +* To skip running core tests, run `yarn test:nightwatch --skiptags core` +* To run a single test, run e.g. + `yarn test:nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js` -* Make sure you have a recent version of chrome installed - -* Install selenium-server-standalone and chromedriver - -Example for Mac: - -``` -brew install selenium-server-standalone; -brew install chromedriver; -``` - -* Before running tests make sure that selenium-server is running -``` -selenium-server -port 4444 -``` - -* Set the correct driver args and run the tests: -``` -export MINK_DRIVER_ARGS_WEBDRIVER='["chrome", null, "http://localhost:4444/wd/hub"]'; -./vendor/bin/phpunit -c core --testsuite functional-javascript; -``` - -* It is possible to use alternate browsers if the required dependencies are -installed. For example to use Firefox: - -``` -export MINK_DRIVER_ARGS_WEBDRIVER='["firefox", null, "http://localhost:4444/wd/hub"]'; -./vendor/bin/phpunit -c core --testsuite functional-javascript; -``` - -* To force all BrowserTestBase (including legacy JavascriptTestBase) tests to use -webdriver: - -``` -export MINK_DRIVER_CLASS='Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver'; -./vendor/bin/phpunit -c core --testsuite functional-javascript; -``` - -## Running legacy javascript tests - -Older javascript test may use the PhantomJSDriver. To run these tests you will -have to install and start PhantomJS. - -* Start PhantomJS: - ``` - phantomjs --ssl-protocol=any --ignore-ssl-errors=true ./vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /dev/null & - ``` - -* Then you can run the test: -``` -./vendor/bin/phpunit -c core --testsuite functional-javascript; -``` - -## Running tests with a different user - -If the default user is e.g. `www-data`, the above functional tests will have to -be invoked with sudo instead: - -``` -export SIMPLETEST_DB='mysql://root@localhost/dev_d8'; -export SIMPLETEST_BASE_URL='http://d8.dev'; -sudo -u www-data -E ./vendor/bin/phpunit -c core --testsuite functional; -sudo -u www-data -E ./vendor/bin/phpunit -c core --testsuite functional-javascript; -``` - -## Nightwatch tests - -- Ensure your vendor directory is populated (e.g. by running `composer install`) -- If you're running PHP 7.0 or greater you will need to upgrade PHPUnit with `composer run-script drupal-phpunit-upgrade` -- Install [Node.js](https://nodejs.org/en/download/) and [yarn](https://yarnpkg.com/en/docs/install). The versions required are specificed inside core/package.json in the `engines` field -- Install [Google Chrome](https://www.google.com/chrome/browser/desktop/index.html) -- Inside the `core` folder, run `yarn install` -- Configure the nightwatch settings by copying `.env.example` to `.env` and editing as necessary. -- Ensure you have a web server running (as instructed in `.env`) -- Again inside the `core` folder, run `yarn test:nightwatch` to run the tests. By default this will output reports to `core/reports` -- Nightwatch will run tests for core, as well as contrib and custom modules and themes. It will search for tests located under folders with the pattern `**/tests/**/Nightwatch/(Tests|Commands|Assertions)` -- To run only core tests, run `yarn test:nightwatch --tag core` -- To skip running core tests, run `yarn test:nightwatch --skiptags core` -- To run a single test, run e.g. `yarn test:nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js` - -Nightwatch tests can be placed in any folder with the pattern `**/tests/**/Nightwatch/(Tests|Commands|Assertions)`. For example: +Nightwatch tests, as well as custom commands, assertions and pages, can be +placed in any folder with the pattern +`**/tests/**/Nightwatch/(Tests|Commands|Assertions|Pages)`. For example: ``` tests/Nightwatch/Tests src/tests/Nightwatch/Tests tests/src/Nightwatch/Tests tests/Nightwatch/Commands +tests/src/Nightwatch/Assertions +tests/src/Nightwatch/Pages ``` -It's helpful to follow existing patterns for test placement, so for the action module they would go in `core/modules/action/tests/src/Nightwatch`. -The Nightwatch configuration, as well as global tests, commands, and assertions which span many modules/systems, are located in `core/tests/Drupal/Nightwatch`. +It's helpful to follow existing patterns for test placement, so for the action +module they would go in `core/modules/action/tests/src/Nightwatch`. +The Nightwatch configuration, as well as global tests, commands, and assertions +which span many modules/systems, are located in `core/tests/Drupal/Nightwatch`. -If your core directory is located in a subfolder (e.g. `docroot`), then you can edit the search directory in `.env` to pick up tests outside of your Drupal directory. -Tests outside of the `core` folder will run in the version of node you have installed. If you want to transpile with babel (e.g. to use `import` statements) outside of core, -then add your own babel config to the root of your project. For example, if core is located under `docroot/core`, then you could run `yarn add babel-preset-env` inside -`docroot`, then copy the babel settings from `docroot/core/package.json` into `docroot/package.json`. +If your core directory is located in a subfolder (e.g. `docroot`), then you can +edit the search directory in `.env` to pick up tests outside of your Drupal +directory. Tests outside of the `core` folder will run in the version of node +you have installed. If you want to transpile with babel (e.g. to use `import` +statements) outside of core, then add your own babel config to the root of your +project. For example, if core is located under `docroot/core`, then you could +run `yarn add babel-preset-env` inside `docroot`, then copy the babel settings +from `docroot/core/package.json` into `docroot/package.json`. + +## Troubleshooting test running + +If you run into file permission problems while running tests, you may need to +invoke the phpunit executable with a user in the same group as the web server +user, or with access to files owned by the web server user. For example: +``` +sudo -u www-data ./vendor/bin/phpunit -c /path/to/your/phpunit.xml --group Groupname +``` + +If you have permission problems accessing files after running tests, try +putting +``` +$settings['file_chmod_directory'] = 02775; +``` +in your settings.php or local.settings.php file. + +You may need to use absolute paths in your phpunit.xml file, and/or in your +phpunit command arguments. diff -r 129ea1e6d783 -r af1871eacc83 core/tests/fixtures/config_install/multilingual.tar.gz Binary file core/tests/fixtures/config_install/multilingual.tar.gz has changed diff -r 129ea1e6d783 -r af1871eacc83 core/tests/fixtures/config_install/testing_config_install.tar.gz Binary file core/tests/fixtures/config_install/testing_config_install.tar.gz has changed diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/color/preview.css --- a/core/themes/bartik/color/preview.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/color/preview.css Thu May 09 15:33:08 2019 +0100 @@ -1,114 +1,114 @@ /* ---------- Preview Styles ----------- */ .js .color-preview { + float: none !important; clear: both; - float: none !important; } .color-preview { + overflow: hidden; + margin-bottom: 10px; + word-wrap: break-word; background-color: #fff; font-family: Georgia, "Times New Roman", Times, serif; font-size: 14px; line-height: 1.5; - overflow: hidden; - word-wrap: break-word; - margin-bottom: 10px; } .color-preview-header { + position: relative; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - position: relative; } .color-preview-logo { float: left; padding: 15px; } .color-preview-site-name { - color: #686868; - font-weight: normal; - font-size: 1.821em; - line-height: 1; margin-bottom: 30px; margin-left: 15px; /* LTR */ padding-top: 34px; + color: #686868; + font-size: 1.821em; + font-weight: normal; + line-height: 1; } [dir="rtl"] .color-preview-site-name { + margin-right: 15px; margin-left: 0; - margin-right: 15px; } .color-preview-main-menu { clear: both; padding: 0 15px 3px; } .color-preview-main-menu-links a { + padding: 0.6em 1em 0.4em; color: #d9d9d9; - padding: 0.6em 1em 0.4em; } .color-preview-main-menu-links { - font-size: 0.929em; margin: 0; padding: 0; + font-size: 0.929em; } .color-preview-main-menu-links a { color: #333; + border-top-left-radius: 8px; + border-top-right-radius: 8px; background: #ccc; background: rgba(255, 255, 255, 0.7); text-shadow: 0 1px #eee; - border-top-left-radius: 8px; - border-top-right-radius: 8px; } .color-preview-main-menu-links a:hover, .color-preview-main-menu-links a:focus { + cursor: pointer; + text-decoration: none; background: #eee; background: rgba(255, 255, 255, 0.95); - text-decoration: none; - cursor: pointer; } .color-preview-main-menu-links li a.is-active { + border-bottom: none; background: #fff; - border-bottom: none; } .color-preview-main-menu-links li { display: inline; + padding: 0.6em 0 0.4em; list-style-type: none; - padding: 0.6em 0 0.4em; } .color-preview-sidebar, .color-preview-content { + position: relative; display: inline; float: left; /* LTR */ - position: relative; } [dir="rtl"] .color-preview-sidebar, [dir="rtl"] .color-preview-content { float: right; } .color-preview-sidebar { + width: 210px; margin-left: 15px; /* LTR */ - width: 210px; } [dir="rtl"] .color-preview-sidebar { + margin-right: 15px; margin-left: 0; - margin-right: 15px; } .color-preview-content { + width: 26.5em; margin-left: 30px; /* LTR */ - width: 26.5em; } [dir="rtl"] .color-preview-content { + margin-right: 30px; margin-left: 0; - margin-right: 30px; } .color-preview-sidebar .preview-block { - border: 1px solid; margin: 20px 0; padding: 15px 20px; + border: 1px solid; } .color-preview-sidebar h2 { - border-bottom: 1px solid #d6d6d6; - font-weight: normal; margin-top: 0; margin-right: 0; margin-left: 0; padding-bottom: 5px; + border-bottom: 1px solid #d6d6d6; text-shadow: 0 1px 0 #fff; + font-weight: normal; } .color-preview .preview-block .preview-content { margin-top: 1em; @@ -118,21 +118,21 @@ margin-top: 0; } .color-preview-main { + margin-top: 20px; margin-bottom: 40px; - margin-top: 20px; } .color-preview-page-title { + margin: 1em 0 0.5em; font-size: 2em; font-weight: normal; line-height: 1; - margin: 1em 0 0.5em; } .color-preview-footer-wrapper { + display: block !important; + padding: 20px 20px 25px; color: #c0c0c0; color: rgba(255, 255, 255, 0.65); - display: block !important; font-size: 0.857em; - padding: 20px 20px 25px; } .color-preview-footer-wrapper a { color: #fcfcfc; @@ -140,36 +140,36 @@ } .color-preview-footer-wrapper a:hover, .color-preview-footer-wrapper a:focus { + text-decoration: underline; color: #fefefe; color: rgba(255, 255, 255, 0.95); - text-decoration: underline; } .color-preview-footer-wrapper .preview-footer-column { + position: relative; display: inline; float: left; /* LTR */ + width: 220px; padding: 0 10px; - position: relative; - width: 220px; } [dir="rtl"] .color-preview-footer-wrapper .preview-footer-column { float: right; } .color-preview-footer-wrapper .preview-block { + margin: 20px 0; + padding: 10px; border: 1px solid #444; border-color: rgba(255, 255, 255, 0.1); - margin: 20px 0; - padding: 10px; } .color-preview-footer-columns .preview-block-menu { - border: none; margin: 0; padding: 0; + border: none; } .color-preview-footer-columns h2 { - border-bottom: 1px solid #555; - border-color: rgba(255, 255, 255, 0.15); padding-bottom: 3px; text-transform: uppercase; + border-color: rgba(255, 255, 255, 0.15); + border-bottom: 1px solid #555; } .color-preview-footer-columns .preview-content { margin-top: 0; @@ -183,26 +183,26 @@ padding-right: 0; } .color-preview-footer-columns .preview-content li { + margin: 0; + padding: 0; list-style: none; list-style-image: none; - margin: 0; - padding: 0; } .color-preview-footer-columns .preview-content li a { - border-bottom: 1px solid #555; - border-color: rgba(255, 255, 255, 0.15); display: block; - line-height: 1.2; padding: 0.8em 2px 0.8em 20px; /* LTR */ text-indent: -15px; + border-color: rgba(255, 255, 255, 0.15); + border-bottom: 1px solid #555; + line-height: 1.2; } [dir="rtl"] .color-preview-footer-columns .preview-content li a { + padding-right: 20px; padding-left: 2px; - padding-right: 20px; } .color-preview-footer-columns .preview-content li a:hover, .color-preview-footer-columns .preview-content li a:focus { + text-decoration: none; background-color: #1f1f21; background-color: rgba(255, 255, 255, 0.05); - text-decoration: none; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/base/elements.css --- a/core/themes/bartik/css/base/elements.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/base/elements.css Thu May 09 15:33:08 2019 +0100 @@ -8,10 +8,10 @@ } body { min-height: 100%; - line-height: 1.5; word-wrap: break-word; font-family: Georgia, "Times New Roman", Times, serif; font-size: 87.5%; + line-height: 1.5; } a, a.link { @@ -42,43 +42,43 @@ h1, .heading-a { margin: 1em 0 0.5em; + color: #000; + font-size: 1.357em; font-weight: inherit; - font-size: 1.357em; - color: #000; } h2, .heading-b { margin: 1em 0 0.5em; + font-size: 1.143em; font-weight: inherit; - font-size: 1.143em; } h3, .heading-c { margin: 1em 0 0.5em; + font-size: 1.092em; font-weight: inherit; - font-size: 1.092em; } h4, .heading-d { margin: 1em 0 0.5em; + font-size: 1.05em; font-weight: inherit; - font-size: 1.05em; } h5, .heading-e { margin: 1em 0 0.5em; + letter-spacing: 0.1em; + text-transform: uppercase; + font-size: 0.889em; font-weight: inherit; - font-size: 0.889em; - text-transform: uppercase; - letter-spacing: 0.1em; } h6, .heading-f { margin: 1em 0 0.5em; + letter-spacing: 0.1em; + text-transform: uppercase; + font-size: 0.67em; font-weight: inherit; - font-size: 0.67em; - text-transform: uppercase; - letter-spacing: 0.1em; } p { margin: 0 0 1.2em; @@ -88,35 +88,35 @@ } blockquote { - background: #f7f7f7; - border-left: 1px solid #bbb; /* LTR */ - font-style: italic; margin: 1.5em 10px; padding: 0.5em 10px; + border-left: 1px solid #bbb; /* LTR */ + background: #f7f7f7; + font-style: italic; } [dir="rtl"] blockquote { + border-right: 1px solid #bbb; border-left: none; - border-right: 1px solid #bbb; } blockquote:before { + margin-right: 0.2em; /* LTR */ + content: "\201C"; + vertical-align: -0.4em; color: #bbb; - content: "\201C"; font-size: 3em; line-height: 0.1em; - margin-right: 0.2em; /* LTR */ - vertical-align: -0.4em; } [dir="rtl"] blockquote:before { + margin-right: 0; + margin-left: 0.2em; content: "\201D"; - margin-left: 0.2em; - margin-right: 0; } blockquote:after { + content: "\201D"; + vertical-align: -0.45em; color: #bbb; - content: "\201D"; font-size: 3em; line-height: 0.1em; - vertical-align: -0.45em; } [dir="rtl"] blockquote:after { content: "\201C"; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/colors.css --- a/core/themes/bartik/css/colors.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/colors.css Thu May 09 15:33:08 2019 +0100 @@ -14,8 +14,8 @@ background-color: #fff; } .tabs ul.primary li.is-active a { + border-bottom-color: #fff; background-color: #fff; - border-bottom-color: #fff; } #header { background-color: #1d84c3; @@ -37,8 +37,8 @@ color: #23aeff; } .sidebar .block { + border-color: #f9f9f9; background-color: #f6f6f2; - border-color: #f9f9f9; } .site-footer { background: #292929; @@ -58,8 +58,8 @@ /* ---------- Color Form ----------- */ [dir="rtl"] .color-form .color-palette { + margin-right: 20px; margin-left: 0; - margin-right: 20px; } [dir="rtl"] .color-form .form-item label { float: right; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/book.css --- a/core/themes/bartik/css/components/book.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/book.css Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,7 @@ border-top: 1px solid #d6d6d6; } .book-navigation .book-pager { + margin: 0; + border-top: 1px solid #d6d6d6; border-bottom: 1px solid #d6d6d6; - border-top: 1px solid #d6d6d6; - margin: 0; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/buttons.css --- a/core/themes/bartik/css/components/buttons.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/buttons.css Thu May 09 15:33:08 2019 +0100 @@ -4,37 +4,37 @@ */ .button { + display: inline-block; + padding: 0.25em 1.063em; + cursor: pointer; + text-align: center; + color: #3a3a3a; + border: 1px solid #e4e4e4; + border-right-color: #d2d2d2; + border-bottom-color: #b4b4b4; + border-left-color: #d2d2d2; + border-radius: 1em; background-color: #fff; background-image: -webkit-linear-gradient(top, #f3f3f3, #e8e8e8); background-image: linear-gradient(to bottom, #f3f3f3, #e8e8e8); - border: 1px solid #e4e4e4; - border-bottom-color: #b4b4b4; - border-left-color: #d2d2d2; - border-right-color: #d2d2d2; - color: #3a3a3a; - cursor: pointer; font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; font-size: 0.929em; font-weight: normal; - text-align: center; - padding: 0.25em 1.063em; - border-radius: 1em; - display: inline-block; line-height: normal; } .button:hover, .button:active, .button:focus { + text-decoration: none; + color: #5a5a5a; background: #dedede; - color: #5a5a5a; - text-decoration: none; } .button.is-disabled:hover, .button.is-disabled:active, .button.is-disabled:focus, .button.is-disabled { + cursor: default; + color: #717171; + border-color: #bbb; background: #ededed; - border-color: #bbb; - color: #717171; - cursor: default; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/captions.css --- a/core/themes/bartik/css/components/captions.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/captions.css Thu May 09 15:33:08 2019 +0100 @@ -3,16 +3,16 @@ margin-bottom: 1.2em; } .caption > * { - background: #f3f3f3; padding: 0.5ex; border: 1px solid #ccc; + background: #f3f3f3; } .caption > figcaption { + padding-top: 0.5ex; + text-align: center; border: 1px solid #ccc; border-top: none; - padding-top: 0.5ex; font-size: small; - text-align: center; } /* Override Bartik's default blockquote and pre styles when captioned. */ diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/comments.css --- a/core/themes/bartik/css/components/comments.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/comments.css Thu May 09 15:33:08 2019 +0100 @@ -14,9 +14,9 @@ font-size: 0.934em; } .comment { + display: table; margin-bottom: 19px; vertical-align: top; - display: table; } [dir="rtl"] .comment { direction: rtl; @@ -57,20 +57,20 @@ .comment__content { position: relative; display: table-cell; + width: 100%; padding: 10px 25px 10px 25px; vertical-align: top; - width: 100%; + word-break: break-all; border: 1px solid #d3d7d9; font-size: 0.929em; line-height: 1.6; - word-break: break-all; } .comment__content:before { - content: ''; position: absolute; + top: 20px; right: 100%; /* LTR */ - top: 20px; + content: ""; border-top: 20px solid transparent; border-right: 20px solid #d3d7d9; /* LTR */ border-bottom: 20px solid transparent; @@ -82,22 +82,22 @@ border-left: 20px solid #d3d7d9; } .comment__content:after { - content: ''; position: absolute; + top: 20px; right: 100%; /* LTR */ - top: 20px; + margin-right: -1px; /* LTR */ + content: ""; border-top: 20px solid transparent; border-right: 20px solid #fff; /* LTR */ border-bottom: 20px solid transparent; - margin-right: -1px; /* LTR */ } [dir="rtl"] .comment__content:after { right: auto; left: 100%; + margin-right: 0; + margin-left: -1px; border-right: none; border-left: 20px solid #fff; - margin-right: 0; - margin-left: -1px; } .comment__content h3 { margin-top: 0.94em; @@ -127,8 +127,8 @@ background: #fff4f4; } [dir="rtl"] .comment--unpublished { + margin-right: 0; margin-left: 5px; - margin-right: 0; padding: 5px 5px 5px 2px; } @@ -137,8 +137,8 @@ * change this to .comment--unpublished. */ .unpublished .comment-text .comment-arrow { + border-right: 1px solid #fff4f4; border-left: 1px solid #fff4f4; - border-right: 1px solid #fff4f4; } .unpublished { padding: 20px 15px 0; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/demo-block.css --- a/core/themes/bartik/css/components/demo-block.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/demo-block.css Thu May 09 15:33:08 2019 +0100 @@ -4,14 +4,14 @@ */ .demo-block { - background: #ff6; - border: 1px dotted #9f9e00; - color: #000; - font: 90% "Lucida Grande", "Lucida Sans Unicode", sans-serif; margin: 5px; padding: 5px; text-align: center; + color: #000; + border: 1px dotted #9f9e00; + background: #ff6; text-shadow: none; + font: 90% "Lucida Grande", "Lucida Sans Unicode", sans-serif; } .featured-top .demo-block { font-size: 0.55em; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/dropbutton.component.css --- a/core/themes/bartik/css/components/dropbutton.component.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/dropbutton.component.css Thu May 09 15:33:08 2019 +0100 @@ -4,25 +4,25 @@ */ .js .dropbutton-widget { + overflow: hidden; + margin: 0.125em 0; + cursor: pointer; + text-align: center; + color: #3a3a3a; border: 1px solid; border-color: #e4e4e4 #d2d2d2 #b4b4b4 #d2d2d2; + border-radius: 1em; background-color: #fff; background-image: -webkit-linear-gradient(top, #f3f3f3, #e8e8e8); background-image: linear-gradient(to bottom, #f3f3f3, #e8e8e8); - color: #3a3a3a; - cursor: pointer; - text-align: center; - margin: 0.125em 0; - border-radius: 1em; - overflow: hidden; } .js .dropbutton-widget:hover { border-color: #e4e4e4 #d2d2d2 #b4b4b4 #d2d2d2; } .js .dropbutton-widget .button { - border: none; margin: 0; padding: 0.32em 1em; + border: none; background: transparent none; } .js .dropbutton-multiple .dropbutton-widget, @@ -30,8 +30,8 @@ padding: 0; } .js .dropbutton-multiple .dropbutton-widget .dropbutton { + position: relative; padding-right: 2em; /* LTR */ - position: relative; } .js[dir="rtl"] .dropbutton-multiple .dropbutton-widget .dropbutton { padding-right: 0; @@ -60,6 +60,6 @@ } .js .dropbutton .dropbutton-action:hover, .js .dropbutton a:hover { + border-bottom: 0 none; background: #dedede; - border-bottom: 0 none; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/featured-bottom.css --- a/core/themes/bartik/css/components/featured-bottom.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/featured-bottom.css Thu May 09 15:33:08 2019 +0100 @@ -4,8 +4,8 @@ */ .featured-bottom { + border-top: 1px solid #e7e7e7; background: rgba(30, 50, 10, 0.08); - border-top: 1px solid #e7e7e7; } .featured-bottom .region { padding: 0 20px; @@ -13,11 +13,11 @@ @media all and (min-width: 560px) { .featured-bottom .region { + position: relative; float: left; /* LTR */ - position: relative; box-sizing: border-box; + width: 33%; padding: 20px 15px 30px; - width: 33%; } [dir="rtl"] .featured-bottom .region { float: right; @@ -30,11 +30,11 @@ } } .featured-bottom h2 { + margin-bottom: 0.6em; + text-align: center; color: #000; + text-shadow: 0 1px 0 #fff; font-size: 1.4em; - margin-bottom: 0.6em; - text-shadow: 0 1px 0 #fff; - text-align: center; line-height: 1em; } .featured-bottom .block { diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/featured-top.css --- a/core/themes/bartik/css/components/featured-top.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/featured-top.css Thu May 09 15:33:08 2019 +0100 @@ -4,16 +4,16 @@ */ .featured-top { + margin: 0; + padding: 20px 10px 45px; text-align: center; + border-bottom: 1px solid #e7e7e7; + background: #f0f0f0; + background: rgba(30, 50, 10, 0.08); + text-shadow: 1px 1px #fff; font-size: 1.2em; font-weight: normal; line-height: 1.4; - padding: 20px 10px 45px; - margin: 0; - background: #f0f0f0; - background: rgba(30, 50, 10, 0.08); - border-bottom: 1px solid #e7e7e7; - text-shadow: 1px 1px #fff; } .featured-top h2 { font-size: 1.2em; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/feed-icon.css --- a/core/themes/bartik/css/components/feed-icon.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/feed-icon.css Thu May 09 15:33:08 2019 +0100 @@ -4,9 +4,9 @@ */ .feed-icon { - border-bottom: 1px solid transparent; display: inline-block; padding-bottom: 2px; + border-bottom: 1px solid transparent; } .feed-icon:focus, diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/field.css --- a/core/themes/bartik/css/components/field.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/field.css Thu May 09 15:33:08 2019 +0100 @@ -8,13 +8,13 @@ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .field--type-entity-reference .field__label { - font-weight: normal; margin: 0; padding-right: 5px; /* LTR */ + font-weight: normal; } [dir="rtl"] .field--type-entity-reference .field__label { + padding-right: 0; padding-left: 5px; - padding-right: 0; } .field--type-entity-reference .field__label, .field--type-entity-reference ul.links { @@ -25,8 +25,8 @@ font-size: 0.821em; } .field--type-entity-reference ul.links { + margin: 0; padding: 0; - margin: 0; list-style: none; } /* This is required to win over specificity of [dir="rtl"] .region-content ul */ @@ -39,8 +39,8 @@ white-space: nowrap; } [dir="rtl"] .field--type-entity-reference ul.links li { + float: right; padding: 0 0 0 1em; - float: right; } @media all and (min-width: 560px) { @@ -68,13 +68,13 @@ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .field--name-field-tags .field__label { - font-weight: normal; margin: 0; padding-right: 5px; /* LTR */ + font-weight: normal; } [dir="rtl"] .field--name-field-tags .field__label { + padding-right: 0; padding-left: 5px; - padding-right: 0; } .field--name-field-tags .field__label, .field--name-field-tags ul.links { @@ -85,8 +85,8 @@ font-size: 0.821em; } .field--name-field-tags ul.links { + margin: 0; padding: 0; - margin: 0; } .field--name-field-tags ul.links li { float: left; /* LTR */ @@ -94,6 +94,6 @@ white-space: nowrap; } [dir="rtl"] .field--name-field-tags ul.links li { + float: right; padding: 0 0 0 1em; - float: right; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/form.css --- a/core/themes/bartik/css/components/form.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/form.css Thu May 09 15:33:08 2019 +0100 @@ -14,8 +14,8 @@ padding: 0; } fieldset { + min-width: 0; margin: 1em 0; - min-width: 0; } /** * We've temporarily added this Firefox specific rule here to fix fieldset @@ -44,12 +44,12 @@ margin-right: 10px; /* LTR */ } [dir="rtl"] .filter-wrapper .form-item label { + margin-right: 0; margin-left: 10px; - margin-right: 0; } summary { + color: #3b3b3b; background: #dbdbdb; - color: #3b3b3b; text-shadow: 0 1px 0 #fff; } details summary a { @@ -76,11 +76,11 @@ font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; } input { + box-sizing: border-box; + /* Keep form elements from overflowing their containers. */ + max-width: 100%; margin: 2px 0; padding: 4px; - /* Keep form elements from overflowing their containers. */ - max-width: 100%; - box-sizing: border-box; } input, textarea { @@ -112,8 +112,8 @@ input.form-number, input.form-color, textarea.form-textarea { + color: #3b3b3b; border: 1px solid #ccc; - color: #3b3b3b; } input.form-submit:hover, input.form-submit:focus { @@ -175,8 +175,8 @@ margin-bottom: 0; } .node-form .form-actions { + margin-top: 0; padding-top: 0; - margin-top: 0; } /* Contact Form */ @@ -202,9 +202,9 @@ .form-disabled input, .form-disabled select, .form-disabled textarea { + color: #717171; + border-color: #bbb; background: #ededed; - border-color: #bbb; - color: #717171; } .form-disabled label { color: #717171; @@ -213,9 +213,9 @@ /* Comment form */ .comment-form label { float: left; /* LTR */ + width: 120px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.929em; - width: 120px; } [dir="rtl"] .comment-form label { float: right; @@ -232,8 +232,8 @@ .comment-form .form-radios, .comment-form .form-type-checkbox, .comment-form .form-select { + overflow: hidden; margin-bottom: 10px; - overflow: hidden; } .comment-form .form-type-checkbox, .comment-form .form-radios { @@ -242,8 +242,8 @@ [dir="rtl"] .comment-form .form-type-checkbox, [dir="rtl"] .comment-form .form-radios, [dir="rtl"] .comment-form .form-item .description { + margin-right: 120px; margin-left: 0; - margin-right: 120px; } .comment-form .form-type-checkbox label, .comment-form .form-radios label { @@ -263,9 +263,9 @@ width: 320px; } .comment-form .form-item .description { + margin-left: 120px; /* LTR */ font-size: 0.786em; line-height: 1.2; - margin-left: 120px; /* LTR */ } .comment-form .form-textarea { border-top-left-radius: 4px; @@ -277,8 +277,8 @@ margin-bottom: 0; } .filter-wrapper label { + float: none; width: auto; - float: none; } .filter-wrapper .form-select { min-width: 120px; @@ -293,8 +293,8 @@ margin-right: 0.6em; /* LTR */ } [dir="rtl"] #edit-actions input { + margin-right: 0; margin-left: 0.6em; - margin-right: 0; } /* Form error styles. */ @@ -312,20 +312,20 @@ */ @media all and (max-width: 600px) { .form-actions .button { + display: block; float: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 100%; margin: 10px 0 0; padding-bottom: 6px; - width: 100%; - display: block; - box-sizing: border-box; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; } .js .dropbutton .dropbutton-action > input, .js .dropbutton .dropbutton-action > a, .js .dropbutton .dropbutton-action > button { + padding-left: 3em; text-align: center; - padding-left: 3em; } } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/header.css --- a/core/themes/bartik/css/components/header.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/header.css Thu May 09 15:33:08 2019 +0100 @@ -36,9 +36,9 @@ } /* Region header blocks. */ .region-header .block:not(.site-branding) { + clear: right; + margin: 0 0 1em; font-size: 0.857em; - margin: 0 0 1em; - clear: right; } @media all and (min-width: 901px) { @@ -49,8 +49,8 @@ .region-header .block > h2 { /* @extend .visually-hidden */ position: absolute !important; + overflow: hidden; clip: rect(1px, 1px, 1px, 1px); - overflow: hidden; height: 1px; } .header .block .content { @@ -61,24 +61,24 @@ padding: 0; } .region-header .block li { + padding: 0; list-style: none; list-style-image: none; - padding: 0; } .region-header .branding { font-size: 1em; } .region-header .form-text { + width: 120px; + margin-right: 2px; /* LTR */ + border-color: #ccc; + border-color: rgba(255, 255, 255, 0.3); background: #fefefe; background: rgba(255, 255, 255, 0.7); - border-color: #ccc; - border-color: rgba(255, 255, 255, 0.3); - margin-right: 2px; /* LTR */ - width: 120px; } [dir="rtl"] .region-header .form-text { + margin-right: 0; margin-left: 2px; - margin-right: 0; } .region-header .form-text:hover, .region-header .form-text:focus, @@ -91,18 +91,18 @@ } /* Region header block menus. */ .region-header .block-menu { + width: 208px; + padding: 0; border: 1px solid; border-color: #eee; border-color: rgba(255, 255, 255, 0.2); - padding: 0; - width: 208px; } .region-header .block-menu li a { display: block; + padding: 3px 7px; border-bottom: 1px solid; border-bottom-color: #eee; border-bottom-color: rgba(255, 255, 255, 0.2); - padding: 3px 7px; } .region-header .block-menu li a:hover, .region-header .block-menu li a:focus, @@ -127,8 +127,8 @@ } .region-header #block-user-login div.item-list, .region-header #block-user-login div.description { + margin: 0; font-size: 0.916em; - margin: 0; } .region-header #block-user-login div.item-list { clear: both; @@ -141,30 +141,30 @@ line-height: 1; } .region-header #block-user-login .item-list li { - list-style: none; float: left; /* LTR */ padding: 3px 0 1px; + list-style: none; } .region-header #block-user-login .item-list li:last-child { padding-left: 0.5em; /* LTR */ } [dir="rtl"] .region-header #block-user-login .item-list li:last-child { + padding-right: 0.5em; padding-left: 0; - padding-right: 0.5em; } .region-header #block-user-login .form-actions { + clear: both; margin: 4px 0 0; padding: 0; - clear: both; } .region-header #block-user-login input.form-submit { + margin: 4px 0; + padding: 3px 8px; border: 1px solid; border-color: #ccc; border-color: rgba(255, 255, 255, 0.5); background: #eee; background: rgba(255, 255, 255, 0.7); - margin: 4px 0; - padding: 3px 8px; } .region-header #block-user-login input.form-submit:hover, .region-header #block-user-login input.form-submit:focus { diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/help.css --- a/core/themes/bartik/css/components/help.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/help.css Thu May 09 15:33:08 2019 +0100 @@ -4,7 +4,7 @@ */ .block-help { + margin-bottom: 30px; + padding: 0 1.5em; border: 1px solid #d3d7d9; - padding: 0 1.5em; - margin-bottom: 30px; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/image-button.css --- a/core/themes/bartik/css/components/image-button.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/image-button.css Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,7 @@ .image-button.is-disabled:active, .image-button.is-disabled:focus, .image-button.is-disabled { + cursor: default; + opacity: 0.5; background: transparent; - opacity: 0.5; - cursor: default; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/item-list.css --- a/core/themes/bartik/css/components/item-list.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/item-list.css Thu May 09 15:33:08 2019 +0100 @@ -4,9 +4,9 @@ */ .item-list ul { - list-style: none; margin: 0 0 0.25em 0; padding: 0; /* LTR */ + list-style: none; } [dir="rtl"] .item-list ul { padding: 0; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/list-group.css --- a/core/themes/bartik/css/components/list-group.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/list-group.css Thu May 09 15:33:08 2019 +0100 @@ -5,8 +5,8 @@ */ .list-group__link { + padding: 7px 0 0; border-top: 1px solid #ccc; - padding: 7px 0 0; } .list-group__description { margin: 0 0 10px; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/list.css --- a/core/themes/bartik/css/components/list.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/list.css Thu May 09 15:33:08 2019 +0100 @@ -4,10 +4,10 @@ */ ul.links { + margin: 0; + padding: 0; + list-style: none; color: #68696b; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.821em; - padding: 0; - margin: 0; - list-style: none; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/main-content.css --- a/core/themes/bartik/css/components/main-content.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/main-content.css Thu May 09 15:33:08 2019 +0100 @@ -14,16 +14,16 @@ @media all and (min-width: 851px) { .main-content { + position: relative; float: left; /* LTR */ - position: relative; } [dir="rtl"] .main-content { float: right; } .layout-two-sidebars .main-content { + width: 50%; + margin-right: 25%; margin-left: 25%; - margin-right: 25%; - width: 50%; } .layout-one-sidebar .main-content { width: 75%; @@ -32,12 +32,12 @@ width: 100%; } .layout-sidebar-first .main-content { + margin-right: 0; /* LTR */ margin-left: 25%; /* LTR */ - margin-right: 0; /* LTR */ } [dir="rtl"] .layout-sidebar-first .main-content { + margin-right: 25%; margin-left: 0; - margin-right: 25%; } .layout-sidebar-second .main-content { margin-right: 25%; /* LTR */ @@ -48,4 +48,3 @@ margin-left: 25%; } } - diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/messages.css --- a/core/themes/bartik/css/components/messages.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/messages.css Thu May 09 15:33:08 2019 +0100 @@ -4,10 +4,15 @@ */ .messages__wrapper { - padding: 20px 0 5px 8px; + padding: 0 0 0 8px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - margin: 8px 0; } [dir="rtl"] .messages__wrapper { - padding: 20px 8px 5px 0; + padding: 0 8px 0 0; } +.messages:first-child { + margin-top: 28px; +} +.messages:last-child { + margin-bottom: 13px; +} diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/node-preview.css --- a/core/themes/bartik/css/components/node-preview.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/node-preview.css Thu May 09 15:33:08 2019 +0100 @@ -1,42 +1,42 @@ .node-preview-container { - background: #d1e8f5; - background-image: -webkit-linear-gradient(top, #d1e8f5, #d3e8f4); - background-image: linear-gradient(to bottom, #d1e8f5, #d3e8f4); - font-family: Arial, sans-serif; - box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.3333); position: fixed; z-index: 499; width: 100%; padding: 5px 10px; + background: #d1e8f5; + background-image: -webkit-linear-gradient(top, #d1e8f5, #d3e8f4); + background-image: linear-gradient(to bottom, #d1e8f5, #d3e8f4); + box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.3333); + font-family: Arial, sans-serif; } .node-preview-backlink { + display: inline-block; + margin: 5px 10px 5px 0; /* LTR */ + padding: 4px 1em 4px 0.6em; /* LTR */ + color: #fff; + border: 1px solid #0048c8; + border-radius: 0.4em; background: url(../../../../misc/icons/000000/chevron-left.svg) left no-repeat, -webkit-linear-gradient(top, #419ff1, #1076d5); background: url(../../../../misc/icons/000000/chevron-left.svg) left no-repeat, linear-gradient(to bottom, #419ff1, #1076d5); /* LTR */ - border: 1px solid #0048c8; - border-radius: 0.4em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); - color: #fff; + text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5); font-size: 0.9em; line-height: normal; - margin: 5px 10px 5px 0; /* LTR */ - padding: 4px 1em 4px 0.6em; /* LTR */ - text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5); - display: inline-block; } [dir="rtl"] .node-preview-backlink { + float: right; + margin: 5px 0 5px 10px; + padding: 4px 0.6em 4px 1em; background: url(../../../../misc/icons/000000/chevron-right.svg) right no-repeat, -webkit-linear-gradient(top, #419ff1, #1076d5); background: url(../../../../misc/icons/000000/chevron-right.svg) right no-repeat, linear-gradient(to bottom, #419ff1, #1076d5); - margin: 5px 0 5px 10px; - padding: 4px 0.6em 4px 1em; - float: right; } .node-preview-backlink:focus, .node-preview-backlink:hover { + text-decoration: none; + color: #fff; + border: 1px solid #0048c8; background: url(../../../../misc/icons/000000/chevron-left.svg) left no-repeat, -webkit-linear-gradient(top, #59abf3, #2a90ef); background: url(../../../../misc/icons/000000/chevron-left.svg) left no-repeat, linear-gradient(to bottom, #59abf3, #2a90ef); /* LTR */ - border: 1px solid #0048c8; - text-decoration: none; - color: #fff; } [dir="rtl"] .node-preview-backlink:focus, [dir="rtl"] .node-preview-backlink:hover { @@ -44,9 +44,9 @@ background: url(../../../../misc/icons/000000/chevron-right.svg) right no-repeat, linear-gradient(to bottom, #59abf3, #2a90ef); } .node-preview-backlink:active { + border: 1px solid #0048c8; background: url(../../../../misc/icons/000000/chevron-left.svg) left no-repeat, -webkit-linear-gradient(top, #0e69be, #2a93ef); background: url(../../../../misc/icons/000000/chevron-left.svg) left no-repeat, linear-gradient(to bottom, #0e69be, #2a93ef); /* LTR */ - border: 1px solid #0048c8; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25); } [dir="rtl"] .node-preview-backlink:active { @@ -54,14 +54,14 @@ background: url(../../../../misc/icons/000000/chevron-right.svg) right no-repeat, linear-gradient(to bottom, #0e69be, #2a93ef); } .node-preview-backlink::before { - content: ''; + display: inline-block; width: 10px; - display: inline-block; + content: ""; } [dir="rtl"] .node-preview-backlink::after { - content: ''; + display: inline-block; width: 10px; - display: inline-block; + content: ""; } .node-preview-container .form-item-view-mode { display: inline-block; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/node.css --- a/core/themes/bartik/css/components/node.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/node.css Thu May 09 15:33:08 2019 +0100 @@ -4,15 +4,15 @@ */ .node__content { + margin-top: 10px; font-size: 1.071em; - margin-top: 10px; } /* View mode teaser styles. */ .node--view-mode-teaser { - border-bottom: 1px solid #d3d7d9; margin-bottom: 30px; padding-bottom: 15px; + border-bottom: 1px solid #d3d7d9; } .node--view-mode-teaser h2 { margin-top: 0; @@ -22,10 +22,10 @@ color: #181818; } .node--view-mode-teaser.node--sticky { + padding: 0 15px 15px; + border: 1px solid #d3d7d9; background: #f9f9f9; background: rgba(0, 0, 0, 0.024); - border: 1px solid #d3d7d9; - padding: 0 15px 15px; } .node--view-mode-teaser .node__content { clear: none; @@ -35,10 +35,10 @@ /* Node metadata styles. */ .node__meta { + margin-bottom: -5px; + color: #68696b; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.857em; - color: #68696b; - margin-bottom: -5px; } .node__meta .field--name-user-picture img { float: left; /* LTR */ @@ -46,8 +46,8 @@ } [dir="rtl"] .node__meta .field--name-user-picture img { float: right; + margin-right: 0; margin-left: 20px; - margin-right: 0; } /* Node links styles. */ @@ -64,6 +64,6 @@ padding: 20px 15px 0; } .node--unpublished .comment-text .comment-arrow { + border-right: 1px solid #fff4f4; border-left: 1px solid #fff4f4; - border-right: 1px solid #fff4f4; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/pager.css --- a/core/themes/bartik/css/components/pager.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/pager.css Thu May 09 15:33:08 2019 +0100 @@ -9,8 +9,8 @@ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .pager__item { + padding: 10px 15px; font-size: 0.929em; - padding: 10px 15px; } .pager__item a { display: inline-block; @@ -25,8 +25,8 @@ } [dir="rtl"] .pager__item--first, [dir="rtl"] .pager__item--previous { + padding-right: 0; padding-left: 10px; - padding-right: 0; } .pager__item--ellipsis { padding: 10px 0; @@ -37,6 +37,6 @@ } [dir="rtl"] .pager__item--last, [dir="rtl"] .pager__item--next { + padding-right: 10px; padding-left: 0; - padding-right: 10px; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/panel.css --- a/core/themes/bartik/css/components/panel.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/panel.css Thu May 09 15:33:08 2019 +0100 @@ -4,10 +4,10 @@ */ .panel { - background: #fbfbfb; - border: 1px solid #ccc; margin: 10px 0; padding: 0 5px 5px; + border: 1px solid #ccc; + background: #fbfbfb; } .panel__title { margin: 16px 7px; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/primary-menu.css --- a/core/themes/bartik/css/components/primary-menu.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/primary-menu.css Thu May 09 15:33:08 2019 +0100 @@ -4,35 +4,35 @@ clear: both; } .region-primary-menu .menu { - font-size: 0.929em; margin: 0 5px; padding: 0; text-align: left; /* LTR */ + font-size: 0.929em; } [dir="rtl"] .region-primary-menu .menu { + margin-right: 5px; /* This is required to win over specificity of [dir="rtl"] ul.menu */ + margin-left: 5px; /* This is required to win over specificity of [dir="rtl"] ul.menu */ text-align: right; - margin-left: 5px; /* This is required to win over specificity of [dir="rtl"] ul.menu */ - margin-right: 5px; /* This is required to win over specificity of [dir="rtl"] ul.menu */ } .region-primary-menu .menu-item { float: none; - list-style: none; + width: 100%; + height: auto; margin: 0; padding: 0; - height: auto; - width: 100%; + list-style: none; } .region-primary-menu .menu a { + display: block; + float: none; + margin: 4px 0; + padding: 0.9em 0 0.9em 10px; /* LTR */ + text-decoration: none; color: #333; + border-radius: 8px; background: #ccc; background: rgba(255, 255, 255, 0.7); - float: none; - display: block; - text-decoration: none; text-shadow: 0 1px #eee; - border-radius: 8px; - margin: 4px 0; - padding: 0.9em 0 0.9em 10px; /* LTR */ } [dir="rtl"] .region-primary-menu .menu a { padding: 0.9em 10px 0.9em 0; @@ -58,34 +58,34 @@ } /* Unhide it for the primary menu. */ .region-primary-menu .menu-toggle-target { - display: inherit; position: fixed; top: 0; + display: inherit; } .region-primary-menu .menu-toggle { display: none; } body:not(:target) .region-primary-menu .menu-toggle { + z-index: 1000; + display: block; + float: none; + padding: 0.9em 10px 0.9em 10px; + text-decoration: none; color: #333; background: #ccc; background: rgba(255, 255, 255, 0.7); - float: none; + text-shadow: 0 1px #eee; font-size: 0.929em; - display: block; - text-decoration: none; - text-shadow: 0 1px #eee; - padding: 0.9em 10px 0.9em 10px; - z-index: 1000; } body:not(:target) .region-primary-menu .menu-toggle:after { + position: absolute; + right: 10px; /* LTR */ + display: inline-block; + width: 22px; + height: 22px; content: ""; background: url(../../../../misc/icons/ffffff/hamburger.svg) no-repeat; background-size: contain; - width: 22px; - height: 22px; - display: inline-block; - position: absolute; - right: 10px; /* LTR */ } [dir="rtl"] body:not(:target) .region-primary-menu .menu-toggle:after { right: initial; @@ -100,12 +100,12 @@ } body:not(:target) .region-primary-menu .menu-item { + overflow: hidden; height: 0; - overflow: hidden; } body:not(:target) .region-primary-menu .menu-toggle-target-show:target ~ .menu .menu-item { + overflow: visible; height: auto; - overflow: visible; } /** @@ -123,33 +123,33 @@ } .region-primary-menu .menu-item, body:not(:target) .region-primary-menu .menu-item { + display: inline-block; float: left; /* LTR */ + overflow: visible; + width: 32.75%; + height: auto; margin-right: 5px; /* LTR */ padding: 0; - display: inline-block; - width: 32.75%; - height: auto; - overflow: visible; } [dir="rtl"] .region-primary-menu .menu-item, [dir="rtl"] body:not(:target) .region-primary-menu .menu-item { float: right; + margin-right: 0; margin-left: 5px; - margin-right: 0; } .region-primary-menu .menu-item:nth-child(3n) { margin-right: -5px; /* LTR */ } [dir="rtl"] .region-primary-menu .menu-item:nth-child(3n) { + margin-right: 0; margin-left: -5px; - margin-right: 0; } .region-primary-menu .menu a { + display: block; float: none; - display: block; - border-radius: 8px; margin-bottom: 5px; padding: 0.9em 5px; + border-radius: 8px; } /* This is required to win over specificity of the global [dir="rtl"] .region-primary-menu .menu a */ [dir="rtl"] .region-primary-menu .menu a { @@ -162,19 +162,19 @@ @media all and (min-width: 901px) { .region-primary-menu .block-menu .menu { - font-size: 0.929em; margin: 0; padding: 0 15px; + font-size: 0.929em; } .region-primary-menu .menu-item, body:not(:target) .region-primary-menu .menu-item { float: left; /* LTR */ - list-style: none; - padding: 0 1px; - margin: 0 1px; + overflow: visible; width: auto; height: auto; - overflow: visible; + margin: 0 1px; + padding: 0 1px; + list-style: none; } [dir="rtl"] .region-primary-menu .menu-item, [dir="rtl"] body:not(:target) .region-primary-menu .menu-item { @@ -182,10 +182,10 @@ } .region-primary-menu .menu a { float: left; /* LTR */ + margin-bottom: 0; padding: 0.7em 0.8em; - margin-bottom: 0; + border-bottom-right-radius: 0; border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } [dir="rtl"] .region-primary-menu .menu a { float: right; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/search-form.css --- a/core/themes/bartik/css/components/search-form.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/search-form.css Thu May 09 15:33:08 2019 +0100 @@ -13,21 +13,21 @@ } [dir="rtl"] .search-form .form-search { float: right; + margin-right: 0; margin-left: 5px; - margin-right: 0; } .button.search-form__submit, .search-form__submit { - background: #f0f0f0 url(../../../../misc/icons/505050/loupe.svg) no-repeat center; + overflow: hidden; + width: 34px; + height: 26px; + margin-right: 0; + margin-left: 0; + padding: 0; cursor: pointer; - height: 26px; - margin-left: 0; - margin-right: 0; - overflow: hidden; - padding: 0; text-indent: -9999px; direction: ltr; - width: 34px; + background: #f0f0f0 url(../../../../misc/icons/505050/loupe.svg) no-repeat center; } .button.search-form__submit:hover, .search-form__submit:hover, diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/search-results.css --- a/core/themes/bartik/css/components/search-results.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/search-results.css Thu May 09 15:33:08 2019 +0100 @@ -8,14 +8,14 @@ list-style-position: inside; } .search-results li { + margin-bottom: 0.5em; + padding-bottom: 0.4285em; border-bottom: 1px solid #d3d7d9; - padding-bottom: 0.4285em; - margin-bottom: 0.5em; } .search-results li:last-child { + margin-bottom: 1em; + padding-bottom: 0; border-bottom: none; - padding-bottom: 0; - margin-bottom: 1em; } .search-result__title { font-weight: bold; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/secondary-menu.css --- a/core/themes/bartik/css/components/secondary-menu.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/secondary-menu.css Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,20 @@ /* --------------- Secondary Menu ------------ */ .region-secondary-menu .menu { + margin: 0 10px; + padding: 0; text-align: right; /* LTR */ font-size: 0.929em; - margin: 0 10px; - padding: 0; } [dir="rtl"] .region-secondary-menu .menu { - text-align: left; margin-right: 10px; /* required to win over specificity of [dir="rtl"] ul.menu */ margin-left: 10px; + text-align: left; } .region-secondary-menu .menu-item { + display: inline; margin: 0; padding: 0; - display: inline; } .region-secondary-menu .menu a { display: inline-block; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/shortcut.css --- a/core/themes/bartik/css/components/shortcut.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/shortcut.css Thu May 09 15:33:08 2019 +0100 @@ -14,13 +14,13 @@ float: right; } .shortcut-action { - border-bottom: none; margin-left: 0.5em; /* LTR */ padding-top: 0.35em; + border-bottom: none; } [dir="rtl"] .shortcut-action { + margin-right: 0.5em; margin-left: 0; - margin-right: 0.5em; } .shortcut-action:hover, .shortcut-action:active, diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/sidebar.css --- a/core/themes/bartik/css/components/sidebar.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/sidebar.css Thu May 09 15:33:08 2019 +0100 @@ -2,8 +2,8 @@ @media all and (min-width: 560px) { .sidebar { + position: relative; float: left; /* LTR */ - position: relative; width: 50%; } [dir="rtl"] .sidebar { @@ -27,9 +27,9 @@ margin-left: 0; } #sidebar-second { + clear: none; width: 25%; margin-left: -25%; /* LTR */ - clear: none; } [dir="rtl"] #sidebar-second { margin-right: -25%; @@ -41,15 +41,15 @@ padding: 10px 15px 0; } .sidebar .block { + margin: 0 0 20px; + padding: 15px 20px; + border-width: 1px; border-style: solid; - border-width: 1px; - padding: 15px 20px; - margin: 0 0 20px; } .sidebar h2 { margin: 0 0 0.5em; + padding-bottom: 5px; border-bottom: 1px solid #d6d6d6; - padding-bottom: 5px; text-shadow: 0 1px 0 #fff; font-size: 1.071em; line-height: 1.2; @@ -63,6 +63,6 @@ } .sidebar tr.even, .sidebar tr.odd { + border-bottom: 1px solid #d6d6d6; background: none; - border-bottom: 1px solid #d6d6d6; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/site-branding.css --- a/core/themes/bartik/css/components/site-branding.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/site-branding.css Thu May 09 15:33:08 2019 +0100 @@ -30,8 +30,8 @@ } } .site-branding__name { + color: #686868; font-size: 1.6em; - color: #686868; line-height: 1; } @@ -41,9 +41,9 @@ } } .site-branding__slogan { + margin-top: 7px; + word-spacing: 0.1em; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.929em; - margin-top: 7px; - word-spacing: 0.1em; font-style: italic; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/site-footer.css --- a/core/themes/bartik/css/components/site-footer.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/site-footer.css Thu May 09 15:33:08 2019 +0100 @@ -4,8 +4,8 @@ */ .site-footer { + padding: 35px 0 30px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - padding: 35px 0 30px; } .site-footer .layout-container { padding: 0 15px; @@ -13,8 +13,8 @@ @media all and (min-width: 560px) { .site-footer__top .region { + position: relative; float: left; /* LTR */ - position: relative; width: 50%; } [dir="rtl"] .site-footer__top .region { @@ -30,15 +30,15 @@ padding-right: 10px; /* LTR */ } [dir="rtl"] .site-footer__top .region:nth-child(2n+1) { + padding-right: 0; padding-left: 10px; - padding-right: 0; } .site-footer__top .region:nth-child(2n) { padding-left: 10px; /* LTR */ } [dir="rtl"] .site-footer__top .region:nth-child(2n) { + padding-right: 10px; padding-left: 0; - padding-right: 10px; } .region-footer-third { clear: both; @@ -54,15 +54,15 @@ padding-left: 0; /* LTR */ } [dir="rtl"] .site-footer__top .region:first-child { + padding-right: 0; padding-left: 10px; - padding-right: 0; } .site-footer__top .region:last-child { padding-right: 0; /* LTR */ } [dir="rtl"] .site-footer__top .region:last-child { + padding-right: 10px; padding-left: 0; - padding-right: 10px; } } .site-footer h2 { @@ -101,9 +101,9 @@ } .site-footer .block { margin: 20px 0; + padding: 10px; border: 1px solid #444; border-color: rgba(255, 255, 255, 0.1); - padding: 10px; } .site-footer table { font-size: 1em; @@ -123,12 +123,12 @@ /* Footer Top Styling. */ .site-footer__top h2 { - border-bottom: 1px solid #555; - border-color: rgba(255, 255, 255, 0.15); - font-size: 1em; margin-bottom: 0; padding-bottom: 3px; text-transform: uppercase; + border-color: rgba(255, 255, 255, 0.15); + border-bottom: 1px solid #555; + font-size: 1em; } .site-footer__top .content { margin-top: 0; @@ -144,20 +144,20 @@ } .site-footer__top .content li a { display: block; - border-bottom: 1px solid #555; - border-color: rgba(255, 255, 255, 0.15); - line-height: 1.2; padding: 0.8em 2px 0.8em 20px; /* LTR */ text-indent: -15px; + border-color: rgba(255, 255, 255, 0.15); + border-bottom: 1px solid #555; + line-height: 1.2; } [dir="rtl"] .site-footer__top .content li a { padding: 0.8em 20px 0.8em 2px; } .site-footer__top .content li a:hover, .site-footer__top .content li a:focus { + text-decoration: none; background-color: #1f1f21; background-color: rgba(255, 255, 255, 0.05); - text-decoration: none; } .site-footer__top .block-menu, .site-footer__bottom .block { @@ -171,17 +171,17 @@ margin: 0.5em 0; } .site-footer__bottom .content { + margin-top: 0; padding: 0.5em 0; - margin-top: 0; } .site-footer__bottom .block h2 { margin: 0; } .site-footer__bottom { + margin-top: 30px; letter-spacing: 0.2px; - margin-top: 30px; + border-color: rgba(255, 255, 255, 0.15); border-top: 1px solid #555; - border-color: rgba(255, 255, 255, 0.15); } .site-footer__bottom .region { margin-top: 20px; @@ -195,16 +195,16 @@ padding: 0; } .site-footer__bottom .menu-item a { + display: block; float: left; /* LTR */ padding: 0 12px; - display: block; + border-color: rgba(255, 255, 255, 0.15); border-right: 1px solid #555; /* LTR */ - border-color: rgba(255, 255, 255, 0.15); } [dir="rtl"] .site-footer__bottom .menu-item a { float: right; + border-right: none; border-left: 1px solid #555; - border-right: none; } .site-footer__bottom .menu-item:first-child a { padding-left: 0; /* LTR */ @@ -218,8 +218,8 @@ border-right: none; /* LTR */ } [dir="rtl"] .site-footer__bottom .menu-item:last-child a { + padding-right: 12px; padding-left: 0; - padding-right: 12px; border-left: none; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/skip-link.css --- a/core/themes/bartik/css/components/skip-link.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/skip-link.css Thu May 09 15:33:08 2019 +0100 @@ -4,20 +4,20 @@ */ .skip-link { + z-index: 50; left: 50%; + padding: 1px 10px 2px; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); - z-index: 50; + border-bottom-width: 0; + border-radius: 0 0 10px 10px; + outline: 0; background: #444; background: rgba(0, 0, 0, 0.6); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.94em; line-height: 1.7em; - padding: 1px 10px 2px; - border-radius: 0 0 10px 10px; - border-bottom-width: 0; - outline: 0; } .skip-link.visually-hidden.focusable:focus { position: absolute !important; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/table.css --- a/core/themes/bartik/css/components/table.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/table.css Thu May 09 15:33:08 2019 +0100 @@ -4,19 +4,19 @@ */ table { + width: 100%; + margin: 10px 0; + border-spacing: 0; border: 0; - border-spacing: 0; font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; font-size: 0.857em; - margin: 10px 0; - width: 100%; } table table { font-size: 1em; } tr { + padding: 0.1em 0.6em; border-bottom: 1px solid #ccc; - padding: 0.1em 0.6em; background: #efefef; background: rgba(0, 0, 0, 0.063); } @@ -28,9 +28,9 @@ background: rgba(0, 0, 0, 0.105); } table tr th { + border-bottom-style: none; background: #757575; background: rgba(0, 0, 0, 0.51); - border-bottom-style: none; } table tr th, table tr th a, @@ -45,8 +45,8 @@ tr td, tr th { padding: 4px 9px; + text-align: left; /* LTR */ border: 1px solid #fff; - text-align: left; /* LTR */ } .tabledrag-handle:hover, .tabledrag-handle { diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/tablesort-indicator.css --- a/core/themes/bartik/css/components/tablesort-indicator.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/tablesort-indicator.css Thu May 09 15:33:08 2019 +0100 @@ -6,8 +6,8 @@ .tablesort { width: 14px; height: 14px; + margin: 1px 0 0 5px; vertical-align: top; - margin: 1px 0 0 5px; } .tablesort--asc { background-image: url(../../../../misc/icons/ffffff/twistie-down.svg); diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/tabs.css --- a/core/themes/bartik/css/components/tabs.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/tabs.css Thu May 09 15:33:08 2019 +0100 @@ -1,28 +1,28 @@ /* --------------- System Tabs --------------- */ div.tabs { + margin-bottom: 20px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - margin-bottom: 20px; } .tabs ul.primary { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .tabs ul.primary li a { + display: block; + height: 1.8em; + padding: 0 10px 3px; color: #000; + border-width: 1px; + border-style: solid solid none solid; + border-color: #bbb; background-color: #ededed; - border-color: #bbb; - border-style: solid solid none solid; - border-width: 1px; - height: 1.8em; + text-shadow: 0 1px 0 #fff; + font-size: 0.929em; line-height: 1.9; - display: block; - font-size: 0.929em; - padding: 0 10px 3px; - text-shadow: 0 1px 0 #fff; } .tabs ul.primary li.is-active a { + border: 1px solid #bbb; background-color: #fff; - border: 1px solid #bbb; } @media screen and (max-width: 37.5em) { /* 600px */ @@ -43,25 +43,25 @@ @media screen and (min-width: 37.5em) { /* 600px */ .tabs ul.primary { + overflow: hidden; + height: auto; + margin: 0; + padding: 0 3px; + white-space: nowrap; + border: none; border-collapse: collapse; - height: auto; + background: transparent url(../../images/tabs-border.png) repeat-x left bottom; line-height: normal; - padding: 0 3px; - margin: 0; - overflow: hidden; - border: none; - background: transparent url(../../images/tabs-border.png) repeat-x left bottom; - white-space: nowrap; } .tabs ul.primary li { display: block; float: left; /* LTR */ + margin: 0 5px 0 0; /* LTR */ vertical-align: bottom; - margin: 0 5px 0 0; /* LTR */ } [dir="rtl"] .tabs ul.primary li { + float: right; margin: 0 0 0 5px; - float: right; } .tabs ul.primary li a { float: left; /* not LTR */ @@ -73,22 +73,22 @@ } } .tabs ul.secondary { - border-bottom: none; + overflow: hidden; margin: 5px; padding: 0.5em 0; - overflow: hidden; + border-bottom: none; } .tabs ul.secondary li { - border-right: 1px solid #ccc; /* LTR */ display: block; float: left; /* LTR */ margin: 0; padding: 0 1em; + border-right: 1px solid #ccc; /* LTR */ } [dir="rtl"] .tabs ul.secondary li { + float: right; + border-right: none; border-left: 1px solid #ccc; - border-right: none; - float: right; } .tabs ul.secondary li:last-child { border-right: none; /* LTR */ @@ -108,7 +108,7 @@ text-decoration: none; } .tabs ul.secondary li a.is-active { - background: #f2f2f2; border-bottom: none; border-radius: 5px; + background: #f2f2f2; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/ui-dialog.css --- a/core/themes/bartik/css/components/ui-dialog.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/ui-dialog.css Thu May 09 15:33:08 2019 +0100 @@ -4,12 +4,12 @@ */ .ui-widget-overlay { + opacity: 0.7; background: #000; - opacity: 0.7; } .ui-dialog { + border-radius: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - border-radius: 0; } .ui-dialog input, .ui-dialog select, @@ -17,18 +17,18 @@ font-size: 0.9em; } .ui-dialog .button { + padding: 0.25em 1.063em; + cursor: pointer; + text-align: center; + color: #3a3a3a; + border: 1px solid #e4e4e4; + border-right-color: #d2d2d2; + border-bottom-color: #b4b4b4; + border-left-color: #d2d2d2; + border-radius: 1em; background-color: #fff; background-image: -webkit-linear-gradient(top, #f3f3f3, #e8e8e8); background-image: linear-gradient(to bottom, #f3f3f3, #e8e8e8); - border: 1px solid #e4e4e4; - border-bottom-color: #b4b4b4; - border-left-color: #d2d2d2; - border-right-color: #d2d2d2; - color: #3a3a3a; - cursor: pointer; font-size: 0.929em; font-weight: normal; - text-align: center; - padding: 0.25em 1.063em; - border-radius: 1em; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/components/vertical-tabs.component.css --- a/core/themes/bartik/css/components/vertical-tabs.component.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/components/vertical-tabs.component.css Thu May 09 15:33:08 2019 +0100 @@ -9,8 +9,8 @@ padding: 0; } [dir="rtl"] .vertical-tabs__menu { + margin-right: -15em; margin-left: 0; - margin-right: -15em; /* This is required to win specificity over [dir="rtl"] .region-content ul */ padding: 0; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/layout.css --- a/core/themes/bartik/css/layout.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/layout.css Thu May 09 15:33:08 2019 +0100 @@ -7,10 +7,10 @@ * Container */ .layout-container { + box-sizing: border-box; max-width: 860px; + margin-right: auto; margin-left: auto; - margin-right: auto; - box-sizing: border-box; } @media all and (min-width: 851px) { diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/css/maintenance-page.css --- a/core/themes/bartik/css/maintenance-page.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/css/maintenance-page.css Thu May 09 15:33:08 2019 +0100 @@ -1,15 +1,15 @@ body.maintenance-page { + color: #000; background-color: #fff; - color: #000; } .maintenance-page #page-wrapper { - background: #fff; - margin-left: auto; - margin-right: auto; min-width: 0; min-height: 0; + margin-top: 40px; + margin-right: auto; + margin-left: auto; border: 1px solid #ddd; - margin-top: 40px; + background: #fff; } .maintenance-page #page { margin: 10px; @@ -27,8 +27,8 @@ padding: 0 0 0 10px; /* LTR */ } [dir="rtl"] .maintenance-page .content .section { + padding-right: 10px; padding-left: 0; - padding-right: 10px; } .maintenance-page #header { background-color: #fff; @@ -50,8 +50,8 @@ color: #777; } .maintenance-page .page-title { + margin-top: 0; line-height: 1em; - margin-top: 0; } @media all and (min-width: 800px) { diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/templates/comment.html.twig --- a/core/themes/bartik/templates/comment.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/templates/comment.html.twig Thu May 09 15:33:08 2019 +0100 @@ -13,11 +13,11 @@ * {{ content|without('field_example') }} * @endcode * - created: Formatted date and time for when the comment was created. - * Preprocess functions can reformat it by calling format_date() with the - * desired parameters on the 'comment.created' variable. + * Preprocess functions can reformat it by calling DateFormatter::format() + * with the desired parameters on the 'comment.created' variable. * - changed: Formatted date and time for when the comment was last changed. - * Preprocess functions can reformat it by calling format_date() with the - * desired parameters on the 'comment.changed' variable. + * Preprocess functions can reformat it by calling DateFormatter::format() + * with the desired parameters on the 'comment.changed' variable. * - permalink: Comment permalink. * - submitted: Submission information created from author and created * during template_preprocess_comment(). diff -r 129ea1e6d783 -r af1871eacc83 core/themes/bartik/templates/node.html.twig --- a/core/themes/bartik/templates/node.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/bartik/templates/node.html.twig Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,7 @@ * Calling other methods, such as node.delete(), will result in an exception. * See \Drupal\node\Entity\Node for a full list of public properties and * methods for the node object. - * - label: The title of the node. + * - label: (optional) The title of the node. * - content: All node items. Use {{ content }} to print them all, * or print a subset such as {{ content.field_example }}. Use * {{ content|without('field_example') }} to temporarily suppress the printing @@ -23,8 +23,8 @@ * - author_picture: The node author user entity, rendered using the "compact" * view mode. * - metadata: Metadata for this node. - * - date: Themed creation date field. - * - author_name: Themed author name field. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. * - display_submitted: Whether submission information should be displayed. * - attributes: HTML attributes for the containing element. @@ -81,7 +81,7 @@
{{ title_prefix }} - {% if not page %} + {% if label and not page %} {{ label }} diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/action-links.css --- a/core/themes/classy/css/components/action-links.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/action-links.css Thu May 09 15:33:08 2019 +0100 @@ -4,9 +4,9 @@ */ .action-links { + margin: 1em 0; + padding: 0; list-style: none; - padding: 0; - margin: 1em 0; } [dir="rtl"] .action-links { /* This is required to win over specificity of [dir="rtl"] ul */ @@ -20,24 +20,24 @@ margin-left: 0; /* LTR */ } [dir="rtl"] .action-links li:first-child { + margin-right: 0; margin-left: 0.3em; - margin-right: 0; } .button-action { display: inline-block; - line-height: 160%; padding: 0.2em 0.5em 0.3em; text-decoration: none; + line-height: 160%; } .button-action:before { - content: '+'; - font-weight: 900; margin-left: -0.1em; /* LTR */ padding-right: 0.2em; /* LTR */ + content: "+"; + font-weight: 900; } [dir="rtl"] .button-action:before { + margin-right: -0.1em; margin-left: 0; - margin-right: -0.1em; + padding-right: 0; padding-left: 0.2em; - padding-right: 0; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/book-navigation.css --- a/core/themes/classy/css/components/book-navigation.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/book-navigation.css Thu May 09 15:33:08 2019 +0100 @@ -4,12 +4,12 @@ */ .book-navigation .menu { + padding-top: 1em; padding-bottom: 0; - padding-top: 1em; } .book-navigation .book-pager { + overflow: auto; margin: 0; - overflow: auto; padding: 0.5em 0; } .book-pager__item { @@ -18,21 +18,21 @@ vertical-align: top; } .book-pager__item--previous { + width: 45%; text-align: left; /* LTR */ - width: 45%; } [dir="rtl"] .book-pager__item--previous { float: right; text-align: right; } .book-pager__item--center { + width: 8%; text-align: center; - width: 8%; } .book-pager__item--next { float: right; /* LTR */ + width: 45%; text-align: right; /* LTR */ - width: 45%; } [dir="rtl"] .book-pager__item--next { float: left; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/breadcrumb.css --- a/core/themes/classy/css/components/breadcrumb.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/breadcrumb.css Thu May 09 15:33:08 2019 +0100 @@ -16,13 +16,13 @@ } .breadcrumb li { display: inline; - list-style-type: none; margin: 0; padding: 0; + list-style-type: none; } /* IE8 does not support :not() and :last-child. */ .breadcrumb li:before { - content: ' \BB '; + content: " \BB "; } .breadcrumb li:first-child:before { content: none; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/button.css --- a/core/themes/classy/css/components/button.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/button.css Thu May 09 15:33:08 2019 +0100 @@ -5,11 +5,11 @@ .button, .image-button { + margin-right: 1em; margin-left: 1em; - margin-right: 1em; } .button:first-child, .image-button:first-child { + margin-right: 0; margin-left: 0; - margin-right: 0; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/collapse-processed.css --- a/core/themes/classy/css/components/collapse-processed.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/collapse-processed.css Thu May 09 15:33:08 2019 +0100 @@ -4,29 +4,29 @@ */ .collapse-processed > summary { + padding-right: 0.5em; padding-left: 0.5em; - padding-right: 0.5em; } .collapse-processed > summary:before { + float: left; /* LTR */ + width: 1em; + height: 1em; + content: ""; background: url(../../../../misc/menu-expanded.png) 0 100% no-repeat; /* LTR */ - content: ""; - float: left; /* LTR */ - height: 1em; - width: 1em; } [dir="rtl"] .collapse-processed > summary:before { + float: right; background-position: 100% 100%; - float: right; } .collapse-processed:not([open]) > summary:before { - background-position: 25% 35%; /* LTR */ -ms-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); transform: rotate(-90deg); + background-position: 25% 35%; /* LTR */ } [dir="rtl"] .collapse-processed:not([open]) > summary:before { - background-position: 75% 35%; -ms-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg); + background-position: 75% 35%; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/container-inline.css --- a/core/themes/classy/css/components/container-inline.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/container-inline.css Thu May 09 15:33:08 2019 +0100 @@ -5,12 +5,14 @@ .container-inline label:after, .container-inline .label:after { - content: ':'; + content: ":"; } -.form-type-radios .container-inline label:after { - content: ''; +.form-type-radios .container-inline label:after, +.form-type-checkboxes .container-inline label:after { + content: ""; } -.form-type-radios .container-inline .form-type-radio { +.form-type-radios .container-inline .form-type-radio, +.form-type-checkboxes .container-inline .form-type-checkbox { margin: 0 1em; } .container-inline .form-actions, diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/details.css --- a/core/themes/classy/css/components/details.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/details.css Thu May 09 15:33:08 2019 +0100 @@ -7,9 +7,9 @@ */ details { - border: 1px solid #ccc; margin-top: 1em; margin-bottom: 1em; + border: 1px solid #ccc; } details > .details-wrapper { padding: 0.5em 1.5em; @@ -18,6 +18,6 @@ vertically aligned with the .details-wrapper in browsers without native details support. */ summary { + padding: 0.2em 0.5em; cursor: pointer; - padding: 0.2em 0.5em; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/dialog.css --- a/core/themes/classy/css/components/dialog.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/dialog.css Thu May 09 15:33:08 2019 +0100 @@ -7,10 +7,10 @@ position: absolute; z-index: 1260; overflow: visible; + padding: 0; color: #000; + border: solid 1px #ccc; background: #fff; - border: solid 1px #ccc; - padding: 0; } @media all and (max-width: 48em) { /* 768px */ @@ -19,12 +19,12 @@ } } .ui-dialog .ui-dialog-titlebar { + border-width: 0 0 1px 0; + border-style: solid; + border-color: #ccc; + border-radius: 0; + background: #f3f4ee; font-weight: bold; - background: #f3f4ee; - border-style: solid; - border-radius: 0; - border-width: 0 0 1px 0; - border-color: #ccc; } .ui-dialog .ui-dialog-titlebar-close { border: 0; @@ -32,10 +32,10 @@ } .ui-dialog .ui-dialog-buttonpane { margin-top: 0; - background: #f3f4ee; padding: 0.3em 1em; border-width: 1px 0 0 0; border-color: #ccc; + background: #f3f4ee; } .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { margin: 0; @@ -47,27 +47,26 @@ /* Form action buttons are moved in dialogs. Remove empty space. */ .ui-dialog .ui-dialog-content .form-actions { + margin: 0; padding: 0; - margin: 0; } .ui-dialog .ajax-progress-throbber { + position: fixed; + z-index: 1000; + top: 48.5%; /* Can't do center:50% middle: 50%, so approximate it for a typical window size. */ left: 49%; - position: fixed; - top: 48.5%; - z-index: 1000; + width: 24px; + height: 24px; + padding: 4px; + opacity: 0.9; + border-radius: 7px; background-color: #232323; background-image: url(../../../../misc/loading-small.gif); + background-repeat: no-repeat; background-position: center center; - background-repeat: no-repeat; - border-radius: 7px; - height: 24px; - opacity: 0.9; - padding: 4px; - width: 24px; } .ui-dialog .ajax-progress-throbber .throbber, .ui-dialog .ajax-progress-throbber .message { display: none; } - diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/dropbutton.css --- a/core/themes/classy/css/components/dropbutton.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/dropbutton.css Thu May 09 15:33:08 2019 +0100 @@ -4,8 +4,8 @@ */ .js .dropbutton-widget { + border: 1px solid #ccc; background-color: white; - border: 1px solid #ccc; } .js .dropbutton-widget:hover { border-color: #b8b8b8; @@ -21,13 +21,13 @@ border-right: 1px solid #e8e8e8; /* LTR */ } [dir="rtl"] .dropbutton-multiple .dropbutton { + border-right: 0 none; border-left: 1px solid #e8e8e8; - border-right: 0 none; } .dropbutton-multiple .dropbutton .dropbutton-action > * { margin-right: 0.25em; /* LTR */ } [dir="rtl"] .dropbutton-multiple .dropbutton .dropbutton-action > * { + margin-right: 0; margin-left: 0.25em; - margin-right: 0; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/exposed-filters.css --- a/core/themes/classy/css/components/exposed-filters.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/exposed-filters.css Thu May 09 15:33:08 2019 +0100 @@ -9,8 +9,8 @@ } [dir="rtl"] .exposed-filters .filters { float: right; + margin-right: 0; margin-left: 1em; - margin-right: 0; } .exposed-filters .form-item { margin: 0 0 0.1em 0; @@ -18,8 +18,8 @@ } .exposed-filters .form-item label { float: left; /* LTR */ + width: 10em; font-weight: normal; - width: 10em; } [dir="rtl"] .exposed-filters .form-item label { float: right; @@ -32,8 +32,8 @@ margin-bottom: 1em; } .exposed-filters .current-filters .placeholder { + font-weight: bold; font-style: normal; - font-weight: bold; } .exposed-filters .additional-filters { float: left; /* LTR */ @@ -41,6 +41,6 @@ } [dir="rtl"] .exposed-filters .additional-filters { float: right; + margin-right: 0; margin-left: 1em; - margin-right: 0; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/field.css --- a/core/themes/classy/css/components/field.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/field.css Thu May 09 15:33:08 2019 +0100 @@ -17,9 +17,9 @@ } [dir="rtl"] .field--label-inline .field__label, [dir="rtl"] .field--label-inline .field__items { + padding-right: 0; padding-left: 0.5em; - padding-right: 0; } .field--label-inline .field__label::after { - content: ':'; + content: ":"; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/file.css --- a/core/themes/classy/css/components/file.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/file.css Thu May 09 15:33:08 2019 +0100 @@ -6,15 +6,15 @@ /* File icons. */ .file { - padding-left: 20px; /* LTR */ display: inline-block; min-height: 16px; + padding-left: 20px; /* LTR */ background-repeat: no-repeat; background-position: left center; /* LTR */ } [dir="rtl"] .file { + padding-right: 20px; padding-left: inherit; - padding-right: 20px; background-position: right center; } .file--general, diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/form.css --- a/core/themes/classy/css/components/form.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/form.css Thu May 09 15:33:08 2019 +0100 @@ -48,10 +48,10 @@ .form-composite > legend, .label { display: inline; + margin: 0; + padding: 0; font-size: inherit; font-weight: bold; - margin: 0; - padding: 0; } .form-checkboxes .form-item, .form-radios .form-item { @@ -64,23 +64,23 @@ } [dir="rtl"] .form-type-radio .description, [dir="rtl"] .form-type-checkbox .description { + margin-right: 2.4em; margin-left: 0; - margin-right: 2.4em; } .marker { color: #e00; } .form-required:after { - content: ''; + display: inline-block; + width: 6px; + height: 6px; + margin: 0 0.3em; + content: ""; vertical-align: super; - display: inline-block; /* Use a background image to prevent screen readers from announcing the text. */ background-image: url(../../../../misc/icons/ee0000/required.svg); background-repeat: no-repeat; background-size: 6px 6px; - width: 6px; - height: 6px; - margin: 0 0.3em; } abbr.tabledrag-changed, abbr.ajax-changed { @@ -94,10 +94,10 @@ /* Inline error messages. */ .form-item--error-message:before { - content: ''; display: inline-block; + width: 14px; height: 14px; - width: 14px; + content: ""; vertical-align: sub; background: url(../../../../misc/icons/e32700/error.svg) no-repeat; background-size: contain; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/forum.css --- a/core/themes/classy/css/components/forum.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/forum.css Thu May 09 15:33:08 2019 +0100 @@ -4,16 +4,16 @@ */ .forum__description { + margin: 0.5em; font-size: 0.9em; - margin: 0.5em; } .forum__icon { + float: left; /* LTR */ + width: 24px; + height: 24px; + margin: 0 9px 0 0; /* LTR */ background-image: url(../../images/icons/forum-icons.png); background-repeat: no-repeat; - float: left; /* LTR */ - height: 24px; - margin: 0 9px 0 0; /* LTR */ - width: 24px; } [dir="rtl"] .forum__icon { float: right; @@ -26,8 +26,8 @@ margin-left: 20px; /* LTR */ } [dir="rtl"] .forum .indented { + margin-right: 20px; margin-left: 0; - margin-right: 20px; } .forum__topic-status--new { background-position: -24px 0; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/icons.css --- a/core/themes/classy/css/components/icons.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/icons.css Thu May 09 15:33:08 2019 +0100 @@ -4,18 +4,18 @@ */ .icon-help { + padding: 1px 0 1px 20px; /* LTR */ background: url(../../../../misc/help.png) 0 50% no-repeat; /* LTR */ - padding: 1px 0 1px 20px; /* LTR */ } [dir="rtl"] .icon-help { + padding: 1px 20px 1px 0; background-position: 100% 50%; - padding: 1px 20px 1px 0; } .feed-icon { - background: url(../../../../misc/feed.svg) no-repeat; + display: block; overflow: hidden; - text-indent: -9999px; - display: block; width: 16px; height: 16px; + text-indent: -9999px; + background: url(../../../../misc/feed.svg) no-repeat; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/indented.css --- a/core/themes/classy/css/components/indented.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/indented.css Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,6 @@ margin-left: 25px; /* LTR */ } [dir="rtl"] .indented { + margin-right: 25px; margin-left: 0; - margin-right: 25px; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/link.css --- a/core/themes/classy/css/components/link.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/link.css Thu May 09 15:33:08 2019 +0100 @@ -4,11 +4,11 @@ */ button.link { - background: transparent; - border: 0; - cursor: pointer; margin: 0; padding: 0; + cursor: pointer; + border: 0; + background: transparent; font-size: 1em; } label button.link { diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/links.css --- a/core/themes/classy/css/components/links.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/links.css Thu May 09 15:33:08 2019 +0100 @@ -15,8 +15,8 @@ } ul.inline li { display: inline; + padding: 0 0.5em; list-style-type: none; - padding: 0 0.5em; } ul.links a.is-active { color: #000; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/menu.css --- a/core/themes/classy/css/components/menu.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/menu.css Thu May 09 15:33:08 2019 +0100 @@ -4,30 +4,30 @@ */ ul.menu { - list-style: none outside; margin-left: 1em; /* LTR */ padding: 0; + list-style: none outside; text-align: left; /* LTR */ } [dir="rtl"] ul.menu { + margin-right: 1em; margin-left: 0; - margin-right: 1em; text-align: right; } .menu-item--expanded { + list-style-type: circle; list-style-image: url(../../../../misc/menu-expanded.png); - list-style-type: circle; } .menu-item--collapsed { + list-style-type: disc; list-style-image: url(../../../../misc/menu-collapsed.png); /* LTR */ - list-style-type: disc; } [dir="rtl"] .menu-item--collapsed { list-style-image: url(../../../../misc/menu-collapsed-rtl.png); } .menu-item { + margin: 0; padding-top: 0.2em; - margin: 0; } ul.menu a.is-active { color: #000; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/messages.css --- a/core/themes/classy/css/components/messages.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/messages.css Thu May 09 15:33:08 2019 +0100 @@ -4,28 +4,28 @@ */ .messages { - background: no-repeat 10px 17px; /* LTR */ + padding: 15px 20px 15px 35px; /* LTR */ + word-wrap: break-word; border: 1px solid; border-width: 1px 1px 1px 0; /* LTR */ border-radius: 2px; - padding: 15px 20px 15px 35px; /* LTR */ - word-wrap: break-word; + background: no-repeat 10px 17px; /* LTR */ overflow-wrap: break-word; } [dir="rtl"] .messages { + padding-right: 35px; + padding-left: 20px; + text-align: right; border-width: 1px 0 1px 1px; background-position: right 10px top 17px; - padding-left: 20px; - padding-right: 35px; - text-align: right; } .messages + .messages { margin-top: 1.538em; } .messages__list { + margin: 0; + padding: 0; list-style: none; - padding: 0; - margin: 0; } .messages__item + .messages__item { margin-top: 0.769em; @@ -33,22 +33,22 @@ /* See .color-success in Seven's colors.css */ .messages--status { color: #325e1c; + border-color: #c9e1bd #c9e1bd #c9e1bd transparent; /* LTR */ background-color: #f3faef; - border-color: #c9e1bd #c9e1bd #c9e1bd transparent; /* LTR */ background-image: url(../../../../misc/icons/73b355/check.svg); box-shadow: -8px 0 0 #77b259; /* LTR */ } [dir="rtl"] .messages--status { + margin-left: 0; border-color: #c9e1bd transparent #c9e1bd #c9e1bd; box-shadow: 8px 0 0 #77b259; - margin-left: 0; } /* See .color-warning in Seven's colors.css */ .messages--warning { + color: #734c00; + border-color: #f4daa6 #f4daa6 #f4daa6 transparent; /* LTR */ background-color: #fdf8ed; background-image: url(../../../../misc/icons/e29700/warning.svg); - border-color: #f4daa6 #f4daa6 #f4daa6 transparent; /* LTR */ - color: #734c00; box-shadow: -8px 0 0 #e09600; /* LTR */ } [dir="rtl"] .messages--warning { @@ -57,10 +57,10 @@ } /* See .color-error in Seven's colors.css */ .messages--error { + color: #a51b00; + border-color: #f9c9bf #f9c9bf #f9c9bf transparent; /* LTR */ background-color: #fcf4f2; - color: #a51b00; background-image: url(../../../../misc/icons/e32700/error.svg); - border-color: #f9c9bf #f9c9bf #f9c9bf transparent; /* LTR */ box-shadow: -8px 0 0 #e62600; /* LTR */ } [dir="rtl"] .messages--error { diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/progress.css --- a/core/themes/classy/css/components/progress.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/progress.css Thu May 09 15:33:08 2019 +0100 @@ -14,7 +14,16 @@ box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.16); } .progress__bar { + height: 16px; + margin-top: -1px; + margin-left: -1px; /* LTR */ + padding: 0 1px; + -webkit-transition: width 0.5s ease-out; + transition: width 0.5s ease-out; + -webkit-animation: animate-stripes 3s linear infinite; + -moz-animation: animate-stripes 3s linear infinite; border: 1px #07629a solid; + border-radius: 10em; background: #057ec9; background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)), @@ -23,30 +32,21 @@ linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)), linear-gradient(to right bottom, #0094f0 0%, #0094f0 25%, #007ecc 25%, #007ecc 50%, #0094f0 50%, #0094f0 75%, #0094f0 100%); background-size: 40px 40px; - margin-top: -1px; - margin-left: -1px; /* LTR */ - padding: 0 1px; - height: 16px; - border-radius: 10em; - -webkit-animation: animate-stripes 3s linear infinite; - -moz-animation: animate-stripes 3s linear infinite; - -webkit-transition: width 0.5s ease-out; - transition: width 0.5s ease-out; } [dir="rtl"] .progress__bar { + margin-right: -1px; margin-left: 0; - margin-right: -1px; - animation-direction: reverse; -webkit-animation-direction: reverse; -moz-animation-direction: reverse; + animation-direction: reverse; } @media screen and (prefers-reduced-motion: reduce) { .progress__bar { + -webkit-transition: none; + transition: none; -webkit-animation: none; -moz-animation: none; - -webkit-transition: none; - transition: none; } } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/tabs.css --- a/core/themes/classy/css/components/tabs.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/tabs.css Thu May 09 15:33:08 2019 +0100 @@ -7,17 +7,17 @@ margin: 1em 0; } ul.tabs { - list-style: none; margin: 0 0 0.5em; padding: 0; + list-style: none; } .tabs > li { display: inline-block; margin-right: 0.3em; /* LTR */ } [dir="rtl"] .tabs > li { + margin-right: 0; margin-left: 0.3em; - margin-right: 0; } .tabs a { display: block; diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/textarea.css --- a/core/themes/classy/css/components/textarea.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/textarea.css Thu May 09 15:33:08 2019 +0100 @@ -5,7 +5,7 @@ .form-textarea-wrapper textarea { display: block; + box-sizing: border-box; + width: 100%; margin: 0; - width: 100%; - box-sizing: border-box; } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/ui-dialog.css --- a/core/themes/classy/css/components/ui-dialog.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/ui-dialog.css Thu May 09 15:33:08 2019 +0100 @@ -9,7 +9,7 @@ @media screen and (max-width: 600px) { .ui-dialog--narrow { + min-width: 95%; max-width: 95%; - min-width: 95%; } } diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/css/components/user.css --- a/core/themes/classy/css/components/user.css Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/css/components/user.css Thu May 09 15:33:08 2019 +0100 @@ -9,9 +9,9 @@ background-color: #ebeae4; } .password-strength__indicator { - background-color: #77b259; -webkit-transition: width 0.5s ease-out; transition: width 0.5s ease-out; + background-color: #77b259; } .password-strength__indicator.is-weak { background-color: #e62600; @@ -34,9 +34,9 @@ } .password-suggestions { + max-width: 34.7em; + margin: 0.7em 0; padding: 0.2em 0.5em; - margin: 0.7em 0; - max-width: 34.7em; border: 1px solid #b4b4b4; } .password-suggestions ul { @@ -46,9 +46,9 @@ .confirm-parent, .password-parent { clear: left; /* LTR */ + overflow: hidden; + max-width: 33em; margin: 0; - max-width: 33em; - overflow: hidden; } [dir="rtl"] .confirm-parent, [dir="rtl"] .password-parent { diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/templates/content/comment.html.twig --- a/core/themes/classy/templates/content/comment.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/templates/content/comment.html.twig Thu May 09 15:33:08 2019 +0100 @@ -13,11 +13,11 @@ * {{ content|without('field_example') }} * @endcode * - created: Formatted date and time for when the comment was created. - * Preprocess functions can reformat it by calling format_date() with the - * desired parameters on the 'comment.created' variable. + * Preprocess functions can reformat it by calling DateFormatter::format() + * with the desired parameters on the 'comment.created' variable. * - changed: Formatted date and time for when the comment was last changed. - * Preprocess functions can reformat it by calling format_date() with the - * desired parameters on the 'comment.changed' variable. + * Preprocess functions can reformat it by calling DateFormatter::format() + * with the desired parameters on the 'comment.changed' variable. * - permalink: Comment permalink. * - submitted: Submission information created from author and created * during template_preprocess_comment(). diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/templates/content/node.html.twig --- a/core/themes/classy/templates/content/node.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/templates/content/node.html.twig Thu May 09 15:33:08 2019 +0100 @@ -15,7 +15,7 @@ * Calling other methods, such as node.delete(), will result in an exception. * See \Drupal\node\Entity\Node for a full list of public properties and * methods for the node object. - * - label: The title of the node. + * - label: (optional) The title of the node. * - content: All node items. Use {{ content }} to print them all, * or print a subset such as {{ content.field_example }}. Use * {{ content|without('field_example') }} to temporarily suppress the printing @@ -23,8 +23,8 @@ * - author_picture: The node author user entity, rendered using the "compact" * view mode. * - metadata: Metadata for this node. - * - date: Themed creation date field. - * - author_name: Themed author name field. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. * - display_submitted: Whether submission information should be displayed. * - attributes: HTML attributes for the containing element. @@ -84,7 +84,7 @@ {{ title_prefix }} - {% if not page %} + {% if label and not page %} {{ label }} diff -r 129ea1e6d783 -r af1871eacc83 core/themes/classy/templates/field/time.html.twig --- a/core/themes/classy/templates/field/time.html.twig Thu Feb 28 13:21:36 2019 +0000 +++ b/core/themes/classy/templates/field/time.html.twig Thu May 09 15:33:08 2019 +0100 @@ -9,11 +9,11 @@ * attribute value in attributes.datetime. * - text: (optional) The content to display within the
-"; - } - - // line 42 - public function block_content($context, array $blocks = []) - { - // line 43 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " - "; - } - - public function getTemplateName() - { - return "@classy/block/block--search-form-block.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 80 => 43, 77 => 42, 72 => 45, 70 => 42, 65 => 41, 57 => 39, 55 => 38, 51 => 37, 46 => 36, 44 => 30,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "@classy/block/block--search-form-block.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/block/block--search-form-block.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block--search-form-block._Hw8-ysT8Nq_53Gz9gaqawBqFG/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_block--search-form-block._Hw8-ysT8Nq_53Gz9gaqawBqFG/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block--search-form-block._Hw8-ysT8Nq_53Gz9gaqawBqFG/NY7OhDI8dL9O6EDEJCUKz3kwbZ1ejvtkVnrVOEIoxDw.php --- a/sites/default/files/php/twig/5c77df9da7840_block--search-form-block._Hw8-ysT8Nq_53Gz9gaqawBqFG/NY7OhDI8dL9O6EDEJCUKz3kwbZ1ejvtkVnrVOEIoxDw.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -parent = $this->loadTemplate("@classy/block/block--search-form-block.html.twig", "themes/isobartik/templates/block--search-form-block.html.twig", 1); - $this->blocks = [ - 'content' => [$this, 'block_content'], - ]; - } - - protected function doGetParent(array $context) - { - return "@classy/block/block--search-form-block.html.twig"; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - $this->parent->display($context, array_merge($this->blocks, $blocks)); - } - - // line 19 - public function block_content($context, array $blocks = []) - { - // line 20 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["content_attributes"] ?? null), "addClass", [0 => "content", 1 => "container-inline"], "method"), "html", null, true)); - echo "> - "; - // line 21 - $this->displayParentBlock("content", $context, $blocks); - echo " -
-"; - } - - public function getTemplateName() - { - return "themes/isobartik/templates/block--search-form-block.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 60 => 21, 55 => 20, 52 => 19, 11 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "themes/isobartik/templates/block--search-form-block.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/block--search-form-block.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block--system-menu-block._1mrraq57epVEwI8rbKEg2iw1y/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_block--system-menu-block._1mrraq57epVEwI8rbKEg2iw1y/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block--system-menu-block._1mrraq57epVEwI8rbKEg2iw1y/LuO4WBwQFHqtbNrLos3YLmGaVpnHkru5bg2AqOoxnCU.php --- a/sites/default/files/php/twig/5c77df9da7840_block--system-menu-block._1mrraq57epVEwI8rbKEg2iw1y/LuO4WBwQFHqtbNrLos3YLmGaVpnHkru5bg2AqOoxnCU.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -parent = $this->loadTemplate("@classy/block/block--system-menu-block.html.twig", "themes/isobartik/templates/block--system-menu-block.html.twig", 1); - $this->blocks = [ - 'content' => [$this, 'block_content'], - ]; - } - - protected function doGetParent(array $context) - { - return "@classy/block/block--system-menu-block.html.twig"; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 10, "trans" => 17]; - $filters = ["clean_id" => 10]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'trans'], - ['clean_id'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 10 - $context["show_anchor"] = ("show-" . \Drupal\Component\Utility\Html::getId($this->getAttribute(($context["attributes"] ?? null), "id", []))); - // line 11 - $context["hide_anchor"] = ("hide-" . \Drupal\Component\Utility\Html::getId($this->getAttribute(($context["attributes"] ?? null), "id", []))); - // line 1 - $this->parent->display($context, array_merge($this->blocks, $blocks)); - } - - // line 12 - public function block_content($context, array $blocks = []) - { - // line 13 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["content_attributes"] ?? null), "addClass", [0 => "content"], "method"), "html", null, true)); - echo "> - "; - // line 15 - echo "
env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["show_anchor"] ?? null), "html", null, true)); - echo "\">
-
env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["hide_anchor"] ?? null), "html", null, true)); - echo "\">
- env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["show_anchor"] ?? null), "html", null, true)); - echo "\">"; - echo t("Show — @configuration.label", array("@configuration.label" => $this->getAttribute(($context["configuration"] ?? null), "label", []), )); - echo " - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["hide_anchor"] ?? null), "html", null, true)); - echo "\">"; - echo t("Hide — @configuration.label", array("@configuration.label" => $this->getAttribute(($context["configuration"] ?? null), "label", []), )); - echo " - "; - // line 19 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " - -"; - } - - public function getTemplateName() - { - return "themes/isobartik/templates/block--system-menu-block.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 86 => 19, 80 => 18, 74 => 17, 70 => 16, 65 => 15, 60 => 13, 57 => 12, 53 => 1, 51 => 11, 49 => 10, 11 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "themes/isobartik/templates/block--system-menu-block.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/block--system-menu-block.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block--system-menu-block._2hNSCNK6Y2jmAWQaMH3vksp4p/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_block--system-menu-block._2hNSCNK6Y2jmAWQaMH3vksp4p/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block--system-menu-block._2hNSCNK6Y2jmAWQaMH3vksp4p/nbjfXfDIn3pmCFNGyuCM_qHZ05Lal0ET5tPVCAJwLY8.php --- a/sites/default/files/php/twig/5c77df9da7840_block--system-menu-block._2hNSCNK6Y2jmAWQaMH3vksp4p/nbjfXfDIn3pmCFNGyuCM_qHZ05Lal0ET5tPVCAJwLY8.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -parent = false; - - $this->blocks = [ - 'content' => [$this, 'block_content'], - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 35, "if" => 45, "block" => 53]; - $filters = ["clean_class" => 39, "clean_id" => 42, "without" => 43]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if', 'block'], - ['clean_class', 'clean_id', 'without'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 35 - $context["classes"] = [0 => "block", 1 => "block-menu", 2 => "navigation", 3 => ("menu--" . \Drupal\Component\Utility\Html::getClass( // line 39 -($context["derivative_plugin_id"] ?? null)))]; - // line 42 - $context["heading_id"] = ($this->getAttribute(($context["attributes"] ?? null), "id", []) . \Drupal\Component\Utility\Html::getId("-menu")); - // line 43 - echo " -"; - } - - // line 53 - public function block_content($context, array $blocks = []) - { - // line 54 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " - "; - } - - public function getTemplateName() - { - return "@classy/block/block--system-menu-block.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 92 => 54, 89 => 53, 84 => 56, 81 => 53, 76 => 50, 70 => 49, 65 => 48, 62 => 47, 59 => 46, 56 => 45, 49 => 43, 47 => 42, 45 => 39, 44 => 35,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "@classy/block/block--system-menu-block.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/block/block--system-menu-block.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block--system-messages-bl_ZI0iUqt_t91aPosCA454NgoNz/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_block--system-messages-bl_ZI0iUqt_t91aPosCA454NgoNz/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block--system-messages-bl_ZI0iUqt_t91aPosCA454NgoNz/fPWC1NxSznKCMe1fakcV9I7sTxmmMRak6nI0CRmQJm4.php --- a/sites/default/files/php/twig/5c77df9da7840_block--system-messages-bl_ZI0iUqt_t91aPosCA454NgoNz/fPWC1NxSznKCMe1fakcV9I7sTxmmMRak6nI0CRmQJm4.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 13 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/stable/templates/block/block--system-messages-block.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 43 => 13,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/stable/templates/block/block--system-messages-block.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/block/block--system-messages-block.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block.html.twig_CIz2o0S3PkA8DW5E6V6XtYLjI/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_block.html.twig_CIz2o0S3PkA8DW5E6V6XtYLjI/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block.html.twig_CIz2o0S3PkA8DW5E6V6XtYLjI/pb3i7xJG1wXf2V7PQlFILjpNxMFDVEthEdYPlGv71iw.php --- a/sites/default/files/php/twig/5c77df9da7840_block.html.twig_CIz2o0S3PkA8DW5E6V6XtYLjI/pb3i7xJG1wXf2V7PQlFILjpNxMFDVEthEdYPlGv71iw.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -parent = false; - - $this->blocks = [ - 'content' => [$this, 'block_content'], - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 33, "if" => 41, "block" => 45]; - $filters = ["clean_class" => 35]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if', 'block'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 33 - $context["classes"] = [0 => "block", 1 => ("block-" . \Drupal\Component\Utility\Html::getClass($this->getAttribute( // line 35 -($context["configuration"] ?? null), "provider", []))), 2 => ("block-" . \Drupal\Component\Utility\Html::getClass( // line 36 -($context["plugin_id"] ?? null)))]; - // line 39 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 40 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_prefix"] ?? null), "html", null, true)); - echo " - "; - // line 41 - if (($context["label"] ?? null)) { - // line 42 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_attributes"] ?? null), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true)); - echo " - "; - } - // line 44 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_suffix"] ?? null), "html", null, true)); - echo " - "; - // line 45 - $this->displayBlock('content', $context, $blocks); - // line 50 - echo " -"; - } - - // line 45 - public function block_content($context, array $blocks = []) - { - // line 46 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["content_attributes"] ?? null), "addClass", [0 => "content"], "method"), "html", null, true)); - echo "> - "; - // line 47 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " - - "; - } - - public function getTemplateName() - { - return "themes/isobartik/templates/block.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 87 => 47, 82 => 46, 79 => 45, 74 => 50, 72 => 45, 67 => 44, 59 => 42, 57 => 41, 53 => 40, 48 => 39, 46 => 36, 45 => 35, 44 => 33,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "themes/isobartik/templates/block.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/block.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block.html.twig_RaxcD_Ozyj4rZR7jTJXMDcNYp/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_block.html.twig_RaxcD_Ozyj4rZR7jTJXMDcNYp/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block.html.twig_RaxcD_Ozyj4rZR7jTJXMDcNYp/uIYh7UThhK7o_7scxBinuPee47VGD64QcOPipIN0WJk.php --- a/sites/default/files/php/twig/5c77df9da7840_block.html.twig_RaxcD_Ozyj4rZR7jTJXMDcNYp/uIYh7UThhK7o_7scxBinuPee47VGD64QcOPipIN0WJk.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -parent = false; - - $this->blocks = [ - 'content' => [$this, 'block_content'], - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 32, "block" => 36]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if', 'block'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 30 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["attributes"] ?? null), "html", null, true)); - echo "> - "; - // line 31 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_prefix"] ?? null), "html", null, true)); - echo " - "; - // line 32 - if (($context["label"] ?? null)) { - // line 33 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_attributes"] ?? null), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true)); - echo " - "; - } - // line 35 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_suffix"] ?? null), "html", null, true)); - echo " - "; - // line 36 - $this->displayBlock('content', $context, $blocks); - // line 39 - echo " -"; - } - - // line 36 - public function block_content($context, array $blocks = []) - { - // line 37 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " - "; - } - - public function getTemplateName() - { - return "@block/block.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 78 => 37, 75 => 36, 70 => 39, 68 => 36, 63 => 35, 55 => 33, 53 => 32, 49 => 31, 44 => 30,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "@block/block.html.twig", "/var/www/sites/isophonics.net/core/modules/block/templates/block.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block.html.twig_SPyKCXAOAP3fcdrOgkAHxAZj_/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_block.html.twig_SPyKCXAOAP3fcdrOgkAHxAZj_/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_block.html.twig_SPyKCXAOAP3fcdrOgkAHxAZj_/m02_eHe6t3YqZabOZJAa6K2Rh7vDQqw5ZDFgR_bnB6A.php --- a/sites/default/files/php/twig/5c77df9da7840_block.html.twig_SPyKCXAOAP3fcdrOgkAHxAZj_/m02_eHe6t3YqZabOZJAa6K2Rh7vDQqw5ZDFgR_bnB6A.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -parent = false; - - $this->blocks = [ - 'content' => [$this, 'block_content'], - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 29, "if" => 37, "block" => 41]; - $filters = ["clean_class" => 31]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if', 'block'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 29 - $context["classes"] = [0 => "block", 1 => ("block-" . \Drupal\Component\Utility\Html::getClass($this->getAttribute( // line 31 -($context["configuration"] ?? null), "provider", []))), 2 => ("block-" . \Drupal\Component\Utility\Html::getClass( // line 32 -($context["plugin_id"] ?? null)))]; - // line 35 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 36 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_prefix"] ?? null), "html", null, true)); - echo " - "; - // line 37 - if (($context["label"] ?? null)) { - // line 38 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_attributes"] ?? null), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true)); - echo " - "; - } - // line 40 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_suffix"] ?? null), "html", null, true)); - echo " - "; - // line 41 - $this->displayBlock('content', $context, $blocks); - // line 44 - echo " -"; - } - - // line 41 - public function block_content($context, array $blocks = []) - { - // line 42 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " - "; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/block/block.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 82 => 42, 79 => 41, 74 => 44, 72 => 41, 67 => 40, 59 => 38, 57 => 37, 53 => 36, 48 => 35, 46 => 32, 45 => 31, 44 => 29,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/block/block.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/block/block.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_breadcrumb.html.twig_H4UQfgZP18ZL0vxRxVUOyXGQy/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_breadcrumb.html.twig_H4UQfgZP18ZL0vxRxVUOyXGQy/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_breadcrumb.html.twig_H4UQfgZP18ZL0vxRxVUOyXGQy/95GfoCKTnHr60S08TGYe4UhpWXxEO9s31J6RIPWuwvE.php --- a/sites/default/files/php/twig/5c77df9da7840_breadcrumb.html.twig_H4UQfgZP18ZL0vxRxVUOyXGQy/95GfoCKTnHr60S08TGYe4UhpWXxEO9s31J6RIPWuwvE.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 10, "for" => 14]; - $filters = ["t" => 12]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if', 'for'], - ['t'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 10 - if (($context["breadcrumb"] ?? null)) { - // line 11 - echo " -"; - } - } - - public function getTemplateName() - { - return "core/themes/classy/templates/navigation/breadcrumb.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 83 => 23, 76 => 21, 70 => 19, 62 => 17, 60 => 16, 57 => 15, 53 => 14, 48 => 12, 45 => 11, 43 => 10,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/navigation/breadcrumb.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/breadcrumb.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_container.html.twig_5ytYVUs_gdkx819cOy1xqJ2Z_/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_container.html.twig_5ytYVUs_gdkx819cOy1xqJ2Z_/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_container.html.twig_5ytYVUs_gdkx819cOy1xqJ2Z_/WKS3_AQR28NaaJi5-NqKWooMItdjK85BcF5HiqX0bVY.php --- a/sites/default/files/php/twig/5c77df9da7840_container.html.twig_5ytYVUs_gdkx819cOy1xqJ2Z_/WKS3_AQR28NaaJi5-NqKWooMItdjK85BcF5HiqX0bVY.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 23]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 23 - $context["classes"] = [0 => (( // line 24 -($context["has_parent"] ?? null)) ? ("js-form-wrapper") : ("")), 1 => (( // line 25 -($context["has_parent"] ?? null)) ? ("form-wrapper") : (""))]; - // line 28 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["children"] ?? null), "html", null, true)); - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/form/container.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 47 => 28, 45 => 25, 44 => 24, 43 => 23,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/form/container.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/container.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--comment.html.twig_YK_Ioe_n90akMtES79fzIR33M/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_field--comment.html.twig_YK_Ioe_n90akMtES79fzIR33M/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--comment.html.twig_YK_Ioe_n90akMtES79fzIR33M/PRfJIQzw7JSU-VFd23QJp8b3NMl10aP3VPIywGU-WhM.php --- a/sites/default/files/php/twig/5c77df9da7840_field--comment.html.twig_YK_Ioe_n90akMtES79fzIR33M/PRfJIQzw7JSU-VFd23QJp8b3NMl10aP3VPIywGU-WhM.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 29, "if" => 44]; - $filters = ["clean_class" => 31, "t" => 53]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if'], - ['clean_class', 't'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 29 - $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass( // line 31 -($context["field_name"] ?? null))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass( // line 32 -($context["field_type"] ?? null))), 3 => ("field--label-" . // line 33 -($context["label_display"] ?? null)), 4 => "comment-wrapper"]; - // line 38 - $context["title_classes"] = [0 => "title", 1 => ((( // line 40 -($context["label_display"] ?? null) == "visually_hidden")) ? ("visually-hidden") : (""))]; - // line 43 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 44 - if ((($context["comments"] ?? null) && !($context["label_hidden"] ?? null))) { - // line 45 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_prefix"] ?? null), "html", null, true)); - echo " - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => ($context["title_classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true)); - echo " - "; - // line 47 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_suffix"] ?? null), "html", null, true)); - echo " - "; - } - // line 49 - echo " - "; - // line 50 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["comments"] ?? null), "html", null, true)); - echo " - - "; - // line 52 - if (($context["comment_form"] ?? null)) { - // line 53 - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Add new comment"))); - echo "

- "; - // line 54 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["comment_form"] ?? null), "html", null, true)); - echo " - "; - } - // line 56 - echo " - -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/field/field--comment.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 94 => 56, 89 => 54, 84 => 53, 82 => 52, 77 => 50, 74 => 49, 69 => 47, 63 => 46, 58 => 45, 56 => 44, 51 => 43, 49 => 40, 48 => 38, 46 => 33, 45 => 32, 44 => 31, 43 => 29,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/field/field--comment.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--comment.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--node--created.html_ZRaCLMEpVfrzxWAK5lvCUvb3I/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_field--node--created.html_ZRaCLMEpVfrzxWAK5lvCUvb3I/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--node--created.html_ZRaCLMEpVfrzxWAK5lvCUvb3I/Oxp0juO-sSq29ZJcX0cizjF0Nqg4lLcY5bfZpY--xHo.php --- a/sites/default/files/php/twig/5c77df9da7840_field--node--created.html_ZRaCLMEpVfrzxWAK5lvCUvb3I/Oxp0juO-sSq29ZJcX0cizjF0Nqg4lLcY5bfZpY--xHo.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 23, "for" => 31]; - $filters = ["clean_class" => 25]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'for'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 23 - $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass( // line 25 -($context["field_name"] ?? null))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass( // line 26 -($context["field_type"] ?? null))), 3 => ("field--label-" . // line 27 -($context["label_display"] ?? null))]; - // line 30 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - // line 31 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 32 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "content", []), "html", null, true)); - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 34 - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/field/field--node--created.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 62 => 34, 56 => 32, 52 => 31, 48 => 30, 46 => 27, 45 => 26, 44 => 25, 43 => 23,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/field/field--node--created.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--node--created.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--node--title.html.t_uHV16hM_5Ek2SKYrnVCT8a34x/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_field--node--title.html.t_uHV16hM_5Ek2SKYrnVCT8a34x/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--node--title.html.t_uHV16hM_5Ek2SKYrnVCT8a34x/6NVqMhWM09hh-m-HCQH_DKgU0UYjPNAZ2g6KnCPs8bM.php --- a/sites/default/files/php/twig/5c77df9da7840_field--node--title.html.t_uHV16hM_5Ek2SKYrnVCT8a34x/6NVqMhWM09hh-m-HCQH_DKgU0UYjPNAZ2g6KnCPs8bM.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 23, "for" => 31]; - $filters = ["clean_class" => 25]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'for'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 23 - $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass( // line 25 -($context["field_name"] ?? null))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass( // line 26 -($context["field_type"] ?? null))), 3 => ("field--label-" . // line 27 -($context["label_display"] ?? null))]; - // line 30 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - // line 31 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 32 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "content", []), "html", null, true)); - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 34 - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/field/field--node--title.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 62 => 34, 56 => 32, 52 => 31, 48 => 30, 46 => 27, 45 => 26, 44 => 25, 43 => 23,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/field/field--node--title.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--node--title.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--node--uid.html.twi_pHva96U8V4NJsFe_uKfLrz0F8/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_field--node--uid.html.twi_pHva96U8V4NJsFe_uKfLrz0F8/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--node--uid.html.twi_pHva96U8V4NJsFe_uKfLrz0F8/dLhlc3_WXyGKJjK8XR-_aILHxkdLSxgC9nqnMC0LqSY.php --- a/sites/default/files/php/twig/5c77df9da7840_field--node--uid.html.twi_pHva96U8V4NJsFe_uKfLrz0F8/dLhlc3_WXyGKJjK8XR-_aILHxkdLSxgC9nqnMC0LqSY.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 23, "for" => 31]; - $filters = ["clean_class" => 25]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'for'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 23 - $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass( // line 25 -($context["field_name"] ?? null))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass( // line 26 -($context["field_type"] ?? null))), 3 => ("field--label-" . // line 27 -($context["label_display"] ?? null))]; - // line 30 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - // line 31 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 32 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "content", []), "html", null, true)); - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 34 - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/field/field--node--uid.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 62 => 34, 56 => 32, 52 => 31, 48 => 30, 46 => 27, 45 => 26, 44 => 25, 43 => 23,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/field/field--node--uid.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--node--uid.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--text-long.html.twi_8qcsk4VfkwG2ribFw6EjkUnjh/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_field--text-long.html.twi_8qcsk4VfkwG2ribFw6EjkUnjh/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--text-long.html.twi_8qcsk4VfkwG2ribFw6EjkUnjh/r5-dG4w8mNP_gUkROTp2deIJm_c6w9iP_7XkfJqwwPE.php --- a/sites/default/files/php/twig/5c77df9da7840_field--text-long.html.twi_8qcsk4VfkwG2ribFw6EjkUnjh/r5-dG4w8mNP_gUkROTp2deIJm_c6w9iP_7XkfJqwwPE.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -parent = $this->loadTemplate("field--text.html.twig", "core/themes/classy/templates/field/field--text-long.html.twig", 1); - $this->blocks = [ - ]; - } - - protected function doGetParent(array $context) - { - return "field--text.html.twig"; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - $this->parent->display($context, array_merge($this->blocks, $blocks)); - } - - public function getTemplateName() - { - return "core/themes/classy/templates/field/field--text-long.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 11 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/field/field--text-long.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--text-long.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--text-with-summary._gLNSZGKby7XjpK24cB7UxUBGx/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_field--text-with-summary._gLNSZGKby7XjpK24cB7UxUBGx/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--text-with-summary._gLNSZGKby7XjpK24cB7UxUBGx/9PQm_OQDYaauN7jryPebGXwQxRRtdJWmnCu2BAwacFk.php --- a/sites/default/files/php/twig/5c77df9da7840_field--text-with-summary._gLNSZGKby7XjpK24cB7UxUBGx/9PQm_OQDYaauN7jryPebGXwQxRRtdJWmnCu2BAwacFk.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -parent = $this->loadTemplate("field--text.html.twig", "core/themes/classy/templates/field/field--text-with-summary.html.twig", 1); - $this->blocks = [ - ]; - } - - protected function doGetParent(array $context) - { - return "field--text.html.twig"; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - $this->parent->display($context, array_merge($this->blocks, $blocks)); - } - - public function getTemplateName() - { - return "core/themes/classy/templates/field/field--text-with-summary.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 11 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/field/field--text-with-summary.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--text-with-summary.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--text.html.twig_QRokRSh6FCHqQzooG_1XDDBRv/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_field--text.html.twig_QRokRSh6FCHqQzooG_1XDDBRv/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field--text.html.twig_QRokRSh6FCHqQzooG_1XDDBRv/46Cvjelhl4RruCyh-BR5iKJb7_KO300jHnMBXLhN2_4.php --- a/sites/default/files/php/twig/5c77df9da7840_field--text.html.twig_QRokRSh6FCHqQzooG_1XDDBRv/46Cvjelhl4RruCyh-BR5iKJb7_KO300jHnMBXLhN2_4.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -parent = $this->loadTemplate("field.html.twig", "field--text.html.twig", 1); - $this->blocks = [ - ]; - } - - protected function doGetParent(array $context) - { - return "field.html.twig"; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 28]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 28 - $context["attributes"] = $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "clearfix", 1 => "text-formatted"], "method"); - // line 1 - $this->parent->display($context, array_merge($this->blocks, $blocks)); - } - - public function getTemplateName() - { - return "field--text.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 50 => 1, 48 => 28, 11 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "field--text.html.twig", "core/themes/classy/templates/field/field--text.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field.html.twig_sg0aNDZNrB2qJXZQKh1ByVo-x/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_field.html.twig_sg0aNDZNrB2qJXZQKh1ByVo-x/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_field.html.twig_sg0aNDZNrB2qJXZQKh1ByVo-x/X9m-wPh3EJaVJdFNPOeSbnIPRKzvsONxDOuM01y3k5U.php --- a/sites/default/files/php/twig/5c77df9da7840_field.html.twig_sg0aNDZNrB2qJXZQKh1ByVo-x/X9m-wPh3EJaVJdFNPOeSbnIPRKzvsONxDOuM01y3k5U.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 41, "if" => 55, "for" => 58]; - $filters = ["clean_class" => 43]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if', 'for'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 41 - $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass( // line 43 -($context["field_name"] ?? null))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass( // line 44 -($context["field_type"] ?? null))), 3 => ("field--label-" . // line 45 -($context["label_display"] ?? null))]; - // line 49 - $context["title_classes"] = [0 => "field__label", 1 => ((( // line 51 -($context["label_display"] ?? null) == "visually_hidden")) ? ("visually-hidden") : (""))]; - // line 54 - echo " -"; - // line 55 - if (($context["label_hidden"] ?? null)) { - // line 56 - echo " "; - if (($context["multiple"] ?? null)) { - // line 57 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null), 1 => "field__items"], "method"), "html", null, true)); - echo "> - "; - // line 58 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 59 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["item"], "attributes", []), "addClass", [0 => "field__item"], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "content", []), "html", null, true)); - echo " - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 61 - echo " - "; - } else { - // line 63 - echo " "; - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 64 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null), 1 => "field__item"], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "content", []), "html", null, true)); - echo " - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 66 - echo " "; - } - } else { - // line 68 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => ($context["title_classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true)); - echo " - "; - // line 70 - if (($context["multiple"] ?? null)) { - // line 71 - echo "
- "; - } - // line 73 - echo " "; - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 74 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["item"], "attributes", []), "addClass", [0 => "field__item"], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "content", []), "html", null, true)); - echo "
- "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 76 - echo " "; - if (($context["multiple"] ?? null)) { - // line 77 - echo " - "; - } - // line 79 - echo " -"; - } - } - - public function getTemplateName() - { - return "core/themes/classy/templates/field/field.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 143 => 79, 139 => 77, 136 => 76, 125 => 74, 120 => 73, 116 => 71, 114 => 70, 108 => 69, 103 => 68, 99 => 66, 88 => 64, 83 => 63, 79 => 61, 68 => 59, 64 => 58, 59 => 57, 56 => 56, 54 => 55, 51 => 54, 49 => 51, 48 => 49, 46 => 45, 45 => 44, 44 => 43, 43 => 41,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/field/field.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_form--search-block-form.h_YEtfwF0CQwlW4bNJjdBbzp2DC/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_form--search-block-form.h_YEtfwF0CQwlW4bNJjdBbzp2DC/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_form--search-block-form.h_YEtfwF0CQwlW4bNJjdBbzp2DC/6cbYjlcfR96WpTGbr8j35K-cMHqqAHabkSoVgenuc0U.php --- a/sites/default/files/php/twig/5c77df9da7840_form--search-block-form.h_YEtfwF0CQwlW4bNJjdBbzp2DC/6cbYjlcfR96WpTGbr8j35K-cMHqqAHabkSoVgenuc0U.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 13 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "search-form", 1 => "search-block-form"], "method"), "html", null, true)); - echo "> - "; - // line 14 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["children"] ?? null), "html", null, true)); - echo " - -"; - } - - public function getTemplateName() - { - return "themes/isobartik/templates/form--search-block-form.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 48 => 14, 43 => 13,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "themes/isobartik/templates/form--search-block-form.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/form--search-block-form.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_form-element-label.html.t_LIUK9REF8eGBcgyB37knqChLi/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_form-element-label.html.t_LIUK9REF8eGBcgyB37knqChLi/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_form-element-label.html.t_LIUK9REF8eGBcgyB37knqChLi/nDd2IAqoDlaIqGfYnWAybgPzuKiuAM6igLdHktoyRyc.php --- a/sites/default/files/php/twig/5c77df9da7840_form-element-label.html.t_LIUK9REF8eGBcgyB37knqChLi/nDd2IAqoDlaIqGfYnWAybgPzuKiuAM6igLdHktoyRyc.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 16, "if" => 23]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 16 - $context["classes"] = [0 => ((( // line 17 -($context["title_display"] ?? null) == "after")) ? ("option") : ("")), 1 => ((( // line 18 -($context["title_display"] ?? null) == "invisible")) ? ("visually-hidden") : ("")), 2 => (( // line 19 -($context["required"] ?? null)) ? ("js-form-required") : ("")), 3 => (( // line 20 -($context["required"] ?? null)) ? ("form-required") : (""))]; - // line 23 - if (( !twig_test_empty(($context["title"] ?? null)) || ($context["required"] ?? null))) { - // line 24 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title"] ?? null), "html", null, true)); - echo ""; - } - } - - public function getTemplateName() - { - return "core/themes/classy/templates/form/form-element-label.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 51 => 24, 49 => 23, 47 => 20, 46 => 19, 45 => 18, 44 => 17, 43 => 16,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/form/form-element-label.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/form-element-label.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_form-element.html.twig_dJcTIbdx1y7B0dbOtEyyZSSZ1/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_form-element.html.twig_dJcTIbdx1y7B0dbOtEyyZSSZ1/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_form-element.html.twig_dJcTIbdx1y7B0dbOtEyyZSSZ1/C81fTChsSTb7aXcVrn907JqPr_ff3IXWRGwglPtmEG4.php --- a/sites/default/files/php/twig/5c77df9da7840_form-element.html.twig_dJcTIbdx1y7B0dbOtEyyZSSZ1/C81fTChsSTb7aXcVrn907JqPr_ff3IXWRGwglPtmEG4.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 48, "if" => 67]; - $filters = ["clean_class" => 51]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 48 - $context["classes"] = [0 => "js-form-item", 1 => "form-item", 2 => ("js-form-type-" . \Drupal\Component\Utility\Html::getClass( // line 51 -($context["type"] ?? null))), 3 => ("form-type-" . \Drupal\Component\Utility\Html::getClass( // line 52 -($context["type"] ?? null))), 4 => ("js-form-item-" . \Drupal\Component\Utility\Html::getClass( // line 53 -($context["name"] ?? null))), 5 => ("form-item-" . \Drupal\Component\Utility\Html::getClass( // line 54 -($context["name"] ?? null))), 6 => ((!twig_in_filter( // line 55 -($context["title_display"] ?? null), [0 => "after", 1 => "before"])) ? ("form-no-label") : ("")), 7 => ((( // line 56 -($context["disabled"] ?? null) == "disabled")) ? ("form-disabled") : ("")), 8 => (( // line 57 -($context["errors"] ?? null)) ? ("form-item--error") : (""))]; - // line 61 - $context["description_classes"] = [0 => "description", 1 => ((( // line 63 -($context["description_display"] ?? null) == "invisible")) ? ("visually-hidden") : (""))]; - // line 66 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 67 - if (twig_in_filter(($context["label_display"] ?? null), [0 => "before", 1 => "invisible"])) { - // line 68 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true)); - echo " - "; - } - // line 70 - echo " "; - if ( !twig_test_empty(($context["prefix"] ?? null))) { - // line 71 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["prefix"] ?? null), "html", null, true)); - echo " - "; - } - // line 73 - echo " "; - if (((($context["description_display"] ?? null) == "before") && $this->getAttribute(($context["description"] ?? null), "content", []))) { - // line 74 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["description"] ?? null), "attributes", []), "html", null, true)); - echo "> - "; - // line 75 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["description"] ?? null), "content", []), "html", null, true)); - echo " - - "; - } - // line 78 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["children"] ?? null), "html", null, true)); - echo " - "; - // line 79 - if ( !twig_test_empty(($context["suffix"] ?? null))) { - // line 80 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["suffix"] ?? null), "html", null, true)); - echo " - "; - } - // line 82 - echo " "; - if ((($context["label_display"] ?? null) == "after")) { - // line 83 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true)); - echo " - "; - } - // line 85 - echo " "; - if (($context["errors"] ?? null)) { - // line 86 - echo "
- "; - // line 87 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["errors"] ?? null), "html", null, true)); - echo " -
- "; - } - // line 90 - echo " "; - if ((twig_in_filter(($context["description_display"] ?? null), [0 => "after", 1 => "invisible"]) && $this->getAttribute(($context["description"] ?? null), "content", []))) { - // line 91 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute(($context["description"] ?? null), "attributes", []), "addClass", [0 => ($context["description_classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 92 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["description"] ?? null), "content", []), "html", null, true)); - echo " - - "; - } - // line 95 - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/form/form-element.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 139 => 95, 133 => 92, 128 => 91, 125 => 90, 119 => 87, 116 => 86, 113 => 85, 107 => 83, 104 => 82, 98 => 80, 96 => 79, 91 => 78, 85 => 75, 80 => 74, 77 => 73, 71 => 71, 68 => 70, 62 => 68, 60 => 67, 55 => 66, 53 => 63, 52 => 61, 50 => 57, 49 => 56, 48 => 55, 47 => 54, 46 => 53, 45 => 52, 44 => 51, 43 => 48,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/form/form-element.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/form-element.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_form.html.twig_yB95M-mH2KEXj4tKtKISfLbel/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_form.html.twig_yB95M-mH2KEXj4tKtKISfLbel/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_form.html.twig_yB95M-mH2KEXj4tKtKISfLbel/WsF61Nl6ELKheg0vyKpWD4pmgqOzIts6Zf_DiJW0AJI.php --- a/sites/default/files/php/twig/5c77df9da7840_form.html.twig_yB95M-mH2KEXj4tKtKISfLbel/WsF61Nl6ELKheg0vyKpWD4pmgqOzIts6Zf_DiJW0AJI.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 13 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["attributes"] ?? null), "html", null, true)); - echo "> - "; - // line 14 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["children"] ?? null), "html", null, true)); - echo " - -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/form/form.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 48 => 14, 43 => 13,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/form/form.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/form.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_html.html.twig_gQv-GORxUVif_Pag4s-5z2NkO/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_html.html.twig_gQv-GORxUVif_Pag4s-5z2NkO/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_html.html.twig_gQv-GORxUVif_Pag4s-5z2NkO/sa428CSha_1jP8108y9kYASf1HMkzCuX7r6EehGYxSU.php --- a/sites/default/files/php/twig/5c77df9da7840_html.html.twig_gQv-GORxUVif_Pag4s-5z2NkO/sa428CSha_1jP8108y9kYASf1HMkzCuX7r6EehGYxSU.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 27]; - $filters = ["clean_class" => 29, "safe_join" => 38, "t" => 48]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set'], - ['clean_class', 'safe_join', 't'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 27 - $context["body_classes"] = [0 => (( // line 28 -($context["logged_in"] ?? null)) ? ("user-logged-in") : ("")), 1 => (( ! // line 29 -($context["root_path"] ?? null)) ? ("path-frontpage") : (("path-" . \Drupal\Component\Utility\Html::getClass(($context["root_path"] ?? null))))), 2 => (( // line 30 -($context["node_type"] ?? null)) ? (("page-node-type-" . \Drupal\Component\Utility\Html::getClass(($context["node_type"] ?? null)))) : ("")), 3 => (( // line 31 -($context["db_offline"] ?? null)) ? ("db-offline") : (""))]; - // line 34 - echo " -env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["html_attributes"] ?? null), "html", null, true)); - echo "> - - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["placeholder_token"] ?? null), "html", null, true)); - echo "\"> - "; - // line 38 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($this->env->getExtension('Drupal\Core\Template\TwigExtension')->safeJoin($this->env, ($context["head_title"] ?? null), " | "))); - echo " - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["placeholder_token"] ?? null), "html", null, true)); - echo "\"> - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["placeholder_token"] ?? null), "html", null, true)); - echo "\"> - - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["body_classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 47 - echo " - "; - // line 48 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Skip to main content"))); - echo " - - "; - // line 50 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["page_top"] ?? null), "html", null, true)); - echo " - "; - // line 51 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["page"] ?? null), "html", null, true)); - echo " - "; - // line 52 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["page_bottom"] ?? null), "html", null, true)); - echo " - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["placeholder_token"] ?? null), "html", null, true)); - echo "\"> - - -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/layout/html.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 98 => 53, 94 => 52, 90 => 51, 86 => 50, 81 => 48, 78 => 47, 74 => 42, 69 => 40, 65 => 39, 61 => 38, 57 => 37, 52 => 35, 49 => 34, 47 => 31, 46 => 30, 45 => 29, 44 => 28, 43 => 27,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/layout/html.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/layout/html.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_image.html.twig_ITS0znd8FnUJOXPKyZZ6PppVX/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_image.html.twig_ITS0znd8FnUJOXPKyZZ6PppVX/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_image.html.twig_ITS0znd8FnUJOXPKyZZ6PppVX/OsY8GBlxwmn3NnCG28ug-CIePYfifoOZ0Zj7In9SYkY.php --- a/sites/default/files/php/twig/5c77df9da7840_image.html.twig_ITS0znd8FnUJOXPKyZZ6PppVX/OsY8GBlxwmn3NnCG28ug-CIePYfifoOZ0Zj7In9SYkY.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 14]; - $filters = ["clean_class" => 15]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 14 - $context["classes"] = [0 => (( // line 15 -($context["style_name"] ?? null)) ? (("image-style-" . \Drupal\Component\Utility\Html::getClass(($context["style_name"] ?? null)))) : (""))]; - // line 18 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo " /> -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/field/image.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 46 => 18, 44 => 15, 43 => 14,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/field/image.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/image.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_inline-template_T-xhV_TNNJ3iO7wKK2rml8iOw/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_inline-template_T-xhV_TNNJ3iO7wKK2rml8iOw/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_inline-template_T-xhV_TNNJ3iO7wKK2rml8iOw/rO_-B-ZrrMO3dZTsP6ZVgPzQ4Ud7_slqnXRyJ1euYEs.php --- a/sites/default/files/php/twig/5c77df9da7840_inline-template_T-xhV_TNNJ3iO7wKK2rml8iOw/rO_-B-ZrrMO3dZTsP6ZVgPzQ4Ud7_slqnXRyJ1euYEs.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = ["nl2br" => 1]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - ['nl2br'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 1 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed(nl2br($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["value"] ?? null), "html", null, true))); - } - - public function getTemplateName() - { - return "{# inline_template_start #}{{ value|nl2br }}"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 43 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "{# inline_template_start #}{{ value|nl2br }}", ""); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_input.html.twig_jYi6QYvFpjKLYKZCId7BmHw8z/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_input.html.twig_jYi6QYvFpjKLYKZCId7BmHw8z/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_input.html.twig_jYi6QYvFpjKLYKZCId7BmHw8z/d59Iqvp9Tjdv_rR4euHAG_-A0K3_N-snwVrieBn2V-s.php --- a/sites/default/files/php/twig/5c77df9da7840_input.html.twig_jYi6QYvFpjKLYKZCId7BmHw8z/d59Iqvp9Tjdv_rR4euHAG_-A0K3_N-snwVrieBn2V-s.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 13 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["attributes"] ?? null), "html", null, true)); - echo " />"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["children"] ?? null), "html", null, true)); - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/form/input.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 43 => 13,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/form/input.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/input.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_links--node.html.twig_1wXe-HY27nDkstwTVbPk4uUqL/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_links--node.html.twig_1wXe-HY27nDkstwTVbPk4uUqL/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_links--node.html.twig_1wXe-HY27nDkstwTVbPk4uUqL/F7y0JzHEZkFZnnOr-i8TVeF33IYj4D4ksMieLc37Ic8.php --- a/sites/default/files/php/twig/5c77df9da7840_links--node.html.twig_1wXe-HY27nDkstwTVbPk4uUqL/F7y0JzHEZkFZnnOr-i8TVeF33IYj4D4ksMieLc37Ic8.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 36, "include" => 38]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if', 'include'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 36 - if (($context["links"] ?? null)) { - // line 37 - echo "
- "; - // line 38 - $this->loadTemplate("links.html.twig", "core/themes/classy/templates/content/links--node.html.twig", 38)->display($context); - // line 39 - echo "
-"; - } - } - - public function getTemplateName() - { - return "core/themes/classy/templates/content/links--node.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 50 => 39, 48 => 38, 45 => 37, 43 => 36,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/content/links--node.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/content/links--node.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_links.html.twig_KA9UNfGPPAAfgCg_weyFshk4D/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_links.html.twig_KA9UNfGPPAAfgCg_weyFshk4D/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_links.html.twig_KA9UNfGPPAAfgCg_weyFshk4D/AJ5gfEgzl6_yB1AChuzG4NcGdWssAdm3kawuE1_C7LM.php --- a/sites/default/files/php/twig/5c77df9da7840_links.html.twig_KA9UNfGPPAAfgCg_weyFshk4D/AJ5gfEgzl6_yB1AChuzG4NcGdWssAdm3kawuE1_C7LM.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 34, "for" => 43]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if', 'for'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 34 - if (($context["links"] ?? null)) { - // line 35 - if (($context["heading"] ?? null)) { - // line 36 - if ($this->getAttribute(($context["heading"] ?? null), "level", [])) { - // line 37 - echo "<"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "level", []), "html", null, true)); - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "attributes", []), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "text", []), "html", null, true)); - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "level", []), "html", null, true)); - echo ">"; - } else { - // line 39 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "attributes", []), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "text", []), "html", null, true)); - echo ""; - } - } - // line 42 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["attributes"] ?? null), "html", null, true)); - echo ">"; - // line 43 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["links"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 44 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "attributes", []), "html", null, true)); - echo ">"; - // line 45 - if ($this->getAttribute($context["item"], "link", [])) { - // line 46 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "link", []), "html", null, true)); - } elseif ($this->getAttribute( // line 47 -$context["item"], "text_attributes", [])) { - // line 48 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "text_attributes", []), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "text", []), "html", null, true)); - echo ""; - } else { - // line 50 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "text", []), "html", null, true)); - } - // line 52 - echo ""; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 54 - echo ""; - } - } - - public function getTemplateName() - { - return "core/themes/classy/templates/navigation/links.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 101 => 54, 95 => 52, 92 => 50, 85 => 48, 83 => 47, 81 => 46, 79 => 45, 75 => 44, 71 => 43, 67 => 42, 59 => 39, 49 => 37, 47 => 36, 45 => 35, 43 => 34,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/navigation/links.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/links.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu--toolbar.html.twig_rEyH-nXH5XjWIMdT-yjXXlvnB/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_menu--toolbar.html.twig_rEyH-nXH5XjWIMdT-yjXXlvnB/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu--toolbar.html.twig_rEyH-nXH5XjWIMdT-yjXXlvnB/GuDe4su5-tbBZmoGXdCS02vIgxbW4RcbYGya_EWZsGo.php --- a/sites/default/files/php/twig/5c77df9da7840_menu--toolbar.html.twig_rEyH-nXH5XjWIMdT-yjXXlvnB/GuDe4su5-tbBZmoGXdCS02vIgxbW4RcbYGya_EWZsGo.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["import" => 21, "macro" => 29, "if" => 31, "for" => 37, "set" => 39]; - $filters = []; - $functions = ["link" => 47]; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['import', 'macro', 'if', 'for', 'set'], - [], - ['link'] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 21 - $context["menus"] = $this; - // line 22 - echo " -"; - // line 27 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($context["menus"]->getmenu_links(($context["items"] ?? null), ($context["attributes"] ?? null), 0))); - echo " - -"; - } - - // line 29 - public function getmenu_links($__items__ = null, $__attributes__ = null, $__menu_level__ = null, ...$__varargs__) - { - $context = $this->env->mergeGlobals([ - "items" => $__items__, - "attributes" => $__attributes__, - "menu_level" => $__menu_level__, - "varargs" => $__varargs__, - ]); - - $blocks = []; - - ob_start(); - try { - // line 30 - echo " "; - $context["menus"] = $this; - // line 31 - echo " "; - if (($context["items"] ?? null)) { - // line 32 - echo " "; - if ((($context["menu_level"] ?? null) == 0)) { - // line 33 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "toolbar-menu"], "method"), "html", null, true)); - echo "> - "; - } else { - // line 35 - echo "
    - "; - } - // line 37 - echo " "; - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 38 - echo " "; - // line 39 - $context["classes"] = [0 => "menu-item", 1 => (($this->getAttribute( // line 41 -$context["item"], "is_expanded", [])) ? ("menu-item--expanded") : ("")), 2 => (($this->getAttribute( // line 42 -$context["item"], "is_collapsed", [])) ? ("menu-item--collapsed") : ("")), 3 => (($this->getAttribute( // line 43 -$context["item"], "in_active_trail", [])) ? ("menu-item--active-trail") : (""))]; - // line 46 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["item"], "attributes", []), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 47 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->getLink($this->getAttribute($context["item"], "title", []), $this->getAttribute($context["item"], "url", [])), "html", null, true)); - echo " - "; - // line 48 - if ($this->getAttribute($context["item"], "below", [])) { - // line 49 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($context["menus"]->getmenu_links($this->getAttribute($context["item"], "below", []), ($context["attributes"] ?? null), (($context["menu_level"] ?? null) + 1)))); - echo " - "; - } - // line 51 - echo " - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 53 - echo "
- "; - } - } catch (Exception $e) { - ob_end_clean(); - - throw $e; - } catch (Throwable $e) { - ob_end_clean(); - - throw $e; - } - - return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); - } - - public function getTemplateName() - { - return "core/themes/stable/templates/navigation/menu--toolbar.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 124 => 53, 117 => 51, 111 => 49, 109 => 48, 105 => 47, 100 => 46, 98 => 43, 97 => 42, 96 => 41, 95 => 39, 93 => 38, 88 => 37, 84 => 35, 78 => 33, 75 => 32, 72 => 31, 69 => 30, 55 => 29, 48 => 27, 45 => 22, 43 => 21,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/stable/templates/navigation/menu--toolbar.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/navigation/menu--toolbar.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu-local-action.html.tw_SmEXYQdfLExe45IPIpBWLlPo2/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_menu-local-action.html.tw_SmEXYQdfLExe45IPIpBWLlPo2/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu-local-action.html.tw_SmEXYQdfLExe45IPIpBWLlPo2/pcy9p0NDEfdX9n2Rz_WRdR0qzmcb2cwSxRss-3wB6gA.php --- a/sites/default/files/php/twig/5c77df9da7840_menu-local-action.html.tw_SmEXYQdfLExe45IPIpBWLlPo2/pcy9p0NDEfdX9n2Rz_WRdR0qzmcb2cwSxRss-3wB6gA.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 13 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["attributes"] ?? null), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["link"] ?? null), "html", null, true)); - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/navigation/menu-local-action.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 43 => 13,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/navigation/menu-local-action.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/menu-local-action.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu-local-task.html.twig_CyZBDRlpXnhaZDz3KzNHr4Ys1/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_menu-local-task.html.twig_CyZBDRlpXnhaZDz3KzNHr4Ys1/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu-local-task.html.twig_CyZBDRlpXnhaZDz3KzNHr4Ys1/qXJkZ-FGS9QoeOE8nV0alM85EEkHeqp_19Zju2hDm84.php --- a/sites/default/files/php/twig/5c77df9da7840_menu-local-task.html.twig_CyZBDRlpXnhaZDz3KzNHr4Ys1/qXJkZ-FGS9QoeOE8nV0alM85EEkHeqp_19Zju2hDm84.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 17 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ((($context["is_active"] ?? null)) ? ("is-active") : (""))], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["link"] ?? null), "html", null, true)); - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/navigation/menu-local-task.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 43 => 17,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/navigation/menu-local-task.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/menu-local-task.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu-local-tasks.html.twi_-U9q0KfMoCml9W-9XJZZCwICm/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_menu-local-tasks.html.twi_-U9q0KfMoCml9W-9XJZZCwICm/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu-local-tasks.html.twi_-U9q0KfMoCml9W-9XJZZCwICm/E0Xi5CrwOsJwsARcsWaPTfONwoTavMnOj_wWLRZTZrE.php --- a/sites/default/files/php/twig/5c77df9da7840_menu-local-tasks.html.twi_-U9q0KfMoCml9W-9XJZZCwICm/E0Xi5CrwOsJwsARcsWaPTfONwoTavMnOj_wWLRZTZrE.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 14]; - $filters = ["t" => 15]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - ['t'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 14 - if (($context["primary"] ?? null)) { - // line 15 - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Primary tabs"))); - echo "

-
    "; - // line 16 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["primary"] ?? null), "html", null, true)); - echo "
-"; - } - // line 18 - if (($context["secondary"] ?? null)) { - // line 19 - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Secondary tabs"))); - echo "

-
    "; - // line 20 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["secondary"] ?? null), "html", null, true)); - echo "
-"; - } - } - - public function getTemplateName() - { - return "core/themes/classy/templates/navigation/menu-local-tasks.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 62 => 20, 57 => 19, 55 => 18, 50 => 16, 45 => 15, 43 => 14,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/navigation/menu-local-tasks.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/menu-local-tasks.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu-local-tasks.html.twi_vZrEgCVxmQOJgo2t80yArbQKF/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_menu-local-tasks.html.twi_vZrEgCVxmQOJgo2t80yArbQKF/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu-local-tasks.html.twi_vZrEgCVxmQOJgo2t80yArbQKF/3IybbS7taLLo71XLGBMECYKgMoqxuuiujtx3AWAcyOI.php --- a/sites/default/files/php/twig/5c77df9da7840_menu-local-tasks.html.twi_vZrEgCVxmQOJgo2t80yArbQKF/3IybbS7taLLo71XLGBMECYKgMoqxuuiujtx3AWAcyOI.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 16]; - $filters = ["t" => 17]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - ['t'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 16 - if (($context["primary"] ?? null)) { - // line 17 - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Primary tabs"))); - echo "

- -"; - } - // line 23 - if (($context["secondary"] ?? null)) { - // line 24 - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Secondary tabs"))); - echo "

- -"; - } - } - - public function getTemplateName() - { - return "core/themes/seven/templates/menu-local-tasks.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 69 => 26, 63 => 24, 61 => 23, 55 => 20, 51 => 19, 45 => 17, 43 => 16,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/seven/templates/menu-local-tasks.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/menu-local-tasks.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu.html.twig_6_49nUJrABYdgsuH1VhK8sIfM/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_menu.html.twig_6_49nUJrABYdgsuH1VhK8sIfM/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_menu.html.twig_6_49nUJrABYdgsuH1VhK8sIfM/mX4Tq0AbBCpAvrFmsONTl3VEzkPkyNfEwvw_VtUoxKM.php --- a/sites/default/files/php/twig/5c77df9da7840_menu.html.twig_6_49nUJrABYdgsuH1VhK8sIfM/mX4Tq0AbBCpAvrFmsONTl3VEzkPkyNfEwvw_VtUoxKM.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["import" => 21, "macro" => 29, "if" => 31, "for" => 37, "set" => 39]; - $filters = []; - $functions = ["link" => 47]; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['import', 'macro', 'if', 'for', 'set'], - [], - ['link'] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 21 - $context["menus"] = $this; - // line 22 - echo " -"; - // line 27 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($context["menus"]->getmenu_links(($context["items"] ?? null), ($context["attributes"] ?? null), 0))); - echo " - -"; - } - - // line 29 - public function getmenu_links($__items__ = null, $__attributes__ = null, $__menu_level__ = null, ...$__varargs__) - { - $context = $this->env->mergeGlobals([ - "items" => $__items__, - "attributes" => $__attributes__, - "menu_level" => $__menu_level__, - "varargs" => $__varargs__, - ]); - - $blocks = []; - - ob_start(); - try { - // line 30 - echo " "; - $context["menus"] = $this; - // line 31 - echo " "; - if (($context["items"] ?? null)) { - // line 32 - echo " "; - if ((($context["menu_level"] ?? null) == 0)) { - // line 33 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "menu"], "method"), "html", null, true)); - echo "> - "; - } else { - // line 35 - echo "
    - "; - } - // line 37 - echo " "; - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["item"]) { - // line 38 - echo " "; - // line 39 - $context["classes"] = [0 => "menu-item", 1 => (($this->getAttribute( // line 41 -$context["item"], "is_expanded", [])) ? ("menu-item--expanded") : ("")), 2 => (($this->getAttribute( // line 42 -$context["item"], "is_collapsed", [])) ? ("menu-item--collapsed") : ("")), 3 => (($this->getAttribute( // line 43 -$context["item"], "in_active_trail", [])) ? ("menu-item--active-trail") : (""))]; - // line 46 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["item"], "attributes", []), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 47 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->getLink($this->getAttribute($context["item"], "title", []), $this->getAttribute($context["item"], "url", [])), "html", null, true)); - echo " - "; - // line 48 - if ($this->getAttribute($context["item"], "below", [])) { - // line 49 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($context["menus"]->getmenu_links($this->getAttribute($context["item"], "below", []), ($context["attributes"] ?? null), (($context["menu_level"] ?? null) + 1)))); - echo " - "; - } - // line 51 - echo " - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 53 - echo "
- "; - } - } catch (Exception $e) { - ob_end_clean(); - - throw $e; - } catch (Throwable $e) { - ob_end_clean(); - - throw $e; - } - - return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); - } - - public function getTemplateName() - { - return "core/themes/classy/templates/navigation/menu.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 124 => 53, 117 => 51, 111 => 49, 109 => 48, 105 => 47, 100 => 46, 98 => 43, 97 => 42, 96 => 41, 95 => 39, 93 => 38, 88 => 37, 84 => 35, 78 => 33, 75 => 32, 72 => 31, 69 => 30, 55 => 29, 48 => 27, 45 => 22, 43 => 21,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/navigation/menu.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/menu.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_node.html.twig_32z-mkTIWv6R7LirBp4T2MzOR/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_node.html.twig_32z-mkTIWv6R7LirBp4T2MzOR/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_node.html.twig_32z-mkTIWv6R7LirBp4T2MzOR/xVNkvHIN24lFDec8eOlRodmckHT1eAOc1syNWuYJvKI.php --- a/sites/default/files/php/twig/5c77df9da7840_node.html.twig_32z-mkTIWv6R7LirBp4T2MzOR/xVNkvHIN24lFDec8eOlRodmckHT1eAOc1syNWuYJvKI.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 70, "if" => 84, "trans" => 94]; - $filters = ["clean_class" => 72]; - $functions = ["attach_library" => 80]; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if', 'trans'], - ['clean_class'], - ['attach_library'] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 70 - $context["classes"] = [0 => "node", 1 => ("node--type-" . \Drupal\Component\Utility\Html::getClass($this->getAttribute( // line 72 -($context["node"] ?? null), "bundle", []))), 2 => (($this->getAttribute( // line 73 -($context["node"] ?? null), "isPromoted", [], "method")) ? ("node--promoted") : ("")), 3 => (($this->getAttribute( // line 74 -($context["node"] ?? null), "isSticky", [], "method")) ? ("node--sticky") : ("")), 4 => (( !$this->getAttribute( // line 75 -($context["node"] ?? null), "isPublished", [], "method")) ? ("node--unpublished") : ("")), 5 => (( // line 76 -($context["view_mode"] ?? null)) ? (("node--view-mode-" . \Drupal\Component\Utility\Html::getClass(($context["view_mode"] ?? null)))) : ("")), 6 => "clearfix"]; - // line 80 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->attachLibrary("classy/node"), "html", null, true)); - echo " -env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> -
- "; - // line 83 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_prefix"] ?? null), "html", null, true)); - echo " - "; - // line 84 - if ( !($context["page"] ?? null)) { - // line 85 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => "node__title"], "method"), "html", null, true)); - echo "> - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["url"] ?? null), "html", null, true)); - echo "\" rel=\"bookmark\">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true)); - echo " - - "; - } - // line 89 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_suffix"] ?? null), "html", null, true)); - echo " - "; - // line 90 - if (($context["display_submitted"] ?? null)) { - // line 91 - echo "
- "; - // line 92 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["author_picture"] ?? null), "html", null, true)); - echo " - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["author_attributes"] ?? null), "html", null, true)); - echo "> - "; - // line 94 - echo t("Submitted by @author_name on @date", array("@author_name" => ($context["author_name"] ?? null), "@date" => ($context["date"] ?? null), )); - // line 95 - echo " - "; - // line 96 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["metadata"] ?? null), "html", null, true)); - echo " -
- "; - } - // line 99 - echo "
- env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["content_attributes"] ?? null), "addClass", [0 => "node__content", 1 => "clearfix"], "method"), "html", null, true)); - echo "> - "; - // line 101 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " - - -"; - } - - public function getTemplateName() - { - return "themes/isobartik/templates/node.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 114 => 101, 110 => 100, 107 => 99, 101 => 96, 98 => 95, 96 => 94, 92 => 93, 88 => 92, 85 => 91, 83 => 90, 78 => 89, 70 => 86, 65 => 85, 63 => 84, 59 => 83, 54 => 81, 50 => 80, 48 => 76, 47 => 75, 46 => 74, 45 => 73, 44 => 72, 43 => 70,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "themes/isobartik/templates/node.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/node.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_off-canvas-page-wrapper.h_hlAfqNqVOta6cQY1nMpQqxAZ7/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_off-canvas-page-wrapper.h_hlAfqNqVOta6cQY1nMpQqxAZ7/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_off-canvas-page-wrapper.h_hlAfqNqVOta6cQY1nMpQqxAZ7/SSwFP0c300bPP_Z5o8nvBwZQdoeVxP4fFsF328J5ANI.php --- a/sites/default/files/php/twig/5c77df9da7840_off-canvas-page-wrapper.h_hlAfqNqVOta6cQY1nMpQqxAZ7/SSwFP0c300bPP_Z5o8nvBwZQdoeVxP4fFsF328J5ANI.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 20]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 20 - if (($context["children"] ?? null)) { - // line 21 - echo "
- "; - // line 22 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["children"] ?? null), "html", null, true)); - echo " -
-"; - } - } - - public function getTemplateName() - { - return "core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 48 => 22, 45 => 21, 43 => 20,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_page-title.html.twig_5-d0Vm9L73Nnquj8G5WDwO2eX/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_page-title.html.twig_5-d0Vm9L73Nnquj8G5WDwO2eX/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_page-title.html.twig_5-d0Vm9L73Nnquj8G5WDwO2eX/80RhJKkexpAOVFsnvSoiebDmtH_co2Lxl97m-Mzs8xo.php --- a/sites/default/files/php/twig/5c77df9da7840_page-title.html.twig_5-d0Vm9L73Nnquj8G5WDwO2eX/80RhJKkexpAOVFsnvSoiebDmtH_co2Lxl97m-Mzs8xo.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -parent = $this->loadTemplate("@classy/content/page-title.html.twig", "themes/isobartik/templates/page-title.html.twig", 1); - $this->blocks = [ - ]; - } - - protected function doGetParent(array $context) - { - return "@classy/content/page-title.html.twig"; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 16]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 16 - $context["title_attributes"] = $this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => "title"], "method"); - // line 1 - $this->parent->display($context, array_merge($this->blocks, $blocks)); - } - - public function getTemplateName() - { - return "themes/isobartik/templates/page-title.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 50 => 1, 48 => 16, 11 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "themes/isobartik/templates/page-title.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/page-title.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_page-title.html.twig_Kj22JzrbuWqFmqffbsmZOndRV/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_page-title.html.twig_Kj22JzrbuWqFmqffbsmZOndRV/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_page-title.html.twig_Kj22JzrbuWqFmqffbsmZOndRV/REBRMMwP_OVlUJ6eFw9UTRmKN1RNmOc9kKklolUnhTs.php --- a/sites/default/files/php/twig/5c77df9da7840_page-title.html.twig_Kj22JzrbuWqFmqffbsmZOndRV/REBRMMwP_OVlUJ6eFw9UTRmKN1RNmOc9kKklolUnhTs.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 16]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 15 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_prefix"] ?? null), "html", null, true)); - echo " -"; - // line 16 - if (($context["title"] ?? null)) { - // line 17 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => "page-title"], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title"] ?? null), "html", null, true)); - echo " -"; - } - // line 19 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_suffix"] ?? null), "html", null, true)); - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/content/page-title.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 57 => 19, 49 => 17, 47 => 16, 43 => 15,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/content/page-title.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/content/page-title.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_page.html.twig_bSBFdzJm9gjsbRg0uQYoaPOTU/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_page.html.twig_bSBFdzJm9gjsbRg0uQYoaPOTU/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_page.html.twig_bSBFdzJm9gjsbRg0uQYoaPOTU/Ex3VXatl--DQOrwhiANoPHU-MbLBV_fiB0pfdUg4AoU.php --- a/sites/default/files/php/twig/5c77df9da7840_page.html.twig_bSBFdzJm9gjsbRg0uQYoaPOTU/Ex3VXatl--DQOrwhiANoPHU-MbLBV_fiB0pfdUg4AoU.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 54]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 42 - echo "
-
- "; - // line 44 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "header", []), "html", null, true)); - echo " -
-
- -
- "; - // line 49 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "pre_content", []), "html", null, true)); - echo " - "; - // line 50 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "breadcrumb", []), "html", null, true)); - echo " -
-
- "; - // line 53 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "highlighted", []), "html", null, true)); - echo " - "; - // line 54 - if ($this->getAttribute(($context["page"] ?? null), "help", [])) { - // line 55 - echo "
- "; - // line 56 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "help", []), "html", null, true)); - echo " -
- "; - } - // line 59 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "content", []), "html", null, true)); - echo " -
- -
-"; - } - - public function getTemplateName() - { - return "core/themes/seven/templates/page.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 80 => 59, 74 => 56, 71 => 55, 69 => 54, 65 => 53, 59 => 50, 55 => 49, 47 => 44, 43 => 42,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/seven/templates/page.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/page.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_page.html.twig_izP4tzIqfiN5N6VS1seT4HkZg/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_page.html.twig_izP4tzIqfiN5N6VS1seT4HkZg/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_page.html.twig_izP4tzIqfiN5N6VS1seT4HkZg/VYpUxEqX_CXfWf6-YscykE0f1q3EB1efSIr0btkH7EE.php --- a/sites/default/files/php/twig/5c77df9da7840_page.html.twig_izP4tzIqfiN5N6VS1seT4HkZg/VYpUxEqX_CXfWf6-YscykE0f1q3EB1efSIr0btkH7EE.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,235 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 62]; - $filters = ["t" => 55]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - ['t'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 53 - echo "
-
-
env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Site header"))); - echo "\"> -
- "; - // line 57 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "secondary_menu", []), "html", null, true)); - echo " - "; - // line 58 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "header", []), "html", null, true)); - echo " - "; - // line 59 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "primary_menu", []), "html", null, true)); - echo " -
-
- "; - // line 62 - if ($this->getAttribute(($context["page"] ?? null), "highlighted", [])) { - // line 63 - echo "
- -
- "; - } - // line 69 - echo " "; - if ($this->getAttribute(($context["page"] ?? null), "featured_top", [])) { - // line 70 - echo "
- -
- "; - } - // line 76 - echo "
-
- "; - // line 78 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "breadcrumb", []), "html", null, true)); - echo " -
-
- - "; - // line 82 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["page"] ?? null), "content", []), "html", null, true)); - echo " -
-
- "; - // line 85 - if ($this->getAttribute(($context["page"] ?? null), "sidebar_first", [])) { - // line 86 - echo "
- -
- "; - } - // line 92 - echo " "; - if ($this->getAttribute(($context["page"] ?? null), "sidebar_second", [])) { - // line 93 - echo "
- -
- "; - } - // line 99 - echo "
-
- "; - // line 101 - if ((($this->getAttribute(($context["page"] ?? null), "featured_bottom_first", []) || $this->getAttribute(($context["page"] ?? null), "featured_bottom_second", [])) || $this->getAttribute(($context["page"] ?? null), "featured_bottom_third", []))) { - // line 102 - echo "
- -
- "; - } - // line 110 - echo "
-
- "; - // line 112 - if (((($this->getAttribute(($context["page"] ?? null), "footer_first", []) || $this->getAttribute(($context["page"] ?? null), "footer_second", [])) || $this->getAttribute(($context["page"] ?? null), "footer_third", [])) || $this->getAttribute(($context["page"] ?? null), "footer_fourth", []))) { - // line 113 - echo " - "; - } - // line 120 - echo " "; - if ($this->getAttribute(($context["page"] ?? null), "footer_fifth", [])) { - // line 121 - echo " - "; - } - // line 125 - echo "
-
-
-
-"; - } - - public function getTemplateName() - { - return "themes/isobartik/templates/page.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 201 => 125, 195 => 122, 192 => 121, 189 => 120, 183 => 117, 179 => 116, 175 => 115, 171 => 114, 168 => 113, 166 => 112, 162 => 110, 155 => 106, 151 => 105, 147 => 104, 143 => 102, 141 => 101, 137 => 99, 130 => 95, 126 => 93, 123 => 92, 116 => 88, 112 => 86, 110 => 85, 104 => 82, 97 => 78, 93 => 76, 86 => 72, 82 => 70, 79 => 69, 72 => 65, 68 => 63, 66 => 62, 60 => 59, 56 => 58, 52 => 57, 47 => 55, 43 => 53,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "themes/isobartik/templates/page.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/page.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_rdf-metadata.html.twig_uPrK6afSpkgoBwBnUVhZOcGe5/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_rdf-metadata.html.twig_uPrK6afSpkgoBwBnUVhZOcGe5/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_rdf-metadata.html.twig_uPrK6afSpkgoBwBnUVhZOcGe5/lydj9k7FqR5cH8_zIlK_3yoNnEkudlZoPmelQ5radT0.php --- a/sites/default/files/php/twig/5c77df9da7840_rdf-metadata.html.twig_uPrK6afSpkgoBwBnUVhZOcGe5/lydj9k7FqR5cH8_zIlK_3yoNnEkudlZoPmelQ5radT0.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["for" => 18]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['for'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 18 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["metadata"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["attributes"]) { - // line 19 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["attributes"], "addClass", [0 => "rdf-meta", 1 => "hidden"], "method"), "html", null, true)); - echo "> -"; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['attributes'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/misc/rdf-metadata.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 47 => 19, 43 => 18,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/misc/rdf-metadata.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/misc/rdf-metadata.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_region.html.twig_MR3fMmw95qbpuDFvbyuI9QHlG/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_region.html.twig_MR3fMmw95qbpuDFvbyuI9QHlG/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_region.html.twig_MR3fMmw95qbpuDFvbyuI9QHlG/6dERun9DCWqf1rUz7YUqcoHJO7ae4S6mLxDZlfzAga8.php --- a/sites/default/files/php/twig/5c77df9da7840_region.html.twig_MR3fMmw95qbpuDFvbyuI9QHlG/6dERun9DCWqf1rUz7YUqcoHJO7ae4S6mLxDZlfzAga8.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 16, "if" => 21]; - $filters = ["clean_class" => 18]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if'], - ['clean_class'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 16 - $context["classes"] = [0 => "region", 1 => ("region-" . \Drupal\Component\Utility\Html::getClass( // line 18 -($context["region"] ?? null)))]; - // line 21 - if (($context["content"] ?? null)) { - // line 22 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 23 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - echo " - -"; - } - } - - public function getTemplateName() - { - return "core/themes/classy/templates/layout/region.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 53 => 23, 48 => 22, 46 => 21, 44 => 18, 43 => 16,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/layout/region.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/layout/region.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-messages.html.twig_3IhisVoQLOYIb64NBegMDuHJs/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_status-messages.html.twig_3IhisVoQLOYIb64NBegMDuHJs/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-messages.html.twig_3IhisVoQLOYIb64NBegMDuHJs/asp7da5bmMl2-YGm9upQRp97yIAYXeMUN7a5xOyAuMw.php --- a/sites/default/files/php/twig/5c77df9da7840_status-messages.html.twig_3IhisVoQLOYIb64NBegMDuHJs/asp7da5bmMl2-YGm9upQRp97yIAYXeMUN7a5xOyAuMw.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -parent = false; - - $this->blocks = [ - 'messages' => [$this, 'block_messages'], - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["block" => 22, "for" => 23, "set" => 25, "if" => 31]; - $filters = ["without" => 30, "length" => 37, "first" => 44]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['block', 'for', 'set', 'if'], - ['without', 'length', 'first'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 22 - $this->displayBlock('messages', $context, $blocks); - } - - public function block_messages($context, array $blocks = []) - { - // line 23 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["message_list"] ?? null)); - foreach ($context['_seq'] as $context["type"] => $context["messages"]) { - // line 24 - echo " "; - // line 25 - $context["classes"] = [0 => "messages", 1 => ("messages--" . // line 27 -$context["type"])]; - // line 30 - echo "
env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array"), "html", null, true)); - echo "\""; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, twig_without($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "role", "aria-label"), "html", null, true)); - echo "> - "; - // line 31 - if (($context["type"] == "error")) { - // line 32 - echo "
- "; - } - // line 34 - echo " "; - if ($this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array")) { - // line 35 - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array"), "html", null, true)); - echo "

- "; - } - // line 37 - echo " "; - if ((twig_length_filter($this->env, $context["messages"]) > 1)) { - // line 38 - echo "
    - "; - // line 39 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable($context["messages"]); - foreach ($context['_seq'] as $context["_key"] => $context["message"]) { - // line 40 - echo "
  • "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $context["message"], "html", null, true)); - echo "
  • - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 42 - echo "
- "; - } else { - // line 44 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, twig_first($this->env, $context["messages"]), "html", null, true)); - echo " - "; - } - // line 46 - echo " "; - if (($context["type"] == "error")) { - // line 47 - echo "
- "; - } - // line 49 - echo "
- "; - // line 51 - echo " "; - $context["attributes"] = $this->getAttribute(($context["attributes"] ?? null), "removeClass", [0 => ($context["classes"] ?? null)], "method"); - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['type'], $context['messages'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/misc/status-messages.html.twig"; - } - - public function getDebugInfo() - { - return array ( 120 => 51, 117 => 49, 113 => 47, 110 => 46, 104 => 44, 100 => 42, 91 => 40, 87 => 39, 84 => 38, 81 => 37, 75 => 35, 72 => 34, 68 => 32, 66 => 31, 59 => 30, 57 => 27, 56 => 25, 54 => 24, 50 => 23, 44 => 22,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/misc/status-messages.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/misc/status-messages.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-report-counter.htm_mxSHYHiC8L4J9dSO1A6bmASTx/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_status-report-counter.htm_mxSHYHiC8L4J9dSO1A6bmASTx/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-report-counter.htm_mxSHYHiC8L4J9dSO1A6bmASTx/0RIkF8itr3L6yEMpxxIR07PFelmQtrB_ezWvFXqSQLc.php --- a/sites/default/files/php/twig/5c77df9da7840_status-report-counter.htm_mxSHYHiC8L4J9dSO1A6bmASTx/0RIkF8itr3L6yEMpxxIR07PFelmQtrB_ezWvFXqSQLc.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 15]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 15 - $context["classes"] = [0 => "system-status-counter", 1 => ("system-status-counter--" . // line 17 -($context["severity"] ?? null))]; - // line 20 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo "> - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["severity"] ?? null), "html", null, true)); - echo "\"> - - "; - // line 23 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["amount"] ?? null), "html", null, true)); - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["text"] ?? null), "html", null, true)); - echo " - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["severity"] ?? null), "html", null, true)); - echo "\" >"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["text"] ?? null), "html", null, true)); - echo " Details - - -"; - } - - public function getTemplateName() - { - return "core/themes/seven/templates/status-report-counter.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 62 => 24, 56 => 23, 51 => 21, 46 => 20, 44 => 17, 43 => 15,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/seven/templates/status-report-counter.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/status-report-counter.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-report-general-inf__4c1dcxGXawxLMvy3aWlo-RtR/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_status-report-general-inf__4c1dcxGXawxLMvy3aWlo-RtR/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-report-general-inf__4c1dcxGXawxLMvy3aWlo-RtR/Q3wBxkT3oaFv08kDH64vrMgBaxKC2HOcor9S1WSyR18.php --- a/sites/default/files/php/twig/5c77df9da7840_status-report-general-inf__4c1dcxGXawxLMvy3aWlo-RtR/Q3wBxkT3oaFv08kDH64vrMgBaxKC2HOcor9S1WSyR18.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,243 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 40]; - $filters = ["t" => 33]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - ['t'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 32 - echo "
-

"; - // line 33 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("General System Information"))); - echo "

-
-
- -
-

"; - // line 38 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Drupal Version"))); - echo "

- "; - // line 39 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["drupal"] ?? null), "value", []), "html", null, true)); - echo " - "; - // line 40 - if ($this->getAttribute(($context["drupal"] ?? null), "description", [])) { - // line 41 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["drupal"] ?? null), "description", []), "html", null, true)); - echo "
- "; - } - // line 43 - echo "
-
-
- -
-

"; - // line 48 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Last Cron Run"))); - echo "

- "; - // line 49 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["cron"] ?? null), "value", []), "html", null, true)); - echo " - "; - // line 50 - if ($this->getAttribute(($context["cron"] ?? null), "run_cron", [])) { - // line 51 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["cron"] ?? null), "run_cron", []), "html", null, true)); - echo "
- "; - } - // line 53 - echo " "; - if ($this->getAttribute(($context["cron"] ?? null), "description", [])) { - // line 54 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["cron"] ?? null), "description", []), "html", null, true)); - echo "
- "; - } - // line 56 - echo "
-
-
- -
-

"; - // line 61 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Web Server"))); - echo "

- "; - // line 62 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["webserver"] ?? null), "value", []), "html", null, true)); - echo " - "; - // line 63 - if ($this->getAttribute(($context["webserver"] ?? null), "description", [])) { - // line 64 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["webserver"] ?? null), "description", []), "html", null, true)); - echo "
- "; - } - // line 66 - echo "
-
-
- -
-

"; - // line 71 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("PHP"))); - echo "

-

"; - // line 72 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Version"))); - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["php"] ?? null), "value", []), "html", null, true)); - echo " - "; - // line 73 - if ($this->getAttribute(($context["php"] ?? null), "description", [])) { - // line 74 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["php"] ?? null), "description", []), "html", null, true)); - echo "
- "; - } - // line 76 - echo " -

"; - // line 77 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Memory limit"))); - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["php_memory_limit"] ?? null), "value", []), "html", null, true)); - echo " - "; - // line 78 - if ($this->getAttribute(($context["php_memory_limit"] ?? null), "description", [])) { - // line 79 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["php_memory_limit"] ?? null), "description", []), "html", null, true)); - echo "
- "; - } - // line 81 - echo "
-
-
- -
-

"; - // line 86 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Database"))); - echo "

-

"; - // line 87 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Version"))); - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["database_system_version"] ?? null), "value", []), "html", null, true)); - echo " - "; - // line 88 - if ($this->getAttribute(($context["database_system_version"] ?? null), "description", [])) { - // line 89 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["database_system_version"] ?? null), "description", []), "html", null, true)); - echo "
- "; - } - // line 91 - echo " -

"; - // line 92 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("System"))); - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["database_system"] ?? null), "value", []), "html", null, true)); - echo " - "; - // line 93 - if ($this->getAttribute(($context["database_system"] ?? null), "description", [])) { - // line 94 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["database_system"] ?? null), "description", []), "html", null, true)); - echo "
- "; - } - // line 96 - echo "
-
-
-
-"; - } - - public function getTemplateName() - { - return "core/themes/seven/templates/status-report-general-info.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 209 => 96, 203 => 94, 201 => 93, 195 => 92, 192 => 91, 186 => 89, 184 => 88, 178 => 87, 174 => 86, 167 => 81, 161 => 79, 159 => 78, 153 => 77, 150 => 76, 144 => 74, 142 => 73, 136 => 72, 132 => 71, 125 => 66, 119 => 64, 117 => 63, 113 => 62, 109 => 61, 102 => 56, 96 => 54, 93 => 53, 87 => 51, 85 => 50, 81 => 49, 77 => 48, 70 => 43, 64 => 41, 62 => 40, 58 => 39, 54 => 38, 46 => 33, 43 => 32,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/seven/templates/status-report-general-info.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/status-report-general-info.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-report-grouped.htm_NS-sQPiMk-hc3WXqs4se6QqfI/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_status-report-grouped.htm_NS-sQPiMk-hc3WXqs4se6QqfI/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-report-grouped.htm_NS-sQPiMk-hc3WXqs4se6QqfI/LuuYXkTYfrSRQ5VP12HbXDxIANlpiZhMA_0Jdx0LYQA.php --- a/sites/default/files/php/twig/5c77df9da7840_status-report-grouped.htm_NS-sQPiMk-hc3WXqs4se6QqfI/LuuYXkTYfrSRQ5VP12HbXDxIANlpiZhMA_0Jdx0LYQA.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["for" => 23, "set" => 29, "if" => 35]; - $filters = []; - $functions = ["attach_library" => 19, "create_attribute" => 34]; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['for', 'set', 'if'], - [], - ['attach_library', 'create_attribute'] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 19 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->attachLibrary("core/drupal.collapse"), "html", null, true)); - echo " -"; - // line 20 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->attachLibrary("seven/drupal.responsive-detail"), "html", null, true)); - echo " - -
- "; - // line 23 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["grouped_requirements"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["group"]) { - // line 24 - echo "
-

env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["group"], "type", []), "html", null, true)); - echo "\">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["group"], "title", []), "html", null, true)); - echo "

- "; - // line 26 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["group"], "items", [])); - foreach ($context['_seq'] as $context["_key"] => $context["requirement"]) { - // line 27 - echo "
env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["group"], "type", []), "html", null, true)); - echo " color-"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["group"], "type", []), "html", null, true)); - echo "\" open> - "; - // line 29 - $context["summary_classes"] = [0 => "system-status-report__status-title", 1 => ((twig_in_filter($this->getAttribute( // line 31 -$context["group"], "type", []), [0 => "warning", 1 => "error"])) ? (("system-status-report__status-icon system-status-report__status-icon--" . $this->getAttribute($context["group"], "type", []))) : (""))]; - // line 34 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->createAttribute(["class" => ($context["summary_classes"] ?? null)]), "html", null, true)); - echo " role=\"button\"> - "; - // line 35 - if ($this->getAttribute($context["requirement"], "severity_title", [])) { - // line 36 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["requirement"], "severity_title", []), "html", null, true)); - echo " - "; - } - // line 38 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["requirement"], "title", []), "html", null, true)); - echo " - -
- "; - // line 41 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["requirement"], "value", []), "html", null, true)); - echo " - "; - // line 42 - if ($this->getAttribute($context["requirement"], "description", [])) { - // line 43 - echo "
"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["requirement"], "description", []), "html", null, true)); - echo "
- "; - } - // line 45 - echo "
-
- "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['requirement'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 48 - echo "
- "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['group'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 50 - echo "
-"; - } - - public function getTemplateName() - { - return "core/themes/seven/templates/status-report-grouped.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 127 => 50, 120 => 48, 112 => 45, 106 => 43, 104 => 42, 100 => 41, 93 => 38, 87 => 36, 85 => 35, 80 => 34, 78 => 31, 77 => 29, 70 => 27, 66 => 26, 60 => 25, 57 => 24, 53 => 23, 47 => 20, 43 => 19,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/seven/templates/status-report-grouped.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/status-report-grouped.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-report-page.html.t_QtphgCy5YonxBG_in-0LQSmTE/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_status-report-page.html.t_QtphgCy5YonxBG_in-0LQSmTE/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_status-report-page.html.t_QtphgCy5YonxBG_in-0LQSmTE/gSe0JJpjSNV11VfWkzEiOauNoQaqxZlm7I3GThVmw5w.php --- a/sites/default/files/php/twig/5c77df9da7840_status-report-page.html.t_QtphgCy5YonxBG_in-0LQSmTE/gSe0JJpjSNV11VfWkzEiOauNoQaqxZlm7I3GThVmw5w.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 14, "set" => 15, "for" => 20]; - $filters = ["length" => 14]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if', 'set', 'for'], - ['length'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 14 - if ((twig_length_filter($this->env, ($context["counters"] ?? null)) == 3)) { - // line 15 - echo " "; - $context["element_width_class"] = " system-status-report-counters__item--third-width"; - } elseif ((twig_length_filter($this->env, // line 16 -($context["counters"] ?? null)) == 2)) { - // line 17 - echo " "; - $context["element_width_class"] = " system-status-report-counters__item--half-width"; - } - // line 19 - echo "
- "; - // line 20 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["counters"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["counter"]) { - // line 21 - echo "
env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["element_width_class"] ?? null), "html", null, true)); - echo "\"> - "; - // line 22 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $context["counter"], "html", null, true)); - echo " -
- "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['counter'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 25 - echo "
- -"; - // line 27 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["general_info"] ?? null), "html", null, true)); - echo " -"; - // line 28 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["requirements"] ?? null), "html", null, true)); - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/seven/templates/status-report-page.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 83 => 28, 79 => 27, 75 => 25, 66 => 22, 61 => 21, 57 => 20, 54 => 19, 50 => 17, 48 => 16, 45 => 15, 43 => 14,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/seven/templates/status-report-page.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/status-report-page.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_system-config-form.html.t_Bn4vu2o7XIZ0gjX27fjj6hRCE/-OFSg2c0TQWbLZScgpuC-k6OIwrUx0GkVBQ1An30Dlo.php --- a/sites/default/files/php/twig/5c77df9da7840_system-config-form.html.t_Bn4vu2o7XIZ0gjX27fjj6hRCE/-OFSg2c0TQWbLZScgpuC-k6OIwrUx0GkVBQ1An30Dlo.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = []; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - [], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 15 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["form"] ?? null), "html", null, true)); - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/stable/templates/admin/system-config-form.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 43 => 15,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/stable/templates/admin/system-config-form.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/admin/system-config-form.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_system-config-form.html.t_Bn4vu2o7XIZ0gjX27fjj6hRCE/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_system-config-form.html.t_Bn4vu2o7XIZ0gjX27fjj6hRCE/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_table.html.twig_WzfUyz-QigqQFjRyrFjCNRCJk/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_table.html.twig_WzfUyz-QigqQFjRyrFjCNRCJk/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_table.html.twig_WzfUyz-QigqQFjRyrFjCNRCJk/I1ZKZqJSo4DTqMhJmE7VOKspb5F1pIRjkRql37OArSw.php --- a/sites/default/files/php/twig/5c77df9da7840_table.html.twig_WzfUyz-QigqQFjRyrFjCNRCJk/I1ZKZqJSo4DTqMhJmE7VOKspb5F1pIRjkRql37OArSw.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,304 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 43, "for" => 47, "set" => 64]; - $filters = []; - $functions = ["cycle" => 81]; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if', 'for', 'set'], - [], - ['cycle'] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 42 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["attributes"] ?? null), "html", null, true)); - echo "> - "; - // line 43 - if (($context["caption"] ?? null)) { - // line 44 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["caption"] ?? null), "html", null, true)); - echo " - "; - } - // line 46 - echo " - "; - // line 47 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["colgroups"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["colgroup"]) { - // line 48 - echo " "; - if ($this->getAttribute($context["colgroup"], "cols", [])) { - // line 49 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["colgroup"], "attributes", []), "html", null, true)); - echo "> - "; - // line 50 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["colgroup"], "cols", [])); - foreach ($context['_seq'] as $context["_key"] => $context["col"]) { - // line 51 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["col"], "attributes", []), "html", null, true)); - echo " /> - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['col'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 53 - echo " - "; - } else { - // line 55 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["colgroup"], "attributes", []), "html", null, true)); - echo " /> - "; - } - // line 57 - echo " "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['colgroup'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 58 - echo " - "; - // line 59 - if (($context["header"] ?? null)) { - // line 60 - echo " - - "; - // line 62 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["header"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["cell"]) { - // line 63 - echo " "; - // line 64 - $context["cell_classes"] = [0 => (($this->getAttribute( // line 65 -$context["cell"], "active_table_sort", [])) ? ("is-active") : (""))]; - // line 68 - echo " <"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "tag", []), "html", null, true)); - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["cell"], "attributes", []), "addClass", [0 => ($context["cell_classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - // line 69 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "content", []), "html", null, true)); - // line 70 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "tag", []), "html", null, true)); - echo "> - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cell'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 72 - echo " - - "; - } - // line 75 - echo " - "; - // line 76 - if (($context["rows"] ?? null)) { - // line 77 - echo " - "; - // line 78 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["rows"] ?? null)); - $context['loop'] = [ - 'parent' => $context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, - ]; - if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) { - $length = count($context['_seq']); - $context['loop']['revindex0'] = $length - 1; - $context['loop']['revindex'] = $length; - $context['loop']['length'] = $length; - $context['loop']['last'] = 1 === $length; - } - foreach ($context['_seq'] as $context["_key"] => $context["row"]) { - // line 79 - echo " "; - // line 80 - $context["row_classes"] = [0 => (( ! // line 81 -($context["no_striping"] ?? null)) ? (twig_cycle([0 => "odd", 1 => "even"], $this->getAttribute($context["loop"], "index0", []))) : (""))]; - // line 84 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["row"], "attributes", []), "addClass", [0 => ($context["row_classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 85 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["row"], "cells", [])); - foreach ($context['_seq'] as $context["_key"] => $context["cell"]) { - // line 86 - echo " <"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "tag", []), "html", null, true)); - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "attributes", []), "html", null, true)); - echo ">"; - // line 87 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "content", []), "html", null, true)); - // line 88 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "tag", []), "html", null, true)); - echo "> - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cell'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 90 - echo " - "; - ++$context['loop']['index0']; - ++$context['loop']['index']; - $context['loop']['first'] = false; - if (isset($context['loop']['length'])) { - --$context['loop']['revindex0']; - --$context['loop']['revindex']; - $context['loop']['last'] = 0 === $context['loop']['revindex0']; - } - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['row'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 92 - echo " - "; - } elseif ( // line 93 -($context["empty"] ?? null)) { - // line 94 - echo " - - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["header_columns"] ?? null), "html", null, true)); - echo "\" class=\"empty message\">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["empty"] ?? null), "html", null, true)); - echo " - - - "; - } - // line 100 - echo " "; - if (($context["footer"] ?? null)) { - // line 101 - echo " - "; - // line 102 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["footer"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["row"]) { - // line 103 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["row"], "attributes", []), "html", null, true)); - echo "> - "; - // line 104 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["row"], "cells", [])); - foreach ($context['_seq'] as $context["_key"] => $context["cell"]) { - // line 105 - echo " <"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "tag", []), "html", null, true)); - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "attributes", []), "html", null, true)); - echo ">"; - // line 106 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "content", []), "html", null, true)); - // line 107 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["cell"], "tag", []), "html", null, true)); - echo "> - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cell'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 109 - echo " - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['row'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 111 - echo " - "; - } - // line 113 - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/dataset/table.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 273 => 113, 269 => 111, 262 => 109, 253 => 107, 251 => 106, 246 => 105, 242 => 104, 237 => 103, 233 => 102, 230 => 101, 227 => 100, 218 => 96, 214 => 94, 212 => 93, 209 => 92, 194 => 90, 185 => 88, 183 => 87, 178 => 86, 174 => 85, 169 => 84, 167 => 81, 166 => 80, 164 => 79, 147 => 78, 144 => 77, 142 => 76, 139 => 75, 134 => 72, 125 => 70, 123 => 69, 118 => 68, 116 => 65, 115 => 64, 113 => 63, 109 => 62, 105 => 60, 103 => 59, 100 => 58, 94 => 57, 88 => 55, 84 => 53, 75 => 51, 71 => 50, 66 => 49, 63 => 48, 59 => 47, 56 => 46, 50 => 44, 48 => 43, 43 => 42,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/dataset/table.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/dataset/table.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_textarea.html.twig_meCIS2I44ZfJMIgyV2IbwnPw_/-hASmu6BkAGaCY6EYmrFrRnQRyojTLlFMSsfnx39KPo.php --- a/sites/default/files/php/twig/5c77df9da7840_textarea.html.twig_meCIS2I44ZfJMIgyV2IbwnPw_/-hASmu6BkAGaCY6EYmrFrRnQRyojTLlFMSsfnx39KPo.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 17]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 17 - $context["classes"] = [0 => "form-textarea", 1 => (( // line 19 -($context["resizable"] ?? null)) ? (("resize-" . ($context["resizable"] ?? null))) : ("")), 2 => (( // line 20 -($context["required"] ?? null)) ? ("required") : (""))]; - // line 23 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["wrapper_attributes"] ?? null), "addClass", [0 => "form-textarea-wrapper"], "method"), "html", null, true)); - echo "> - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["value"] ?? null), "html", null, true)); - echo " - -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/form/textarea.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 52 => 24, 47 => 23, 45 => 20, 44 => 19, 43 => 17,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/form/textarea.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/textarea.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_textarea.html.twig_meCIS2I44ZfJMIgyV2IbwnPw_/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_textarea.html.twig_meCIS2I44ZfJMIgyV2IbwnPw_/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_toolbar.html.twig_6OS5XDMFNd05xfubEcPy9VaSc/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_toolbar.html.twig_6OS5XDMFNd05xfubEcPy9VaSc/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_toolbar.html.twig_6OS5XDMFNd05xfubEcPy9VaSc/iXIxSUP-NZ0HC_rfRTxvVW-0IBxK2Y3eo9diksFY_JQ.php --- a/sites/default/files/php/twig/5c77df9da7840_toolbar.html.twig_6OS5XDMFNd05xfubEcPy9VaSc/iXIxSUP-NZ0HC_rfRTxvVW-0IBxK2Y3eo9diksFY_JQ.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["for" => 26, "set" => 27, "spaceless" => 30, "if" => 32]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['for', 'set', 'spaceless', 'if'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 23 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "toolbar"], "method"), "html", null, true)); - echo "> - env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["toolbar_attributes"] ?? null), "addClass", [0 => "toolbar-bar", 1 => "clearfix"], "method"), "html", null, true)); - echo "> -

"; - // line 25 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["toolbar_heading"] ?? null), "html", null, true)); - echo "

- "; - // line 26 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["tabs"] ?? null)); - foreach ($context['_seq'] as $context["key"] => $context["tab"]) { - // line 27 - echo " "; - $context["tray"] = $this->getAttribute(($context["trays"] ?? null), $context["key"], [], "array"); - // line 28 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["tab"], "attributes", []), "addClass", [0 => "toolbar-tab"], "method"), "html", null, true)); - echo "> - "; - // line 29 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["tab"], "link", []), "html", null, true)); - echo " - "; - // line 30 - ob_start(); - // line 31 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["tray"] ?? null), "attributes", []), "html", null, true)); - echo "> - "; - // line 32 - if ($this->getAttribute(($context["tray"] ?? null), "label", [])) { - // line 33 - echo " - "; - // line 45 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["remainder"] ?? null), "html", null, true)); - echo " - -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/navigation/toolbar.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 113 => 45, 110 => 44, 103 => 42, 95 => 38, 91 => 36, 86 => 34, 81 => 33, 79 => 32, 74 => 31, 72 => 30, 68 => 29, 63 => 28, 60 => 27, 56 => 26, 52 => 25, 48 => 24, 43 => 23,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/navigation/toolbar.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/toolbar.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_update-last-check.html.tw_5evmcMXc4P4AVModKM5qc9pwT/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_update-last-check.html.tw_5evmcMXc4P4AVModKM5qc9pwT/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_update-last-check.html.tw_5evmcMXc4P4AVModKM5qc9pwT/FO_nXNfvlbQLQiQY8EhksBxTyAiHHsBsdfipk0bQeyQ.php --- a/sites/default/files/php/twig/5c77df9da7840_update-last-check.html.tw_5evmcMXc4P4AVModKM5qc9pwT/FO_nXNfvlbQLQiQY8EhksBxTyAiHHsBsdfipk0bQeyQ.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 15]; - $filters = ["t" => 16]; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - ['t'], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 14 - echo "

- "; - // line 15 - if (($context["last"] ?? null)) { - // line 16 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Last checked: @time ago", ["@time" => ($context["time"] ?? null)]))); - echo " - "; - } else { - // line 18 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Last checked: never"))); - echo " - "; - } - // line 20 - echo " ("; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["link"] ?? null), "html", null, true)); - echo ") -

-"; - } - - public function getTemplateName() - { - return "core/themes/stable/templates/admin/update-last-check.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 60 => 20, 54 => 18, 48 => 16, 46 => 15, 43 => 14,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/stable/templates/admin/update-last-check.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/admin/update-last-check.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_update-project-status.htm_YZ7nMi6S6Px52_PHLmHmqkUED/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_update-project-status.htm_YZ7nMi6S6Px52_PHLmHmqkUED/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_update-project-status.htm_YZ7nMi6S6Px52_PHLmHmqkUED/eo3qlCUo-_xljnrUXqVSlY_ZEvF9vAkovmjOwq3wvNc.php --- a/sites/default/files/php/twig/5c77df9da7840_update-project-status.htm_YZ7nMi6S6Px52_PHLmHmqkUED/eo3qlCUo-_xljnrUXqVSlY_ZEvF9vAkovmjOwq3wvNc.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["set" => 29, "if" => 38, "for" => 61, "trans" => 88]; - $filters = ["join" => 83, "t" => 85, "placeholder" => 89]; - $functions = ["constant" => 30]; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['set', 'if', 'for', 'trans'], - ['join', 't', 'placeholder'], - ['constant'] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 29 - $context["status_classes"] = [0 => ((($this->getAttribute( // line 30 -($context["project"] ?? null), "status", []) == twig_constant("UPDATE_NOT_SECURE"))) ? ("project-update__status--security-error") : ("")), 1 => ((($this->getAttribute( // line 31 -($context["project"] ?? null), "status", []) == twig_constant("UPDATE_REVOKED"))) ? ("project-update__status--revoked") : ("")), 2 => ((($this->getAttribute( // line 32 -($context["project"] ?? null), "status", []) == twig_constant("UPDATE_NOT_SUPPORTED"))) ? ("project-update__status--not-supported") : ("")), 3 => ((($this->getAttribute( // line 33 -($context["project"] ?? null), "status", []) == twig_constant("UPDATE_NOT_CURRENT"))) ? ("project-update__status--not-current") : ("")), 4 => ((($this->getAttribute( // line 34 -($context["project"] ?? null), "status", []) == twig_constant("UPDATE_CURRENT"))) ? ("project-update__status--current") : (""))]; - // line 37 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute(($context["status"] ?? null), "attributes", []), "addClass", [0 => "project-update__status", 1 => ($context["status_classes"] ?? null)], "method"), "html", null, true)); - echo ">"; - // line 38 - if ($this->getAttribute(($context["status"] ?? null), "label", [])) { - // line 39 - echo ""; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["status"] ?? null), "label", []), "html", null, true)); - echo ""; - } else { - // line 41 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["status"] ?? null), "reason", []), "html", null, true)); - } - // line 43 - echo " - "; - // line 44 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["status"] ?? null), "icon", []), "html", null, true)); - echo " - - - -
"; - // line 49 - if (($context["url"] ?? null)) { - // line 50 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["url"] ?? null), "html", null, true)); - echo "\">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title"] ?? null), "html", null, true)); - echo ""; - } else { - // line 52 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title"] ?? null), "html", null, true)); - } - // line 54 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["existing_version"] ?? null), "html", null, true)); - echo " - "; - // line 55 - if (((($context["install_type"] ?? null) == "dev") && ($context["datestamp"] ?? null))) { - // line 56 - echo " ("; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["datestamp"] ?? null), "html", null, true)); - echo ") - "; - } - // line 58 - echo "
- -"; - // line 60 - if (($context["versions"] ?? null)) { - // line 61 - echo " "; - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["versions"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["version"]) { - // line 62 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $context["version"], "html", null, true)); - echo " - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['version'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - } - // line 65 - echo " -"; - // line 67 - $context["extra_classes"] = [0 => ((($this->getAttribute( // line 68 -($context["project"] ?? null), "status", []) == twig_constant("UPDATE_NOT_SECURE"))) ? ("project-not-secure") : ("")), 1 => ((($this->getAttribute( // line 69 -($context["project"] ?? null), "status", []) == twig_constant("UPDATE_REVOKED"))) ? ("project-revoked") : ("")), 2 => ((($this->getAttribute( // line 70 -($context["project"] ?? null), "status", []) == twig_constant("UPDATE_NOT_SUPPORTED"))) ? ("project-not-supported") : (""))]; - // line 73 - echo "
- "; - // line 74 - if (($context["extras"] ?? null)) { - // line 75 - echo "
- "; - // line 76 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["extras"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["extra"]) { - // line 77 - echo " env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["extra"], "attributes", []), "addClass", [0 => ($context["extra_classes"] ?? null)], "method"), "html", null, true)); - echo "> - "; - // line 78 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["extra"], "label", []), "html", null, true)); - echo ": "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["extra"], "data", []), "html", null, true)); - echo " -
- "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['extra'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 81 - echo "
- "; - } - // line 83 - echo " "; - $context["includes"] = twig_join_filter(($context["includes"] ?? null), ", "); - // line 84 - echo " "; - if (($context["disabled"] ?? null)) { - // line 85 - echo " "; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Includes:"))); - echo " -
    -
  • - "; - // line 88 - echo t("Enabled: %includes", array("%includes" => // line 89 -($context["includes"] ?? null), )); - // line 91 - echo "
  • -
  • - "; - // line 93 - $context["disabled"] = twig_join_filter(($context["disabled"] ?? null), ", "); - // line 94 - echo " "; - echo t("Disabled: %disabled", array("%disabled" => // line 95 -($context["disabled"] ?? null), )); - // line 97 - echo "
  • -
- "; - } else { - // line 100 - echo " "; - echo t("Includes: %includes", array("%includes" => // line 101 -($context["includes"] ?? null), )); - // line 103 - echo " "; - } - // line 104 - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/stable/templates/admin/update-project-status.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 198 => 104, 195 => 103, 193 => 101, 191 => 100, 186 => 97, 184 => 95, 182 => 94, 180 => 93, 176 => 91, 174 => 89, 173 => 88, 166 => 85, 163 => 84, 160 => 83, 156 => 81, 145 => 78, 140 => 77, 136 => 76, 133 => 75, 131 => 74, 128 => 73, 126 => 70, 125 => 69, 124 => 68, 123 => 67, 120 => 65, 110 => 62, 105 => 61, 103 => 60, 99 => 58, 93 => 56, 91 => 55, 86 => 54, 83 => 52, 76 => 50, 74 => 49, 67 => 44, 64 => 43, 61 => 41, 56 => 39, 54 => 38, 50 => 37, 48 => 34, 47 => 33, 46 => 32, 45 => 31, 44 => 30, 43 => 29,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/stable/templates/admin/update-project-status.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/admin/update-project-status.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_update-report.html.twig_LNNkR0tOiJjxwT4fWwYdlJbXl/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_update-report.html.twig_LNNkR0tOiJjxwT4fWwYdlJbXl/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_update-report.html.twig_LNNkR0tOiJjxwT4fWwYdlJbXl/ayBDFhJ64YW8IGul3teOnDIYVFrf4qzFaJpdtHuR188.php --- a/sites/default/files/php/twig/5c77df9da7840_update-report.html.twig_LNNkR0tOiJjxwT4fWwYdlJbXl/ayBDFhJ64YW8IGul3teOnDIYVFrf4qzFaJpdtHuR188.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["for" => 18]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['for'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 16 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["last_checked"] ?? null), "html", null, true)); - echo " - -"; - // line 18 - $context['_parent'] = $context; - $context['_seq'] = twig_ensure_traversable(($context["project_types"] ?? null)); - $context['_iterated'] = false; - foreach ($context['_seq'] as $context["_key"] => $context["project_type"]) { - // line 19 - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["project_type"], "label", []), "html", null, true)); - echo "

- "; - // line 20 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["project_type"], "table", []), "html", null, true)); - echo " -"; - $context['_iterated'] = true; - } - if (!$context['_iterated']) { - // line 22 - echo "

"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["no_updates_message"] ?? null), "html", null, true)); - echo "

-"; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_iterated'], $context['_key'], $context['project_type'], $context['_parent'], $context['loop']); - $context = array_intersect_key($context, $_parent) + $_parent; - } - - public function getTemplateName() - { - return "core/themes/stable/templates/admin/update-report.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 65 => 22, 58 => 20, 53 => 19, 48 => 18, 43 => 16,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/stable/templates/admin/update-report.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/admin/update-report.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_user.html.twig_KTRNr226v0rq8yWMg4jpuD1r8/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_user.html.twig_KTRNr226v0rq8yWMg4jpuD1r8/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_user.html.twig_KTRNr226v0rq8yWMg4jpuD1r8/MUoPxAP2ZF0eUJ1ugxxFGfaUbl8ogFiLRqJLfd6UJ54.php --- a/sites/default/files/php/twig/5c77df9da7840_user.html.twig_KTRNr226v0rq8yWMg4jpuD1r8/MUoPxAP2ZF0eUJ1ugxxFGfaUbl8ogFiLRqJLfd6UJ54.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 20]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 19 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "profile"], "method"), "html", null, true)); - echo "> - "; - // line 20 - if (($context["content"] ?? null)) { - // line 21 - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["content"] ?? null), "html", null, true)); - } - // line 23 - echo " -"; - } - - public function getTemplateName() - { - return "core/themes/classy/templates/user/user.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 53 => 23, 50 => 21, 48 => 20, 43 => 19,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/user/user.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/user/user.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_username.html.twig_tlStYGbLybmZLcjk08jW1Et4T/.htaccess --- a/sites/default/files/php/twig/5c77df9da7840_username.html.twig_tlStYGbLybmZLcjk08jW1Et4T/.htaccess Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5c77df9da7840_username.html.twig_tlStYGbLybmZLcjk08jW1Et4T/IEYUwOa4dTpg9a7MoTebWut_-xi_TKcfV3eji_L45mk.php --- a/sites/default/files/php/twig/5c77df9da7840_username.html.twig_tlStYGbLybmZLcjk08jW1Et4T/IEYUwOa4dTpg9a7MoTebWut_-xi_TKcfV3eji_L45mk.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -parent = false; - - $this->blocks = [ - ]; - } - - protected function doDisplay(array $context, array $blocks = []) - { - $tags = ["if" => 25]; - $filters = []; - $functions = []; - - try { - $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( - ['if'], - [], - [] - ); - } catch (Twig_Sandbox_SecurityError $e) { - $e->setSourceContext($this->getSourceContext()); - - if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { - $e->setTemplateLine($tags[$e->getTagName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { - $e->setTemplateLine($filters[$e->getFilterName()]); - } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { - $e->setTemplateLine($functions[$e->getFunctionName()]); - } - - throw $e; - } - - // line 25 - if (($context["link_path"] ?? null)) { - // line 26 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "username"], "method"), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["name"] ?? null), "html", null, true)); - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["extra"] ?? null), "html", null, true)); - echo ""; - } else { - // line 28 - echo "env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["attributes"] ?? null), "html", null, true)); - echo ">"; - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["name"] ?? null), "html", null, true)); - echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["extra"] ?? null), "html", null, true)); - echo ""; - } - } - - public function getTemplateName() - { - return "core/themes/classy/templates/user/username.html.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 53 => 28, 45 => 26, 43 => 25,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return $this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Twig_Source("", "core/themes/classy/templates/user/username.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/user/username.html.twig"); - } -} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc___string_template__d3e79b_dYY61PMLm_GqIMaXS-zHvAKOH/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc___string_template__d3e79b_dYY61PMLm_GqIMaXS-zHvAKOH/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc___string_template__d3e79b_dYY61PMLm_GqIMaXS-zHvAKOH/FULQU4LlaTkWiq5Xq9ET6NjKBbHC3IwIBWke81OCvZg.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc___string_template__d3e79b_dYY61PMLm_GqIMaXS-zHvAKOH/FULQU4LlaTkWiq5Xq9ET6NjKBbHC3IwIBWke81OCvZg.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,85 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["nl2br" => 1, "escape" => 1]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['nl2br', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 1 + echo nl2br($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["value"] ?? null)), "html", null, true)); + } + + public function getTemplateName() + { + return "__string_template__d3e79bd6029fd1ab1d50dd676e1f6555a2880e7bdc0733b6b806b540b4a45fd4"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 55 => 1,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "__string_template__d3e79bd6029fd1ab1d50dd676e1f6555a2880e7bdc0733b6b806b540b4a45fd4", ""); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_admin-block-content.html._OUkuGRmTn0hDVwylEP-RgULrp/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_admin-block-content.html._OUkuGRmTn0hDVwylEP-RgULrp/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_admin-block-content.html._OUkuGRmTn0hDVwylEP-RgULrp/_XUlB6bsRwvzglnW9wmLtS5NePnrdN7tFbkDz10hoXw.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_admin-block-content.html._OUkuGRmTn0hDVwylEP-RgULrp/_XUlB6bsRwvzglnW9wmLtS5NePnrdN7tFbkDz10hoXw.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,114 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 21, "if" => 26, "for" => 28]; + $filters = ["escape" => 27]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if', 'for'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 21 + $context["classes"] = [0 => "admin-list", 1 => (( // line 23 +($context["compact"] ?? null)) ? ("compact") : (""))]; + // line 26 + if (($context["content"] ?? null)) { + // line 27 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 28 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["content"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 29 + echo "
  • env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "url", [])), "html", null, true); + echo "\">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "title", [])), "html", null, true); + echo "
    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "description", [])), "html", null, true); + echo "
  • + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 31 + echo " +"; + } + } + + public function getTemplateName() + { + return "core/themes/seven/templates/admin-block-content.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 82 => 31, 69 => 29, 65 => 28, 60 => 27, 58 => 26, 56 => 23, 55 => 21,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/seven/templates/admin-block-content.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/admin-block-content.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_admin-block.html.twig_P9CIfkSZr9-WVcbNAn6zjOmFa/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_admin-block.html.twig_P9CIfkSZr9-WVcbNAn6zjOmFa/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_admin-block.html.twig_P9CIfkSZr9-WVcbNAn6zjOmFa/VcQfy0Re1M0EKSkQlRVtwE3768wRz-graqAQFJT1hNk.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_admin-block.html.twig_P9CIfkSZr9-WVcbNAn6zjOmFa/VcQfy0Re1M0EKSkQlRVtwE3768wRz-graqAQFJT1hNk.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,117 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 17, "if" => 22]; + $filters = ["escape" => 21]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 17 + $context["classes"] = [0 => "panel"]; + // line 21 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 22 + if ($this->getAttribute(($context["block"] ?? null), "title", [])) { + // line 23 + echo "

    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["block"] ?? null), "title", [])), "html", null, true); + echo "

    + "; + } + // line 25 + echo " "; + if ($this->getAttribute(($context["block"] ?? null), "content", [])) { + // line 26 + echo "
    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["block"] ?? null), "content", [])), "html", null, true); + echo "
    + "; + } elseif ($this->getAttribute( // line 27 +($context["block"] ?? null), "description", [])) { + // line 28 + echo "
    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["block"] ?? null), "description", [])), "html", null, true); + echo "
    + "; + } + // line 30 + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/stable/templates/admin/admin-block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 86 => 30, 80 => 28, 78 => 27, 73 => 26, 70 => 25, 64 => 23, 62 => 22, 57 => 21, 55 => 17,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/admin/admin-block.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/admin/admin-block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_admin-page.html.twig_e7IM9aUbl5RZexJIgxJaAwJ4C/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_admin-page.html.twig_e7IM9aUbl5RZexJIgxJaAwJ4C/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_admin-page.html.twig_e7IM9aUbl5RZexJIgxJaAwJ4C/6ywOFXYWomZO8ewd0ImyL8vsJdtJCgWUqHhlzOrFAbA.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_admin-page.html.twig_e7IM9aUbl5RZexJIgxJaAwJ4C/6ywOFXYWomZO8ewd0ImyL8vsJdtJCgWUqHhlzOrFAbA.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,121 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["for" => 18]; + $filters = ["escape" => 17]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['for'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 15 + echo " +
    + "; + // line 17 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["system_compact_link"] ?? null)), "html", null, true); + echo " + "; + // line 18 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["containers"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["container"]) { + // line 19 + echo "
    + "; + // line 20 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["container"], "blocks", [])); + foreach ($context['_seq'] as $context["_key"] => $context["block"]) { + // line 21 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($context["block"]), "html", null, true); + echo " + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['block'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 23 + echo "
    + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['container'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 25 + echo "
    +"; + } + + public function getTemplateName() + { + return "core/themes/stable/templates/admin/admin-page.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 90 => 25, 83 => 23, 74 => 21, 70 => 20, 67 => 19, 63 => 18, 59 => 17, 55 => 15,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/admin/admin-page.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/admin/admin-page.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--local-tasks-block._cjWDnSPN8j2EpNTn1lzfBg92V/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--local-tasks-block._cjWDnSPN8j2EpNTn1lzfBg92V/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--local-tasks-block._cjWDnSPN8j2EpNTn1lzfBg92V/BKpjpikgYu-FsyuY5SOS4fX9zaz2HmSuHz8jJPZ7T2E.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--local-tasks-block._cjWDnSPN8j2EpNTn1lzfBg92V/BKpjpikgYu-FsyuY5SOS4fX9zaz2HmSuHz8jJPZ7T2E.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,109 @@ +blocks = [ + 'content' => [$this, 'block_content'], + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 9]; + $filters = ["t" => 10, "escape" => 11]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['t', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doGetParent(array $context) + { + // line 1 + return "block.html.twig"; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $this->parent = $this->loadTemplate("block.html.twig", "core/themes/classy/templates/block/block--local-tasks-block.html.twig", 1); + $this->parent->display($context, array_merge($this->blocks, $blocks)); + } + + // line 8 + public function block_content($context, array $blocks = []) + { + // line 9 + echo " "; + if (($context["content"] ?? null)) { + // line 10 + echo " + "; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/block/block--local-tasks-block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 75 => 11, 70 => 10, 67 => 9, 64 => 8, 54 => 1,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/block/block--local-tasks-block.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/block/block--local-tasks-block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--search-form-block._JbUcM5YDs2ijc8CGpv1CxZH-D/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--search-form-block._JbUcM5YDs2ijc8CGpv1CxZH-D/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--search-form-block._JbUcM5YDs2ijc8CGpv1CxZH-D/YK_AeraV-pyP49ydAW0uI94plyyuy1mfGdbwc9xyYfw.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--search-form-block._JbUcM5YDs2ijc8CGpv1CxZH-D/YK_AeraV-pyP49ydAW0uI94plyyuy1mfGdbwc9xyYfw.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,105 @@ +blocks = [ + 'content' => [$this, 'block_content'], + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 20]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doGetParent(array $context) + { + // line 1 + return "@classy/block/block--search-form-block.html.twig"; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $this->parent = $this->loadTemplate("@classy/block/block--search-form-block.html.twig", "themes/isobartik/templates/block--search-form-block.html.twig", 1); + $this->parent->display($context, array_merge($this->blocks, $blocks)); + } + + // line 19 + public function block_content($context, array $blocks = []) + { + // line 20 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["content_attributes"] ?? null), "addClass", [0 => "content", 1 => "container-inline"], "method")), "html", null, true); + echo "> + "; + // line 21 + $this->displayParentBlock("content", $context, $blocks); + echo " + +"; + } + + public function getTemplateName() + { + return "themes/isobartik/templates/block--search-form-block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 72 => 21, 67 => 20, 64 => 19, 54 => 1,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "themes/isobartik/templates/block--search-form-block.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/block--search-form-block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--search-form-block._U-TbCNfnTaMvwZ3sjMJpj5Tnj/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--search-form-block._U-TbCNfnTaMvwZ3sjMJpj5Tnj/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--search-form-block._U-TbCNfnTaMvwZ3sjMJpj5Tnj/XQjFLo6CxkZEHyEypT0JsIwcXF5dUEqY0dfvUyjjs80.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--search-form-block._U-TbCNfnTaMvwZ3sjMJpj5Tnj/XQjFLo6CxkZEHyEypT0JsIwcXF5dUEqY0dfvUyjjs80.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,125 @@ +parent = false; + + $this->blocks = [ + 'content' => [$this, 'block_content'], + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 30, "if" => 38, "block" => 42]; + $filters = ["escape" => 36]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if', 'block'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 30 + $context["classes"] = [0 => "block", 1 => "block-search", 2 => "container-inline"]; + // line 36 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 37 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_prefix"] ?? null)), "html", null, true); + echo " + "; + // line 38 + if (($context["label"] ?? null)) { + // line 39 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_attributes"] ?? null)), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["label"] ?? null)), "html", null, true); + echo " + "; + } + // line 41 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_suffix"] ?? null)), "html", null, true); + echo " + "; + // line 42 + $this->displayBlock('content', $context, $blocks); + // line 45 + echo " +"; + } + + // line 42 + public function block_content($context, array $blocks = []) + { + // line 43 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + echo " + "; + } + + public function getTemplateName() + { + return "@classy/block/block--search-form-block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 92 => 43, 89 => 42, 84 => 45, 82 => 42, 77 => 41, 69 => 39, 67 => 38, 63 => 37, 58 => 36, 56 => 30,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "@classy/block/block--search-form-block.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/block/block--search-form-block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--system-menu-block._4-Bmg-JHqgUu2Xp_RlJJy-apu/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--system-menu-block._4-Bmg-JHqgUu2Xp_RlJJy-apu/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--system-menu-block._4-Bmg-JHqgUu2Xp_RlJJy-apu/ln2UD_j5290GJLVcyWlkN2Odzaphrxwq4ky9xNxuXW4.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--system-menu-block._4-Bmg-JHqgUu2Xp_RlJJy-apu/ln2UD_j5290GJLVcyWlkN2Odzaphrxwq4ky9xNxuXW4.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,131 @@ +blocks = [ + 'content' => [$this, 'block_content'], + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 10, "trans" => 17]; + $filters = ["clean_id" => 10, "escape" => 13]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'trans'], + ['clean_id', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doGetParent(array $context) + { + // line 1 + return "@classy/block/block--system-menu-block.html.twig"; + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 10 + $context["show_anchor"] = ("show-" . \Drupal\Component\Utility\Html::getId($this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "id", [])))); + // line 11 + $context["hide_anchor"] = ("hide-" . \Drupal\Component\Utility\Html::getId($this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "id", [])))); + // line 1 + $this->parent = $this->loadTemplate("@classy/block/block--system-menu-block.html.twig", "themes/isobartik/templates/block--system-menu-block.html.twig", 1); + $this->parent->display($context, array_merge($this->blocks, $blocks)); + } + + // line 12 + public function block_content($context, array $blocks = []) + { + // line 13 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["content_attributes"] ?? null), "addClass", [0 => "content"], "method")), "html", null, true); + echo "> + "; + // line 15 + echo "
    env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["show_anchor"] ?? null)), "html", null, true); + echo "\">
    +
    env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["hide_anchor"] ?? null)), "html", null, true); + echo "\">
    + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["show_anchor"] ?? null)), "html", null, true); + echo "\">"; + echo t("Show — @configuration.label", array("@configuration.label" => $this->getAttribute(($context["configuration"] ?? null), "label", []), )); + echo " + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["hide_anchor"] ?? null)), "html", null, true); + echo "\">"; + echo t("Hide — @configuration.label", array("@configuration.label" => $this->getAttribute(($context["configuration"] ?? null), "label", []), )); + echo " + "; + // line 19 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + echo " + +"; + } + + public function getTemplateName() + { + return "themes/isobartik/templates/block--system-menu-block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 98 => 19, 92 => 18, 86 => 17, 82 => 16, 77 => 15, 72 => 13, 69 => 12, 64 => 1, 62 => 11, 60 => 10, 54 => 1,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "themes/isobartik/templates/block--system-menu-block.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/block--system-menu-block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--system-menu-block._TlR_NXHaVaDttXekUF_cDsD4A/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--system-menu-block._TlR_NXHaVaDttXekUF_cDsD4A/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--system-menu-block._TlR_NXHaVaDttXekUF_cDsD4A/44-2bBLzt9vCgruRZb1mXdiAAtP9g0C7GRlmS0caCRo.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--system-menu-block._TlR_NXHaVaDttXekUF_cDsD4A/44-2bBLzt9vCgruRZb1mXdiAAtP9g0C7GRlmS0caCRo.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,137 @@ +parent = false; + + $this->blocks = [ + 'content' => [$this, 'block_content'], + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 35, "if" => 45, "block" => 53]; + $filters = ["clean_class" => 39, "clean_id" => 42, "escape" => 43, "without" => 43]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if', 'block'], + ['clean_class', 'clean_id', 'escape', 'without'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 35 + $context["classes"] = [0 => "block", 1 => "block-menu", 2 => "navigation", 3 => ("menu--" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 39 +($context["derivative_plugin_id"] ?? null))))]; + // line 42 + $context["heading_id"] = ($this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "id", [])) . \Drupal\Component\Utility\Html::getId("-menu")); + // line 43 + echo " +"; + } + + // line 53 + public function block_content($context, array $blocks = []) + { + // line 54 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + echo " + "; + } + + public function getTemplateName() + { + return "@classy/block/block--system-menu-block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 104 => 54, 101 => 53, 96 => 56, 93 => 53, 88 => 50, 82 => 49, 77 => 48, 74 => 47, 71 => 46, 68 => 45, 61 => 43, 59 => 42, 57 => 39, 56 => 35,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "@classy/block/block--system-menu-block.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/block/block--system-menu-block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--system-messages-bl_CjLaaCVLUa_QhYBVspyLXWxng/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--system-messages-bl_CjLaaCVLUa_QhYBVspyLXWxng/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block--system-messages-bl_CjLaaCVLUa_QhYBVspyLXWxng/lu0s9owQ2t3Ga1rcMkbXDUPDRl6c047cQXao0329FzI.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block--system-messages-bl_CjLaaCVLUa_QhYBVspyLXWxng/lu0s9owQ2t3Ga1rcMkbXDUPDRl6c047cQXao0329FzI.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,87 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 13]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 13 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/stable/templates/block/block--system-messages-block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 55 => 13,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/block/block--system-messages-block.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/block/block--system-messages-block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block.html.twig_5ySZDDwPl5fgdmErAVBzj7gGM/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block.html.twig_5ySZDDwPl5fgdmErAVBzj7gGM/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block.html.twig_5ySZDDwPl5fgdmErAVBzj7gGM/LqA__F0bLjz5fZnFZ4-fZUME81a_JUZ6oa0PWFsjtGU.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block.html.twig_5ySZDDwPl5fgdmErAVBzj7gGM/LqA__F0bLjz5fZnFZ4-fZUME81a_JUZ6oa0PWFsjtGU.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,127 @@ +parent = false; + + $this->blocks = [ + 'content' => [$this, 'block_content'], + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 29, "if" => 37, "block" => 41]; + $filters = ["clean_class" => 31, "escape" => 35]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if', 'block'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 29 + $context["classes"] = [0 => "block", 1 => ("block-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed($this->getAttribute( // line 31 +($context["configuration"] ?? null), "provider", [])))), 2 => ("block-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 32 +($context["plugin_id"] ?? null))))]; + // line 35 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 36 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_prefix"] ?? null)), "html", null, true); + echo " + "; + // line 37 + if (($context["label"] ?? null)) { + // line 38 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_attributes"] ?? null)), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["label"] ?? null)), "html", null, true); + echo " + "; + } + // line 40 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_suffix"] ?? null)), "html", null, true); + echo " + "; + // line 41 + $this->displayBlock('content', $context, $blocks); + // line 44 + echo " +"; + } + + // line 41 + public function block_content($context, array $blocks = []) + { + // line 42 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + echo " + "; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/block/block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 94 => 42, 91 => 41, 86 => 44, 84 => 41, 79 => 40, 71 => 38, 69 => 37, 65 => 36, 60 => 35, 58 => 32, 57 => 31, 56 => 29,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/block/block.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/block/block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block.html.twig_feLO9i-Xr5tQE3wc48lI4e057/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block.html.twig_feLO9i-Xr5tQE3wc48lI4e057/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_block.html.twig_feLO9i-Xr5tQE3wc48lI4e057/WyzvHLpzAkT_J78o28wC_czn0JTdfglKBWGtZt0TRes.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_block.html.twig_feLO9i-Xr5tQE3wc48lI4e057/WyzvHLpzAkT_J78o28wC_czn0JTdfglKBWGtZt0TRes.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,132 @@ +parent = false; + + $this->blocks = [ + 'content' => [$this, 'block_content'], + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 33, "if" => 41, "block" => 45]; + $filters = ["clean_class" => 35, "escape" => 39]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if', 'block'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 33 + $context["classes"] = [0 => "block", 1 => ("block-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed($this->getAttribute( // line 35 +($context["configuration"] ?? null), "provider", [])))), 2 => ("block-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 36 +($context["plugin_id"] ?? null))))]; + // line 39 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 40 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_prefix"] ?? null)), "html", null, true); + echo " + "; + // line 41 + if (($context["label"] ?? null)) { + // line 42 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_attributes"] ?? null)), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["label"] ?? null)), "html", null, true); + echo " + "; + } + // line 44 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_suffix"] ?? null)), "html", null, true); + echo " + "; + // line 45 + $this->displayBlock('content', $context, $blocks); + // line 50 + echo " +"; + } + + // line 45 + public function block_content($context, array $blocks = []) + { + // line 46 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["content_attributes"] ?? null), "addClass", [0 => "content"], "method")), "html", null, true); + echo "> + "; + // line 47 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + echo " + + "; + } + + public function getTemplateName() + { + return "themes/isobartik/templates/block.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 99 => 47, 94 => 46, 91 => 45, 86 => 50, 84 => 45, 79 => 44, 71 => 42, 69 => 41, 65 => 40, 60 => 39, 58 => 36, 57 => 35, 56 => 33,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "themes/isobartik/templates/block.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/block.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_breadcrumb.html.twig_HYHfK7EVD6NON6ikYVDgJtnB5/-SOj3TPBUIlxfR5_xSIUD_AtVGkR9y1HokZUgRK18U4.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_breadcrumb.html.twig_HYHfK7EVD6NON6ikYVDgJtnB5/-SOj3TPBUIlxfR5_xSIUD_AtVGkR9y1HokZUgRK18U4.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,128 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 10, "for" => 14]; + $filters = ["t" => 12, "escape" => 17]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if', 'for'], + ['t', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 10 + if (($context["breadcrumb"] ?? null)) { + // line 11 + echo " +"; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/navigation/breadcrumb.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 95 => 23, 88 => 21, 82 => 19, 74 => 17, 72 => 16, 69 => 15, 65 => 14, 60 => 12, 57 => 11, 55 => 10,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/navigation/breadcrumb.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/breadcrumb.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_breadcrumb.html.twig_HYHfK7EVD6NON6ikYVDgJtnB5/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_breadcrumb.html.twig_HYHfK7EVD6NON6ikYVDgJtnB5/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_container.html.twig_bZ0ffr1CkLMGv59gmMiHN6UlG/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_container.html.twig_bZ0ffr1CkLMGv59gmMiHN6UlG/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_container.html.twig_bZ0ffr1CkLMGv59gmMiHN6UlG/ZXOkscFdPsvacZDFeDltCbeU6i9Ieg0YkB2ptzh7908.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_container.html.twig_bZ0ffr1CkLMGv59gmMiHN6UlG/ZXOkscFdPsvacZDFeDltCbeU6i9Ieg0YkB2ptzh7908.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,94 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 23]; + $filters = ["escape" => 28]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 23 + $context["classes"] = [0 => (( // line 24 +($context["has_parent"] ?? null)) ? ("js-form-wrapper") : ("")), 1 => (( // line 25 +($context["has_parent"] ?? null)) ? ("form-wrapper") : (""))]; + // line 28 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["children"] ?? null)), "html", null, true); + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/form/container.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 59 => 28, 57 => 25, 56 => 24, 55 => 23,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/form/container.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/container.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--node--created.html_EsYa8OjzJ5-8vA4H8ycafBKv_/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--node--created.html_EsYa8OjzJ5-8vA4H8ycafBKv_/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--node--created.html_EsYa8OjzJ5-8vA4H8ycafBKv_/1h8b8V6Ie52ZXUudMvrhuO0-FnIxa16I8iispxsx6-I.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--node--created.html_EsYa8OjzJ5-8vA4H8ycafBKv_/1h8b8V6Ie52ZXUudMvrhuO0-FnIxa16I8iispxsx6-I.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,105 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 23, "for" => 31]; + $filters = ["clean_class" => 25, "escape" => 30]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'for'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 23 + $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 25 +($context["field_name"] ?? null)))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 26 +($context["field_type"] ?? null)))), 3 => ("field--label-" . $this->sandbox->ensureToStringAllowed( // line 27 +($context["label_display"] ?? null)))]; + // line 30 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo ">"; + // line 31 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 32 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "content", [])), "html", null, true); + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 34 + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/field/field--node--created.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 74 => 34, 68 => 32, 64 => 31, 60 => 30, 58 => 27, 57 => 26, 56 => 25, 55 => 23,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/field/field--node--created.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--node--created.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--node--title.html.t_beVzIoAKh79AXykmDb224hH8b/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--node--title.html.t_beVzIoAKh79AXykmDb224hH8b/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--node--title.html.t_beVzIoAKh79AXykmDb224hH8b/USNAyjNwyZccMtUKFAZ-s4tDOx1BP53AuUDJY6rEvVs.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--node--title.html.t_beVzIoAKh79AXykmDb224hH8b/USNAyjNwyZccMtUKFAZ-s4tDOx1BP53AuUDJY6rEvVs.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,105 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 23, "for" => 31]; + $filters = ["clean_class" => 25, "escape" => 30]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'for'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 23 + $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 25 +($context["field_name"] ?? null)))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 26 +($context["field_type"] ?? null)))), 3 => ("field--label-" . $this->sandbox->ensureToStringAllowed( // line 27 +($context["label_display"] ?? null)))]; + // line 30 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo ">"; + // line 31 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 32 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "content", [])), "html", null, true); + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 34 + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/field/field--node--title.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 74 => 34, 68 => 32, 64 => 31, 60 => 30, 58 => 27, 57 => 26, 56 => 25, 55 => 23,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/field/field--node--title.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--node--title.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--node--uid.html.twi_OaC3bdXpPb9iGloij9UpelfY0/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--node--uid.html.twi_OaC3bdXpPb9iGloij9UpelfY0/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--node--uid.html.twi_OaC3bdXpPb9iGloij9UpelfY0/WVxofjulrn0ucxB8PVXC0alRjmjo3LCJnb40wG1PYpw.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--node--uid.html.twi_OaC3bdXpPb9iGloij9UpelfY0/WVxofjulrn0ucxB8PVXC0alRjmjo3LCJnb40wG1PYpw.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,105 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 23, "for" => 31]; + $filters = ["clean_class" => 25, "escape" => 30]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'for'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 23 + $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 25 +($context["field_name"] ?? null)))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 26 +($context["field_type"] ?? null)))), 3 => ("field--label-" . $this->sandbox->ensureToStringAllowed( // line 27 +($context["label_display"] ?? null)))]; + // line 30 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo ">"; + // line 31 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 32 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "content", [])), "html", null, true); + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 34 + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/field/field--node--uid.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 74 => 34, 68 => 32, 64 => 31, 60 => 30, 58 => 27, 57 => 26, 56 => 25, 55 => 23,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/field/field--node--uid.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--node--uid.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--text-long.html.twi_c5mQMZElNTdffB4oESVpX_O1m/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--text-long.html.twi_c5mQMZElNTdffB4oESVpX_O1m/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--text-long.html.twi_c5mQMZElNTdffB4oESVpX_O1m/7klJsbfHb0RPBo0Razs2WwlzT_cbpD43wCZTLxbtY3A.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--text-long.html.twi_c5mQMZElNTdffB4oESVpX_O1m/7klJsbfHb0RPBo0Razs2WwlzT_cbpD43wCZTLxbtY3A.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,89 @@ +blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = []; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + [], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doGetParent(array $context) + { + // line 1 + return "field--text.html.twig"; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $this->parent = $this->loadTemplate("field--text.html.twig", "core/themes/classy/templates/field/field--text-long.html.twig", 1); + $this->parent->display($context, array_merge($this->blocks, $blocks)); + } + + public function getTemplateName() + { + return "core/themes/classy/templates/field/field--text-long.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 53 => 1,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/field/field--text-long.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--text-long.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--text-with-summary._WgN49EvCEMW5g6g5TPFid9OvR/-0IvHiw6QpDSj967wJ61buVwrSZXDw8lEAQRQQtU_so.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--text-with-summary._WgN49EvCEMW5g6g5TPFid9OvR/-0IvHiw6QpDSj967wJ61buVwrSZXDw8lEAQRQQtU_so.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,89 @@ +blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = []; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + [], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doGetParent(array $context) + { + // line 1 + return "field--text.html.twig"; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $this->parent = $this->loadTemplate("field--text.html.twig", "core/themes/classy/templates/field/field--text-with-summary.html.twig", 1); + $this->parent->display($context, array_merge($this->blocks, $blocks)); + } + + public function getTemplateName() + { + return "core/themes/classy/templates/field/field--text-with-summary.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 53 => 1,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/field/field--text-with-summary.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/field/field--text-with-summary.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--text-with-summary._WgN49EvCEMW5g6g5TPFid9OvR/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--text-with-summary._WgN49EvCEMW5g6g5TPFid9OvR/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--text.html.twig_JLky1M-ArtcCgSTJHwzICT-TR/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--text.html.twig_JLky1M-ArtcCgSTJHwzICT-TR/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field--text.html.twig_JLky1M-ArtcCgSTJHwzICT-TR/ZQN-LF9BffLWXXF_-bL76PC8iM3vuRLPjnF26QwZfyE.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field--text.html.twig_JLky1M-ArtcCgSTJHwzICT-TR/ZQN-LF9BffLWXXF_-bL76PC8iM3vuRLPjnF26QwZfyE.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,92 @@ +blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 28]; + $filters = []; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set'], + [], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doGetParent(array $context) + { + // line 1 + return "field.html.twig"; + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 28 + $context["attributes"] = $this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "clearfix", 1 => "text-formatted"], "method"); + // line 1 + $this->parent = $this->loadTemplate("field.html.twig", "field--text.html.twig", 1); + $this->parent->display($context, array_merge($this->blocks, $blocks)); + } + + public function getTemplateName() + { + return "field--text.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 61 => 1, 59 => 28, 53 => 1,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "field--text.html.twig", "core/themes/classy/templates/field/field--text.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field.html.twig_zCT6HJxPtaObZEpFuNtlYBn9t/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field.html.twig_zCT6HJxPtaObZEpFuNtlYBn9t/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_field.html.twig_zCT6HJxPtaObZEpFuNtlYBn9t/6XBTGyaGYSbDdsjCLpIhFtouwrN3poHsVJWqHnPr0IQ.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_field.html.twig_zCT6HJxPtaObZEpFuNtlYBn9t/6XBTGyaGYSbDdsjCLpIhFtouwrN3poHsVJWqHnPr0IQ.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,187 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 41, "if" => 55, "for" => 58]; + $filters = ["clean_class" => 43, "escape" => 57]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if', 'for'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 41 + $context["classes"] = [0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 43 +($context["field_name"] ?? null)))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 44 +($context["field_type"] ?? null)))), 3 => ("field--label-" . $this->sandbox->ensureToStringAllowed( // line 45 +($context["label_display"] ?? null)))]; + // line 49 + $context["title_classes"] = [0 => "field__label", 1 => ((( // line 51 +($context["label_display"] ?? null) == "visually_hidden")) ? ("visually-hidden") : (""))]; + // line 54 + echo " +"; + // line 55 + if (($context["label_hidden"] ?? null)) { + // line 56 + echo " "; + if (($context["multiple"] ?? null)) { + // line 57 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null), 1 => "field__items"], "method")), "html", null, true); + echo "> + "; + // line 58 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 59 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($this->getAttribute($context["item"], "attributes", []), "addClass", [0 => "field__item"], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "content", [])), "html", null, true); + echo " + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 61 + echo " + "; + } else { + // line 63 + echo " "; + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 64 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null), 1 => "field__item"], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "content", [])), "html", null, true); + echo " + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 66 + echo " "; + } + } else { + // line 68 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => ($context["title_classes"] ?? null)], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["label"] ?? null)), "html", null, true); + echo " + "; + // line 70 + if (($context["multiple"] ?? null)) { + // line 71 + echo "
    + "; + } + // line 73 + echo " "; + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 74 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($this->getAttribute($context["item"], "attributes", []), "addClass", [0 => "field__item"], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "content", [])), "html", null, true); + echo "
    + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 76 + echo " "; + if (($context["multiple"] ?? null)) { + // line 77 + echo " + "; + } + // line 79 + echo " +"; + } + } + + public function getTemplateName() + { + return "field.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 155 => 79, 151 => 77, 148 => 76, 137 => 74, 132 => 73, 128 => 71, 126 => 70, 120 => 69, 115 => 68, 111 => 66, 100 => 64, 95 => 63, 91 => 61, 80 => 59, 76 => 58, 71 => 57, 68 => 56, 66 => 55, 63 => 54, 61 => 51, 60 => 49, 58 => 45, 57 => 44, 56 => 43, 55 => 41,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "field.html.twig", "core/themes/classy/templates/field/field.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_form--search-block-form.h_8vxzsmbnZ5QEKMzvpSlt034Zm/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_form--search-block-form.h_8vxzsmbnZ5QEKMzvpSlt034Zm/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_form--search-block-form.h_8vxzsmbnZ5QEKMzvpSlt034Zm/vWCsnlNWh6l7Qu4ir1TeppLIfG2u_csxOOQK0qE5w6Q.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_form--search-block-form.h_8vxzsmbnZ5QEKMzvpSlt034Zm/vWCsnlNWh6l7Qu4ir1TeppLIfG2u_csxOOQK0qE5w6Q.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,93 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 13]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 13 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "search-form", 1 => "search-block-form"], "method")), "html", null, true); + echo "> + "; + // line 14 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["children"] ?? null)), "html", null, true); + echo " + +"; + } + + public function getTemplateName() + { + return "themes/isobartik/templates/form--search-block-form.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 60 => 14, 55 => 13,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "themes/isobartik/templates/form--search-block-form.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/form--search-block-form.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_form-element-label.html.t_KEX1ocr332f85dU_CaRhEwqE7/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_form-element-label.html.t_KEX1ocr332f85dU_CaRhEwqE7/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_form-element-label.html.t_KEX1ocr332f85dU_CaRhEwqE7/Io5XKAqTVMGjTvGt4uPuQj74uyj4y_pl1rp1vgWNVvM.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_form-element-label.html.t_KEX1ocr332f85dU_CaRhEwqE7/Io5XKAqTVMGjTvGt4uPuQj74uyj4y_pl1rp1vgWNVvM.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,98 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 16, "if" => 23]; + $filters = ["escape" => 24]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 16 + $context["classes"] = [0 => ((( // line 17 +($context["title_display"] ?? null) == "after")) ? ("option") : ("")), 1 => ((( // line 18 +($context["title_display"] ?? null) == "invisible")) ? ("visually-hidden") : ("")), 2 => (( // line 19 +($context["required"] ?? null)) ? ("js-form-required") : ("")), 3 => (( // line 20 +($context["required"] ?? null)) ? ("form-required") : (""))]; + // line 23 + if (( !twig_test_empty(($context["title"] ?? null)) || ($context["required"] ?? null))) { + // line 24 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title"] ?? null)), "html", null, true); + echo ""; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/form/form-element-label.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 63 => 24, 61 => 23, 59 => 20, 58 => 19, 57 => 18, 56 => 17, 55 => 16,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/form/form-element-label.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/form-element-label.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_form-element.html.twig_ugktWp2JNDVCjYxWnM8FvkNfo/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_form-element.html.twig_ugktWp2JNDVCjYxWnM8FvkNfo/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_form-element.html.twig_ugktWp2JNDVCjYxWnM8FvkNfo/aJU_7hDYQ8Zsvr5CIm9vG2OT-CjcxTJNIfiqAoNX7s8.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_form-element.html.twig_ugktWp2JNDVCjYxWnM8FvkNfo/aJU_7hDYQ8Zsvr5CIm9vG2OT-CjcxTJNIfiqAoNX7s8.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,182 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 48, "if" => 67]; + $filters = ["clean_class" => 51, "escape" => 66]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 48 + $context["classes"] = [0 => "js-form-item", 1 => "form-item", 2 => ("js-form-type-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 51 +($context["type"] ?? null)))), 3 => ("form-type-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 52 +($context["type"] ?? null)))), 4 => ("js-form-item-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 53 +($context["name"] ?? null)))), 5 => ("form-item-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 54 +($context["name"] ?? null)))), 6 => ((!twig_in_filter( // line 55 +($context["title_display"] ?? null), [0 => "after", 1 => "before"])) ? ("form-no-label") : ("")), 7 => ((( // line 56 +($context["disabled"] ?? null) == "disabled")) ? ("form-disabled") : ("")), 8 => (( // line 57 +($context["errors"] ?? null)) ? ("form-item--error") : (""))]; + // line 61 + $context["description_classes"] = [0 => "description", 1 => ((( // line 63 +($context["description_display"] ?? null) == "invisible")) ? ("visually-hidden") : (""))]; + // line 66 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 67 + if (twig_in_filter(($context["label_display"] ?? null), [0 => "before", 1 => "invisible"])) { + // line 68 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["label"] ?? null)), "html", null, true); + echo " + "; + } + // line 70 + echo " "; + if ( !twig_test_empty(($context["prefix"] ?? null))) { + // line 71 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["prefix"] ?? null)), "html", null, true); + echo " + "; + } + // line 73 + echo " "; + if (((($context["description_display"] ?? null) == "before") && $this->getAttribute(($context["description"] ?? null), "content", []))) { + // line 74 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["description"] ?? null), "attributes", [])), "html", null, true); + echo "> + "; + // line 75 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["description"] ?? null), "content", [])), "html", null, true); + echo " + + "; + } + // line 78 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["children"] ?? null)), "html", null, true); + echo " + "; + // line 79 + if ( !twig_test_empty(($context["suffix"] ?? null))) { + // line 80 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["suffix"] ?? null)), "html", null, true); + echo " + "; + } + // line 82 + echo " "; + if ((($context["label_display"] ?? null) == "after")) { + // line 83 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["label"] ?? null)), "html", null, true); + echo " + "; + } + // line 85 + echo " "; + if (($context["errors"] ?? null)) { + // line 86 + echo "
    + "; + // line 87 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["errors"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 90 + echo " "; + if ((twig_in_filter(($context["description_display"] ?? null), [0 => "after", 1 => "invisible"]) && $this->getAttribute(($context["description"] ?? null), "content", []))) { + // line 91 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($this->getAttribute(($context["description"] ?? null), "attributes", []), "addClass", [0 => ($context["description_classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 92 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["description"] ?? null), "content", [])), "html", null, true); + echo " + + "; + } + // line 95 + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/form/form-element.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 151 => 95, 145 => 92, 140 => 91, 137 => 90, 131 => 87, 128 => 86, 125 => 85, 119 => 83, 116 => 82, 110 => 80, 108 => 79, 103 => 78, 97 => 75, 92 => 74, 89 => 73, 83 => 71, 80 => 70, 74 => 68, 72 => 67, 67 => 66, 65 => 63, 64 => 61, 62 => 57, 61 => 56, 60 => 55, 59 => 54, 58 => 53, 57 => 52, 56 => 51, 55 => 48,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/form/form-element.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/form-element.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_form.html.twig_tThm2KxLUiHp76EKIkx-0RYJ8/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_form.html.twig_tThm2KxLUiHp76EKIkx-0RYJ8/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_form.html.twig_tThm2KxLUiHp76EKIkx-0RYJ8/VcYDah36vSTD6fQoEAQIy6CtGlS32Y6ryTf0CyjcwvM.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_form.html.twig_tThm2KxLUiHp76EKIkx-0RYJ8/VcYDah36vSTD6fQoEAQIy6CtGlS32Y6ryTf0CyjcwvM.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,93 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 13]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 13 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["attributes"] ?? null)), "html", null, true); + echo "> + "; + // line 14 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["children"] ?? null)), "html", null, true); + echo " + +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/form/form.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 60 => 14, 55 => 13,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/form/form.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/form.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_html.html.twig_4xdEEzIeoXQbMARFYVGISkcQB/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_html.html.twig_4xdEEzIeoXQbMARFYVGISkcQB/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_html.html.twig_4xdEEzIeoXQbMARFYVGISkcQB/7XabE_7OQOP1XyZyVe6KOOZMz7EDJJ87hX1dGZIgGtQ.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_html.html.twig_4xdEEzIeoXQbMARFYVGISkcQB/7XabE_7OQOP1XyZyVe6KOOZMz7EDJJ87hX1dGZIgGtQ.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,144 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 27]; + $filters = ["clean_class" => 29, "escape" => 35, "safe_join" => 38, "t" => 48]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set'], + ['clean_class', 'escape', 'safe_join', 't'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 27 + $context["body_classes"] = [0 => (( // line 28 +($context["logged_in"] ?? null)) ? ("user-logged-in") : ("")), 1 => (( ! // line 29 +($context["root_path"] ?? null)) ? ("path-frontpage") : (("path-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed(($context["root_path"] ?? null)))))), 2 => (( // line 30 +($context["node_type"] ?? null)) ? (("page-node-type-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed(($context["node_type"] ?? null))))) : ("")), 3 => (( // line 31 +($context["db_offline"] ?? null)) ? ("db-offline") : (""))]; + // line 34 + echo " +env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["html_attributes"] ?? null)), "html", null, true); + echo "> + + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["placeholder_token"] ?? null)), "html", null, true); + echo "\"> + "; + // line 38 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($this->env->getExtension('Drupal\Core\Template\TwigExtension')->safeJoin($this->env, $this->sandbox->ensureToStringAllowed(($context["head_title"] ?? null)), " | ")); + echo " + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["placeholder_token"] ?? null)), "html", null, true); + echo "\"> + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["placeholder_token"] ?? null)), "html", null, true); + echo "\"> + + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["body_classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 47 + echo " + "; + // line 48 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Skip to main content")); + echo " + + "; + // line 50 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["page_top"] ?? null)), "html", null, true); + echo " + "; + // line 51 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["page"] ?? null)), "html", null, true); + echo " + "; + // line 52 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["page_bottom"] ?? null)), "html", null, true); + echo " + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["placeholder_token"] ?? null)), "html", null, true); + echo "\"> + + +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/layout/html.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 110 => 53, 106 => 52, 102 => 51, 98 => 50, 93 => 48, 90 => 47, 86 => 42, 81 => 40, 77 => 39, 73 => 38, 69 => 37, 64 => 35, 61 => 34, 59 => 31, 58 => 30, 57 => 29, 56 => 28, 55 => 27,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/layout/html.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/layout/html.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_input.html.twig_byCkx_vr9-a1na6v7u8N6-jq2/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_input.html.twig_byCkx_vr9-a1na6v7u8N6-jq2/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_input.html.twig_byCkx_vr9-a1na6v7u8N6-jq2/g12kWRtmcep9LLER5jwHqKfODWKM1f_HDL82xDJ7_hw.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_input.html.twig_byCkx_vr9-a1na6v7u8N6-jq2/g12kWRtmcep9LLER5jwHqKfODWKM1f_HDL82xDJ7_hw.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,90 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 13]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 13 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["attributes"] ?? null)), "html", null, true); + echo " />"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["children"] ?? null)), "html", null, true); + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/form/input.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 55 => 13,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/form/input.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/input.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_links--node.html.twig_6yCfjHNE89klr1YHB412c2xRu/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_links--node.html.twig_6yCfjHNE89klr1YHB412c2xRu/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_links--node.html.twig_6yCfjHNE89klr1YHB412c2xRu/LBGq0va9aAmPgGgDH4yyr-xsILYy1g-an_s4Ggxqf9Q.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_links--node.html.twig_6yCfjHNE89klr1YHB412c2xRu/LBGq0va9aAmPgGgDH4yyr-xsILYy1g-an_s4Ggxqf9Q.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,94 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 36, "include" => 38]; + $filters = []; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if', 'include'], + [], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 36 + if (($context["links"] ?? null)) { + // line 37 + echo "
    + "; + // line 38 + $this->loadTemplate("links.html.twig", "core/themes/classy/templates/content/links--node.html.twig", 38)->display($context); + // line 39 + echo "
    +"; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/content/links--node.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 62 => 39, 60 => 38, 57 => 37, 55 => 36,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/content/links--node.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/content/links--node.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_links.html.twig_WSJRZicyqAlo84QfUVd1sJ0xw/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_links.html.twig_WSJRZicyqAlo84QfUVd1sJ0xw/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_links.html.twig_WSJRZicyqAlo84QfUVd1sJ0xw/tLOoQP4Zc9XP7wTrgLzsaohmJVdqjt8631BgPQE-u3w.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_links.html.twig_WSJRZicyqAlo84QfUVd1sJ0xw/tLOoQP4Zc9XP7wTrgLzsaohmJVdqjt8631BgPQE-u3w.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,144 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 34, "for" => 43]; + $filters = ["escape" => 37]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if', 'for'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 34 + if (($context["links"] ?? null)) { + // line 35 + if (($context["heading"] ?? null)) { + // line 36 + if ($this->getAttribute(($context["heading"] ?? null), "level", [])) { + // line 37 + echo "<"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["heading"] ?? null), "level", [])), "html", null, true); + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["heading"] ?? null), "attributes", [])), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["heading"] ?? null), "text", [])), "html", null, true); + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["heading"] ?? null), "level", [])), "html", null, true); + echo ">"; + } else { + // line 39 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["heading"] ?? null), "attributes", [])), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["heading"] ?? null), "text", [])), "html", null, true); + echo ""; + } + } + // line 42 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["attributes"] ?? null)), "html", null, true); + echo ">"; + // line 43 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["links"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 44 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "attributes", [])), "html", null, true); + echo ">"; + // line 45 + if ($this->getAttribute($context["item"], "link", [])) { + // line 46 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "link", [])), "html", null, true); + } elseif ($this->getAttribute( // line 47 +$context["item"], "text_attributes", [])) { + // line 48 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "text_attributes", [])), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "text", [])), "html", null, true); + echo ""; + } else { + // line 50 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "text", [])), "html", null, true); + } + // line 52 + echo ""; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 54 + echo ""; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/navigation/links.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 113 => 54, 107 => 52, 104 => 50, 97 => 48, 95 => 47, 93 => 46, 91 => 45, 87 => 44, 83 => 43, 79 => 42, 71 => 39, 61 => 37, 59 => 36, 57 => 35, 55 => 34,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/navigation/links.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/links.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu--toolbar.html.twig_tdG0xj7NtoYwFrq5M9nV9-hl0/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu--toolbar.html.twig_tdG0xj7NtoYwFrq5M9nV9-hl0/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu--toolbar.html.twig_tdG0xj7NtoYwFrq5M9nV9-hl0/vTuOobAdCLNfzaR-sacSKih8FjkDiyXzw-87eXUHxCI.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu--toolbar.html.twig_tdG0xj7NtoYwFrq5M9nV9-hl0/vTuOobAdCLNfzaR-sacSKih8FjkDiyXzw-87eXUHxCI.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,179 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["import" => 21, "macro" => 29, "if" => 31, "for" => 37, "set" => 39]; + $filters = ["escape" => 33]; + $functions = ["link" => 47]; + + try { + $this->sandbox->checkSecurity( + ['import', 'macro', 'if', 'for', 'set'], + ['escape'], + ['link'] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 21 + $context["menus"] = $this; + // line 22 + echo " +"; + // line 27 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($context["menus"]->getmenu_links(($context["items"] ?? null), ($context["attributes"] ?? null), 0)); + echo " + +"; + } + + // line 29 + public function getmenu_links($__items__ = null, $__attributes__ = null, $__menu_level__ = null, ...$__varargs__) + { + $context = $this->env->mergeGlobals([ + "items" => $__items__, + "attributes" => $__attributes__, + "menu_level" => $__menu_level__, + "varargs" => $__varargs__, + ]); + + $blocks = []; + + ob_start(); + try { + // line 30 + echo " "; + $context["menus"] = $this; + // line 31 + echo " "; + if (($context["items"] ?? null)) { + // line 32 + echo " "; + if ((($context["menu_level"] ?? null) == 0)) { + // line 33 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "toolbar-menu"], "method")), "html", null, true); + echo "> + "; + } else { + // line 35 + echo "
      + "; + } + // line 37 + echo " "; + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 38 + echo " "; + // line 39 + $context["classes"] = [0 => "menu-item", 1 => (($this->getAttribute( // line 41 +$context["item"], "is_expanded", [])) ? ("menu-item--expanded") : ("")), 2 => (($this->getAttribute( // line 42 +$context["item"], "is_collapsed", [])) ? ("menu-item--collapsed") : ("")), 3 => (($this->getAttribute( // line 43 +$context["item"], "in_active_trail", [])) ? ("menu-item--active-trail") : (""))]; + // line 46 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($this->getAttribute($context["item"], "attributes", []), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 47 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->getLink($this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "title", [])), $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "url", []))), "html", null, true); + echo " + "; + // line 48 + if ($this->getAttribute($context["item"], "below", [])) { + // line 49 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($context["menus"]->getmenu_links($this->getAttribute($context["item"], "below", []), ($context["attributes"] ?? null), (($context["menu_level"] ?? null) + 1))); + echo " + "; + } + // line 51 + echo " + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 53 + echo "
    + "; + } + } catch (\Exception $e) { + ob_end_clean(); + + throw $e; + } catch (\Throwable $e) { + ob_end_clean(); + + throw $e; + } + + return ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset()); + } + + public function getTemplateName() + { + return "core/themes/stable/templates/navigation/menu--toolbar.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 136 => 53, 129 => 51, 123 => 49, 121 => 48, 117 => 47, 112 => 46, 110 => 43, 109 => 42, 108 => 41, 107 => 39, 105 => 38, 100 => 37, 96 => 35, 90 => 33, 87 => 32, 84 => 31, 81 => 30, 67 => 29, 60 => 27, 57 => 22, 55 => 21,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/navigation/menu--toolbar.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/navigation/menu--toolbar.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu-local-task.html.twig_oZkK0Jb1F0DWgCMxjkPwZIHDK/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu-local-task.html.twig_oZkK0Jb1F0DWgCMxjkPwZIHDK/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu-local-task.html.twig_oZkK0Jb1F0DWgCMxjkPwZIHDK/o_OSd22-_RD2HL9pihgafYFlDlBZrAztXY_lzTn11w8.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu-local-task.html.twig_oZkK0Jb1F0DWgCMxjkPwZIHDK/o_OSd22-_RD2HL9pihgafYFlDlBZrAztXY_lzTn11w8.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,90 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 17]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 17 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ((($context["is_active"] ?? null)) ? ("is-active") : (""))], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["link"] ?? null)), "html", null, true); + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/navigation/menu-local-task.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 55 => 17,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/navigation/menu-local-task.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/menu-local-task.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu-local-tasks.html.twi_gCNagW9IAVaiUE8mKNNZqX9RT/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu-local-tasks.html.twi_gCNagW9IAVaiUE8mKNNZqX9RT/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu-local-tasks.html.twi_gCNagW9IAVaiUE8mKNNZqX9RT/X4dsosMkrD3u1gk55O6pBaBuSDRXotz5-ic3h-k5BiI.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu-local-tasks.html.twi_gCNagW9IAVaiUE8mKNNZqX9RT/X4dsosMkrD3u1gk55O6pBaBuSDRXotz5-ic3h-k5BiI.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,115 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 16]; + $filters = ["t" => 17, "escape" => 20]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['t', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 16 + if (($context["primary"] ?? null)) { + // line 17 + echo "

    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Primary tabs")); + echo "

    + +"; + } + // line 23 + if (($context["secondary"] ?? null)) { + // line 24 + echo "

    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Secondary tabs")); + echo "

    + +"; + } + } + + public function getTemplateName() + { + return "core/themes/seven/templates/menu-local-tasks.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 81 => 26, 75 => 24, 73 => 23, 67 => 20, 63 => 19, 57 => 17, 55 => 16,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/seven/templates/menu-local-tasks.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/menu-local-tasks.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu-local-tasks.html.twi_iSBfDap9ssCxrqaRWavPsCupd/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu-local-tasks.html.twi_iSBfDap9ssCxrqaRWavPsCupd/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu-local-tasks.html.twi_iSBfDap9ssCxrqaRWavPsCupd/tUYmV5KN1eESELxrG6wLSjYwipikhGOFIPDg10Ktus8.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu-local-tasks.html.twi_iSBfDap9ssCxrqaRWavPsCupd/tUYmV5KN1eESELxrG6wLSjYwipikhGOFIPDg10Ktus8.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,107 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 14]; + $filters = ["t" => 15, "escape" => 16]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['t', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 14 + if (($context["primary"] ?? null)) { + // line 15 + echo "

    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Primary tabs")); + echo "

    +
      "; + // line 16 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["primary"] ?? null)), "html", null, true); + echo "
    +"; + } + // line 18 + if (($context["secondary"] ?? null)) { + // line 19 + echo "

    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Secondary tabs")); + echo "

    +
      "; + // line 20 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["secondary"] ?? null)), "html", null, true); + echo "
    +"; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/navigation/menu-local-tasks.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 74 => 20, 69 => 19, 67 => 18, 62 => 16, 57 => 15, 55 => 14,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/navigation/menu-local-tasks.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/menu-local-tasks.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu.html.twig_kNP-_HK_bnqOqRaypt-q2dXJL/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu.html.twig_kNP-_HK_bnqOqRaypt-q2dXJL/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_menu.html.twig_kNP-_HK_bnqOqRaypt-q2dXJL/gKp4kl2FuYw7IWYUE7sBLg3oJEwg4SZbgK7e15ku1aM.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_menu.html.twig_kNP-_HK_bnqOqRaypt-q2dXJL/gKp4kl2FuYw7IWYUE7sBLg3oJEwg4SZbgK7e15ku1aM.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,179 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["import" => 21, "macro" => 29, "if" => 31, "for" => 37, "set" => 39]; + $filters = ["escape" => 33]; + $functions = ["link" => 47]; + + try { + $this->sandbox->checkSecurity( + ['import', 'macro', 'if', 'for', 'set'], + ['escape'], + ['link'] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 21 + $context["menus"] = $this; + // line 22 + echo " +"; + // line 27 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($context["menus"]->getmenu_links(($context["items"] ?? null), ($context["attributes"] ?? null), 0)); + echo " + +"; + } + + // line 29 + public function getmenu_links($__items__ = null, $__attributes__ = null, $__menu_level__ = null, ...$__varargs__) + { + $context = $this->env->mergeGlobals([ + "items" => $__items__, + "attributes" => $__attributes__, + "menu_level" => $__menu_level__, + "varargs" => $__varargs__, + ]); + + $blocks = []; + + ob_start(); + try { + // line 30 + echo " "; + $context["menus"] = $this; + // line 31 + echo " "; + if (($context["items"] ?? null)) { + // line 32 + echo " "; + if ((($context["menu_level"] ?? null) == 0)) { + // line 33 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "menu"], "method")), "html", null, true); + echo "> + "; + } else { + // line 35 + echo "
      + "; + } + // line 37 + echo " "; + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["item"]) { + // line 38 + echo " "; + // line 39 + $context["classes"] = [0 => "menu-item", 1 => (($this->getAttribute( // line 41 +$context["item"], "is_expanded", [])) ? ("menu-item--expanded") : ("")), 2 => (($this->getAttribute( // line 42 +$context["item"], "is_collapsed", [])) ? ("menu-item--collapsed") : ("")), 3 => (($this->getAttribute( // line 43 +$context["item"], "in_active_trail", [])) ? ("menu-item--active-trail") : (""))]; + // line 46 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($this->getAttribute($context["item"], "attributes", []), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 47 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->getLink($this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "title", [])), $this->sandbox->ensureToStringAllowed($this->getAttribute($context["item"], "url", []))), "html", null, true); + echo " + "; + // line 48 + if ($this->getAttribute($context["item"], "below", [])) { + // line 49 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar($context["menus"]->getmenu_links($this->getAttribute($context["item"], "below", []), ($context["attributes"] ?? null), (($context["menu_level"] ?? null) + 1))); + echo " + "; + } + // line 51 + echo " + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 53 + echo "
    + "; + } + } catch (\Exception $e) { + ob_end_clean(); + + throw $e; + } catch (\Throwable $e) { + ob_end_clean(); + + throw $e; + } + + return ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset()); + } + + public function getTemplateName() + { + return "core/themes/classy/templates/navigation/menu.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 136 => 53, 129 => 51, 123 => 49, 121 => 48, 117 => 47, 112 => 46, 110 => 43, 109 => 42, 108 => 41, 107 => 39, 105 => 38, 100 => 37, 96 => 35, 90 => 33, 87 => 32, 84 => 31, 81 => 30, 67 => 29, 60 => 27, 57 => 22, 55 => 21,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/navigation/menu.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/menu.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_node.html.twig_wZZXf2W23tpiyXLG6T72Gbrja/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_node.html.twig_wZZXf2W23tpiyXLG6T72Gbrja/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_node.html.twig_wZZXf2W23tpiyXLG6T72Gbrja/hDDjPUEiTArS8AFWCHA9rkHIhi7GwVHKJL3YfzJae7M.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_node.html.twig_wZZXf2W23tpiyXLG6T72Gbrja/hDDjPUEiTArS8AFWCHA9rkHIhi7GwVHKJL3YfzJae7M.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,160 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 70, "if" => 84, "trans" => 94]; + $filters = ["clean_class" => 72, "escape" => 80]; + $functions = ["attach_library" => 80]; + + try { + $this->sandbox->checkSecurity( + ['set', 'if', 'trans'], + ['clean_class', 'escape'], + ['attach_library'] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 70 + $context["classes"] = [0 => "node", 1 => ("node--type-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed($this->getAttribute( // line 72 +($context["node"] ?? null), "bundle", [])))), 2 => (($this->getAttribute( // line 73 +($context["node"] ?? null), "isPromoted", [], "method")) ? ("node--promoted") : ("")), 3 => (($this->getAttribute( // line 74 +($context["node"] ?? null), "isSticky", [], "method")) ? ("node--sticky") : ("")), 4 => (( !$this->getAttribute( // line 75 +($context["node"] ?? null), "isPublished", [], "method")) ? ("node--unpublished") : ("")), 5 => (( // line 76 +($context["view_mode"] ?? null)) ? (("node--view-mode-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed(($context["view_mode"] ?? null))))) : ("")), 6 => "clearfix"]; + // line 80 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->attachLibrary("classy/node"), "html", null, true); + echo " +env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> +
    + "; + // line 83 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_prefix"] ?? null)), "html", null, true); + echo " + "; + // line 84 + if ( !($context["page"] ?? null)) { + // line 85 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => "node__title"], "method")), "html", null, true); + echo "> + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["url"] ?? null)), "html", null, true); + echo "\" rel=\"bookmark\">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["label"] ?? null)), "html", null, true); + echo " + + "; + } + // line 89 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_suffix"] ?? null)), "html", null, true); + echo " + "; + // line 90 + if (($context["display_submitted"] ?? null)) { + // line 91 + echo "
    + "; + // line 92 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["author_picture"] ?? null)), "html", null, true); + echo " + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["author_attributes"] ?? null)), "html", null, true); + echo "> + "; + // line 94 + echo t("Submitted by @author_name on @date", array("@author_name" => ($context["author_name"] ?? null), "@date" => ($context["date"] ?? null), )); + // line 95 + echo " + "; + // line 96 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["metadata"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 99 + echo "
    + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["content_attributes"] ?? null), "addClass", [0 => "node__content", 1 => "clearfix"], "method")), "html", null, true); + echo "> + "; + // line 101 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + echo " + + +"; + } + + public function getTemplateName() + { + return "themes/isobartik/templates/node.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 126 => 101, 122 => 100, 119 => 99, 113 => 96, 110 => 95, 108 => 94, 104 => 93, 100 => 92, 97 => 91, 95 => 90, 90 => 89, 82 => 86, 77 => 85, 75 => 84, 71 => 83, 66 => 81, 62 => 80, 60 => 76, 59 => 75, 58 => 74, 57 => 73, 56 => 72, 55 => 70,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "themes/isobartik/templates/node.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/node.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_off-canvas-page-wrapper.h_xGlanmOT_zFdju2aI-RKrOGb1/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_off-canvas-page-wrapper.h_xGlanmOT_zFdju2aI-RKrOGb1/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_off-canvas-page-wrapper.h_xGlanmOT_zFdju2aI-RKrOGb1/V4f106VFZUUAPWinQMfc0WTB8kUS8GRJKCWlh_LCCr8.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_off-canvas-page-wrapper.h_xGlanmOT_zFdju2aI-RKrOGb1/V4f106VFZUUAPWinQMfc0WTB8kUS8GRJKCWlh_LCCr8.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,94 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 20]; + $filters = ["escape" => 22]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 20 + if (($context["children"] ?? null)) { + // line 21 + echo "
    + "; + // line 22 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["children"] ?? null)), "html", null, true); + echo " +
    +"; + } + } + + public function getTemplateName() + { + return "core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 60 => 22, 57 => 21, 55 => 20,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_page-title.html.twig_OEHNK2-gyrCvxY41y4mc_ioNU/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_page-title.html.twig_OEHNK2-gyrCvxY41y4mc_ioNU/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_page-title.html.twig_OEHNK2-gyrCvxY41y4mc_ioNU/nh45_PnWZm7O5i20aiKgRIG9qmBEbDksR1it-cFyJeM.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_page-title.html.twig_OEHNK2-gyrCvxY41y4mc_ioNU/nh45_PnWZm7O5i20aiKgRIG9qmBEbDksR1it-cFyJeM.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,92 @@ +blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 16]; + $filters = []; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set'], + [], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doGetParent(array $context) + { + // line 1 + return "@classy/content/page-title.html.twig"; + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 16 + $context["title_attributes"] = $this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => "title"], "method"); + // line 1 + $this->parent = $this->loadTemplate("@classy/content/page-title.html.twig", "themes/isobartik/templates/page-title.html.twig", 1); + $this->parent->display($context, array_merge($this->blocks, $blocks)); + } + + public function getTemplateName() + { + return "themes/isobartik/templates/page-title.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 61 => 1, 59 => 16, 53 => 1,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "themes/isobartik/templates/page-title.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/page-title.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_page-title.html.twig_YZ7EJlYc1TtYUzbis7v6JBdFR/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_page-title.html.twig_YZ7EJlYc1TtYUzbis7v6JBdFR/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_page-title.html.twig_YZ7EJlYc1TtYUzbis7v6JBdFR/zXKThT7n_kxjEuaTQAPcOnaprqb519uBmPlap9hIlPA.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_page-title.html.twig_YZ7EJlYc1TtYUzbis7v6JBdFR/zXKThT7n_kxjEuaTQAPcOnaprqb519uBmPlap9hIlPA.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,101 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 16]; + $filters = ["escape" => 15]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 15 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_prefix"] ?? null)), "html", null, true); + echo " +"; + // line 16 + if (($context["title"] ?? null)) { + // line 17 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["title_attributes"] ?? null), "addClass", [0 => "page-title"], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title"] ?? null)), "html", null, true); + echo " +"; + } + // line 19 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_suffix"] ?? null)), "html", null, true); + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/content/page-title.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 69 => 19, 61 => 17, 59 => 16, 55 => 15,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/content/page-title.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/content/page-title.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_page.html.twig_eckruO6KtRncuQXyc1FrH8Rko/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_page.html.twig_eckruO6KtRncuQXyc1FrH8Rko/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_page.html.twig_eckruO6KtRncuQXyc1FrH8Rko/ZWo5DxLtApCJ1xrj89LnJw6o2nruFa97uZ8lvFBKdIY.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_page.html.twig_eckruO6KtRncuQXyc1FrH8Rko/ZWo5DxLtApCJ1xrj89LnJw6o2nruFa97uZ8lvFBKdIY.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,247 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 62]; + $filters = ["t" => 55, "escape" => 57]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['t', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 53 + echo "
    +
    +
    env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Site header")); + echo "\"> +
    + "; + // line 57 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "secondary_menu", [])), "html", null, true); + echo " + "; + // line 58 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "header", [])), "html", null, true); + echo " + "; + // line 59 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "primary_menu", [])), "html", null, true); + echo " +
    +
    + "; + // line 62 + if ($this->getAttribute(($context["page"] ?? null), "highlighted", [])) { + // line 63 + echo "
    + +
    + "; + } + // line 69 + echo " "; + if ($this->getAttribute(($context["page"] ?? null), "featured_top", [])) { + // line 70 + echo "
    + +
    + "; + } + // line 76 + echo "
    +
    + "; + // line 78 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "breadcrumb", [])), "html", null, true); + echo " +
    +
    + + "; + // line 82 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "content", [])), "html", null, true); + echo " +
    +
    + "; + // line 85 + if ($this->getAttribute(($context["page"] ?? null), "sidebar_first", [])) { + // line 86 + echo "
    + +
    + "; + } + // line 92 + echo " "; + if ($this->getAttribute(($context["page"] ?? null), "sidebar_second", [])) { + // line 93 + echo "
    + +
    + "; + } + // line 99 + echo "
    +
    + "; + // line 101 + if ((($this->getAttribute(($context["page"] ?? null), "featured_bottom_first", []) || $this->getAttribute(($context["page"] ?? null), "featured_bottom_second", [])) || $this->getAttribute(($context["page"] ?? null), "featured_bottom_third", []))) { + // line 102 + echo "
    + +
    + "; + } + // line 110 + echo "
    +
    + "; + // line 112 + if (((($this->getAttribute(($context["page"] ?? null), "footer_first", []) || $this->getAttribute(($context["page"] ?? null), "footer_second", [])) || $this->getAttribute(($context["page"] ?? null), "footer_third", [])) || $this->getAttribute(($context["page"] ?? null), "footer_fourth", []))) { + // line 113 + echo " + "; + } + // line 120 + echo " "; + if ($this->getAttribute(($context["page"] ?? null), "footer_fifth", [])) { + // line 121 + echo " + "; + } + // line 125 + echo "
    +
    +
    +
    +"; + } + + public function getTemplateName() + { + return "themes/isobartik/templates/page.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 213 => 125, 207 => 122, 204 => 121, 201 => 120, 195 => 117, 191 => 116, 187 => 115, 183 => 114, 180 => 113, 178 => 112, 174 => 110, 167 => 106, 163 => 105, 159 => 104, 155 => 102, 153 => 101, 149 => 99, 142 => 95, 138 => 93, 135 => 92, 128 => 88, 124 => 86, 122 => 85, 116 => 82, 109 => 78, 105 => 76, 98 => 72, 94 => 70, 91 => 69, 84 => 65, 80 => 63, 78 => 62, 72 => 59, 68 => 58, 64 => 57, 59 => 55, 55 => 53,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "themes/isobartik/templates/page.html.twig", "/var/www/sites/isophonics.net/themes/isobartik/templates/page.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_page.html.twig_sZIXST3hUgsiPCYwt8VPY1nTj/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_page.html.twig_sZIXST3hUgsiPCYwt8VPY1nTj/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_page.html.twig_sZIXST3hUgsiPCYwt8VPY1nTj/zbaNbOrF2asrjA8DXNEE04jLgO5bvnfMRChcMlJwXDc.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_page.html.twig_sZIXST3hUgsiPCYwt8VPY1nTj/zbaNbOrF2asrjA8DXNEE04jLgO5bvnfMRChcMlJwXDc.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,128 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 54]; + $filters = ["escape" => 44]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 42 + echo "
    +
    + "; + // line 44 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "header", [])), "html", null, true); + echo " +
    +
    + +
    + "; + // line 49 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "pre_content", [])), "html", null, true); + echo " + "; + // line 50 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "breadcrumb", [])), "html", null, true); + echo " +
    +
    + "; + // line 53 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "highlighted", [])), "html", null, true); + echo " + "; + // line 54 + if ($this->getAttribute(($context["page"] ?? null), "help", [])) { + // line 55 + echo "
    + "; + // line 56 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "help", [])), "html", null, true); + echo " +
    + "; + } + // line 59 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["page"] ?? null), "content", [])), "html", null, true); + echo " +
    + +
    +"; + } + + public function getTemplateName() + { + return "core/themes/seven/templates/page.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 92 => 59, 86 => 56, 83 => 55, 81 => 54, 77 => 53, 71 => 50, 67 => 49, 59 => 44, 55 => 42,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/seven/templates/page.html.twig", "/var/www/sites/isophonics.net/core/themes/seven/templates/page.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_rdf-metadata.html.twig_mPFfCMqhyCESmWgvqb9GzYQ5C/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_rdf-metadata.html.twig_mPFfCMqhyCESmWgvqb9GzYQ5C/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_rdf-metadata.html.twig_mPFfCMqhyCESmWgvqb9GzYQ5C/koyG0h1Hz8ykRnlqhSh9-AEWu48zcbijYxU92hS4auw.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_rdf-metadata.html.twig_mPFfCMqhyCESmWgvqb9GzYQ5C/koyG0h1Hz8ykRnlqhSh9-AEWu48zcbijYxU92hS4auw.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,96 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["for" => 18]; + $filters = ["escape" => 19]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['for'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 18 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["metadata"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["attributes"]) { + // line 19 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["attributes"], "addClass", [0 => "rdf-meta", 1 => "hidden"], "method")), "html", null, true); + echo "> +"; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['attributes'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/misc/rdf-metadata.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 59 => 19, 55 => 18,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/misc/rdf-metadata.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/misc/rdf-metadata.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_region.html.twig_z6u1e_e8TzL41n0SAUtE3p4U5/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_region.html.twig_z6u1e_e8TzL41n0SAUtE3p4U5/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_region.html.twig_z6u1e_e8TzL41n0SAUtE3p4U5/jndHdavupEYIwoWHw2QLBvdh-h0MZZgLNLWcucLjIHI.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_region.html.twig_z6u1e_e8TzL41n0SAUtE3p4U5/jndHdavupEYIwoWHw2QLBvdh-h0MZZgLNLWcucLjIHI.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,99 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 16, "if" => 21]; + $filters = ["clean_class" => 18, "escape" => 22]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 16 + $context["classes"] = [0 => "region", 1 => ("region-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 18 +($context["region"] ?? null))))]; + // line 21 + if (($context["content"] ?? null)) { + // line 22 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 23 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + echo " + +"; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/layout/region.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 65 => 23, 60 => 22, 58 => 21, 56 => 18, 55 => 16,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/layout/region.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/layout/region.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_status-messages.html.twig_U0QJnnctZr5wLI6s1U0SGn6p-/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_status-messages.html.twig_U0QJnnctZr5wLI6s1U0SGn6p-/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_status-messages.html.twig_U0QJnnctZr5wLI6s1U0SGn6p-/0AuVMpvsV0B8KaxPMxbUOqYLeCsr9nht4ARcJ5u4LRo.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_status-messages.html.twig_U0QJnnctZr5wLI6s1U0SGn6p-/0AuVMpvsV0B8KaxPMxbUOqYLeCsr9nht4ARcJ5u4LRo.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,169 @@ +parent = false; + + $this->blocks = [ + 'messages' => [$this, 'block_messages'], + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["block" => 23, "for" => 24, "set" => 26, "if" => 32]; + $filters = ["escape" => 31, "without" => 31, "length" => 38, "first" => 45]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['block', 'for', 'set', 'if'], + ['escape', 'without', 'length', 'first'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 22 + echo "
    +"; + // line 23 + $this->displayBlock('messages', $context, $blocks); + // line 55 + echo "
    +"; + } + + // line 23 + public function block_messages($context, array $blocks = []) + { + // line 24 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["message_list"] ?? null)); + foreach ($context['_seq'] as $context["type"] => $context["messages"]) { + // line 25 + echo " "; + // line 26 + $context["classes"] = [0 => "messages", 1 => ("messages--" . $this->sandbox->ensureToStringAllowed( // line 28 +$context["type"]))]; + // line 31 + echo "
    env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array")), "html", null, true); + echo "\""; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->withoutFilter($this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "role", "aria-label"), "html", null, true); + echo "> + "; + // line 32 + if (($context["type"] == "error")) { + // line 33 + echo "
    + "; + } + // line 35 + echo " "; + if ($this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array")) { + // line 36 + echo "

    "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array")), "html", null, true); + echo "

    + "; + } + // line 38 + echo " "; + if ((twig_length_filter($this->env, $context["messages"]) > 1)) { + // line 39 + echo "
      + "; + // line 40 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable($context["messages"]); + foreach ($context['_seq'] as $context["_key"] => $context["message"]) { + // line 41 + echo "
    • "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($context["message"]), "html", null, true); + echo "
    • + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 43 + echo "
    + "; + } else { + // line 45 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, twig_first($this->env, $this->sandbox->ensureToStringAllowed($context["messages"])), "html", null, true); + echo " + "; + } + // line 47 + echo " "; + if (($context["type"] == "error")) { + // line 48 + echo "
    + "; + } + // line 50 + echo "
    + "; + // line 52 + echo " "; + $context["attributes"] = $this->getAttribute(($context["attributes"] ?? null), "removeClass", [0 => ($context["classes"] ?? null)], "method"); + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['type'], $context['messages'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/misc/status-messages.html.twig"; + } + + public function getDebugInfo() + { + return array ( 139 => 52, 136 => 50, 132 => 48, 129 => 47, 123 => 45, 119 => 43, 110 => 41, 106 => 40, 103 => 39, 100 => 38, 94 => 36, 91 => 35, 87 => 33, 85 => 32, 78 => 31, 76 => 28, 75 => 26, 73 => 25, 69 => 24, 66 => 23, 61 => 55, 59 => 23, 56 => 22,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/misc/status-messages.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/misc/status-messages.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_system-config-form.html.t_iJONwSqDGOycPaay2XRI-xEQl/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_system-config-form.html.t_iJONwSqDGOycPaay2XRI-xEQl/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_system-config-form.html.t_iJONwSqDGOycPaay2XRI-xEQl/Cz4jHT9biQVkxvxoWwOdAsKyufbWi73gcbyVBpcX3fc.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_system-config-form.html.t_iJONwSqDGOycPaay2XRI-xEQl/Cz4jHT9biQVkxvxoWwOdAsKyufbWi73gcbyVBpcX3fc.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,87 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 15]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 15 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["form"] ?? null)), "html", null, true); + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/stable/templates/admin/system-config-form.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 55 => 15,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/admin/system-config-form.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/admin/system-config-form.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_textarea.html.twig_WySOIkO10rEWnG2smKPyu8wZ7/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_textarea.html.twig_WySOIkO10rEWnG2smKPyu8wZ7/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_textarea.html.twig_WySOIkO10rEWnG2smKPyu8wZ7/y-caleMmqBwy5RQlmkEQ8LQ3yWmFpfNJIJLVnwSfw64.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_textarea.html.twig_WySOIkO10rEWnG2smKPyu8wZ7/y-caleMmqBwy5RQlmkEQ8LQ3yWmFpfNJIJLVnwSfw64.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,99 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 17]; + $filters = ["escape" => 23]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 17 + $context["classes"] = [0 => "form-textarea", 1 => (( // line 19 +($context["resizable"] ?? null)) ? (("resize-" . $this->sandbox->ensureToStringAllowed(($context["resizable"] ?? null)))) : ("")), 2 => (( // line 20 +($context["required"] ?? null)) ? ("required") : (""))]; + // line 23 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["wrapper_attributes"] ?? null), "addClass", [0 => "form-textarea-wrapper"], "method")), "html", null, true); + echo "> + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["value"] ?? null)), "html", null, true); + echo " + +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/form/textarea.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 64 => 24, 59 => 23, 57 => 20, 56 => 19, 55 => 17,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/form/textarea.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/form/textarea.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_toolbar.html.twig_vlrkXb7cQXP-f3D36Eqeej6f2/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_toolbar.html.twig_vlrkXb7cQXP-f3D36Eqeej6f2/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_toolbar.html.twig_vlrkXb7cQXP-f3D36Eqeej6f2/Udj0dsfc4hh0ozWHrp4kwoXN-TzfbOdkpGuvcqriDRw.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_toolbar.html.twig_vlrkXb7cQXP-f3D36Eqeej6f2/Udj0dsfc4hh0ozWHrp4kwoXN-TzfbOdkpGuvcqriDRw.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,158 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["for" => 26, "set" => 27, "spaceless" => 30, "if" => 32]; + $filters = ["escape" => 23]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['for', 'set', 'spaceless', 'if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 23 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "toolbar"], "method")), "html", null, true); + echo "> + env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["toolbar_attributes"] ?? null), "addClass", [0 => "toolbar-bar", 1 => "clearfix"], "method")), "html", null, true); + echo "> +

    "; + // line 25 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["toolbar_heading"] ?? null)), "html", null, true); + echo "

    + "; + // line 26 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["tabs"] ?? null)); + foreach ($context['_seq'] as $context["key"] => $context["tab"]) { + // line 27 + echo " "; + $context["tray"] = $this->getAttribute(($context["trays"] ?? null), $context["key"], [], "array"); + // line 28 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($this->getAttribute($context["tab"], "attributes", []), "addClass", [0 => "toolbar-tab"], "method")), "html", null, true); + echo "> + "; + // line 29 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["tab"], "link", [])), "html", null, true); + echo " + "; + // line 30 + ob_start(); + // line 31 + echo " env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["tray"] ?? null), "attributes", [])), "html", null, true); + echo "> + "; + // line 32 + if ($this->getAttribute(($context["tray"] ?? null), "label", [])) { + // line 33 + echo " + "; + // line 45 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["remainder"] ?? null)), "html", null, true); + echo " + +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/navigation/toolbar.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 125 => 45, 122 => 44, 115 => 42, 107 => 38, 103 => 36, 98 => 34, 93 => 33, 91 => 32, 86 => 31, 84 => 30, 80 => 29, 75 => 28, 72 => 27, 68 => 26, 64 => 25, 60 => 24, 55 => 23,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/navigation/toolbar.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/navigation/toolbar.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_update-last-check.html.tw_Kf4FyeZ-OeZZBYZUKb2muf5V7/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_update-last-check.html.tw_Kf4FyeZ-OeZZBYZUKb2muf5V7/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_update-last-check.html.tw_Kf4FyeZ-OeZZBYZUKb2muf5V7/HpH3cuVlj-WTXNTc2mt9boiQHY-GxNVmWCk6VDbtfpA.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_update-last-check.html.tw_Kf4FyeZ-OeZZBYZUKb2muf5V7/HpH3cuVlj-WTXNTc2mt9boiQHY-GxNVmWCk6VDbtfpA.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,106 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 15]; + $filters = ["t" => 16, "escape" => 20]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['t', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 14 + echo "

    + "; + // line 15 + if (($context["last"] ?? null)) { + // line 16 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Last checked: @time ago", ["@time" => ($context["time"] ?? null)])); + echo " + "; + } else { + // line 18 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Last checked: never")); + echo " + "; + } + // line 20 + echo " ("; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["link"] ?? null)), "html", null, true); + echo ") +

    +"; + } + + public function getTemplateName() + { + return "core/themes/stable/templates/admin/update-last-check.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 72 => 20, 66 => 18, 60 => 16, 58 => 15, 55 => 14,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/admin/update-last-check.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/admin/update-last-check.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_user.html.twig_ZApjFC7Fxo4MqZFXRXpUgL6fs/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_user.html.twig_ZApjFC7Fxo4MqZFXRXpUgL6fs/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_user.html.twig_ZApjFC7Fxo4MqZFXRXpUgL6fs/ir_H19YoWXc1AL1ShYYx22DWTTgzHGf_Mzl7s4XjraY.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_user.html.twig_ZApjFC7Fxo4MqZFXRXpUgL6fs/ir_H19YoWXc1AL1ShYYx22DWTTgzHGf_Mzl7s4XjraY.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,96 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 20]; + $filters = ["escape" => 19]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 19 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "profile"], "method")), "html", null, true); + echo "> + "; + // line 20 + if (($context["content"] ?? null)) { + // line 21 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["content"] ?? null)), "html", null, true); + } + // line 23 + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/user/user.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 65 => 23, 62 => 21, 60 => 20, 55 => 19,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/user/user.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/user/user.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_username.html.twig_Kdv0fs5r0aBEJsQGx6m6G0Cva/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_username.html.twig_Kdv0fs5r0aBEJsQGx6m6G0Cva/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_username.html.twig_Kdv0fs5r0aBEJsQGx6m6G0Cva/xl2iZMX4IH-V3_LChZn4YlxxZYsy4tdYDlwWM8_1C48.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_username.html.twig_Kdv0fs5r0aBEJsQGx6m6G0Cva/xl2iZMX4IH-V3_LChZn4YlxxZYsy4tdYDlwWM8_1C48.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,101 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 25]; + $filters = ["escape" => 26]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 25 + if (($context["link_path"] ?? null)) { + // line 26 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => "username"], "method")), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["name"] ?? null)), "html", null, true); + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["extra"] ?? null)), "html", null, true); + echo ""; + } else { + // line 28 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["attributes"] ?? null)), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["name"] ?? null)), "html", null, true); + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["extra"] ?? null)), "html", null, true); + echo ""; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/user/username.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 65 => 28, 57 => 26, 55 => 25,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/user/username.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/user/username.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-mini-pager.html.twi_QlfpqdYar58nR7aU5qPmj1cTv/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-mini-pager.html.twi_QlfpqdYar58nR7aU5qPmj1cTv/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-mini-pager.html.twi_QlfpqdYar58nR7aU5qPmj1cTv/V5Pw5RZ30m8Kvu_iWxy--xM8ENCHr7nQI70JctpDh8A.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-mini-pager.html.twi_QlfpqdYar58nR7aU5qPmj1cTv/V5Pw5RZ30m8Kvu_iWxy--xM8ENCHr7nQI70JctpDh8A.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,160 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 12, "trans" => 26]; + $filters = ["t" => 14, "escape" => 18, "without" => 18, "default" => 20]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if', 'trans'], + ['t', 'escape', 'without', 'default'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 12 + if (($this->getAttribute(($context["items"] ?? null), "previous", []) || $this->getAttribute(($context["items"] ?? null), "next", []))) { + // line 13 + echo " +"; + } + } + + public function getTemplateName() + { + return "core/themes/classy/templates/views/views-mini-pager.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 127 => 39, 120 => 35, 116 => 34, 108 => 33, 105 => 32, 102 => 31, 98 => 29, 96 => 27, 95 => 26, 92 => 25, 89 => 24, 82 => 20, 78 => 19, 70 => 18, 67 => 17, 65 => 16, 60 => 14, 57 => 13, 55 => 12,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/views/views-mini-pager.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/views/views-mini-pager.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_LDT6xYAM1sS6q9ZWOiPhYofvB/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_LDT6xYAM1sS6q9ZWOiPhYofvB/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_LDT6xYAM1sS6q9ZWOiPhYofvB/DAvqhWIJ-hH7yZ1h65TsCEeygKF4HwfqluFpxkYAOsU.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_LDT6xYAM1sS6q9ZWOiPhYofvB/DAvqhWIJ-hH7yZ1h65TsCEeygKF4HwfqluFpxkYAOsU.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,106 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["for" => 17]; + $filters = ["escape" => 16]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['for'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 16 + echo "
    env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["vss_id"] ?? null)), "html", null, true); + echo "\" "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 17 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["rendered_rows"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["rendered_row"]) { + // line 18 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($context["rendered_row"]), "html", null, true); + echo " + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['rendered_row'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 20 + echo "
    +"; + } + + public function getTemplateName() + { + return "modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 75 => 20, 66 => 18, 62 => 17, 55 => 16,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame.html.twig", "/var/www/sites/isophonics.net/modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_gFXWeShs83PsOHwz5AH8lQo3B/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_gFXWeShs83PsOHwz5AH8lQo3B/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_gFXWeShs83PsOHwz5AH8lQo3B/G1yj0mATkTd8LB96iVgD4CFOHRFoeYb3eMrz2E7nECE.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_gFXWeShs83PsOHwz5AH8lQo3B/G1yj0mATkTd8LB96iVgD4CFOHRFoeYb3eMrz2E7nECE.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,93 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 19]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 19 + echo "
    env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 20 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["item"] ?? null)), "html", null, true); + echo " +
    +"; + } + + public function getTemplateName() + { + return "modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame-row-item.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 60 => 20, 55 => 19,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame-row-item.html.twig", "/var/www/sites/isophonics.net/modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame-row-item.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_hUvxybZJ9EsBwm2_o3nlOo3qA/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_hUvxybZJ9EsBwm2_o3nlOo3qA/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_hUvxybZJ9EsBwm2_o3nlOo3qA/kQwuRex9mFcjyq0Jv_xMsFWEnidtS9NI2QIPdtqzX34.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-slideshow-cycle-mai_hUvxybZJ9EsBwm2_o3nlOo3qA/kQwuRex9mFcjyq0Jv_xMsFWEnidtS9NI2QIPdtqzX34.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,108 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["for" => 18]; + $filters = ["escape" => 17]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['for'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 17 + echo "
    env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["vss_id"] ?? null)), "html", null, true); + echo "_"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["count"] ?? null)), "html", null, true); + echo "\" "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 18 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["rendered_items"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["rendered_item"]) { + // line 19 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($context["rendered_item"]), "html", null, true); + echo " + "; + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['rendered_item'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + // line 21 + echo "
    +"; + } + + public function getTemplateName() + { + return "modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame-row.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 77 => 21, 68 => 19, 64 => 18, 55 => 17,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame-row.html.twig", "/var/www/sites/isophonics.net/modules/contrib/views_slideshow/modules/views_slideshow_cycle/templates/views-slideshow-cycle-main-frame-row.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-slideshow-main-sect_0XrKE3Runrv-KbwCu6vN5JT30/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-slideshow-main-sect_0XrKE3Runrv-KbwCu6vN5JT30/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-slideshow-main-sect_0XrKE3Runrv-KbwCu6vN5JT30/avOP_Dm3kn3mYOR-u8XYFjuxFWElqhhFNCUTGLDDbAY.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-slideshow-main-sect_0XrKE3Runrv-KbwCu6vN5JT30/avOP_Dm3kn3mYOR-u8XYFjuxFWElqhhFNCUTGLDDbAY.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,97 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 14]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 14 + echo "
    env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["plugin"] ?? null)), "html", null, true); + echo "_main_"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["vss_id"] ?? null)), "html", null, true); + echo "\" class=\""; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["plugin"] ?? null)), "html", null, true); + echo "_main views_slideshow_main\"> + "; + // line 15 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["slides"] ?? null)), "html", null, true); + echo " +
    +"; + } + + public function getTemplateName() + { + return "modules/contrib/views_slideshow/templates/views-slideshow-main-section.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 64 => 15, 55 => 14,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "modules/contrib/views_slideshow/templates/views-slideshow-main-section.html.twig", "/var/www/sites/isophonics.net/modules/contrib/views_slideshow/templates/views-slideshow-main-section.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-view-field.html.twi_-I5ugiNk5E8APLHrqEzs9j9D5/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-view-field.html.twi_-I5ugiNk5E8APLHrqEzs9j9D5/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-view-field.html.twi_-I5ugiNk5E8APLHrqEzs9j9D5/n4r5p-DraOgS7ZhveLaQXBx-rEG32fBzULGrSxOZSZA.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-view-field.html.twi_-I5ugiNk5E8APLHrqEzs9j9D5/n4r5p-DraOgS7ZhveLaQXBx-rEG32fBzULGrSxOZSZA.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,85 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = []; + $filters = ["escape" => 21]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + [], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 21 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["output"] ?? null)), "html", null, true); + } + + public function getTemplateName() + { + return "core/themes/stable/templates/views/views-view-field.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 55 => 21,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/views/views-view-field.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/views/views-view-field.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-view-fields.html.tw_AYS38eLscX4kNCRGsKaSG4Ht7/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-view-fields.html.tw_AYS38eLscX4kNCRGsKaSG4Ht7/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-view-fields.html.tw_AYS38eLscX4kNCRGsKaSG4Ht7/7q4sp000mYz5ZLoH05sPVojzu82zJC9DcozgNk5T1KA.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-view-fields.html.tw_AYS38eLscX4kNCRGsKaSG4Ht7/7q4sp000mYz5ZLoH05sPVojzu82zJC9DcozgNk5T1KA.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,143 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["for" => 32, "if" => 34]; + $filters = ["escape" => 33]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['for', 'if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 32 + $context['_parent'] = $context; + $context['_seq'] = twig_ensure_traversable(($context["fields"] ?? null)); + foreach ($context['_seq'] as $context["_key"] => $context["field"]) { + // line 33 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "separator", [])), "html", null, true); + // line 34 + if ($this->getAttribute($context["field"], "wrapper_element", [])) { + // line 35 + echo "<"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "wrapper_element", [])), "html", null, true); + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "wrapper_attributes", [])), "html", null, true); + echo ">"; + } + // line 37 + if ($this->getAttribute($context["field"], "label", [])) { + // line 38 + if ($this->getAttribute($context["field"], "label_element", [])) { + // line 39 + echo "<"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "label_element", [])), "html", null, true); + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "label_attributes", [])), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "label", [])), "html", null, true); + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "label_suffix", [])), "html", null, true); + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "label_element", [])), "html", null, true); + echo ">"; + } else { + // line 41 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "label", [])), "html", null, true); + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "label_suffix", [])), "html", null, true); + } + } + // line 44 + if ($this->getAttribute($context["field"], "element_type", [])) { + // line 45 + echo "<"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "element_type", [])), "html", null, true); + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "element_attributes", [])), "html", null, true); + echo ">"; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "content", [])), "html", null, true); + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "element_type", [])), "html", null, true); + echo ">"; + } else { + // line 47 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "content", [])), "html", null, true); + } + // line 49 + if ($this->getAttribute($context["field"], "wrapper_element", [])) { + // line 50 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute($context["field"], "wrapper_element", [])), "html", null, true); + echo ">"; + } + } + $_parent = $context['_parent']; + unset($context['_seq'], $context['_iterated'], $context['_key'], $context['field'], $context['_parent'], $context['loop']); + $context = array_intersect_key($context, $_parent) + $_parent; + } + + public function getTemplateName() + { + return "core/themes/stable/templates/views/views-view-fields.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 106 => 50, 104 => 49, 101 => 47, 91 => 45, 89 => 44, 84 => 41, 73 => 39, 71 => 38, 69 => 37, 63 => 35, 61 => 34, 59 => 33, 55 => 32,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/stable/templates/views/views-view-fields.html.twig", "/var/www/sites/isophonics.net/core/themes/stable/templates/views/views-view-fields.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-view-slideshow.html_jDEHC-_LfzV8OvyDuFqjdyukx/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-view-slideshow.html_jDEHC-_LfzV8OvyDuFqjdyukx/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-view-slideshow.html_jDEHC-_LfzV8OvyDuFqjdyukx/fnov3gCgFF-Ot1I-TIenYfw-U7hobr1HBcam-0xHB5U.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-view-slideshow.html_jDEHC-_LfzV8OvyDuFqjdyukx/fnov3gCgFF-Ot1I-TIenYfw-U7hobr1HBcam-0xHB5U.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,124 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["if" => 17]; + $filters = ["escape" => 18]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['if'], + ['escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 17 + if (($context["slideshow"] ?? null)) { + // line 18 + echo "
    env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["skin"] ?? null)), "html", null, true); + echo "\"> + "; + // line 19 + if (($context["top_widget_rendered"] ?? null)) { + // line 20 + echo "
    + "; + // line 21 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["top_widget_rendered"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 24 + echo " + "; + // line 25 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["slideshow"] ?? null)), "html", null, true); + echo " + + "; + // line 27 + if (($context["bottom_widget_rendered"] ?? null)) { + // line 28 + echo "
    + "; + // line 29 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["bottom_widget_rendered"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 32 + echo "
    +"; + } + } + + public function getTemplateName() + { + return "modules/contrib/views_slideshow/templates/views-view-slideshow.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 92 => 32, 86 => 29, 83 => 28, 81 => 27, 76 => 25, 73 => 24, 67 => 21, 64 => 20, 62 => 19, 57 => 18, 55 => 17,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "modules/contrib/views_slideshow/templates/views-view-slideshow.html.twig", "/var/www/sites/isophonics.net/modules/contrib/views_slideshow/templates/views-view-slideshow.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-view.html.twig_Rrykl0lUhD9AVd4ooQI_-Asa4/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-view.html.twig_Rrykl0lUhD9AVd4ooQI_-Asa4/.htaccess Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 sites/default/files/php/twig/5cd43804194fc_views-view.html.twig_Rrykl0lUhD9AVd4ooQI_-Asa4/nNZMgy2d2xaBulEvLB7LSzu7vmBDHpWipsKg7w7y2Kk.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/default/files/php/twig/5cd43804194fc_views-view.html.twig_Rrykl0lUhD9AVd4ooQI_-Asa4/nNZMgy2d2xaBulEvLB7LSzu7vmBDHpWipsKg7w7y2Kk.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,229 @@ +parent = false; + + $this->blocks = [ + ]; + $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension'); + $tags = ["set" => 34, "if" => 44]; + $filters = ["clean_class" => 36, "escape" => 42]; + $functions = []; + + try { + $this->sandbox->checkSecurity( + ['set', 'if'], + ['clean_class', 'escape'], + [] + ); + } catch (SecurityError $e) { + $e->setSourceContext($this->getSourceContext()); + + if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { + $e->setTemplateLine($tags[$e->getTagName()]); + } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { + $e->setTemplateLine($filters[$e->getFilterName()]); + } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { + $e->setTemplateLine($functions[$e->getFunctionName()]); + } + + throw $e; + } + + } + + protected function doDisplay(array $context, array $blocks = []) + { + // line 34 + $context["classes"] = [0 => "view", 1 => ("view-" . \Drupal\Component\Utility\Html::getClass($this->sandbox->ensureToStringAllowed( // line 36 +($context["id"] ?? null)))), 2 => ("view-id-" . $this->sandbox->ensureToStringAllowed( // line 37 +($context["id"] ?? null))), 3 => ("view-display-id-" . $this->sandbox->ensureToStringAllowed( // line 38 +($context["display_id"] ?? null))), 4 => (( // line 39 +($context["dom_id"] ?? null)) ? (("js-view-dom-id-" . $this->sandbox->ensureToStringAllowed(($context["dom_id"] ?? null)))) : (""))]; + // line 42 + echo "env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "html", null, true); + echo "> + "; + // line 43 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_prefix"] ?? null)), "html", null, true); + echo " + "; + // line 44 + if (($context["title"] ?? null)) { + // line 45 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title"] ?? null)), "html", null, true); + echo " + "; + } + // line 47 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["title_suffix"] ?? null)), "html", null, true); + echo " + "; + // line 48 + if (($context["header"] ?? null)) { + // line 49 + echo "
    + "; + // line 50 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["header"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 53 + echo " "; + if (($context["exposed"] ?? null)) { + // line 54 + echo "
    + "; + // line 55 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["exposed"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 58 + echo " "; + if (($context["attachment_before"] ?? null)) { + // line 59 + echo "
    + "; + // line 60 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["attachment_before"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 63 + echo " + "; + // line 64 + if (($context["rows"] ?? null)) { + // line 65 + echo "
    + "; + // line 66 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["rows"] ?? null)), "html", null, true); + echo " +
    + "; + } elseif ( // line 68 +($context["empty"] ?? null)) { + // line 69 + echo "
    + "; + // line 70 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["empty"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 73 + echo " + "; + // line 74 + if (($context["pager"] ?? null)) { + // line 75 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["pager"] ?? null)), "html", null, true); + echo " + "; + } + // line 77 + echo " "; + if (($context["attachment_after"] ?? null)) { + // line 78 + echo "
    + "; + // line 79 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["attachment_after"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 82 + echo " "; + if (($context["more"] ?? null)) { + // line 83 + echo " "; + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["more"] ?? null)), "html", null, true); + echo " + "; + } + // line 85 + echo " "; + if (($context["footer"] ?? null)) { + // line 86 + echo "
    + "; + // line 87 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["footer"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 90 + echo " "; + if (($context["feed_icons"] ?? null)) { + // line 91 + echo "
    + "; + // line 92 + echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(($context["feed_icons"] ?? null)), "html", null, true); + echo " +
    + "; + } + // line 95 + echo " +"; + } + + public function getTemplateName() + { + return "core/themes/classy/templates/views/views-view.html.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 198 => 95, 192 => 92, 189 => 91, 186 => 90, 180 => 87, 177 => 86, 174 => 85, 168 => 83, 165 => 82, 159 => 79, 156 => 78, 153 => 77, 147 => 75, 145 => 74, 142 => 73, 136 => 70, 133 => 69, 131 => 68, 126 => 66, 123 => 65, 121 => 64, 118 => 63, 112 => 60, 109 => 59, 106 => 58, 100 => 55, 97 => 54, 94 => 53, 88 => 50, 85 => 49, 83 => 48, 78 => 47, 72 => 45, 70 => 44, 66 => 43, 61 => 42, 59 => 39, 58 => 38, 57 => 37, 56 => 36, 55 => 34,); + } + + /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return $this->getSourceContext()->getCode(); + } + + public function getSourceContext() + { + return new Source("", "core/themes/classy/templates/views/views-view.html.twig", "/var/www/sites/isophonics.net/core/themes/classy/templates/views/views-view.html.twig"); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/behat/mink/src/WebAssert.php --- a/vendor/behat/mink/src/WebAssert.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/behat/mink/src/WebAssert.php Thu May 09 15:33:08 2019 +0100 @@ -190,7 +190,7 @@ $actual = $this->session->getResponseHeader($name); $message = sprintf('The text "%s" was not found anywhere in the "%s" response header.', $value, $name); - $this->assert(false !== stripos($actual, $value), $message); + $this->assert(false !== stripos($actual, (string) $value), $message); } /** @@ -206,7 +206,7 @@ $actual = $this->session->getResponseHeader($name); $message = sprintf('The text "%s" was found in the "%s" response header, but it should not.', $value, $name); - $this->assert(false === stripos($actual, $value), $message); + $this->assert(false === stripos($actual, (string) $value), $message); } /** @@ -321,7 +321,7 @@ $actual = $this->session->getPage()->getContent(); $message = sprintf('The string "%s" was not found anywhere in the HTML response of the current page.', $text); - $this->assert(stripos($actual, $text) !== false, $message); + $this->assert(stripos($actual, (string) $text) !== false, $message); } /** @@ -336,7 +336,7 @@ $actual = $this->session->getPage()->getContent(); $message = sprintf('The string "%s" appears in the HTML response of this page, but it should not.', $text); - $this->assert(stripos($actual, $text) === false, $message); + $this->assert(stripos($actual, (string) $text) === false, $message); } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/brumann/polyfill-unserialize/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/brumann/polyfill-unserialize/.gitignore Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,4 @@ +/vendor/ +/phpunit.xml +/.composer.lock + diff -r 129ea1e6d783 -r af1871eacc83 vendor/brumann/polyfill-unserialize/.travis.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/brumann/polyfill-unserialize/.travis.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,20 @@ +language: php + +sudo: false + +php: + - '5.3' + - '5.4' + - '5.5' + - '5.6' + - '7.0' + - '7.1' + +before_install: + - phpenv config-rm xdebug.ini + - composer self-update + +install: + - composer install + +script: phpunit diff -r 129ea1e6d783 -r af1871eacc83 vendor/brumann/polyfill-unserialize/LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/brumann/polyfill-unserialize/LICENSE Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Denis Brumann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -r 129ea1e6d783 -r af1871eacc83 vendor/brumann/polyfill-unserialize/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/brumann/polyfill-unserialize/README.md Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,61 @@ +Polyfill unserialize [![Build Status](https://travis-ci.org/dbrumann/polyfill-unserialize.svg?branch=master)](https://travis-ci.org/dbrumann/polyfill-unserialize) +=== + +Backports unserialize options introduced in PHP 7.0 to older PHP versions. +This was originally designed as a Proof of Concept for Symfony Issue [#21090](https://github.com/symfony/symfony/pull/21090). + +You can use this package in projects that rely on PHP versions older than PHP 7.0. +In case you are using PHP 7.0+ the original `unserialize()` will be used instead. + +From the [documentation](https://secure.php.net/manual/en/function.unserialize.php): + +> Warning: Do not pass untrusted user input to unserialize(). Unserialization can +> result in code being loaded and executed due to object instantiation +> and autoloading, and a malicious user may be able to exploit this. + +This warning holds true even when `allowed_classes` is used. + +Requirements +------------ + + - PHP 5.3+ + +Installation +------------ + +You can install this package via composer: + +``` +composer require brumann/polyfill-unserialize "^1.0" +``` + +Known Issues +------------ + +There is a mismatch in behavior when `allowed_classes` in `$options` is not +of the correct type (array or boolean). PHP 7.1 will issue a warning, whereas +PHP 7.0 will not. I opted to copy the behavior of the former. + +Tests +----- + +You can run the test suite using PHPUnit. It is intentionally not bundled as +dev dependency to make sure this package has the lowest restrictions on the +implementing system as possible. + +Please read the [PHPUnit Manual](https://phpunit.de/manual/current/en/installation.html) +for information how to install it on your system. + +You can run the test suite as follows: + +``` +phpunit -c phpunit.xml.dist tests/ +``` + +Contributing +------------ + +This package is considered feature complete. As such I will likely not update it +unless there are security issues. + +Should you find any bugs or have questions, feel free to submit an Issue or a Pull Request. diff -r 129ea1e6d783 -r af1871eacc83 vendor/brumann/polyfill-unserialize/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/brumann/polyfill-unserialize/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,26 @@ +{ + "name": "brumann/polyfill-unserialize", + "description": "Backports unserialize options introduced in PHP 7.0 to older PHP versions.", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Denis Brumann", + "email": "denis.brumann@sensiolabs.de" + } + ], + "autoload": { + "psr-4": { + "Brumann\\Polyfill\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\Brumann\\Polyfill\\": "tests/" + } + }, + "minimum-stability": "stable", + "require": { + "php": "^5.3|^7.0" + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/brumann/polyfill-unserialize/phpunit.xml.dist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/brumann/polyfill-unserialize/phpunit.xml.dist Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,25 @@ + + + + + + + + + + ./tests/ + + + + + + ./src/ + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/brumann/polyfill-unserialize/src/Unserialize.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/brumann/polyfill-unserialize/src/Unserialize.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,58 @@ += 70000) { + return \unserialize($serialized, $options); + } + if (!array_key_exists('allowed_classes', $options)) { + $options['allowed_classes'] = true; + } + $allowedClasses = $options['allowed_classes']; + if (true === $allowedClasses) { + return \unserialize($serialized); + } + if (false === $allowedClasses) { + $allowedClasses = array(); + } + if (!is_array($allowedClasses)) { + trigger_error( + 'unserialize(): allowed_classes option should be array or boolean', + E_USER_WARNING + ); + $allowedClasses = array(); + } + + $sanitizedSerialized = preg_replace_callback( + '/(^|;)O:\d+:"([^"]*)":(\d+):{/', + function ($match) use ($allowedClasses) { + list($completeMatch, $leftBorder, $className, $objectSize) = $match; + if (in_array($className, $allowedClasses)) { + return $completeMatch; + } else { + return sprintf( + '%sO:22:"__PHP_Incomplete_Class":%d:{s:27:"__PHP_Incomplete_Class_Name";%s', + $leftBorder, + $objectSize + 1, // size of object + 1 for added string + \serialize($className) + ); + } + }, + $serialized + ); + + return \unserialize($sanitizedSerialized); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/brumann/polyfill-unserialize/tests/Foo.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/brumann/polyfill-unserialize/tests/Foo.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,7 @@ +assertInstanceOf('Tests\\Brumann\\Polyfill\\Foo', $unserialized); + } + + public function test_unserialize_with_cqn_returns_instance() + { + $foo = new Foo(); + $serialized = serialize($foo); + $options = array( + 'allowed_classes' => array('Tests\\Brumann\\Polyfill\\Foo'), + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertInstanceOf('Tests\\Brumann\\Polyfill\\Foo', $unserialized); + } + + public function test_unserialize_with_fqcn_allowed_returns_instance() + { + $foo = new Foo(); + $serialized = serialize($foo); + $options = array( + 'allowed_classes' => array('\\Tests\\Brumann\\Polyfill\\Foo'), + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertInstanceOf('__PHP_Incomplete_Class', $unserialized); + } + + public function test_unserialize_with_allowed_classes_false_returns_incomplete_object() + { + $foo = new Foo(); + $serialized = serialize($foo); + $options = array( + 'allowed_classes' => false, + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertInstanceOf('__PHP_Incomplete_Class', $unserialized); + } + + /** + * @requires PHP < 7.0 + * + * @expectedException \PHPUnit_Framework_Error_Warning + * @expectedMessage allowed_classes option should be array or boolean + */ + public function test_unserialize_with_allowed_classes_null_behaves_like_php71() + { + $foo = new Foo(); + $serialized = serialize($foo); + $options = array( + 'allowed_classes' => null, + ); + + Unserialize::unserialize($serialized, $options); + } + + /** + * @expectedException \PHPUnit_Framework_Error_Notice + * @expectedExceptionMessage tried to execute a method or access a property of an incomplete object. + */ + public function test_accessing_property_of_incomplete_object_returns_warning() + { + $bar = new \stdClass(); + $bar->foo = new Foo(); + $serialized = serialize($bar); + $options = array( + 'allowed_classes' => array('Tests\\Brumann\\Polyfill\\Foo'), + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertInstanceOf('__PHP_Incomplete_Class', $unserialized); + $unserialized->foo; + } + + public function test_unserialize_only_parent_object() + { + $foo = new Foo(); + $foo->bar = new \stdClass(); + $serialized = serialize($foo); + $options = array( + 'allowed_classes' => array('Tests\\Brumann\\Polyfill\\Foo'), + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertInstanceOf('\\Tests\\Brumann\\Polyfill\\Foo', $unserialized); + $this->assertInstanceOf('__PHP_Incomplete_Class', $unserialized->bar); + } + + public function test_unserialize_parent_and_embedded_object() + { + $foo = new Foo(); + $foo->foo = new Foo(); + $serialized = serialize($foo); + $options = array( + 'allowed_classes' => array('Tests\\Brumann\\Polyfill\\Foo'), + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertInstanceOf('\\Tests\\Brumann\\Polyfill\\Foo', $unserialized); + $this->assertInstanceOf('\\Tests\\Brumann\\Polyfill\\Foo', $unserialized->foo); + } + + public function test_unserialize_with_allowed_classes_false_serializes_string() + { + $string = 'This is an ordinary string'; + $serialized = serialize($string); + $options = array( + 'allowed_classes' => false, + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertEquals($string, $unserialized); + } + + public function test_unserialize_with_allowed_classes_false_serializes_bool() + { + $bool = true; + $serialized = serialize($bool); + $options = array( + 'allowed_classes' => false, + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertEquals($bool, $unserialized); + } + + public function test_unserialize_with_allowed_classes_false_serializes_array() + { + $array = array( + 'key' => 42, + 1 => 'foo', + 'bar' => 'baz', + 2 => 23, + 4 => true, + ); + $serialized = serialize($array); + $options = array( + 'allowed_classes' => false, + ); + + $unserialized = Unserialize::unserialize($serialized, $options); + + $this->assertSame($array, $unserialized); + } + + public function test_double_serialized_unserializes_as_first_serialized() + { + $foo = new Foo(); + $first = serialize($foo); + $second = serialize($first); + $options = array( + 'allowed_classes' => false, + ); + + $unserialized = Unserialize::unserialize($second, $options); + + $this->assertSame($first, $unserialized); + } + + public function test_double_unserialize_double_serialized() + { + $foo = new Foo(); + $serialized = serialize(serialize($foo)); + $options = array( + 'allowed_classes' => false, + ); + + $first = Unserialize::unserialize($serialized, $options); + $unserialized = Unserialize::unserialize($first, $options); + + $this->assertInstanceOf('__PHP_Incomplete_Class', $unserialized); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/autoload_classmap.php --- a/vendor/composer/autoload_classmap.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/autoload_classmap.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ 'Console_Table' => $vendorDir . '/pear/console_table/Table.php', 'DivisionByZeroError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php', 'Drupal' => $baseDir . '/core/lib/Drupal.php', + 'DrupalFinder\\DrupalFinder' => $vendorDir . '/webflo/drupal-finder/src/DrupalFinder.php', 'Drupal\\Component\\Utility\\Timer' => $baseDir . '/core/lib/Drupal/Component/Utility/Timer.php', 'Drupal\\Component\\Utility\\Unicode' => $baseDir . '/core/lib/Drupal/Component/Utility/Unicode.php', 'Drupal\\Core\\Database\\Database' => $baseDir . '/core/lib/Drupal/Core/Database/Database.php', diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/autoload_files.php --- a/vendor/composer/autoload_files.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/autoload_files.php Thu May 09 15:33:08 2019 +0100 @@ -6,14 +6,14 @@ $baseDir = dirname($vendorDir); return array( + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php', '023d27dca8066ef29e6739335ea73bad' => $vendorDir . '/symfony/polyfill-php70/bootstrap.php', '92c8763cd6170fce6fcfe7e26b4e8c10' => $vendorDir . '/symfony/phpunit-bridge/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/autoload_namespaces.php --- a/vendor/composer/autoload_namespaces.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/autoload_namespaces.php Thu May 09 15:33:08 2019 +0100 @@ -11,13 +11,16 @@ 'Twig_' => array($vendorDir . '/twig/twig/lib'), 'Stack' => array($vendorDir . '/stack/builder/src'), 'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src'), - 'Egulias\\' => array($vendorDir . '/egulias/email-validator/src'), + 'PEAR' => array($vendorDir . '/pear/pear_exception'), 'EasyRdf_' => array($vendorDir . '/easyrdf/easyrdf/lib'), 'Drush' => array($vendorDir . '/drush/drush/lib'), 'Drupal\\' => array($vendorDir . '/drupal/coder/coder_sniffer/Drupal'), - 'DrupalPractice\\' => array($vendorDir . '/drupal/coder/coder_sniffer/Drupal'), + 'DrupalPractice\\' => array($vendorDir . '/drupal/coder/coder_sniffer/DrupalPractice'), 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'), 'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'), 'Dflydev\\DotAccessData' => array($vendorDir . '/dflydev/dot-access-data/src'), 'Consolidation' => array($vendorDir . '/drush/drush/lib'), + 'Console' => array($vendorDir . '/pear/console_getopt'), + 'Archive_Tar' => array($vendorDir . '/pear/archive_tar'), + '' => array($vendorDir . '/pear/pear-core-minimal/src'), ); diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/autoload_psr4.php --- a/vendor/composer/autoload_psr4.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/autoload_psr4.php Thu May 09 15:33:08 2019 +0100 @@ -56,6 +56,8 @@ 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'Goutte\\' => array($vendorDir . '/fabpot/goutte/Goutte'), + 'Egulias\\EmailValidator\\' => array($vendorDir . '/egulias/email-validator/EmailValidator'), + 'Drush\\' => array($vendorDir . '/drush/drush/src'), 'Drupal\\Driver\\' => array($baseDir . '/drivers/lib/Drupal/Driver', $baseDir . '/drivers/lib/Drupal/Driver'), 'Drupal\\Core\\Composer\\' => array($baseDir . '/core/lib/Drupal/Core/Composer'), 'Drupal\\Core\\' => array($baseDir . '/core/lib/Drupal/Core', $baseDir . '/core/lib/Drupal/Core'), @@ -70,6 +72,7 @@ 'Consolidation\\AnnotatedCommand\\' => array($vendorDir . '/consolidation/annotated-command/src'), 'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'), 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'), + 'Brumann\\Polyfill\\' => array($vendorDir . '/brumann/polyfill-unserialize/src'), 'Behat\\Mink\\Driver\\' => array($vendorDir . '/behat/mink-browserkit-driver/src', $vendorDir . '/behat/mink-goutte-driver/src', $vendorDir . '/behat/mink-selenium2-driver/src'), 'Behat\\Mink\\' => array($vendorDir . '/behat/mink/src'), 'Asm89\\Stack\\' => array($vendorDir . '/asm89/stack-cors/src/Asm89/Stack'), diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/autoload_real.php --- a/vendor/composer/autoload_real.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/autoload_real.php Thu May 09 15:33:08 2019 +0100 @@ -23,6 +23,10 @@ self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInitDrupal8', 'loadClassLoader')); + $includePaths = require __DIR__ . '/include_paths.php'; + $includePaths[] = get_include_path(); + set_include_path(implode(PATH_SEPARATOR, $includePaths)); + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/autoload_static.php --- a/vendor/composer/autoload_static.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/autoload_static.php Thu May 09 15:33:08 2019 +0100 @@ -7,14 +7,14 @@ class ComposerStaticInitDrupal8 { public static $files = array ( + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php', '023d27dca8066ef29e6739335ea73bad' => __DIR__ . '/..' . '/symfony/polyfill-php70/bootstrap.php', '92c8763cd6170fce6fcfe7e26b4e8c10' => __DIR__ . '/..' . '/symfony/phpunit-bridge/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', @@ -111,8 +111,13 @@ 'GuzzleHttp\\' => 11, 'Goutte\\' => 7, ), + 'E' => + array ( + 'Egulias\\EmailValidator\\' => 23, + ), 'D' => array ( + 'Drush\\' => 6, 'Drupal\\Driver\\' => 14, 'Drupal\\Core\\Composer\\' => 21, 'Drupal\\Core\\' => 12, @@ -133,6 +138,7 @@ ), 'B' => array ( + 'Brumann\\Polyfill\\' => 17, 'Behat\\Mink\\Driver\\' => 18, 'Behat\\Mink\\' => 11, ), @@ -345,6 +351,14 @@ array ( 0 => __DIR__ . '/..' . '/fabpot/goutte/Goutte', ), + 'Egulias\\EmailValidator\\' => + array ( + 0 => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator', + ), + 'Drush\\' => + array ( + 0 => __DIR__ . '/..' . '/drush/drush/src', + ), 'Drupal\\Driver\\' => array ( 0 => __DIR__ . '/../..' . '/drivers/lib/Drupal/Driver', @@ -404,6 +418,10 @@ array ( 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers', ), + 'Brumann\\Polyfill\\' => + array ( + 0 => __DIR__ . '/..' . '/brumann/polyfill-unserialize/src', + ), 'Behat\\Mink\\Driver\\' => array ( 0 => __DIR__ . '/..' . '/behat/mink-browserkit-driver/src', @@ -455,13 +473,13 @@ array ( 0 => __DIR__ . '/..' . '/phpspec/prophecy/src', ), + 'PEAR' => + array ( + 0 => __DIR__ . '/..' . '/pear/pear_exception', + ), ), 'E' => array ( - 'Egulias\\' => - array ( - 0 => __DIR__ . '/..' . '/egulias/email-validator/src', - ), 'EasyRdf_' => array ( 0 => __DIR__ . '/..' . '/easyrdf/easyrdf/lib', @@ -479,7 +497,7 @@ ), 'DrupalPractice\\' => array ( - 0 => __DIR__ . '/..' . '/drupal/coder/coder_sniffer/Drupal', + 0 => __DIR__ . '/..' . '/drupal/coder/coder_sniffer/DrupalPractice', ), 'Doctrine\\Common\\Lexer\\' => array ( @@ -500,7 +518,22 @@ array ( 0 => __DIR__ . '/..' . '/drush/drush/lib', ), + 'Console' => + array ( + 0 => __DIR__ . '/..' . '/pear/console_getopt', + ), ), + 'A' => + array ( + 'Archive_Tar' => + array ( + 0 => __DIR__ . '/..' . '/pear/archive_tar', + ), + ), + ); + + public static $fallbackDirsPsr0 = array ( + 0 => __DIR__ . '/..' . '/pear/pear-core-minimal/src', ); public static $classMap = array ( @@ -509,6 +542,7 @@ 'Console_Table' => __DIR__ . '/..' . '/pear/console_table/Table.php', 'DivisionByZeroError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php', 'Drupal' => __DIR__ . '/../..' . '/core/lib/Drupal.php', + 'DrupalFinder\\DrupalFinder' => __DIR__ . '/..' . '/webflo/drupal-finder/src/DrupalFinder.php', 'Drupal\\Component\\Utility\\Timer' => __DIR__ . '/../..' . '/core/lib/Drupal/Component/Utility/Timer.php', 'Drupal\\Component\\Utility\\Unicode' => __DIR__ . '/../..' . '/core/lib/Drupal/Component/Utility/Unicode.php', 'Drupal\\Core\\Database\\Database' => __DIR__ . '/../..' . '/core/lib/Drupal/Core/Database/Database.php', @@ -1077,6 +1111,7 @@ $loader->prefixLengthsPsr4 = ComposerStaticInitDrupal8::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitDrupal8::$prefixDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInitDrupal8::$prefixesPsr0; + $loader->fallbackDirsPsr0 = ComposerStaticInitDrupal8::$fallbackDirsPsr0; $loader->classMap = ComposerStaticInitDrupal8::$classMap; }, null, ClassLoader::class); diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/include_paths.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/composer/include_paths.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +=5.4.0", - "squizlabs/php_codesniffer": "^3.0.1", + "php": ">=5.5.9", + "squizlabs/php_codesniffer": "^3.4.1", "symfony/yaml": ">=2.0.0" }, "require-dev": { "phpunit/phpunit": ">=3.7 <6" }, - "time": "2018-09-21T14:22:49+00:00", + "time": "2019-04-16T18:56:06+00:00", "type": "phpcodesniffer-standard", "installation-source": "source", "autoload": { "psr-0": { "Drupal\\": "coder_sniffer/Drupal/", - "DrupalPractice\\": "coder_sniffer/Drupal/" + "DrupalPractice\\": "coder_sniffer/DrupalPractice/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1238,17 +1321,17 @@ }, { "name": "drupal/core", - "version": "8.6.10", - "version_normalized": "8.6.10.0", + "version": "8.7.1", + "version_normalized": "8.7.1.0", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "59568ac02948cf075ee8543e6c6d4386ad8daec1" + "reference": "969f24810fb31eac71dd624de593f551bd6dc2a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/59568ac02948cf075ee8543e6c6d4386ad8daec1", - "reference": "59568ac02948cf075ee8543e6c6d4386ad8daec1", + "url": "https://api.github.com/repos/drupal/core/zipball/969f24810fb31eac71dd624de593f551bd6dc2a3", + "reference": "969f24810fb31eac71dd624de593f551bd6dc2a3", "shasum": "" }, "require": { @@ -1257,7 +1340,7 @@ "doctrine/annotations": "^1.2", "doctrine/common": "^2.5", "easyrdf/easyrdf": "^0.9", - "egulias/email-validator": "^1.2", + "egulias/email-validator": "^2.0", "ext-date": "*", "ext-dom": "*", "ext-filter": "*", @@ -1274,14 +1357,15 @@ "guzzlehttp/guzzle": "^6.2.1", "masterminds/html5": "^2.1", "paragonie/random_compat": "^1.0|^2.0", + "pear/archive_tar": "^1.4", "php": "^5.5.9|>=7.0.8", "stack/builder": "^1.0", "symfony-cmf/routing": "^1.4", "symfony/class-loader": "~3.4.0", "symfony/console": "~3.4.0", - "symfony/dependency-injection": "~3.4.0", + "symfony/dependency-injection": "~3.4.26", "symfony/event-dispatcher": "~3.4.0", - "symfony/http-foundation": "~3.4.14", + "symfony/http-foundation": "~3.4.27", "symfony/http-kernel": "~3.4.14", "symfony/polyfill-iconv": "^1.0", "symfony/process": "~3.4.0", @@ -1291,8 +1375,8 @@ "symfony/translation": "~3.4.0", "symfony/validator": "~3.4.0", "symfony/yaml": "~3.4.5", - "twig/twig": "^1.35.0", - "typo3/phar-stream-wrapper": "^2.0.1", + "twig/twig": "^1.38.2", + "typo3/phar-stream-wrapper": "^2.1.1", "zendframework/zend-diactoros": "^1.1", "zendframework/zend-feed": "^2.4" }, @@ -1344,6 +1428,7 @@ "drupal/core-transliteration": "self.version", "drupal/core-utility": "self.version", "drupal/core-uuid": "self.version", + "drupal/core-version": "self.version", "drupal/datetime": "self.version", "drupal/datetime_range": "self.version", "drupal/dblog": "self.version", @@ -1361,6 +1446,7 @@ "drupal/history": "self.version", "drupal/image": "self.version", "drupal/inline_form_errors": "self.version", + "drupal/jsonapi": "self.version", "drupal/language": "self.version", "drupal/layout_builder": "self.version", "drupal/layout_discovery": "self.version", @@ -1411,9 +1497,10 @@ "behat/mink": "1.7.x-dev", "behat/mink-goutte-driver": "^1.2", "behat/mink-selenium2-driver": "1.3.x-dev", - "drupal/coder": "^8.2.12", + "drupal/coder": "^8.3.1", "jcalderonzumba/gastonjs": "^1.0.2", "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "justinrainbow/json-schema": "^5.2", "mikey179/vfsstream": "^1.2", "phpspec/prophecy": "^1.7", "phpunit/phpunit": "^4.8.35 || ^6.5", @@ -1421,7 +1508,7 @@ "symfony/debug": "^3.4.0", "symfony/phpunit-bridge": "^3.4.3" }, - "time": "2019-02-20T18:35:01+00:00", + "time": "2019-05-08T16:00:55+00:00", "type": "drupal-core", "extra": { "merge-plugin": { @@ -1447,7 +1534,8 @@ "core/lib/Drupal/Component/Serialization/composer.json", "core/lib/Drupal/Component/Transliteration/composer.json", "core/lib/Drupal/Component/Utility/composer.json", - "core/lib/Drupal/Component/Uuid/composer.json" + "core/lib/Drupal/Component/Uuid/composer.json", + "core/lib/Drupal/Component/Version/composer.json" ], "recurse": false, "replace": false, @@ -1479,21 +1567,21 @@ }, { "name": "drush/drush", - "version": "8.1.18", - "version_normalized": "8.1.18.0", + "version": "8.2.3", + "version_normalized": "8.2.3.0", "source": { "type": "git", "url": "https://github.com/drush-ops/drush.git", - "reference": "799e4135ad7161f1a4668164ff8a6e5bcd779fc7" + "reference": "bf2b2471b9410e0ff4adc23aee020ee1aff28610" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drush-ops/drush/zipball/799e4135ad7161f1a4668164ff8a6e5bcd779fc7", - "reference": "799e4135ad7161f1a4668164ff8a6e5bcd779fc7", + "url": "https://api.github.com/repos/drush-ops/drush/zipball/bf2b2471b9410e0ff4adc23aee020ee1aff28610", + "reference": "bf2b2471b9410e0ff4adc23aee020ee1aff28610", "shasum": "" }, "require": { - "consolidation/annotated-command": "^2.9.1", + "consolidation/annotated-command": "^2.12.0", "consolidation/output-formatters": "~3", "pear/console_table": "~1.3.1", "php": ">=5.4.5", @@ -1504,6 +1592,7 @@ "symfony/finder": "~2.7|^3", "symfony/var-dumper": "~2.7|^3", "symfony/yaml": "~2.3|^3", + "webflo/drupal-finder": "^1.1.0", "webmozart/path-util": "~2" }, "require-dev": { @@ -1519,7 +1608,7 @@ "drush/config-extra": "Provides configuration workflow commands, such as config-merge.", "ext-pcntl": "*" }, - "time": "2018-11-21T22:57:06+00:00", + "time": "2019-04-03T04:20:26+00:00", "bin": [ "drush", "drush.launcher", @@ -1537,6 +1626,9 @@ "psr-0": { "Drush": "lib/", "Consolidation": "lib/" + }, + "psr-4": { + "Drush\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1654,27 +1746,32 @@ }, { "name": "egulias/email-validator", - "version": "1.2.15", - "version_normalized": "1.2.15.0", + "version": "2.1.7", + "version_normalized": "2.1.7.0", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "758a77525bdaabd6c0f5669176bd4361cb2dda9e" + "reference": "709f21f92707308cdf8f9bcfa1af4cb26586521e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/758a77525bdaabd6c0f5669176bd4361cb2dda9e", - "reference": "758a77525bdaabd6c0f5669176bd4361cb2dda9e", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/709f21f92707308cdf8f9bcfa1af4cb26586521e", + "reference": "709f21f92707308cdf8f9bcfa1af4cb26586521e", "shasum": "" }, "require": { "doctrine/lexer": "^1.0.1", - "php": ">= 5.3.3" + "php": ">= 5.5" }, "require-dev": { - "phpunit/phpunit": "^4.8.24" - }, - "time": "2018-09-25T20:59:41+00:00", + "dominicsayers/isemail": "dev-master", + "phpunit/phpunit": "^4.8.35||^5.7||^6.0", + "satooshi/php-coveralls": "^1.0.1" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "time": "2018-12-04T22:38:24+00:00", "type": "library", "extra": { "branch-alias": { @@ -1683,8 +1780,8 @@ }, "installation-source": "dist", "autoload": { - "psr-0": { - "Egulias\\": "src/" + "psr-4": { + "Egulias\\EmailValidator\\": "EmailValidator" } }, "notification-url": "https://packagist.org/downloads/", @@ -1696,7 +1793,7 @@ "name": "Eduardo Gulias Davis" } ], - "description": "A library for validating emails", + "description": "A library for validating emails against several RFCs", "homepage": "https://github.com/egulias/EmailValidator", "keywords": [ "email", @@ -2226,17 +2323,17 @@ }, { "name": "masterminds/html5", - "version": "2.5.0", - "version_normalized": "2.5.0.0", + "version": "2.6.0", + "version_normalized": "2.6.0.0", "source": { "type": "git", "url": "https://github.com/Masterminds/html5-php.git", - "reference": "b5d892a4bd058d61f736935d32a9c248f11ccc93" + "reference": "c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/b5d892a4bd058d61f736935d32a9c248f11ccc93", - "reference": "b5d892a4bd058d61f736935d32a9c248f11ccc93", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad", + "reference": "c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad", "shasum": "" }, "require": { @@ -2250,11 +2347,11 @@ "sami/sami": "~2.0", "satooshi/php-coveralls": "1.0.*" }, - "time": "2018-12-27T22:03:43+00:00", + "time": "2019-03-10T11:41:28+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.6-dev" } }, "installation-source": "dist", @@ -2295,17 +2392,17 @@ }, { "name": "mikey179/vfsStream", - "version": "v1.6.5", - "version_normalized": "1.6.5.0", + "version": "v1.6.6", + "version_normalized": "1.6.6.0", "source": { "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d", "shasum": "" }, "require": { @@ -2314,7 +2411,7 @@ "require-dev": { "phpunit/phpunit": "~4.5" }, - "time": "2017-08-01T08:02:14+00:00", + "time": "2019-04-08T13:54:32+00:00", "type": "library", "extra": { "branch-alias": { @@ -2493,6 +2590,123 @@ ] }, { + "name": "pear/archive_tar", + "version": "1.4.7", + "version_normalized": "1.4.7.0", + "source": { + "type": "git", + "url": "https://github.com/pear/Archive_Tar.git", + "reference": "7e48add6f8edc3027dd98ad15964b1a28fd0c845" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/7e48add6f8edc3027dd98ad15964b1a28fd0c845", + "reference": "7e48add6f8edc3027dd98ad15964b1a28fd0c845", + "shasum": "" + }, + "require": { + "pear/pear-core-minimal": "^1.10.0alpha2", + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-bz2": "Bz2 compression support.", + "ext-xz": "Lzma2 compression support.", + "ext-zlib": "Gzip compression support." + }, + "time": "2019-04-08T13:15:55+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Archive_Tar": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Vincent Blavet", + "email": "vincent@phpconcept.net" + }, + { + "name": "Greg Beaver", + "email": "greg@chiaraquartet.net" + }, + { + "name": "Michiel Rook", + "email": "mrook@php.net" + } + ], + "description": "Tar file management class with compression support (gzip, bzip2, lzma2)", + "homepage": "https://github.com/pear/Archive_Tar", + "keywords": [ + "archive", + "tar" + ] + }, + { + "name": "pear/console_getopt", + "version": "v1.4.2", + "version_normalized": "1.4.2.0", + "source": { + "type": "git", + "url": "https://github.com/pear/Console_Getopt.git", + "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/6c77aeb625b32bd752e89ee17972d103588b90c0", + "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0", + "shasum": "" + }, + "time": "2019-02-06T16:52:33+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Console": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Greg Beaver", + "email": "cellog@php.net", + "role": "Helper" + }, + { + "name": "Andrei Zmievski", + "email": "andrei@php.net", + "role": "Lead" + }, + { + "name": "Stig Bakken", + "email": "stig@php.net", + "role": "Developer" + } + ], + "description": "More info available on: http://pear.php.net/package/Console_Getopt" + }, + { "name": "pear/console_table", "version": "v1.3.1", "version_normalized": "1.3.1.0", @@ -2550,6 +2764,109 @@ ] }, { + "name": "pear/pear-core-minimal", + "version": "v1.10.9", + "version_normalized": "1.10.9.0", + "source": { + "type": "git", + "url": "https://github.com/pear/pear-core-minimal.git", + "reference": "742be8dd68c746a01e4b0a422258e9c9cae1c37f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/742be8dd68c746a01e4b0a422258e9c9cae1c37f", + "reference": "742be8dd68c746a01e4b0a422258e9c9cae1c37f", + "shasum": "" + }, + "require": { + "pear/console_getopt": "~1.4", + "pear/pear_exception": "~1.0" + }, + "replace": { + "rsky/pear-core-min": "self.version" + }, + "time": "2019-03-13T18:15:44+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "src/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@php.net", + "role": "Lead" + } + ], + "description": "Minimal set of PEAR core files to be used as composer dependency" + }, + { + "name": "pear/pear_exception", + "version": "v1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/pear/PEAR_Exception.git", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b", + "shasum": "" + }, + "require": { + "php": ">=4.4.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "time": "2015-02-10T20:07:52+00:00", + "type": "class", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "PEAR": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "." + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Helgi Thormar", + "email": "dufuz@php.net" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net" + } + ], + "description": "The PEAR Exception base class.", + "homepage": "https://github.com/pear/PEAR_Exception", + "keywords": [ + "exception" + ] + }, + { "name": "phar-io/manifest", "version": "1.0.1", "version_normalized": "1.0.1.0", @@ -2713,17 +3030,17 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", - "version_normalized": "4.3.0.0", + "version": "4.3.1", + "version_normalized": "4.3.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", "shasum": "" }, "require": { @@ -2737,7 +3054,7 @@ "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.4" }, - "time": "2017-11-30T07:14:17+00:00", + "time": "2019-04-30T17:48:53+00:00", "type": "library", "extra": { "branch-alias": { @@ -4138,17 +4455,17 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.0", - "version_normalized": "3.4.0.0", + "version": "3.4.2", + "version_normalized": "3.4.2.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48" + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", "shasum": "" }, "require": { @@ -4160,7 +4477,7 @@ "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, - "time": "2018-12-19T23:57:18+00:00", + "time": "2019-04-10T23:49:02+00:00", "bin": [ "bin/phpcs", "bin/phpcbf" @@ -4183,7 +4500,7 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" @@ -4303,17 +4620,17 @@ }, { "name": "symfony/browser-kit", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "884689e5d29fc3c48498a0038e96d60e4f91b471" + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/884689e5d29fc3c48498a0038e96d60e4f91b471", - "reference": "884689e5d29fc3c48498a0038e96d60e4f91b471", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/7f2b0843d5045468225f9a9b27a0cb171ae81828", + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828", "shasum": "" }, "require": { @@ -4327,7 +4644,7 @@ "suggest": { "symfony/process": "" }, - "time": "2019-01-16T09:39:14+00:00", + "time": "2019-04-06T19:33:58+00:00", "type": "library", "extra": { "branch-alias": { @@ -4362,8 +4679,8 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", @@ -4420,17 +4737,17 @@ }, { "name": "symfony/console", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be" + "reference": "15a9104356436cb26e08adab97706654799d31d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/069bf3f0e8f871a2169a06e43d9f3f03f355e9be", - "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be", + "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8", + "reference": "15a9104356436cb26e08adab97706654799d31d8", "shasum": "" }, "require": { @@ -4459,7 +4776,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2019-01-25T10:42:12+00:00", + "time": "2019-04-08T09:29:13+00:00", "type": "library", "extra": { "branch-alias": { @@ -4494,8 +4811,8 @@ }, { "name": "symfony/css-selector", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -4549,17 +4866,17 @@ }, { "name": "symfony/debug", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8" + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", - "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", + "url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9", + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9", "shasum": "" }, "require": { @@ -4572,7 +4889,7 @@ "require-dev": { "symfony/http-kernel": "~2.8|~3.0|~4.0" }, - "time": "2019-01-25T10:19:25+00:00", + "time": "2019-04-11T09:48:14+00:00", "type": "library", "extra": { "branch-alias": { @@ -4607,17 +4924,17 @@ }, { "name": "symfony/dependency-injection", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1" + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1", - "reference": "b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0feb3fa202aedfd8d1956f2dafd563fb13acbf", + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf", "shasum": "" }, "require": { @@ -4645,7 +4962,7 @@ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, - "time": "2019-01-30T17:48:51+00:00", + "time": "2019-04-20T15:32:49+00:00", "type": "library", "extra": { "branch-alias": { @@ -4680,17 +4997,17 @@ }, { "name": "symfony/dom-crawler", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "32cb577c07bd900ee883a9d4b55d4098aa02e422" + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/32cb577c07bd900ee883a9d4b55d4098aa02e422", - "reference": "32cb577c07bd900ee883a9d4b55d4098aa02e422", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d40023c057393fb25f7ca80af2a56ed948c45a09", + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09", "shasum": "" }, "require": { @@ -4704,7 +5021,7 @@ "suggest": { "symfony/css-selector": "" }, - "time": "2019-01-16T13:27:11+00:00", + "time": "2019-02-23T15:06:07+00:00", "type": "library", "extra": { "branch-alias": { @@ -4739,17 +5056,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b" + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ed5be1663fa66623b3a7004d5d51a14c4045399b", - "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a088aafcefb4eef2520a290ed82e4374092a6dff", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff", "shasum": "" }, "require": { @@ -4769,7 +5086,7 @@ "symfony/dependency-injection": "", "symfony/http-kernel": "" }, - "time": "2019-01-16T13:27:11+00:00", + "time": "2019-04-02T08:51:52+00:00", "type": "library", "extra": { "branch-alias": { @@ -4804,23 +5121,23 @@ }, { "name": "symfony/finder", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7c0c627220308928e958a87c293108e5891cde1d" + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7c0c627220308928e958a87c293108e5891cde1d", - "reference": "7c0c627220308928e958a87c293108e5891cde1d", + "url": "https://api.github.com/repos/symfony/finder/zipball/61af5ce0b34b942d414fe8f1b11950d0e9a90e98", + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, - "time": "2019-01-16T13:43:35+00:00", + "time": "2019-04-02T19:54:57+00:00", "type": "library", "extra": { "branch-alias": { @@ -4855,17 +5172,17 @@ }, { "name": "symfony/http-foundation", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "9a81d2330ea255ded06a69b4f7fb7804836e7a05" + "reference": "fa02215233be8de1c2b44617088192f9e8db3512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9a81d2330ea255ded06a69b4f7fb7804836e7a05", - "reference": "9a81d2330ea255ded06a69b4f7fb7804836e7a05", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/fa02215233be8de1c2b44617088192f9e8db3512", + "reference": "fa02215233be8de1c2b44617088192f9e8db3512", "shasum": "" }, "require": { @@ -4876,7 +5193,7 @@ "require-dev": { "symfony/expression-language": "~2.8|~3.0|~4.0" }, - "time": "2019-01-27T09:04:14+00:00", + "time": "2019-05-01T08:04:33+00:00", "type": "library", "extra": { "branch-alias": { @@ -4911,17 +5228,17 @@ }, { "name": "symfony/http-kernel", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "dc6bf17684b7120f7bf74fae85c9155506041002" + "reference": "586046f5adc6a08eaebbe4519ef18ad52f54e453" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/dc6bf17684b7120f7bf74fae85c9155506041002", - "reference": "dc6bf17684b7120f7bf74fae85c9155506041002", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/586046f5adc6a08eaebbe4519ef18ad52f54e453", + "reference": "586046f5adc6a08eaebbe4519ef18ad52f54e453", "shasum": "" }, "require": { @@ -4967,7 +5284,7 @@ "symfony/finder": "", "symfony/var-dumper": "" }, - "time": "2019-02-03T12:22:50+00:00", + "time": "2019-05-01T13:03:24+00:00", "type": "library", "extra": { "branch-alias": { @@ -5002,17 +5319,17 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "6a2148bfc6ca0016846a32bdc55a317274283709" + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/6a2148bfc6ca0016846a32bdc55a317274283709", - "reference": "6a2148bfc6ca0016846a32bdc55a317274283709", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/a43a2f6c465a2d99635fea0addbebddc3864ad97", + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97", "shasum": "" }, "require": { @@ -5022,10 +5339,9 @@ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "suggest": { - "ext-zip": "Zip support is required when using bin/simple-phpunit", "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" }, - "time": "2019-01-30T13:30:37+00:00", + "time": "2019-04-16T09:03:16+00:00", "bin": [ "bin/simple-phpunit" ], @@ -5070,17 +5386,17 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.10.0", - "version_normalized": "1.10.0.0", + "version": "v1.11.0", + "version_normalized": "1.11.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "82ebae02209c21113908c229e9883c419720738a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", "shasum": "" }, "require": { @@ -5089,11 +5405,11 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2018-08-06T14:22:27+00:00", + "time": "2019-02-06T07:57:58+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "installation-source": "dist", @@ -5130,17 +5446,17 @@ }, { "name": "symfony/polyfill-iconv", - "version": "v1.10.0", - "version_normalized": "1.10.0.0", + "version": "v1.11.0", + "version_normalized": "1.11.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "97001cfc283484c9691769f51cdf25259037eba2" + "reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/97001cfc283484c9691769f51cdf25259037eba2", - "reference": "97001cfc283484c9691769f51cdf25259037eba2", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/f037ea22acfaee983e271dd9c3b8bb4150bd8ad7", + "reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7", "shasum": "" }, "require": { @@ -5149,11 +5465,11 @@ "suggest": { "ext-iconv": "For best performance" }, - "time": "2018-09-21T06:26:08+00:00", + "time": "2019-02-06T07:57:58+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "installation-source": "dist", @@ -5191,17 +5507,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", - "version_normalized": "1.10.0.0", + "version": "v1.11.0", + "version_normalized": "1.11.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", "shasum": "" }, "require": { @@ -5210,11 +5526,11 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2018-09-21T13:07:52+00:00", + "time": "2019-02-06T07:57:58+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "installation-source": "dist", @@ -5252,28 +5568,28 @@ }, { "name": "symfony/polyfill-php70", - "version": "v1.10.0", - "version_normalized": "1.10.0.0", + "version": "v1.11.0", + "version_normalized": "1.11.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" + "reference": "bc4858fb611bda58719124ca079baff854149c89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", - "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89", + "reference": "bc4858fb611bda58719124ca079baff854149c89", "shasum": "" }, "require": { "paragonie/random_compat": "~1.0|~2.0|~9.99", "php": ">=5.3.3" }, - "time": "2018-09-21T06:26:08+00:00", + "time": "2019-02-06T07:57:58+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "installation-source": "dist", @@ -5313,23 +5629,23 @@ }, { "name": "symfony/process", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "url": "https://api.github.com/repos/symfony/process/zipball/a9c4dfbf653023b668c282e4e02609d131f4057a", + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, - "time": "2019-01-16T13:27:11+00:00", + "time": "2019-04-08T16:15:54+00:00", "type": "library", "extra": { "branch-alias": { @@ -5364,17 +5680,17 @@ }, { "name": "symfony/psr-http-message-bridge", - "version": "v1.1.0", - "version_normalized": "1.1.0.0", + "version": "v1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "53c15a6a7918e6c2ab16ae370ea607fb40cab196" + "reference": "a33352af16f78a5ff4f9d90811536abf210df12b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/53c15a6a7918e6c2ab16ae370ea607fb40cab196", - "reference": "53c15a6a7918e6c2ab16ae370ea607fb40cab196", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/a33352af16f78a5ff4f9d90811536abf210df12b", + "reference": "a33352af16f78a5ff4f9d90811536abf210df12b", "shasum": "" }, "require": { @@ -5383,14 +5699,12 @@ "symfony/http-foundation": "^2.3.42 || ^3.4 || ^4.0" }, "require-dev": { - "symfony/phpunit-bridge": "^3.4 || 4.0" + "symfony/phpunit-bridge": "^3.4 || ^4.0" }, "suggest": { - "psr/http-factory-implementation": "To use the PSR-17 factory", - "psr/http-message-implementation": "To use the HttpFoundation factory", - "zendframework/zend-diactoros": "To use the Zend Diactoros factory" - }, - "time": "2018-08-30T16:28:28+00:00", + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" + }, + "time": "2019-04-03T17:09:40+00:00", "type": "symfony-bridge", "extra": { "branch-alias": { @@ -5401,7 +5715,10 @@ "autoload": { "psr-4": { "Symfony\\Bridge\\PsrHttpMessage\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5422,22 +5739,23 @@ "keywords": [ "http", "http-message", + "psr-17", "psr-7" ] }, { "name": "symfony/routing", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646" + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646", - "reference": "62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646", + "url": "https://api.github.com/repos/symfony/routing/zipball/ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", "shasum": "" }, "require": { @@ -5460,12 +5778,11 @@ "suggest": { "doctrine/annotations": "For using the annotation loader", "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", "symfony/expression-language": "For using expression matching", "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" }, - "time": "2019-01-29T08:47:12+00:00", + "time": "2019-03-29T21:58:42+00:00", "type": "library", "extra": { "branch-alias": { @@ -5506,17 +5823,17 @@ }, { "name": "symfony/serializer", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "a897373b86489ddecacc665d15ab32983a519907" + "reference": "99aceeb3e10852b951b9cab57a2b83062db09efb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/a897373b86489ddecacc665d15ab32983a519907", - "reference": "a897373b86489ddecacc665d15ab32983a519907", + "url": "https://api.github.com/repos/symfony/serializer/zipball/99aceeb3e10852b951b9cab57a2b83062db09efb", + "reference": "99aceeb3e10852b951b9cab57a2b83062db09efb", "shasum": "" }, "require": { @@ -5539,7 +5856,7 @@ "symfony/dependency-injection": "~3.2|~4.0", "symfony/http-foundation": "~2.8|~3.0|~4.0", "symfony/property-access": "~2.8|~3.0|~4.0", - "symfony/property-info": "~3.1|~4.0", + "symfony/property-info": "^3.4.13|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -5552,7 +5869,7 @@ "symfony/property-info": "To deserialize relations.", "symfony/yaml": "For using the default YAML mapping loader." }, - "time": "2019-01-26T19:55:54+00:00", + "time": "2019-04-27T21:20:35+00:00", "type": "library", "extra": { "branch-alias": { @@ -5587,17 +5904,17 @@ }, { "name": "symfony/translation", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "81cfcd6935cb7505640153576c1f9155b2a179c1" + "reference": "301a5d627220a1c4ee522813b0028653af6c4f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/81cfcd6935cb7505640153576c1f9155b2a179c1", - "reference": "81cfcd6935cb7505640153576c1f9155b2a179c1", + "url": "https://api.github.com/repos/symfony/translation/zipball/301a5d627220a1c4ee522813b0028653af6c4f54", + "reference": "301a5d627220a1c4ee522813b0028653af6c4f54", "shasum": "" }, "require": { @@ -5614,7 +5931,9 @@ "symfony/config": "~2.8|~3.0|~4.0", "symfony/dependency-injection": "~3.4|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/http-kernel": "~3.4|~4.0", "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/var-dumper": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -5622,7 +5941,7 @@ "symfony/config": "", "symfony/yaml": "" }, - "time": "2019-01-25T10:00:44+00:00", + "time": "2019-05-01T11:10:09+00:00", "type": "library", "extra": { "branch-alias": { @@ -5657,17 +5976,17 @@ }, { "name": "symfony/validator", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "06af494d8634df6ad9655ec7d80cb61983253912" + "reference": "cc3f577d8887737df4d77a4c0cc6e3c22164cea4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/06af494d8634df6ad9655ec7d80cb61983253912", - "reference": "06af494d8634df6ad9655ec7d80cb61983253912", + "url": "https://api.github.com/repos/symfony/validator/zipball/cc3f577d8887737df4d77a4c0cc6e3c22164cea4", + "reference": "cc3f577d8887737df4d77a4c0cc6e3c22164cea4", "shasum": "" }, "require": { @@ -5709,7 +6028,7 @@ "symfony/property-access": "For accessing properties within comparison constraints", "symfony/yaml": "" }, - "time": "2019-01-30T09:03:33+00:00", + "time": "2019-04-29T08:34:27+00:00", "type": "library", "extra": { "branch-alias": { @@ -5744,17 +6063,17 @@ }, { "name": "symfony/var-dumper", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2159335b452d929cbb9921fc4eb7d1bfed32d0be" + "reference": "ca5fef348a0440411bbca0f9ec14e9a11625bd6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2159335b452d929cbb9921fc4eb7d1bfed32d0be", - "reference": "2159335b452d929cbb9921fc4eb7d1bfed32d0be", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ca5fef348a0440411bbca0f9ec14e9a11625bd6a", + "reference": "ca5fef348a0440411bbca0f9ec14e9a11625bd6a", "shasum": "" }, "require": { @@ -5773,7 +6092,7 @@ "ext-intl": "To show region name in time zone dump", "ext-symfony_debug": "" }, - "time": "2019-01-29T16:19:17+00:00", + "time": "2019-05-01T09:52:10+00:00", "type": "library", "extra": { "branch-alias": { @@ -5815,17 +6134,17 @@ }, { "name": "symfony/yaml", - "version": "v3.4.22", - "version_normalized": "3.4.22.0", + "version": "v3.4.27", + "version_normalized": "3.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d" + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", "shasum": "" }, "require": { @@ -5841,7 +6160,7 @@ "suggest": { "symfony/console": "For validating YAML files using the lint command" }, - "time": "2019-01-16T10:59:17+00:00", + "time": "2019-03-25T07:48:46+00:00", "type": "library", "extra": { "branch-alias": { @@ -5876,17 +6195,17 @@ }, { "name": "theseer/tokenizer", - "version": "1.1.0", - "version_normalized": "1.1.0.0", + "version": "1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8", "shasum": "" }, "require": { @@ -5895,7 +6214,7 @@ "ext-xmlwriter": "*", "php": "^7.0" }, - "time": "2017-04-07T12:08:54+00:00", + "time": "2019-04-04T09:56:43+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5918,17 +6237,17 @@ }, { "name": "twig/twig", - "version": "v1.37.1", - "version_normalized": "1.37.1.0", + "version": "v1.40.1", + "version_normalized": "1.40.1.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62" + "reference": "35889516bbd6bbe46a600c2c33b03515df4a076e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/66be9366c76cbf23e82e7171d47cbfa54a057a62", - "reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/35889516bbd6bbe46a600c2c33b03515df4a076e", + "reference": "35889516bbd6bbe46a600c2c33b03515df4a076e", "shasum": "" }, "require": { @@ -5940,11 +6259,11 @@ "symfony/debug": "^2.7", "symfony/phpunit-bridge": "^3.4.19|^4.1.8" }, - "time": "2019-01-14T14:59:29+00:00", + "time": "2019-04-29T14:12:28+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.37-dev" + "dev-master": "1.40-dev" } }, "installation-source": "dist", @@ -5986,26 +6305,30 @@ }, { "name": "typo3/phar-stream-wrapper", - "version": "v2.0.1", - "version_normalized": "2.0.1.0", + "version": "v2.1.1", + "version_normalized": "2.1.1.0", "source": { "type": "git", "url": "https://github.com/TYPO3/phar-stream-wrapper.git", - "reference": "0469d9fefa0146ea4299d3b11cfbb76faa7045bf" + "reference": "e438b0c78652b33407983eb29d215a1a3f68f6f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TYPO3/phar-stream-wrapper/zipball/0469d9fefa0146ea4299d3b11cfbb76faa7045bf", - "reference": "0469d9fefa0146ea4299d3b11cfbb76faa7045bf", + "url": "https://api.github.com/repos/TYPO3/phar-stream-wrapper/zipball/e438b0c78652b33407983eb29d215a1a3f68f6f3", + "reference": "e438b0c78652b33407983eb29d215a1a3f68f6f3", "shasum": "" }, "require": { + "brumann/polyfill-unserialize": "^1.0", + "ext-fileinfo": "*", + "ext-json": "*", "php": "^5.3.3|^7.0" }, "require-dev": { + "ext-xdebug": "*", "phpunit/phpunit": "^4.8.36" }, - "time": "2018-10-18T08:46:28+00:00", + "time": "2019-05-05T17:30:51+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6027,6 +6350,45 @@ ] }, { + "name": "webflo/drupal-finder", + "version": "1.1.0", + "version_normalized": "1.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-finder.git", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/8a7886c575d6eaa67a425dceccc84e735c0b9637", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637", + "shasum": "" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^4.8" + }, + "time": "2017-10-24T08:12:11+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/DrupalFinder.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Florian Weber", + "email": "florian@webflo.org" + } + ], + "description": "Helper class to locate a Drupal installation from a given path." + }, + { "name": "webmozart/assert", "version": "1.4.0", "version_normalized": "1.4.0.0", @@ -6293,17 +6655,17 @@ }, { "name": "zendframework/zend-feed", - "version": "2.11.0", - "version_normalized": "2.11.0.0", + "version": "2.12.0", + "version_normalized": "2.12.0.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-feed.git", - "reference": "5248e9fffa760e5c36092aeff02c3797e4a8a690" + "reference": "d926c5af34b93a0121d5e2641af34ddb1533d733" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/5248e9fffa760e5c36092aeff02c3797e4a8a690", - "reference": "5248e9fffa760e5c36092aeff02c3797e4a8a690", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/d926c5af34b93a0121d5e2641af34ddb1533d733", + "reference": "d926c5af34b93a0121d5e2641af34ddb1533d733", "shasum": "" }, "require": { @@ -6331,12 +6693,12 @@ "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for easily extending ExtensionManager implementations", "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries when using the Writer subcomponent" }, - "time": "2019-01-29T21:37:15+00:00", + "time": "2019-03-05T20:08:49+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" + "dev-master": "2.12.x-dev", + "dev-develop": "2.13.x-dev" } }, "installation-source": "dist", diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/semver/CHANGELOG.md --- a/vendor/composer/semver/CHANGELOG.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/semver/CHANGELOG.md Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +### [1.5.0] 2019-03-19 + + * Added: some support for date versions (e.g. 201903) in `~` operator + * Fixed: support for stabilities in `~` operator was inconsistent + ### [1.4.2] 2016-08-30 * Fixed: collapsing of complex constraints lead to buggy constraints @@ -57,6 +62,7 @@ - Namespace: `Composer\Test\Package\LinkConstraint` -> `Composer\Test\Semver\Constraint` * Changed: code style using php-cs-fixer. +[1.4.2]: https://github.com/composer/semver/compare/1.4.1...1.4.2 [1.4.1]: https://github.com/composer/semver/compare/1.4.0...1.4.1 [1.4.0]: https://github.com/composer/semver/compare/1.3.0...1.4.0 [1.3.0]: https://github.com/composer/semver/compare/1.2.0...1.3.0 diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/semver/src/Constraint/AbstractConstraint.php --- a/vendor/composer/semver/src/Constraint/AbstractConstraint.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/semver/src/Constraint/AbstractConstraint.php Thu May 09 15:33:08 2019 +0100 @@ -11,7 +11,7 @@ namespace Composer\Semver\Constraint; -trigger_error('The ' . __CLASS__ . ' abstract class is deprecated, there is no replacement for it, it will be removed in the next major version.', E_USER_DEPRECATED); +trigger_error('The ' . __NAMESPACE__ . '\AbstractConstraint abstract class is deprecated, there is no replacement for it, it will be removed in the next major version.', E_USER_DEPRECATED); /** * Base constraint class. diff -r 129ea1e6d783 -r af1871eacc83 vendor/composer/semver/src/VersionParser.php --- a/vendor/composer/semver/src/VersionParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/composer/semver/src/VersionParser.php Thu May 09 15:33:08 2019 +0100 @@ -322,11 +322,11 @@ } // Work out which position in the version we are operating at - if (isset($matches[4]) && '' !== $matches[4]) { + if (isset($matches[4]) && '' !== $matches[4] && null !== $matches[4]) { $position = 4; - } elseif (isset($matches[3]) && '' !== $matches[3]) { + } elseif (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) { $position = 3; - } elseif (isset($matches[2]) && '' !== $matches[2]) { + } elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) { $position = 2; } else { $position = 1; @@ -334,19 +334,11 @@ // Calculate the stability suffix $stabilitySuffix = ''; - if (!empty($matches[5])) { - $stabilitySuffix .= '-' . $this->expandStability($matches[5]) . (!empty($matches[6]) ? $matches[6] : ''); - } - - if (!empty($matches[7])) { + if (empty($matches[5]) && empty($matches[7])) { $stabilitySuffix .= '-dev'; } - if (!$stabilitySuffix) { - $stabilitySuffix = '-dev'; - } - - $lowVersion = $this->manipulateVersionString($matches, $position, 0) . $stabilitySuffix; + $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1)); $lowerBound = new Constraint('>=', $lowVersion); // For upper bound, we increment the position of one more significance, @@ -368,9 +360,9 @@ // versions 0.X >=0.1.0, and no updates for versions 0.0.X if (preg_match('{^\^' . $versionRegex . '($)}i', $constraint, $matches)) { // Work out which position in the version we are operating at - if ('0' !== $matches[1] || '' === $matches[2]) { + if ('0' !== $matches[1] || '' === $matches[2] || null === $matches[2]) { $position = 1; - } elseif ('0' !== $matches[2] || '' === $matches[3]) { + } elseif ('0' !== $matches[2] || '' === $matches[3] || null === $matches[3]) { $position = 2; } else { $position = 3; @@ -401,9 +393,9 @@ // Any of X, x, or * may be used to "stand in" for one of the numeric values in the [major, minor, patch] tuple. // A partial version range is treated as an X-Range, so the special character is in fact optional. if (preg_match('{^v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.[xX*])++$}', $constraint, $matches)) { - if (isset($matches[3]) && '' !== $matches[3]) { + if (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) { $position = 3; - } elseif (isset($matches[2]) && '' !== $matches[2]) { + } elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) { $position = 2; } else { $position = 1; diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/annotated-command/CHANGELOG.md --- a/vendor/consolidation/annotated-command/CHANGELOG.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/consolidation/annotated-command/CHANGELOG.md Thu May 09 15:33:08 2019 +0100 @@ -1,5 +1,9 @@ # Change Log +### 2.12.0 - 8 Mar 2019 + +- Allow annotated args and options to specify their default values in their descriptions. (#186) + ### 2.11.2 - 1 Feb 2019 - Fix handling of old caches from 2.11.1 that introduced upgrade errors. diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/annotated-command/src/Parser/Internal/BespokeDocBlockParser.php --- a/vendor/consolidation/annotated-command/src/Parser/Internal/BespokeDocBlockParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/consolidation/annotated-command/src/Parser/Internal/BespokeDocBlockParser.php Thu May 09 15:33:08 2019 +0100 @@ -137,7 +137,20 @@ { $variableName = $this->commandInfo->findMatchingOption($name); $description = static::removeLineBreaks($description); + list($description, $defaultValue) = $this->splitOutDefault($description); $set->add($variableName, $description); + if ($defaultValue !== null) { + $set->setDefaultValue($variableName, $defaultValue); + } + } + + protected function splitOutDefault($description) + { + if (!preg_match('#(.*)(Default: *)(.*)#', trim($description), $matches)) { + return [$description, null]; + } + + return [trim($matches[1]), $this->interpretDefaultValue(trim($matches[3]))]; } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/install --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/install Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,57 @@ +#!/bin/bash + +SCENARIO=$1 +DEPENDENCIES=${2-install} + +# Convert the aliases 'highest', 'lowest' and 'lock' to +# the corresponding composer command to run. +case $DEPENDENCIES in + highest) + DEPENDENCIES=update + ;; + lowest) + DEPENDENCIES='update --prefer-lowest' + ;; + lock|default|"") + DEPENDENCIES=install + ;; +esac + +original_name=scenarios +recommended_name=".scenarios.lock" + +base="$original_name" +if [ -d "$recommended_name" ] ; then + base="$recommended_name" +fi + +# If scenario is not specified, install the lockfile at +# the root of the project. +dir="$base/${SCENARIO}" +if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then + SCENARIO=default + dir=. +fi + +# Test to make sure that the selected scenario exists. +if [ ! -d "$dir" ] ; then + echo "Requested scenario '${SCENARIO}' does not exist." + exit 1 +fi + +echo +echo "::" +echo ":: Switch to ${SCENARIO} scenario" +echo "::" +echo + +set -ex + +composer -n validate --working-dir=$dir --no-check-all --ansi +composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/symfony2/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/symfony2/.gitignore Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ +vendor +composer.lock \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/symfony2/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/symfony2/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,65 @@ +{ + "name": "consolidation/output-formatters", + "description": "Format text by applying transformations provided by plug-in formatters.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "../../tests/src" + } + }, + "require": { + "symfony/console": "^2.8", + "php": ">=5.4.0", + "dflydev/dot-access-data": "^1.1.0", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36", + "g1a/composer-test-scenarios": "^3", + "squizlabs/php_codesniffer": "^2.7", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "config": { + "platform": { + "php": "5.4.8" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "scripts": { + "api": "phpdoc-md generate src > docs/api.md", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/symfony3/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/symfony3/.gitignore Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +vendor \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/symfony3/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/symfony3/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,67 @@ +{ + "name": "consolidation/output-formatters", + "description": "Format text by applying transformations provided by plug-in formatters.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "../../tests/src" + } + }, + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4", + "php": ">=5.4.0", + "dflydev/dot-access-data": "^1.1.0" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "phpunit/phpunit": "^5.7.27", + "squizlabs/php_codesniffer": "^2.7", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "config": { + "platform": { + "php": "5.6.32" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "scripts": { + "api": "phpdoc-md generate src > docs/api.md", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/symfony3/composer.lock --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/symfony3/composer.lock Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2364 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "b93f5c37dbac1262cf9e9a1170b9e3ad", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-10-03T08:46:40+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "ff8ac19e97e5c7c3979236b584719a1190f84181" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ff8ac19e97e5c7c3979236b584719a1190f84181", + "reference": "ff8ac19e97e5c7c3979236b584719a1190f84181", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, + "require-dev": { + "ext-iconv": "*", + "twig/twig": "~1.34|~2.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "ext-symfony_debug": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2018-10-02T16:33:53+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-22T05:10:20+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.9.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" + }, + "suggest": { + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.9-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-10T14:09:06+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-11-19T08:54:04+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/76494bc38ff38d90d01913d23b5271acd4d78dd3", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-20T23:16:31+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "victorjonsson/markdowndocs", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator.git", + "reference": "c5eb16ff5bd15ee60223883ddacba0ab8797268d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/victorjonsson/PHP-Markdown-Documentation-Generator/zipball/c5eb16ff5bd15ee60223883ddacba0ab8797268d", + "reference": "c5eb16ff5bd15ee60223883ddacba0ab8797268d", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": ">=2.6" + }, + "require-dev": { + "phpunit/phpunit": "3.7.23" + }, + "bin": [ + "bin/phpdoc-md" + ], + "type": "library", + "autoload": { + "psr-0": { + "PHPDocsMD": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Victor Jonsson", + "email": "kontakt@victorjonsson.se" + } + ], + "description": "Command line tool for generating markdown-formatted class documentation", + "homepage": "https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator", + "time": "2017-04-20T09:52:47+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.6.32" + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/symfony4/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/symfony4/.gitignore Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +vendor \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/symfony4/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/symfony4/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,66 @@ +{ + "name": "consolidation/output-formatters", + "description": "Format text by applying transformations provided by plug-in formatters.", + "license": "MIT", + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "../../src" + } + }, + "autoload-dev": { + "psr-4": { + "Consolidation\\TestUtils\\": "../../tests/src" + } + }, + "require": { + "symfony/console": "^4.0", + "php": ">=5.4.0", + "dflydev/dot-access-data": "^1.1.0", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "phpunit/phpunit": "^6", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", + "squizlabs/php_codesniffer": "^2.7", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "config": { + "platform": { + "php": "7.1.3" + }, + "optimize-autoloader": true, + "sort-packages": true, + "vendor-dir": "../../vendor" + }, + "scripts": { + "api": "phpdoc-md generate src > docs/api.md", + "cs": "phpcs --standard=PSR2 -n src", + "cbf": "phpcbf --standard=PSR2 -n src", + "unit": "phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/.scenarios.lock/symfony4/composer.lock --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/.scenarios.lock/symfony4/composer.lock Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2566 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "8be5eb98a4ffa6ddd6a6c8f27bf99e5a", + "packages": [ + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "symfony/console", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:30:44+00:00" + }, + { + "name": "symfony/finder", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "1f17195b44543017a9c9b2d437c670627e96ad06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/1f17195b44543017a9c9b2d437c670627e96ad06", + "reference": "1f17195b44543017a9c9b2d437c670627e96ad06", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-10-03T08:47:56+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "g1a/composer-test-scenarios", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/g1a/composer-test-scenarios.git", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "bin": [ + "scripts/dependency-licenses" + ], + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Useful scripts for testing multiple sets of Composer dependencies.", + "time": "2018-11-22T05:10:20+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.9.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" + }, + "suggest": { + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.9-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2018-04-06T15:36:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.13", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-09-08T15:10:43+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-11-07T22:31:41+00:00" + }, + { + "name": "symfony/config", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:09:42+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/76494bc38ff38d90d01913d23b5271acd4d78dd3", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-20T23:16:31+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T13:18:25+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9050816e2ca34a8e916c3a0ae8b9c2fccf68b631", + "reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "5bfc064125b73ff81229e19381ce1c34d3416f4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5bfc064125b73ff81229e19381ce1c34d3416f4b", + "reference": "5bfc064125b73ff81229e19381ce1c34d3416f4b", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:40:59+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "60319b45653580b0cdacca499344577d87732f16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/60319b45653580b0cdacca499344577d87732f16", + "reference": "60319b45653580b0cdacca499344577d87732f16", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/process": "~3.4|~4.0", + "twig/twig": "~1.34|~2.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2018-10-02T16:36:10+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:36:10+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "victorjonsson/markdowndocs", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator.git", + "reference": "c5eb16ff5bd15ee60223883ddacba0ab8797268d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/victorjonsson/PHP-Markdown-Documentation-Generator/zipball/c5eb16ff5bd15ee60223883ddacba0ab8797268d", + "reference": "c5eb16ff5bd15ee60223883ddacba0ab8797268d", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": ">=2.6" + }, + "require-dev": { + "phpunit/phpunit": "3.7.23" + }, + "bin": [ + "bin/phpdoc-md" + ], + "type": "library", + "autoload": { + "psr-0": { + "PHPDocsMD": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Victor Jonsson", + "email": "kontakt@victorjonsson.se" + } + ], + "description": "Command line tool for generating markdown-formatted class documentation", + "homepage": "https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator", + "time": "2017-04-20T09:52:47+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.1.3" + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/CHANGELOG.md --- a/vendor/consolidation/output-formatters/CHANGELOG.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/consolidation/output-formatters/CHANGELOG.md Thu May 09 15:33:08 2019 +0100 @@ -1,5 +1,9 @@ # Change Log +### 3.4.1 - 13 March 2019 + +- Add enclosure and escape character options for CsvFormatter. (#79) + ### 3.4.0 - 19 October 2018 - Add an UnstucturedInterface marker interface, and update the 'string' format to not accept data types that implement this interface unless they also implement StringTransformationInterface. diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/LICENSE --- a/vendor/consolidation/output-formatters/LICENSE Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/consolidation/output-formatters/LICENSE Thu May 09 15:33:08 2019 +0100 @@ -9,10 +9,10 @@ DEPENDENCY LICENSES: -Name Version License -dflydev/dot-access-data v1.1.0 MIT -psr/log 1.0.2 MIT -symfony/console v3.2.3 MIT -symfony/debug v3.4.17 MIT -symfony/finder v3.4.17 MIT -symfony/polyfill-mbstring v1.9.0 MIT +Name Version License +dflydev/dot-access-data v1.1.0 MIT +psr/log 1.1.0 MIT +symfony/console v3.4.18 MIT +symfony/debug v3.4.18 MIT +symfony/finder v3.4.18 MIT +symfony/polyfill-mbstring v1.10.0 MIT \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/composer.json --- a/vendor/consolidation/output-formatters/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/consolidation/output-formatters/composer.json Thu May 09 15:33:08 2019 +0100 @@ -25,11 +25,10 @@ "symfony/finder": "^2.5|^3|^4" }, "require-dev": { - "g1a/composer-test-scenarios": "^2", - "satooshi/php-coveralls": "^2", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", "phpunit/phpunit": "^5.7.27", "squizlabs/php_codesniffer": "^2.7", - "symfony/console": "3.2.3", "symfony/var-dumper": "^2.8|^3|^4", "victorjonsson/markdowndocs": "^1.3" }, @@ -56,16 +55,55 @@ "@lint", "@unit", "@cs" - ], - "scenario": "scenarios/install", - "post-update-cmd": [ - "create-scenario symfony4 'symfony/console:^4.0' 'phpunit/phpunit:^6' --platform-php '7.1.3'", - "create-scenario symfony3 'symfony/console:^3.4' 'symfony/finder:^3.4' 'symfony/var-dumper:^3.4' --platform-php '5.6.32'", - "create-scenario symfony2 'symfony/console:^2.8' 'phpunit/phpunit:^4.8.36' --remove 'satooshi/php-coveralls' --platform-php '5.4' --no-lockfile", - "dependency-licenses" ] }, "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony3": { + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "config": { + "platform": { + "php": "5.6.32" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, "branch-alias": { "dev-master": "3.x-dev" } diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/composer.lock --- a/vendor/consolidation/output-formatters/composer.lock Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/consolidation/output-formatters/composer.lock Thu May 09 15:33:08 2019 +0100 @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5232f66b194c337084b00c3d828a8e62", + "content-hash": "ee70f32509f8c43ebd69a87705e29cad", "packages": [ { "name": "dflydev/dot-access-data", @@ -67,16 +67,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -110,43 +110,49 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "symfony/console", - "version": "v3.2.3", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936" + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7a8405a9fc175f87fed8a3c40856b0d866d61936", - "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/debug": "~2.8|~3.0", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", - "symfony/filesystem": "", + "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -173,20 +179,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-02-06T12:04:21+00:00" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/debug", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", "shasum": "" }, "require": { @@ -229,11 +235,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/finder", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -282,16 +288,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -337,7 +343,7 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" } ], "packages-dev": [ @@ -397,24 +403,43 @@ }, { "name": "g1a/composer-test-scenarios", - "version": "2.2.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/g1a/composer-test-scenarios.git", - "reference": "a166fd15191aceab89f30c097e694b7cf3db4880" + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/a166fd15191aceab89f30c097e694b7cf3db4880", - "reference": "a166fd15191aceab89f30c097e694b7cf3db4880", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", + "reference": "2a7156f1572898888ea50ad1d48a6b4d3f9fbf78", "shasum": "" }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": ">=5.4" + }, + "require-dev": { + "composer/composer": "^1.7", + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8.36|^6", + "squizlabs/php_codesniffer": "^2.8" + }, "bin": [ - "scripts/create-scenario", - "scripts/dependency-licenses", - "scripts/install-scenario" + "scripts/dependency-licenses" ], - "type": "library", + "type": "composer-plugin", + "extra": { + "class": "ComposerTestScenarios\\Plugin", + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerTestScenarios\\": "src/" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -426,47 +451,73 @@ } ], "description": "Useful scripts for testing multiple sets of Composer dependencies.", - "time": "2018-08-08T23:37:23+00:00" + "time": "2018-11-22T05:10:20+00:00" }, { - "name": "guzzlehttp/guzzle", - "version": "6.3.3", + "name": "guzzle/guzzle", + "version": "v3.9.3", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", "shasum": "" }, "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" }, "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" }, "suggest": { - "psr/log": "Required for using the Log middleware" + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.3-dev" + "dev-master": "3.9-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -478,136 +529,25 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2018-04-22T15:46:56+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" }, { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" } ], - "description": "PSR-7 message implementation that also provides common utility methods", + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", + "homepage": "http://guzzlephp.org/", "keywords": [ + "client", + "curl", + "framework", "http", - "message", - "request", - "response", - "stream", - "uri", - "url" + "http client", + "rest", + "web service" ], - "time": "2017-03-20T17:10:46+00:00" + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" }, { "name": "myclabs/deep-copy", @@ -655,6 +595,67 @@ "time": "2017-10-19T19:58:43+00:00" }, { + "name": "php-coveralls/php-coveralls", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "reference": "37f8f83fe22224eb9d9c6d593cdeb33eedd2a9ad", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8 || ^3.0", + "php": "^5.3.3 || ^7.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2017-12-06T23:17:56+00:00" + }, + { "name": "phpdocumentor/reflection-common", "version": "1.0.1", "source": { @@ -1254,140 +1255,6 @@ "time": "2017-06-30T09:13:00+00:00" }, { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "satooshi/php-coveralls", - "version": "v2.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-coveralls/php-coveralls.git", - "reference": "3eaf7eb689cdf6b86801a3843940d974dc657068" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/3eaf7eb689cdf6b86801a3843940d974dc657068", - "reference": "3eaf7eb689cdf6b86801a3843940d974dc657068", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzlehttp/guzzle": "^6.0", - "php": "^5.5 || ^7.0", - "psr/log": "^1.0", - "symfony/config": "^2.1 || ^3.0 || ^4.0", - "symfony/console": "^2.1 || ^3.0 || ^4.0", - "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", - "symfony/yaml": "^2.0 || ^3.0 || ^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" - }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" - }, - "bin": [ - "bin/php-coveralls" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpCoveralls\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp", - "role": "Original creator" - }, - { - "name": "Takashi Matsuo", - "email": "tmatsuo@google.com" - }, - { - "name": "Google Inc" - }, - { - "name": "Dariusz Ruminski", - "email": "dariusz.ruminski@gmail.com", - "homepage": "https://github.com/keradus" - }, - { - "name": "Contributors", - "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/php-coveralls/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "abandoned": "php-coveralls/php-coveralls", - "time": "2017-12-08T14:28:16+00:00" - }, - { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", "source": { @@ -1902,16 +1769,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", "shasum": "" }, "require": { @@ -1976,20 +1843,20 @@ "phpcs", "standards" ], - "time": "2017-05-22T02:43:20+00:00" + "time": "2018-11-07T22:31:41+00:00" }, { "name": "symfony/config", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e5389132dc6320682de3643091121c048ff796b3" + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", - "reference": "e5389132dc6320682de3643091121c048ff796b3", + "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", "shasum": "" }, "require": { @@ -2040,11 +1907,71 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-09-08T13:15:14+00:00" + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/76494bc38ff38d90d01913d23b5271acd4d78dd3", + "reference": "76494bc38ff38d90d01913d23b5271acd4d78dd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-20T23:16:31+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -2094,7 +2021,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2152,7 +2079,7 @@ }, { "name": "symfony/stopwatch", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -2201,7 +2128,7 @@ }, { "name": "symfony/var-dumper", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", @@ -2270,23 +2197,27 @@ }, { "name": "symfony/yaml", - "version": "v3.3.18", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "af615970e265543a26ee712c958404eb9b7ac93d" + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/af615970e265543a26ee712c958404eb9b7ac93d", - "reference": "af615970e265543a26ee712c958404eb9b7ac93d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -2294,7 +2225,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2321,7 +2252,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-20T15:04:53+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "victorjonsson/markdowndocs", diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/src/Formatters/CsvFormatter.php --- a/vendor/consolidation/output-formatters/src/Formatters/CsvFormatter.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/consolidation/output-formatters/src/Formatters/CsvFormatter.php Thu May 09 15:33:08 2019 +0100 @@ -66,6 +66,8 @@ return [ FormatterOptions::INCLUDE_FIELD_LABELS => true, FormatterOptions::DELIMITER => ',', + FormatterOptions::CSV_ENCLOSURE => '"', + FormatterOptions::CSV_ESCAPE_CHAR => "\\", ]; } @@ -87,18 +89,40 @@ } } + /** + * Writes a single a single line of formatted CSV data to the output stream. + * + * @param OutputInterface $output the output stream to write to. + * @param array $data an array of field data to convert to a CSV string. + * @param FormatterOptions $options the specified options for this formatter. + */ protected function writeOneLine(OutputInterface $output, $data, $options) { $defaults = $this->getDefaultFormatterOptions(); $delimiter = $options->get(FormatterOptions::DELIMITER, $defaults); - - $output->write($this->csvEscape($data, $delimiter)); + $enclosure = $options->get(FormatterOptions::CSV_ENCLOSURE, $defaults); + $escapeChar = $options->get(FormatterOptions::CSV_ESCAPE_CHAR, $defaults); + $output->write($this->csvEscape($data, $delimiter, $enclosure, $escapeChar)); } - protected function csvEscape($data, $delimiter = ',') + /** + * Generates a CSV-escaped string from an array of field data. + * + * @param array $data an array of field data to format as a CSV. + * @param string $delimiter the delimiter to use between fields. + * @param string $enclosure character to use when enclosing complex fields. + * @param string $escapeChar character to use when escaping special characters. + * + * @return string|bool the formatted CSV string, or FALSE if the formatting failed. + */ + protected function csvEscape($data, $delimiter = ',', $enclosure = '"', $escapeChar = "\\") { $buffer = fopen('php://temp', 'r+'); - fputcsv($buffer, $data, $delimiter); + if (version_compare(PHP_VERSION, '5.5.4', '>=')) { + fputcsv($buffer, $data, $delimiter, $enclosure, $escapeChar); + } else { + fputcsv($buffer, $data, $delimiter, $enclosure); + } rewind($buffer); $csv = fgets($buffer); fclose($buffer); diff -r 129ea1e6d783 -r af1871eacc83 vendor/consolidation/output-formatters/src/Options/FormatterOptions.php --- a/vendor/consolidation/output-formatters/src/Options/FormatterOptions.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/consolidation/output-formatters/src/Options/FormatterOptions.php Thu May 09 15:33:08 2019 +0100 @@ -46,6 +46,8 @@ const DEFAULT_FIELDS = 'default-fields'; const DEFAULT_STRING_FIELD = 'default-string-field'; const DELIMITER = 'delimiter'; + const CSV_ENCLOSURE = 'csv-enclosure'; + const CSV_ESCAPE_CHAR = 'csv-escape-char'; const LIST_DELIMITER = 'list-delimiter'; const TERMINAL_WIDTH = 'width'; const METADATA_TEMPLATE = 'metadata-template'; @@ -90,6 +92,16 @@ return $this->setConfigurationValue(self::DELIMITER, $delimiter); } + public function setCsvEnclosure($enclosure) + { + return $this->setConfigurationValue(self::CSV_ENCLOSURE, $enclosure); + } + + public function setCsvEscapeChar($escapeChar) + { + return $this->setConfigurationValue(self::CSV_ESCAPE_CHAR, $escapeChar); + } + public function setListDelimiter($listDelimiter) { return $this->setConfigurationValue(self::LIST_DELIMITER, $listDelimiter); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/FETCH_HEAD --- a/vendor/drupal/coder/.git/FETCH_HEAD Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.git/FETCH_HEAD Thu May 09 15:33:08 2019 +0100 @@ -6,8 +6,8 @@ daea5229680e2a36eb2c9ee3e998c91c4bc7522b not-for-merge branch '6.x-2.x' of https://git.drupal.org/project/coder e1853f50aff0b0365798cc9c5290eb30b1d4a865 not-for-merge branch '7.x-1.x' of https://git.drupal.org/project/coder 46fe6f6171df7f4505f502f3439b1be87f820375 not-for-merge branch '7.x-2.x' of https://git.drupal.org/project/coder -fd3321a777a645dd683a8c6ecf4978012357717b not-for-merge branch '8.x-2.x' of https://git.drupal.org/project/coder -29a25627e7148b3119c84f18e087fc3b8c85b959 not-for-merge branch '8.x-3.x' of https://git.drupal.org/project/coder +303046e238bd5dde6e5d26dfaefeb779af85e39a not-for-merge branch '8.x-2.x' of https://git.drupal.org/project/coder +c85aae11366cae4e15a1c5b8410c5e41f8994537 not-for-merge branch '8.x-3.x' of https://git.drupal.org/project/coder aa232f3b37276e8d3fd10ab4601be0b18d6890c1 not-for-merge tag '4.7.x-1.0' of https://git.drupal.org/project/coder 1492f697b1671727e749efe6016dd6af94f51c15 not-for-merge tag '4.7.x-1.1' of https://git.drupal.org/project/coder 0d6028e96213ab9c20b3025e9f5177ec54115469 not-for-merge tag '4.7.x-1.2' of https://git.drupal.org/project/coder @@ -69,6 +69,8 @@ b08682bd939cf7d3ac7034bee792aa17f80e19d7 not-for-merge tag '8.2.9' of https://git.drupal.org/project/coder fd3321a777a645dd683a8c6ecf4978012357717b not-for-merge tag '8.3.0' of https://git.drupal.org/project/coder 29a25627e7148b3119c84f18e087fc3b8c85b959 not-for-merge tag '8.3.1' of https://git.drupal.org/project/coder +44c80c21074df43572652f35bec4f184f9eae5e7 not-for-merge tag '8.3.2' of https://git.drupal.org/project/coder +a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43 not-for-merge tag '8.3.3' of https://git.drupal.org/project/coder 1b8024a0c18255e7dc0a6b3ab8a8ee4cc721ba79 not-for-merge tag '8.x-2.0' of https://git.drupal.org/project/coder 6c1bca66bea25e80a56f29840f6bf41da99b1fe6 not-for-merge tag '8.x-2.0-alpha1' of https://git.drupal.org/project/coder 216f92007f41fb260c75d5a422b7f91186ea9708 not-for-merge tag '8.x-2.0-alpha2' of https://git.drupal.org/project/coder @@ -88,3 +90,5 @@ b08682bd939cf7d3ac7034bee792aa17f80e19d7 not-for-merge tag '8.x-2.9' of https://git.drupal.org/project/coder fd3321a777a645dd683a8c6ecf4978012357717b not-for-merge tag '8.x-3.0' of https://git.drupal.org/project/coder 29a25627e7148b3119c84f18e087fc3b8c85b959 not-for-merge tag '8.x-3.1' of https://git.drupal.org/project/coder +44c80c21074df43572652f35bec4f184f9eae5e7 not-for-merge tag '8.x-3.2' of https://git.drupal.org/project/coder +a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43 not-for-merge tag '8.x-3.3' of https://git.drupal.org/project/coder diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/HEAD --- a/vendor/drupal/coder/.git/HEAD Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.git/HEAD Thu May 09 15:33:08 2019 +0100 @@ -1,1 +1,1 @@ -29a25627e7148b3119c84f18e087fc3b8c85b959 +a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/ORIG_HEAD --- a/vendor/drupal/coder/.git/ORIG_HEAD Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.git/ORIG_HEAD Thu May 09 15:33:08 2019 +0100 @@ -1,1 +1,1 @@ -29a25627e7148b3119c84f18e087fc3b8c85b959 +a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/index Binary file vendor/drupal/coder/.git/index has changed diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/logs/HEAD --- a/vendor/drupal/coder/.git/logs/HEAD Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.git/logs/HEAD Thu May 09 15:33:08 2019 +0100 @@ -1,3 +1,4 @@ 0000000000000000000000000000000000000000 f8b0214e6fe30f19d78e9e059d1581baffddfc41 drupal 1524472998 +0100 clone: from https://git.drupal.org/project/coder.git f8b0214e6fe30f19d78e9e059d1581baffddfc41 984c54a7b1e8f27ff1c32348df69712afd86b17f drupal 1524472999 +0100 checkout: moving from 8.x-2.x to 8.2.12 984c54a7b1e8f27ff1c32348df69712afd86b17f 29a25627e7148b3119c84f18e087fc3b8c85b959 drupal 1551359844 +0000 checkout: moving from 984c54a7b1e8f27ff1c32348df69712afd86b17f to 8.3.1 +29a25627e7148b3119c84f18e087fc3b8c85b959 a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43 drupal 1557410999 +0100 checkout: moving from 29a25627e7148b3119c84f18e087fc3b8c85b959 to 8.3.3 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/logs/refs/remotes/composer/8.x-2.x --- a/vendor/drupal/coder/.git/logs/refs/remotes/composer/8.x-2.x Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.git/logs/refs/remotes/composer/8.x-2.x Thu May 09 15:33:08 2019 +0100 @@ -1,2 +1,3 @@ 0000000000000000000000000000000000000000 f8b0214e6fe30f19d78e9e059d1581baffddfc41 drupal 1524472999 +0100 fetch composer: storing head f8b0214e6fe30f19d78e9e059d1581baffddfc41 fd3321a777a645dd683a8c6ecf4978012357717b drupal 1551359843 +0000 fetch composer: fast-forward +fd3321a777a645dd683a8c6ecf4978012357717b 303046e238bd5dde6e5d26dfaefeb779af85e39a drupal 1557410998 +0100 fetch composer: fast-forward diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/logs/refs/remotes/composer/8.x-3.x --- a/vendor/drupal/coder/.git/logs/refs/remotes/composer/8.x-3.x Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.git/logs/refs/remotes/composer/8.x-3.x Thu May 09 15:33:08 2019 +0100 @@ -1,1 +1,2 @@ 0000000000000000000000000000000000000000 29a25627e7148b3119c84f18e087fc3b8c85b959 drupal 1551359843 +0000 fetch composer: storing head +29a25627e7148b3119c84f18e087fc3b8c85b959 c85aae11366cae4e15a1c5b8410c5e41f8994537 drupal 1557410998 +0100 fetch composer: fast-forward diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/objects/pack/pack-de663a6021b9af2ae8a8823c4c085b2ce1b5602e.idx Binary file vendor/drupal/coder/.git/objects/pack/pack-de663a6021b9af2ae8a8823c4c085b2ce1b5602e.idx has changed diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/objects/pack/pack-de663a6021b9af2ae8a8823c4c085b2ce1b5602e.pack Binary file vendor/drupal/coder/.git/objects/pack/pack-de663a6021b9af2ae8a8823c4c085b2ce1b5602e.pack has changed diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/refs/remotes/composer/8.x-2.x --- a/vendor/drupal/coder/.git/refs/remotes/composer/8.x-2.x Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.git/refs/remotes/composer/8.x-2.x Thu May 09 15:33:08 2019 +0100 @@ -1,1 +1,1 @@ -fd3321a777a645dd683a8c6ecf4978012357717b +303046e238bd5dde6e5d26dfaefeb779af85e39a diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/refs/remotes/composer/8.x-3.x --- a/vendor/drupal/coder/.git/refs/remotes/composer/8.x-3.x Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.git/refs/remotes/composer/8.x-3.x Thu May 09 15:33:08 2019 +0100 @@ -1,1 +1,1 @@ -29a25627e7148b3119c84f18e087fc3b8c85b959 +c85aae11366cae4e15a1c5b8410c5e41f8994537 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/refs/tags/8.3.2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drupal/coder/.git/refs/tags/8.3.2 Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +44c80c21074df43572652f35bec4f184f9eae5e7 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/refs/tags/8.3.3 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drupal/coder/.git/refs/tags/8.3.3 Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/refs/tags/8.x-3.2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drupal/coder/.git/refs/tags/8.x-3.2 Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +44c80c21074df43572652f35bec4f184f9eae5e7 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.git/refs/tags/8.x-3.3 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drupal/coder/.git/refs/tags/8.x-3.3 Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/.travis.yml --- a/vendor/drupal/coder/.travis.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/.travis.yml Thu May 09 15:33:08 2019 +0100 @@ -1,37 +1,40 @@ +# For PHP 5.5 and lower testing we need to stick to Ubuntu 14.04. dist: trusty language: php sudo: false +# Cache composer vendor directories to speed up the composer install step. +cache: + directories: + - $HOME/.composer/cache + - vendor + matrix: fast_finish: true include: - - php: 5.4 - php: 5.5 - php: 5.6 - php: 7.0 - php: 7.1 - php: 7.2 - - php: nightly - - php: hhvm - - allow_failures: - - php: hhvm - - php: nightly + - php: 7.3 before_install: # Speed up build time by disabling Xdebug when its not needed. - phpenv config-rm xdebug.ini || echo 'No xdebug config.' - # Circumvent a bug in the travis HHVM image - ships with incompatible PHPUnit. - - if [[ $TRAVIS_PHP_VERSION == hhv* ]]; then composer self-update; fi - - if [[ $TRAVIS_PHP_VERSION == hhv* ]]; then composer require phpunit/phpunit:~4.0; fi - - if [[ $TRAVIS_PHP_VERSION == hhv* ]]; then composer install; fi before_script: - # We don't have a composer.lock file because we always want to test with - # latest dependencies. + # Running composer install without a lock file will also update cached + # dependencies in vendor. - composer install script: - ./vendor/bin/phpunit + # Check that the sniffs themselves follow the PHPCS coding standard. - ./vendor/bin/phpcs -p + # Ensure that a custom standard can be invoked and the auto-loading of + # abstract classes works. - ./vendor/bin/phpcs -p --standard=coder_sniffer/Drupal/Test/phpcs-ruleset.xml coder_sniffer/Drupal/Test/good/ --ignore=coder_sniffer/Drupal/Test/good/GoodUnitTest.php + # Ensure that the DrupalPractice standard can be invoked standalone and the + # auto-loading of abstract classes works. + - ./vendor/bin/phpcs -p --standard=coder_sniffer/DrupalPractice coder_sniffer/DrupalPractice/Test/good/ --ignore=coder_sniffer/DrupalPractice/Test/good/GoodUnitTest.php diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/README.md --- a/vendor/drupal/coder/README.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/README.md Thu May 09 15:33:08 2019 +0100 @@ -1,6 +1,6 @@ # Coder -[![Build Status](https://travis-ci.org/pfrenssen/coder.svg?branch=8.x-2.x)](https://travis-ci.org/pfrenssen/coder) +[![Build Status](https://travis-ci.org/pfrenssen/coder.svg?branch=8.x-3.x)](https://travis-ci.org/pfrenssen/coder) Coder is a library for automated Drupal code reviews and coding standard fixes. It defines rules for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) @@ -25,7 +25,7 @@ If you get composer not found or similar, follow Composer's installation instructions. -Install Coder (8.x-2.x) in your global Composer directory in your home directory +Install Coder (8.x-3.x) in your global Composer directory in your home directory (`~/.composer`): composer global require drupal/coder @@ -81,12 +81,14 @@ Editors: +- [Atom](https://www.drupal.org/node/1419996) - [Eclipse](https://www.drupal.org/node/1420004) - [Komodo](https://www.drupal.org/node/1419996) - [Netbeans](https://www.drupal.org/node/1420008) - [PhpStorm](https://www.jetbrains.com/help/phpstorm/php-code-sniffer.html) - [Sublime Text](https://www.drupal.org/node/1419996) - [Vim](https://www.drupal.org/node/1419996) +- [Visual Studio Code (VSCode)](https://www.drupal.org/node/1419996) ## Automated Testing (PHPUnit + PHPCS) @@ -108,7 +110,7 @@ ## Contributing 1. Make sure an issue exists at https://www.drupal.org/project/issues/coder -2. Create a [pull request](https://help.github.com/articles/using-pull-requests/) against https://github.com/pfrenssen/coder +2. Create a [Pull Request](https://help.github.com/articles/using-pull-requests/) against https://github.com/pfrenssen/coder 3. Post a link to the pull request to the issue on drupal.org and set the issue to "needs review" @@ -116,7 +118,10 @@ ## Maintainers -Pieter Frenssen, https://www.drupal.org/u/pfrenssen + +- Pieter Frenssen, https://www.drupal.org/u/pfrenssen +- Michael Welford, https://www.drupal.org/u/mikejw +- Klaus Purer, https://www.drupal.org/u/klausi ## Credits diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/DeprecatedSniff.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/DeprecatedSniff.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,133 @@ +getTokens(); + + // Only process @deprecated tags. + if (strcasecmp($tokens[$stackPtr]['content'], '@deprecated') !== 0) { + return; + } + + // Get the end point of the comment block which has the deprecated tag. + $commentEnd = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr + 1)); + + // Get the full @deprecated text which may cover multiple lines. + $depText = ''; + $depEnd = ($stackPtr + 1); + for ($i = ($stackPtr + 1); $i < $commentEnd; $i++) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { + if ($tokens[$i]['line'] <= ($tokens[$depEnd]['line'] + 1)) { + $depText .= ' '.$tokens[$i]['content']; + $depEnd = $i; + } else { + break; + } + } + + // Found another tag, so we have all the deprecation text. + if ($tokens[$i]['code'] === T_DOC_COMMENT_TAG) { + break; + } + } + + $depText = trim($depText); + + // The standard format for the deprecation text is: + // @deprecated in %in-version% and will be removed from %removal-version%. %extra-info%. + // Use (?U) 'ungreedy' before the version so that only the text up to + // the first '. ' is matched, as there may be more than one sentence in + // the extra-info part. + $matches = array(); + preg_match('/in (.+) and will be removed from (?U)(.+)\. (.+)$/', $depText, $matches); + // There should be 4 items in $matches: 0 is full text, 1 = in-version, + // 2 = removal-version, 3 = extra-info. + if (count($matches) !== 4) { + $error = "The deprecation text '@deprecated %s' does not match the standard format: @deprecated in %%in-version%% and will be removed from %%removal-version%%. %%extra-info%%."; + $phpcsFile->addError($error, $stackPtr, 'IncorrectTextLayout', array($depText)); + } else { + // The text follows the basic layout. Now check that the versions + // match drupal:n.n.n or project:n.x-n.n. The text must be all lower + // case and numbers can be one or two digits. + foreach (array('in-version' => $matches[1], 'removal-version' => $matches[2]) as $name => $version) { + if (preg_match('/^drupal:\d{1,2}\.\d{1,2}\.\d{1,2}$/', $version) === 0 + && preg_match('/^[a-z\d_]:\d{1,2}\.x\-\d{1,2}\.\d{1,2}$/', $version) === 0 + ) { + $error = "The deprecation %s '%s' does not match the standard: drupal:n.n.n or project:n.x-n.n"; + $phpcsFile->addWarning($error, $stackPtr, 'DeprecatedVersionFormat', array($name, $version)); + } + } + } + + // The next tag in this comment block after @deprecated must be @see. + $seeTag = $phpcsFile->findNext(T_DOC_COMMENT_TAG, ($stackPtr + 1), $commentEnd, false, '@see'); + if ($seeTag === false) { + $error = 'Each @deprecated tag must have a @see tag immediately following it.'; + $phpcsFile->addError($error, $stackPtr, 'DeprecatedMissingSeeTag'); + return; + } + + // Check the format of the @see url. + $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, ($seeTag + 1), $commentEnd); + $cr_link = $tokens[$string]['content']; + // Allow for the alternative 'node' or 'project/aaa/issues' format. + preg_match('[^http(s*)://www.drupal.org/(node|project/\w+/issues)/(\d+)(\.*)$]', $cr_link, $matches); + // If matches[4] is not blank it means that the url is correct but it + // ends with a period. As this can be a common mistake give a specific + // message to assist in fixing. + if (isset($matches[4]) === true && empty($matches[4]) === false) { + $error = "The @see url '%s' should not end with a period."; + $phpcsFile->addWarning($error, $seeTag, 'DeprecatedPeriodAfterSeeUrl', array($cr_link)); + } else if (empty($matches) === true) { + $error = "The @see url '%s' does not match the standard: http(s)://www.drupal.org/node/n or http(s)://www.drupal.org/project/aaa/issues/n"; + $phpcsFile->addWarning($error, $seeTag, 'DeprecatedWrongSeeUrlFormat', array($cr_link)); + } + + }//end process() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php --- a/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -265,7 +265,7 @@ $searchStart = $stackPtr; $foundNonVoidReturn = false; do { - $returnToken = $phpcsFile->findNext(T_RETURN, $searchStart, $endToken); + $returnToken = $phpcsFile->findNext(array(T_RETURN, T_YIELD), $searchStart, $endToken); if ($returnToken === false && $foundReturnToken === false) { $error = '@return doc comment specified, but function has no return statement'; $phpcsFile->addError($error, $return, 'InvalidNoReturn'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/GenderNeutralCommentSniff.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/GenderNeutralCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,60 @@ +getTokens(); + if ((bool) preg_match('/(^|\W)(he|her|hers|him|his|she)($|\W)/i', $tokens[$stackPtr]['content']) === true) { + $phpcsFile->addError('Unnecessarily gendered language in a comment', $stackPtr, 'GenderNeutral'); + } + + }//end process() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/HookCommentSniff.php --- a/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/HookCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/HookCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -111,8 +111,22 @@ } } }//end if + + return; }//end if + // Check if the doc block just repeats the function name with + // "Implements example_hook_name()". + $functionName = $phpcsFile->getDeclarationName($stackPtr); + if ($functionName !== null && preg_match("/^[\s]*Implements $functionName\(\)\.$/i", $shortContent) === 1) { + $error = 'Hook implementations must be documented with "Implements hook_example()."'; + $fix = $phpcsFile->addFixableError($error, $short, 'HookRepeat'); + if ($fix === true) { + $newComment = preg_replace('/Implements [^_]+/', 'Implements hook', $shortContent); + $phpcsFile->fixer->replaceToken($short, $newComment); + } + } + }//end process() diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php --- a/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php Thu May 09 15:33:08 2019 +0100 @@ -34,6 +34,7 @@ '$base_url', '$channel', '$conf', + '$config', '$config_directories', '$cookie_domain', '$databases', diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/FunctionTriggerErrorSniff.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/FunctionTriggerErrorSniff.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,122 @@ +getTokens(); + + // If no second argument then quit. + if ($this->getArgument(2) === false) { + return; + } + + // Only check deprecation messages. + if (strcasecmp($tokens[$this->getArgument(2)['start']]['content'], 'E_USER_DEPRECATED') !== 0) { + return; + } + + // Get the first argument passed to trigger_error(). + $argument = $this->getArgument(1); + + // Apart from an optional __NAMESPACE__ concatenated at the start of the + // message, the text should be in one string without any further + // concatenations. This means that in all cases the 'end' content will + // contain the message text to be checked. + $message_text = $tokens[$argument['end']]['content']; + + // The standard format for @trigger_error() is: + // %thing% is deprecated in %in-version%. %extra-info%. See %cr-link% + // Use (?U) 'ungreedy' before the version so that only the text up to + // the first '. ' is matched, as there may be more than one sentence in + // the extra-info part. + $matches = array(); + preg_match('/[\'\"](.+) is deprecated in (?U)(.+)\. (.+)\. See (.+)[\'\"]/', $message_text, $matches); + + // There should be 5 items in $matches: 0 is full text, 1 = thing, + // 2 = in-version, 3 = extra-info, 4 = cr-link. + if (count($matches) !== 5) { + $error = "The deprecation message %s does not match the standard format: %%thing%% is deprecated in %%in-version%%. %%extra-info%%. See %%cr-link%%"; + $phpcsFile->addError($error, $argument['start'], 'TriggerErrorTextLayout', array($message_text)); + } else { + // The text follows the basic layout. Now check that the version + // matches drupal:n.n.n or project:n.x-n.n. The text must be all + // lower case and numbers can be one or two digits. + $in_version = $matches[2]; + if (preg_match('/^drupal:\d{1,2}\.\d{1,2}\.\d{1,2}$/', $in_version) === 0 + && preg_match('/^[a-z\d_]+:\d{1,2}\.x\-\d{1,2}\.\d{1,2}$/', $in_version) === 0 + ) { + $error = "The deprecation version '%s' does not match the standard: drupal:n.n.n or project:n.x-n.n"; + $phpcsFile->addWarning($error, $argument['start'], 'TriggerErrorVersion', array($in_version)); + } + + // Check the 'See' link. + $cr_link = $matches[4]; + // Allow for the alternative 'node' or 'project/aaa/issues' format. + preg_match('[^http(s*)://www.drupal.org/(node|project/\w+/issues)/(\d+)(\.*)$]', $cr_link, $matches); + // If matches[4] is not blank it means that the url is correct but it + // ends with a period. As this can be a common mistake give a specific + // message to assist in fixing. + if (isset($matches[4]) === true && empty($matches[4]) === false) { + $error = "The 'See' url '%s' should not end with a period."; + $phpcsFile->addWarning($error, $argument['start'], 'TriggerErrorPeriodAfterSeeUrl', array($cr_link)); + } else if (empty($matches) === true) { + $error = "The 'See' url '%s' does not match the standard: http(s)://www.drupal.org/node/n or http(s)://www.drupal.org/project/aaa/issues/n"; + $phpcsFile->addWarning($error, $argument['start'], 'TriggerErrorSeeUrlFormat', array($cr_link)); + } + }//end if + + }//end processFunctionCall() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/coder_sniffer/DrupalPractice/ruleset.xml --- a/vendor/drupal/coder/coder_sniffer/DrupalPractice/ruleset.xml Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/coder_sniffer/DrupalPractice/ruleset.xml Thu May 09 15:33:08 2019 +0100 @@ -1,25 +1,27 @@ - Drupal best practice checks + Drupal best practice checks - - + + - + - - - * - + ../Drupal/autoload.php - - - *.tpl.php - + + + * + - - */\.git/* - */\.svn/* - */\.hg/* - */\.bzr/* + + + *.tpl.php + + + + */\.git/* + */\.svn/* + */\.hg/* + */\.bzr/* diff -r 129ea1e6d783 -r af1871eacc83 vendor/drupal/coder/composer.json --- a/vendor/drupal/coder/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drupal/coder/composer.json Thu May 09 15:33:08 2019 +0100 @@ -7,19 +7,23 @@ "issues": "https://www.drupal.org/project/issues/coder", "source": "https://www.drupal.org/project/coder" }, - "keywords": ["phpcs", "standards", "code review"], + "keywords": [ + "phpcs", + "standards", + "code review" + ], "license": "GPL-2.0+", "require": { - "php": ">=5.4.0", + "php": ">=5.5.9", "ext-mbstring": "*", - "squizlabs/php_codesniffer": "^3.0.1", + "squizlabs/php_codesniffer": "^3.4.1", "symfony/yaml": ">=2.0.0" }, "autoload": { - "psr-0": { - "Drupal\\": "coder_sniffer/Drupal/", - "DrupalPractice\\": "coder_sniffer/Drupal/" - } + "psr-0": { + "Drupal\\": "coder_sniffer/Drupal/", + "DrupalPractice\\": "coder_sniffer/DrupalPractice/" + } }, "require-dev": { "phpunit/phpunit": ">=3.7 <6" diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/.circleci/config.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/.circleci/config.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs +defaults: &defaults + working_directory: ~/drush + environment: + TZ: "/usr/share/zoneinfo/America/Los_Angeles" + TERM: dumb + PHPUNIT_ARGS: "" + +version: 2 +jobs: + lint: + <<: *defaults + docker: + - image: circleci/php:7.1-apache-node + steps: + - checkout + - run: composer install --prefer-dist --no-interaction + - run: composer lint + +workflows: + version: 2 + build_test: + jobs: + - lint diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/.travis.yml --- a/vendor/drush/drush/.travis.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/.travis.yml Thu May 09 15:33:08 2019 +0100 @@ -27,17 +27,21 @@ matrix: include: + # D8.7.x + - php: 7.0 + env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=7.0-alpha1' + # D8.6.x - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=6.3' + env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=6.12' # D8.5.x - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=5.8' + env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=5.13' # D8.4.x - php: 7.0 - env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=4.5' + env: 'UNISH_DRUPAL_MAJOR_VERSION=8 UNISH_DRUPAL_MINOR_VERSION=4.8 PHPUNIT_ARGS=--group=commands' # D8.3.x - php: 7.0 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/circle.yml --- a/vendor/drush/drush/circle.yml Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -machine: - timezone: - America/Chicago - php: - version: 7.0.11 - -dependencies: - cache_directories: - - ~/.composer/cache - override: - - composer install --prefer-dist --no-interaction - -test: - override: - - composer lint diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/archive.drush.inc --- a/vendor/drush/drush/commands/core/archive.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/archive.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -35,7 +35,7 @@ 'drush archive-dump --tar-options="--exclude=%files"' => 'Placeholder %files is replaced with the real path for the current site, and that path is excluded.', ), 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE, - 'aliases' => array('ard', 'archive-backup', 'arb'), + 'aliases' => array('ard', 'archive-backup', 'arb', 'archive:dump'), ); $items['archive-restore'] = array( 'description' => 'Expand a site archive into a Drupal web site.', @@ -63,7 +63,7 @@ 'drush archive-restore ./example.tar.gz --db-url=mysql://root:pass@127.0.0.1/dbname' => 'Restore archive to a new database (and customize settings.php to point there.).', ), 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'aliases' => array('arr'), + 'aliases' => array('arr', 'archive:restore'), ); return $items; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/cache.drush.inc --- a/vendor/drush/drush/commands/core/cache.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/cache.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -42,7 +42,7 @@ 'pipe-format' => 'var_export', 'output-data-type' => TRUE, ), - 'aliases' => array('cg'), + 'aliases' => array('cg','cache:get'), ); $items['cache-clear'] = array( 'bootstrap' => DRUSH_BOOTSTRAP_MAX, @@ -51,7 +51,7 @@ 'type' => 'The particular cache to clear. Omit this argument to choose from available caches.', ), 'callback' => 'drush_cache_command_clear', - 'aliases' => array('cc'), + 'aliases' => array('cc','cache:clear'), ); $items['cache-set'] = array( 'description' => 'Cache an object expressed in JSON or var_export() format.', @@ -69,7 +69,7 @@ 'cache-get' => 'If the object is the result a previous fetch from the cache, only store the value in the "data" property of the object in the cache.', ), 'callback' => 'drush_cache_command_set', - 'aliases' => array('cs'), + 'aliases' => array('cs','cache:set'), ); $items['cache-rebuild'] = array( 'description' => 'Rebuild a Drupal 8 site and clear all its caches.', @@ -79,7 +79,7 @@ // Further bootstrap is done by the rebuild script. 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE, 'core' => array('8+'), - 'aliases' => array('cr', 'rebuild'), + 'aliases' => array('cr', 'rebuild', 'cache:rebuild'), ); return $items; diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/cli.drush.inc --- a/vendor/drush/drush/commands/core/cli.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/cli.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -14,7 +14,7 @@ $items['core-cli'] = array( 'description' => 'Open an interactive shell on a Drupal site.', 'remote-tty' => TRUE, - 'aliases' => array('php'), + 'aliases' => array('php', 'core:cli'), 'bootstrap' => DRUSH_BOOTSTRAP_MAX, 'topics' => array('docs-repl'), 'options' => array( @@ -29,6 +29,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array(drush_get_context('DOC_PREFIX', DRUSH_BASE_PATH) . '/docs/repl.md'), + 'aliases' => array('docs:repl'), ); return $items; } @@ -95,7 +96,7 @@ if ($drupal_major_version == 7) { Database::closeConnection(); } - + // if the cwd option is passed, lets change the current working directory to wherever // the user wants to go before we lift psysh. if ($cwd = drush_get_option('cwd',FALSE)) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/config.drush.inc --- a/vendor/drush/drush/commands/core/config.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/config.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -58,7 +58,7 @@ 'default' => 'yaml', 'pipe-format' => 'var_export', ), - 'aliases' => array('cget'), + 'aliases' => array('cget', 'config:get'), 'core' => array('8+'), ); @@ -84,14 +84,14 @@ 'examples' => array( 'drush config-set system.site page.front node' => 'Sets system.site:page.front to "node".', ), - 'aliases' => array('cset'), + 'aliases' => array('cset', 'config:set'), 'core' => array('8+'), ); $items['config-export'] = array( 'description' => 'Export configuration to a directory.', 'core' => array('8+'), - 'aliases' => array('cex'), + 'aliases' => array('cex', 'config:export'), 'arguments' => array( 'label' => "A config directory label (i.e. a key in \$config_directories array in settings.php). Defaults to 'sync'", ), @@ -136,13 +136,13 @@ 'examples' => array( 'drush config-import --partial' => 'Import configuration; do not remove missing configuration.', ), - 'aliases' => array('cim'), + 'aliases' => array('cim', 'config:import'), ); $items['config-list'] = array( 'description' => 'List config names by prefix.', 'core' => array('8+'), - 'aliases' => array('cli'), + 'aliases' => array('cli', 'config:list'), 'arguments' => array( 'prefix' => 'The config prefix. For example, "system". No prefix will return all names in the system.', ), @@ -161,7 +161,7 @@ $items['config-edit'] = $deps + array( 'description' => 'Open a config file in a text editor. Edits are imported into active configuration after closing editor.', 'core' => array('8+'), - 'aliases' => array('cedit'), + 'aliases' => array('cedit', 'config:edit'), 'arguments' => array( 'config-name' => 'The config object name, for example "system.site".', ), @@ -178,7 +178,7 @@ $items['config-delete'] = array( 'description' => 'Delete a configuration object.', 'core' => array('8+'), - 'aliases' => array('cdel'), + 'aliases' => array('cdel', 'config:delete'), 'arguments' => array( 'config-name' => 'The config object name, for example "system.site".', 'key' => 'A config key to clear, for example "page.front".', @@ -191,7 +191,7 @@ // 'core' => array('8+'), Operates on remote sites so not possible to declare this locally. 'drush dependencies' => array('config', 'core'), // core-rsync, core-execute. 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'aliases' => array('cpull'), + 'aliases' => array('cpull', 'config:pull'), 'arguments' => array( 'source' => 'A site-alias or the name of a subdirectory within /sites whose config you want to copy from.', 'target' => 'A site-alias or the name of a subdirectory within /sites whose config you want to replace.', @@ -800,7 +800,7 @@ ); drush_log(dt('Starting to export configuration on Target.'), LogLevel::OK); $return = drush_invoke_process($source, 'config-export', array(), $global_options + $export_options, $backend_options); - if ($return['error_status']) { + if ($return === FALSE || $return['error_status']) { return drush_set_error('DRUSH_CONFIG_PULL_EXPORT_FAILED', dt('Config-export failed.')); } else { diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/core.drush.inc --- a/vendor/drush/drush/commands/core/core.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/core.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -87,7 +87,7 @@ ); $items['core-cron'] = array( 'description' => 'Run all cron hooks in all active modules for specified site.', - 'aliases' => array('cron'), + 'aliases' => array('cron', 'core:cron'), 'topics' => array('docs-cron'), ); $items['updatedb'] = array( @@ -103,13 +103,13 @@ ); $items['entity-updates'] = array( 'description' => 'Apply pending entity schema updates.', - 'aliases' => array('entup'), + 'aliases' => array('entup', 'entity:updates'), 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, 'core' => array('8+'), ); $items['twig-compile'] = array( 'description' => 'Compile all Twig template(s).', - 'aliases' => array('twigc'), + 'aliases' => array('twigc', 'twig:compile'), 'core' => array('8+'), ); $items['updatedb-status'] = array( @@ -121,7 +121,7 @@ 'fields-default' => array('module', 'update_id', 'description'), 'output-data-type' => 'format-table', ), - 'aliases' => array('updbst'), + 'aliases' => array('updbst', 'updatedb:status'), ); $items['core-config'] = array( 'description' => 'Edit drushrc, site alias, and Drupal settings.php files.', @@ -138,12 +138,12 @@ 'drush core-config sett' => 'Edit settings.php for the current Drupal site.', 'drush core-config --choice=2' => 'Edit the second file in the choice list.', ), - 'aliases' => array('conf', 'config'), + 'aliases' => array('conf', 'config', 'core:config'), ); $items['core-status'] = array( 'description' => 'Provides a birds-eye view of the current Drupal installation, if any.', 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'aliases' => array('status', 'st'), + 'aliases' => array('status', 'st', 'core:status'), 'examples' => array( 'drush core-status version' => 'Show all status lines that contain version information.', 'drush core-status --pipe' => 'A list key=value items separated by line breaks.', @@ -178,7 +178,7 @@ $items['core-requirements'] = array( 'description' => 'Provides information about things that may be wrong in your Drupal installation, if any.', - 'aliases' => array('status-report','rq'), + 'aliases' => array('status-report','rq', 'core:requirements'), 'examples' => array( 'drush core-requirements' => 'Show all status lines from the Status Report admin page.', 'drush core-requirements --severity=2' => 'Show only the red lines from the Status Report admin page.', @@ -222,7 +222,7 @@ 'required-arguments' => TRUE, 'allow-additional-options' => TRUE, 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'aliases' => array('eval', 'ev'), + 'aliases' => array('eval', 'ev', 'php:eval'), 'outputformat' => array( 'default' => 'var_export', ), @@ -247,7 +247,7 @@ ), 'allow-additional-options' => TRUE, 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'aliases' => array('scr'), + 'aliases' => array('scr', 'php:script'), 'topics' => array('docs-examplescript', 'docs-scripts'), ); $items['core-execute'] = array( @@ -266,7 +266,7 @@ 'examples' => array( 'drush core-execute git pull origin rebase' => 'Retrieve latest code from git', ), - 'aliases' => array('exec', 'execute'), + 'aliases' => array('exec', 'execute', 'core:execute'), 'topics' => array('docs-aliases'), ); $items['core-rsync'] = array( @@ -296,7 +296,7 @@ 'drush rsync ./ @stage:%files/img' => 'Rsync all files in the current directory to the \'img\' directory in the file storage folder on the Drush alias stage.', 'drush -s rsync @dev @stage --exclude=*.sql --delete' => "Simulate Rsync Drupal root from the Drush alias dev to the alias stage (one of which must be local), excluding all files that match the filter '*.sql' and delete all files on the destination that are no longer on the source.", ), - 'aliases' => array('rsync'), + 'aliases' => array('rsync', 'core:rsync'), 'topics' => array('docs-aliases'), ); $items['drupal-directory'] = array( @@ -315,7 +315,7 @@ 'drush dd @alias:%files' => 'Print the path to the files directory on the site @alias.', 'edit `drush dd devel`/devel.module' => "Open devel module in your editor (customize 'edit' for your editor)", ), - 'aliases' => array('dd'), + 'aliases' => array('dd', 'drupal:directory'), 'bootstrap' => DRUSH_BOOTSTRAP_NONE, ); @@ -327,6 +327,7 @@ ), 'required-arguments' => TRUE, 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN, + 'aliases' => array('batch:process'), ); $items['updatedb-batch-process'] = array( @@ -339,6 +340,7 @@ // Drupal 7 needs DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, while Drupal 8 needs _FULL. // Therefore we bootstrap to _FULL in commands/core/drupal/update.inc. 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, + 'aliases' => array('updatedb:batch-process'), ); $items['core-global-options'] = array( 'description' => 'All global options', @@ -351,11 +353,12 @@ 'field-labels' => array('label' => 'Label', 'description' => 'Description'), 'output-data-type' => 'format-table', ), + 'aliases' => array('core:global-options'), ); $items['core-quick-drupal'] = array( 'description' => 'Download, install, serve and login to Drupal with minimal configuration and dependencies.', 'bootstrap' => DRUSH_BOOTSTRAP_NONE, - 'aliases' => array('qd', 'cutie'), + 'aliases' => array('qd', 'cutie', 'core:quick:drupal'), 'arguments' => array( 'site' => 'Short name for the site to be created - used as a directory name and as sqlite file name. Optional - if omitted timestamped "quick-drupal" directory will be used instead.', 'projects' => 'A list of projects to download into the new site. If projects contain extensions (modules or themes) with the same name they will be enabled by default. See --enable option to control this behaviour further.', diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/docs.drush.inc --- a/vendor/drush/drush/commands/core/docs.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/docs.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -40,6 +40,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/README.md'), + 'aliases' => array('docs:readme'), ); $items['docs-bisect'] = array( 'description' => 'git bisect and Drush may be used together to find the commit an error was introduced in.', @@ -48,6 +49,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/git-bisect.example.sh'), + 'aliases' => array('docs:bisect'), ); $items['docs-bashrc'] = array( 'description' => 'Bashrc customization examples for Drush.', @@ -56,6 +58,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/example.bashrc'), + 'aliases' => array('docs:bashrc'), ); $items['docs-configuration'] = array( 'description' => 'Configuration overview with examples from example.drushrc.php.', @@ -64,6 +67,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/example.drushrc.php'), + 'aliases' => array('docs:configuration'), ); $items['docs-config-exporting'] = array( 'description' => 'Drupal configuration export instructions, including customizing configuration by environment.', @@ -72,6 +76,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/config-exporting.md'), + 'aliases' => array('docs:config:exporting'), ); $items['docs-aliases'] = array( 'description' => 'Site aliases overview on creating your own aliases for commonly used Drupal sites with examples from example.aliases.drushrc.php.', @@ -80,6 +85,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/example.aliases.drushrc.php'), + 'aliases' => array('docs:aliases'), ); $items['docs-ini-files'] = array( 'description' => 'php.ini or drush.ini configuration to set PHP values for use with Drush.', @@ -88,6 +94,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/example.drush.ini'), + 'aliases' => array('docs:ini-files'), ); $items['docs-bastion'] = array( 'description' => 'Bastion server configuration: remotely operate on a Drupal sites behind a firewall.', @@ -96,6 +103,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/bastion.md'), + 'aliases' => array('docs:bastion'), ); $items['docs-bootstrap'] = array( 'description' => 'Bootstrap explanation: how Drush starts up and prepares the Drupal environment for use with the command.', @@ -104,6 +112,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/bootstrap.md'), + 'aliases' => array('docs:bootstrap'), ); $items['docs-cron'] = array( 'description' => 'Crontab instructions for running your Drupal cron tasks via `drush cron`.', @@ -112,6 +121,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/cron.md'), + 'aliases' => array('docs:cron'), ); $items['docs-scripts'] = array( 'description' => 'Shell script overview on writing simple sequences of Drush statements.', @@ -120,6 +130,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/shellscripts.md'), + 'aliases' => array('docs:scripts'), ); $items['docs-shell-aliases'] = array( 'description' => 'Shell alias overview on creating your own aliases for commonly used Drush commands.', @@ -128,6 +139,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/shellaliases.md'), + 'aliases' => array('docs:shell-aliases'), ); $items['docs-commands'] = array( 'description' => 'Drush command instructions on creating your own Drush commands.', @@ -136,12 +148,14 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/commands.md'), + 'aliases' => array('docs:commands'), ); $items['docs-errorcodes'] = array( 'description' => 'Error code list containing all identifiers used with drush_set_error.', 'hidden' => TRUE, 'topic' => TRUE, 'bootstrap' => DRUSH_BOOTSTRAP_NONE, + 'aliases' => array('docs:errorcodes'), ); $items['docs-api'] = array( 'description' => 'Drush API', @@ -150,6 +164,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/drush.api.php'), + 'aliases' => array('docs:api'), ); $items['docs-context'] = array( 'description' => 'Contexts overview explaining how Drush manages command line options and configuration file settings.', @@ -158,6 +173,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/context.md'), + 'aliases' => array('docs:context'), ); $items['docs-examplescript'] = array( 'description' => 'Example Drush script.', @@ -166,6 +182,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/helloworld.script'), + 'aliases' => array('docs:examplescript'), ); $items['docs-examplecommand'] = array( 'description' => 'Example Drush command file.', @@ -174,6 +191,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/sandwich.drush.inc'), + 'aliases' => array('docs:examplecommand'), ); $items['docs-example-sync-extension'] = array( 'description' => 'Example Drush commandfile that extends sql-sync to enable development modules in the post-sync hook.', @@ -182,6 +200,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/sync_enable.drush.inc'), + 'aliases' => array('docs:example-sync-extension'), ); $items['docs-example-sync-via-http'] = array( 'description' => 'Example Drush commandfile that extends sql-sync to allow transfer of the sql dump file via http rather than ssh and rsync.', @@ -190,6 +209,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/sync_via_http.drush.inc'), + 'aliases' => array('docs:example-sync-via-http'), ); $items['docs-policy'] = array( 'description' => 'Example policy file.', @@ -198,6 +218,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/examples/policy.drush.inc'), + 'aliases' => array('docs:policy'), ); $items['docs-strict-options'] = array( 'description' => 'Strict option handling, and how commands that use it differ from regular Drush commands.', @@ -206,6 +227,7 @@ 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'callback' => 'drush_print_file', 'callback arguments' => array($docs_dir . '/docs/strict-options.md'), + 'aliases' => array('docs:strict-options'), ); return $items; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/drupal/update_7.inc --- a/vendor/drush/drush/commands/core/drupal/update_7.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/drupal/update_7.inc Thu May 09 15:33:08 2019 +0100 @@ -199,6 +199,11 @@ // @see https://github.com/drush-ops/drush/pull/399 module_implements('', FALSE, TRUE); + // Ensure we re-evaluate the stream wrappers on full bootstrap. + // update_check_requirements() invokes a writeable check and hence loads the + // stream wrappers while not all modules are available. + drupal_static_reset('file_get_stream_wrappers'); + // Now proceed with a full bootstrap. drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/field.drush.inc --- a/vendor/drush/drush/commands/core/field.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/field.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -37,6 +37,7 @@ 'open `drush field-create article`' => 'Define new article fields and then open field edit form for refinement.', 'drush field-create article city,text,text_textfield subtitle,text,text_textfield' => 'Create two new fields.' ), + 'aliases' => array('field:create'), ); $items['field-update'] = array( 'description' => 'Return URL for field editing web page.', @@ -47,6 +48,7 @@ 'examples' => array( 'field-update comment_body' => 'Quickly navigate to a field edit web page.', ), + 'aliases' => array('field:update'), ); $items['field-delete'] = array( 'description' => 'Delete a field and its instances.', @@ -62,6 +64,7 @@ 'field-delete city' => 'Delete the city field and any instances it might have.', 'field-delete city --bundle=article' => 'Delete the city instance on the article bundle', ), + 'aliases' => array('field:delete'), ); $items['field-clone'] = array( 'description' => 'Clone a field and all its instances.', @@ -74,6 +77,7 @@ 'field-clone tags labels' => 'Copy \'tags\' field into a new field \'labels\' field which has same instances.', 'open `field-clone tags labels`' => 'Clone field and then open field edit forms for refinement.', ), + 'aliases' => array('field:clone'), ); $items['field-info'] = array( 'description' => 'View information about fields, field_types, and widgets.', @@ -99,6 +103,7 @@ 'process-cell' => '_drush_field_info_process_cell', ), 'output-data-type' => 'format-table', + 'aliases' => array('field:info'), ), ); return $items; diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/image.drush.inc --- a/vendor/drush/drush/commands/core/image.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/image.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -27,7 +27,7 @@ 'drush image-flush thumbnail' => 'Delete all thumbnail images.', 'drush image-flush --all' => 'Flush all derived images. They will be regenerated on the fly.', ), - 'aliases' => array('if'), + 'aliases' => array('if', 'image:flush'), ); $items['image-derive'] = array( 'description' => 'Create an image derivative.', @@ -42,7 +42,7 @@ 'examples' => array( 'drush image-derive thumbnail themes/bartik/logo.png' => 'Save thumbnail sized derivative of logo image.', ), - 'aliases' => array('id'), + 'aliases' => array('id', 'image:derive'), ); return $items; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/init.drush.inc --- a/vendor/drush/drush/commands/core/init.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/init.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -16,7 +16,7 @@ function init_drush_command() { $items['core-init'] = array( 'description' => 'Enrich the bash startup file with completion and aliases. Copy .drushrc file to ~/.drush', - 'aliases' => array('init'), + 'aliases' => array('init', 'core:init'), 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'package' => 'core', 'global-options' => array('editor', 'bg'), diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/locale.d8.drush.inc --- a/vendor/drush/drush/commands/core/locale.d8.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/locale.d8.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -31,6 +31,7 @@ 'langcodes' => 'A comma-separated list of language codes to update. If omitted, all translations will be updated.' ], 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, + 'aliases' => array('locale:check'), ]; // @todo Implement proper export and import commands. return $items; diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/queue.drush.inc --- a/vendor/drush/drush/commands/core/queue.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/queue.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -25,6 +25,7 @@ 'options' => array( 'time-limit' => 'The maximum number of seconds allowed to run the queue', ), + 'aliases' => array('queue:run'), ); $items['queue-list'] = array( 'description' => 'Returns a list of all defined queues', @@ -41,6 +42,7 @@ 'key-value-item' => 'items', ), 'output-data-type' => 'format-table', + 'aliases' => array('queue:list'), ), ); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/role.drush.inc --- a/vendor/drush/drush/commands/core/role.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/role.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -43,7 +43,7 @@ 'machine name' => 'The symbolic machine name for the role. Required.', 'human-readable name' => 'A descriptive name for the role. Optional; Drupal 8 only. Ignored in D6 and D7.', ), - 'aliases' => array('rcrt'), + 'aliases' => array('rcrt', 'role:create'), ); $items['role-delete'] = array( 'description' => 'Delete a role.', @@ -53,7 +53,7 @@ 'arguments' => array( 'machine name' => 'The symbolic machine name for the role. Required. In D6 and D7, this may also be a numeric role ID.', ), - 'aliases' => array('rdel'), + 'aliases' => array('rdel', 'role:delete'), ); $items['role-add-perm'] = array( 'description' => 'Grant specified permission(s) to a role.', @@ -73,7 +73,7 @@ 'global-options' => array( 'cache-clear', ), - 'aliases' => array('rap'), + 'aliases' => array('rap', 'role:add:perm'), ); $items['role-remove-perm'] = array( @@ -92,7 +92,7 @@ 'global-options' => array( 'cache-clear', ), - 'aliases' => array('rmp'), + 'aliases' => array('rmp', 'role:remove:perm'), ); $items['role-list'] = array( @@ -113,7 +113,7 @@ 'field-labels' => array('rid' => 'ID', 'label' => 'Role Label', 'perm' => "Permission"), 'output-data-type' => 'format-table', ), - 'aliases' => array('rls'), + 'aliases' => array('rls', 'role:list'), ); return $items; diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/search.drush.inc --- a/vendor/drush/drush/commands/core/search.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/search.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -27,6 +27,7 @@ 'message-template' => '!remaining/!total', ), 'output-data-type' => 'format-list', + 'aliases' => array('search:status'), ), ); $items['search-index'] = array( @@ -39,6 +40,7 @@ 'options' => array( 'immediate' => 'Rebuild the index immediately, instead of waiting for cron.', ), + 'aliases' => array('search:index'), ); return $items; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/shellalias.drush.inc --- a/vendor/drush/drush/commands/core/shellalias.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/shellalias.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -39,7 +39,7 @@ 'simplify-single' => TRUE, 'output-data-type' => 'format-list', ), - 'aliases' => array('sha'), + 'aliases' => array('sha', 'shell:alias'), 'examples' => array( 'drush shell-alias' => 'List all alias records known to drush.', 'drush shell-alias pull' => 'Print the value of the shell alias \'pull\'.', diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/site_install.drush.inc --- a/vendor/drush/drush/commands/core/site_install.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/site_install.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -67,7 +67,7 @@ 'drush site-install standard install_configure_form.enable_update_status_module=NULL install_configure_form.enable_update_status_emails=NULL' => 'Disable email notification during install and later (D8). If your server has no mail transfer agent, this gets rid of an error during install.', ), 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT, - 'aliases' => array('si'), + 'aliases' => array('si', 'site:install'), ); return $items; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/sitealias.drush.inc --- a/vendor/drush/drush/commands/core/sitealias.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/sitealias.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -42,7 +42,7 @@ 'field-mappings' => array('name' => '#name'), 'output-data-type' => 'format-table', ), - 'aliases' => array('sa'), + 'aliases' => array('sa', 'site:alias'), 'examples' => array( 'drush site-alias' => 'List all alias records known to drush.', 'drush site-alias @dev' => 'Print an alias record for the alias \'dev\'.', @@ -57,7 +57,7 @@ 'arguments' => array( 'site' => 'Site specification to use, or "-" for previous site. Omit this argument to "unset"', ), - 'aliases' => array('use'), + 'aliases' => array('use', 'site:set'), 'examples' => array( 'drush site-set @dev' => 'Set the current session to use the @dev alias.', 'drush site-set user@server/path/to/drupal#sitename' => 'Set the current session to use a remote site via site specification.', diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/ssh.drush.inc --- a/vendor/drush/drush/commands/core/ssh.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/ssh.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -22,7 +22,7 @@ 'drush @prod ssh ls /tmp' => 'Run "ls /tmp" on @prod site. If @prod is a site list, then ls will be executed on each site.', 'drush @prod ssh git pull' => 'Run "git pull" on the Drupal root directory on the @prod site.', ), - 'aliases' => array('ssh'), + 'aliases' => array('ssh', 'site:ssh'), 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'topics' => array('docs-aliases'), ); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/state.drush.inc --- a/vendor/drush/drush/commands/core/state.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/state.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -34,7 +34,7 @@ 'default' => 'json', 'pipe-format' => 'json', ), - 'aliases' => array('sget'), + 'aliases' => array('sget', 'state:get'), 'core' => array('8+'), ); @@ -66,7 +66,7 @@ 'drush state-set system.cron_last 1406682882 --format=integer' => 'Sets a timestamp for last cron run.', 'php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush state-set --format=json foo.name -'=> 'Set a key to a complex value (e.g. array)', ), - 'aliases' => array('sset'), + 'aliases' => array('sset', 'state:set'), 'core' => array('8+'), ); @@ -79,7 +79,7 @@ 'examples' => array( 'drush state-del system.cron_last' => 'Delete state entry for system.cron_last.', ), - 'aliases' => array('sdel'), + 'aliases' => array('sdel', 'state:delete'), 'core' => array('8+'), ); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/topic.drush.inc --- a/vendor/drush/drush/commands/core/topic.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/topic.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -24,7 +24,7 @@ ), 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'remote-tty' => TRUE, - 'aliases' => array('topic'), + 'aliases' => array('topic', 'core:topic'), 'topics' => array('docs-readme'), ); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/usage.drush.inc --- a/vendor/drush/drush/commands/core/usage.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/usage.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -25,7 +25,7 @@ 'drush usage-show' => 'Show cached usage statistics.', '$options[\'drush_usage_log\'] = TRUE;' => 'Specify in a .drushrc.php file that usage information should be logged locally in a usage statistics file.', ), - 'aliases' => array('ushow'), + 'aliases' => array('ushow', 'usage:show'), ); $items['usage-send'] = array( 'bootstrap' => DRUSH_BOOTSTRAP_NONE, @@ -36,7 +36,7 @@ '$options[\'drush_usage_send\'] = TRUE;' => 'Specify in a .drushrc.php file that usage information should be sent.', '$options[\'drush_usage_size\'] = 10240;' => 'Specify the frequency (file size) that usage information should be sent.', ), - 'aliases' => array('usend'), + 'aliases' => array('usend', 'usage:send'), ); return $items; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/variable.drush.inc --- a/vendor/drush/drush/commands/core/variable.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/variable.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -39,7 +39,7 @@ 'format' => 'var_export', ), ), - 'aliases' => array('vget'), + 'aliases' => array('vget', 'variable:get'), ); $items['variable-set'] = array( 'description' => "Set a variable.", @@ -64,7 +64,7 @@ 'drush vset pr TRUE' => 'Choose from a list of variables beginning with "pr" to set to (bool)true.', 'php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush vset --format=json project_dependency_excluded_dependencies -'=> 'Set a variable to a complex value (e.g. array)', ), - 'aliases' => array('vset'), + 'aliases' => array('vset', 'variable:set'), ); $items['variable-delete'] = array( 'core' => array(6,7), @@ -82,7 +82,7 @@ 'drush vdel u' => 'Choose from a list of variables beginning with "u" to delete.', 'drush vdel -y --exact maintenance_mode' => 'Bring the site back online, skipping confirmation. Variable is rewritten to site_offline for Drupal 6.', ), - 'aliases' => array('vdel'), + 'aliases' => array('vdel', 'variable:delete'), ); return $items; diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/views.d8.drush.inc --- a/vendor/drush/drush/commands/core/views.d8.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/views.d8.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -36,12 +36,12 @@ $items['views-dev'] = array( 'description' => 'Set the Views settings to more developer-oriented values.', - 'aliases' => array('vd'), + 'aliases' => array('vd', 'views:dev'), ) + $base; $items['views-list'] = array( 'description' => 'Get a list of all views in the system.', - 'aliases' => array('vl'), + 'aliases' => array('vl', 'views:list'), 'options' => array( 'name' => array( 'description' => 'A string contained in the view\'s name to filter the results with.', @@ -76,7 +76,7 @@ $items['views-execute'] = array( 'description' => 'Execute a view and get the results.', - 'aliases' => array('vex'), + 'aliases' => array('vex', 'views:execute'), 'arguments' => array( 'view' => 'The name of the view to execute.', 'display' => 'The display ID to execute. If none specified, the default display will be used.', @@ -107,7 +107,7 @@ $items['views-analyze'] = array( 'drupal dependencies' => array('views', 'views_ui'), 'description' => 'Get a list of all Views analyze warnings', - 'aliases' => array('va'), + 'aliases' => array('va', 'views:analyze'), 'options' => array( 'format' => array( 'description' => 'Define the output format. Known formats are: json, print_r, and export.', @@ -121,7 +121,7 @@ 'views' => 'A space delimited list of view names.', ), 'required-arguments' => 1, - 'aliases' => array('ven'), + 'aliases' => array('ven', 'views:enable'), 'examples' => array( 'drush ven frontpage taxonomy_term' => 'Enable the frontpage and taxonomy_term views.', ), @@ -133,7 +133,7 @@ 'views' => 'A space delimited list of view names.', ), 'required-arguments' => 1, - 'aliases' => array('vdis'), + 'aliases' => array('vdis', 'views:disable'), 'examples' => array( 'drush vdis frontpage taxonomy_term' => 'Disable the frontpage and taxonomy_term views.', ), diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/core/watchdog.drush.inc --- a/vendor/drush/drush/commands/core/watchdog.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/core/watchdog.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -37,7 +37,7 @@ 'column-widths' => array('type' => 8, 'severity' => 8), 'output-data-type' => 'format-table', ), - 'aliases' => array('wd-list'), + 'aliases' => array('wd-list', 'watchdog:list'), ); $items['watchdog-show'] = array( 'description' => 'Show watchdog messages.', @@ -71,7 +71,7 @@ 'column-widths' => array('type' => 8, 'severity' => 8), 'output-data-type' => 'format-table', ), - 'aliases' => array('wd-show', 'ws'), + 'aliases' => array('wd-show', 'ws', 'watchdog:show'), ); $items['watchdog-delete'] = array( 'description' => 'Delete watchdog messages.', @@ -87,7 +87,7 @@ 'drush watchdog-delete --severity=notice' => 'Delete all messages with a severity of notice.', 'drush watchdog-delete --type=cron' => 'Delete all messages of type cron.', ), - 'aliases' => array('wd-del', 'wd-delete'), + 'aliases' => array('wd-del', 'wd-delete', 'watchdog:delete'), ); return $items; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/make/make.download.inc --- a/vendor/drush/drush/commands/make/make.download.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/make/make.download.inc Thu May 09 15:33:08 2019 +0100 @@ -253,7 +253,7 @@ $wc = _get_working_copy_option($download); $checkout_after_clone = TRUE; // If no download URL specified, assume anonymous clone from git.drupal.org. - $download['url'] = isset($download['url']) ? $download['url'] : "http://git.drupal.org/project/$name.git"; + $download['url'] = isset($download['url']) ? $download['url'] : "https://git.drupal.org/project/$name.git"; // If no working-copy download URL specified, assume it is the same. $download['wc_url'] = isset($download['wc_url']) ? $download['wc_url'] : $download['url']; diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/pm/package_handler/git_drupalorg.inc --- a/vendor/drush/drush/commands/pm/package_handler/git_drupalorg.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/pm/package_handler/git_drupalorg.inc Thu May 09 15:33:08 2019 +0100 @@ -49,10 +49,10 @@ function package_handler_download_project(&$request, $release) { if ($username = drush_get_option('gitusername')) { // Uses SSH, which enables pushing changes back to git.drupal.org. - $repository = $username . '@git.drupal.org:project/' . $request['name'] . '.git'; + $repository = 'git@git.drupal.org:project/' . $request['name'] . '.git'; } else { - $repository = 'git://git.drupal.org/project/' . $request['name'] . '.git'; + $repository = 'https://git.drupal.org/project/' . $request['name'] . '.git'; } $request['repository'] = $repository; $tag = $release['tag']; diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/pm/pm.drush.inc --- a/vendor/drush/drush/commands/pm/pm.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/pm/pm.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -189,7 +189,7 @@ 'resolve-dependencies' => 'Attempt to download any missing dependencies. At the moment, only works when the module name is the same as the project name.', 'skip' => 'Skip automatic downloading of libraries (c.f. devel).', ), - 'aliases' => array('en'), + 'aliases' => array('en', 'pm:enable'), 'engines' => array( 'release_info' => array( 'add-options-to-command' => FALSE, @@ -201,7 +201,7 @@ 'arguments' => array( 'extensions' => 'A list of modules or themes. You can use the * wildcard at the end of extension names to disable multiple matches.', ), - 'aliases' => array('dis'), + 'aliases' => array('dis', 'pm:disable'), 'engines' => array( 'version_control', 'package_handler', @@ -215,7 +215,7 @@ 'arguments' => array( 'extensions' => 'A list of modules or themes. You can use the * wildcard at the end of extension names to show info for multiple matches. If no argument is provided it will show info for all available extensions.', ), - 'aliases' => array('pmi'), + 'aliases' => array('pmi', 'pm:info'), 'outputformat' => array( 'default' => 'key-value-list', 'pipe-format' => 'json', @@ -280,7 +280,7 @@ 'fields-pipe' => array('label'), 'output-data-type' => 'format-table', ), - 'aliases' => array('pmpi'), + 'aliases' => array('pmpi', 'pm:projectinfo'), ); // Install command is reserved for the download and enable of projects including dependencies. @@ -293,7 +293,7 @@ 'arguments' => array( 'modules' => 'A list of modules.', ), - 'aliases' => array('pmu'), + 'aliases' => array('pmu', 'pm:uninstall'), ); $items['pm-list'] = array( 'description' => 'Show a list of available extensions (modules and themes).', @@ -317,7 +317,7 @@ 'field-labels' => array('package' => 'Package', 'name' => 'Name', 'type' => 'Type', 'status' => 'Status', 'version' => 'Version'), 'output-data-type' => 'format-table', ), - 'aliases' => array('pml'), + 'aliases' => array('pml', 'pm:list'), ); $items['pm-refresh'] = array( 'description' => 'Refresh update status information.', @@ -326,7 +326,7 @@ 'add-options-to-command' => FALSE, ), ), - 'aliases' => array('rf'), + 'aliases' => array('rf', 'pm:refresh'), ); $items['pm-updatestatus'] = array( 'description' => 'Show a report of available minor updates to Drupal core and contrib projects.', @@ -348,7 +348,7 @@ 'fields-pipe' => array('name', 'existing_version', 'candidate_version', 'status_msg'), 'output-data-type' => 'format-table', ), - 'aliases' => array('ups'), + 'aliases' => array('ups', 'pm:updatestatus'), ); $items['pm-updatecode'] = array( 'description' => 'Update Drupal core and contrib projects to latest recommended releases.', @@ -365,7 +365,7 @@ 'check-updatedb' => 'Check to see if an updatedb is needed after updating the code. Default is on; use --check-updatedb=0 to disable.', ) + $update_options, 'sub-options' => $update_suboptions, - 'aliases' => array('upc'), + 'aliases' => array('upc', 'pm:updatecode'), 'topics' => array('docs-policy'), 'engines' => array( 'version_control', @@ -379,12 +379,13 @@ // Merge all items from above. $items['pm-update'] = array( 'description' => 'Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb).', - 'aliases' => array('up'), + 'aliases' => array('up', 'pm:update'), 'allow-additional-options' => array('pm-updatecode', 'updatedb'), ); $items['pm-updatecode-postupdate'] = array( 'description' => 'Notify of pending db updates.', 'hidden' => TRUE, + 'aliases' => array('pm:updatecode:postupdate'), ); $items['pm-releasenotes'] = array( 'description' => 'Print release notes for given projects.', @@ -399,7 +400,7 @@ 'drush rln token-1.13' => 'View release notes of a specfic version of the Token project for my version of Drupal.', 'drush rln pathauto zen' => 'View release notes for the recommended version of Pathauto and Zen projects.', ), - 'aliases' => array('rln'), + 'aliases' => array('rln', 'pm:releasenotes'), 'bootstrap' => DRUSH_BOOTSTRAP_MAX, 'engines' => array( 'release_info', @@ -416,7 +417,7 @@ 'options' => array( 'default-major' => 'Show releases compatible with the specified major version of Drupal.', ), - 'aliases' => array('rl'), + 'aliases' => array('rl', 'pm:releases'), 'bootstrap' => DRUSH_BOOTSTRAP_MAX, 'outputformat' => array( 'default' => 'table', @@ -474,7 +475,7 @@ 'pipe' => 'Returns a list of the names of the extensions (modules and themes) contained in the downloaded projects.', ), 'bootstrap' => DRUSH_BOOTSTRAP_MAX, - 'aliases' => array('dl'), + 'aliases' => array('dl', 'pm:download'), 'engines' => array( 'version_control', 'package_handler', diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/sql/sql.drush.inc --- a/vendor/drush/drush/commands/sql/sql.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/sql/sql.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -52,6 +52,7 @@ ), ) + $options + $db_url, 'topics' => array('docs-policy'), + 'aliases' => array('sql:drop'), ); $items['sql-conf'] = array( 'description' => 'Print database connection details using print_r().', @@ -66,6 +67,7 @@ 'pipe-format' => 'var_export', 'private-fields' => 'password', ), + 'aliases' => array('sql:conf'), ); $items['sql-connect'] = array( 'description' => 'A string for connecting to the DB.', @@ -80,6 +82,7 @@ '`drush sql-connect` < example.sql' => 'Bash: Import SQL statements from a file into the current database.', 'eval (drush sql-connect) < example.sql' => 'Fish: Import SQL statements from a file into the current database.', ), + 'aliases' => array('sql:connect'), ); $items['sql-create'] = array( 'description' => 'Create a database.', @@ -94,6 +97,7 @@ 'db-su' => 'Account to use when creating a new database. Optional.', 'db-su-pw' => 'Password for the "db-su" account. Optional.', ) + $options + $db_url, + 'aliases' => array('sql:create'), ); $items['sql-dump'] = array( 'description' => 'Exports the Drupal DB as SQL using mysqldump or equivalent.', @@ -115,6 +119,7 @@ 'gzip' => 'Compress the dump using the gzip program which must be in your $PATH.', 'extra' => 'Add custom options to the dump command.', ) + $options + $db_url, + 'aliases' => array('sql:dump'), ); $items['sql-query'] = array( 'bootstrap' => DRUSH_BOOTSTRAP_NONE, @@ -144,14 +149,14 @@ 'hidden' => TRUE, // Hide since this is only used with --backend calls. ) ) + $options + $db_url, - 'aliases' => array('sqlq'), + 'aliases' => array('sqlq', 'sql:query'), ); $items['sql-cli'] = array( 'description' => "Open a SQL command-line interface using Drupal's credentials.", 'bootstrap' => DRUSH_BOOTSTRAP_NONE, // 'options' => $options + $db_url, 'allow-additional-options' => array('sql-connect'), - 'aliases' => array('sqlc'), + 'aliases' => array('sqlc', 'sql:cli'), 'examples' => array( 'drush sql-cli' => "Open a SQL command-line interface using Drupal's credentials.", 'drush sql-cli --extra=-A' => "Open a SQL CLI and skip reading table information.", diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/commands/user/user.drush.inc --- a/vendor/drush/drush/commands/user/user.drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/commands/user/user.drush.inc Thu May 09 15:33:08 2019 +0100 @@ -42,7 +42,7 @@ $items['user-information'] = array( 'description' => 'Print information about the specified user(s).', - 'aliases' => array('uinf'), + 'aliases' => array('uinf', 'user:information'), 'examples' => array( 'drush user-information 2,3,someguy,somegal,billgates@microsoft.com' => 'Display information about the listed users.', @@ -87,7 +87,7 @@ ); $items['user-block'] = array( 'description' => 'Block the specified user(s).', - 'aliases' => array('ublk'), + 'aliases' => array('ublk', 'user:block'), 'arguments' => array( 'users' => 'A comma delimited list of uids, user names, or email addresses.', ), @@ -99,7 +99,7 @@ ); $items['user-unblock'] = array( 'description' => 'Unblock the specified user(s).', - 'aliases' => array('uublk'), + 'aliases' => array('uublk', 'user:unblock'), 'arguments' => array( 'users' => 'A comma delimited list of uids, user names, or email addresses.', ), @@ -111,7 +111,7 @@ ); $items['user-add-role'] = array( 'description' => 'Add a role to the specified user accounts.', - 'aliases' => array('urol'), + 'aliases' => array('urol', 'user:add:role'), 'arguments' => array( 'role' => 'The name of the role to add', 'users' => '(optional) A comma delimited list of uids, user names, or email addresses.', @@ -125,7 +125,7 @@ ); $items['user-remove-role'] = array( 'description' => 'Remove a role from the specified user accounts.', - 'aliases' => array('urrol'), + 'aliases' => array('urrol', 'user:remove:role'), 'arguments' => array( 'role' => 'The name of the role to remove', 'users' => '(optional) A comma delimited list of uids, user names, or email addresses.', @@ -139,7 +139,7 @@ ); $items['user-create'] = array( 'description' => 'Create a user account with the specified name.', - 'aliases' => array('ucrt'), + 'aliases' => array('ucrt', 'user:create'), 'arguments' => array( 'name' => 'The name of the account to add' ), @@ -156,7 +156,7 @@ ); $items['user-cancel'] = array( 'description' => 'Cancel a user account with the specified name.', - 'aliases' => array('ucan'), + 'aliases' => array('ucan', 'user:cancel'), 'arguments' => array( 'name' => 'The name of the account to cancel', ), @@ -171,7 +171,7 @@ ); $items['user-password'] = array( 'description' => '(Re)Set the password for the user account with the specified name.', - 'aliases' => array('upwd'), + 'aliases' => array('upwd', 'user:password'), 'arguments' => array( 'name' => 'The name of the account to modify.' ), @@ -190,7 +190,7 @@ ); $items['user-login'] = array( 'description' => 'Display a one time login link for the given user account (defaults to uid 1).', - 'aliases' => array('uli'), + 'aliases' => array('uli', 'user:login'), 'bootstrap' => DRUSH_BOOTSTRAP_NONE, 'handle-remote-commands' => TRUE, 'arguments' => array( diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/composer.json --- a/vendor/drush/drush/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/composer.json Thu May 09 15:33:08 2019 +0100 @@ -36,7 +36,7 @@ "php": ">=5.4.5", "psr/log": "~1.0", "psy/psysh": "~0.6", - "consolidation/annotated-command": "^2.9.1", + "consolidation/annotated-command": "^2.12.0", "consolidation/output-formatters": "~3", "symfony/yaml": "~2.3|^3", "symfony/var-dumper": "~2.7|^3", @@ -44,6 +44,7 @@ "symfony/event-dispatcher": "~2.7|^3", "symfony/finder": "~2.7|^3", "pear/console_table": "~1.3.1", + "webflo/drupal-finder": "^1.1.0", "webmozart/path-util": "~2" }, "require-dev": { @@ -63,6 +64,9 @@ "psr-0": { "Drush": "lib/", "Consolidation": "lib/" + }, + "psr-4": { + "Drush\\": "src/" } }, "autoload-dev": { @@ -72,7 +76,8 @@ }, "scripts": { "lint": [ - "find includes -name '*.inc' -print0 | xargs -0 -n1 php -l" + "find includes -name '*.inc' -print0 | xargs -0 -n1 php -l", + "find lib/Drush -name '*.php' -print0 | xargs -0 -n1 php -l" ] }, "extra": { diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/composer.lock --- a/vendor/drush/drush/composer.lock Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/composer.lock Thu May 09 15:33:08 2019 +0100 @@ -4,38 +4,82 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "212f332e747566b2707730cb23824682", + "content-hash": "6350957e1c82365d6a7199dd8d1289b1", "packages": [ { "name": "consolidation/annotated-command", - "version": "2.9.1", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac" + "reference": "512a2e54c98f3af377589de76c43b24652bcb789" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac", - "reference": "4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/512a2e54c98f3af377589de76c43b24652bcb789", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789", "shasum": "" }, "require": { - "consolidation/output-formatters": "^3.1.12", - "php": ">=5.4.0", + "consolidation/output-formatters": "^3.4", + "php": ">=5.4.5", "psr/log": "^1", "symfony/console": "^2.8|^3|^4", "symfony/event-dispatcher": "^2.5|^3|^4", "symfony/finder": "^2.5|^3|^4" }, "require-dev": { - "g1a/composer-test-scenarios": "^2", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", "phpunit/phpunit": "^6", - "satooshi/php-coveralls": "^2", "squizlabs/php_codesniffer": "^2.7" }, "type": "library", "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + }, + "phpunit4": { + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, "branch-alias": { "dev-master": "2.x-dev" } @@ -56,23 +100,24 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2018-09-19T17:47:18+00:00" + "time": "2019-03-08T16:55:03+00:00" }, { "name": "consolidation/output-formatters", - "version": "3.2.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5" + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/d78ef59aea19d3e2e5a23f90a055155ee78a0ad5", - "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", "shasum": "" }, "require": { + "dflydev/dot-access-data": "^1.1.0", "php": ">=5.4.0", "symfony/console": "^2.8|^3|^4", "symfony/finder": "^2.5|^3|^4" @@ -111,7 +156,66 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2018-05-25T18:02:34+00:00" + "time": "2018-10-19T22:35:38+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -148,32 +252,32 @@ }, { "name": "jakub-onderka/php-console-color", - "version": "0.1", + "version": "v0.2", "source": { "type": "git", "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" + "reference": "d5deaecff52a0d61ccb613bb3804088da0307191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", + "reference": "d5deaecff52a0d61ccb613bb3804088da0307191", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.4.0" }, "require-dev": { "jakub-onderka/php-code-style": "1.0", - "jakub-onderka/php-parallel-lint": "0.*", + "jakub-onderka/php-parallel-lint": "1.0", "jakub-onderka/php-var-dump-check": "0.*", - "phpunit/phpunit": "3.7.*", + "phpunit/phpunit": "~4.3", "squizlabs/php_codesniffer": "1.*" }, "type": "library", "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleColor": "src/" + "psr-4": { + "JakubOnderka\\PhpConsoleColor\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -183,41 +287,41 @@ "authors": [ { "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com", - "homepage": "http://www.acci.cz" + "email": "jakub.onderka@gmail.com" } ], - "time": "2014-04-08T15:00:19+00:00" + "time": "2018-09-29T17:23:10+00:00" }, { "name": "jakub-onderka/php-console-highlighter", - "version": "v0.3.2", + "version": "v0.4", "source": { "type": "git", "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" + "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/9f7a229a69d52506914b4bc61bfdb199d90c5547", + "reference": "9f7a229a69d52506914b4bc61bfdb199d90c5547", "shasum": "" }, "require": { - "jakub-onderka/php-console-color": "~0.1", - "php": ">=5.3.0" + "ext-tokenizer": "*", + "jakub-onderka/php-console-color": "~0.2", + "php": ">=5.4.0" }, "require-dev": { "jakub-onderka/php-code-style": "~1.0", - "jakub-onderka/php-parallel-lint": "~0.5", + "jakub-onderka/php-parallel-lint": "~1.0", "jakub-onderka/php-var-dump-check": "~0.1", "phpunit/phpunit": "~4.0", "squizlabs/php_codesniffer": "~1.5" }, "type": "library", "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleHighlighter": "src/" + "psr-4": { + "JakubOnderka\\PhpConsoleHighlighter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -231,7 +335,8 @@ "homepage": "http://www.acci.cz/" } ], - "time": "2015-04-20T18:58:01+00:00" + "description": "Highlight PHP code in terminal", + "time": "2018-09-29T18:48:56+00:00" }, { "name": "nikic/php-parser", @@ -341,16 +446,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -384,27 +489,27 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "psy/psysh", - "version": "v0.9.8", + "version": "v0.9.9", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "ed3c32c4304e1a678a6e0f9dc11dd2d927d89555" + "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/ed3c32c4304e1a678a6e0f9dc11dd2d927d89555", - "reference": "ed3c32c4304e1a678a6e0f9dc11dd2d927d89555", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", + "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", "shasum": "" }, "require": { "dnoegel/php-xdg-base-dir": "0.1", "ext-json": "*", "ext-tokenizer": "*", - "jakub-onderka/php-console-highlighter": "0.3.*", + "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*", "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", "php": ">=5.4.0", "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", @@ -458,20 +563,20 @@ "interactive", "shell" ], - "time": "2018-09-05T11:40:09+00:00" + "time": "2018-10-13T15:16:03+00:00" }, { "name": "symfony/console", - "version": "v2.8.45", + "version": "v2.8.49", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0c1fcbb9afb5cff992c982ff99c0434f0146dcfc" + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0c1fcbb9afb5cff992c982ff99c0434f0146dcfc", - "reference": "0c1fcbb9afb5cff992c982ff99c0434f0146dcfc", + "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", "shasum": "" }, "require": { @@ -519,20 +624,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:13:39+00:00" + "time": "2018-11-20T15:55:20+00:00" }, { "name": "symfony/debug", - "version": "v2.8.45", + "version": "v2.8.49", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "cbb8a5f212148964efbc414838c527229f9951b7" + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/cbb8a5f212148964efbc414838c527229f9951b7", - "reference": "cbb8a5f212148964efbc414838c527229f9951b7", + "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", "shasum": "" }, "require": { @@ -576,20 +681,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-08-03T09:45:57+00:00" + "time": "2018-11-11T11:18:13+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.45", + "version": "v2.8.49", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "84ae343f39947aa084426ed1138bb96bf94d1f12" + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/84ae343f39947aa084426ed1138bb96bf94d1f12", - "reference": "84ae343f39947aa084426ed1138bb96bf94d1f12", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", "shasum": "" }, "require": { @@ -636,20 +741,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:03:18+00:00" + "time": "2018-11-21T14:20:20+00:00" }, { "name": "symfony/finder", - "version": "v2.8.45", + "version": "v2.8.49", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "f0de0b51913eb2caab7dfed6413b87e14fca780e" + "reference": "1444eac52273e345d9b95129bf914639305a9ba4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f0de0b51913eb2caab7dfed6413b87e14fca780e", - "reference": "f0de0b51913eb2caab7dfed6413b87e14fca780e", + "url": "https://api.github.com/repos/symfony/finder/zipball/1444eac52273e345d9b95129bf914639305a9ba4", + "reference": "1444eac52273e345d9b95129bf914639305a9ba4", "shasum": "" }, "require": { @@ -685,11 +790,11 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:13:39+00:00" + "time": "2018-11-11T11:18:13+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -732,7 +837,7 @@ }, { "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "email": "backendtea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -747,16 +852,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -802,20 +907,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/var-dumper", - "version": "v2.8.45", + "version": "v2.8.49", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "4f935cf61c3733ca662628425eac69b38c2bbb4c" + "reference": "91abb1e39d14fb7773d25de9c711949ea8502ac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/4f935cf61c3733ca662628425eac69b38c2bbb4c", - "reference": "4f935cf61c3733ca662628425eac69b38c2bbb4c", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/91abb1e39d14fb7773d25de9c711949ea8502ac1", + "reference": "91abb1e39d14fb7773d25de9c711949ea8502ac1", "shasum": "" }, "require": { @@ -870,20 +975,20 @@ "debug", "dump" ], - "time": "2018-07-26T11:13:39+00:00" + "time": "2018-11-11T11:18:13+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.45", + "version": "v2.8.49", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "fbf876678e29dc634430dcf0096e216eb0004467" + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/fbf876678e29dc634430dcf0096e216eb0004467", - "reference": "fbf876678e29dc634430dcf0096e216eb0004467", + "url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b", + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b", "shasum": "" }, "require": { @@ -920,24 +1025,62 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:03:18+00:00" + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "webflo/drupal-finder", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-finder.git", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/8a7886c575d6eaa67a425dceccc84e735c0b9637", + "reference": "8a7886c575d6eaa67a425dceccc84e735c0b9637", + "shasum": "" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/DrupalFinder.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Florian Weber", + "email": "florian@webflo.org" + } + ], + "description": "Helper class to locate a Drupal installation from a given path.", + "time": "2017-10-24T08:12:11+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -970,7 +1113,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2018-12-25T11:19:39+00:00" }, { "name": "webmozart/path-util", @@ -1560,6 +1703,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2015-10-02T06:51:40+00:00" }, { @@ -1936,16 +2080,16 @@ }, { "name": "symfony/process", - "version": "v2.7.49", + "version": "v2.7.50", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "df9e3c66fb62a1ee93002e8ec9cd4d831236f494" + "reference": "eda637e05670e2afeec3842dcd646dce94262f6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/df9e3c66fb62a1ee93002e8ec9cd4d831236f494", - "reference": "df9e3c66fb62a1ee93002e8ec9cd4d831236f494", + "url": "https://api.github.com/repos/symfony/process/zipball/eda637e05670e2afeec3842dcd646dce94262f6b", + "reference": "eda637e05670e2afeec3842dcd646dce94262f6b", "shasum": "" }, "require": { @@ -1981,7 +2125,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-15T08:20:41+00:00" + "time": "2018-08-03T11:24:48+00:00" } ], "aliases": [], diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/docs/make.md --- a/vendor/drush/drush/docs/make.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/docs/make.md Thu May 09 15:33:08 2019 +0100 @@ -1,6 +1,8 @@ Drush make ---------- +**Drush make is no longer maintained ([#3946](https://github.com/drush-ops/drush/issues/3946#issuecomment-467861007)), use [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) template for Drupal projects!** + Drush make is an extension to drush that can create a ready-to-use drupal site, pulling sources from various locations. It does this by parsing a flat text file (similar to a drupal `.info` file) and downloading the sources it describes. In @@ -484,7 +486,7 @@ type: "module" download: type: "git" - url: "http://git.drupal.org/project/views.git" + url: "https://git.drupal.org/project/views.git" A project or library entry of an included makefile can be removed entirely by setting the corresponding key to NULL: diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/drush.info --- a/vendor/drush/drush/drush.info Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/drush.info Thu May 09 15:33:08 2019 +0100 @@ -1,1 +1,1 @@ -drush_version=8.1.18 +drush_version=8.2.3 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/examples/example.make --- a/vendor/drush/drush/examples/example.make Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/examples/example.make Thu May 09 15:33:08 2019 +0100 @@ -36,7 +36,7 @@ ; Git clone of Drupal 7.x. Requires the `core` property to be set to 7.x. ; projects[drupal][type] = "core" ; projects[drupal][download][type] = git -; projects[drupal][download][url] = http://git.drupal.org/project/drupal.git +; projects[drupal][download][url] = https://git.drupal.org/project/drupal.git projects[] = drupal @@ -69,7 +69,7 @@ projects[data][type] = module projects[data][download][type] = git -projects[data][download][url] = http://git.drupal.org/project/views.git +projects[data][download][url] = https://git.drupal.org/project/views.git projects[data][download][revision] = DRUPAL-6--3 ; For projects on drupal.org, some shorthand is available. If any diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/examples/example.make.yml --- a/vendor/drush/drush/examples/example.make.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/examples/example.make.yml Thu May 09 15:33:08 2019 +0100 @@ -40,7 +40,7 @@ # drupal: # type: "core" # download: -# url: "http://git.drupal.org/project/drupal.git" +# url: "https://git.drupal.org/project/drupal.git" projects: drupal: @@ -80,7 +80,7 @@ type: "module" download: type: "git" # Note, 'git' is the default, no need to specify. - url: "http://git.drupal.org/project/views.git" + url: "https://git.drupal.org/project/views.git" revision: "7.x-3.x" # For projects on drupal.org, some shorthand is available. If any diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/includes/annotationcommand_adapter.inc --- a/vendor/drush/drush/includes/annotationcommand_adapter.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/includes/annotationcommand_adapter.inc Thu May 09 15:33:08 2019 +0100 @@ -16,6 +16,9 @@ use Consolidation\AnnotatedCommand\CommandData; use Drush\Command\DrushInputAdapter; use Drush\Command\DrushOutputAdapter; +use Drush\Drush; +use Drush\SiteAlias\AliasManagerAdapterInjector; +use Drush\SiteAlias\ProcessManagerInjector; use Symfony\Component\Console\Output\ConsoleOutput; @@ -103,9 +106,11 @@ unset($annotation_commandfiles[$key]); } } - $commands = annotationcommand_adapter_get_commands($annotation_commandfiles); + $site_wide_commands = annotationcommand_adapter_get_commands($annotation_commandfiles); $module_service_commands = drush_get_context('DRUSH_MODULE_SERVICE_COMMANDS'); - return array_merge($commands, $module_service_commands); + $commands = array_merge($site_wide_commands, $module_service_commands); + + return $commands; } /** @@ -245,6 +250,15 @@ $commandData->setIncludeOptionsInArgs($command['add-options-to-arguments']); $names = annotationcommand_adapter_command_names($command); + // For now, the only thing that can be injected is the InputInterface. + foreach ($command['injected-classes'] as $injected) { + switch ($injected) { + case 'Symfony\Component\Console\Input\InputInterface': + $commandData->injectInstance($input); + break; + } + } + // n.b.: backend result is set by a post-alter hook. $result = $commandprocessor->process( $output, @@ -290,6 +304,9 @@ return $commands; } +use Psr\Log\LoggerAwareInterface; + + /** * Create and cache a commandfile instance. * @@ -303,6 +320,22 @@ if (!isset($cache[$commandfile_path])) { include_once $commandfile_path; $commandhandler = new $commandfile_class; + + // Inject logger if requested + if ($commandhandler instanceof LoggerAwareInterface) { + $commandhandler->setLogger(Drush::logger()); + } + + if (class_exists('\Consolidation\SiteAlias\SiteAliasManager')) { + $alias_manager_injector = new AliasManagerAdapterInjector(); + $alias_manager_injector->inflect($commandhandler); + } + + if (class_exists('\Consolidation\SiteProcess\ProcessManager')) { + $process_manager_injector = new ProcessManagerInjector(); + $process_manager_injector->inflect($commandhandler); + } + $cache[$commandfile_path] = $commandhandler; } return $cache[$commandfile_path]; @@ -489,6 +522,7 @@ } } $command['annotations'] = $commandinfo->getAnnotations(); + $command['injected-classes'] = $commandinfo->getInjectedClasses(); // If the command has a '@return' annotation, then // remember information we will need to use the output formatter. $returnType = $commandinfo->getReturnType(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/includes/command.inc --- a/vendor/drush/drush/includes/command.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/includes/command.inc Thu May 09 15:33:08 2019 +0100 @@ -847,6 +847,7 @@ // into options (starting with a '-') and arguments. $arguments = $options = array(); + $verbosity = 0; for ($i = 1; $i < count($args); $i++) { $opt = $args[$i]; // We set $command_args to NULL until the first argument that is not @@ -861,7 +862,11 @@ if (strlen($opt) > 2 && $opt{1} != "-") { // Each char becomes a key of its own. for ($j = 1; $j < strlen($opt); $j++) { - $options[substr($opt, $j, 1)] = TRUE; + $opt_char = substr($opt, $j, 1); + $options[$opt_char] = TRUE; + if ($opt_char == 'v') { + ++$verbosity; + } } } // Do we have a longopt (starting with '--')? @@ -912,6 +917,9 @@ } } } + if ($verbosity >= 3) { + $options['debug'] = TRUE; + } // If no arguments are specified, then the command will // be either 'help' or 'version' (the latter if --version is specified) // @todo: it would be handy if one could do `drush @remote st --help` and diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/includes/drush.inc --- a/vendor/drush/drush/includes/drush.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/includes/drush.inc Thu May 09 15:33:08 2019 +0100 @@ -328,6 +328,7 @@ $options['redirect-port'] = array('hidden' => TRUE, 'never-propagate' => TRUE, 'description' => 'Used by the user-login command to specify the redirect port on the local machine; it therefore would not do to pass this to the remote machines.'); $options['cache-clear'] = array('propagate' => TRUE, 'description' => 'If 0, Drush skips normal cache clearing; the caller should then clear if needed.', 'example-value' => '0', ); $options['local'] = array('propagate' => TRUE, 'description' => 'Don\'t look in global locations for commandfiles, config, and site aliases'); + $options['no-interaction'] = array('hidden' => TRUE, 'description' => 'Synonym for --yes; provided for light forward-compatibility with future Drush versions.'); $options['ignored-directories'] = array('propagate' => TRUE, 'description' => "Exclude directories when searching for files in drush_scan_directory().", 'example-value' => 'node_modules,bower_components'); $command = array( diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/includes/environment.inc --- a/vendor/drush/drush/includes/environment.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/includes/environment.inc Thu May 09 15:33:08 2019 +0100 @@ -10,6 +10,7 @@ * @see includes/bootstrap.inc */ +use Drush\Drush; use Drush\Log\LogLevel; use Webmozart\PathUtil\Path; @@ -139,6 +140,10 @@ // Save original working dir case some command wants it. drush_set_context('DRUSH_OLDCWD', $path); + // Make a read-only copy of the original cwd at env.cwd + // for forwards-compatibility + drush_set_option('env.cwd', $path); + return $path; } @@ -608,9 +613,7 @@ * Read the drush info file. */ function drush_read_drush_info() { - $drush_info_file = dirname(__FILE__) . '/../drush.info'; - - return parse_ini_file($drush_info_file); + return Drush::ReadDrushInfo(); } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/includes/preflight.inc --- a/vendor/drush/drush/includes/preflight.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/includes/preflight.inc Thu May 09 15:33:08 2019 +0100 @@ -5,6 +5,7 @@ * Preflight, postflight and shutdown code. */ +use Drush\Drush; use Drush\Log\LogLevel; /** @@ -143,6 +144,10 @@ drush_set_context('DRUSH_VENDOR_PATH', dirname($vendor_path)); drush_set_context('DRUSH_CLASSLOADER', $classloader); + // Make a read-only copy of the vendor path at drush.vendor-dir + // for forwards-compatibility + drush_set_option('drush.vendor-dir', dirname($vendor_path)); + // Can't log until we have a logger, so we'll create this ASAP. _drush_create_default_logger(); @@ -165,17 +170,20 @@ return; // An error was logged. } - $drush_info = drush_read_drush_info(); - define('DRUSH_VERSION', $drush_info['drush_version']); - $version_parts = explode('.', DRUSH_VERSION); - define('DRUSH_MAJOR_VERSION', $version_parts[0]); - define('DRUSH_MINOR_VERSION', $version_parts[1]); + // For backwards compatibility. Prefer the static accessors. + define('DRUSH_VERSION', Drush::getVersion()); + define('DRUSH_MAJOR_VERSION', Drush::getMajorVersion()); + define('DRUSH_MINOR_VERSION', Drush::getMinorVersion()); define('DRUSH_REQUEST_TIME', microtime(TRUE)); drush_set_context('argc', $GLOBALS['argc']); drush_set_context('argv', $GLOBALS['argv']); + // Make a read-only copy of the arguments at runtime.argv + // for forwards-compatibility + drush_set_option('runtime.argv', $GLOBALS['argv']); + // Set an error handler and a shutdown function set_error_handler('drush_error_handler'); register_shutdown_function('drush_shutdown'); @@ -325,6 +333,13 @@ if (!isset($root)) { $root = drush_locate_root(); } + // If the old ways do not find a Drupal root, use DrupalFinder. + if (!$root) { + $finder = new \DrupalFinder\DrupalFinder(); + if ($finder->locateRoot(getcwd())) { + $root = $finder->getDrupalRoot(); + } + } if ($root) { $root = realpath($root); } @@ -382,7 +397,7 @@ // Backend implies affirmative unless negative is explicitly specified drush_set_context('DRUSH_NEGATIVE', drush_get_option('no', FALSE)); - drush_set_context('DRUSH_AFFIRMATIVE', drush_get_option(array('yes', 'pipe'), FALSE) || (drush_get_context('DRUSH_BACKEND') && !drush_get_context('DRUSH_NEGATIVE'))); + drush_set_context('DRUSH_AFFIRMATIVE', drush_get_option(array('yes', 'pipe', 'no-interaction'), FALSE) || (drush_get_context('DRUSH_BACKEND') && !drush_get_context('DRUSH_NEGATIVE'))); // Pipe implies quiet. drush_set_context('DRUSH_QUIET', drush_get_option(array('quiet', 'pipe'))); @@ -613,7 +628,7 @@ $local_drush = find_wrapper_or_launcher($root); } $is_local = drush_get_option('local'); - $must_use_site_local = !empty($root) && !empty($local_drush) && empty($is_local); + $must_use_site_local = !empty($root) && !empty($local_drush) && !empty($is_local); // If the command sets the 'handle-remote-commands' flag, then we will short-circuit // remote command dispatching and site-list command dispatching, and always let // the command handler run on the local machine. diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/lib/Drush/Commands/DrushCommands.php --- a/vendor/drush/drush/lib/Drush/Commands/DrushCommands.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/lib/Drush/Commands/DrushCommands.php Thu May 09 15:33:08 2019 +0100 @@ -1,16 +1,17 @@ config = $config; + } + + /** + * @inheritdoc + */ + public function has($key) + { + return $this->config->has($key); + } + + /** + * @inheritdoc + */ + public function get($key, $defaultFallback = null) + { + return $this->config->get($key, $defaultFallback); + } + + /** + * @inheritdoc + */ + public function set($key, $value) + { + $this->config->set($key, $value); + } + + /** + * @inheritdoc + */ + public function import($data) + { + return $this->config->import($data); + } + + /** + * @inheritdoc + */ + public function replace($data) + { + $this->config->replace($data); + } + + /** + * @inheritdoc + */ + public function combine($data) + { + return $this->config->combine($data); + } + + /** + * @inheritdoc + */ + public function export() + { + return $this->config->export(); + } + + /** + * @inheritdoc + */ + public function hasDefault($key) + { + return $this->config->hasDefault($key); + } + + /** + * @inheritdoc + */ + public function getDefault($key, $defaultFallback = null) + { + return $this->config->getDefault($key, $defaultFallback); + } + + /** + * @inheritdoc + */ + public function setDefault($key, $value) + { + return $this->setDefault($key, $value); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/lib/Drush/Drush.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/lib/Drush/Drush.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,413 @@ +setConfig(new ConfigAdapter(new DrushConfig())); + // TODO: static::$processManager->setConfigRuntime() + } + + return static::$processManager; + } + + /** + * Return the input object + * + * @return InputInterface + */ + public static function input() + { + if (!static::$input) { + static::$input = annotationcommand_adapter_input(); + } + + return static::$input; + } + + /** + * Return the output object + * + * @return OutputInterface + */ + public static function output() + { + if (!static::$output) { + static::$output = new DrushOutputAdapter(); + } + + return static::$output; + } + + /** + * Run a Drush command on a site alias (or @self). + * + * Tip: Use injected process manager instead of this method. See below. + * + * A class should use ProcessManagerAwareInterface / ProcessManagerAwareTrait + * in order to have the Process Manager injected by Drush's DI container. + * For example: + * + * use Consolidation\SiteProcess\ProcessManagerAwareTrait; + * use Consolidation\SiteProcess\ProcessManagerAwareInterface; + * + * abstract class DrushCommands implements ProcessManagerAwareInterface ... + * { + * use ProcessManagerAwareTrait; + * } + * + * Since DrushCommands already uses ProcessManagerAwareTrait, all Drush + * commands may use the process manager to call other Drush commands. + * Other classes will need to ensure that the process manager is injected + * as shown above. + * + * Note, however, that an alias record is required to use the `drush` method. + * The alias manager will provide an alias record, but the alias manager is + * not injected by default into Drush commands. In order to use it, it is + * necessary to use SiteAliasManagerAwareTrait: + * + * use Consolidation\SiteAlias\SiteAliasManagerAwareInterface; + * use Consolidation\SiteAlias\SiteAliasManagerAwareTrait; + * + * class SiteInstallCommands extends DrushCommands implements SiteAliasManagerAwareInterface + * { + * use SiteAliasManagerAwareTrait; + * + * public function install(array $profile, ...) + * { + * $selfRecord = $this->siteAliasManager()->getSelf(); + * $args = ['system.site', ...]; + * $options = ['yes' => true]; + * $process = $this->processManager()->drush(selfRecord, 'config-set', $args, $options); + * $process->mustRun(); + * } + * } + * + * Objects that are fetched from the DI container, or any Drush command will + * automatically be given a reference to the alias manager if SiteAliasManagerAwareTrait + * is used. Other objects will need to be manually provided with a reference + * to the alias manager once it is created (call $obj->setAliasManager($aliasManager);). + * + * Clients that are using Drush::drush(), and need a reference to the alias + * manager may use Drush::aliasManager(). + * + * @param SiteAliasInterface $siteAlias + * @param string $command + * @param array $args + * @param array $options + * @param array $options_double_dash + * @return SiteProcess + */ + public static function drush(SiteAliasInterface $siteAlias, $command, $args = [], $options = [], $options_double_dash = []) + { + return static::processManager()->drush($siteAlias, $command, $args, $options, $options_double_dash); + } + + /** + * Run a bash fragment on a site alias. U + * + * Use Drush::drush() instead of this method when calling Drush. + * Tip: Consider using injected process manager instead of this method. @see \Drush\Drush::drush(). + * + * @param SiteAliasInterface $siteAlias + * @param array $args + * @param array $options + * @param array $options_double_dash + * @return ProcessBase + */ + public static function siteProcess(SiteAliasInterface $siteAlias, $args = [], $options = [], $options_double_dash = []) + { + return static::processManager()->siteProcess($siteAlias, $args, $options, $options_double_dash); + } + + /** + * Run a bash fragment locally. + * + * The timeout parameter on this method doesn't work. It exists for compatibility with parent. + * Call this method to get a Process and then call setters as needed. + * + * Tip: Consider using injected process manager instead of this method. @see \Drush\Drush::drush(). + * + * @param string|array $commandline The command line to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input + * @param int|float|null $timeout The timeout in seconds or null to disable + * @param array $options An array of options for proc_open + * + * @return ProcessBase + * A wrapper around Symfony Process. + */ + public static function process($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60) + { + return static::processManager()->process($commandline, $cwd, $env, $input, $timeout); + } + + /** + * Create a Process instance from a commandline string. + * + * Tip: Consider using injected process manager instead of this method. @see \Drush\Drush::drush(). + * + * @param string $command The commandline string to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input + * @param int|float|null $timeout The timeout in seconds or null to disable + * @return Process + */ + public static function shell($command, $cwd = null, array $env = null, $input = null, $timeout = 60) + { + return static::processManager()->shell($command, $cwd, $env, $input, $timeout); + } + + /** + * Return the path to this Drush. + * + * @deprecated Inject configuration and use $this->getConfig()->drushScript(). + */ + public static function drushScript() + { + return \Drush\Drush::config()->drushScript(); + } + + /** + * Return 'true' if we are in simulated mode + * + * @deprecated Inject configuration and use $this->getConfig()->simulate(). + */ + public static function simulate() + { + return \Drush\Drush::config()->simulate(); + } + + /** + * Return 'true' if we are in backend mode + * + * @deprecated Inject configuration and use $this->getConfig()->backend(). + */ + public static function backend() + { + return \Drush\Drush::config()->backend(); + } + + /** + * Return 'true' if we are in affirmative mode + */ + public static function affirmative() + { + return drush_get_context('DRUSH_AFFIRMATIVE'); + } + + /** + * Return 'true' if we are in negative mode + */ + public static function negative() + { + return drush_get_context('DRUSH_NEGATIVE'); + } + + /** + * Return 'true' if we are in verbose mode + */ + public static function verbose() + { + return drush_get_context('DRUSH_VERBOSE'); + } + + /** + * Return 'true' if we are in debug mode + */ + public static function debug() + { + return drush_get_context('DRUSH_DEBUG'); + } + + // public static function bootstrapManager() + + // public static function bootstrap() + + public static function redispatchOptions() + { + return drush_redispatch_get_options(); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/lib/Drush/DrushConfig.php --- a/vendor/drush/drush/lib/Drush/DrushConfig.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/lib/Drush/DrushConfig.php Thu May 09 15:33:08 2019 +0100 @@ -1,6 +1,8 @@ $value) { + $data->set("options.$key", $value); + unset($contextData[$key]); + } + foreach ($contextData as $key => $value) { + $data->set($key, $value); + } + return $data->export(); + } + + /** * Return the default value for a given configuration item. * * @param string $key @@ -91,4 +114,25 @@ { drush_set_default($key, $value); } + + /** + * Determine whether we are in 'backend' mode + */ + public function backend() + { + return drush_get_context('DRUSH_BACKEND'); + } + + /** + * Determine whether we are in 'simulate' mode + */ + public function simulate() + { + return drush_get_context('DRUSH_SIMULATE'); + } + + public function drushScript() + { + return DRUSH_COMMAND; + } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/lib/Drush/Exceptions/UserAbortException.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/lib/Drush/Exceptions/UserAbortException.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +getAlias($name); + } + + /** + * @inheritdoc + */ + public function getSelf() + { + return $this->getAlias('@self'); + } + + /** + * @inheritdoc + */ + public function getAlias($aliasName) + { + $record = drush_sitealias_get_record($aliasName); + + // TODO: Convert $record to new site alias layout + + return new SiteAlias($record, $aliasName); + } + + /** + * @inheritdoc + */ + public function getMultiple($name = '') + { + // Not supported + return false; + } + + /** + * @inheritdoc + */ + public function listAllFilePaths($location = '') + { + // Not supported + return []; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapterInjector.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/lib/Drush/SiteAlias/AliasManagerAdapterInjector.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,18 @@ +setSiteAliasManager(Drush::aliasManager()); + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/lib/Drush/SiteAlias/ProcessManager.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/lib/Drush/SiteAlias/ProcessManager.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,159 @@ +drushSiteProcess($siteAlias, $args, $options, $options_double_dash); + } + + /** + * drushSiteProcess should be avoided in favor of the drush method above. + * drushSiteProcess exists specifically for use by the RedispatchHook, + * which does not have specific knowledge about which argument is the command. + * + * @param SiteAliasInterface $siteAlias + * @param array $args + * @param array $options + * @param array $options_double_dash + * @return ProcessBase + */ + public function drushSiteProcess(SiteAliasInterface $siteAlias, $args = [], $options = [], $options_double_dash = []) + { + // Fill in the root and URI from the site alias, if the caller + // did not already provide them in $options. + if ($siteAlias->has('uri')) { + $options += [ 'uri' => $siteAlias->uri(), ]; + } + if ($siteAlias->hasRoot()) { + $options += [ 'root' => $siteAlias->root(), ]; + } + + // The executable is always 'drush' (at some path or another) + array_unshift($args, $this->drushScript($siteAlias)); + + return $this->siteProcess($siteAlias, $args, $options, $options_double_dash); + } + + /** + * Determine the path to Drush to use + */ + public function drushScript(SiteAliasInterface $siteAlias) + { + $defaultDrushScript = 'drush'; + + // If the site alias has 'paths.drush-script', always use that. + if ($siteAlias->has('paths.drush-script')) { + return $siteAlias->get('paths.drush-script'); + } + + // If the provided site alias is for a remote site / container et. al., + // then use the 'drush' in the $PATH. + if ($this->hasTransport($siteAlias)) { + return $defaultDrushScript; + } + + // If the target is a local Drupal site that has a vendor/bin/drush, + // then use that. + if ($siteAlias->hasRoot()) { + $localDrushScript = Path::join($siteAlias->root(), 'vendor/bin/drush'); + if (file_exists($localDrushScript)) { + return $localDrushScript; + } + } + + // Otherwise, use the path to the version of Drush that is running + // right now (if available). + return $this->getConfig()->get('runtime.drush-script', $defaultDrushScript); + } + + /** + * @inheritdoc + * + * Use Drush::drush() or ProcessManager::drush() instead of this method + * when calling Drush. + */ + public function siteProcess(SiteAliasInterface $siteAlias, $args = [], $options = [], $optionsPassedAsArgs = []) + { + $process = parent::siteProcess($siteAlias, $args, $options, $optionsPassedAsArgs); + return $this->configureProcess($process); + } + + /** + * Run a bash fragment locally. + * + * The timeout parameter on this method doesn't work. It exists for compatibility with parent. + * Call this method to get a Process and then call setters as needed. + * + * @param array $commandline The command line to run with arguments as separate items in an array + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input + * @param int|float|null $timeout The timeout in seconds or null to disable + * + * @return ProcessBase + * A wrapper around Symfony Process. + */ + public function process($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60) + { + $process = parent::process($commandline, $cwd, $env, $input, $timeout); + return $this->configureProcess($process); + } + + /** + * Create a Process instance from a commandline string. + * @param string $command The commandline string to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input + * @param int|float|null $timeout The timeout in seconds or null to disable + * @return Process + */ + public function shell($command, $cwd = null, array $env = null, $input = null, $timeout = 60) + { + $process = parent::shell($command, $cwd, $env, $input, $timeout); + return $this->configureProcess($process); + } + + /** + * configureProcess sets up a process object so that it is ready to use. + */ + protected static function configureProcess(ProcessBase $process) + { + $process->setSimulated(Drush::simulate()); + $process->setVerbose(Drush::verbose()); + $process->inheritEnvironmentVariables(); + $process->setLogger(Drush::logger()); + $process->setRealtimeOutput(new SymfonyStyle(Drush::input(), Drush::output())); + $process->setTimeout(Drush::getTimeout()); + return $process; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/lib/Drush/SiteAlias/ProcessManagerInjector.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/lib/Drush/SiteAlias/ProcessManagerInjector.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,19 @@ +setProcessManager(Drush::processManager()); + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/src/TestTraits/CliTestTrait.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/src/TestTraits/CliTestTrait.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,222 @@ +process ? $this->process->getOutput() : ''; + } + + /** + * Accessor for the last stderr output, non-trimmed. + * + * @return string + * Raw stderr as text. + * + * @access public + */ + public function getErrorOutputRaw() + { + return $this->process ? $this->process->getErrorOutput() : ''; + } + + /** + * Actually runs the command. + * + * @param string $command + * The actual command line to run. + * @param integer $expected_return + * The return code to expect + * @param sting cd + * The directory to run the command in. + * @param array $env + * Extra environment variables. + * @param string $input + * A string representing the STDIN that is piped to the command. + */ + public function execute($command, $expected_return = 0, $cd = null, $env = null, $input = null) + { + try { + // Process uses a default timeout of 60 seconds, set it to 0 (none). + $this->process = new Process($command, $cd, $env, $input, 0); + $this->process->inheritEnvironmentVariables(true); + if ($this->timeout) { + $this->process->setTimeout($this->timeout) + ->setIdleTimeout($this->idleTimeout); + } + $return = $this->process->run(); + if ($expected_return !== $return) { + $message = 'Unexpected exit code ' . $return . ' (expected ' . $expected_return . ") for command:\n" . $command; + throw new \Exception($message . $this->buildProcessMessage()); + } + // Reset timeouts to default. + $this->timeout = $this->defaultTimeout; + $this->idleTimeout = $this->defaultIdleTimeout; + } catch (ProcessTimedOutException $e) { + if ($e->isGeneralTimeout()) { + $message = 'Command runtime exceeded ' . $this->timeout . " seconds:\n" . $command; + } else { + $message = 'Command had no output for ' . $this->idleTimeout . " seconds:\n" . $command; + } + throw new \Exception($message . $this->buildProcessMessage()); + } + } + + public static function escapeshellarg($arg) + { + // Short-circuit escaping for simple params (keep stuff readable) + if (preg_match('|^[a-zA-Z0-9.:/_-]*$|', $arg)) { + return $arg; + } elseif (self::isWindows()) { + return self::_escapeshellargWindows($arg); + } else { + return escapeshellarg($arg); + } + } + + public static function isWindows() + { + return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; + } + + public static function _escapeshellargWindows($arg) + { + // Double up existing backslashes + $arg = preg_replace('/\\\/', '\\\\\\\\', $arg); + + // Double up double quotes + $arg = preg_replace('/"/', '""', $arg); + + // Double up percents. + $arg = preg_replace('/%/', '%%', $arg); + + // Add surrounding quotes. + $arg = '"' . $arg . '"'; + + return $arg; + } + + /** + * Borrowed from \Symfony\Component\Process\Exception\ProcessTimedOutException + * + * @return string + */ + public function buildProcessMessage() + { + $error = sprintf( + "%s\n\nExit Code: %s(%s)\n\nWorking directory: %s", + $this->process->getCommandLine(), + $this->process->getExitCode(), + $this->process->getExitCodeText(), + $this->process->getWorkingDirectory() + ); + + if (!$this->process->isOutputDisabled()) { + $error .= sprintf( + "\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", + $this->process->getOutput(), + $this->process->getErrorOutput() + ); + } + + return $error; + } + + /** + * Checks that the output matches the expected output. + * + * This matches against a simplified version of the actual output that has + * absolute paths and duplicate whitespace removed, to avoid false negatives + * on minor differences. + * + * @param string $expected + * The expected output. + * @param string $filter + * Optional regular expression that should be ignored in the error output. + */ + + protected function assertOutputEquals($expected, $filter = '') + { + $output = $this->getSimplifiedOutput(); + if (!empty($filter)) { + $output = preg_replace($filter, '', $output); + } + $this->assertEquals($expected, $output); + } + + /** + * Checks that the error output matches the expected output. + * + * This matches against a simplified version of the actual output that has + * absolute paths and duplicate whitespace removed, to avoid false negatives + * on minor differences. + * + * @param string $expected + * The expected output. + * @param string $filter + * Optional regular expression that should be ignored in the error output. + */ + protected function assertErrorOutputEquals($expected, $filter = '') + { + $output = $this->getSimplifiedErrorOutput(); + if (!empty($filter)) { + $output = preg_replace($filter, '', $output); + } + $this->assertEquals($expected, $output); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/src/TestTraits/DrushTestTrait.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/src/TestTraits/DrushTestTrait.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,116 @@ +&1. + * @param array $env + * Environment variables to pass along to the subprocess. + */ + public function drush($command, array $args = [], array $options = [], $site_specification = null, $cd = null, $expected_return = 0, $suffix = null, $env = []) + { + // Set UA for SimpleTests which typically extend BrowserTestCase (i.e. contrib modules). + if (isset($this->databasePrefix) && function_exists('drupal_generate_test_ua') && !isset($env['HTTP_USER_AGENT'])) { + $env['HTTP_USER_AGENT'] = drupal_generate_test_ua($this->databasePrefix); + } + + $global_option_list = ['simulate', 'root', 'uri', 'include', 'config', 'alias-path', 'ssh-options']; + $cmd[] = self::getPathToDrush(); + + // Insert global options. + foreach ($options as $key => $value) { + if (in_array($key, $global_option_list)) { + unset($options[$key]); + $cmd[] = $this->convertKeyValueToFlag($key, $value); + } + } + + $cmd[] = "--no-interaction"; + + // Insert site specification and drush command. + if (!empty($site_specification)) { + $cmd[] = self::escapeshellarg($site_specification); + } + $cmd[] = $command; + + // Insert drush command arguments. + foreach ($args as $arg) { + $cmd[] = self::escapeshellarg($arg); + } + // insert drush command options + foreach ($options as $key => $value) { + $cmd[] = $this->convertKeyValueToFlag($key, $value); + } + + $cmd[] = $suffix; + $exec = array_filter($cmd, 'strlen'); // Remove NULLs + + $cmd = implode(' ', $exec); + $this->execute($cmd, $expected_return, $cd, $env); + } + + /** + * Given an option key / value pair, convert to a + * "--key=value" string. + * + * @param string $key The option name + * @param string $value The option value (or empty) + * @return string + */ + protected function convertKeyValueToFlag($key, $value) + { + if (!isset($value)) { + return "--$key"; + } + return "--$key=" . self::escapeshellarg($value); + } + + /** + * Return the major version of Drush + * + * @return string e.g. "8" or "9" + */ + public function drushMajorVersion() + { + static $major; + + if (!isset($major)) { + $this->drush('version', [], ['field' => 'drush-version']); + $version = trim($this->getOutput()); + list($major) = explode('.', $version); + } + return (int)$major; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/src/TestTraits/OutputUtilsTrait.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/src/TestTraits/OutputUtilsTrait.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,165 @@ +simplifyOutput($this->getOutput()); + } + + /** + * Returns a simplified version of the error output to facilitate testing. + * + * @return string + * A simplified version of the error output that has things like full + * paths and superfluous whitespace removed from it. + */ + protected function getSimplifiedErrorOutput() + { + return $this->simplifyOutput($this->getErrorOutput()); + } + + /** + * Remove things like full paths and extra whitespace from the given string. + * + * @param string $output + * The output string to simplify. + * + * @return string + * The simplified output. + */ + protected function simplifyOutput($output) + { + // We do not care if Drush inserts a -t or not in the string. Depends on whether there is a tty. + $output = preg_replace('# -t #', ' ', $output); + // Remove multiple blank lines + $output = preg_replace("#\n\n\n*#m", "\n\n", $output); + // Remove double spaces from output to help protect test from false negatives if spacing changes subtly + $output = preg_replace('# *#', ' ', $output); + // Remove leading and trailing spaces. + $output = preg_replace('#^[ \t]*#m', '', $output); + $output = preg_replace('#[ \t]*$#m', '', $output); + // Remove verbose info for rsync. + $output = preg_replace('# -akzv --stats --progress #', ' -akz ', $output); + // Debug flags may be added to command strings if we are in debug mode. Take those out so that tests in phpunit --debug mode work + $output = preg_replace('# --debug #', ' ', $output); + $output = preg_replace('# --verbose #', ' ', $output); + $output = preg_replace('# -vvv #', ' ', $output); + + foreach ($this->pathsToSimplify() as $path => $simplification) { + $output = str_replace($path, $simplification, $output); + } + + return $output; + } + + public function pathsToSimplify() + { + return []; + } + + /** + * Accessor for the last output, trimmed. + * + * @return string + * Trimmed output as text. + * + * @access public + */ + public function getOutput() + { + return trim($this->getOutputRaw()); + } + + /** + * Accessor for the last stderr output, trimmed. + * + * @return string + * Trimmed stderr as text. + * + * @access public + */ + public function getErrorOutput() + { + return trim($this->getErrorOutputRaw()); + } + + /** + * Accessor for the last output, rtrimmed and split on newlines. + * + * @return array + * Output as array of lines. + * + * @access public + */ + public function getOutputAsList() + { + return array_map('rtrim', explode("\n", $this->getOutput())); + } + + /** + * Accessor for the last stderr output, rtrimmed and split on newlines. + * + * @return array + * Stderr as array of lines. + * + * @access public + */ + public function getErrorOutputAsList() + { + return array_map('rtrim', explode("\n", $this->getErrorOutput())); + } + + /** + * Accessor for the last output, decoded from json. + * + * @param string $key + * Optionally return only a top level element from the json object. + * + * @return object + * Decoded object. + */ + public function getOutputFromJSON($key = null) + { + $output = $this->getOutput(); + $json = json_decode($output, true); + if (!$json) { + throw new \Exception("No json output received.\n\nOutput:\n\n$output\n\nStderr:\n\n" . $this->getErrorOutput()); + } + if (isset($key)) { + $json = $json[$key]; + } + return $json; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/tests/makeTest.php --- a/vendor/drush/drush/tests/makeTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/tests/makeTest.php Thu May 09 15:33:08 2019 +0100 @@ -319,7 +319,7 @@ // Verify that a reference cache was created. $cache_dir = UNISH_CACHE . DIRECTORY_SEPARATOR . 'cache'; - $this->assertFileExists($cache_dir . '/git/cck_signup-' . md5('http://git.drupal.org/project/cck_signup.git')); + $this->assertFileExists($cache_dir . '/git/cck_signup-' . md5('https://git.drupal.org/project/cck_signup.git')); // Test context_admin.info file. $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/context_admin/context_admin.info'); @@ -329,7 +329,7 @@ $this->assertContains('project = "context_admin"', $contents); // Verify git reference cache exists. - $this->assertFileExists($cache_dir . '/git/context_admin-' . md5('http://git.drupal.org/project/context_admin.git')); + $this->assertFileExists($cache_dir . '/git/context_admin-' . md5('https://git.drupal.org/project/context_admin.git')); // Text caption_filter .info rewrite. $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/contrib/caption_filter/caption_filter.info'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/tests/makefiles/git.make --- a/vendor/drush/drush/tests/makefiles/git.make Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/tests/makefiles/git.make Thu May 09 15:33:08 2019 +0100 @@ -27,5 +27,5 @@ ; Test a refspec fetch. projects[storypal][type] = module projects[storypal][download][type] = git -projects[storypal][download][url] = http://git.drupal.org/project/storypal.git +projects[storypal][download][url] = https://git.drupal.org/project/storypal.git projects[storypal][download][refspec] = refs/tags/7.x-1.0 diff -r 129ea1e6d783 -r af1871eacc83 vendor/drush/drush/tests/pmEnDisUnListInfoTest.php --- a/vendor/drush/drush/tests/pmEnDisUnListInfoTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/drush/drush/tests/pmEnDisUnListInfoTest.php Thu May 09 15:33:08 2019 +0100 @@ -112,6 +112,9 @@ } if (UNISH_DRUPAL_MAJOR_VERSION !=6) { + if (substr(UNISH_DRUPAL_MINOR_VERSION, 0, 2) == '.4') { + $this->markTestSkipped("panels module broken with Drupal 8.4.x"); + } // Test that pm-enable downloads missing projects and dependencies. $this->drush('pm-enable', array('panels'), $options + array('resolve-dependencies' => TRUE)); $this->drush('pm-list', array(), $options + array('status' => 'enabled')); diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/.coveralls.yml --- a/vendor/egulias/email-validator/.coveralls.yml Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -service_name: travis-ci -src_dir: . -coverage_clover: build/logs/clover*.xml diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/.gitignore --- a/vendor/egulias/email-validator/.gitignore Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -report/ -vendor/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/.travis.yml --- a/vendor/egulias/email-validator/.travis.yml Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -sudo: false - -language: php - -cache: - directories: - - $HOME/.composer/cache/files - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - hhvm - -env: - global: - - deps=high - -matrix: - fast_finish: true - include: - - php: 5.3 - dist: precise - - php: 5.3 - dist: precise - env: deps=low - - php: 5.4 - env: deps=no - - php: 5.5 - env: deps=no - -install: - - if [ "$deps" = "no" ]; then composer install; fi - - if [ "$deps" = "low" ]; then composer update --prefer-lowest; fi - - if [ "$deps" = "high" ]; then composer update; fi - -script: - - mkdir -p build/logs - - composer test -- --coverage-clover build/logs/clover.xml - diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/EmailLexer.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/EmailLexer.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,221 @@ + self::S_OPENPARENTHESIS, + ')' => self::S_CLOSEPARENTHESIS, + '<' => self::S_LOWERTHAN, + '>' => self::S_GREATERTHAN, + '[' => self::S_OPENBRACKET, + ']' => self::S_CLOSEBRACKET, + ':' => self::S_COLON, + ';' => self::S_SEMICOLON, + '@' => self::S_AT, + '\\' => self::S_BACKSLASH, + '/' => self::S_SLASH, + ',' => self::S_COMMA, + '.' => self::S_DOT, + '"' => self::S_DQUOTE, + '-' => self::S_HYPHEN, + '::' => self::S_DOUBLECOLON, + ' ' => self::S_SP, + "\t" => self::S_HTAB, + "\r" => self::S_CR, + "\n" => self::S_LF, + "\r\n" => self::CRLF, + 'IPv6' => self::S_IPV6TAG, + '{' => self::S_OPENQBRACKET, + '}' => self::S_CLOSEQBRACKET, + '' => self::S_EMPTY, + '\0' => self::C_NUL, + ); + + protected $hasInvalidTokens = false; + + protected $previous; + + public function reset() + { + $this->hasInvalidTokens = false; + parent::reset(); + } + + public function hasInvalidTokens() + { + return $this->hasInvalidTokens; + } + + /** + * @param $type + * @throws \UnexpectedValueException + * @return boolean + */ + public function find($type) + { + $search = clone $this; + $search->skipUntil($type); + + if (!$search->lookahead) { + throw new \UnexpectedValueException($type . ' not found'); + } + return true; + } + + /** + * getPrevious + * + * @return array token + */ + public function getPrevious() + { + return $this->previous; + } + + /** + * moveNext + * + * @return boolean + */ + public function moveNext() + { + $this->previous = $this->token; + + return parent::moveNext(); + } + + /** + * Lexical catchable patterns. + * + * @return string[] + */ + protected function getCatchablePatterns() + { + return array( + '[a-zA-Z_]+[46]?', //ASCII and domain literal + '[^\x00-\x7F]', //UTF-8 + '[0-9]+', + '\r\n', + '::', + '\s+?', + '.', + ); + } + + /** + * Lexical non-catchable patterns. + * + * @return string[] + */ + protected function getNonCatchablePatterns() + { + return array('[\xA0-\xff]+'); + } + + /** + * Retrieve token type. Also processes the token value if necessary. + * + * @param string $value + * @throws \InvalidArgumentException + * @return integer + */ + protected function getType(&$value) + { + if ($this->isNullType($value)) { + return self::C_NUL; + } + + if ($this->isValid($value)) { + return $this->charValue[$value]; + } + + if ($this->isUTF8Invalid($value)) { + $this->hasInvalidTokens = true; + return self::INVALID; + } + + return self::GENERIC; + } + + protected function isValid($value) + { + if (isset($this->charValue[$value])) { + return true; + } + + return false; + } + + /** + * @param $value + * @return bool + */ + protected function isNullType($value) + { + if ($value === "\0") { + return true; + } + + return false; + } + + /** + * @param $value + * @return bool + */ + protected function isUTF8Invalid($value) + { + if (preg_match('/\p{Cc}+/u', $value)) { + return true; + } + + return false; + } + + protected function getModifiers() + { + return 'iu'; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/EmailParser.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/EmailParser.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,104 @@ + + */ +class EmailParser +{ + const EMAIL_MAX_LENGTH = 254; + + protected $warnings; + protected $domainPart = ''; + protected $localPart = ''; + protected $lexer; + protected $localPartParser; + protected $domainPartParser; + + public function __construct(EmailLexer $lexer) + { + $this->lexer = $lexer; + $this->localPartParser = new LocalPart($this->lexer); + $this->domainPartParser = new DomainPart($this->lexer); + $this->warnings = new \SplObjectStorage(); + } + + /** + * @param $str + * @return array + */ + public function parse($str) + { + $this->lexer->setInput($str); + + if (!$this->hasAtToken()) { + throw new NoLocalPart(); + } + + + $this->localPartParser->parse($str); + $this->domainPartParser->parse($str); + + $this->setParts($str); + + if ($this->lexer->hasInvalidTokens()) { + throw new ExpectingATEXT(); + } + + return array('local' => $this->localPart, 'domain' => $this->domainPart); + } + + public function getWarnings() + { + $localPartWarnings = $this->localPartParser->getWarnings(); + $domainPartWarnings = $this->domainPartParser->getWarnings(); + $this->warnings = array_merge($localPartWarnings, $domainPartWarnings); + + $this->addLongEmailWarning($this->localPart, $this->domainPart); + + return $this->warnings; + } + + public function getParsedDomainPart() + { + return $this->domainPart; + } + + protected function setParts($email) + { + $parts = explode('@', $email); + $this->domainPart = $this->domainPartParser->getDomainPart(); + $this->localPart = $parts[0]; + } + + protected function hasAtToken() + { + $this->lexer->moveNext(); + $this->lexer->moveNext(); + if ($this->lexer->token['type'] === EmailLexer::S_AT) { + return false; + } + + return true; + } + + /** + * @param string $localPart + * @param string $parsedDomainPart + */ + protected function addLongEmailWarning($localPart, $parsedDomainPart) + { + if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAIL_MAX_LENGTH) { + $this->warnings[EmailTooLong::CODE] = new EmailTooLong(); + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/EmailValidator.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/EmailValidator.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,67 @@ +lexer = new EmailLexer(); + } + + /** + * @param $email + * @param EmailValidation $emailValidation + * @return bool + */ + public function isValid($email, EmailValidation $emailValidation) + { + $isValid = $emailValidation->isValid($email, $this->lexer); + $this->warnings = $emailValidation->getWarnings(); + $this->error = $emailValidation->getError(); + + return $isValid; + } + + /** + * @return boolean + */ + public function hasWarnings() + { + return !empty($this->warnings); + } + + /** + * @return array + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * @return InvalidEmail + */ + public function getError() + { + return $this->error; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Exception/AtextAfterCFWS.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Exception/AtextAfterCFWS.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,9 @@ +lexer->moveNext(); + + if ($this->lexer->token['type'] === EmailLexer::S_DOT) { + throw new DotAtStart(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_EMPTY) { + throw new NoDomainPart(); + } + if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) { + throw new DomainHyphened(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { + $this->warnings[DeprecatedComment::CODE] = new DeprecatedComment(); + $this->parseDomainComments(); + } + + $domain = $this->doParseDomainPart(); + + $prev = $this->lexer->getPrevious(); + $length = strlen($domain); + + if ($prev['type'] === EmailLexer::S_DOT) { + throw new DotAtEnd(); + } + if ($prev['type'] === EmailLexer::S_HYPHEN) { + throw new DomainHyphened(); + } + if ($length > self::DOMAIN_MAX_LENGTH) { + $this->warnings[DomainTooLong::CODE] = new DomainTooLong(); + } + if ($prev['type'] === EmailLexer::S_CR) { + throw new CRLFAtTheEnd(); + } + $this->domainPart = $domain; + } + + public function getDomainPart() + { + return $this->domainPart; + } + + public function checkIPV6Tag($addressLiteral, $maxGroups = 8) + { + $prev = $this->lexer->getPrevious(); + if ($prev['type'] === EmailLexer::S_COLON) { + $this->warnings[IPV6ColonEnd::CODE] = new IPV6ColonEnd(); + } + + $IPv6 = substr($addressLiteral, 5); + //Daniel Marschall's new IPv6 testing strategy + $matchesIP = explode(':', $IPv6); + $groupCount = count($matchesIP); + $colons = strpos($IPv6, '::'); + + if (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0) { + $this->warnings[IPV6BadChar::CODE] = new IPV6BadChar(); + } + + if ($colons === false) { + // We need exactly the right number of groups + if ($groupCount !== $maxGroups) { + $this->warnings[IPV6GroupCount::CODE] = new IPV6GroupCount(); + } + return; + } + + if ($colons !== strrpos($IPv6, '::')) { + $this->warnings[IPV6DoubleColon::CODE] = new IPV6DoubleColon(); + return; + } + + if ($colons === 0 || $colons === (strlen($IPv6) - 2)) { + // RFC 4291 allows :: at the start or end of an address + //with 7 other groups in addition + ++$maxGroups; + } + + if ($groupCount > $maxGroups) { + $this->warnings[IPV6MaxGroups::CODE] = new IPV6MaxGroups(); + } elseif ($groupCount === $maxGroups) { + $this->warnings[IPV6Deprecated::CODE] = new IPV6Deprecated(); + } + } + + protected function doParseDomainPart() + { + $domain = ''; + $openedParenthesis = 0; + do { + $prev = $this->lexer->getPrevious(); + + $this->checkNotAllowedChars($this->lexer->token); + + if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { + $this->parseComments(); + $openedParenthesis += $this->getOpenedParenthesis(); + $this->lexer->moveNext(); + $tmpPrev = $this->lexer->getPrevious(); + if ($tmpPrev['type'] === EmailLexer::S_CLOSEPARENTHESIS) { + $openedParenthesis--; + } + } + if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { + if ($openedParenthesis === 0) { + throw new UnopenedComment(); + } else { + $openedParenthesis--; + } + } + + $this->checkConsecutiveDots(); + $this->checkDomainPartExceptions($prev); + + if ($this->hasBrackets()) { + $this->parseDomainLiteral(); + } + + $this->checkLabelLength($prev); + + if ($this->isFWS()) { + $this->parseFWS(); + } + + $domain .= $this->lexer->token['value']; + $this->lexer->moveNext(); + } while ($this->lexer->token); + + return $domain; + } + + private function checkNotAllowedChars($token) + { + $notAllowed = [EmailLexer::S_BACKSLASH => true, EmailLexer::S_SLASH=> true]; + if (isset($notAllowed[$token['type']])) { + throw new CharNotAllowed(); + } + } + + protected function parseDomainLiteral() + { + if ($this->lexer->isNextToken(EmailLexer::S_COLON)) { + $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); + } + if ($this->lexer->isNextToken(EmailLexer::S_IPV6TAG)) { + $lexer = clone $this->lexer; + $lexer->moveNext(); + if ($lexer->isNextToken(EmailLexer::S_DOUBLECOLON)) { + $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); + } + } + + return $this->doParseDomainLiteral(); + } + + protected function doParseDomainLiteral() + { + $IPv6TAG = false; + $addressLiteral = ''; + do { + if ($this->lexer->token['type'] === EmailLexer::C_NUL) { + throw new ExpectingDTEXT(); + } + + if ($this->lexer->token['type'] === EmailLexer::INVALID || + $this->lexer->token['type'] === EmailLexer::C_DEL || + $this->lexer->token['type'] === EmailLexer::S_LF + ) { + $this->warnings[ObsoleteDTEXT::CODE] = new ObsoleteDTEXT(); + } + + if ($this->lexer->isNextTokenAny(array(EmailLexer::S_OPENQBRACKET, EmailLexer::S_OPENBRACKET))) { + throw new ExpectingDTEXT(); + } + + if ($this->lexer->isNextTokenAny( + array(EmailLexer::S_HTAB, EmailLexer::S_SP, $this->lexer->token['type'] === EmailLexer::CRLF) + )) { + $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); + $this->parseFWS(); + } + + if ($this->lexer->isNextToken(EmailLexer::S_CR)) { + throw new CRNoLF(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH) { + $this->warnings[ObsoleteDTEXT::CODE] = new ObsoleteDTEXT(); + $addressLiteral .= $this->lexer->token['value']; + $this->lexer->moveNext(); + $this->validateQuotedPair(); + } + if ($this->lexer->token['type'] === EmailLexer::S_IPV6TAG) { + $IPv6TAG = true; + } + if ($this->lexer->token['type'] === EmailLexer::S_CLOSEQBRACKET) { + break; + } + + $addressLiteral .= $this->lexer->token['value']; + + } while ($this->lexer->moveNext()); + + $addressLiteral = str_replace('[', '', $addressLiteral); + $addressLiteral = $this->checkIPV4Tag($addressLiteral); + + if (false === $addressLiteral) { + return $addressLiteral; + } + + if (!$IPv6TAG) { + $this->warnings[DomainLiteral::CODE] = new DomainLiteral(); + return $addressLiteral; + } + + $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); + + $this->checkIPV6Tag($addressLiteral); + + return $addressLiteral; + } + + protected function checkIPV4Tag($addressLiteral) + { + $matchesIP = array(); + + // Extract IPv4 part from the end of the address-literal (if there is one) + if (preg_match( + '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', + $addressLiteral, + $matchesIP + ) > 0 + ) { + $index = strrpos($addressLiteral, $matchesIP[0]); + if ($index === 0) { + $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); + return false; + } + // Convert IPv4 part to IPv6 format for further testing + $addressLiteral = substr($addressLiteral, 0, $index) . '0:0'; + } + + return $addressLiteral; + } + + protected function checkDomainPartExceptions($prev) + { + $invalidDomainTokens = array( + EmailLexer::S_DQUOTE => true, + EmailLexer::S_SEMICOLON => true, + EmailLexer::S_GREATERTHAN => true, + EmailLexer::S_LOWERTHAN => true, + ); + + if (isset($invalidDomainTokens[$this->lexer->token['type']])) { + throw new ExpectingATEXT(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_COMMA) { + throw new CommaInDomain(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_AT) { + throw new ConsecutiveAt(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_OPENQBRACKET && $prev['type'] !== EmailLexer::S_AT) { + throw new ExpectingATEXT(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) { + throw new DomainHyphened(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH + && $this->lexer->isNextToken(EmailLexer::GENERIC)) { + throw new ExpectingATEXT(); + } + } + + protected function hasBrackets() + { + if ($this->lexer->token['type'] !== EmailLexer::S_OPENBRACKET) { + return false; + } + + try { + $this->lexer->find(EmailLexer::S_CLOSEBRACKET); + } catch (\RuntimeException $e) { + throw new ExpectingDomainLiteralClose(); + } + + return true; + } + + protected function checkLabelLength($prev) + { + if ($this->lexer->token['type'] === EmailLexer::S_DOT && + $prev['type'] === EmailLexer::GENERIC && + strlen($prev['value']) > 63 + ) { + $this->warnings[LabelTooLong::CODE] = new LabelTooLong(); + } + } + + protected function parseDomainComments() + { + $this->isUnclosedComment(); + while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { + $this->warnEscaping(); + $this->lexer->moveNext(); + } + + $this->lexer->moveNext(); + if ($this->lexer->isNextToken(EmailLexer::S_DOT)) { + throw new ExpectingATEXT(); + } + } + + protected function addTLDWarnings() + { + if ($this->warnings[DomainLiteral::CODE]) { + $this->warnings[TLD::CODE] = new TLD(); + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Parser/LocalPart.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Parser/LocalPart.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,138 @@ +lexer->token['type'] !== EmailLexer::S_AT && $this->lexer->token) { + if ($this->lexer->token['type'] === EmailLexer::S_DOT && !$this->lexer->getPrevious()) { + throw new DotAtStart(); + } + + $closingQuote = $this->checkDQUOTE($closingQuote); + if ($closingQuote && $parseDQuote) { + $parseDQuote = $this->parseDoubleQuote(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { + $this->parseComments(); + $openedParenthesis += $this->getOpenedParenthesis(); + } + if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { + if ($openedParenthesis === 0) { + throw new UnopenedComment(); + } else { + $openedParenthesis--; + } + } + + $this->checkConsecutiveDots(); + + if ($this->lexer->token['type'] === EmailLexer::S_DOT && + $this->lexer->isNextToken(EmailLexer::S_AT) + ) { + throw new DotAtEnd(); + } + + $this->warnEscaping(); + $this->isInvalidToken($this->lexer->token, $closingQuote); + + if ($this->isFWS()) { + $this->parseFWS(); + } + + $this->lexer->moveNext(); + } + + $prev = $this->lexer->getPrevious(); + if (strlen($prev['value']) > LocalTooLong::LOCAL_PART_LENGTH) { + $this->warnings[LocalTooLong::CODE] = new LocalTooLong(); + } + } + + protected function parseDoubleQuote() + { + $parseAgain = true; + $special = array( + EmailLexer::S_CR => true, + EmailLexer::S_HTAB => true, + EmailLexer::S_LF => true + ); + + $invalid = array( + EmailLexer::C_NUL => true, + EmailLexer::S_HTAB => true, + EmailLexer::S_CR => true, + EmailLexer::S_LF => true + ); + $setSpecialsWarning = true; + + $this->lexer->moveNext(); + + while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && $this->lexer->token) { + $parseAgain = false; + if (isset($special[$this->lexer->token['type']]) && $setSpecialsWarning) { + $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); + $setSpecialsWarning = false; + } + if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH && $this->lexer->isNextToken(EmailLexer::S_DQUOTE)) { + $this->lexer->moveNext(); + } + + $this->lexer->moveNext(); + + if (!$this->escaped() && isset($invalid[$this->lexer->token['type']])) { + throw new ExpectingATEXT(); + } + } + + $prev = $this->lexer->getPrevious(); + + if ($prev['type'] === EmailLexer::S_BACKSLASH) { + if (!$this->checkDQUOTE(false)) { + throw new UnclosedQuotedString(); + } + } + + if (!$this->lexer->isNextToken(EmailLexer::S_AT) && $prev['type'] !== EmailLexer::S_BACKSLASH) { + throw new ExpectingAT(); + } + + return $parseAgain; + } + + protected function isInvalidToken($token, $closingQuote) + { + $forbidden = array( + EmailLexer::S_COMMA, + EmailLexer::S_CLOSEBRACKET, + EmailLexer::S_OPENBRACKET, + EmailLexer::S_GREATERTHAN, + EmailLexer::S_LOWERTHAN, + EmailLexer::S_COLON, + EmailLexer::S_SEMICOLON, + EmailLexer::INVALID + ); + + if (in_array($token['type'], $forbidden) && !$closingQuote) { + throw new ExpectingATEXT(); + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Parser/Parser.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Parser/Parser.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,215 @@ +lexer = $lexer; + } + + public function getWarnings() + { + return $this->warnings; + } + + abstract public function parse($str); + + /** @return int */ + public function getOpenedParenthesis() + { + return $this->openedParenthesis; + } + + /** + * validateQuotedPair + */ + protected function validateQuotedPair() + { + if (!($this->lexer->token['type'] === EmailLexer::INVALID + || $this->lexer->token['type'] === EmailLexer::C_DEL)) { + throw new ExpectedQPair(); + } + + $this->warnings[QuotedPart::CODE] = + new QuotedPart($this->lexer->getPrevious()['type'], $this->lexer->token['type']); + } + + protected function parseComments() + { + $this->openedParenthesis = 1; + $this->isUnclosedComment(); + $this->warnings[Comment::CODE] = new Comment(); + while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { + if ($this->lexer->isNextToken(EmailLexer::S_OPENPARENTHESIS)) { + $this->openedParenthesis++; + } + $this->warnEscaping(); + $this->lexer->moveNext(); + } + + $this->lexer->moveNext(); + if ($this->lexer->isNextTokenAny(array(EmailLexer::GENERIC, EmailLexer::S_EMPTY))) { + throw new ExpectingATEXT(); + } + + if ($this->lexer->isNextToken(EmailLexer::S_AT)) { + $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); + } + } + + protected function isUnclosedComment() + { + try { + $this->lexer->find(EmailLexer::S_CLOSEPARENTHESIS); + return true; + } catch (\RuntimeException $e) { + throw new UnclosedComment(); + } + } + + protected function parseFWS() + { + $previous = $this->lexer->getPrevious(); + + $this->checkCRLFInFWS(); + + if ($this->lexer->token['type'] === EmailLexer::S_CR) { + throw new CRNoLF(); + } + + if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] !== EmailLexer::S_AT) { + throw new AtextAfterCFWS(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) { + throw new ExpectingCTEXT(); + } + + if ($this->lexer->isNextToken(EmailLexer::S_AT) || $previous['type'] === EmailLexer::S_AT) { + $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); + } else { + $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); + } + } + + protected function checkConsecutiveDots() + { + if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { + throw new ConsecutiveDot(); + } + } + + protected function isFWS() + { + if ($this->escaped()) { + return false; + } + + if ($this->lexer->token['type'] === EmailLexer::S_SP || + $this->lexer->token['type'] === EmailLexer::S_HTAB || + $this->lexer->token['type'] === EmailLexer::S_CR || + $this->lexer->token['type'] === EmailLexer::S_LF || + $this->lexer->token['type'] === EmailLexer::CRLF + ) { + return true; + } + + return false; + } + + protected function escaped() + { + $previous = $this->lexer->getPrevious(); + + if ($previous['type'] === EmailLexer::S_BACKSLASH + && + $this->lexer->token['type'] !== EmailLexer::GENERIC + ) { + return true; + } + + return false; + } + + protected function warnEscaping() + { + if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { + return false; + } + + if ($this->lexer->isNextToken(EmailLexer::GENERIC)) { + throw new ExpectingATEXT(); + } + + if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { + return false; + } + + $this->warnings[QuotedPart::CODE] = + new QuotedPart($this->lexer->getPrevious()['type'], $this->lexer->token['type']); + return true; + + } + + protected function checkDQUOTE($hasClosingQuote) + { + if ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE) { + return $hasClosingQuote; + } + if ($hasClosingQuote) { + return $hasClosingQuote; + } + $previous = $this->lexer->getPrevious(); + if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] === EmailLexer::GENERIC) { + throw new ExpectingATEXT(); + } + + try { + $this->lexer->find(EmailLexer::S_DQUOTE); + $hasClosingQuote = true; + } catch (\Exception $e) { + throw new UnclosedQuotedString(); + } + $this->warnings[QuotedString::CODE] = new QuotedString($previous['value'], $this->lexer->token['value']); + + return $hasClosingQuote; + } + + protected function checkCRLFInFWS() + { + if ($this->lexer->token['type'] !== EmailLexer::CRLF) { + return; + } + + if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { + throw new CRLFX2(); + } + + if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { + throw new CRLFAtTheEnd(); + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Validation/DNSCheckValidation.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Validation/DNSCheckValidation.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,72 @@ +checkDNS($host); + } + + public function getError() + { + return $this->error; + } + + public function getWarnings() + { + return $this->warnings; + } + + protected function checkDNS($host) + { + $variant = INTL_IDNA_VARIANT_2003; + if ( defined('INTL_IDNA_VARIANT_UTS46') ) { + $variant = INTL_IDNA_VARIANT_UTS46; + } + $host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.') . '.'; + + $Aresult = true; + $MXresult = checkdnsrr($host, 'MX'); + + if (!$MXresult) { + $this->warnings[NoDNSMXRecord::CODE] = new NoDNSMXRecord(); + $Aresult = checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA'); + if (!$Aresult) { + $this->error = new NoDNSRecord(); + } + } + return $MXresult || $Aresult; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Validation/EmailValidation.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Validation/EmailValidation.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,34 @@ +errors = $errors; + parent::__construct(); + } + + public function getErrors() + { + return $this->errors; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,111 @@ +validations = $validations; + $this->mode = $mode; + } + + /** + * {@inheritdoc} + */ + public function isValid($email, EmailLexer $emailLexer) + { + $result = true; + $errors = []; + foreach ($this->validations as $validation) { + $emailLexer->reset(); + $validationResult = $validation->isValid($email, $emailLexer); + $result = $result && $validationResult; + $this->warnings = array_merge($this->warnings, $validation->getWarnings()); + $errors = $this->addNewError($validation->getError(), $errors); + + if ($this->shouldStop($result)) { + break; + } + } + + if (!empty($errors)) { + $this->error = new MultipleErrors($errors); + } + + return $result; + } + + private function addNewError($possibleError, array $errors) + { + if (null !== $possibleError) { + $errors[] = $possibleError; + } + + return $errors; + } + + private function shouldStop($result) + { + return !$result && $this->mode === self::STOP_ON_ERROR; + } + + /** + * {@inheritdoc} + */ + public function getError() + { + return $this->error; + } + + /** + * {@inheritdoc} + */ + public function getWarnings() + { + return $this->warnings; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Validation/NoRFCWarningsValidation.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Validation/NoRFCWarningsValidation.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,41 @@ +getWarnings())) { + return true; + } + + $this->error = new RFCWarnings(); + + return false; + } + + /** + * {@inheritdoc} + */ + public function getError() + { + return $this->error ?: parent::getError(); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Validation/RFCValidation.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Validation/RFCValidation.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,49 @@ +parser = new EmailParser($emailLexer); + try { + $this->parser->parse((string)$email); + } catch (InvalidEmail $invalid) { + $this->error = $invalid; + return false; + } + + $this->warnings = $this->parser->getWarnings(); + return true; + } + + public function getError() + { + return $this->error; + } + + public function getWarnings() + { + return $this->warnings; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Validation/SpoofCheckValidation.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Validation/SpoofCheckValidation.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,45 @@ +setChecks(Spoofchecker::SINGLE_SCRIPT); + + if ($checker->isSuspicious($email)) { + $this->error = new SpoofEmail(); + } + + return $this->error === null; + } + + public function getError() + { + return $this->error; + } + + public function getWarnings() + { + return []; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/AddressLiteral.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/AddressLiteral.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Address literal in domain part'; + $this->rfcNumber = 5321; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/CFWSNearAt.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/CFWSNearAt.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +message = "Deprecated folding white space near @"; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/CFWSWithFWS.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/CFWSWithFWS.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +message = 'Folding whites space followed by folding white space'; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/Comment.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/Comment.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +message = "Comments found in this email"; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/DeprecatedComment.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/DeprecatedComment.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +message = 'Deprecated comments'; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/DomainLiteral.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/DomainLiteral.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Domain Literal'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/DomainTooLong.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/DomainTooLong.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Domain is too long, exceeds 255 chars'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/EmailTooLong.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/EmailTooLong.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,15 @@ +message = 'Email is too long, exceeds ' . EmailParser::EMAIL_MAX_LENGTH; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/IPV6BadChar.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/IPV6BadChar.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Bad char in IPV6 domain literal'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/IPV6ColonEnd.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/IPV6ColonEnd.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = ':: found at the end of the domain literal'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/IPV6ColonStart.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/IPV6ColonStart.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = ':: found at the start of the domain literal'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/IPV6Deprecated.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/IPV6Deprecated.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Deprecated form of IPV6'; + $this->rfcNumber = 5321; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/IPV6DoubleColon.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/IPV6DoubleColon.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Double colon found after IPV6 tag'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/IPV6GroupCount.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/IPV6GroupCount.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Group count is not IPV6 valid'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/IPV6MaxGroups.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/IPV6MaxGroups.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Reached the maximum number of IPV6 groups allowed'; + $this->rfcNumber = 5321; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/LabelTooLong.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/LabelTooLong.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'Label too long'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/LocalTooLong.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/LocalTooLong.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,15 @@ +message = 'Local part is too long, exceeds 64 chars (octets)'; + $this->rfcNumber = 5322; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/NoDNSMXRecord.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/NoDNSMXRecord.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +message = 'No MX DSN record was found for this email'; + $this->rfcNumber = 5321; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/ObsoleteDTEXT.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/ObsoleteDTEXT.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +rfcNumber = 5322; + $this->message = 'Obsolete DTEXT in domain literal'; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/QuotedPart.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/QuotedPart.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +message = "Deprecated Quoted String found between $prevToken and $postToken"; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/QuotedString.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/QuotedString.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +message = "Quoted String found between $prevToken and $postToken"; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/TLD.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/TLD.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +message = "RFC5321, TLD"; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/EmailValidator/Warning/Warning.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/egulias/email-validator/EmailValidator/Warning/Warning.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,30 @@ +message; + } + + public function code() + { + return self::CODE; + } + + public function RFCNumber() + { + return $this->rfcNumber; + } + + public function __toString() + { + return $this->message() . " rfc: " . $this->rfcNumber . "interal code: " . static::CODE; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/LICENSE --- a/vendor/egulias/email-validator/LICENSE Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/egulias/email-validator/LICENSE Thu May 09 15:33:08 2019 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2013 Eduardo Gulias Davis +Copyright (c) 2013-2016 Eduardo Gulias Davis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/README.md --- a/vendor/egulias/email-validator/README.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/egulias/email-validator/README.md Thu May 09 15:33:08 2019 +0100 @@ -1,59 +1,82 @@ -#EmailValidator +# EmailValidator [![Build Status](https://travis-ci.org/egulias/EmailValidator.png?branch=master)](https://travis-ci.org/egulias/EmailValidator) [![Coverage Status](https://coveralls.io/repos/egulias/EmailValidator/badge.png?branch=master)](https://coveralls.io/r/egulias/EmailValidator?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/egulias/EmailValidator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=master) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/22ba6692-9c02-42e5-a65d-1c5696bfffc6/small.png)](https://insight.sensiolabs.com/projects/22ba6692-9c02-42e5-a65d-1c5696bfffc6) ============================= -With the help of +## Suported RFCs ## +This library aims to support: -![Powered by PhpStorm](https://www.jetbrains.com/phpstorm/documentation/docs/logo_phpstorm.png) -##Installation## +RFC 5321, 5322, 6530, 6531, 6532. + +## Requirements ## + + * [Composer](https://getcomposer.org) is required for installation + * [Spoofchecking](https://github.com/egulias/EmailValidator/blob/master/EmailValidator/Validation/SpoofCheckValidation.php) and [DNSCheckValidation](https://github.com/egulias/EmailValidator/blob/master/EmailValidator/Validation/DNSCheckValidation.php) validation requires that your PHP system has the [PHP Internationalization Libraries](https://php.net/manual/en/book.intl.php) (also known as PHP Intl) + +## Installation ## Run the command below to install via Composer ```shell -composer require egulias/email-validator "~1.2" +composer require egulias/email-validator "~2.1" ``` -##Usage## +## Getting Started ## +`EmailValidator`requires you to decide which (or combination of them) validation/s strategy/ies you'd like to follow for each [validation](#available-validations). -Simple example: +A basic example with the RFC validation +```php +isValid("example@example.com", new RFCValidation()); //true +``` + + +### Available validations ### + +1. [RFCValidation](https://github.com/egulias/EmailValidator/blob/master/EmailValidator/Validation/RFCValidation.php) +2. [NoRFCWarningsValidation](https://github.com/egulias/EmailValidator/blob/master/EmailValidator/Validation/NoRFCWarningsValidation.php) +3. [DNSCheckValidation](https://github.com/egulias/EmailValidator/blob/master/EmailValidator/Validation/DNSCheckValidation.php) +4. [SpoofCheckValidation](https://github.com/egulias/EmailValidator/blob/master/EmailValidator/Validation/SpoofCheckValidation.php) +5. [MultipleValidationWithAnd](https://github.com/egulias/EmailValidator/blob/master/EmailValidator/Validation/MultipleValidationWithAnd.php) +6. [Your own validation](#how-to-extend) + +`MultipleValidationWithAnd` + +It is a validation that operates over other validations performing a logical and (&&) over the result of each validation. ```php isValid($email)) { - echo $email . ' is a valid email address'; -} +$validator = new EmailValidator(); +$multipleValidations = new MultipleValidationWithAnd([ + new RFCValidation(), + new DNSCheckValidation() +]); +$validator->isValid("example@example.com", $multipleValidations); //true ``` -More advanced example (returns detailed diagnostic error codes): +### How to extend ### -```php -isValid($email); +## Other Contributors ## +(You can find current contributors [here](https://github.com/egulias/EmailValidator/graphs/contributors)) -if ($result) { - echo $email . ' is a valid email address'; -} else if ($validator->hasWarnings()) { - echo 'Warning! ' . $email . ' has unusual/deprecated features (result code ' . var_export($validator->getWarnings(), true) . ')'; -} else { - echo $email . ' is not a valid email address (result code ' . $validator->getError() . ')'; -} -``` +As this is a port from another library and work, here are other people related to the previous one: -##Contributors## -As this is a port from another library and work, here are other people related to the previous: +* Ricard Clau [@ricardclau](https://github.com/ricardclau): Performance against PHP built-in filter_var +* Josepf Bielawski [@stloyd](https://github.com/stloyd): For its first re-work of Dominic's lib +* Dominic Sayers [@dominicsayers](https://github.com/dominicsayers): The original isemail function -* Ricard Clau [@ricardclau](http://github.com/ricardclau): Performance against PHP built-in filter_var -* Josepf Bielawski [@stloyd](http://github.com/stloyd): For its first re-work of Dominic's lib -* Dominic Sayers [@dominicsayers](http://github.com/dominicsayers): The original isemail function - -##License## +## License ## Released under the MIT License attached with this code. diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/composer.json --- a/vendor/egulias/email-validator/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/egulias/email-validator/composer.json Thu May 09 15:33:08 2019 +0100 @@ -1,6 +1,6 @@ { "name": "egulias/email-validator", - "description": "A library for validating emails", + "description": "A library for validating emails against several RFCs", "homepage": "https://github.com/egulias/EmailValidator", "type": "Library", "keywords": ["email", "validation", "validator", "emailvalidation", "emailvalidator"], @@ -13,19 +13,32 @@ "dev-master": "2.0.x-dev" } }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/dominicsayers/isemail" + } + ], "require": { - "php": ">= 5.3.3", + "php": ">= 5.5", "doctrine/lexer": "^1.0.1" }, "require-dev" : { - "phpunit/phpunit": "^4.8.24" + "satooshi/php-coveralls": "^1.0.1", + "phpunit/phpunit": "^4.8.35||^5.7||^6.0", + "dominicsayers/isemail": "dev-master" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" }, "autoload": { - "psr-0": { - "Egulias\\": "src/" + "psr-4": { + "Egulias\\EmailValidator\\": "EmailValidator" } }, - "scripts": { - "test": "phpunit" + "autoload-dev": { + "psr-4": { + "Egulias\\Tests\\": "test" + } } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/composer.lock --- a/vendor/egulias/email-validator/composer.lock Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1078 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "aeeae19ffaaf639f5ad6edac2f979b28", - "content-hash": "61ce0ff395bacaa79d3f6e1216e23e4b", - "packages": [ - { - "name": "doctrine/lexer", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "lexer", - "parser" - ], - "time": "2014-09-09 13:34:57" - } - ], - "packages-dev": [ - { - "name": "dflydev/markdown", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/dflydev/dflydev-markdown.git", - "reference": "76501a808522dbe40a5a71d272bd08d54cbae03d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-markdown/zipball/76501a808522dbe40a5a71d272bd08d54cbae03d", - "reference": "76501a808522dbe40a5a71d272bd08d54cbae03d", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "autoload": { - "psr-0": { - "dflydev\\markdown": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "New BSD License" - ], - "authors": [ - { - "name": "Dragonfly Development Inc.", - "email": "info@dflydev.com", - "homepage": "http://dflydev.com" - }, - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" - }, - { - "name": "Michel Fortin", - "homepage": "http://michelf.com" - }, - { - "name": "John Gruber", - "homepage": "http://daringfireball.net" - } - ], - "description": "PHP Markdown & Extra", - "homepage": "http://github.com/dflydev/dflydev-markdown", - "keywords": [ - "markdown" - ], - "abandoned": "michelf/php-markdown", - "time": "2012-01-02 23:11:32" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "26404e0c90565b614ee76b988b9bc8790d77f590" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/26404e0c90565b614ee76b988b9bc8790d77f590", - "reference": "26404e0c90565b614ee76b988b9bc8790d77f590", - "shasum": "" - }, - "require": { - "php": "~5.3" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2014-08-25 15:09:25" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "66ae84e9d7c8ea85c979cb65977bd8e608baf0c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66ae84e9d7c8ea85c979cb65977bd8e608baf0c5", - "reference": "66ae84e9d7c8ea85c979cb65977bd8e608baf0c5", - "shasum": "" - }, - "require": { - "dflydev/markdown": "1.0.*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*@stable" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2013-08-07 11:04:22" - }, - { - "name": "phpspec/prophecy", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/9ca52329bcdd1500de24427542577ebf3fc2f1c9", - "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", - "phpdocumentor/reflection-docblock": "~2.0" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "http://phpspec.org", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2014-11-17 16:23:49" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ba315f46873fd6e86fdb98685a1a900e7379c886" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ba315f46873fd6e86fdb98685a1a900e7379c886", - "reference": "ba315f46873fd6e86fdb98685a1a900e7379c886", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-05-30 12:58:40" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2015-04-02 05:19:05" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "Text/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2014-01-30 17:20:04" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/83fe1bdc5d47658b727595c14da140da92b3d66d", - "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2015-06-13 07:35:30" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "f8d5d08c56de5cfd592b3340424a81733259a876" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876", - "reference": "f8d5d08c56de5cfd592b3340424a81733259a876", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2014-08-31 06:12:13" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.24", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2016-03-14 06:16:08" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "c63d2367247365f688544f0d500af90a11a44c65" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", - "reference": "c63d2367247365f688544f0d500af90a11a44c65", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "~1.0,>=1.0.1", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.3" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2014-10-03 05:12:11" - }, - { - "name": "sebastian/comparator", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "c484a80f97573ab934e37826dba0135a3301b26a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/c484a80f97573ab934e37826dba0135a3301b26a", - "reference": "c484a80f97573ab934e37826dba0135a3301b26a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.1", - "sebastian/exporter": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2014-11-16 21:32:38" - }, - { - "name": "sebastian/diff", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2014-08-15 10:29:00" - }, - { - "name": "sebastian/environment", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", - "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2015-07-26 06:42:57" - }, - { - "name": "sebastian/exporter", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-01-27 07:23:06" - }, - { - "name": "sebastian/global-state", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2014-10-06 09:23:50" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" - }, - { - "name": "sebastian/version", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "16b021aed448b654ae05846e394e057e9a6f04cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/16b021aed448b654ae05846e394e057e9a6f04cb", - "reference": "16b021aed448b654ae05846e394e057e9a6f04cb", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2013-01-05 14:27:32" - }, - { - "name": "symfony/yaml", - "version": "v2.1.0", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "f18e004fc975707bb4695df1dbbe9b0d8c8b7715" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f18e004fc975707bb4695df1dbbe9b0d8c8b7715", - "reference": "f18e004fc975707bb4695df1dbbe9b0d8c8b7715", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2012-08-22 13:48:41" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": true, - "platform": { - "php": ">= 5.3.3" - }, - "platform-dev": [] -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/phpunit.xml.dist --- a/vendor/egulias/email-validator/phpunit.xml.dist Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/egulias/email-validator/phpunit.xml.dist Thu May 09 15:33:08 2019 +0100 @@ -9,11 +9,11 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="false" - bootstrap="tests/bootstrap.php" + bootstrap="vendor/autoload.php" > - ./tests/egulias/Tests/ + ./Tests/EmailValidator ./vendor/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailLexer.php --- a/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailLexer.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ - self::S_OPENPARENTHESIS, - ')' => self::S_CLOSEPARENTHESIS, - '<' => self::S_LOWERTHAN, - '>' => self::S_GREATERTHAN, - '[' => self::S_OPENBRACKET, - ']' => self::S_CLOSEBRACKET, - ':' => self::S_COLON, - ';' => self::S_SEMICOLON, - '@' => self::S_AT, - '\\' => self::S_BACKSLASH, - '/' => self::S_SLASH, - ',' => self::S_COMMA, - '.' => self::S_DOT, - '"' => self::S_DQUOTE, - '-' => self::S_HYPHEN, - '::' => self::S_DOUBLECOLON, - ' ' => self::S_SP, - "\t" => self::S_HTAB, - "\r" => self::S_CR, - "\n" => self::S_LF, - "\r\n" => self::CRLF, - 'IPv6' => self::S_IPV6TAG, - '{' => self::S_OPENQBRACKET, - '}' => self::S_CLOSEQBRACKET, - '' => self::S_EMPTY, - '\0' => self::C_NUL, - ); - - protected $hasInvalidTokens = false; - - protected $previous; - - public function reset() - { - $this->hasInvalidTokens = false; - parent::reset(); - } - - public function hasInvalidTokens() - { - return $this->hasInvalidTokens; - } - - /** - * @param $type - * @throws \UnexpectedValueException - * @return boolean - */ - public function find($type) - { - $search = clone $this; - $search->skipUntil($type); - - if (!$search->lookahead) { - throw new \UnexpectedValueException($type . ' not found'); - } - return true; - } - - /** - * getPrevious - * - * @return array token - */ - public function getPrevious() - { - return $this->previous; - } - - /** - * moveNext - * - * @return boolean - */ - public function moveNext() - { - $this->previous = $this->token; - - return parent::moveNext(); - } - - /** - * Lexical catchable patterns. - * - * @return string[] - */ - protected function getCatchablePatterns() - { - return array( - '[a-zA-Z_]+[46]?', //ASCII and domain literal - '[^\x00-\x7F]', //UTF-8 - '[0-9]+', - '\r\n', - '::', - '\s+?', - '.', - ); - } - - /** - * Lexical non-catchable patterns. - * - * @return string[] - */ - protected function getNonCatchablePatterns() - { - return array('[\xA0-\xff]+'); - } - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * @throws \InvalidArgumentException - * @return integer - */ - protected function getType(&$value) - { - if ($this->isNullType($value)) { - return self::C_NUL; - } - - if ($this->isValid($value)) { - return $this->charValue[$value]; - } - - if ($this->isUTF8Invalid($value)) { - $this->hasInvalidTokens = true; - return self::INVALID; - } - - return self::GENERIC; - } - - protected function isValid($value) - { - if (isset($this->charValue[$value])) { - return true; - } - - return false; - } - - /** - * @param $value - * @return bool - */ - protected function isNullType($value) - { - if ($value === "\0") { - return true; - } - - return false; - } - - /** - * @param $value - * @return bool - */ - protected function isUTF8Invalid($value) - { - if (preg_match('/\p{Cc}+/u', $value)) { - return true; - } - - return false; - } - - protected function getModifiers() - { - return 'iu'; - } -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailParser.php --- a/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailParser.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ - - */ -class EmailParser -{ - const EMAIL_MAX_LENGTH = 254; - - protected $warnings = array(); - protected $domainPart = ''; - protected $localPart = ''; - protected $lexer; - protected $localPartParser; - protected $domainPartParser; - - public function __construct(EmailLexer $lexer) - { - $this->lexer = $lexer; - $this->localPartParser = new LocalPart($this->lexer); - $this->domainPartParser = new DomainPart($this->lexer); - } - - /** - * @param $str - * @return array - */ - public function parse($str) - { - $this->lexer->setInput($str); - - if (!$this->hasAtToken()) { - throw new \InvalidArgumentException('ERR_NOLOCALPART'); - } - - - $this->localPartParser->parse($str); - $this->domainPartParser->parse($str); - - $this->setParts($str); - - if ($this->lexer->hasInvalidTokens()) { - throw new \InvalidArgumentException('ERR_INVALID_ATEXT'); - } - - return array('local' => $this->localPart, 'domain' => $this->domainPart); - } - - public function getWarnings() - { - $localPartWarnings = $this->localPartParser->getWarnings(); - $domainPartWarnings = $this->domainPartParser->getWarnings(); - - $this->warnings = array_merge($localPartWarnings, $domainPartWarnings); - $this->addLongEmailWarning($this->localPart, $this->domainPart); - - return $this->warnings; - } - - public function getParsedDomainPart() - { - return $this->domainPart; - } - - protected function setParts($email) - { - $parts = explode('@', $email); - $this->domainPart = $this->domainPartParser->getDomainPart(); - $this->localPart = $parts[0]; - } - - protected function hasAtToken() - { - $this->lexer->moveNext(); - $this->lexer->moveNext(); - if ($this->lexer->token['type'] === EmailLexer::S_AT) { - return false; - } - - return true; - } - - /** - * @param string $localPart - * @param string $parsedDomainPart - */ - protected function addLongEmailWarning($localPart, $parsedDomainPart) - { - if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAIL_MAX_LENGTH) { - $this->warnings[] = EmailValidator::RFC5322_TOOLONG; - } - } -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailValidator.php --- a/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailValidator.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ - - */ -class EmailValidator implements EmailValidatorInterface -{ - /** - * Critical validation errors used to indicate that - * an email address is invalid: - */ - const ERR_CONSECUTIVEATS = 128; - const ERR_EXPECTING_DTEXT = 129; - const ERR_NOLOCALPART = 130; - const ERR_NODOMAIN = 131; - const ERR_CONSECUTIVEDOTS = 132; - const ERR_ATEXT_AFTER_CFWS = 133; - const ERR_EXPECTING_QPAIR = 136; - const ERR_EXPECTING_ATEXT = 137; - const ERR_EXPECTING_CTEXT = 139; - const ERR_DOT_START = 141; - const ERR_DOT_END = 142; - const ERR_DOMAINHYPHENEND = 144; - const ERR_UNCLOSEDQUOTEDSTR = 145; - const ERR_UNCLOSEDCOMMENT = 146; - const ERR_FWS_CRLF_X2 = 148; - const ERR_FWS_CRLF_END = 149; - const ERR_CR_NO_LF = 150; - const ERR_DEPREC_REACHED = 151; - const ERR_UNOPENEDCOMMENT = 152; - const ERR_ATEXT_AFTER_QS = 134; // not in use - const ERR_ATEXT_AFTER_DOMLIT = 135; // not in use - const ERR_EXPECTING_QTEXT = 138; // not in use - const ERR_BACKSLASHEND = 140; // not in use - const ERR_DOMAINHYPHENSTART = 143; // not in use - const ERR_UNCLOSEDDOMLIT = 147; // not in use - - /** - * Informational validation warnings regarding unusual or - * deprecated features found in an email address: - */ - // Address is valid for SMTP (RFC-5321), but has unusual elements. - const RFC5321_TLD = 9; - const RFC5321_QUOTEDSTRING = 11; - const RFC5321_ADDRESSLITERAL = 12; - const RFC5321_IPV6DEPRECATED = 13; - const RFC5321_TLDNUMERIC = 10; // not in use - // Address is only valid according to the broad - // definition of RFC-5322. It is otherwise invalid. - const RFC5322_LOCAL_TOOLONG = 64; - const RFC5322_LABEL_TOOLONG = 63; - const RFC5322_TOOLONG = 66; - const RFC5322_DOMAIN_TOOLONG = 255; - const RFC5322_DOMAINLITERAL = 70; - const RFC5322_DOMLIT_OBSDTEXT = 71; - const RFC5322_IPV6_GRPCOUNT = 72; - const RFC5322_IPV6_2X2XCOLON = 73; - const RFC5322_IPV6_BADCHAR = 74; - const RFC5322_IPV6_MAXGRPS = 75; - const RFC5322_IPV6_COLONSTRT = 76; - const RFC5322_IPV6_COLONEND = 77; - const RFC5322_DOMAIN = 65; // not in use - // Address contains deprecated elements, but may - // still be valid in restricted contexts. - const DEPREC_QP = 36; - const DEPREC_COMMENT = 37; - const DEPREC_CFWS_NEAR_AT = 49; - const DEPREC_LOCALPART = 33; // not in use - const DEPREC_FWS = 34; // not in use - const DEPREC_QTEXT = 35; // not in use - const DEPREC_CTEXT = 38; // not in use - // Address is valid within the message, - // but cannot be used unmodified in the envelope. - const CFWS_COMMENT = 17; - const CFWS_FWS = 18; - // Hostname DNS checks were unsuccessful. - const DNSWARN_NO_MX_RECORD = 5; - const DNSWARN_NO_RECORD = 6; - - /** - * @var EmailParser - */ - protected $parser; - - /** - * Contains any informational warnings regarding unusual/deprecated - * features that were encountered during validation. - * - * @var array - */ - protected $warnings = array(); - - /** - * If a critical validation problem is encountered, this will be - * set to the value of one of this class's ERR_* constants. - * - * @var int - */ - protected $error; - - /** - * @var int - */ - protected $threshold = 255; - - public function __construct() - { - $this->parser = new EmailParser(new EmailLexer()); - } - - /** - * {@inheritdoc} - */ - public function isValid($email, $checkDNS = false, $strict = false) - { - try { - $this->parser->parse((string)$email); - $this->warnings = $this->parser->getWarnings(); - } catch (\Exception $e) { - $rClass = new \ReflectionClass($this); - $this->error = $rClass->getConstant($e->getMessage()); - return false; - } - - $dnsProblemExists = ($checkDNS ? !$this->checkDNS() : false); - - if ($this->hasWarnings() && ((int) max($this->warnings) > $this->threshold)) { - $this->error = self::ERR_DEPREC_REACHED; - return false; - } - - return !($dnsProblemExists || $strict && $this->hasWarnings()); - } - - /** - * {@inheritdoc} - */ - public function hasWarnings() - { - return !empty($this->warnings); - } - - /** - * {@inheritdoc} - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * {@inheritdoc} - */ - public function getError() - { - return $this->error; - } - - /** - * {@inheritdoc} - */ - public function setThreshold($threshold) - { - $this->threshold = (int) $threshold; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getThreshold() - { - return $this->threshold; - } - - /** - * @return bool Whether or not an MX record exists for the - * email address's host name. - */ - protected function checkDNS() - { - $host = $this->parser->getParsedDomainPart(); - $host = rtrim($host, '.') . '.'; - - $mxRecordExists = checkdnsrr($host, 'MX'); - - if (!$mxRecordExists) { - $this->warnings[] = self::DNSWARN_NO_RECORD; - $this->addTLDWarnings(); - } - - return $mxRecordExists; - } - - protected function addTLDWarnings() - { - if (!in_array(self::DNSWARN_NO_RECORD, $this->warnings) && - !in_array(self::DNSWARN_NO_MX_RECORD, $this->warnings) && - in_array(self::RFC5322_DOMAINLITERAL, $this->warnings) - ) { - $this->warnings[] = self::RFC5321_TLD; - } - } -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailValidatorInterface.php --- a/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailValidatorInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ - - */ -interface EmailValidatorInterface -{ - /** - * Validates an email address against the following standards: - * - * RFC-5321: Simple Mail Transfer Protocol - * RFC-5322: Internet Message Format - * RFC-6530: Overview and Framework for Internationalized Email - * RFC-6531: SMTP Extension for Internationalized Email - * RFC-6532: Internationalized Email Headers - * RFC-1123 section 2.1: Requirements for Internet Hosts -- Application and Support - * RFC-4291 section 2.2: IP Version 6 Addressing Architecture - * - * @param string $email The email address to validate. - * @param bool $checkDNS Whether or not the email address's hostname should - * be confirmed with a DNS lookup. This only comes - * into play if strict mode is also enabled. - * @param bool $strict If this is true, and any informational warnings - * were raised during validation, the email address - * will be considered invalid. Additionally, if - * $checkDNS is true and the DNS lookup failed, - * the email address will be considered invalid. - * @return bool - */ - public function isValid($email, $checkDNS = false, $strict = false); - - /** - * @return bool - */ - public function hasWarnings(); - - /** - * @return array - */ - public function getWarnings(); - - /** - * @return string - */ - public function getError(); - - /** - * @param int $threshold The acceptable number of deprecation warnings. - * - * @return EmailValidator - */ - public function setThreshold($threshold); - - /** - * @return int - */ - public function getThreshold(); -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/DomainPart.php --- a/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/DomainPart.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ -lexer->moveNext(); - - if ($this->lexer->token['type'] === EmailLexer::S_DOT) { - throw new \InvalidArgumentException('ERR_DOT_START'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_EMPTY) { - throw new \InvalidArgumentException('ERR_NODOMAIN'); - } - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) { - throw new \InvalidArgumentException('ERR_DOMAINHYPHENEND'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->warnings[] = EmailValidator::DEPREC_COMMENT; - $this->parseDomainComments(); - } - - $domain = $this->doParseDomainPart(); - - $prev = $this->lexer->getPrevious(); - $length = strlen($domain); - - if ($prev['type'] === EmailLexer::S_DOT) { - throw new \InvalidArgumentException('ERR_DOT_END'); - } - if ($prev['type'] === EmailLexer::S_HYPHEN) { - throw new \InvalidArgumentException('ERR_DOMAINHYPHENEND'); - } - if ($length > self::DOMAIN_MAX_LENGTH) { - $this->warnings[] = EmailValidator::RFC5322_DOMAIN_TOOLONG; - } - if ($prev['type'] === EmailLexer::S_CR) { - throw new \InvalidArgumentException('ERR_FWS_CRLF_END'); - } - $this->domainPart = $domain; - } - - public function getDomainPart() - { - return $this->domainPart; - } - - public function checkIPV6Tag($addressLiteral, $maxGroups = 8) - { - $prev = $this->lexer->getPrevious(); - if ($prev['type'] === EmailLexer::S_COLON) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_COLONEND; - } - - $IPv6 = substr($addressLiteral, 5); - //Daniel Marschall's new IPv6 testing strategy - $matchesIP = explode(':', $IPv6); - $groupCount = count($matchesIP); - $colons = strpos($IPv6, '::'); - - if (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_BADCHAR; - } - - if ($colons === false) { - // We need exactly the right number of groups - if ($groupCount !== $maxGroups) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_GRPCOUNT; - } - return; - } - - if ($colons !== strrpos($IPv6, '::')) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_2X2XCOLON; - return; - } - - if ($colons === 0 || $colons === (strlen($IPv6) - 2)) { - // RFC 4291 allows :: at the start or end of an address - //with 7 other groups in addition - ++$maxGroups; - } - - if ($groupCount > $maxGroups) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_MAXGRPS; - } elseif ($groupCount === $maxGroups) { - $this->warnings[] = EmailValidator::RFC5321_IPV6DEPRECATED; - } - } - - protected function doParseDomainPart() - { - $domain = ''; - $openedParenthesis = 0; - $openBrackets = false; - do { - $prev = $this->lexer->getPrevious(); - - $this->checkNotAllowedChars($this->lexer->token); - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->parseComments(); - $openedParenthesis += $this->getOpenedParenthesis(); - $this->lexer->moveNext(); - $tmpPrev = $this->lexer->getPrevious(); - if ($tmpPrev['type'] === EmailLexer::S_CLOSEPARENTHESIS) { - $openedParenthesis--; - } - } - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { - if ($openedParenthesis === 0) { - throw new \InvalidArgumentException('ERR_UNOPENEDCOMMENT'); - } else { - $openedParenthesis--; - } - } - - $this->checkConsecutiveDots(); - $this->checkDomainPartExceptions($prev); - - if ($openBrackets = $this->hasBrackets($openBrackets)) { - $this->parseDomainLiteral(); - } - - $this->checkLabelLength($prev); - - if ($this->isFWS()) { - $this->parseFWS(); - } - - $domain .= $this->lexer->token['value']; - $this->lexer->moveNext(); - } while ($this->lexer->token); - - return $domain; - } - - private function checkNotAllowedChars($token) - { - $notAllowed = array(EmailLexer::S_BACKSLASH => true, EmailLexer::S_SLASH=> true); - if (isset($notAllowed[$token['type']])) { - throw new \InvalidArgumentException('ERR_DOMAIN_CHAR_NOT_ALLOWED'); - } - } - - protected function parseDomainLiteral() - { - if ($this->lexer->isNextToken(EmailLexer::S_COLON)) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_COLONSTRT; - } - if ($this->lexer->isNextToken(EmailLexer::S_IPV6TAG)) { - $lexer = clone $this->lexer; - $lexer->moveNext(); - if ($lexer->isNextToken(EmailLexer::S_DOUBLECOLON)) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_COLONSTRT; - } - } - - return $this->doParseDomainLiteral(); - } - - protected function doParseDomainLiteral() - { - $IPv6TAG = false; - $addressLiteral = ''; - do { - if ($this->lexer->token['type'] === EmailLexer::C_NUL) { - throw new \InvalidArgumentException('ERR_EXPECTING_DTEXT'); - } - - if ($this->lexer->token['type'] === EmailLexer::INVALID || - $this->lexer->token['type'] === EmailLexer::C_DEL || - $this->lexer->token['type'] === EmailLexer::S_LF - ) { - $this->warnings[] = EmailValidator::RFC5322_DOMLIT_OBSDTEXT; - } - - if ($this->lexer->isNextTokenAny(array(EmailLexer::S_OPENQBRACKET, EmailLexer::S_OPENBRACKET))) { - throw new \InvalidArgumentException('ERR_EXPECTING_DTEXT'); - } - - if ($this->lexer->isNextTokenAny( - array(EmailLexer::S_HTAB, EmailLexer::S_SP, $this->lexer->token['type'] === EmailLexer::CRLF) - )) { - $this->warnings[] = EmailValidator::CFWS_FWS; - $this->parseFWS(); - } - - if ($this->lexer->isNextToken(EmailLexer::S_CR)) { - throw new \InvalidArgumentException('ERR_CR_NO_LF'); - } - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH) { - $this->warnings[] = EmailValidator::RFC5322_DOMLIT_OBSDTEXT; - $addressLiteral .= $this->lexer->token['value']; - $this->lexer->moveNext(); - $this->validateQuotedPair(); - } - if ($this->lexer->token['type'] === EmailLexer::S_IPV6TAG) { - $IPv6TAG = true; - } - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEQBRACKET) { - break; - } - - $addressLiteral .= $this->lexer->token['value']; - - } while ($this->lexer->moveNext()); - - $addressLiteral = str_replace('[', '', $addressLiteral); - $addressLiteral = $this->checkIPV4Tag($addressLiteral); - - if (false === $addressLiteral) { - return $addressLiteral; - } - - if (!$IPv6TAG) { - $this->warnings[] = EmailValidator::RFC5322_DOMAINLITERAL; - return $addressLiteral; - } - - $this->warnings[] = EmailValidator::RFC5321_ADDRESSLITERAL; - - $this->checkIPV6Tag($addressLiteral); - - return $addressLiteral; - } - - protected function checkIPV4Tag($addressLiteral) - { - $matchesIP = array(); - - // Extract IPv4 part from the end of the address-literal (if there is one) - if (preg_match( - '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', - $addressLiteral, - $matchesIP - ) > 0 - ) { - $index = strrpos($addressLiteral, $matchesIP[0]); - if ($index === 0) { - $this->warnings[] = EmailValidator::RFC5321_ADDRESSLITERAL; - return false; - } - // Convert IPv4 part to IPv6 format for further testing - $addressLiteral = substr($addressLiteral, 0, $index) . '0:0'; - } - - return $addressLiteral; - } - - protected function checkDomainPartExceptions($prev) - { - $invalidDomainTokens = array( - EmailLexer::S_DQUOTE => true, - EmailLexer::S_SEMICOLON => true, - EmailLexer::S_GREATERTHAN => true, - EmailLexer::S_LOWERTHAN => true, - ); - - if (isset($invalidDomainTokens[$this->lexer->token['type']])) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_COMMA) { - throw new \InvalidArgumentException('ERR_COMMA_IN_DOMAIN'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_AT) { - throw new \InvalidArgumentException('ERR_CONSECUTIVEATS'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENQBRACKET && $prev['type'] !== EmailLexer::S_AT) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new \InvalidArgumentException('ERR_DOMAINHYPHENEND'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH - && $this->lexer->isNextToken(EmailLexer::GENERIC)) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - } - - protected function hasBrackets($openBrackets) - { - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEBRACKET && !$openBrackets) { - throw new \InvalidArgumentException('ERR_EXPECTING_OPENBRACKET'); - } - - if ($this->lexer->token['type'] !== EmailLexer::S_OPENBRACKET) { - return false; - } - - try { - $this->lexer->find(EmailLexer::S_CLOSEBRACKET); - } catch (\RuntimeException $e) { - throw new \InvalidArgumentException('ERR_EXPECTING_DOMLIT_CLOSE'); - } - - return true; - } - - protected function checkLabelLength($prev) - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && - $prev['type'] === EmailLexer::GENERIC && - strlen($prev['value']) > 63 - ) { - $this->warnings[] = EmailValidator::RFC5322_LABEL_TOOLONG; - } - } - - protected function parseDomainComments() - { - $this->isUnclosedComment(); - while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { - $this->warnEscaping(); - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - if ($this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - } -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/LocalPart.php --- a/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/LocalPart.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -lexer->token['type'] !== EmailLexer::S_AT && $this->lexer->token) { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && !$this->lexer->getPrevious()) { - throw new \InvalidArgumentException('ERR_DOT_START'); - } - - $closingQuote = $this->checkDQUOTE($closingQuote); - if ($closingQuote && $parseDQuote) { - $parseDQuote = $this->parseDoubleQuote(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->parseComments(); - $openedParenthesis += $this->getOpenedParenthesis(); - } - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { - if ($openedParenthesis === 0) { - throw new \InvalidArgumentException('ERR_UNOPENEDCOMMENT'); - } else { - $openedParenthesis--; - } - } - - $this->checkConsecutiveDots(); - - if ($this->lexer->token['type'] === EmailLexer::S_DOT && - $this->lexer->isNextToken(EmailLexer::S_AT) - ) { - throw new \InvalidArgumentException('ERR_DOT_END'); - } - - $this->warnEscaping(); - $this->isInvalidToken($this->lexer->token, $closingQuote); - - if ($this->isFWS()) { - $this->parseFWS(); - } - - $this->lexer->moveNext(); - } - - $prev = $this->lexer->getPrevious(); - if (strlen($prev['value']) > EmailValidator::RFC5322_LOCAL_TOOLONG) { - $this->warnings[] = EmailValidator::RFC5322_LOCAL_TOOLONG; - } - } - - protected function parseDoubleQuote() - { - $parseAgain = true; - $special = array( - EmailLexer::S_CR => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_LF => true - ); - - $invalid = array( - EmailLexer::C_NUL => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_CR => true, - EmailLexer::S_LF => true - ); - $setSpecialsWarning = true; - - $this->lexer->moveNext(); - - while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && $this->lexer->token) { - $parseAgain = false; - if (isset($special[$this->lexer->token['type']]) && $setSpecialsWarning) { - $this->warnings[] = EmailValidator::CFWS_FWS; - $setSpecialsWarning = false; - } - - $this->lexer->moveNext(); - - if (!$this->escaped() && isset($invalid[$this->lexer->token['type']])) { - throw new \InvalidArgumentException('ERR_EXPECTED_ATEXT'); - } - } - - $prev = $this->lexer->getPrevious(); - - if ($prev['type'] === EmailLexer::S_BACKSLASH) { - if (!$this->checkDQUOTE(false)) { - throw new \InvalidArgumentException('ERR_UNCLOSED_DQUOTE'); - } - } - - if (!$this->lexer->isNextToken(EmailLexer::S_AT) && $prev['type'] !== EmailLexer::S_BACKSLASH) { - throw new \InvalidArgumentException('ERR_EXPECED_AT'); - } - - return $parseAgain; - } - - protected function isInvalidToken($token, $closingQuote) - { - $forbidden = array( - EmailLexer::S_COMMA, - EmailLexer::S_CLOSEBRACKET, - EmailLexer::S_OPENBRACKET, - EmailLexer::S_GREATERTHAN, - EmailLexer::S_LOWERTHAN, - EmailLexer::S_COLON, - EmailLexer::S_SEMICOLON, - EmailLexer::INVALID - ); - - if (in_array($token['type'], $forbidden) && !$closingQuote) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - } -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/Parser.php --- a/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/Parser.php Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,197 +0,0 @@ -lexer = $lexer; - } - - public function getWarnings() - { - return $this->warnings; - } - - abstract public function parse($str); - - /** @return int */ - public function getOpenedParenthesis() - { - return $this->openedParenthesis; - } - - /** - * validateQuotedPair - */ - protected function validateQuotedPair() - { - if (!($this->lexer->token['type'] === EmailLexer::INVALID - || $this->lexer->token['type'] === EmailLexer::C_DEL)) { - throw new \InvalidArgumentException('ERR_EXPECTING_QPAIR'); - } - - $this->warnings[] = EmailValidator::DEPREC_QP; - } - - protected function parseComments() - { - $this->openedParenthesis = 1; - $this->isUnclosedComment(); - $this->warnings[] = EmailValidator::CFWS_COMMENT; - while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { - if ($this->lexer->isNextToken(EmailLexer::S_OPENPARENTHESIS)) { - $this->openedParenthesis++; - } - $this->warnEscaping(); - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - if ($this->lexer->isNextTokenAny(array(EmailLexer::GENERIC, EmailLexer::S_EMPTY))) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - if ($this->lexer->isNextToken(EmailLexer::S_AT)) { - $this->warnings[] = EmailValidator::DEPREC_CFWS_NEAR_AT; - } - } - - protected function isUnclosedComment() - { - try { - $this->lexer->find(EmailLexer::S_CLOSEPARENTHESIS); - return true; - } catch (\RuntimeException $e) { - throw new \InvalidArgumentException('ERR_UNCLOSEDCOMMENT'); - } - } - - protected function parseFWS() - { - $previous = $this->lexer->getPrevious(); - - $this->checkCRLFInFWS(); - - if ($this->lexer->token['type'] === EmailLexer::S_CR) { - throw new \InvalidArgumentException('ERR_CR_NO_LF'); - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] !== EmailLexer::S_AT) { - throw new \InvalidArgumentException('ERR_ATEXT_AFTER_CFWS'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) { - throw new \InvalidArgumentException('ERR_EXPECTING_CTEXT'); - } - - if ($this->lexer->isNextToken(EmailLexer::S_AT) || $previous['type'] === EmailLexer::S_AT) { - $this->warnings[] = EmailValidator::DEPREC_CFWS_NEAR_AT; - } else { - $this->warnings[] = EmailValidator::CFWS_FWS; - } - } - - protected function checkConsecutiveDots() - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new \InvalidArgumentException('ERR_CONSECUTIVEDOTS'); - } - } - - protected function isFWS() - { - if ($this->escaped()) { - return false; - } - - if ($this->lexer->token['type'] === EmailLexer::S_SP || - $this->lexer->token['type'] === EmailLexer::S_HTAB || - $this->lexer->token['type'] === EmailLexer::S_CR || - $this->lexer->token['type'] === EmailLexer::S_LF || - $this->lexer->token['type'] === EmailLexer::CRLF - ) { - return true; - } - - return false; - } - - protected function escaped() - { - $previous = $this->lexer->getPrevious(); - - if ($previous['type'] === EmailLexer::S_BACKSLASH - && - $this->lexer->token['type'] !== EmailLexer::GENERIC - ) { - return true; - } - - return false; - } - - protected function warnEscaping() - { - if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { - return false; - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC)) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { - return false; - } - - $this->warnings[] = EmailValidator::DEPREC_QP; - return true; - - } - - protected function checkDQUOTE($hasClosingQuote) - { - if ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE) { - return $hasClosingQuote; - } - if ($hasClosingQuote) { - return $hasClosingQuote; - } - $previous = $this->lexer->getPrevious(); - if ($previous['type'] === EmailLexer::GENERIC && $this->lexer->isNextToken(EmailLexer::GENERIC)) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - $this->warnings[] = EmailValidator::RFC5321_QUOTEDSTRING; - try { - $this->lexer->find(EmailLexer::S_DQUOTE); - $hasClosingQuote = true; - } catch (\Exception $e) { - throw new \InvalidArgumentException('ERR_UNCLOSEDQUOTEDSTR'); - } - - return $hasClosingQuote; - } - - protected function checkCRLFInFWS() - { - if ($this->lexer->token['type'] !== EmailLexer::CRLF) { - return; - } - if ($this->lexer->isNextToken(EmailLexer::CRLF)) { - throw new \InvalidArgumentException('ERR_FWS_CRLF_X2'); - } - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { - throw new \InvalidArgumentException('ERR_FWS_CRLF_END'); - } - } -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/masterminds/html5/RELEASE.md --- a/vendor/masterminds/html5/RELEASE.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/masterminds/html5/RELEASE.md Thu May 09 15:33:08 2019 +0100 @@ -1,5 +1,9 @@ # Release Notes +2.6.0 (2019-03-10) + +- #163: Allow to pass a charset to the Scanner + 2.5.0 (2018-12-27) - #162, #161, #155, #154, #153, #151: big performance improvements diff -r 129ea1e6d783 -r af1871eacc83 vendor/masterminds/html5/composer.json --- a/vendor/masterminds/html5/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/masterminds/html5/composer.json Thu May 09 15:33:08 2019 +0100 @@ -38,7 +38,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.6-dev" } } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/masterminds/html5/src/HTML5.php --- a/vendor/masterminds/html5/src/HTML5.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/masterminds/html5/src/HTML5.php Thu May 09 15:33:08 2019 +0100 @@ -155,7 +155,7 @@ $this->errors = array(); $options = array_merge($this->defaultOptions, $options); $events = new DOMTreeBuilder(false, $options); - $scanner = new Scanner($input); + $scanner = new Scanner($input, !empty($options['encoding']) ? $options['encoding'] : 'UTF-8'); $parser = new Tokenizer($scanner, $events, !empty($options['xmlNamespaces']) ? Tokenizer::CONFORMANT_XML : Tokenizer::CONFORMANT_HTML); $parser->parse(); @@ -179,7 +179,7 @@ { $options = array_merge($this->defaultOptions, $options); $events = new DOMTreeBuilder(true, $options); - $scanner = new Scanner($input); + $scanner = new Scanner($input, !empty($options['encoding']) ? $options['encoding'] : 'UTF-8'); $parser = new Tokenizer($scanner, $events, !empty($options['xmlNamespaces']) ? Tokenizer::CONFORMANT_XML : Tokenizer::CONFORMANT_HTML); $parser->parse(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php --- a/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php Thu May 09 15:33:08 2019 +0100 @@ -3,8 +3,7 @@ namespace Masterminds\HTML5\Parser; /* - * -* Portions based on code from html5lib files with the following copyright: +Portions based on code from html5lib files with the following copyright: Copyright 2009 Geoffrey Sneddon @@ -26,28 +25,20 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ use Masterminds\HTML5\Exception; -/** - * UTF-8 Utilities. - */ class UTF8Utils { /** - * The Unicode replacement character.. + * The Unicode replacement character. */ const FFFD = "\xEF\xBF\xBD"; /** * Count the number of characters in a string. - * - * UTF-8 aware. This will try (in order) iconv, - * MB, libxml, and finally a custom counter. - * - * @todo Move this to a general utility class. + * UTF-8 aware. This will try (in order) iconv, MB, libxml, and finally a custom counter. * * @param string $string * @@ -58,14 +49,20 @@ // Get the length for the string we need. if (function_exists('mb_strlen')) { return mb_strlen($string, 'utf-8'); - } elseif (function_exists('iconv_strlen')) { + } + + if (function_exists('iconv_strlen')) { return iconv_strlen($string, 'utf-8'); - } elseif (function_exists('utf8_decode')) { + } + + if (function_exists('utf8_decode')) { // MPB: Will this work? Won't certain decodes lead to two chars // extrapolated out of 2-byte chars? return strlen(utf8_decode($string)); } + $count = count_chars($string); + // 0x80 = 0x7F - 0 + 1 (one added to get inclusive range) // 0x33 = 0xF4 - 0x2C + 1 (one added to get inclusive range) return array_sum(array_slice($count, 0, 0x80)) + array_sum(array_slice($count, 0xC2, 0x33)); @@ -85,7 +82,12 @@ public static function convertToUTF8($data, $encoding = 'UTF-8') { /* - * From the HTML5 spec: Given an encoding, the bytes in the input stream must be converted to Unicode characters for the tokeniser, as described by the rules for that encoding, except that the leading U+FEFF BYTE ORDER MARK character, if any, must not be stripped by the encoding layer (it is stripped by the rule below). Bytes or sequences of bytes in the original byte stream that could not be converted to Unicode characters must be converted to U+FFFD REPLACEMENT CHARACTER code points. + * From the HTML5 spec: Given an encoding, the bytes in the input stream must be converted + * to Unicode characters for the tokeniser, as described by the rules for that encoding, + * except that the leading U+FEFF BYTE ORDER MARK character, if any, must not be stripped + * by the encoding layer (it is stripped by the rule below). Bytes or sequences of bytes + * in the original byte stream that could not be converted to Unicode characters must be + * converted to U+FFFD REPLACEMENT CHARACTER code points. */ // mb_convert_encoding is chosen over iconv because of a bug. The best @@ -106,7 +108,8 @@ mb_substitute_character('none'); $data = mb_convert_encoding($data, 'UTF-8', $encoding); mb_substitute_character($save); - } // @todo Get iconv running in at least some environments if that is possible. + } + // @todo Get iconv running in at least some environments if that is possible. elseif (function_exists('iconv') && 'auto' !== $encoding) { // fprintf(STDOUT, "iconv found\n"); // iconv has the following behaviors: @@ -141,14 +144,20 @@ $errors = array(); /* - * All U+0000 null characters in the input must be replaced by U+FFFD REPLACEMENT CHARACTERs. Any occurrences of such characters is a parse error. + * All U+0000 null characters in the input must be replaced by U+FFFD REPLACEMENT CHARACTERs. + * Any occurrences of such characters is a parse error. */ for ($i = 0, $count = substr_count($data, "\0"); $i < $count; ++$i) { $errors[] = 'null-character'; } /* - * Any occurrences of any characters in the ranges U+0001 to U+0008, U+000B, U+000E to U+001F, U+007F to U+009F, U+D800 to U+DFFF , U+FDD0 to U+FDEF, and characters U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, U+2FFFF, U+3FFFE, U+3FFFF, U+4FFFE, U+4FFFF, U+5FFFE, U+5FFFF, U+6FFFE, U+6FFFF, U+7FFFE, U+7FFFF, U+8FFFE, U+8FFFF, U+9FFFE, U+9FFFF, U+AFFFE, U+AFFFF, U+BFFFE, U+BFFFF, U+CFFFE, U+CFFFF, U+DFFFE, U+DFFFF, U+EFFFE, U+EFFFF, U+FFFFE, U+FFFFF, U+10FFFE, and U+10FFFF are parse errors. (These are all control characters or permanently undefined Unicode characters.) + * Any occurrences of any characters in the ranges U+0001 to U+0008, U+000B, U+000E to U+001F, U+007F + * to U+009F, U+D800 to U+DFFF , U+FDD0 to U+FDEF, and characters U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, + * U+2FFFE, U+2FFFF, U+3FFFE, U+3FFFF, U+4FFFE, U+4FFFF, U+5FFFE, U+5FFFF, U+6FFFE, U+6FFFF, U+7FFFE, + * U+7FFFF, U+8FFFE, U+8FFFF, U+9FFFE, U+9FFFF, U+AFFFE, U+AFFFF, U+BFFFE, U+BFFFF, U+CFFFE, U+CFFFF, + * U+DFFFE, U+DFFFF, U+EFFFE, U+EFFFF, U+FFFFE, U+FFFFF, U+10FFFE, and U+10FFFF are parse errors. + * (These are all control characters or permanently undefined Unicode characters.) */ // Check PCRE is loaded. $count = preg_match_all( diff -r 129ea1e6d783 -r af1871eacc83 vendor/mikey179/vfsStream/CHANGELOG.md --- a/vendor/mikey179/vfsStream/CHANGELOG.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/mikey179/vfsStream/CHANGELOG.md Thu May 09 15:33:08 2019 +0100 @@ -1,3 +1,9 @@ +1.6.6 (2019-04-08) +------------------ + + * backported #174 from master, original PR provided by @localheinz + + 1.6.5 (2017-08-01) ------------------ diff -r 129ea1e6d783 -r af1871eacc83 vendor/mikey179/vfsStream/README.md --- a/vendor/mikey179/vfsStream/README.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/mikey179/vfsStream/README.md Thu May 09 15:33:08 2019 +0100 @@ -3,6 +3,6 @@ Also you might want to check [vfsStream examples](https://github.com/mikey179/vfsStream-examples). -[![Build Status](https://secure.travis-ci.org/mikey179/vfsStream.png)](http://travis-ci.org/mikey179/vfsStream) [![Build Status Windows](https://ci.appveyor.com/api/projects/status/6whqgluyeggspjp1/branch/master?svg=true)](https://ci.appveyor.com/project/mikey179/vfsstream) [![Coverage Status](https://coveralls.io/repos/mikey179/vfsStream/badge.png?branch=master)](https://coveralls.io/r/mikey179/vfsStream?branch=master) +[![Build Status](https://secure.travis-ci.org/mikey179/vfsStream.png)](http://travis-ci.org/mikey179/vfsStream) [![Build Status Windows](https://ci.appveyor.com/api/projects/status/6whqgluyeggspjp1/branch/master?svg=true)](https://ci.appveyor.com/project/mikey179/vfsstream) [![Coverage Status](https://coveralls.io/repos/github/bovigo/vfsStream/badge.svg?branch=v1.x)](https://coveralls.io/github/bovigo/vfsStream?branch=v1.x) [![Latest Stable Version](https://poser.pugx.org/mikey179/vfsStream/version.png)](https://packagist.org/packages/mikey179/vfsStream) [![Latest Unstable Version](https://poser.pugx.org/mikey179/vfsStream/v/unstable.png)](//packagist.org/packages/mikey179/vfsStream) diff -r 129ea1e6d783 -r af1871eacc83 vendor/mikey179/vfsStream/appveyor.yml --- a/vendor/mikey179/vfsStream/appveyor.yml Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/mikey179/vfsStream/appveyor.yml Thu May 09 15:33:08 2019 +0100 @@ -13,7 +13,7 @@ install: - if exist .\php (set CACHED=1) else (mkdir .\php) - if %CACHED%==0 cd .\php - - if %CACHED%==0 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-7.0.7-nts-Win32-VC14-x64.zip -FileName php.zip + - if %CACHED%==0 curl --fail --location --silent --show-error -o php.zip https://windows.php.net/downloads/releases/archives/php-7.0.7-nts-Win32-VC14-x64.zip - if %CACHED%==0 appveyor DownloadFile https://getcomposer.org/composer.phar - if %CACHED%==0 7z x php.zip -y - if %CACHED%==0 cd .. diff -r 129ea1e6d783 -r af1871eacc83 vendor/mikey179/vfsStream/composer.json --- a/vendor/mikey179/vfsStream/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/mikey179/vfsStream/composer.json Thu May 09 15:33:08 2019 +0100 @@ -1,5 +1,5 @@ { - "name": "mikey179/vfsStream", + "name": "mikey179/vfsstream", "type": "library", "homepage": "http://vfs.bovigo.org/", "description": "Virtual file system to mock the real file system in unit tests.", @@ -12,9 +12,9 @@ } ], "support": { - "issues": "https://github.com/mikey179/vfsStream/issues", - "source": "https://github.com/mikey179/vfsStream/tree/master", - "wiki": "https://github.com/mikey179/vfsStream/wiki" + "issues": "https://github.com/bovigo/vfsStream/issues", + "source": "https://github.com/bovigo/vfsStream/tree/master", + "wiki": "https://github.com/bovigo/vfsStream/wiki" }, "require": { "php": ">=5.3.0" diff -r 129ea1e6d783 -r af1871eacc83 vendor/mikey179/vfsStream/composer.lock --- a/vendor/mikey179/vfsStream/composer.lock Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/mikey179/vfsStream/composer.lock Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "hash": "e3c2dd0d4b4daf3d2c9e0bedd344592a", - "content-hash": "59c3102c5db7e3c4d78a920d4712790d", + "content-hash": "ba1a29e3e44423cdcaf79db9532fcd02", "packages": [], "packages-dev": [ { @@ -60,7 +59,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -109,7 +108,7 @@ "email": "mike.vanriel@naenius.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2015-02-03T12:10:50+00:00" }, { "name": "phpspec/prophecy", @@ -169,7 +168,7 @@ "spy", "stub" ], - "time": "2015-08-13 10:07:40" + "time": "2015-08-13T10:07:40+00:00" }, { "name": "phpunit/php-code-coverage", @@ -231,7 +230,7 @@ "testing", "xunit" ], - "time": "2015-09-14 06:51:16" + "time": "2015-09-14T06:51:16+00:00" }, { "name": "phpunit/php-file-iterator", @@ -278,7 +277,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21 13:08:43" + "time": "2015-06-21T13:08:43+00:00" }, { "name": "phpunit/php-text-template", @@ -319,7 +318,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -360,7 +359,7 @@ "keywords": [ "timer" ], - "time": "2015-06-21 08:01:12" + "time": "2015-06-21T08:01:12+00:00" }, { "name": "phpunit/php-token-stream", @@ -409,7 +408,7 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2015-09-15T10:49:45+00:00" }, { "name": "phpunit/phpunit", @@ -481,7 +480,7 @@ "testing", "xunit" ], - "time": "2015-10-01 09:14:30" + "time": "2015-10-01T09:14:30+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -537,7 +536,8 @@ "mock", "xunit" ], - "time": "2015-10-02 06:51:40" + "abandoned": true, + "time": "2015-10-02T06:51:40+00:00" }, { "name": "sebastian/comparator", @@ -601,7 +601,7 @@ "compare", "equality" ], - "time": "2015-07-26 15:48:44" + "time": "2015-07-26T15:48:44+00:00" }, { "name": "sebastian/diff", @@ -653,7 +653,7 @@ "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-02-22T15:13:53+00:00" }, { "name": "sebastian/environment", @@ -703,7 +703,7 @@ "environment", "hhvm" ], - "time": "2015-08-03 06:14:51" + "time": "2015-08-03T06:14:51+00:00" }, { "name": "sebastian/exporter", @@ -769,7 +769,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2015-06-21T07:55:53+00:00" }, { "name": "sebastian/global-state", @@ -820,7 +820,7 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2014-10-06T09:23:50+00:00" }, { "name": "sebastian/recursion-context", @@ -873,7 +873,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" + "time": "2015-06-21T08:04:50+00:00" }, { "name": "sebastian/version", @@ -908,7 +908,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" + "time": "2015-06-21T13:59:46+00:00" }, { "name": "symfony/yaml", @@ -957,7 +957,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-09-14 14:14:09" + "time": "2015-09-14T14:14:09+00:00" } ], "aliases": [], diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/.gitignore Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,10 @@ +# composer related +composer.lock +composer.phar +vendor +# IDE +.idea +# eclipse +.buildpath +.project +.settings diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/.travis.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/.travis.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,28 @@ +sudo: false +language: php +matrix: + include: + - php: 5.2 + dist: precise + - php: 5.3 + dist: precise + - php: 5.4 + dist: trusty + - php: 5.5 + dist: trusty + - php: 5.6 + dist: trusty + - php: 7.0 + dist: trusty + - php: 7.1 + dist: trusty + - php: 7.2 + dist: trusty + - php: 7.3 + dist: trusty +install: +# - pear upgrade --force --alldeps pear/pear + - pear install -f package.xml +script: + - pear run-tests -qr tests/ + - for i in `find tests/ -name '*.out'`; do echo "$i"; cat "$i"; done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/Archive/Tar.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/Archive/Tar.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2464 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category File_Formats + * @package Archive_Tar + * @author Vincent Blavet + * @copyright 1997-2010 The Authors + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id$ + * @link http://pear.php.net/package/Archive_Tar + */ + +// If the PEAR class cannot be loaded via the autoloader, +// then try to require_once it from the PHP include path. +if (!class_exists('PEAR')) { + require_once 'PEAR.php'; +} + +define('ARCHIVE_TAR_ATT_SEPARATOR', 90001); +define('ARCHIVE_TAR_END_BLOCK', pack("a512", '')); + +if (!function_exists('gzopen') && function_exists('gzopen64')) { + function gzopen($filename, $mode, $use_include_path = 0) + { + return gzopen64($filename, $mode, $use_include_path); + } +} + +if (!function_exists('gztell') && function_exists('gztell64')) { + function gztell($zp) + { + return gztell64($zp); + } +} + +if (!function_exists('gzseek') && function_exists('gzseek64')) { + function gzseek($zp, $offset, $whence = SEEK_SET) + { + return gzseek64($zp, $offset, $whence); + } +} + +/** + * Creates a (compressed) Tar archive + * + * @package Archive_Tar + * @author Vincent Blavet + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @version $Revision$ + */ +class Archive_Tar extends PEAR +{ + /** + * @var string Name of the Tar + */ + public $_tarname = ''; + + /** + * @var boolean if true, the Tar file will be gzipped + */ + public $_compress = false; + + /** + * @var string Type of compression : 'none', 'gz', 'bz2' or 'lzma2' + */ + public $_compress_type = 'none'; + + /** + * @var string Explode separator + */ + public $_separator = ' '; + + /** + * @var file descriptor + */ + public $_file = 0; + + /** + * @var string Local Tar name of a remote Tar (http:// or ftp://) + */ + public $_temp_tarname = ''; + + /** + * @var string regular expression for ignoring files or directories + */ + public $_ignore_regexp = ''; + + /** + * @var object PEAR_Error object + */ + public $error_object = null; + + /** + * Format for data extraction + * + * @var string + */ + public $_fmt = ''; + + /** + * @var int Length of the read buffer in bytes + */ + protected $buffer_length; + + /** + * Archive_Tar Class constructor. This flavour of the constructor only + * declare a new Archive_Tar object, identifying it by the name of the + * tar file. + * If the compress argument is set the tar will be read or created as a + * gzip or bz2 compressed TAR file. + * + * @param string $p_tarname The name of the tar archive to create + * @param string $p_compress can be null, 'gz', 'bz2' or 'lzma2'. This + * parameter indicates if gzip, bz2 or lzma2 compression + * is required. For compatibility reason the + * boolean value 'true' means 'gz'. + * @param int $buffer_length Length of the read buffer in bytes + * + * @return bool + */ + public function __construct($p_tarname, $p_compress = null, $buffer_length = 512) + { + parent::__construct(); + + $this->_compress = false; + $this->_compress_type = 'none'; + if (($p_compress === null) || ($p_compress == '')) { + if (@file_exists($p_tarname)) { + if ($fp = @fopen($p_tarname, "rb")) { + // look for gzip magic cookie + $data = fread($fp, 2); + fclose($fp); + if ($data == "\37\213") { + $this->_compress = true; + $this->_compress_type = 'gz'; + // No sure it's enought for a magic code .... + } elseif ($data == "BZ") { + $this->_compress = true; + $this->_compress_type = 'bz2'; + } elseif (file_get_contents($p_tarname, false, null, 1, 4) == '7zXZ') { + $this->_compress = true; + $this->_compress_type = 'lzma2'; + } + } + } else { + // probably a remote file or some file accessible + // through a stream interface + if (substr($p_tarname, -2) == 'gz') { + $this->_compress = true; + $this->_compress_type = 'gz'; + } elseif ((substr($p_tarname, -3) == 'bz2') || + (substr($p_tarname, -2) == 'bz') + ) { + $this->_compress = true; + $this->_compress_type = 'bz2'; + } else { + if (substr($p_tarname, -2) == 'xz') { + $this->_compress = true; + $this->_compress_type = 'lzma2'; + } + } + } + } else { + if (($p_compress === true) || ($p_compress == 'gz')) { + $this->_compress = true; + $this->_compress_type = 'gz'; + } else { + if ($p_compress == 'bz2') { + $this->_compress = true; + $this->_compress_type = 'bz2'; + } else { + if ($p_compress == 'lzma2') { + $this->_compress = true; + $this->_compress_type = 'lzma2'; + } else { + $this->_error( + "Unsupported compression type '$p_compress'\n" . + "Supported types are 'gz', 'bz2' and 'lzma2'.\n" + ); + return false; + } + } + } + } + $this->_tarname = $p_tarname; + if ($this->_compress) { // assert zlib or bz2 or xz extension support + if ($this->_compress_type == 'gz') { + $extname = 'zlib'; + } else { + if ($this->_compress_type == 'bz2') { + $extname = 'bz2'; + } else { + if ($this->_compress_type == 'lzma2') { + $extname = 'xz'; + } + } + } + + if (!extension_loaded($extname)) { + PEAR::loadExtension($extname); + } + if (!extension_loaded($extname)) { + $this->_error( + "The extension '$extname' couldn't be found.\n" . + "Please make sure your version of PHP was built " . + "with '$extname' support.\n" + ); + return false; + } + } + + + if (version_compare(PHP_VERSION, "5.5.0-dev") < 0) { + $this->_fmt = "a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/" . + "a8checksum/a1typeflag/a100link/a6magic/a2version/" . + "a32uname/a32gname/a8devmajor/a8devminor/a131prefix"; + } else { + $this->_fmt = "Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/" . + "Z8checksum/Z1typeflag/Z100link/Z6magic/Z2version/" . + "Z32uname/Z32gname/Z8devmajor/Z8devminor/Z131prefix"; + } + + + $this->buffer_length = $buffer_length; + } + + public function __destruct() + { + $this->_close(); + // ----- Look for a local copy to delete + if ($this->_temp_tarname != '') { + @unlink($this->_temp_tarname); + } + } + + /** + * This method creates the archive file and add the files / directories + * that are listed in $p_filelist. + * If a file with the same name exist and is writable, it is replaced + * by the new tar. + * The method return false and a PEAR error text. + * The $p_filelist parameter can be an array of string, each string + * representing a filename or a directory name with their path if + * needed. It can also be a single string with names separated by a + * single blank. + * For each directory added in the archive, the files and + * sub-directories are also added. + * See also createModify() method for more details. + * + * @param array $p_filelist An array of filenames and directory names, or a + * single string with names separated by a single + * blank space. + * + * @return true on success, false on error. + * @see createModify() + */ + public function create($p_filelist) + { + return $this->createModify($p_filelist, '', ''); + } + + /** + * This method add the files / directories that are listed in $p_filelist in + * the archive. If the archive does not exist it is created. + * The method return false and a PEAR error text. + * The files and directories listed are only added at the end of the archive, + * even if a file with the same name is already archived. + * See also createModify() method for more details. + * + * @param array $p_filelist An array of filenames and directory names, or a + * single string with names separated by a single + * blank space. + * + * @return true on success, false on error. + * @see createModify() + * @access public + */ + public function add($p_filelist) + { + return $this->addModify($p_filelist, '', ''); + } + + /** + * @param string $p_path + * @param bool $p_preserve + * @return bool + */ + public function extract($p_path = '', $p_preserve = false) + { + return $this->extractModify($p_path, '', $p_preserve); + } + + /** + * @return array|int + */ + public function listContent() + { + $v_list_detail = array(); + + if ($this->_openRead()) { + if (!$this->_extractList('', $v_list_detail, "list", '', '')) { + unset($v_list_detail); + $v_list_detail = 0; + } + $this->_close(); + } + + return $v_list_detail; + } + + /** + * This method creates the archive file and add the files / directories + * that are listed in $p_filelist. + * If the file already exists and is writable, it is replaced by the + * new tar. It is a create and not an add. If the file exists and is + * read-only or is a directory it is not replaced. The method return + * false and a PEAR error text. + * The $p_filelist parameter can be an array of string, each string + * representing a filename or a directory name with their path if + * needed. It can also be a single string with names separated by a + * single blank. + * The path indicated in $p_remove_dir will be removed from the + * memorized path of each file / directory listed when this path + * exists. By default nothing is removed (empty path '') + * The path indicated in $p_add_dir will be added at the beginning of + * the memorized path of each file / directory listed. However it can + * be set to empty ''. The adding of a path is done after the removing + * of path. + * The path add/remove ability enables the user to prepare an archive + * for extraction in a different path than the origin files are. + * See also addModify() method for file adding properties. + * + * @param array $p_filelist An array of filenames and directory names, + * or a single string with names separated by + * a single blank space. + * @param string $p_add_dir A string which contains a path to be added + * to the memorized path of each element in + * the list. + * @param string $p_remove_dir A string which contains a path to be + * removed from the memorized path of each + * element in the list, when relevant. + * + * @return boolean true on success, false on error. + * @see addModify() + */ + public function createModify($p_filelist, $p_add_dir, $p_remove_dir = '') + { + $v_result = true; + + if (!$this->_openWrite()) { + return false; + } + + if ($p_filelist != '') { + if (is_array($p_filelist)) { + $v_list = $p_filelist; + } elseif (is_string($p_filelist)) { + $v_list = explode($this->_separator, $p_filelist); + } else { + $this->_cleanFile(); + $this->_error('Invalid file list'); + return false; + } + + $v_result = $this->_addList($v_list, $p_add_dir, $p_remove_dir); + } + + if ($v_result) { + $this->_writeFooter(); + $this->_close(); + } else { + $this->_cleanFile(); + } + + return $v_result; + } + + /** + * This method add the files / directories listed in $p_filelist at the + * end of the existing archive. If the archive does not yet exists it + * is created. + * The $p_filelist parameter can be an array of string, each string + * representing a filename or a directory name with their path if + * needed. It can also be a single string with names separated by a + * single blank. + * The path indicated in $p_remove_dir will be removed from the + * memorized path of each file / directory listed when this path + * exists. By default nothing is removed (empty path '') + * The path indicated in $p_add_dir will be added at the beginning of + * the memorized path of each file / directory listed. However it can + * be set to empty ''. The adding of a path is done after the removing + * of path. + * The path add/remove ability enables the user to prepare an archive + * for extraction in a different path than the origin files are. + * If a file/dir is already in the archive it will only be added at the + * end of the archive. There is no update of the existing archived + * file/dir. However while extracting the archive, the last file will + * replace the first one. This results in a none optimization of the + * archive size. + * If a file/dir does not exist the file/dir is ignored. However an + * error text is send to PEAR error. + * If a file/dir is not readable the file/dir is ignored. However an + * error text is send to PEAR error. + * + * @param array $p_filelist An array of filenames and directory + * names, or a single string with names + * separated by a single blank space. + * @param string $p_add_dir A string which contains a path to be + * added to the memorized path of each + * element in the list. + * @param string $p_remove_dir A string which contains a path to be + * removed from the memorized path of + * each element in the list, when + * relevant. + * + * @return true on success, false on error. + */ + public function addModify($p_filelist, $p_add_dir, $p_remove_dir = '') + { + $v_result = true; + + if (!$this->_isArchive()) { + $v_result = $this->createModify( + $p_filelist, + $p_add_dir, + $p_remove_dir + ); + } else { + if (is_array($p_filelist)) { + $v_list = $p_filelist; + } elseif (is_string($p_filelist)) { + $v_list = explode($this->_separator, $p_filelist); + } else { + $this->_error('Invalid file list'); + return false; + } + + $v_result = $this->_append($v_list, $p_add_dir, $p_remove_dir); + } + + return $v_result; + } + + /** + * This method add a single string as a file at the + * end of the existing archive. If the archive does not yet exists it + * is created. + * + * @param string $p_filename A string which contains the full + * filename path that will be associated + * with the string. + * @param string $p_string The content of the file added in + * the archive. + * @param bool|int $p_datetime A custom date/time (unix timestamp) + * for the file (optional). + * @param array $p_params An array of optional params: + * stamp => the datetime (replaces + * datetime above if it exists) + * mode => the permissions on the + * file (600 by default) + * type => is this a link? See the + * tar specification for details. + * (default = regular file) + * uid => the user ID of the file + * (default = 0 = root) + * gid => the group ID of the file + * (default = 0 = root) + * + * @return true on success, false on error. + */ + public function addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) + { + $p_stamp = @$p_params["stamp"] ? $p_params["stamp"] : ($p_datetime ? $p_datetime : time()); + $p_mode = @$p_params["mode"] ? $p_params["mode"] : 0600; + $p_type = @$p_params["type"] ? $p_params["type"] : ""; + $p_uid = @$p_params["uid"] ? $p_params["uid"] : ""; + $p_gid = @$p_params["gid"] ? $p_params["gid"] : ""; + $v_result = true; + + if (!$this->_isArchive()) { + if (!$this->_openWrite()) { + return false; + } + $this->_close(); + } + + if (!$this->_openAppend()) { + return false; + } + + // Need to check the get back to the temporary file ? .... + $v_result = $this->_addString($p_filename, $p_string, $p_datetime, $p_params); + + $this->_writeFooter(); + + $this->_close(); + + return $v_result; + } + + /** + * This method extract all the content of the archive in the directory + * indicated by $p_path. When relevant the memorized path of the + * files/dir can be modified by removing the $p_remove_path path at the + * beginning of the file/dir path. + * While extracting a file, if the directory path does not exists it is + * created. + * While extracting a file, if the file already exists it is replaced + * without looking for last modification date. + * While extracting a file, if the file already exists and is write + * protected, the extraction is aborted. + * While extracting a file, if a directory with the same name already + * exists, the extraction is aborted. + * While extracting a directory, if a file with the same name already + * exists, the extraction is aborted. + * While extracting a file/directory if the destination directory exist + * and is write protected, or does not exist but can not be created, + * the extraction is aborted. + * If after extraction an extracted file does not show the correct + * stored file size, the extraction is aborted. + * When the extraction is aborted, a PEAR error text is set and false + * is returned. However the result can be a partial extraction that may + * need to be manually cleaned. + * + * @param string $p_path The path of the directory where the + * files/dir need to by extracted. + * @param string $p_remove_path Part of the memorized path that can be + * removed if present at the beginning of + * the file/dir path. + * @param boolean $p_preserve Preserve user/group ownership of files + * + * @return boolean true on success, false on error. + * @see extractList() + */ + public function extractModify($p_path, $p_remove_path, $p_preserve = false) + { + $v_result = true; + $v_list_detail = array(); + + if ($v_result = $this->_openRead()) { + $v_result = $this->_extractList( + $p_path, + $v_list_detail, + "complete", + 0, + $p_remove_path, + $p_preserve + ); + $this->_close(); + } + + return $v_result; + } + + /** + * This method extract from the archive one file identified by $p_filename. + * The return value is a string with the file content, or NULL on error. + * + * @param string $p_filename The path of the file to extract in a string. + * + * @return a string with the file content or NULL. + */ + public function extractInString($p_filename) + { + if ($this->_openRead()) { + $v_result = $this->_extractInString($p_filename); + $this->_close(); + } else { + $v_result = null; + } + + return $v_result; + } + + /** + * This method extract from the archive only the files indicated in the + * $p_filelist. These files are extracted in the current directory or + * in the directory indicated by the optional $p_path parameter. + * If indicated the $p_remove_path can be used in the same way as it is + * used in extractModify() method. + * + * @param array $p_filelist An array of filenames and directory names, + * or a single string with names separated + * by a single blank space. + * @param string $p_path The path of the directory where the + * files/dir need to by extracted. + * @param string $p_remove_path Part of the memorized path that can be + * removed if present at the beginning of + * the file/dir path. + * @param boolean $p_preserve Preserve user/group ownership of files + * + * @return true on success, false on error. + * @see extractModify() + */ + public function extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false) + { + $v_result = true; + $v_list_detail = array(); + + if (is_array($p_filelist)) { + $v_list = $p_filelist; + } elseif (is_string($p_filelist)) { + $v_list = explode($this->_separator, $p_filelist); + } else { + $this->_error('Invalid string list'); + return false; + } + + if ($v_result = $this->_openRead()) { + $v_result = $this->_extractList( + $p_path, + $v_list_detail, + "partial", + $v_list, + $p_remove_path, + $p_preserve + ); + $this->_close(); + } + + return $v_result; + } + + /** + * This method set specific attributes of the archive. It uses a variable + * list of parameters, in the format attribute code + attribute values : + * $arch->setAttribute(ARCHIVE_TAR_ATT_SEPARATOR, ','); + * + * @return true on success, false on error. + */ + public function setAttribute() + { + $v_result = true; + + // ----- Get the number of variable list of arguments + if (($v_size = func_num_args()) == 0) { + return true; + } + + // ----- Get the arguments + $v_att_list = func_get_args(); + + // ----- Read the attributes + $i = 0; + while ($i < $v_size) { + + // ----- Look for next option + switch ($v_att_list[$i]) { + // ----- Look for options that request a string value + case ARCHIVE_TAR_ATT_SEPARATOR : + // ----- Check the number of parameters + if (($i + 1) >= $v_size) { + $this->_error( + 'Invalid number of parameters for ' + . 'attribute ARCHIVE_TAR_ATT_SEPARATOR' + ); + return false; + } + + // ----- Get the value + $this->_separator = $v_att_list[$i + 1]; + $i++; + break; + + default : + $this->_error('Unknown attribute code ' . $v_att_list[$i] . ''); + return false; + } + + // ----- Next attribute + $i++; + } + + return $v_result; + } + + /** + * This method sets the regular expression for ignoring files and directories + * at import, for example: + * $arch->setIgnoreRegexp("#CVS|\.svn#"); + * + * @param string $regexp regular expression defining which files or directories to ignore + */ + public function setIgnoreRegexp($regexp) + { + $this->_ignore_regexp = $regexp; + } + + /** + * This method sets the regular expression for ignoring all files and directories + * matching the filenames in the array list at import, for example: + * $arch->setIgnoreList(array('CVS', '.svn', 'bin/tool')); + * + * @param array $list a list of file or directory names to ignore + * + * @access public + */ + public function setIgnoreList($list) + { + $regexp = str_replace(array('#', '.', '^', '$'), array('\#', '\.', '\^', '\$'), $list); + $regexp = '#/' . join('$|/', $list) . '#'; + $this->setIgnoreRegexp($regexp); + } + + /** + * @param string $p_message + */ + public function _error($p_message) + { + $this->error_object = $this->raiseError($p_message); + } + + /** + * @param string $p_message + */ + public function _warning($p_message) + { + $this->error_object = $this->raiseError($p_message); + } + + /** + * @param string $p_filename + * @return bool + */ + public function _isArchive($p_filename = null) + { + if ($p_filename == null) { + $p_filename = $this->_tarname; + } + clearstatcache(); + return @is_file($p_filename) && !@is_link($p_filename); + } + + /** + * @return bool + */ + public function _openWrite() + { + if ($this->_compress_type == 'gz' && function_exists('gzopen')) { + $this->_file = @gzopen($this->_tarname, "wb9"); + } else { + if ($this->_compress_type == 'bz2' && function_exists('bzopen')) { + $this->_file = @bzopen($this->_tarname, "w"); + } else { + if ($this->_compress_type == 'lzma2' && function_exists('xzopen')) { + $this->_file = @xzopen($this->_tarname, 'w'); + } else { + if ($this->_compress_type == 'none') { + $this->_file = @fopen($this->_tarname, "wb"); + } else { + $this->_error( + 'Unknown or missing compression type (' + . $this->_compress_type . ')' + ); + return false; + } + } + } + } + + if ($this->_file == 0) { + $this->_error( + 'Unable to open in write mode \'' + . $this->_tarname . '\'' + ); + return false; + } + + return true; + } + + /** + * @return bool + */ + public function _openRead() + { + if (strtolower(substr($this->_tarname, 0, 7)) == 'http://') { + + // ----- Look if a local copy need to be done + if ($this->_temp_tarname == '') { + $this->_temp_tarname = uniqid('tar') . '.tmp'; + if (!$v_file_from = @fopen($this->_tarname, 'rb')) { + $this->_error( + 'Unable to open in read mode \'' + . $this->_tarname . '\'' + ); + $this->_temp_tarname = ''; + return false; + } + if (!$v_file_to = @fopen($this->_temp_tarname, 'wb')) { + $this->_error( + 'Unable to open in write mode \'' + . $this->_temp_tarname . '\'' + ); + $this->_temp_tarname = ''; + return false; + } + while ($v_data = @fread($v_file_from, 1024)) { + @fwrite($v_file_to, $v_data); + } + @fclose($v_file_from); + @fclose($v_file_to); + } + + // ----- File to open if the local copy + $v_filename = $this->_temp_tarname; + } else { + // ----- File to open if the normal Tar file + + $v_filename = $this->_tarname; + } + + if ($this->_compress_type == 'gz' && function_exists('gzopen')) { + $this->_file = @gzopen($v_filename, "rb"); + } else { + if ($this->_compress_type == 'bz2' && function_exists('bzopen')) { + $this->_file = @bzopen($v_filename, "r"); + } else { + if ($this->_compress_type == 'lzma2' && function_exists('xzopen')) { + $this->_file = @xzopen($v_filename, "r"); + } else { + if ($this->_compress_type == 'none') { + $this->_file = @fopen($v_filename, "rb"); + } else { + $this->_error( + 'Unknown or missing compression type (' + . $this->_compress_type . ')' + ); + return false; + } + } + } + } + + if ($this->_file == 0) { + $this->_error('Unable to open in read mode \'' . $v_filename . '\''); + return false; + } + + return true; + } + + /** + * @return bool + */ + public function _openReadWrite() + { + if ($this->_compress_type == 'gz') { + $this->_file = @gzopen($this->_tarname, "r+b"); + } else { + if ($this->_compress_type == 'bz2') { + $this->_error( + 'Unable to open bz2 in read/write mode \'' + . $this->_tarname . '\' (limitation of bz2 extension)' + ); + return false; + } else { + if ($this->_compress_type == 'lzma2') { + $this->_error( + 'Unable to open lzma2 in read/write mode \'' + . $this->_tarname . '\' (limitation of lzma2 extension)' + ); + return false; + } else { + if ($this->_compress_type == 'none') { + $this->_file = @fopen($this->_tarname, "r+b"); + } else { + $this->_error( + 'Unknown or missing compression type (' + . $this->_compress_type . ')' + ); + return false; + } + } + } + } + + if ($this->_file == 0) { + $this->_error( + 'Unable to open in read/write mode \'' + . $this->_tarname . '\'' + ); + return false; + } + + return true; + } + + /** + * @return bool + */ + public function _close() + { + //if (isset($this->_file)) { + if (is_resource($this->_file)) { + if ($this->_compress_type == 'gz') { + @gzclose($this->_file); + } else { + if ($this->_compress_type == 'bz2') { + @bzclose($this->_file); + } else { + if ($this->_compress_type == 'lzma2') { + @xzclose($this->_file); + } else { + if ($this->_compress_type == 'none') { + @fclose($this->_file); + } else { + $this->_error( + 'Unknown or missing compression type (' + . $this->_compress_type . ')' + ); + } + } + } + } + + $this->_file = 0; + } + + // ----- Look if a local copy need to be erase + // Note that it might be interesting to keep the url for a time : ToDo + if ($this->_temp_tarname != '') { + @unlink($this->_temp_tarname); + $this->_temp_tarname = ''; + } + + return true; + } + + /** + * @return bool + */ + public function _cleanFile() + { + $this->_close(); + + // ----- Look for a local copy + if ($this->_temp_tarname != '') { + // ----- Remove the local copy but not the remote tarname + @unlink($this->_temp_tarname); + $this->_temp_tarname = ''; + } else { + // ----- Remove the local tarname file + @unlink($this->_tarname); + } + $this->_tarname = ''; + + return true; + } + + /** + * @param mixed $p_binary_data + * @param integer $p_len + * @return bool + */ + public function _writeBlock($p_binary_data, $p_len = null) + { + if (is_resource($this->_file)) { + if ($p_len === null) { + if ($this->_compress_type == 'gz') { + @gzputs($this->_file, $p_binary_data); + } else { + if ($this->_compress_type == 'bz2') { + @bzwrite($this->_file, $p_binary_data); + } else { + if ($this->_compress_type == 'lzma2') { + @xzwrite($this->_file, $p_binary_data); + } else { + if ($this->_compress_type == 'none') { + @fputs($this->_file, $p_binary_data); + } else { + $this->_error( + 'Unknown or missing compression type (' + . $this->_compress_type . ')' + ); + } + } + } + } + } else { + if ($this->_compress_type == 'gz') { + @gzputs($this->_file, $p_binary_data, $p_len); + } else { + if ($this->_compress_type == 'bz2') { + @bzwrite($this->_file, $p_binary_data, $p_len); + } else { + if ($this->_compress_type == 'lzma2') { + @xzwrite($this->_file, $p_binary_data, $p_len); + } else { + if ($this->_compress_type == 'none') { + @fputs($this->_file, $p_binary_data, $p_len); + } else { + $this->_error( + 'Unknown or missing compression type (' + . $this->_compress_type . ')' + ); + } + } + } + } + } + } + return true; + } + + /** + * @return null|string + */ + public function _readBlock() + { + $v_block = null; + if (is_resource($this->_file)) { + if ($this->_compress_type == 'gz') { + $v_block = @gzread($this->_file, 512); + } else { + if ($this->_compress_type == 'bz2') { + $v_block = @bzread($this->_file, 512); + } else { + if ($this->_compress_type == 'lzma2') { + $v_block = @xzread($this->_file, 512); + } else { + if ($this->_compress_type == 'none') { + $v_block = @fread($this->_file, 512); + } else { + $this->_error( + 'Unknown or missing compression type (' + . $this->_compress_type . ')' + ); + } + } + } + } + } + return $v_block; + } + + /** + * @param null $p_len + * @return bool + */ + public function _jumpBlock($p_len = null) + { + if (is_resource($this->_file)) { + if ($p_len === null) { + $p_len = 1; + } + + if ($this->_compress_type == 'gz') { + @gzseek($this->_file, gztell($this->_file) + ($p_len * 512)); + } else { + if ($this->_compress_type == 'bz2') { + // ----- Replace missing bztell() and bzseek() + for ($i = 0; $i < $p_len; $i++) { + $this->_readBlock(); + } + } else { + if ($this->_compress_type == 'lzma2') { + // ----- Replace missing xztell() and xzseek() + for ($i = 0; $i < $p_len; $i++) { + $this->_readBlock(); + } + } else { + if ($this->_compress_type == 'none') { + @fseek($this->_file, $p_len * 512, SEEK_CUR); + } else { + $this->_error( + 'Unknown or missing compression type (' + . $this->_compress_type . ')' + ); + } + } + } + } + } + return true; + } + + /** + * @return bool + */ + public function _writeFooter() + { + if (is_resource($this->_file)) { + // ----- Write the last 0 filled block for end of archive + $v_binary_data = pack('a1024', ''); + $this->_writeBlock($v_binary_data); + } + return true; + } + + /** + * @param array $p_list + * @param string $p_add_dir + * @param string $p_remove_dir + * @return bool + */ + public function _addList($p_list, $p_add_dir, $p_remove_dir) + { + $v_result = true; + $v_header = array(); + + // ----- Remove potential windows directory separator + $p_add_dir = $this->_translateWinPath($p_add_dir); + $p_remove_dir = $this->_translateWinPath($p_remove_dir, false); + + if (!$this->_file) { + $this->_error('Invalid file descriptor'); + return false; + } + + if (sizeof($p_list) == 0) { + return true; + } + + foreach ($p_list as $v_filename) { + if (!$v_result) { + break; + } + + // ----- Skip the current tar name + if ($v_filename == $this->_tarname) { + continue; + } + + if ($v_filename == '') { + continue; + } + + // ----- ignore files and directories matching the ignore regular expression + if ($this->_ignore_regexp && preg_match($this->_ignore_regexp, '/' . $v_filename)) { + $this->_warning("File '$v_filename' ignored"); + continue; + } + + if (!file_exists($v_filename) && !is_link($v_filename)) { + $this->_warning("File '$v_filename' does not exist"); + continue; + } + + // ----- Add the file or directory header + if (!$this->_addFile($v_filename, $v_header, $p_add_dir, $p_remove_dir)) { + return false; + } + + if (@is_dir($v_filename) && !@is_link($v_filename)) { + if (!($p_hdir = opendir($v_filename))) { + $this->_warning("Directory '$v_filename' can not be read"); + continue; + } + while (false !== ($p_hitem = readdir($p_hdir))) { + if (($p_hitem != '.') && ($p_hitem != '..')) { + if ($v_filename != ".") { + $p_temp_list[0] = $v_filename . '/' . $p_hitem; + } else { + $p_temp_list[0] = $p_hitem; + } + + $v_result = $this->_addList( + $p_temp_list, + $p_add_dir, + $p_remove_dir + ); + } + } + + unset($p_temp_list); + unset($p_hdir); + unset($p_hitem); + } + } + + return $v_result; + } + + /** + * @param string $p_filename + * @param mixed $p_header + * @param string $p_add_dir + * @param string $p_remove_dir + * @param null $v_stored_filename + * @return bool + */ + public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $v_stored_filename = null) + { + if (!$this->_file) { + $this->_error('Invalid file descriptor'); + return false; + } + + if ($p_filename == '') { + $this->_error('Invalid file name'); + return false; + } + + if (is_null($v_stored_filename)) { + // ----- Calculate the stored filename + $p_filename = $this->_translateWinPath($p_filename, false); + $v_stored_filename = $p_filename; + + if (strcmp($p_filename, $p_remove_dir) == 0) { + return true; + } + + if ($p_remove_dir != '') { + if (substr($p_remove_dir, -1) != '/') { + $p_remove_dir .= '/'; + } + + if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir) { + $v_stored_filename = substr($p_filename, strlen($p_remove_dir)); + } + } + + $v_stored_filename = $this->_translateWinPath($v_stored_filename); + if ($p_add_dir != '') { + if (substr($p_add_dir, -1) == '/') { + $v_stored_filename = $p_add_dir . $v_stored_filename; + } else { + $v_stored_filename = $p_add_dir . '/' . $v_stored_filename; + } + } + + $v_stored_filename = $this->_pathReduction($v_stored_filename); + } + + if ($this->_isArchive($p_filename)) { + if (($v_file = @fopen($p_filename, "rb")) == 0) { + $this->_warning( + "Unable to open file '" . $p_filename + . "' in binary read mode" + ); + return true; + } + + if (!$this->_writeHeader($p_filename, $v_stored_filename)) { + return false; + } + + while (($v_buffer = fread($v_file, $this->buffer_length)) != '') { + $buffer_length = strlen("$v_buffer"); + if ($buffer_length != $this->buffer_length) { + $pack_size = ((int)($buffer_length / 512) + 1) * 512; + $pack_format = sprintf('a%d', $pack_size); + } else { + $pack_format = sprintf('a%d', $this->buffer_length); + } + $v_binary_data = pack($pack_format, "$v_buffer"); + $this->_writeBlock($v_binary_data); + } + + fclose($v_file); + } else { + // ----- Only header for dir + if (!$this->_writeHeader($p_filename, $v_stored_filename)) { + return false; + } + } + + return true; + } + + /** + * @param string $p_filename + * @param string $p_string + * @param bool $p_datetime + * @param array $p_params + * @return bool + */ + public function _addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) + { + $p_stamp = @$p_params["stamp"] ? $p_params["stamp"] : ($p_datetime ? $p_datetime : time()); + $p_mode = @$p_params["mode"] ? $p_params["mode"] : 0600; + $p_type = @$p_params["type"] ? $p_params["type"] : ""; + $p_uid = @$p_params["uid"] ? $p_params["uid"] : 0; + $p_gid = @$p_params["gid"] ? $p_params["gid"] : 0; + if (!$this->_file) { + $this->_error('Invalid file descriptor'); + return false; + } + + if ($p_filename == '') { + $this->_error('Invalid file name'); + return false; + } + + // ----- Calculate the stored filename + $p_filename = $this->_translateWinPath($p_filename, false); + + // ----- If datetime is not specified, set current time + if ($p_datetime === false) { + $p_datetime = time(); + } + + if (!$this->_writeHeaderBlock( + $p_filename, + strlen($p_string), + $p_stamp, + $p_mode, + $p_type, + $p_uid, + $p_gid + ) + ) { + return false; + } + + $i = 0; + while (($v_buffer = substr($p_string, (($i++) * 512), 512)) != '') { + $v_binary_data = pack("a512", $v_buffer); + $this->_writeBlock($v_binary_data); + } + + return true; + } + + /** + * @param string $p_filename + * @param string $p_stored_filename + * @return bool + */ + public function _writeHeader($p_filename, $p_stored_filename) + { + if ($p_stored_filename == '') { + $p_stored_filename = $p_filename; + } + + $v_reduced_filename = $this->_pathReduction($p_stored_filename); + + if (strlen($v_reduced_filename) > 99) { + if (!$this->_writeLongHeader($v_reduced_filename, false)) { + return false; + } + } + + $v_linkname = ''; + if (@is_link($p_filename)) { + $v_linkname = readlink($p_filename); + } + + if (strlen($v_linkname) > 99) { + if (!$this->_writeLongHeader($v_linkname, true)) { + return false; + } + } + + $v_info = lstat($p_filename); + $v_uid = sprintf("%07s", DecOct($v_info[4])); + $v_gid = sprintf("%07s", DecOct($v_info[5])); + $v_perms = sprintf("%07s", DecOct($v_info['mode'] & 000777)); + $v_mtime = sprintf("%011s", DecOct($v_info['mtime'])); + + if (@is_link($p_filename)) { + $v_typeflag = '2'; + $v_size = sprintf("%011s", DecOct(0)); + } elseif (@is_dir($p_filename)) { + $v_typeflag = "5"; + $v_size = sprintf("%011s", DecOct(0)); + } else { + $v_typeflag = '0'; + clearstatcache(); + $v_size = sprintf("%011s", DecOct($v_info['size'])); + } + + $v_magic = 'ustar '; + $v_version = ' '; + + if (function_exists('posix_getpwuid')) { + $userinfo = posix_getpwuid($v_info[4]); + $groupinfo = posix_getgrgid($v_info[5]); + + $v_uname = $userinfo['name']; + $v_gname = $groupinfo['name']; + } else { + $v_uname = ''; + $v_gname = ''; + } + + $v_devmajor = ''; + $v_devminor = ''; + $v_prefix = ''; + + $v_binary_data_first = pack( + "a100a8a8a8a12a12", + $v_reduced_filename, + $v_perms, + $v_uid, + $v_gid, + $v_size, + $v_mtime + ); + $v_binary_data_last = pack( + "a1a100a6a2a32a32a8a8a155a12", + $v_typeflag, + $v_linkname, + $v_magic, + $v_version, + $v_uname, + $v_gname, + $v_devmajor, + $v_devminor, + $v_prefix, + '' + ); + + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + for ($i = 0; $i < 148; $i++) { + $v_checksum += ord(substr($v_binary_data_first, $i, 1)); + } + // ..... Ignore the checksum value and replace it by ' ' (space) + for ($i = 148; $i < 156; $i++) { + $v_checksum += ord(' '); + } + // ..... Last part of the header + for ($i = 156, $j = 0; $i < 512; $i++, $j++) { + $v_checksum += ord(substr($v_binary_data_last, $j, 1)); + } + + // ----- Write the first 148 bytes of the header in the archive + $this->_writeBlock($v_binary_data_first, 148); + + // ----- Write the calculated checksum + $v_checksum = sprintf("%06s\0 ", DecOct($v_checksum)); + $v_binary_data = pack("a8", $v_checksum); + $this->_writeBlock($v_binary_data, 8); + + // ----- Write the last 356 bytes of the header in the archive + $this->_writeBlock($v_binary_data_last, 356); + + return true; + } + + /** + * @param string $p_filename + * @param int $p_size + * @param int $p_mtime + * @param int $p_perms + * @param string $p_type + * @param int $p_uid + * @param int $p_gid + * @return bool + */ + public function _writeHeaderBlock( + $p_filename, + $p_size, + $p_mtime = 0, + $p_perms = 0, + $p_type = '', + $p_uid = 0, + $p_gid = 0 + ) + { + $p_filename = $this->_pathReduction($p_filename); + + if (strlen($p_filename) > 99) { + if (!$this->_writeLongHeader($p_filename, false)) { + return false; + } + } + + if ($p_type == "5") { + $v_size = sprintf("%011s", DecOct(0)); + } else { + $v_size = sprintf("%011s", DecOct($p_size)); + } + + $v_uid = sprintf("%07s", DecOct($p_uid)); + $v_gid = sprintf("%07s", DecOct($p_gid)); + $v_perms = sprintf("%07s", DecOct($p_perms & 000777)); + + $v_mtime = sprintf("%11s", DecOct($p_mtime)); + + $v_linkname = ''; + + $v_magic = 'ustar '; + + $v_version = ' '; + + if (function_exists('posix_getpwuid')) { + $userinfo = posix_getpwuid($p_uid); + $groupinfo = posix_getgrgid($p_gid); + + $v_uname = $userinfo['name']; + $v_gname = $groupinfo['name']; + } else { + $v_uname = ''; + $v_gname = ''; + } + + $v_devmajor = ''; + + $v_devminor = ''; + + $v_prefix = ''; + + $v_binary_data_first = pack( + "a100a8a8a8a12A12", + $p_filename, + $v_perms, + $v_uid, + $v_gid, + $v_size, + $v_mtime + ); + $v_binary_data_last = pack( + "a1a100a6a2a32a32a8a8a155a12", + $p_type, + $v_linkname, + $v_magic, + $v_version, + $v_uname, + $v_gname, + $v_devmajor, + $v_devminor, + $v_prefix, + '' + ); + + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + for ($i = 0; $i < 148; $i++) { + $v_checksum += ord(substr($v_binary_data_first, $i, 1)); + } + // ..... Ignore the checksum value and replace it by ' ' (space) + for ($i = 148; $i < 156; $i++) { + $v_checksum += ord(' '); + } + // ..... Last part of the header + for ($i = 156, $j = 0; $i < 512; $i++, $j++) { + $v_checksum += ord(substr($v_binary_data_last, $j, 1)); + } + + // ----- Write the first 148 bytes of the header in the archive + $this->_writeBlock($v_binary_data_first, 148); + + // ----- Write the calculated checksum + $v_checksum = sprintf("%06s ", DecOct($v_checksum)); + $v_binary_data = pack("a8", $v_checksum); + $this->_writeBlock($v_binary_data, 8); + + // ----- Write the last 356 bytes of the header in the archive + $this->_writeBlock($v_binary_data_last, 356); + + return true; + } + + /** + * @param string $p_filename + * @return bool + */ + public function _writeLongHeader($p_filename, $is_link = false) + { + $v_uid = sprintf("%07s", 0); + $v_gid = sprintf("%07s", 0); + $v_perms = sprintf("%07s", 0); + $v_size = sprintf("%'011s", DecOct(strlen($p_filename))); + $v_mtime = sprintf("%011s", 0); + $v_typeflag = ($is_link ? 'K' : 'L'); + $v_linkname = ''; + $v_magic = 'ustar '; + $v_version = ' '; + $v_uname = ''; + $v_gname = ''; + $v_devmajor = ''; + $v_devminor = ''; + $v_prefix = ''; + + $v_binary_data_first = pack( + "a100a8a8a8a12a12", + '././@LongLink', + $v_perms, + $v_uid, + $v_gid, + $v_size, + $v_mtime + ); + $v_binary_data_last = pack( + "a1a100a6a2a32a32a8a8a155a12", + $v_typeflag, + $v_linkname, + $v_magic, + $v_version, + $v_uname, + $v_gname, + $v_devmajor, + $v_devminor, + $v_prefix, + '' + ); + + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + for ($i = 0; $i < 148; $i++) { + $v_checksum += ord(substr($v_binary_data_first, $i, 1)); + } + // ..... Ignore the checksum value and replace it by ' ' (space) + for ($i = 148; $i < 156; $i++) { + $v_checksum += ord(' '); + } + // ..... Last part of the header + for ($i = 156, $j = 0; $i < 512; $i++, $j++) { + $v_checksum += ord(substr($v_binary_data_last, $j, 1)); + } + + // ----- Write the first 148 bytes of the header in the archive + $this->_writeBlock($v_binary_data_first, 148); + + // ----- Write the calculated checksum + $v_checksum = sprintf("%06s\0 ", DecOct($v_checksum)); + $v_binary_data = pack("a8", $v_checksum); + $this->_writeBlock($v_binary_data, 8); + + // ----- Write the last 356 bytes of the header in the archive + $this->_writeBlock($v_binary_data_last, 356); + + // ----- Write the filename as content of the block + $i = 0; + while (($v_buffer = substr($p_filename, (($i++) * 512), 512)) != '') { + $v_binary_data = pack("a512", "$v_buffer"); + $this->_writeBlock($v_binary_data); + } + + return true; + } + + /** + * @param mixed $v_binary_data + * @param mixed $v_header + * @return bool + */ + public function _readHeader($v_binary_data, &$v_header) + { + if (strlen($v_binary_data) == 0) { + $v_header['filename'] = ''; + return true; + } + + if (strlen($v_binary_data) != 512) { + $v_header['filename'] = ''; + $this->_error('Invalid block size : ' . strlen($v_binary_data)); + return false; + } + + if (!is_array($v_header)) { + $v_header = array(); + } + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + $v_binary_split = str_split($v_binary_data); + $v_checksum += array_sum(array_map('ord', array_slice($v_binary_split, 0, 148))); + $v_checksum += array_sum(array_map('ord', array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',))); + $v_checksum += array_sum(array_map('ord', array_slice($v_binary_split, 156, 512))); + + + $v_data = unpack($this->_fmt, $v_binary_data); + + if (strlen($v_data["prefix"]) > 0) { + $v_data["filename"] = "$v_data[prefix]/$v_data[filename]"; + } + + // ----- Extract the checksum + $v_header['checksum'] = OctDec(trim($v_data['checksum'])); + if ($v_header['checksum'] != $v_checksum) { + $v_header['filename'] = ''; + + // ----- Look for last block (empty block) + if (($v_checksum == 256) && ($v_header['checksum'] == 0)) { + return true; + } + + $this->_error( + 'Invalid checksum for file "' . $v_data['filename'] + . '" : ' . $v_checksum . ' calculated, ' + . $v_header['checksum'] . ' expected' + ); + return false; + } + + // ----- Extract the properties + $v_header['filename'] = rtrim($v_data['filename'], "\0"); + if ($this->_maliciousFilename($v_header['filename'])) { + $this->_error( + 'Malicious .tar detected, file "' . $v_header['filename'] . + '" will not install in desired directory tree' + ); + return false; + } + $v_header['mode'] = OctDec(trim($v_data['mode'])); + $v_header['uid'] = OctDec(trim($v_data['uid'])); + $v_header['gid'] = OctDec(trim($v_data['gid'])); + $v_header['size'] = $this->_tarRecToSize($v_data['size']); + $v_header['mtime'] = OctDec(trim($v_data['mtime'])); + if (($v_header['typeflag'] = $v_data['typeflag']) == "5") { + $v_header['size'] = 0; + } + $v_header['link'] = trim($v_data['link']); + /* ----- All these fields are removed form the header because + they do not carry interesting info + $v_header[magic] = trim($v_data[magic]); + $v_header[version] = trim($v_data[version]); + $v_header[uname] = trim($v_data[uname]); + $v_header[gname] = trim($v_data[gname]); + $v_header[devmajor] = trim($v_data[devmajor]); + $v_header[devminor] = trim($v_data[devminor]); + */ + + return true; + } + + /** + * Convert Tar record size to actual size + * + * @param string $tar_size + * @return size of tar record in bytes + */ + private function _tarRecToSize($tar_size) + { + /* + * First byte of size has a special meaning if bit 7 is set. + * + * Bit 7 indicates base-256 encoding if set. + * Bit 6 is the sign bit. + * Bits 5:0 are most significant value bits. + */ + $ch = ord($tar_size[0]); + if ($ch & 0x80) { + // Full 12-bytes record is required. + $rec_str = $tar_size . "\x00"; + + $size = ($ch & 0x40) ? -1 : 0; + $size = ($size << 6) | ($ch & 0x3f); + + for ($num_ch = 1; $num_ch < 12; ++$num_ch) { + $size = ($size * 256) + ord($rec_str[$num_ch]); + } + + return $size; + + } else { + return OctDec(trim($tar_size)); + } + } + + /** + * Detect and report a malicious file name + * + * @param string $file + * + * @return bool + */ + private function _maliciousFilename($file) + { + if (strpos($file, 'phar://') === 0) { + return true; + } + if (strpos($file, '../') !== false || strpos($file, '..\\') !== false) { + return true; + } + return false; + } + + /** + * @param $v_header + * @return bool + */ + public function _readLongHeader(&$v_header) + { + $v_filename = ''; + $v_filesize = $v_header['size']; + $n = floor($v_header['size'] / 512); + for ($i = 0; $i < $n; $i++) { + $v_content = $this->_readBlock(); + $v_filename .= $v_content; + } + if (($v_header['size'] % 512) != 0) { + $v_content = $this->_readBlock(); + $v_filename .= $v_content; + } + + // ----- Read the next header + $v_binary_data = $this->_readBlock(); + + if (!$this->_readHeader($v_binary_data, $v_header)) { + return false; + } + + $v_filename = rtrim(substr($v_filename, 0, $v_filesize), "\0"); + $v_header['filename'] = $v_filename; + if ($this->_maliciousFilename($v_filename)) { + $this->_error( + 'Malicious .tar detected, file "' . $v_filename . + '" will not install in desired directory tree' + ); + return false; + } + + return true; + } + + /** + * This method extract from the archive one file identified by $p_filename. + * The return value is a string with the file content, or null on error. + * + * @param string $p_filename The path of the file to extract in a string. + * + * @return a string with the file content or null. + */ + private function _extractInString($p_filename) + { + $v_result_str = ""; + + while (strlen($v_binary_data = $this->_readBlock()) != 0) { + if (!$this->_readHeader($v_binary_data, $v_header)) { + return null; + } + + if ($v_header['filename'] == '') { + continue; + } + + switch ($v_header['typeflag']) { + case 'L': + { + if (!$this->_readLongHeader($v_header)) { + return null; + } + } + break; + + case 'K': + { + $v_link_header = $v_header; + if (!$this->_readLongHeader($v_link_header)) { + return null; + } + $v_header['link'] = $v_link_header['filename']; + } + break; + } + + if ($v_header['filename'] == $p_filename) { + if ($v_header['typeflag'] == "5") { + $this->_error( + 'Unable to extract in string a directory ' + . 'entry {' . $v_header['filename'] . '}' + ); + return null; + } else { + $n = floor($v_header['size'] / 512); + for ($i = 0; $i < $n; $i++) { + $v_result_str .= $this->_readBlock(); + } + if (($v_header['size'] % 512) != 0) { + $v_content = $this->_readBlock(); + $v_result_str .= substr( + $v_content, + 0, + ($v_header['size'] % 512) + ); + } + return $v_result_str; + } + } else { + $this->_jumpBlock(ceil(($v_header['size'] / 512))); + } + } + + return null; + } + + /** + * @param string $p_path + * @param string $p_list_detail + * @param string $p_mode + * @param string $p_file_list + * @param string $p_remove_path + * @param bool $p_preserve + * @return bool + */ + public function _extractList( + $p_path, + &$p_list_detail, + $p_mode, + $p_file_list, + $p_remove_path, + $p_preserve = false + ) + { + $v_result = true; + $v_nb = 0; + $v_extract_all = true; + $v_listing = false; + + $p_path = $this->_translateWinPath($p_path, false); + if ($p_path == '' || (substr($p_path, 0, 1) != '/' + && substr($p_path, 0, 3) != "../" && !strpos($p_path, ':')) + ) { + $p_path = "./" . $p_path; + } + $p_remove_path = $this->_translateWinPath($p_remove_path); + + // ----- Look for path to remove format (should end by /) + if (($p_remove_path != '') && (substr($p_remove_path, -1) != '/')) { + $p_remove_path .= '/'; + } + $p_remove_path_size = strlen($p_remove_path); + + switch ($p_mode) { + case "complete" : + $v_extract_all = true; + $v_listing = false; + break; + case "partial" : + $v_extract_all = false; + $v_listing = false; + break; + case "list" : + $v_extract_all = false; + $v_listing = true; + break; + default : + $this->_error('Invalid extract mode (' . $p_mode . ')'); + return false; + } + + clearstatcache(); + + while (strlen($v_binary_data = $this->_readBlock()) != 0) { + $v_extract_file = false; + $v_extraction_stopped = 0; + + if (!$this->_readHeader($v_binary_data, $v_header)) { + return false; + } + + if ($v_header['filename'] == '') { + continue; + } + + switch ($v_header['typeflag']) { + case 'L': + { + if (!$this->_readLongHeader($v_header)) { + return null; + } + } + break; + + case 'K': + { + $v_link_header = $v_header; + if (!$this->_readLongHeader($v_link_header)) { + return null; + } + $v_header['link'] = $v_link_header['filename']; + } + break; + } + + // ignore extended / pax headers + if ($v_header['typeflag'] == 'x' || $v_header['typeflag'] == 'g') { + $this->_jumpBlock(ceil(($v_header['size'] / 512))); + continue; + } + + if ((!$v_extract_all) && (is_array($p_file_list))) { + // ----- By default no unzip if the file is not found + $v_extract_file = false; + + for ($i = 0; $i < sizeof($p_file_list); $i++) { + // ----- Look if it is a directory + if (substr($p_file_list[$i], -1) == '/') { + // ----- Look if the directory is in the filename path + if ((strlen($v_header['filename']) > strlen($p_file_list[$i])) + && (substr($v_header['filename'], 0, strlen($p_file_list[$i])) + == $p_file_list[$i]) + ) { + $v_extract_file = true; + break; + } + } // ----- It is a file, so compare the file names + elseif ($p_file_list[$i] == $v_header['filename']) { + $v_extract_file = true; + break; + } + } + } else { + $v_extract_file = true; + } + + // ----- Look if this file need to be extracted + if (($v_extract_file) && (!$v_listing)) { + if (($p_remove_path != '') + && (substr($v_header['filename'] . '/', 0, $p_remove_path_size) + == $p_remove_path) + ) { + $v_header['filename'] = substr( + $v_header['filename'], + $p_remove_path_size + ); + if ($v_header['filename'] == '') { + continue; + } + } + if (($p_path != './') && ($p_path != '/')) { + while (substr($p_path, -1) == '/') { + $p_path = substr($p_path, 0, strlen($p_path) - 1); + } + + if (substr($v_header['filename'], 0, 1) == '/') { + $v_header['filename'] = $p_path . $v_header['filename']; + } else { + $v_header['filename'] = $p_path . '/' . $v_header['filename']; + } + } + if (file_exists($v_header['filename'])) { + if ((@is_dir($v_header['filename'])) + && ($v_header['typeflag'] == '') + ) { + $this->_error( + 'File ' . $v_header['filename'] + . ' already exists as a directory' + ); + return false; + } + if (($this->_isArchive($v_header['filename'])) + && ($v_header['typeflag'] == "5") + ) { + $this->_error( + 'Directory ' . $v_header['filename'] + . ' already exists as a file' + ); + return false; + } + if (!is_writeable($v_header['filename'])) { + $this->_error( + 'File ' . $v_header['filename'] + . ' already exists and is write protected' + ); + return false; + } + if (filemtime($v_header['filename']) > $v_header['mtime']) { + // To be completed : An error or silent no replace ? + } + } // ----- Check the directory availability and create it if necessary + elseif (($v_result + = $this->_dirCheck( + ($v_header['typeflag'] == "5" + ? $v_header['filename'] + : dirname($v_header['filename'])) + )) != 1 + ) { + $this->_error('Unable to create path for ' . $v_header['filename']); + return false; + } + + if ($v_extract_file) { + if ($v_header['typeflag'] == "5") { + if (!@file_exists($v_header['filename'])) { + if (!@mkdir($v_header['filename'], 0777)) { + $this->_error( + 'Unable to create directory {' + . $v_header['filename'] . '}' + ); + return false; + } + } + } elseif ($v_header['typeflag'] == "2") { + if (@file_exists($v_header['filename'])) { + @unlink($v_header['filename']); + } + if (!@symlink($v_header['link'], $v_header['filename'])) { + $this->_error( + 'Unable to extract symbolic link {' + . $v_header['filename'] . '}' + ); + return false; + } + } else { + if (($v_dest_file = @fopen($v_header['filename'], "wb")) == 0) { + $this->_error( + 'Error while opening {' . $v_header['filename'] + . '} in write binary mode' + ); + return false; + } else { + $n = floor($v_header['size'] / 512); + for ($i = 0; $i < $n; $i++) { + $v_content = $this->_readBlock(); + fwrite($v_dest_file, $v_content, 512); + } + if (($v_header['size'] % 512) != 0) { + $v_content = $this->_readBlock(); + fwrite($v_dest_file, $v_content, ($v_header['size'] % 512)); + } + + @fclose($v_dest_file); + + if ($p_preserve) { + @chown($v_header['filename'], $v_header['uid']); + @chgrp($v_header['filename'], $v_header['gid']); + } + + // ----- Change the file mode, mtime + @touch($v_header['filename'], $v_header['mtime']); + if ($v_header['mode'] & 0111) { + // make file executable, obey umask + $mode = fileperms($v_header['filename']) | (~umask() & 0111); + @chmod($v_header['filename'], $mode); + } + } + + // ----- Check the file size + clearstatcache(); + if (!is_file($v_header['filename'])) { + $this->_error( + 'Extracted file ' . $v_header['filename'] + . 'does not exist. Archive may be corrupted.' + ); + return false; + } + + $filesize = filesize($v_header['filename']); + if ($filesize != $v_header['size']) { + $this->_error( + 'Extracted file ' . $v_header['filename'] + . ' does not have the correct file size \'' + . $filesize + . '\' (' . $v_header['size'] + . ' expected). Archive may be corrupted.' + ); + return false; + } + } + } else { + $this->_jumpBlock(ceil(($v_header['size'] / 512))); + } + } else { + $this->_jumpBlock(ceil(($v_header['size'] / 512))); + } + + /* TBC : Seems to be unused ... + if ($this->_compress) + $v_end_of_file = @gzeof($this->_file); + else + $v_end_of_file = @feof($this->_file); + */ + + if ($v_listing || $v_extract_file || $v_extraction_stopped) { + // ----- Log extracted files + if (($v_file_dir = dirname($v_header['filename'])) + == $v_header['filename'] + ) { + $v_file_dir = ''; + } + if ((substr($v_header['filename'], 0, 1) == '/') && ($v_file_dir == '')) { + $v_file_dir = '/'; + } + + $p_list_detail[$v_nb++] = $v_header; + if (is_array($p_file_list) && (count($p_list_detail) == count($p_file_list))) { + return true; + } + } + } + + return true; + } + + /** + * @return bool + */ + public function _openAppend() + { + if (filesize($this->_tarname) == 0) { + return $this->_openWrite(); + } + + if ($this->_compress) { + $this->_close(); + + if (!@rename($this->_tarname, $this->_tarname . ".tmp")) { + $this->_error( + 'Error while renaming \'' . $this->_tarname + . '\' to temporary file \'' . $this->_tarname + . '.tmp\'' + ); + return false; + } + + if ($this->_compress_type == 'gz') { + $v_temp_tar = @gzopen($this->_tarname . ".tmp", "rb"); + } elseif ($this->_compress_type == 'bz2') { + $v_temp_tar = @bzopen($this->_tarname . ".tmp", "r"); + } elseif ($this->_compress_type == 'lzma2') { + $v_temp_tar = @xzopen($this->_tarname . ".tmp", "r"); + } + + + if ($v_temp_tar == 0) { + $this->_error( + 'Unable to open file \'' . $this->_tarname + . '.tmp\' in binary read mode' + ); + @rename($this->_tarname . ".tmp", $this->_tarname); + return false; + } + + if (!$this->_openWrite()) { + @rename($this->_tarname . ".tmp", $this->_tarname); + return false; + } + + if ($this->_compress_type == 'gz') { + $end_blocks = 0; + + while (!@gzeof($v_temp_tar)) { + $v_buffer = @gzread($v_temp_tar, 512); + if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { + $end_blocks++; + // do not copy end blocks, we will re-make them + // after appending + continue; + } elseif ($end_blocks > 0) { + for ($i = 0; $i < $end_blocks; $i++) { + $this->_writeBlock(ARCHIVE_TAR_END_BLOCK); + } + $end_blocks = 0; + } + $v_binary_data = pack("a512", $v_buffer); + $this->_writeBlock($v_binary_data); + } + + @gzclose($v_temp_tar); + } elseif ($this->_compress_type == 'bz2') { + $end_blocks = 0; + + while (strlen($v_buffer = @bzread($v_temp_tar, 512)) > 0) { + if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { + $end_blocks++; + // do not copy end blocks, we will re-make them + // after appending + continue; + } elseif ($end_blocks > 0) { + for ($i = 0; $i < $end_blocks; $i++) { + $this->_writeBlock(ARCHIVE_TAR_END_BLOCK); + } + $end_blocks = 0; + } + $v_binary_data = pack("a512", $v_buffer); + $this->_writeBlock($v_binary_data); + } + + @bzclose($v_temp_tar); + } elseif ($this->_compress_type == 'lzma2') { + $end_blocks = 0; + + while (strlen($v_buffer = @xzread($v_temp_tar, 512)) > 0) { + if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { + $end_blocks++; + // do not copy end blocks, we will re-make them + // after appending + continue; + } elseif ($end_blocks > 0) { + for ($i = 0; $i < $end_blocks; $i++) { + $this->_writeBlock(ARCHIVE_TAR_END_BLOCK); + } + $end_blocks = 0; + } + $v_binary_data = pack("a512", $v_buffer); + $this->_writeBlock($v_binary_data); + } + + @xzclose($v_temp_tar); + } + + if (!@unlink($this->_tarname . ".tmp")) { + $this->_error( + 'Error while deleting temporary file \'' + . $this->_tarname . '.tmp\'' + ); + } + } else { + // ----- For not compressed tar, just add files before the last + // one or two 512 bytes block + if (!$this->_openReadWrite()) { + return false; + } + + clearstatcache(); + $v_size = filesize($this->_tarname); + + // We might have zero, one or two end blocks. + // The standard is two, but we should try to handle + // other cases. + fseek($this->_file, $v_size - 1024); + if (fread($this->_file, 512) == ARCHIVE_TAR_END_BLOCK) { + fseek($this->_file, $v_size - 1024); + } elseif (fread($this->_file, 512) == ARCHIVE_TAR_END_BLOCK) { + fseek($this->_file, $v_size - 512); + } + } + + return true; + } + + /** + * @param $p_filelist + * @param string $p_add_dir + * @param string $p_remove_dir + * @return bool + */ + public function _append($p_filelist, $p_add_dir = '', $p_remove_dir = '') + { + if (!$this->_openAppend()) { + return false; + } + + if ($this->_addList($p_filelist, $p_add_dir, $p_remove_dir)) { + $this->_writeFooter(); + } + + $this->_close(); + + return true; + } + + /** + * Check if a directory exists and create it (including parent + * dirs) if not. + * + * @param string $p_dir directory to check + * + * @return bool true if the directory exists or was created + */ + public function _dirCheck($p_dir) + { + clearstatcache(); + if ((@is_dir($p_dir)) || ($p_dir == '')) { + return true; + } + + $p_parent_dir = dirname($p_dir); + + if (($p_parent_dir != $p_dir) && + ($p_parent_dir != '') && + (!$this->_dirCheck($p_parent_dir)) + ) { + return false; + } + + if (!@mkdir($p_dir, 0777)) { + $this->_error("Unable to create directory '$p_dir'"); + return false; + } + + return true; + } + + /** + * Compress path by changing for example "/dir/foo/../bar" to "/dir/bar", + * rand emove double slashes. + * + * @param string $p_dir path to reduce + * + * @return string reduced path + */ + private function _pathReduction($p_dir) + { + $v_result = ''; + + // ----- Look for not empty path + if ($p_dir != '') { + // ----- Explode path by directory names + $v_list = explode('/', $p_dir); + + // ----- Study directories from last to first + for ($i = sizeof($v_list) - 1; $i >= 0; $i--) { + // ----- Look for current path + if ($v_list[$i] == ".") { + // ----- Ignore this directory + // Should be the first $i=0, but no check is done + } else { + if ($v_list[$i] == "..") { + // ----- Ignore it and ignore the $i-1 + $i--; + } else { + if (($v_list[$i] == '') + && ($i != (sizeof($v_list) - 1)) + && ($i != 0) + ) { + // ----- Ignore only the double '//' in path, + // but not the first and last / + } else { + $v_result = $v_list[$i] . ($i != (sizeof($v_list) - 1) ? '/' + . $v_result : ''); + } + } + } + } + } + + if (defined('OS_WINDOWS') && OS_WINDOWS) { + $v_result = strtr($v_result, '\\', '/'); + } + + return $v_result; + } + + /** + * @param $p_path + * @param bool $p_remove_disk_letter + * @return string + */ + public function _translateWinPath($p_path, $p_remove_disk_letter = true) + { + if (defined('OS_WINDOWS') && OS_WINDOWS) { + // ----- Look for potential disk letter + if (($p_remove_disk_letter) + && (($v_position = strpos($p_path, ':')) != false) + ) { + $p_path = substr($p_path, $v_position + 1); + } + // ----- Change potential windows directory separator + if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0, 1) == '\\')) { + $p_path = strtr($p_path, '\\', '/'); + } + } + return $p_path; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/README.md Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,34 @@ +Archive_Tar +========== + +[![Build Status](https://secure.travis-ci.org/pear/Archive_Tar.png?branch=master)](https://travis-ci.org/pear/Archive_Tar) + +This package provides handling of tar files in PHP. +It supports creating, listing, extracting and adding to tar files. +Gzip support is available if PHP has the zlib extension built-in or +loaded. Bz2 compression is also supported with the bz2 extension loaded. +Also Lzma2 compressed archives are supported with xz extension. + +This package is hosted at http://pear.php.net/package/Archive_Tar + +Please report all new issues via the PEAR bug tracker. + +Pull requests are welcome! + + +Testing, building +----------------- + +To test, run either +$ phpunit tests/ + or +$ pear run-tests -r + +To build, simply +$ pear package + +To install from scratch +$ pear install package.xml + +To upgrade +$ pear upgrade -f package.xml diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,54 @@ +{ + "name": "pear/archive_tar", + "description": "Tar file management class with compression support (gzip, bzip2, lzma2)", + "type": "library", + "keywords": [ + "archive", + "tar" + ], + "homepage": "https://github.com/pear/Archive_Tar", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Vincent Blavet", + "email": "vincent@phpconcept.net" + }, + { + "name": "Greg Beaver", + "email": "greg@chiaraquartet.net" + }, + { + "name": "Michiel Rook", + "email": "mrook@php.net" + } + ], + "require": { + "php": ">=5.2.0", + "pear/pear-core-minimal": "^1.10.0alpha2" + }, + "suggest": { + "ext-zlib": "Gzip compression support.", + "ext-bz2": "Bz2 compression support.", + "ext-xz": "Lzma2 compression support." + }, + "autoload": { + "psr-0": { + "Archive_Tar": "" + } + }, + "include-path": [ + "./" + ], + "support": { + "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Archive_Tar", + "source": "https://github.com/pear/Archive_Tar" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/docs/Archive_Tar.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/docs/Archive_Tar.txt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,475 @@ +Documentation for class Archive_Tar +=================================== +Last update : 2001-08-15 + + + +Overview : +---------- + + The Archive_Tar class helps in creating and managing GNU TAR format + files compressed by GNU ZIP or not. + The class offers basic functions like creating an archive, adding + files in the archive, extracting files from the archive and listing + the archive content. + It also provide advanced functions that allow the adding and + extraction of files with path manipulation. + + +Sample : +-------- + + // ----- Creating the object (uncompressed archive) + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object->setErrorHandling(PEAR_ERROR_PRINT); + + // ----- Creating the archive + $v_list[0]="file.txt"; + $v_list[1]="data/"; + $v_list[2]="file.log"; + $tar_object->create($v_list); + + // ----- Adding files + $v_list[0]="dev/file.txt"; + $v_list[1]="dev/data/"; + $v_list[2]="log/file.log"; + $tar_object->add($v_list); + + // ----- Adding more files + $tar_object->add("release/newfile.log release/readme.txt"); + + // ----- Listing the content + if (($v_list = $tar_object->listContent()) != 0) + for ($i=0; $i"; + echo " .size :'".$v_list[$i][size]."'
    "; + echo " .mtime :'".$v_list[$i][mtime]."' (".date("l dS of F Y h:i:s A", $v_list[$i][mtime]).")
    "; + echo " .mode :'".$v_list[$i][mode]."'
    "; + echo " .uid :'".$v_list[$i][uid]."'
    "; + echo " .gid :'".$v_list[$i][gid]."'
    "; + echo " .typeflag :'".$v_list[$i][typeflag]."'
    "; + } + + // ----- Extracting the archive in directory "install" + $tar_object->extract("install"); + + +Public arguments : +------------------ + +None + + +Public Methods : +---------------- + +Method : Archive_Tar($p_tarname, $compress = null) +Description : + Archive_Tar Class constructor. This flavour of the constructor only + declare a new Archive_Tar object, identifying it by the name of the + tar file. + If the compress argument is set the tar will be read or created as a + gzip or bz2 compressed TAR file. +Arguments : + $p_tarname : A valid filename for the tar archive file. + $p_compress : can be null, 'gz' or 'bz2'. For + compatibility reason it can also be true. This + parameter indicates if gzip or bz2 compression + is required. +Return value : + The Archive_Tar object. +Sample : + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object_compressed = new Archive_Tar("tarname.tgz", true); +How it works : + Initialize the object. + +Method : create($p_filelist) +Description : + This method creates the archive file and add the files / directories + that are listed in $p_filelist. + If the file already exists and is writable, it is replaced by the + new tar. It is a create and not an add. If the file exists and is + read-only or is a directory it is not replaced. The method return + false and a PEAR error text. + The $p_filelist parameter can be an array of string, each string + representing a filename or a directory name with their path if + needed. It can also be a single string with names separated by a + single blank. + See also createModify() method for more details. +Arguments : + $p_filelist : An array of filenames and directory names, or a single + string with names separated by a single blank space. +Return value : + true on success, false on error. +Sample 1 : + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling + $v_list[0]="file.txt"; + $v_list[1]="data/"; (Optional '/' at the end) + $v_list[2]="file.log"; + $tar_object->create($v_list); +Sample 2 : + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling + $tar_object->create("file.txt data/ file.log"); +How it works : + Just calling the createModify() method with the right parameters. + +Method : createModify($p_filelist, $p_add_dir, $p_remove_dir = "") +Description : + This method creates the archive file and add the files / directories + that are listed in $p_filelist. + If the file already exists and is writable, it is replaced by the + new tar. It is a create and not an add. If the file exists and is + read-only or is a directory it is not replaced. The method return + false and a PEAR error text. + The $p_filelist parameter can be an array of string, each string + representing a filename or a directory name with their path if + needed. It can also be a single string with names separated by a + single blank. + The path indicated in $p_remove_dir will be removed from the + memorized path of each file / directory listed when this path + exists. By default nothing is removed (empty path "") + The path indicated in $p_add_dir will be added at the beginning of + the memorized path of each file / directory listed. However it can + be set to empty "". The adding of a path is done after the removing + of path. + The path add/remove ability enables the user to prepare an archive + for extraction in a different path than the origin files are. + See also addModify() method for file adding properties. +Arguments : + $p_filelist : An array of filenames and directory names, or a single + string with names separated by a single blank space. + $p_add_dir : A string which contains a path to be added to the + memorized path of each element in the list. + $p_remove_dir : A string which contains a path to be removed from + the memorized path of each element in the list, when + relevant. +Return value : + true on success, false on error. +Sample 1 : + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling + $v_list[0]="file.txt"; + $v_list[1]="data/"; (Optional '/' at the end) + $v_list[2]="file.log"; + $tar_object->createModify($v_list, "install"); + // files are stored in the archive as : + // install/file.txt + // install/data + // install/data/file1.txt + // install/data/... all the files and sub-dirs of data/ + // install/file.log +Sample 2 : + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling + $v_list[0]="dev/file.txt"; + $v_list[1]="dev/data/"; (Optional '/' at the end) + $v_list[2]="log/file.log"; + $tar_object->createModify($v_list, "install", "dev"); + // files are stored in the archive as : + // install/file.txt + // install/data + // install/data/file1.txt + // install/data/... all the files and sub-dirs of data/ + // install/log/file.log +How it works : + Open the file in write mode (erasing the existing one if one), + call the _addList() method for adding the files in an empty archive, + add the tar footer (512 bytes block), close the tar file. + + +Method : addModify($p_filelist, $p_add_dir, $p_remove_dir="") +Description : + This method add the files / directories listed in $p_filelist at the + end of the existing archive. If the archive does not yet exists it + is created. + The $p_filelist parameter can be an array of string, each string + representing a filename or a directory name with their path if + needed. It can also be a single string with names separated by a + single blank. + The path indicated in $p_remove_dir will be removed from the + memorized path of each file / directory listed when this path + exists. By default nothing is removed (empty path "") + The path indicated in $p_add_dir will be added at the beginning of + the memorized path of each file / directory listed. However it can + be set to empty "". The adding of a path is done after the removing + of path. + The path add/remove ability enables the user to prepare an archive + for extraction in a different path than the origin files are. + If a file/dir is already in the archive it will only be added at the + end of the archive. There is no update of the existing archived + file/dir. However while extracting the archive, the last file will + replace the first one. This results in a none optimization of the + archive size. + If a file/dir does not exist the file/dir is ignored. However an + error text is send to PEAR error. + If a file/dir is not readable the file/dir is ignored. However an + error text is send to PEAR error. + If the resulting filename/dirname (after the add/remove option or + not) string is greater than 99 char, the file/dir is + ignored. However an error text is send to PEAR error. +Arguments : + $p_filelist : An array of filenames and directory names, or a single + string with names separated by a single blank space. + $p_add_dir : A string which contains a path to be added to the + memorized path of each element in the list. + $p_remove_dir : A string which contains a path to be removed from + the memorized path of each element in the list, when + relevant. +Return value : + true on success, false on error. +Sample 1 : + $tar_object = new Archive_Tar("tarname.tar"); + [...] + $v_list[0]="dev/file.txt"; + $v_list[1]="dev/data/"; (Optional '/' at the end) + $v_list[2]="log/file.log"; + $tar_object->addModify($v_list, "install"); + // files are stored in the archive as : + // install/file.txt + // install/data + // install/data/file1.txt + // install/data/... all the files and sub-dirs of data/ + // install/file.log +Sample 2 : + $tar_object = new Archive_Tar("tarname.tar"); + [...] + $v_list[0]="dev/file.txt"; + $v_list[1]="dev/data/"; (Optional '/' at the end) + $v_list[2]="log/file.log"; + $tar_object->addModify($v_list, "install", "dev"); + // files are stored in the archive as : + // install/file.txt + // install/data + // install/data/file1.txt + // install/data/... all the files and sub-dirs of data/ + // install/log/file.log +How it works : + If the archive does not exists it create it and add the files. + If the archive does exists and is not compressed, it open it, jump + before the last empty 512 bytes block (tar footer) and add the files + at this point. + If the archive does exists and is compressed, a temporary copy file + is created. This temporary file is then 'gzip' read block by block + until the last empty block. The new files are then added in the + compressed file. + The adding of files is done by going through the file/dir list, + adding files per files, in a recursive way through the + directory. Each time a path need to be added/removed it is done + before writing the file header in the archive. + +Method : add($p_filelist) +Description : + This method add the files / directories listed in $p_filelist at the + end of the existing archive. If the archive does not yet exists it + is created. + The $p_filelist parameter can be an array of string, each string + representing a filename or a directory name with their path if + needed. It can also be a single string with names separated by a + single blank. + See addModify() method for details and limitations. +Arguments : + $p_filelist : An array of filenames and directory names, or a single + string with names separated by a single blank space. +Return value : + true on success, false on error. +Sample 1 : + $tar_object = new Archive_Tar("tarname.tar"); + [...] + $v_list[0]="dev/file.txt"; + $v_list[1]="dev/data/"; (Optional '/' at the end) + $v_list[2]="log/file.log"; + $tar_object->add($v_list); +Sample 2 : + $tar_object = new Archive_Tar("tarname.tgz", true); + [...] + $v_list[0]="dev/file.txt"; + $v_list[1]="dev/data/"; (Optional '/' at the end) + $v_list[2]="log/file.log"; + $tar_object->add($v_list); +How it works : + Simply call the addModify() method with the right parameters. + +Method : addString($p_filename, $p_string, $p_datetime, $p_params) +Description : + This method add a single string as a file at the + end of the existing archive. If the archive does not yet exists it + is created. +Arguments : + $p_filename : A string which contains the full filename path + that will be associated with the string. + $p_string : The content of the file added in the archive. + $p_datetime : (Optional) Timestamp of the file (default = now) + $p_params : (Optional) Various file metadata: + stamp - As above, timestamp of the file + mode - UNIX-style permissions (default 0600) + type - Is this a regular file or link (see TAR + format spec for how to create a hard/symlink) + uid - UNIX-style user ID (default 0 = root) + gid - UNIX-style group ID (default 0 = root) +Return value : + true on success, false on error. +Sample 1 : + $v_archive = & new Archive_Tar($p_filename); + $v_archive->setErrorHandling(PEAR_ERROR_PRINT); + $v_result = $v_archive->addString('data/test.txt', 'This is the text of the string'); + $v_result = $v_archive->addString( + 'data/test.sh', + "#!/bin/sh\necho 'Hello'", + time(), + array( "mode" => 0755, "uid" => 34 ) + ); + + +Method : extract($p_path = "") +Description : + This method extract all the content of the archive in the directory + indicated by $p_path.If $p_path is optional, if not set the archive + is extracted in the current directory. + While extracting a file, if the directory path does not exists it is + created. + See extractModify() for details and limitations. +Arguments : + $p_path : Optional path where the files/dir need to by extracted. +Return value : + true on success, false on error. +Sample : + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object->extract(); +How it works : + Simply call the extractModify() method with appropriate parameters. + +Method : extractModify($p_path, $p_remove_path) +Description : + This method extract all the content of the archive in the directory + indicated by $p_path. When relevant the memorized path of the + files/dir can be modified by removing the $p_remove_path path at the + beginning of the file/dir path. + While extracting a file, if the directory path does not exists it is + created. + While extracting a file, if the file already exists it is replaced + without looking for last modification date. + While extracting a file, if the file already exists and is write + protected, the extraction is aborted. + While extracting a file, if a directory with the same name already + exists, the extraction is aborted. + While extracting a directory, if a file with the same name already + exists, the extraction is aborted. + While extracting a file/directory if the destination directory exist + and is write protected, or does not exist but can not be created, + the extraction is aborted. + If after extraction an extracted file does not show the correct + stored file size, the extraction is aborted. + When the extraction is aborted, a PEAR error text is set and false + is returned. However the result can be a partial extraction that may + need to be manually cleaned. +Arguments : + $p_path : The path of the directory where the files/dir need to by + extracted. + $p_remove_path : Part of the memorized path that can be removed if + present at the beginning of the file/dir path. +Return value : + true on success, false on error. +Sample : + // Imagine tarname.tar with files : + // dev/data/file.txt + // dev/data/log.txt + // readme.txt + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object->extractModify("install", "dev"); + // Files will be extracted there : + // install/data/file.txt + // install/data/log.txt + // install/readme.txt +How it works : + Open the archive and call a more generic function that can extract + only a part of the archive or all the archive. + See extractList() method for more details. + +Method : extractInString($p_filename) +Description : + This method extract from the archive one file identified by $p_filename. + The return value is a string with the file content, or NULL on error. +Arguments : + $p_filename : The path of the file to extract in a string. +Return value : + a string with the file content or NULL. +Sample : + // Imagine tarname.tar with files : + // dev/data/file.txt + // dev/data/log.txt + // dev/readme.txt + $v_archive = & new Archive_Tar('tarname.tar'); + $v_archive->setErrorHandling(PEAR_ERROR_PRINT); + $v_string = $v_archive->extractInString('dev/readme.txt'); + echo $v_string; + +Method : listContent() +Description : + This method returns an array of arrays that describe each + file/directory present in the archive. + The array is not sorted, so it show the position of the file in the + archive. + The file informations are : + $file[filename] : Name and path of the file/dir. + $file[mode] : File permissions (result of fileperms()) + $file[uid] : user id + $file[gid] : group id + $file[size] : filesize + $file[mtime] : Last modification time (result of filemtime()) + $file[typeflag] : "" for file, "5" for directory +Arguments : +Return value : + An array of arrays or 0 on error. +Sample : + $tar_object = new Archive_Tar("tarname.tar"); + if (($v_list = $tar_object->listContent()) != 0) + for ($i=0; $i"; + echo " .size :'".$v_list[$i][size]."'
    "; + echo " .mtime :'".$v_list[$i][mtime]."' (". + date("l dS of F Y h:i:s A", $v_list[$i][mtime]).")
    "; + echo " .mode :'".$v_list[$i][mode]."'
    "; + echo " .uid :'".$v_list[$i][uid]."'
    "; + echo " .gid :'".$v_list[$i][gid]."'
    "; + echo " .typeflag :'".$v_list[$i][typeflag]."'
    "; + } +How it works : + Call the same function as an extract however with a flag to only go + through the archive without extracting the files. + +Method : extractList($p_filelist, $p_path = "", $p_remove_path = "") +Description : + This method extract from the archive only the files indicated in the + $p_filelist. These files are extracted in the current directory or + in the directory indicated by the optional $p_path parameter. + If indicated the $p_remove_path can be used in the same way as it is + used in extractModify() method. +Arguments : + $p_filelist : An array of filenames and directory names, or a single + string with names separated by a single blank space. + $p_path : The path of the directory where the files/dir need to by + extracted. + $p_remove_path : Part of the memorized path that can be removed if + present at the beginning of the file/dir path. +Return value : + true on success, false on error. +Sample : + // Imagine tarname.tar with files : + // dev/data/file.txt + // dev/data/log.txt + // readme.txt + $tar_object = new Archive_Tar("tarname.tar"); + $tar_object->extractList("dev/data/file.txt readme.txt", "install", + "dev"); + // Files will be extracted there : + // install/data/file.txt + // install/readme.txt +How it works : + Go through the archive and extract only the files present in the + list. + diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/package.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/package.xml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,606 @@ + + + Archive_Tar + pear.php.net + Tar file management class + This class provides handling of tar files in PHP. +It supports creating, listing, extracting and adding to tar files. +Gzip support is available if PHP has the zlib extension built-in or +loaded. Bz2 compression is also supported with the bz2 extension loaded. +Also Lzma2 compressed archives are supported with xz extension. + + Vincent Blavet + vblavet + vincent@phpconcept.net + no + + + Greg Beaver + cellog + greg@chiaraquartet.net + no + + + Michiel Rook + mrook + mrook@php.net + yes + + + Stig Bakken + ssb + stig@php.net + no + + 2019-04-08 + + + 1.4.7 + 1.4.0 + + + stable + stable + + New BSD License + +* Improved performance by increasing read buffer size + + + + + + + + + + + + + PEAR + pear.php.net + 1.8.0 + 1.10.10 + + + + + 5.2.0 + + + 1.9.0 + + + + + + + + 1.4.6 + 1.4.0 + + + stable + stable + + 2019-02-01 + New BSD License + +* Improve path traversal detection for forward and backward slashes + + + + + 1.4.5 + 1.4.0 + + + stable + stable + + 2019-01-02 + New BSD License + +* Fix Bug #23788: Relative symlinks are broken [mrook] + + + + + 1.4.4 + 1.4.0 + + + stable + stable + + 2018-12-20 + New BSD License + +* Fix Bug #21058: Long symlinks are not supported [mrook] + * Fix Bug #23782: Prevent phar:// files from being extracted [mrook] + + + + + 1.4.3 + 1.4.0 + + + stable + stable + + 2017-06-11 + New BSD License + +* Fix Bug #21218: Cannot use result of built-in function in write context in PHP + 7.2.0alpha1 [mrook] + + + + + 1.4.2 + 1.4.0 + + + stable + stable + + 2016-02-25 + New BSD License + +* Fix reading of archives with files > 8GB +* Performance optimizations +* Do not try to call require_once on PEAR.php if it has already been loaded by the autoloader + + + + + 1.4.1 + 1.4.0 + + + stable + stable + + 2015-08-05 + New BSD License + +* Update composer.json to use pear-core-minimal 1.10.0alpha2 + + + + + 1.4.0 + 1.4.0 + + + stable + stable + + 2015-07-20 + New BSD License + +* Add support for PHP 7 +* Drop support for PHP 4 +* Add visibility declarations to methods and properties + + + + + 1.3.16 + 1.3.1 + + + stable + stable + + 2015-04-14 + New BSD License + +* Fix Bug #20514: invalid package.xml; not installable with pyrus [mrook] + + + + + 1.3.15 + 1.3.1 + + + stable + stable + + 2015-03-05 + New BSD License + +* Fixes composer.json parse error + + + + + 1.3.14 + 1.3.1 + + + stable + stable + + 2015-02-26 + New BSD License + +* Fix Bug #18505: Possible incorrect handling of file names in TAR [mrook] + + + + + 1.3.13 + 1.3.1 + + + stable + stable + + 2014-09-02 + New BSD + License + +* Fix Bug #20382: gzopen fix [mrook] + + + + + 1.3.12 + 1.3.1 + + + stable + stable + + 2014-08-04 + New BSD + License + +* Fix Bug #19964: Memory leaking in Archive_Tar [mrook] + * Fix Bug #20246: Broken with php 5.5.9 [mrook] + * Fix Bug #20275: "pax_global_header" looks like a regular file + * [mrook] + * Implement Feature #19827: pass filename to _addFile function - downstream + * patch [mrook] + * Implement Feature #20132: Add custom mode/uid/gid to addString() [mrook] + + + + + 1.3.11 + 1.3.1 + + + stable + stable + + 2013-02-09 + New BSD + License + +* Fix Bug #19746: Broken with PHP 5.5 [mrook] + * Implement Feature #11258: Custom date/time in files added on-the-fly + * [mrook] + + + + + 1.3.10 + 1.3.1 + + + stable + stable + + 2012-04-10 + New BSD + License + +* Fix Bug #13361: Unable to add() some files (ex. mp3) [mrook] + * Fix Bug #19330: Class creates incorrect (non-readable) tar.gz file + * [mrook] + + + + + 1.3.9 + 1.3.1 + + + stable + stable + + 2012-02-27 + New BSD License + +* Fix Bug #16759: No error thrown from missing PHP zlib functions [mrook] + * Fix Bug #18877: Incorrect handling of backslashes in filenames on Linux [mrook] + * Fix Bug #19085: Error while packaging [mrook] + * Fix Bug #19289: Invalid tar file generated [mrook] + + + + + 1.3.8 + 1.3.1 + + + stable + stable + + 2011-10-14 + New BSD License + +* Fix Bug #17853: Test failure: dirtraversal.phpt [mrook] + * Fix Bug #18512: dead links are not saved in tar file [mrook] + * Fix Bug #18702: Unpacks incorrectly on long file names using header prefix [mrook] + * Implement Feature #10145: Patch to return a Pear Error Object on failure [mrook] + * Implement Feature #17491: Option to preserve permissions [mrook] + * Implement Feature #17813: Prevent PHP notice when extracting corrupted archive [mrook] + + + + + 1.3.7 + 1.3.1 + + + stable + stable + + 2010-04-26 + New BSD License + +PEAR compatibility update + + + + + 1.3.6 + 1.3.1 + + + stable + stable + + 2010-03-09 + New BSD License + +* Fix Bug #16963: extractList can't extract zipped files from big tar [mrook] + * Implement Feature #4013: Ignoring files and directories on creating an archive. [mrook] + + + + + 1.3.5 + 1.3.1 + + + stable + stable + + 2009-12-31 + New BSD License + +* Fix Bug #16958: Update 'compatible' tag in package.xml [mrook] + + + + + 1.3.4 + 1.3.1 + + + stable + stable + + 2009-12-30 + New BSD License + +* Fix Bug #11871: wrong result of ::listContent() if filename begins or ends with space [mrook] + * Fix Bug #12462: invalid tar magic [mrook] + * Fix Bug #13918: Long filenames may get up to 511 0x00 bytes appended on read [mrook] + * Fix Bug #16202: Bogus modification times [mrook] + * Implement Feature #16212: Die is not exception [mrook] + + + + + 1.3.3 + 1.3.1 + + + stable + stable + + 2009-03-27 + New BSD License + +Change the license to New BSD license + + minor bugfix release + * fix Bug #9921 compression with bzip2 fails [cellog] + * fix Bug #11594 _readLongHeader leaves 0 bytes in filename [jamessas] + * fix Bug #11769 Incorrect symlink handing [fajar99] + + + + + 1.3.2 + 1.3.1 + + + stable + stable + + 2007-01-03 + PHP License + +Correct Bug #4016 +Remove duplicate remove error display with '@' +Correct Bug #3909 : Check existence of OS_WINDOWS constant +Correct Bug #5452 fix for "lone zero block" when untarring packages +Change filemode (from pear-core/Archive/Tar.php v.1.21) +Correct Bug #6486 Can not extract symlinks +Correct Bug #6933 Archive_Tar (Tar file management class) Directory traversal +Correct Bug #8114 Files added on-the-fly not storing date +Correct Bug #9352 Bug on _dirCheck function over nfs path + + + + + 1.3.1 + 1.3.1 + + + stable + stable + + 2005-03-17 + PHP License + +Correct Bug #3855 + + + + + 1.3.0 + 1.3.0 + + + stable + stable + + 2005-03-06 + PHP License + +Bugs correction (2475, 2488, 2135, 2176) + + + + + 1.2 + 1.2 + + + stable + stable + + 2004-05-08 + PHP License + +Add support for other separator than the space char and bug + correction + + + + + 1.1 + 1.1 + + + stable + stable + + 2003-05-28 + PHP License + +* Add support for BZ2 compression +* Add support for add and extract without using temporary files : methods addString() and extractInString() + + + + + 1.0 + 1.0 + + + stable + stable + + 2003-01-24 + PHP License + +Change status to stable + + + + + 0.10-b1 + 0.10-b1 + + + beta + beta + + 2003-01-08 + PHP License + +Add support for long filenames (greater than 99 characters) + + + + + 0.9 + 0.9 + + + stable + stable + + 2002-05-27 + PHP License + +Auto-detect gzip'ed files + + + + + 0.4 + 0.4 + + + stable + stable + + 2002-05-20 + PHP License + +Windows bugfix: use forward slashes inside archives + + + + + 0.2 + 0.2 + + + stable + stable + + 2002-02-18 + PHP License + +From initial commit to stable + + + + + 0.3 + 0.3 + + + stable + stable + + 2002-04-13 + PHP License + +Windows bugfix: used wrong directory separators + + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/scripts/phptar.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/scripts/phptar.in Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,236 @@ +#!@prefix@/bin/php -Cq + 1) { + usage("Only one of -c, -t and -x can be specified at once!"); +} + +if ($op_create + $op_list + $op_extract == 0) { + usage("Please specify either -c, -t or -x!"); +} + +if (empty($file)) { + if ($op_create) { + $file = "php://stdout"; + } else { + $file = "php://stdin"; + } +} + +// }}} + +$tar = new Archive_Tar($file, $use_gzip); +$tar->setErrorHandling(PEAR_ERROR_DIE, "$progname error: %s\n"); + +if ($op_create) { + do_create($tar, $options[1]); + $tar->create($options[1]); +} elseif ($op_list) { + do_list($tar, $verbose); +} elseif ($op_extract) { + do_extract($tar); +} + +// {{{ getrwx() + +function getrwx($bits) { + $str = ''; + $str .= ($bits & 4) ? 'r' : '-'; + $str .= ($bits & 2) ? 'w' : '-'; + $str .= ($bits & 1) ? 'x' : '-'; + return $str; +} + +// }}} +// {{{ getfiletype() + +function getfiletype($bits) { + static $map = array( + '-' => S_IFREG, + 'd' => S_IFDIR, + 'l' => S_IFLNK, + 'c' => S_IFCHR, + 'b' => S_IFBLK, + 'p' => S_IFIFO, + 's' => S_IFSOCK, + ); + foreach ($map as $char => $mask) { + if ($bits & $mask) { + return $char; + } + } +} + +// }}} +// {{{ getuser() + +function getuser($uid) { + static $cache = array(); + if (isset($cache[$uid])) { + return $cache[$uid]; + } + if (function_exists("posix_getpwuid")) { + if (is_array($user = @posix_getpwuid($uid))) { + $cache[$uid] = $user['name']; + return $user['name']; + } + } + $cache[$uid] = $uid; + return $uid; +} + +// }}} +// {{{ getgroup() + +function getgroup($gid) { + static $cache = array(); + if (isset($cache[$gid])) { + return $cache[$gid]; + } + if (function_exists("posix_getgrgid")) { + if (is_array($group = @posix_getgrgid($gid))) { + $cache[$gid] = $group['name']; + return $group['name']; + } + } + $cache[$gid] = $gid; + return $gid; +} + +// }}} +// {{{ do_create() + +function do_create(&$tar, &$files) +{ + $tar->create($files); +} + +// }}} +// {{{ do_list() + +function do_list(&$tar, $verbose) +{ + static $rwx = array(4 => 'r', 2 => 'w', 1 => 'x'); + $files = $tar->listContent(); + if (is_array($files) && sizeof($files) > 0) { + foreach ($files as $file) { + if ($verbose) { + $fm = (int)$file['mode']; + $mode = sprintf('%s%s%s%s', getfiletype($fm), + getrwx(($fm >> 6) & 7), getrwx(($fm >> 3) & 7), + getrwx($fm & 7)); + $owner = getuser($file['uid']) . '/' . getgroup($file['gid']); + printf("%10s %-11s %7d %s %s\n", $mode, $owner, $file['size'], + date('Y-m-d H:i:s', $file['mtime']), $file['filename']); + } else { + printf("%s\n", $file['filename']); + } + } + } +} + +// }}} +// {{{ do_extract() + +function do_extract(&$tar, $destdir = ".") +{ + $tar->extract($destdir); +} + +// }}} +// {{{ usage() + +function usage($errormsg = '') +{ + global $progname; + $fp = fopen("php://stderr", "w"); + if ($errormsg) { + if (PEAR::isError($errormsg)) { + fwrite($fp, $errormsg->getMessage() . "\n"); + } else { + fwrite($fp, "$errormsg\n"); + } + } + fwrite($fp, "$progname [-h|-?] {-c|-t|-x} [-z] [-v] [-f file] [file(s)...] +Options: + -h, -? Show this screen + -c Create archive + -t List archive + -x Extract archive + -z Run input/output through gzip + -f file Use as input or output (default is stdin/stdout) + +"); + fclose($fp); + exit; +} + +// }}} + +?> diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/sync-php4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/sync-php4 Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,6 @@ +#!/bin/sh + +rsync -av Archive/Tar.php ../../php4/pear/Archive/. +rsync -av package.xml ../../php4/pear/package-Archive_Tar.xml +rsync -av docs/Archive_Tar.txt ../../php4/pear/docs/. + diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/deadlinks.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/deadlinks.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,46 @@ +--TEST-- +test saving of dead symbolic links +--SKIPIF-- +--FILE-- + '.$item['link']; +} + +//prepare filesystem +@mkdir('test'); +@mkdir('test/a'); +@touch('test/b'); +@symlink('a', 'test/dir_link'); +@symlink('b', 'test/file_link'); +@symlink('dead', 'test/dead_link'); + +//prepare reference tar +system('tar -cf test1.tar test'); +$tar1=new Archive_Tar('test1.tar'); +$tar1List=array_map('fileName',$tar1->listContent()); +//create tar +$tar2=new Archive_Tar('test2.tar'); +$tar2->create(array('test','nonExisting'));// to make sure we are still report nonExisting +$tar2List=array_map('fileName',$tar2->listContent()); + +$phpunit->assertErrors(array( + array('package' => 'PEAR_Error', 'message' => "File 'nonExisting' does not exist")), 'after 1'); +$phpunit->assertEquals($tar1List, $tar2List, 'bla'); +echo 'tests done'; +?> +--CLEAN-- + +--EXPECT-- +tests done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/dirtraversal.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/dirtraversal.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +--TEST-- +test directory traversal security vulnerability +--SKIPIF-- +--FILE-- +listContent(); +$phpunit->assertErrors(array( + array('package' => 'PEAR_Error', 'message' => 'Malicious .tar detected, file "/../../../../../../../../../../../../../../AAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB.txt" will not install in desired directory tree') +), 'after 1'); +$tar->extract(); +$phpunit->assertErrors(array( + array('package' => 'PEAR_Error', 'message' => 'Malicious .tar detected, file "/../../../../../../../../../../../../../../AAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB.txt" will not install in desired directory tree') +), 'after 2'); +echo 'tests done'; +?> +--CLEAN-- + +--EXPECT-- +tests done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/hamidTARtester2.tar Binary file vendor/pear/archive_tar/tests/hamidTARtester2.tar has changed diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/invalidblock.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/invalidblock.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,20 @@ +--TEST-- +test files that happen to contain the endblock +--SKIPIF-- +--FILE-- +add(dirname(__FILE__) . '/testblock1'); +$tar->add(dirname(__FILE__) . '/testblock2'); +$tar = new Archive_Tar(dirname(__FILE__) . '/testblock.tar.gz'); +$tar->listContent(); +$phpunit->assertNoErrors('after'); +echo 'tests done'; +?> +--CLEAN-- + +--EXPECT-- +tests done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/longfilename.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/longfilename.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,30 @@ +--TEST-- +test trimming of characters in long filenames +--SKIPIF-- +--FILE-- +addModify(array($longfilename), '', dirname(__FILE__)); +$tar = new Archive_Tar(dirname(__FILE__) . '/testlongfilename.tar'); +$files = $tar->listContent(); +$file = reset($files); +$lastChar = $file['filename'][strlen($file['filename']) - 1]; +$phpunit->assertEquals(' ', $lastChar, 'should contain space as last character'); +echo 'tests done'; +?> +--CLEAN-- + +--EXPECT-- +tests done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/longsymlinks.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/longsymlinks.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,29 @@ +--TEST-- +test trimming of characters in long symbolic link targets +--SKIPIF-- +--FILE-- +addModify(array($longfilename, $symlinkfilename), '', dirname(__FILE__)); +$tar = new Archive_Tar(dirname(__FILE__) . '/testlongsymlink.tar'); +$files = $tar->listContent(); +$file = end($files); +$lastChar = $file['link'][strlen($file['link']) - 1]; +$phpunit->assertEquals(' ', $lastChar, 'should contain space as last character'); +echo 'tests done'; +?> +--CLEAN-- + +--EXPECT-- +tests done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/pax.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/pax.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +--TEST-- +tests if pax global / extended headers are ignored +--SKIPIF-- +--FILE-- +assertEquals(1, count($tar->listContent()), "count should be 1"); +echo 'tests done'; +?> +--CLEAN-- +--EXPECT-- +tests done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/permissions.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/permissions.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,18 @@ +--TEST-- +test preserving of permissions +--SKIPIF-- +--FILE-- +extract('', true); +$phpunit->assertNoErrors('after'); +echo 'tests done'; +?> +--CLEAN-- + +--EXPECT-- +tests done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/phpt_test.php.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/phpt_test.php.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,414 @@ +_diffonly = $diffonly; + $this->_errors = array(); + PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'pearerrorCallback')); + if (!$noStackCatch) { + PEAR_ErrorStack::setDefaultCallback(array($this, 'pearerrorstackCallback')); + } + } + + function pearerrorCallback($err) + { + PEAR_ErrorStack::staticPush('PEAR_Error', -1, 'error', array('obj' => $err), + $err->getMessage()); + } + + function pearerrorstackCallback($err) + { + $this->_errors[] = $err; + } + + function assertPEARError($err, $message) + { + if (is_a($err, 'PEAR_Error')) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Not a PEAR_Error\n"; + return false; + } + + function assertNoErrors($message, $trace = null) + { + if (count($this->_errors) == 0) { + return true; + } + if ($trace === null) { + $trace = debug_backtrace(); + } + $this->_failTest($trace, $message); + foreach ($this->_errors as $err) { + if ($err['package'] == 'PEAR_Error') { + echo "Unexpected PEAR_Error:\n"; + echo 'message "' . $err['message'] . "\"\n"; + } else { + echo "Unexpected PEAR_ErrorStack error:\n"; + echo 'package "' . $err['package'] . "\"\n"; + echo 'message "' . $err['message'] . "\"\n"; + } + } + $this->_errors = array(); + return false; + } + + function assertErrors($errors, $message, $trace = null) + { + if (!count($this->_errors)) { + if ($trace === null) { + $trace = debug_backtrace(); + } + $this->_failTest($trace, $message); + echo "No errors caught, but errors were expected\n"; + return false; + } + if (!isset($errors[0])) { + $errors = array($errors); + } + $failed = false; + foreach ($errors as $err) { + $found = false; + foreach ($this->_errors as $i => $caughterror) { + if ($caughterror['package'] == $err['package']) { + if ($caughterror['message'] == $err['message']) { + $found = true; + break; + } + } + } + if ($found) { + unset($this->_errors[$i]); + continue; + } + if (!$failed) { + if ($trace === null) { + $trace = debug_backtrace(); + } + $failed = true; + $this->_failTest($trace, $message); + } + echo "Unthrown error:\n"; + if ($err['package'] == 'PEAR_Error') { + echo "PEAR_Error:\n"; + } else { + echo "error package: \"$err[package]\"\n"; + } + echo "message: \"$err[message]\"\n"; + } + if (count($this->_errors)) { + if (!$failed) { + if ($trace === null) { + $trace = debug_backtrace(); + } + $failed = true; + $this->_failTest($trace, $message); + } + foreach ($this->_errors as $err) { + echo "Unexpected error:\n"; + if ($err['package'] == 'PEAR_Error') { + echo "PEAR_Error:\n"; + } else { + echo "error package: \"$err[package]\"\n"; + } + echo "message: \"$err[message]\"\n"; + } + } + $this->_errors = array(); + return !$failed; + } + + function assertTrue($test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if ($test === true) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpected non-true value: \n"; + var_export($test); + echo "\n'$message'\n"; + return false; + } + + function assertIsa($control, $test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if (is_a($test, $control)) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpected non-$control object: \n"; + var_export($test); + echo "\n'$message'\n"; + return false; + } + + function assertNull($test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if ($test === null) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpected non-null value: \n"; + var_export($test); + echo "\n'$message'\n"; + return false; + } + + function assertNotNull($test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if ($test !== null) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpected null: \n"; + var_export($test); + echo "\n'$message'\n"; + return false; + } + + function assertSame($test, $test1, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if ($test === $test1) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpectedly two vars are not the same thing: \n"; + echo "\n'$message'\n"; + return false; + } + + function assertNotSame($test, $test1, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if ($test !== $test1) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpectedly two vars are the same thing: \n"; + echo "\n'$message'\n"; + return false; + } + + function assertFalse($test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if ($test === false) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpected non-false value: \n"; + var_export($test); + echo "\n'$message'\n"; + return false; + } + + function assertNotTrue($test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if (!$test) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpected loose true value: \n"; + var_export($test); + echo "\n'$message'\n"; + return false; + } + + function assertNotFalse($test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if ($test) { + return true; + } + $this->_failTest(debug_backtrace(), $message); + echo "Unexpected loose false value: \n"; + var_export($test); + echo "\n'$message'\n"; + return false; + } + + function assertEquals($control, $test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if (str_replace(array("\r", "\n"), array('', ''), + var_export($control, true)) != str_replace(array("\r", "\n"), array('', ''), + var_export($test, true))) { + $this->_failTest(debug_backtrace(), $message); + if (class_exists('Text_Diff')) { + echo "Diff of expecting/received:\n"; + $diff = new Text_Diff( + explode("\n", var_export($control, true)), + explode("\n", var_export($test, true))); + + // Output the diff in unified format. + $renderer = new Text_Diff_Renderer_unified(); + echo $renderer->render($diff); + if ($this->_diffonly) { + return false; + } + } + echo "Expecting:\n"; + var_export($control); + echo "\nReceived:\n"; + var_export($test); + echo "\n"; + return false; + } + return true; + } + + function assertFileExists($fname, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if (!@file_exists($fname)) { + $this->_failTest(debug_backtrace(), $message); + echo "File '$fname' does not exist, and should\n"; + return false; + } + return true; + } + + function assertFileNotExists($fname, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if (@file_exists($fname)) { + $this->_failTest(debug_backtrace(), $message); + echo "File '$fname' exists, and should not\n"; + return false; + } + return true; + } + + function assertRegEquals($dump, &$reg, $message) + { + $actualdump = var_export(trim($this->dumpReg($reg)), true); + $testdump = var_export(trim($dump), true); + return $this->assertEquals($testdump, $actualdump, $message); + } + + function assertPackageInfoEquals($control, $test, $message) + { + $this->assertNoErrors($message, debug_backtrace()); + if (isset($control[0])) { + if (!isset($test[0]) || (count($control) != count($test))) { + echo "Invalid packageInfo\n"; + $ret = $this->assertEquals($control, $test, $message); + } + $ret = true; + foreach ($control as $i => $packageinfo) { + $ret = $ret && + $this->assertPackageInfoEquals($packageinfo, $test[$i], $message . $i); + } + return $ret; + } + if (isset($control['_lastmodified'])) { + if (!isset($test['_lastmodified'])) { + echo "_lastmodified is not set in packageInfo() output\n"; + $this->_failTest(debug_backtrace(), $message); + return false; + } + } + $savecontrol = sort($control); + $savetest = sort($test); + unset($control['_lastmodified']); + unset($test['_lastmodified']); + if (var_export($control, true) != var_export($test, true)) { + $this->_failTest(debug_backtrace(), $message); + if (class_exists('Text_Diff')) { + echo "Diff of expecting/received:\n"; + $diff = new Text_Diff( + explode("\n", var_export($control, true)), + explode("\n", var_export($test, true))); + + // Output the diff in unified format. + $renderer = new Text_Diff_Renderer_unified(); + echo $renderer->render($diff); + if ($this->_diffonly) { + return false; + } + } + echo "Expecting:\n"; + var_export($savecontrol); + echo "\nReceived:\n"; + var_export($savetest); + return false; + } + return true; + } + + function _sortRegEntries($a, $b) + { + return strnatcasecmp($a['name'], $b['name']); + } + + function dumpReg(&$reg) + { + ob_start(); + print "dumping registry...\n"; + $infos = $reg->packageInfo(null, null, null); + ksort($infos); + foreach ($infos as $channel => $info) { + echo "channel $channel:\n"; + usort($info, array($this, '_sortRegEntries')); + foreach ($info as $pkg) { + print $pkg["name"] . ":"; + unset($pkg["name"]); + foreach ($pkg as $k => $v) { + if ($k == '_lastmodified') { + print " _lastmodified is set"; + continue; + } + if (is_array($v) && $k == 'filelist') { + print " $k=array("; + $i = 0; + foreach ($v as $k2 => $v2) { + if ($i++ > 0) print ","; + print "{$k2}["; + $j = 0; + foreach ($v2 as $k3 => $v3) { + if ($j++ > 0) print ","; + print "$k3=$v3"; + } + print "]"; + } + print ")"; + } else { + print " $k=\"$v\""; + } + } + print "\n"; + } + } + print "dump done\n"; + $ret = ob_get_contents(); + ob_end_clean(); + return $ret; + } + + function _failTest($trace, $message) + { + echo 'Test Failure: "' . $message . "\"\n in " . $trace[0]['file'] . ' line ' . + $trace[0]['line'] . "\n"; + } + + function showAll() + { + $this->_diffonly = false; + } +} +?> \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/setup.php.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/setup.php.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,4 @@ +extract(); +$phpunit->assertNoErrors('after'); +$phpunit->assertFileExists('testme', 'dir'); +$phpunit->assertFileExists('testme/file1.txt', 'file1.txt'); +$phpunit->assertFileExists('testme/symlink.txt', 'symlink.txt'); +$phpunit->assertTrue(is_link('testme/symlink.txt'), 'is link'); +echo 'tests done'; +?> +--CLEAN-- + +--EXPECT-- +tests done diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/testblock1/a.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/archive_tar/tests/testblock1/a.txt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +abc diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/testblock1/bugTriggeringPng.png Binary file vendor/pear/archive_tar/tests/testblock1/bugTriggeringPng.png has changed diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/testpax.tar Binary file vendor/pear/archive_tar/tests/testpax.tar has changed diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/testperms.tar Binary file vendor/pear/archive_tar/tests/testperms.tar has changed diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/archive_tar/tests/testsymlink.tar Binary file vendor/pear/archive_tar/tests/testsymlink.tar has changed diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/.gitignore Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,6 @@ +# composer related +composer.lock +composer.phar +vendor +README.html +dist/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/.travis.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/.travis.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,9 @@ +language: php +php: + - 7 + - 5.6 + - 5.5 + - 5.4 +sudo: false +script: + - pear run-tests -r tests/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/Console/Getopt.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/Console/Getopt.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,365 @@ + + * @license http://opensource.org/licenses/bsd-license.php BSD-2-Clause + * @version CVS: $Id$ + * @link http://pear.php.net/package/Console_Getopt + */ + +require_once 'PEAR.php'; + +/** + * Command-line options parsing class. + * + * @category Console + * @package Console_Getopt + * @author Andrei Zmievski + * @license http://opensource.org/licenses/bsd-license.php BSD-2-Clause + * @link http://pear.php.net/package/Console_Getopt + */ +class Console_Getopt +{ + + /** + * Parses the command-line options. + * + * The first parameter to this function should be the list of command-line + * arguments without the leading reference to the running program. + * + * The second parameter is a string of allowed short options. Each of the + * option letters can be followed by a colon ':' to specify that the option + * requires an argument, or a double colon '::' to specify that the option + * takes an optional argument. + * + * The third argument is an optional array of allowed long options. The + * leading '--' should not be included in the option name. Options that + * require an argument should be followed by '=', and options that take an + * option argument should be followed by '=='. + * + * The return value is an array of two elements: the list of parsed + * options and the list of non-option command-line arguments. Each entry in + * the list of parsed options is a pair of elements - the first one + * specifies the option, and the second one specifies the option argument, + * if there was one. + * + * Long and short options can be mixed. + * + * Most of the semantics of this function are based on GNU getopt_long(). + * + * @param array $args an array of command-line arguments + * @param string $short_options specifies the list of allowed short options + * @param array $long_options specifies the list of allowed long options + * @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option + * + * @return array two-element array containing the list of parsed options and + * the non-option arguments + */ + public static function getopt2($args, $short_options, $long_options = null, $skip_unknown = false) + { + return Console_Getopt::doGetopt(2, $args, $short_options, $long_options, $skip_unknown); + } + + /** + * This function expects $args to start with the script name (POSIX-style). + * Preserved for backwards compatibility. + * + * @param array $args an array of command-line arguments + * @param string $short_options specifies the list of allowed short options + * @param array $long_options specifies the list of allowed long options + * + * @see getopt2() + * @return array two-element array containing the list of parsed options and + * the non-option arguments + */ + public static function getopt($args, $short_options, $long_options = null, $skip_unknown = false) + { + return Console_Getopt::doGetopt(1, $args, $short_options, $long_options, $skip_unknown); + } + + /** + * The actual implementation of the argument parsing code. + * + * @param int $version Version to use + * @param array $args an array of command-line arguments + * @param string $short_options specifies the list of allowed short options + * @param array $long_options specifies the list of allowed long options + * @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option + * + * @return array + */ + public static function doGetopt($version, $args, $short_options, $long_options = null, $skip_unknown = false) + { + // in case you pass directly readPHPArgv() as the first arg + if (PEAR::isError($args)) { + return $args; + } + + if (empty($args)) { + return array(array(), array()); + } + + $non_opts = $opts = array(); + + settype($args, 'array'); + + if ($long_options) { + sort($long_options); + } + + /* + * Preserve backwards compatibility with callers that relied on + * erroneous POSIX fix. + */ + if ($version < 2) { + if (isset($args[0]{0}) && $args[0]{0} != '-') { + array_shift($args); + } + } + + for ($i = 0; $i < count($args); $i++) { + $arg = $args[$i]; + /* The special element '--' means explicit end of + options. Treat the rest of the arguments as non-options + and end the loop. */ + if ($arg == '--') { + $non_opts = array_merge($non_opts, array_slice($args, $i + 1)); + break; + } + + if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) { + $non_opts = array_merge($non_opts, array_slice($args, $i)); + break; + } elseif (strlen($arg) > 1 && $arg{1} == '-') { + $error = Console_Getopt::_parseLongOption(substr($arg, 2), + $long_options, + $opts, + $i, + $args, + $skip_unknown); + if (PEAR::isError($error)) { + return $error; + } + } elseif ($arg == '-') { + // - is stdin + $non_opts = array_merge($non_opts, array_slice($args, $i)); + break; + } else { + $error = Console_Getopt::_parseShortOption(substr($arg, 1), + $short_options, + $opts, + $i, + $args, + $skip_unknown); + if (PEAR::isError($error)) { + return $error; + } + } + } + + return array($opts, $non_opts); + } + + /** + * Parse short option + * + * @param string $arg Argument + * @param string[] $short_options Available short options + * @param string[][] &$opts + * @param int &$argIdx + * @param string[] $args + * @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option + * + * @return void + */ + protected static function _parseShortOption($arg, $short_options, &$opts, &$argIdx, $args, $skip_unknown) + { + for ($i = 0; $i < strlen($arg); $i++) { + $opt = $arg{$i}; + $opt_arg = null; + + /* Try to find the short option in the specifier string. */ + if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':') { + if ($skip_unknown === true) { + break; + } + + $msg = "Console_Getopt: unrecognized option -- $opt"; + return PEAR::raiseError($msg); + } + + if (strlen($spec) > 1 && $spec{1} == ':') { + if (strlen($spec) > 2 && $spec{2} == ':') { + if ($i + 1 < strlen($arg)) { + /* Option takes an optional argument. Use the remainder of + the arg string if there is anything left. */ + $opts[] = array($opt, substr($arg, $i + 1)); + break; + } + } else { + /* Option requires an argument. Use the remainder of the arg + string if there is anything left. */ + if ($i + 1 < strlen($arg)) { + $opts[] = array($opt, substr($arg, $i + 1)); + break; + } else if (isset($args[++$argIdx])) { + $opt_arg = $args[$argIdx]; + /* Else use the next argument. */; + if (Console_Getopt::_isShortOpt($opt_arg) + || Console_Getopt::_isLongOpt($opt_arg)) { + $msg = "option requires an argument --$opt"; + return PEAR::raiseError("Console_Getopt: " . $msg); + } + } else { + $msg = "option requires an argument --$opt"; + return PEAR::raiseError("Console_Getopt: " . $msg); + } + } + } + + $opts[] = array($opt, $opt_arg); + } + } + + /** + * Checks if an argument is a short option + * + * @param string $arg Argument to check + * + * @return bool + */ + protected static function _isShortOpt($arg) + { + return strlen($arg) == 2 && $arg[0] == '-' + && preg_match('/[a-zA-Z]/', $arg[1]); + } + + /** + * Checks if an argument is a long option + * + * @param string $arg Argument to check + * + * @return bool + */ + protected static function _isLongOpt($arg) + { + return strlen($arg) > 2 && $arg[0] == '-' && $arg[1] == '-' && + preg_match('/[a-zA-Z]+$/', substr($arg, 2)); + } + + /** + * Parse long option + * + * @param string $arg Argument + * @param string[] $long_options Available long options + * @param string[][] &$opts + * @param int &$argIdx + * @param string[] $args + * + * @return void|PEAR_Error + */ + protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx, $args, $skip_unknown) + { + @list($opt, $opt_arg) = explode('=', $arg, 2); + + $opt_len = strlen($opt); + + for ($i = 0; $i < count($long_options); $i++) { + $long_opt = $long_options[$i]; + $opt_start = substr($long_opt, 0, $opt_len); + + $long_opt_name = str_replace('=', '', $long_opt); + + /* Option doesn't match. Go on to the next one. */ + if ($long_opt_name != $opt) { + continue; + } + + $opt_rest = substr($long_opt, $opt_len); + + /* Check that the options uniquely matches one of the allowed + options. */ + if ($i + 1 < count($long_options)) { + $next_option_rest = substr($long_options[$i + 1], $opt_len); + } else { + $next_option_rest = ''; + } + + if ($opt_rest != '' && $opt{0} != '=' && + $i + 1 < count($long_options) && + $opt == substr($long_options[$i+1], 0, $opt_len) && + $next_option_rest != '' && + $next_option_rest{0} != '=') { + + $msg = "Console_Getopt: option --$opt is ambiguous"; + return PEAR::raiseError($msg); + } + + if (substr($long_opt, -1) == '=') { + if (substr($long_opt, -2) != '==') { + /* Long option requires an argument. + Take the next argument if one wasn't specified. */; + if (!strlen($opt_arg)) { + if (!isset($args[++$argIdx])) { + $msg = "Console_Getopt: option requires an argument --$opt"; + return PEAR::raiseError($msg); + } + $opt_arg = $args[$argIdx]; + } + + if (Console_Getopt::_isShortOpt($opt_arg) + || Console_Getopt::_isLongOpt($opt_arg)) { + $msg = "Console_Getopt: option requires an argument --$opt"; + return PEAR::raiseError($msg); + } + } + } else if ($opt_arg) { + $msg = "Console_Getopt: option --$opt doesn't allow an argument"; + return PEAR::raiseError($msg); + } + + $opts[] = array('--' . $opt, $opt_arg); + return; + } + + if ($skip_unknown === true) { + return; + } + + return PEAR::raiseError("Console_Getopt: unrecognized option --$opt"); + } + + /** + * Safely read the $argv PHP array across different PHP configurations. + * Will take care on register_globals and register_argc_argv ini directives + * + * @return mixed the $argv PHP array or PEAR error if not registered + */ + public static function readPHPArgv() + { + global $argv; + if (!is_array($argv)) { + if (!@is_array($_SERVER['argv'])) { + if (!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) { + $msg = "Could not read cmd args (register_argc_argv=Off?)"; + return PEAR::raiseError("Console_Getopt: " . $msg); + } + return $GLOBALS['HTTP_SERVER_VARS']['argv']; + } + return $_SERVER['argv']; + } + return $argv; + } + +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/LICENSE Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,25 @@ +Copyright (c) 2001-2015, The PEAR developers +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/README.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/README.rst Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,26 @@ +******************************************* +Console_Getopt - Command-line option parser +******************************************* + +This is a PHP implementation of "getopt" supporting both short and long options. +It helps parsing command line options in your PHP script. + +Homepage: http://pear.php.net/package/Console_Getopt + +.. image:: https://travis-ci.org/pear/Console_Getopt.svg?branch=master + :target: https://travis-ci.org/pear/Console_Getopt + + +Alternatives +============ + +* Console_CommandLine__ (recommended) +* Console_GetoptPlus__ + +__ http://pear.php.net/package/Console_CommandLine +__ http://pear.php.net/package/Console_GetoptPlus + + +License +======= +BSD-2-Clause diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,35 @@ +{ + "authors": [ + { + "email": "andrei@php.net", + "name": "Andrei Zmievski", + "role": "Lead" + }, + { + "email": "stig@php.net", + "name": "Stig Bakken", + "role": "Developer" + }, + { + "email": "cellog@php.net", + "name": "Greg Beaver", + "role": "Helper" + } + ], + "autoload": { + "psr-0": { + "Console": "./" + } + }, + "description": "More info available on: http://pear.php.net/package/Console_Getopt", + "include-path": [ + "./" + ], + "license": "BSD-2-Clause", + "name": "pear/console_getopt", + "support": { + "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Console_Getopt", + "source": "https://github.com/pear/Console_Getopt" + }, + "type": "library" +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/package.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/package.xml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,284 @@ + + + Console_Getopt + pear.php.net + Command-line option parser + This is a PHP implementation of "getopt" supporting both +short and long options. + + Andrei Zmievski + andrei + andrei@php.net + no + + + Stig Bakken + ssb + stig@php.net + no + + + Greg Beaver + cellog + cellog@php.net + no + + + 2019-02-06 + + 1.4.2 + 1.4.0 + + + stable + stable + + BSD-2-Clause + + +* Remove use of each(), which is removed in PHP 8 + + + + + + + + + + + + + + + + + + PEAR + pear.php.net + 1.4.0 + 1.999.999 + + + + + + 5.4.0 + + + 1.8.0 + + + + + + + + + + 2019-02-06 + + 1.4.2 + 1.4.0 + + + stable + stable + + BSD-2-Clause + + * Remove use of each(), which is removed in PHP 8 + + + + + 2015-07-20 + + 1.4.1 + 1.4.0 + + + stable + stable + + BSD-2-Clause + + * Fix unit test on PHP 7 [cweiske] + + + + + 2015-02-22 + + 1.4.0 + 1.4.0 + + + stable + stable + + BSD-2-Clause + + * Change license to BSD-2-Clause + * Set minimum PHP version to 5.4.0 + * Mark static methods with "static" keyword + + + + + 2011-03-07 + + 1.3.1 + 1.3.0 + + + stable + stable + + PHP License + + * Change the minimum PEAR installer dep to be lower + + + + + 2010-12-11 + + + 1.3.0 + 1.3.0 + + + stable + stable + + PHP License + + * Implement Request #13140: [PATCH] to skip unknown parameters. [patch by rquadling, improved on by dufuz] + + + + + 2007-06-12 + + 1.2.3 + 1.2.1 + + + stable + stable + + PHP License + +* fix Bug #11068: No way to read plain "-" option [cardoe] + + + + + 1.2.2 + 1.2.1 + + + stable + stable + + 2007-02-17 + PHP License + +* fix Bug #4475: An ambiguous error occurred when specifying similar longoption name. +* fix Bug #10055: Not failing properly on short options missing required values + + + + + 1.2.1 + 1.2.1 + + + stable + stable + + 2006-12-08 + PHP License + +Fixed bugs #4448 (Long parameter values truncated with longoption parameter) and #7444 (Trailing spaces after php closing tag) + + + + + 1.2 + 1.2 + + + stable + stable + + 2003-12-11 + PHP License + +Fix to preserve BC with 1.0 and allow correct behaviour for new users + + + + + 1.0 + 1.0 + + + stable + stable + + 2002-09-13 + PHP License + +Stable release + + + + + 0.11 + 0.11 + + + beta + beta + + 2002-05-26 + PHP License + +POSIX getopt compatibility fix: treat first element of args + array as command name + + + + + 0.10 + 0.10 + + + beta + beta + + 2002-05-12 + PHP License + +Packaging fix + + + + + 0.9 + 0.9 + + + beta + beta + + 2002-05-12 + PHP License + +Initial release + + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/tests/001-getopt.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/tests/001-getopt.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,63 @@ +--TEST-- +Console_Getopt +--FILE-- + $d) { + if ($i++ > 0) { + print ", "; + } + print $d[0] . '=' . $d[1]; + } + print "\n"; + print "params: " . implode(", ", $non_opts) . "\n"; + print "\n"; +} + +test("-abc", "abc"); +test("-abc foo", "abc"); +test("-abc foo", "abc:"); +test("-abc foo bar gazonk", "abc"); +test("-abc foo bar gazonk", "abc:"); +test("-a -b -c", "abc"); +test("-a -b -c", "abc:"); +test("-abc", "ab:c"); +test("-abc foo -bar gazonk", "abc"); +?> +--EXPECT-- +options: a=, b=, c= +params: + +options: a=, b=, c= +params: foo + +options: a=, b=, c=foo +params: + +options: a=, b=, c= +params: foo, bar, gazonk + +options: a=, b=, c=foo +params: bar, gazonk + +options: a=, b=, c= +params: + +Console_Getopt: option requires an argument --c + +options: a=, b=c +params: + +options: a=, b=, c= +params: foo, -bar, gazonk diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/tests/bug10557.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/tests/bug10557.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,22 @@ +--TEST-- +Console_Getopt [bug 10557] +--SKIPIF-- +--FILE-- +getMessage()."\n"; + echo 'FATAL'; + exit; +} + +print_r($ret); +?> +--EXPECT-- +Console_Getopt: option requires an argument --to +FATAL \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/tests/bug11068.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/tests/bug11068.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,44 @@ +--TEST-- +Console_Getopt [bug 11068] +--SKIPIF-- +--FILE-- +getMessage()."\n"; + echo 'FATAL'; + exit; +} + +print_r($ret); +?> +--EXPECT-- +Array +( + [0] => Array + ( + [0] => Array + ( + [0] => f + [1] => jjohnston@mail.com + ) + + [1] => Array + ( + [0] => --to + [1] => hi + ) + + ) + + [1] => Array + ( + [0] => - + ) + +) \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/console_getopt/tests/bug13140.phpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_getopt/tests/bug13140.phpt Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,75 @@ +--TEST-- +Console_Getopt [bug 13140] +--SKIPIF-- +--FILE-- +getopt2($cg->readPHPArgv(), 't', array('test'), true)); +print_r($cg->getopt2($cg->readPHPArgv(), 'bar', array('foo'), true)); +?> +--EXPECT-- +Array +( + [0] => Array + ( + [0] => Array + ( + [0] => --test + [1] => + ) + + ) + + [1] => Array + ( + [0] => thisshouldbehere + ) + +) +Array +( + [0] => Array + ( + [0] => Array + ( + [0] => --foo + [1] => + ) + + [1] => Array + ( + [0] => b + [1] => + ) + + [2] => Array + ( + [0] => a + [1] => + ) + + [3] => Array + ( + [0] => r + [1] => + ) + + [4] => Array + ( + [0] => r + [1] => + ) + + ) + + [1] => Array + ( + [0] => thisshouldbehere + ) + +) diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear-core-minimal/README.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear-core-minimal/README.rst Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,26 @@ +****************************** +Minimal set of PEAR core files +****************************** + +This repository provides a set of files from ``pear-core`` +that are often used in PEAR packages. + +It follows the `pear-core`__ repository and gets updated whenever a new +PEAR version is released. + +It's meant to be used as dependency for composer packages. + +__ https://github.com/pear/pear-core + +============== +Included files +============== +- ``OS/Guess.php`` +- ``PEAR.php`` +- ``PEAR/Error.php`` +- ``PEAR/ErrorStack.php`` +- ``System.php`` + + +``PEAR/Error.php`` is a dummy file that only includes ``PEAR.php``, +to make autoloaders work without problems. diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear-core-minimal/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear-core-minimal/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,32 @@ +{ + "name": "pear/pear-core-minimal", + "description": "Minimal set of PEAR core files to be used as composer dependency", + "license": "BSD-3-Clause", + "authors": [ + { + "email": "cweiske@php.net", + "name": "Christian Weiske", + "role": "Lead" + } + ], + "autoload": { + "psr-0": { + "": "src/" + } + }, + "include-path": [ + "src/" + ], + "support": { + "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PEAR", + "source": "https://github.com/pear/pear-core-minimal" + }, + "type": "library", + "require": { + "pear/console_getopt": "~1.4", + "pear/pear_exception": "~1.0" + }, + "replace": { + "rsky/pear-core-min": "self.version" + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear-core-minimal/src/OS/Guess.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear-core-minimal/src/OS/Guess.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,337 @@ + + * @author Gregory Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since PEAR 0.1 + */ + +// {{{ uname examples + +// php_uname() without args returns the same as 'uname -a', or a PHP-custom +// string for Windows. +// PHP versions prior to 4.3 return the uname of the host where PHP was built, +// as of 4.3 it returns the uname of the host running the PHP code. +// +// PC RedHat Linux 7.1: +// Linux host.example.com 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown +// +// PC Debian Potato: +// Linux host 2.4.17 #2 SMP Tue Feb 12 15:10:04 CET 2002 i686 unknown +// +// PC FreeBSD 3.3: +// FreeBSD host.example.com 3.3-STABLE FreeBSD 3.3-STABLE #0: Mon Feb 21 00:42:31 CET 2000 root@example.com:/usr/src/sys/compile/CONFIG i386 +// +// PC FreeBSD 4.3: +// FreeBSD host.example.com 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Mon Jun 25 11:19:43 EDT 2001 root@example.com:/usr/src/sys/compile/CONFIG i386 +// +// PC FreeBSD 4.5: +// FreeBSD host.example.com 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Feb 6 23:59:23 CET 2002 root@example.com:/usr/src/sys/compile/CONFIG i386 +// +// PC FreeBSD 4.5 w/uname from GNU shellutils: +// FreeBSD host.example.com 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Feb i386 unknown +// +// HP 9000/712 HP-UX 10: +// HP-UX iq B.10.10 A 9000/712 2008429113 two-user license +// +// HP 9000/712 HP-UX 10 w/uname from GNU shellutils: +// HP-UX host B.10.10 A 9000/712 unknown +// +// IBM RS6000/550 AIX 4.3: +// AIX host 3 4 000003531C00 +// +// AIX 4.3 w/uname from GNU shellutils: +// AIX host 3 4 000003531C00 unknown +// +// SGI Onyx IRIX 6.5 w/uname from GNU shellutils: +// IRIX64 host 6.5 01091820 IP19 mips +// +// SGI Onyx IRIX 6.5: +// IRIX64 host 6.5 01091820 IP19 +// +// SparcStation 20 Solaris 8 w/uname from GNU shellutils: +// SunOS host.example.com 5.8 Generic_108528-12 sun4m sparc +// +// SparcStation 20 Solaris 8: +// SunOS host.example.com 5.8 Generic_108528-12 sun4m sparc SUNW,SPARCstation-20 +// +// Mac OS X (Darwin) +// Darwin home-eden.local 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug 5 19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC Power Macintosh +// +// Mac OS X early versions +// + +// }}} + +/* TODO: + * - define endianness, to allow matchSignature("bigend") etc. + */ + +/** + * Retrieves information about the current operating system + * + * This class uses php_uname() to grok information about the current OS + * + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Gregory Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class OS_Guess +{ + var $sysname; + var $nodename; + var $cpu; + var $release; + var $extra; + + function __construct($uname = null) + { + list($this->sysname, + $this->release, + $this->cpu, + $this->extra, + $this->nodename) = $this->parseSignature($uname); + } + + function parseSignature($uname = null) + { + static $sysmap = array( + 'HP-UX' => 'hpux', + 'IRIX64' => 'irix', + ); + static $cpumap = array( + 'i586' => 'i386', + 'i686' => 'i386', + 'ppc' => 'powerpc', + ); + if ($uname === null) { + $uname = php_uname(); + } + $parts = preg_split('/\s+/', trim($uname)); + $n = count($parts); + + $release = $machine = $cpu = ''; + $sysname = $parts[0]; + $nodename = $parts[1]; + $cpu = $parts[$n-1]; + $extra = ''; + if ($cpu == 'unknown') { + $cpu = $parts[$n - 2]; + } + + switch ($sysname) { + case 'AIX' : + $release = "$parts[3].$parts[2]"; + break; + case 'Windows' : + switch ($parts[1]) { + case '95/98': + $release = '9x'; + break; + default: + $release = $parts[1]; + break; + } + $cpu = 'i386'; + break; + case 'Linux' : + $extra = $this->_detectGlibcVersion(); + // use only the first two digits from the kernel version + $release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1', $parts[2]); + break; + case 'Mac' : + $sysname = 'darwin'; + $nodename = $parts[2]; + $release = $parts[3]; + if ($cpu == 'Macintosh') { + if ($parts[$n - 2] == 'Power') { + $cpu = 'powerpc'; + } + } + break; + case 'Darwin' : + if ($cpu == 'Macintosh') { + if ($parts[$n - 2] == 'Power') { + $cpu = 'powerpc'; + } + } + $release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1', $parts[2]); + break; + default: + $release = preg_replace('/-.*/', '', $parts[2]); + break; + } + + if (isset($sysmap[$sysname])) { + $sysname = $sysmap[$sysname]; + } else { + $sysname = strtolower($sysname); + } + if (isset($cpumap[$cpu])) { + $cpu = $cpumap[$cpu]; + } + return array($sysname, $release, $cpu, $extra, $nodename); + } + + function _detectGlibcVersion() + { + static $glibc = false; + if ($glibc !== false) { + return $glibc; // no need to run this multiple times + } + $major = $minor = 0; + include_once "System.php"; + // Use glibc's header file to + // get major and minor version number: + if (@file_exists('/usr/include/features.h') && + @is_readable('/usr/include/features.h')) { + if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) { + $features_file = fopen('/usr/include/features.h', 'rb'); + while (!feof($features_file)) { + $line = fgets($features_file, 8192); + if (!$line || (strpos($line, '#define') === false)) { + continue; + } + if (strpos($line, '__GLIBC__')) { + // major version number #define __GLIBC__ version + $line = preg_split('/\s+/', $line); + $glibc_major = trim($line[2]); + if (isset($glibc_minor)) { + break; + } + continue; + } + + if (strpos($line, '__GLIBC_MINOR__')) { + // got the minor version number + // #define __GLIBC_MINOR__ version + $line = preg_split('/\s+/', $line); + $glibc_minor = trim($line[2]); + if (isset($glibc_major)) { + break; + } + continue; + } + } + fclose($features_file); + if (!isset($glibc_major) || !isset($glibc_minor)) { + return $glibc = ''; + } + return $glibc = 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ; + } // no cpp + + $tmpfile = System::mktemp("glibctest"); + $fp = fopen($tmpfile, "w"); + fwrite($fp, "#include \n__GLIBC__ __GLIBC_MINOR__\n"); + fclose($fp); + $cpp = popen("/usr/bin/cpp $tmpfile", "r"); + while ($line = fgets($cpp, 1024)) { + if ($line{0} == '#' || trim($line) == '') { + continue; + } + + if (list($major, $minor) = explode(' ', trim($line))) { + break; + } + } + pclose($cpp); + unlink($tmpfile); + } // features.h + + if (!($major && $minor) && @is_link('/lib/libc.so.6')) { + // Let's try reading the libc.so.6 symlink + if (preg_match('/^libc-(.*)\.so$/', basename(readlink('/lib/libc.so.6')), $matches)) { + list($major, $minor) = explode('.', $matches[1]); + } + } + + if (!($major && $minor)) { + return $glibc = ''; + } + + return $glibc = "glibc{$major}.{$minor}"; + } + + function getSignature() + { + if (empty($this->extra)) { + return "{$this->sysname}-{$this->release}-{$this->cpu}"; + } + return "{$this->sysname}-{$this->release}-{$this->cpu}-{$this->extra}"; + } + + function getSysname() + { + return $this->sysname; + } + + function getNodename() + { + return $this->nodename; + } + + function getCpu() + { + return $this->cpu; + } + + function getRelease() + { + return $this->release; + } + + function getExtra() + { + return $this->extra; + } + + function matchSignature($match) + { + $fragments = is_array($match) ? $match : explode('-', $match); + $n = count($fragments); + $matches = 0; + if ($n > 0) { + $matches += $this->_matchFragment($fragments[0], $this->sysname); + } + if ($n > 1) { + $matches += $this->_matchFragment($fragments[1], $this->release); + } + if ($n > 2) { + $matches += $this->_matchFragment($fragments[2], $this->cpu); + } + if ($n > 3) { + $matches += $this->_matchFragment($fragments[3], $this->extra); + } + return ($matches == $n); + } + + function _matchFragment($fragment, $value) + { + if (strcspn($fragment, '*?') < strlen($fragment)) { + $reg = '/^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '\\z/'; + return preg_match($reg, $value); + } + return ($fragment == '*' || !strcasecmp($fragment, $value)); + } + +} +/* + * Local Variables: + * indent-tabs-mode: nil + * c-basic-offset: 4 + * End: + */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear-core-minimal/src/PEAR.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear-core-minimal/src/PEAR.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1113 @@ + + * @author Stig Bakken + * @author Tomas V.V.Cox + * @author Greg Beaver + * @copyright 1997-2010 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/**#@+ + * ERROR constants + */ +define('PEAR_ERROR_RETURN', 1); +define('PEAR_ERROR_PRINT', 2); +define('PEAR_ERROR_TRIGGER', 4); +define('PEAR_ERROR_DIE', 8); +define('PEAR_ERROR_CALLBACK', 16); +/** + * WARNING: obsolete + * @deprecated + */ +define('PEAR_ERROR_EXCEPTION', 32); +/**#@-*/ + +if (substr(PHP_OS, 0, 3) == 'WIN') { + define('OS_WINDOWS', true); + define('OS_UNIX', false); + define('PEAR_OS', 'Windows'); +} else { + define('OS_WINDOWS', false); + define('OS_UNIX', true); + define('PEAR_OS', 'Unix'); // blatant assumption +} + +$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; +$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; +$GLOBALS['_PEAR_destructor_object_list'] = array(); +$GLOBALS['_PEAR_shutdown_funcs'] = array(); +$GLOBALS['_PEAR_error_handler_stack'] = array(); + +@ini_set('track_errors', true); + +/** + * Base class for other PEAR classes. Provides rudimentary + * emulation of destructors. + * + * If you want a destructor in your class, inherit PEAR and make a + * destructor method called _yourclassname (same name as the + * constructor, but with a "_" prefix). Also, in your constructor you + * have to call the PEAR constructor: $this->PEAR();. + * The destructor method will be called without parameters. Note that + * at in some SAPI implementations (such as Apache), any output during + * the request shutdown (in which destructors are called) seems to be + * discarded. If you need to get any debug information from your + * destructor, use error_log(), syslog() or something similar. + * + * IMPORTANT! To use the emulated destructors you need to create the + * objects by reference: $obj =& new PEAR_child; + * + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Tomas V.V. Cox + * @author Greg Beaver + * @copyright 1997-2006 The PHP Group + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PEAR + * @see PEAR_Error + * @since Class available since PHP 4.0.2 + * @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear + */ +class PEAR +{ + /** + * Whether to enable internal debug messages. + * + * @var bool + * @access private + */ + var $_debug = false; + + /** + * Default error mode for this object. + * + * @var int + * @access private + */ + var $_default_error_mode = null; + + /** + * Default error options used for this object when error mode + * is PEAR_ERROR_TRIGGER. + * + * @var int + * @access private + */ + var $_default_error_options = null; + + /** + * Default error handler (callback) for this object, if error mode is + * PEAR_ERROR_CALLBACK. + * + * @var string + * @access private + */ + var $_default_error_handler = ''; + + /** + * Which class to use for error objects. + * + * @var string + * @access private + */ + var $_error_class = 'PEAR_Error'; + + /** + * An array of expected errors. + * + * @var array + * @access private + */ + var $_expected_errors = array(); + + /** + * List of methods that can be called both statically and non-statically. + * @var array + */ + protected static $bivalentMethods = array( + 'setErrorHandling' => true, + 'raiseError' => true, + 'throwError' => true, + 'pushErrorHandling' => true, + 'popErrorHandling' => true, + ); + + /** + * Constructor. Registers this object in + * $_PEAR_destructor_object_list for destructor emulation if a + * destructor object exists. + * + * @param string $error_class (optional) which class to use for + * error objects, defaults to PEAR_Error. + * @access public + * @return void + */ + function __construct($error_class = null) + { + $classname = strtolower(get_class($this)); + if ($this->_debug) { + print "PEAR constructor called, class=$classname\n"; + } + + if ($error_class !== null) { + $this->_error_class = $error_class; + } + + while ($classname && strcasecmp($classname, "pear")) { + $destructor = "_$classname"; + if (method_exists($this, $destructor)) { + global $_PEAR_destructor_object_list; + $_PEAR_destructor_object_list[] = $this; + if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { + register_shutdown_function("_PEAR_call_destructors"); + $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; + } + break; + } else { + $classname = get_parent_class($classname); + } + } + } + + /** + * Only here for backwards compatibility. + * E.g. Archive_Tar calls $this->PEAR() in its constructor. + * + * @param string $error_class Which class to use for error objects, + * defaults to PEAR_Error. + */ + public function PEAR($error_class = null) + { + self::__construct($error_class); + } + + /** + * Destructor (the emulated type of...). Does nothing right now, + * but is included for forward compatibility, so subclass + * destructors should always call it. + * + * See the note in the class desciption about output from + * destructors. + * + * @access public + * @return void + */ + function _PEAR() { + if ($this->_debug) { + printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); + } + } + + public function __call($method, $arguments) + { + if (!isset(self::$bivalentMethods[$method])) { + trigger_error( + 'Call to undefined method PEAR::' . $method . '()', E_USER_ERROR + ); + } + return call_user_func_array( + array(get_class(), '_' . $method), + array_merge(array($this), $arguments) + ); + } + + public static function __callStatic($method, $arguments) + { + if (!isset(self::$bivalentMethods[$method])) { + trigger_error( + 'Call to undefined method PEAR::' . $method . '()', E_USER_ERROR + ); + } + return call_user_func_array( + array(get_class(), '_' . $method), + array_merge(array(null), $arguments) + ); + } + + /** + * If you have a class that's mostly/entirely static, and you need static + * properties, you can use this method to simulate them. Eg. in your method(s) + * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); + * You MUST use a reference, or they will not persist! + * + * @param string $class The calling classname, to prevent clashes + * @param string $var The variable to retrieve. + * @return mixed A reference to the variable. If not set it will be + * auto initialised to NULL. + */ + public static function &getStaticProperty($class, $var) + { + static $properties; + if (!isset($properties[$class])) { + $properties[$class] = array(); + } + + if (!array_key_exists($var, $properties[$class])) { + $properties[$class][$var] = null; + } + + return $properties[$class][$var]; + } + + /** + * Use this function to register a shutdown method for static + * classes. + * + * @param mixed $func The function name (or array of class/method) to call + * @param mixed $args The arguments to pass to the function + * + * @return void + */ + public static function registerShutdownFunc($func, $args = array()) + { + // if we are called statically, there is a potential + // that no shutdown func is registered. Bug #6445 + if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { + register_shutdown_function("_PEAR_call_destructors"); + $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; + } + $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); + } + + /** + * Tell whether a value is a PEAR error. + * + * @param mixed $data the value to test + * @param int $code if $data is an error object, return true + * only if $code is a string and + * $obj->getMessage() == $code or + * $code is an integer and $obj->getCode() == $code + * + * @return bool true if parameter is an error + */ + public static function isError($data, $code = null) + { + if (!is_a($data, 'PEAR_Error')) { + return false; + } + + if (is_null($code)) { + return true; + } elseif (is_string($code)) { + return $data->getMessage() == $code; + } + + return $data->getCode() == $code; + } + + /** + * Sets how errors generated by this object should be handled. + * Can be invoked both in objects and statically. If called + * statically, setErrorHandling sets the default behaviour for all + * PEAR objects. If called in an object, setErrorHandling sets + * the default behaviour for that object. + * + * @param object $object + * Object the method was called on (non-static mode) + * + * @param int $mode + * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. + * + * @param mixed $options + * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one + * of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * + * When $mode is PEAR_ERROR_CALLBACK, this parameter is expected + * to be the callback function or method. A callback + * function is a string with the name of the function, a + * callback method is an array of two elements: the element + * at index 0 is the object, and the element at index 1 is + * the name of the method to call in the object. + * + * When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is + * a printf format string used when printing the error + * message. + * + * @access public + * @return void + * @see PEAR_ERROR_RETURN + * @see PEAR_ERROR_PRINT + * @see PEAR_ERROR_TRIGGER + * @see PEAR_ERROR_DIE + * @see PEAR_ERROR_CALLBACK + * @see PEAR_ERROR_EXCEPTION + * + * @since PHP 4.0.5 + */ + protected static function _setErrorHandling( + $object, $mode = null, $options = null + ) { + if ($object !== null) { + $setmode = &$object->_default_error_mode; + $setoptions = &$object->_default_error_options; + } else { + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + } + + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + } + + /** + * This method is used to tell which errors you expect to get. + * Expected errors are always returned with error mode + * PEAR_ERROR_RETURN. Expected error codes are stored in a stack, + * and this method pushes a new element onto it. The list of + * expected errors are in effect until they are popped off the + * stack with the popExpect() method. + * + * Note that this method can not be called statically + * + * @param mixed $code a single error code or an array of error codes to expect + * + * @return int the new depth of the "expected errors" stack + * @access public + */ + function expectError($code = '*') + { + if (is_array($code)) { + array_push($this->_expected_errors, $code); + } else { + array_push($this->_expected_errors, array($code)); + } + return count($this->_expected_errors); + } + + /** + * This method pops one element off the expected error codes + * stack. + * + * @return array the list of error codes that were popped + */ + function popExpect() + { + return array_pop($this->_expected_errors); + } + + /** + * This method checks unsets an error code if available + * + * @param mixed error code + * @return bool true if the error code was unset, false otherwise + * @access private + * @since PHP 4.3.0 + */ + function _checkDelExpect($error_code) + { + $deleted = false; + foreach ($this->_expected_errors as $key => $error_array) { + if (in_array($error_code, $error_array)) { + unset($this->_expected_errors[$key][array_search($error_code, $error_array)]); + $deleted = true; + } + + // clean up empty arrays + if (0 == count($this->_expected_errors[$key])) { + unset($this->_expected_errors[$key]); + } + } + + return $deleted; + } + + /** + * This method deletes all occurrences of the specified element from + * the expected error codes stack. + * + * @param mixed $error_code error code that should be deleted + * @return mixed list of error codes that were deleted or error + * @access public + * @since PHP 4.3.0 + */ + function delExpect($error_code) + { + $deleted = false; + if ((is_array($error_code) && (0 != count($error_code)))) { + // $error_code is a non-empty array here; we walk through it trying + // to unset all values + foreach ($error_code as $key => $error) { + $deleted = $this->_checkDelExpect($error) ? true : false; + } + + return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } elseif (!empty($error_code)) { + // $error_code comes alone, trying to unset it + if ($this->_checkDelExpect($error_code)) { + return true; + } + + return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } + + // $error_code is empty + return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME + } + + /** + * This method is a wrapper that returns an instance of the + * configured error class with this object's default error + * handling applied. If the $mode and $options parameters are not + * specified, the object's defaults are used. + * + * @param mixed $message a text error message or a PEAR error object + * + * @param int $code a numeric error code (it is up to your class + * to define these if you want to use codes) + * + * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. + * + * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter + * specifies the PHP-internal error level (one of + * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * If $mode is PEAR_ERROR_CALLBACK, this + * parameter specifies the callback function or + * method. In other error modes this parameter + * is ignored. + * + * @param string $userinfo If you need to pass along for example debug + * information, this parameter is meant for that. + * + * @param string $error_class The returned error object will be + * instantiated from this class, if specified. + * + * @param bool $skipmsg If true, raiseError will only pass error codes, + * the error message parameter will be dropped. + * + * @return object a PEAR error object + * @see PEAR::setErrorHandling + * @since PHP 4.0.5 + */ + protected static function _raiseError($object, + $message = null, + $code = null, + $mode = null, + $options = null, + $userinfo = null, + $error_class = null, + $skipmsg = false) + { + // The error is yet a PEAR error object + if (is_object($message)) { + $code = $message->getCode(); + $userinfo = $message->getUserInfo(); + $error_class = $message->getType(); + $message->error_message_prefix = ''; + $message = $message->getMessage(); + } + + if ( + $object !== null && + isset($object->_expected_errors) && + count($object->_expected_errors) > 0 && + count($exp = end($object->_expected_errors)) + ) { + if ($exp[0] === "*" || + (is_int(reset($exp)) && in_array($code, $exp)) || + (is_string(reset($exp)) && in_array($message, $exp)) + ) { + $mode = PEAR_ERROR_RETURN; + } + } + + // No mode given, try global ones + if ($mode === null) { + // Class error handler + if ($object !== null && isset($object->_default_error_mode)) { + $mode = $object->_default_error_mode; + $options = $object->_default_error_options; + // Global error handler + } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { + $mode = $GLOBALS['_PEAR_default_error_mode']; + $options = $GLOBALS['_PEAR_default_error_options']; + } + } + + if ($error_class !== null) { + $ec = $error_class; + } elseif ($object !== null && isset($object->_error_class)) { + $ec = $object->_error_class; + } else { + $ec = 'PEAR_Error'; + } + + if ($skipmsg) { + $a = new $ec($code, $mode, $options, $userinfo); + } else { + $a = new $ec($message, $code, $mode, $options, $userinfo); + } + + return $a; + } + + /** + * Simpler form of raiseError with fewer options. In most cases + * message, code and userinfo are enough. + * + * @param mixed $message a text error message or a PEAR error object + * + * @param int $code a numeric error code (it is up to your class + * to define these if you want to use codes) + * + * @param string $userinfo If you need to pass along for example debug + * information, this parameter is meant for that. + * + * @return object a PEAR error object + * @see PEAR::raiseError + */ + protected static function _throwError($object, $message = null, $code = null, $userinfo = null) + { + if ($object !== null) { + $a = $object->raiseError($message, $code, null, null, $userinfo); + return $a; + } + + $a = PEAR::raiseError($message, $code, null, null, $userinfo); + return $a; + } + + public static function staticPushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + $stack[] = array($def_mode, $def_options); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $def_mode = $mode; + $def_options = $options; + break; + + case PEAR_ERROR_CALLBACK: + $def_mode = $mode; + // class/object method callback + if (is_callable($options)) { + $def_options = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + $stack[] = array($mode, $options); + return true; + } + + public static function staticPopErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + return true; + } + + /** + * Push a new error handler on top of the error handler options stack. With this + * you can easily override the actual error handler for some code and restore + * it later with popErrorHandling. + * + * @param mixed $mode (same as setErrorHandling) + * @param mixed $options (same as setErrorHandling) + * + * @return bool Always true + * + * @see PEAR::setErrorHandling + */ + protected static function _pushErrorHandling($object, $mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + if ($object !== null) { + $def_mode = &$object->_default_error_mode; + $def_options = &$object->_default_error_options; + } else { + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + } + $stack[] = array($def_mode, $def_options); + + if ($object !== null) { + $object->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + $stack[] = array($mode, $options); + return true; + } + + /** + * Pop the last error handler used + * + * @return bool Always true + * + * @see PEAR::pushErrorHandling + */ + protected static function _popErrorHandling($object) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + if ($object !== null) { + $object->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + return true; + } + + /** + * OS independent PHP extension load. Remember to take care + * on the correct extension name for case sensitive OSes. + * + * @param string $ext The extension name + * @return bool Success or not on the dl() call + */ + public static function loadExtension($ext) + { + if (extension_loaded($ext)) { + return true; + } + + // if either returns true dl() will produce a FATAL error, stop that + if ( + function_exists('dl') === false || + ini_get('enable_dl') != 1 + ) { + return false; + } + + if (OS_WINDOWS) { + $suffix = '.dll'; + } elseif (PHP_OS == 'HP-UX') { + $suffix = '.sl'; + } elseif (PHP_OS == 'AIX') { + $suffix = '.a'; + } elseif (PHP_OS == 'OSX') { + $suffix = '.bundle'; + } else { + $suffix = '.so'; + } + + return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); + } +} + +function _PEAR_call_destructors() +{ + global $_PEAR_destructor_object_list; + if (is_array($_PEAR_destructor_object_list) && + sizeof($_PEAR_destructor_object_list)) + { + reset($_PEAR_destructor_object_list); + + $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo'); + + if ($destructLifoExists) { + $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); + } + + foreach ($_PEAR_destructor_object_list as $k => $objref) { + $classname = get_class($objref); + while ($classname) { + $destructor = "_$classname"; + if (method_exists($objref, $destructor)) { + $objref->$destructor(); + break; + } else { + $classname = get_parent_class($classname); + } + } + } + // Empty the object list to ensure that destructors are + // not called more than once. + $_PEAR_destructor_object_list = array(); + } + + // Now call the shutdown functions + if ( + isset($GLOBALS['_PEAR_shutdown_funcs']) && + is_array($GLOBALS['_PEAR_shutdown_funcs']) && + !empty($GLOBALS['_PEAR_shutdown_funcs']) + ) { + foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) { + call_user_func_array($value[0], $value[1]); + } + } +} + +/** + * Standard PEAR error class for PHP 4 + * + * This class is supserseded by {@link PEAR_Exception} in PHP 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Tomas V.V. Cox + * @author Gregory Beaver + * @copyright 1997-2006 The PHP Group + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/manual/en/core.pear.pear-error.php + * @see PEAR::raiseError(), PEAR::throwError() + * @since Class available since PHP 4.0.2 + */ +class PEAR_Error +{ + var $error_message_prefix = ''; + var $mode = PEAR_ERROR_RETURN; + var $level = E_USER_NOTICE; + var $code = -1; + var $message = ''; + var $userinfo = ''; + var $backtrace = null; + + /** + * PEAR_Error constructor + * + * @param string $message message + * + * @param int $code (optional) error code + * + * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN, + * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION + * + * @param mixed $options (optional) error level, _OR_ in the case of + * PEAR_ERROR_CALLBACK, the callback function or object/method + * tuple. + * + * @param string $userinfo (optional) additional user/debug info + * + * @access public + * + */ + function __construct($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + if ($mode === null) { + $mode = PEAR_ERROR_RETURN; + } + $this->message = $message; + $this->code = $code; + $this->mode = $mode; + $this->userinfo = $userinfo; + + $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace'); + + if (!$skiptrace) { + $this->backtrace = debug_backtrace(); + if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) { + unset($this->backtrace[0]['object']); + } + } + + if ($mode & PEAR_ERROR_CALLBACK) { + $this->level = E_USER_NOTICE; + $this->callback = $options; + } else { + if ($options === null) { + $options = E_USER_NOTICE; + } + + $this->level = $options; + $this->callback = null; + } + + if ($this->mode & PEAR_ERROR_PRINT) { + if (is_null($options) || is_int($options)) { + $format = "%s"; + } else { + $format = $options; + } + + printf($format, $this->getMessage()); + } + + if ($this->mode & PEAR_ERROR_TRIGGER) { + trigger_error($this->getMessage(), $this->level); + } + + if ($this->mode & PEAR_ERROR_DIE) { + $msg = $this->getMessage(); + if (is_null($options) || is_int($options)) { + $format = "%s"; + if (substr($msg, -1) != "\n") { + $msg .= "\n"; + } + } else { + $format = $options; + } + printf($format, $msg); + exit($code); + } + + if ($this->mode & PEAR_ERROR_CALLBACK && is_callable($this->callback)) { + call_user_func($this->callback, $this); + } + + if ($this->mode & PEAR_ERROR_EXCEPTION) { + trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING); + eval('$e = new Exception($this->message, $this->code);throw($e);'); + } + } + + /** + * Only here for backwards compatibility. + * + * Class "Cache_Error" still uses it, among others. + * + * @param string $message Message + * @param int $code Error code + * @param int $mode Error mode + * @param mixed $options See __construct() + * @param string $userinfo Additional user/debug info + */ + public function PEAR_Error( + $message = 'unknown error', $code = null, $mode = null, + $options = null, $userinfo = null + ) { + self::__construct($message, $code, $mode, $options, $userinfo); + } + + /** + * Get the error mode from an error object. + * + * @return int error mode + * @access public + */ + function getMode() + { + return $this->mode; + } + + /** + * Get the callback function/method from an error object. + * + * @return mixed callback function or object/method array + * @access public + */ + function getCallback() + { + return $this->callback; + } + + /** + * Get the error message from an error object. + * + * @return string full error message + * @access public + */ + function getMessage() + { + return ($this->error_message_prefix . $this->message); + } + + /** + * Get error code from an error object + * + * @return int error code + * @access public + */ + function getCode() + { + return $this->code; + } + + /** + * Get the name of this error/exception. + * + * @return string error/exception name (type) + * @access public + */ + function getType() + { + return get_class($this); + } + + /** + * Get additional user-supplied information. + * + * @return string user-supplied information + * @access public + */ + function getUserInfo() + { + return $this->userinfo; + } + + /** + * Get additional debug information supplied by the application. + * + * @return string debug information + * @access public + */ + function getDebugInfo() + { + return $this->getUserInfo(); + } + + /** + * Get the call backtrace from where the error was generated. + * Supported with PHP 4.3.0 or newer. + * + * @param int $frame (optional) what frame to fetch + * @return array Backtrace, or NULL if not available. + * @access public + */ + function getBacktrace($frame = null) + { + if (defined('PEAR_IGNORE_BACKTRACE')) { + return null; + } + if ($frame === null) { + return $this->backtrace; + } + return $this->backtrace[$frame]; + } + + function addUserInfo($info) + { + if (empty($this->userinfo)) { + $this->userinfo = $info; + } else { + $this->userinfo .= " ** $info"; + } + } + + function __toString() + { + return $this->getMessage(); + } + + /** + * Make a string representation of this object. + * + * @return string a string with an object summary + * @access public + */ + function toString() + { + $modes = array(); + $levels = array(E_USER_NOTICE => 'notice', + E_USER_WARNING => 'warning', + E_USER_ERROR => 'error'); + if ($this->mode & PEAR_ERROR_CALLBACK) { + if (is_array($this->callback)) { + $callback = (is_object($this->callback[0]) ? + strtolower(get_class($this->callback[0])) : + $this->callback[0]) . '::' . + $this->callback[1]; + } else { + $callback = $this->callback; + } + return sprintf('[%s: message="%s" code=%d mode=callback '. + 'callback=%s prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + $callback, $this->error_message_prefix, + $this->userinfo); + } + if ($this->mode & PEAR_ERROR_PRINT) { + $modes[] = 'print'; + } + if ($this->mode & PEAR_ERROR_TRIGGER) { + $modes[] = 'trigger'; + } + if ($this->mode & PEAR_ERROR_DIE) { + $modes[] = 'die'; + } + if ($this->mode & PEAR_ERROR_RETURN) { + $modes[] = 'return'; + } + return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. + 'prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + implode("|", $modes), $levels[$this->level], + $this->error_message_prefix, + $this->userinfo); + } +} + +/* + * Local Variables: + * mode: php + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear-core-minimal/src/PEAR/Error.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear-core-minimal/src/PEAR/Error.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ + + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + */ +require_once __DIR__ . '/../PEAR.php'; +?> \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear-core-minimal/src/PEAR/ErrorStack.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear-core-minimal/src/PEAR/ErrorStack.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,979 @@ + + * @copyright 2004-2008 Greg Beaver + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR_ErrorStack + */ + +/** + * Singleton storage + * + * Format: + *
    + * array(
    + *  'package1' => PEAR_ErrorStack object,
    + *  'package2' => PEAR_ErrorStack object,
    + *  ...
    + * )
    + * 
    + * @access private + * @global array $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] + */ +$GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] = array(); + +/** + * Global error callback (default) + * + * This is only used if set to non-false. * is the default callback for + * all packages, whereas specific packages may set a default callback + * for all instances, regardless of whether they are a singleton or not. + * + * To exclude non-singletons, only set the local callback for the singleton + * @see PEAR_ErrorStack::setDefaultCallback() + * @access private + * @global array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] + */ +$GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] = array( + '*' => false, +); + +/** + * Global Log object (default) + * + * This is only used if set to non-false. Use to set a default log object for + * all stacks, regardless of instantiation order or location + * @see PEAR_ErrorStack::setDefaultLogger() + * @access private + * @global array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] + */ +$GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = false; + +/** + * Global Overriding Callback + * + * This callback will override any error callbacks that specific loggers have set. + * Use with EXTREME caution + * @see PEAR_ErrorStack::staticPushCallback() + * @access private + * @global array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] + */ +$GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array(); + +/**#@+ + * One of four possible return values from the error Callback + * @see PEAR_ErrorStack::_errorCallback() + */ +/** + * If this is returned, then the error will be both pushed onto the stack + * and logged. + */ +define('PEAR_ERRORSTACK_PUSHANDLOG', 1); +/** + * If this is returned, then the error will only be pushed onto the stack, + * and not logged. + */ +define('PEAR_ERRORSTACK_PUSH', 2); +/** + * If this is returned, then the error will only be logged, but not pushed + * onto the error stack. + */ +define('PEAR_ERRORSTACK_LOG', 3); +/** + * If this is returned, then the error is completely ignored. + */ +define('PEAR_ERRORSTACK_IGNORE', 4); +/** + * If this is returned, then the error is logged and die() is called. + */ +define('PEAR_ERRORSTACK_DIE', 5); +/**#@-*/ + +/** + * Error code for an attempt to instantiate a non-class as a PEAR_ErrorStack in + * the singleton method. + */ +define('PEAR_ERRORSTACK_ERR_NONCLASS', 1); + +/** + * Error code for an attempt to pass an object into {@link PEAR_ErrorStack::getMessage()} + * that has no __toString() method + */ +define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2); +/** + * Error Stack Implementation + * + * Usage: + * + * // global error stack + * $global_stack = &PEAR_ErrorStack::singleton('MyPackage'); + * // local error stack + * $local_stack = new PEAR_ErrorStack('MyPackage'); + * + * @author Greg Beaver + * @version @package_version@ + * @package PEAR_ErrorStack + * @category Debugging + * @copyright 2004-2008 Greg Beaver + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR_ErrorStack + */ +class PEAR_ErrorStack { + /** + * Errors are stored in the order that they are pushed on the stack. + * @since 0.4alpha Errors are no longer organized by error level. + * This renders pop() nearly unusable, and levels could be more easily + * handled in a callback anyway + * @var array + * @access private + */ + var $_errors = array(); + + /** + * Storage of errors by level. + * + * Allows easy retrieval and deletion of only errors from a particular level + * @since PEAR 1.4.0dev + * @var array + * @access private + */ + var $_errorsByLevel = array(); + + /** + * Package name this error stack represents + * @var string + * @access protected + */ + var $_package; + + /** + * Determines whether a PEAR_Error is thrown upon every error addition + * @var boolean + * @access private + */ + var $_compat = false; + + /** + * If set to a valid callback, this will be used to generate the error + * message from the error code, otherwise the message passed in will be + * used + * @var false|string|array + * @access private + */ + var $_msgCallback = false; + + /** + * If set to a valid callback, this will be used to generate the error + * context for an error. For PHP-related errors, this will be a file + * and line number as retrieved from debug_backtrace(), but can be + * customized for other purposes. The error might actually be in a separate + * configuration file, or in a database query. + * @var false|string|array + * @access protected + */ + var $_contextCallback = false; + + /** + * If set to a valid callback, this will be called every time an error + * is pushed onto the stack. The return value will be used to determine + * whether to allow an error to be pushed or logged. + * + * The return value must be one an PEAR_ERRORSTACK_* constant + * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG + * @var false|string|array + * @access protected + */ + var $_errorCallback = array(); + + /** + * PEAR::Log object for logging errors + * @var false|Log + * @access protected + */ + var $_logger = false; + + /** + * Error messages - designed to be overridden + * @var array + * @abstract + */ + var $_errorMsgs = array(); + + /** + * Set up a new error stack + * + * @param string $package name of the package this error stack represents + * @param callback $msgCallback callback used for error message generation + * @param callback $contextCallback callback used for context generation, + * defaults to {@link getFileLine()} + * @param boolean $throwPEAR_Error + */ + function __construct($package, $msgCallback = false, $contextCallback = false, + $throwPEAR_Error = false) + { + $this->_package = $package; + $this->setMessageCallback($msgCallback); + $this->setContextCallback($contextCallback); + $this->_compat = $throwPEAR_Error; + } + + /** + * Return a single error stack for this package. + * + * Note that all parameters are ignored if the stack for package $package + * has already been instantiated + * @param string $package name of the package this error stack represents + * @param callback $msgCallback callback used for error message generation + * @param callback $contextCallback callback used for context generation, + * defaults to {@link getFileLine()} + * @param boolean $throwPEAR_Error + * @param string $stackClass class to instantiate + * + * @return PEAR_ErrorStack + */ + public static function &singleton( + $package, $msgCallback = false, $contextCallback = false, + $throwPEAR_Error = false, $stackClass = 'PEAR_ErrorStack' + ) { + if (isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { + return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]; + } + if (!class_exists($stackClass)) { + if (function_exists('debug_backtrace')) { + $trace = debug_backtrace(); + } + PEAR_ErrorStack::staticPush('PEAR_ErrorStack', PEAR_ERRORSTACK_ERR_NONCLASS, + 'exception', array('stackclass' => $stackClass), + 'stack class "%stackclass%" is not a valid class name (should be like PEAR_ErrorStack)', + false, $trace); + } + $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package] = + new $stackClass($package, $msgCallback, $contextCallback, $throwPEAR_Error); + + return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]; + } + + /** + * Internal error handler for PEAR_ErrorStack class + * + * Dies if the error is an exception (and would have died anyway) + * @access private + */ + function _handleError($err) + { + if ($err['level'] == 'exception') { + $message = $err['message']; + if (isset($_SERVER['REQUEST_URI'])) { + echo '
    '; + } else { + echo "\n"; + } + var_dump($err['context']); + die($message); + } + } + + /** + * Set up a PEAR::Log object for all error stacks that don't have one + * @param Log $log + */ + public static function setDefaultLogger(&$log) + { + if (is_object($log) && method_exists($log, 'log') ) { + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; + } elseif (is_callable($log)) { + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; + } + } + + /** + * Set up a PEAR::Log object for this error stack + * @param Log $log + */ + function setLogger(&$log) + { + if (is_object($log) && method_exists($log, 'log') ) { + $this->_logger = &$log; + } elseif (is_callable($log)) { + $this->_logger = &$log; + } + } + + /** + * Set an error code => error message mapping callback + * + * This method sets the callback that can be used to generate error + * messages for any instance + * @param array|string Callback function/method + */ + function setMessageCallback($msgCallback) + { + if (!$msgCallback) { + $this->_msgCallback = array(&$this, 'getErrorMessage'); + } else { + if (is_callable($msgCallback)) { + $this->_msgCallback = $msgCallback; + } + } + } + + /** + * Get an error code => error message mapping callback + * + * This method returns the current callback that can be used to generate error + * messages + * @return array|string|false Callback function/method or false if none + */ + function getMessageCallback() + { + return $this->_msgCallback; + } + + /** + * Sets a default callback to be used by all error stacks + * + * This method sets the callback that can be used to generate error + * messages for a singleton + * @param array|string Callback function/method + * @param string Package name, or false for all packages + */ + public static function setDefaultCallback($callback = false, $package = false) + { + if (!is_callable($callback)) { + $callback = false; + } + $package = $package ? $package : '*'; + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'][$package] = $callback; + } + + /** + * Set a callback that generates context information (location of error) for an error stack + * + * This method sets the callback that can be used to generate context + * information for an error. Passing in NULL will disable context generation + * and remove the expensive call to debug_backtrace() + * @param array|string|null Callback function/method + */ + function setContextCallback($contextCallback) + { + if ($contextCallback === null) { + return $this->_contextCallback = false; + } + if (!$contextCallback) { + $this->_contextCallback = array(&$this, 'getFileLine'); + } else { + if (is_callable($contextCallback)) { + $this->_contextCallback = $contextCallback; + } + } + } + + /** + * Set an error Callback + * If set to a valid callback, this will be called every time an error + * is pushed onto the stack. The return value will be used to determine + * whether to allow an error to be pushed or logged. + * + * The return value must be one of the ERRORSTACK_* constants. + * + * This functionality can be used to emulate PEAR's pushErrorHandling, and + * the PEAR_ERROR_CALLBACK mode, without affecting the integrity of + * the error stack or logging + * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG + * @see popCallback() + * @param string|array $cb + */ + function pushCallback($cb) + { + array_push($this->_errorCallback, $cb); + } + + /** + * Remove a callback from the error callback stack + * @see pushCallback() + * @return array|string|false + */ + function popCallback() + { + if (!count($this->_errorCallback)) { + return false; + } + return array_pop($this->_errorCallback); + } + + /** + * Set a temporary overriding error callback for every package error stack + * + * Use this to temporarily disable all existing callbacks (can be used + * to emulate the @ operator, for instance) + * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG + * @see staticPopCallback(), pushCallback() + * @param string|array $cb + */ + public static function staticPushCallback($cb) + { + array_push($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'], $cb); + } + + /** + * Remove a temporary overriding error callback + * @see staticPushCallback() + * @return array|string|false + */ + public static function staticPopCallback() + { + $ret = array_pop($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK']); + if (!is_array($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'])) { + $GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array(); + } + return $ret; + } + + /** + * Add an error to the stack + * + * If the message generator exists, it is called with 2 parameters. + * - the current Error Stack object + * - an array that is in the same format as an error. Available indices + * are 'code', 'package', 'time', 'params', 'level', and 'context' + * + * Next, if the error should contain context information, this is + * handled by the context grabbing method. + * Finally, the error is pushed onto the proper error stack + * @param int $code Package-specific error code + * @param string $level Error level. This is NOT spell-checked + * @param array $params associative array of error parameters + * @param string $msg Error message, or a portion of it if the message + * is to be generated + * @param array $repackage If this error re-packages an error pushed by + * another package, place the array returned from + * {@link pop()} in this parameter + * @param array $backtrace Protected parameter: use this to pass in the + * {@link debug_backtrace()} that should be used + * to find error context + * @return PEAR_Error|array if compatibility mode is on, a PEAR_Error is also + * thrown. If a PEAR_Error is returned, the userinfo + * property is set to the following array: + * + * + * array( + * 'code' => $code, + * 'params' => $params, + * 'package' => $this->_package, + * 'level' => $level, + * 'time' => time(), + * 'context' => $context, + * 'message' => $msg, + * //['repackage' => $err] repackaged error array/Exception class + * ); + * + * + * Normally, the previous array is returned. + */ + function push($code, $level = 'error', $params = array(), $msg = false, + $repackage = false, $backtrace = false) + { + $context = false; + // grab error context + if ($this->_contextCallback) { + if (!$backtrace) { + $backtrace = debug_backtrace(); + } + $context = call_user_func($this->_contextCallback, $code, $params, $backtrace); + } + + // save error + $time = explode(' ', microtime()); + $time = $time[1] + $time[0]; + $err = array( + 'code' => $code, + 'params' => $params, + 'package' => $this->_package, + 'level' => $level, + 'time' => $time, + 'context' => $context, + 'message' => $msg, + ); + + if ($repackage) { + $err['repackage'] = $repackage; + } + + // set up the error message, if necessary + if ($this->_msgCallback) { + $msg = call_user_func_array($this->_msgCallback, + array(&$this, $err)); + $err['message'] = $msg; + } + $push = $log = true; + $die = false; + // try the overriding callback first + $callback = $this->staticPopCallback(); + if ($callback) { + $this->staticPushCallback($callback); + } + if (!is_callable($callback)) { + // try the local callback next + $callback = $this->popCallback(); + if (is_callable($callback)) { + $this->pushCallback($callback); + } else { + // try the default callback + $callback = isset($GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'][$this->_package]) ? + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'][$this->_package] : + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK']['*']; + } + } + if (is_callable($callback)) { + switch(call_user_func($callback, $err)){ + case PEAR_ERRORSTACK_IGNORE: + return $err; + break; + case PEAR_ERRORSTACK_PUSH: + $log = false; + break; + case PEAR_ERRORSTACK_LOG: + $push = false; + break; + case PEAR_ERRORSTACK_DIE: + $die = true; + break; + // anything else returned has the same effect as pushandlog + } + } + if ($push) { + array_unshift($this->_errors, $err); + if (!isset($this->_errorsByLevel[$err['level']])) { + $this->_errorsByLevel[$err['level']] = array(); + } + $this->_errorsByLevel[$err['level']][] = &$this->_errors[0]; + } + if ($log) { + if ($this->_logger || $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER']) { + $this->_log($err); + } + } + if ($die) { + die(); + } + if ($this->_compat && $push) { + return $this->raiseError($msg, $code, null, null, $err); + } + return $err; + } + + /** + * Static version of {@link push()} + * + * @param string $package Package name this error belongs to + * @param int $code Package-specific error code + * @param string $level Error level. This is NOT spell-checked + * @param array $params associative array of error parameters + * @param string $msg Error message, or a portion of it if the message + * is to be generated + * @param array $repackage If this error re-packages an error pushed by + * another package, place the array returned from + * {@link pop()} in this parameter + * @param array $backtrace Protected parameter: use this to pass in the + * {@link debug_backtrace()} that should be used + * to find error context + * @return PEAR_Error|array if compatibility mode is on, a PEAR_Error is also + * thrown. see docs for {@link push()} + */ + public static function staticPush( + $package, $code, $level = 'error', $params = array(), + $msg = false, $repackage = false, $backtrace = false + ) { + $s = &PEAR_ErrorStack::singleton($package); + if ($s->_contextCallback) { + if (!$backtrace) { + if (function_exists('debug_backtrace')) { + $backtrace = debug_backtrace(); + } + } + } + return $s->push($code, $level, $params, $msg, $repackage, $backtrace); + } + + /** + * Log an error using PEAR::Log + * @param array $err Error array + * @param array $levels Error level => Log constant map + * @access protected + */ + function _log($err) + { + if ($this->_logger) { + $logger = &$this->_logger; + } else { + $logger = &$GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER']; + } + if (is_a($logger, 'Log')) { + $levels = array( + 'exception' => PEAR_LOG_CRIT, + 'alert' => PEAR_LOG_ALERT, + 'critical' => PEAR_LOG_CRIT, + 'error' => PEAR_LOG_ERR, + 'warning' => PEAR_LOG_WARNING, + 'notice' => PEAR_LOG_NOTICE, + 'info' => PEAR_LOG_INFO, + 'debug' => PEAR_LOG_DEBUG); + if (isset($levels[$err['level']])) { + $level = $levels[$err['level']]; + } else { + $level = PEAR_LOG_INFO; + } + $logger->log($err['message'], $level, $err); + } else { // support non-standard logs + call_user_func($logger, $err); + } + } + + + /** + * Pop an error off of the error stack + * + * @return false|array + * @since 0.4alpha it is no longer possible to specify a specific error + * level to return - the last error pushed will be returned, instead + */ + function pop() + { + $err = @array_shift($this->_errors); + if (!is_null($err)) { + @array_pop($this->_errorsByLevel[$err['level']]); + if (!count($this->_errorsByLevel[$err['level']])) { + unset($this->_errorsByLevel[$err['level']]); + } + } + return $err; + } + + /** + * Pop an error off of the error stack, static method + * + * @param string package name + * @return boolean + * @since PEAR1.5.0a1 + */ + static function staticPop($package) + { + if ($package) { + if (!isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { + return false; + } + return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->pop(); + } + } + + /** + * Determine whether there are any errors on the stack + * @param string|array Level name. Use to determine if any errors + * of level (string), or levels (array) have been pushed + * @return boolean + */ + function hasErrors($level = false) + { + if ($level) { + return isset($this->_errorsByLevel[$level]); + } + return count($this->_errors); + } + + /** + * Retrieve all errors since last purge + * + * @param boolean set in order to empty the error stack + * @param string level name, to return only errors of a particular severity + * @return array + */ + function getErrors($purge = false, $level = false) + { + if (!$purge) { + if ($level) { + if (!isset($this->_errorsByLevel[$level])) { + return array(); + } else { + return $this->_errorsByLevel[$level]; + } + } else { + return $this->_errors; + } + } + if ($level) { + $ret = $this->_errorsByLevel[$level]; + foreach ($this->_errorsByLevel[$level] as $i => $unused) { + // entries are references to the $_errors array + $this->_errorsByLevel[$level][$i] = false; + } + // array_filter removes all entries === false + $this->_errors = array_filter($this->_errors); + unset($this->_errorsByLevel[$level]); + return $ret; + } + $ret = $this->_errors; + $this->_errors = array(); + $this->_errorsByLevel = array(); + return $ret; + } + + /** + * Determine whether there are any errors on a single error stack, or on any error stack + * + * The optional parameter can be used to test the existence of any errors without the need of + * singleton instantiation + * @param string|false Package name to check for errors + * @param string Level name to check for a particular severity + * @return boolean + */ + public static function staticHasErrors($package = false, $level = false) + { + if ($package) { + if (!isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { + return false; + } + return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->hasErrors($level); + } + foreach ($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $obj) { + if ($obj->hasErrors($level)) { + return true; + } + } + return false; + } + + /** + * Get a list of all errors since last purge, organized by package + * @since PEAR 1.4.0dev BC break! $level is now in the place $merge used to be + * @param boolean $purge Set to purge the error stack of existing errors + * @param string $level Set to a level name in order to retrieve only errors of a particular level + * @param boolean $merge Set to return a flat array, not organized by package + * @param array $sortfunc Function used to sort a merged array - default + * sorts by time, and should be good for most cases + * + * @return array + */ + public static function staticGetErrors( + $purge = false, $level = false, $merge = false, + $sortfunc = array('PEAR_ErrorStack', '_sortErrors') + ) { + $ret = array(); + if (!is_callable($sortfunc)) { + $sortfunc = array('PEAR_ErrorStack', '_sortErrors'); + } + foreach ($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $obj) { + $test = $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->getErrors($purge, $level); + if ($test) { + if ($merge) { + $ret = array_merge($ret, $test); + } else { + $ret[$package] = $test; + } + } + } + if ($merge) { + usort($ret, $sortfunc); + } + return $ret; + } + + /** + * Error sorting function, sorts by time + * @access private + */ + public static function _sortErrors($a, $b) + { + if ($a['time'] == $b['time']) { + return 0; + } + if ($a['time'] < $b['time']) { + return 1; + } + return -1; + } + + /** + * Standard file/line number/function/class context callback + * + * This function uses a backtrace generated from {@link debug_backtrace()} + * and so will not work at all in PHP < 4.3.0. The frame should + * reference the frame that contains the source of the error. + * @return array|false either array('file' => file, 'line' => line, + * 'function' => function name, 'class' => class name) or + * if this doesn't work, then false + * @param unused + * @param integer backtrace frame. + * @param array Results of debug_backtrace() + */ + public static function getFileLine($code, $params, $backtrace = null) + { + if ($backtrace === null) { + return false; + } + $frame = 0; + $functionframe = 1; + if (!isset($backtrace[1])) { + $functionframe = 0; + } else { + while (isset($backtrace[$functionframe]['function']) && + $backtrace[$functionframe]['function'] == 'eval' && + isset($backtrace[$functionframe + 1])) { + $functionframe++; + } + } + if (isset($backtrace[$frame])) { + if (!isset($backtrace[$frame]['file'])) { + $frame++; + } + $funcbacktrace = $backtrace[$functionframe]; + $filebacktrace = $backtrace[$frame]; + $ret = array('file' => $filebacktrace['file'], + 'line' => $filebacktrace['line']); + // rearrange for eval'd code or create function errors + if (strpos($filebacktrace['file'], '(') && + preg_match(';^(.*?)\((\d+)\) : (.*?)\\z;', $filebacktrace['file'], + $matches)) { + $ret['file'] = $matches[1]; + $ret['line'] = $matches[2] + 0; + } + if (isset($funcbacktrace['function']) && isset($backtrace[1])) { + if ($funcbacktrace['function'] != 'eval') { + if ($funcbacktrace['function'] == '__lambda_func') { + $ret['function'] = 'create_function() code'; + } else { + $ret['function'] = $funcbacktrace['function']; + } + } + } + if (isset($funcbacktrace['class']) && isset($backtrace[1])) { + $ret['class'] = $funcbacktrace['class']; + } + return $ret; + } + return false; + } + + /** + * Standard error message generation callback + * + * This method may also be called by a custom error message generator + * to fill in template values from the params array, simply + * set the third parameter to the error message template string to use + * + * The special variable %__msg% is reserved: use it only to specify + * where a message passed in by the user should be placed in the template, + * like so: + * + * Error message: %msg% - internal error + * + * If the message passed like so: + * + * + * $stack->push(ERROR_CODE, 'error', array(), 'server error 500'); + * + * + * The returned error message will be "Error message: server error 500 - + * internal error" + * @param PEAR_ErrorStack + * @param array + * @param string|false Pre-generated error message template + * + * @return string + */ + public static function getErrorMessage(&$stack, $err, $template = false) + { + if ($template) { + $mainmsg = $template; + } else { + $mainmsg = $stack->getErrorMessageTemplate($err['code']); + } + $mainmsg = str_replace('%__msg%', $err['message'], $mainmsg); + if (is_array($err['params']) && count($err['params'])) { + foreach ($err['params'] as $name => $val) { + if (is_array($val)) { + // @ is needed in case $val is a multi-dimensional array + $val = @implode(', ', $val); + } + if (is_object($val)) { + if (method_exists($val, '__toString')) { + $val = $val->__toString(); + } else { + PEAR_ErrorStack::staticPush('PEAR_ErrorStack', PEAR_ERRORSTACK_ERR_OBJTOSTRING, + 'warning', array('obj' => get_class($val)), + 'object %obj% passed into getErrorMessage, but has no __toString() method'); + $val = 'Object'; + } + } + $mainmsg = str_replace('%' . $name . '%', $val, $mainmsg); + } + } + return $mainmsg; + } + + /** + * Standard Error Message Template generator from code + * @return string + */ + function getErrorMessageTemplate($code) + { + if (!isset($this->_errorMsgs[$code])) { + return '%__msg%'; + } + return $this->_errorMsgs[$code]; + } + + /** + * Set the Error Message Template array + * + * The array format must be: + *
    +     * array(error code => 'message template',...)
    +     * 
    + * + * Error message parameters passed into {@link push()} will be used as input + * for the error message. If the template is 'message %foo% was %bar%', and the + * parameters are array('foo' => 'one', 'bar' => 'six'), the error message returned will + * be 'message one was six' + * @return string + */ + function setErrorMessageTemplate($template) + { + $this->_errorMsgs = $template; + } + + + /** + * emulate PEAR::raiseError() + * + * @return PEAR_Error + */ + function raiseError() + { + require_once 'PEAR.php'; + $args = func_get_args(); + return call_user_func_array(array('PEAR', 'raiseError'), $args); + } +} +$stack = &PEAR_ErrorStack::singleton('PEAR_ErrorStack'); +$stack->pushCallback(array('PEAR_ErrorStack', '_handleError')); +?> diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear-core-minimal/src/System.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear-core-minimal/src/System.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,628 @@ + + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR.php'; +require_once 'Console/Getopt.php'; + +$GLOBALS['_System_temp_files'] = array(); + +/** +* System offers cross platform compatible system functions +* +* Static functions for different operations. Should work under +* Unix and Windows. The names and usage has been taken from its respectively +* GNU commands. The functions will return (bool) false on error and will +* trigger the error with the PHP trigger_error() function (you can silence +* the error by prefixing a '@' sign after the function call, but this +* is not recommended practice. Instead use an error handler with +* {@link set_error_handler()}). +* +* Documentation on this class you can find in: +* http://pear.php.net/manual/ +* +* Example usage: +* if (!@System::rm('-r file1 dir1')) { +* print "could not delete file1 or dir1"; +* } +* +* In case you need to to pass file names with spaces, +* pass the params as an array: +* +* System::rm(array('-r', $file1, $dir1)); +* +* @category pear +* @package System +* @author Tomas V.V. Cox +* @copyright 1997-2006 The PHP Group +* @license http://opensource.org/licenses/bsd-license.php New BSD License +* @version Release: @package_version@ +* @link http://pear.php.net/package/PEAR +* @since Class available since Release 0.1 +* @static +*/ +class System +{ + /** + * returns the commandline arguments of a function + * + * @param string $argv the commandline + * @param string $short_options the allowed option short-tags + * @param string $long_options the allowed option long-tags + * @return array the given options and there values + */ + public static function _parseArgs($argv, $short_options, $long_options = null) + { + if (!is_array($argv) && $argv !== null) { + /* + // Quote all items that are a short option + $av = preg_split('/(\A| )--?[a-z0-9]+[ =]?((? $a) { + if (empty($a)) { + continue; + } + $argv[$k] = trim($a) ; + } + } + + return Console_Getopt::getopt2($argv, $short_options, $long_options); + } + + /** + * Output errors with PHP trigger_error(). You can silence the errors + * with prefixing a "@" sign to the function call: @System::mkdir(..); + * + * @param mixed $error a PEAR error or a string with the error message + * @return bool false + */ + protected static function raiseError($error) + { + if (PEAR::isError($error)) { + $error = $error->getMessage(); + } + trigger_error($error, E_USER_WARNING); + return false; + } + + /** + * Creates a nested array representing the structure of a directory + * + * System::_dirToStruct('dir1', 0) => + * Array + * ( + * [dirs] => Array + * ( + * [0] => dir1 + * ) + * + * [files] => Array + * ( + * [0] => dir1/file2 + * [1] => dir1/file3 + * ) + * ) + * @param string $sPath Name of the directory + * @param integer $maxinst max. deep of the lookup + * @param integer $aktinst starting deep of the lookup + * @param bool $silent if true, do not emit errors. + * @return array the structure of the dir + */ + protected static function _dirToStruct($sPath, $maxinst, $aktinst = 0, $silent = false) + { + $struct = array('dirs' => array(), 'files' => array()); + if (($dir = @opendir($sPath)) === false) { + if (!$silent) { + System::raiseError("Could not open dir $sPath"); + } + return $struct; // XXX could not open error + } + + $struct['dirs'][] = $sPath = realpath($sPath); // XXX don't add if '.' or '..' ? + $list = array(); + while (false !== ($file = readdir($dir))) { + if ($file != '.' && $file != '..') { + $list[] = $file; + } + } + + closedir($dir); + natsort($list); + if ($aktinst < $maxinst || $maxinst == 0) { + foreach ($list as $val) { + $path = $sPath . DIRECTORY_SEPARATOR . $val; + if (is_dir($path) && !is_link($path)) { + $tmp = System::_dirToStruct($path, $maxinst, $aktinst+1, $silent); + $struct = array_merge_recursive($struct, $tmp); + } else { + $struct['files'][] = $path; + } + } + } + + return $struct; + } + + /** + * Creates a nested array representing the structure of a directory and files + * + * @param array $files Array listing files and dirs + * @return array + * @static + * @see System::_dirToStruct() + */ + protected static function _multipleToStruct($files) + { + $struct = array('dirs' => array(), 'files' => array()); + settype($files, 'array'); + foreach ($files as $file) { + if (is_dir($file) && !is_link($file)) { + $tmp = System::_dirToStruct($file, 0); + $struct = array_merge_recursive($tmp, $struct); + } else { + if (!in_array($file, $struct['files'])) { + $struct['files'][] = $file; + } + } + } + return $struct; + } + + /** + * The rm command for removing files. + * Supports multiple files and dirs and also recursive deletes + * + * @param string $args the arguments for rm + * @return mixed PEAR_Error or true for success + * @static + * @access public + */ + public static function rm($args) + { + $opts = System::_parseArgs($args, 'rf'); // "f" does nothing but I like it :-) + if (PEAR::isError($opts)) { + return System::raiseError($opts); + } + foreach ($opts[0] as $opt) { + if ($opt[0] == 'r') { + $do_recursive = true; + } + } + $ret = true; + if (isset($do_recursive)) { + $struct = System::_multipleToStruct($opts[1]); + foreach ($struct['files'] as $file) { + if (!@unlink($file)) { + $ret = false; + } + } + + rsort($struct['dirs']); + foreach ($struct['dirs'] as $dir) { + if (!@rmdir($dir)) { + $ret = false; + } + } + } else { + foreach ($opts[1] as $file) { + $delete = (is_dir($file)) ? 'rmdir' : 'unlink'; + if (!@$delete($file)) { + $ret = false; + } + } + } + return $ret; + } + + /** + * Make directories. + * + * The -p option will create parent directories + * @param string $args the name of the director(y|ies) to create + * @return bool True for success + */ + public static function mkDir($args) + { + $opts = System::_parseArgs($args, 'pm:'); + if (PEAR::isError($opts)) { + return System::raiseError($opts); + } + + $mode = 0777; // default mode + foreach ($opts[0] as $opt) { + if ($opt[0] == 'p') { + $create_parents = true; + } elseif ($opt[0] == 'm') { + // if the mode is clearly an octal number (starts with 0) + // convert it to decimal + if (strlen($opt[1]) && $opt[1]{0} == '0') { + $opt[1] = octdec($opt[1]); + } else { + // convert to int + $opt[1] += 0; + } + $mode = $opt[1]; + } + } + + $ret = true; + if (isset($create_parents)) { + foreach ($opts[1] as $dir) { + $dirstack = array(); + while ((!file_exists($dir) || !is_dir($dir)) && + $dir != DIRECTORY_SEPARATOR) { + array_unshift($dirstack, $dir); + $dir = dirname($dir); + } + + while ($newdir = array_shift($dirstack)) { + if (!is_writeable(dirname($newdir))) { + $ret = false; + break; + } + + if (!mkdir($newdir, $mode)) { + $ret = false; + } + } + } + } else { + foreach($opts[1] as $dir) { + if ((@file_exists($dir) || !is_dir($dir)) && !mkdir($dir, $mode)) { + $ret = false; + } + } + } + + return $ret; + } + + /** + * Concatenate files + * + * Usage: + * 1) $var = System::cat('sample.txt test.txt'); + * 2) System::cat('sample.txt test.txt > final.txt'); + * 3) System::cat('sample.txt test.txt >> final.txt'); + * + * Note: as the class use fopen, urls should work also + * + * @param string $args the arguments + * @return boolean true on success + */ + public static function &cat($args) + { + $ret = null; + $files = array(); + if (!is_array($args)) { + $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY); + } + + $count_args = count($args); + for ($i = 0; $i < $count_args; $i++) { + if ($args[$i] == '>') { + $mode = 'wb'; + $outputfile = $args[$i+1]; + break; + } elseif ($args[$i] == '>>') { + $mode = 'ab+'; + $outputfile = $args[$i+1]; + break; + } else { + $files[] = $args[$i]; + } + } + $outputfd = false; + if (isset($mode)) { + if (!$outputfd = fopen($outputfile, $mode)) { + $err = System::raiseError("Could not open $outputfile"); + return $err; + } + $ret = true; + } + foreach ($files as $file) { + if (!$fd = fopen($file, 'r')) { + System::raiseError("Could not open $file"); + continue; + } + while ($cont = fread($fd, 2048)) { + if (is_resource($outputfd)) { + fwrite($outputfd, $cont); + } else { + $ret .= $cont; + } + } + fclose($fd); + } + if (is_resource($outputfd)) { + fclose($outputfd); + } + return $ret; + } + + /** + * Creates temporary files or directories. This function will remove + * the created files when the scripts finish its execution. + * + * Usage: + * 1) $tempfile = System::mktemp("prefix"); + * 2) $tempdir = System::mktemp("-d prefix"); + * 3) $tempfile = System::mktemp(); + * 4) $tempfile = System::mktemp("-t /var/tmp prefix"); + * + * prefix -> The string that will be prepended to the temp name + * (defaults to "tmp"). + * -d -> A temporary dir will be created instead of a file. + * -t -> The target dir where the temporary (file|dir) will be created. If + * this param is missing by default the env vars TMP on Windows or + * TMPDIR in Unix will be used. If these vars are also missing + * c:\windows\temp or /tmp will be used. + * + * @param string $args The arguments + * @return mixed the full path of the created (file|dir) or false + * @see System::tmpdir() + */ + public static function mktemp($args = null) + { + static $first_time = true; + $opts = System::_parseArgs($args, 't:d'); + if (PEAR::isError($opts)) { + return System::raiseError($opts); + } + + foreach ($opts[0] as $opt) { + if ($opt[0] == 'd') { + $tmp_is_dir = true; + } elseif ($opt[0] == 't') { + $tmpdir = $opt[1]; + } + } + + $prefix = (isset($opts[1][0])) ? $opts[1][0] : 'tmp'; + if (!isset($tmpdir)) { + $tmpdir = System::tmpdir(); + } + + if (!System::mkDir(array('-p', $tmpdir))) { + return false; + } + + $tmp = tempnam($tmpdir, $prefix); + if (isset($tmp_is_dir)) { + unlink($tmp); // be careful possible race condition here + if (!mkdir($tmp, 0700)) { + return System::raiseError("Unable to create temporary directory $tmpdir"); + } + } + + $GLOBALS['_System_temp_files'][] = $tmp; + if (isset($tmp_is_dir)) { + //$GLOBALS['_System_temp_files'][] = dirname($tmp); + } + + if ($first_time) { + PEAR::registerShutdownFunc(array('System', '_removeTmpFiles')); + $first_time = false; + } + + return $tmp; + } + + /** + * Remove temporary files created my mkTemp. This function is executed + * at script shutdown time + */ + public static function _removeTmpFiles() + { + if (count($GLOBALS['_System_temp_files'])) { + $delete = $GLOBALS['_System_temp_files']; + array_unshift($delete, '-r'); + System::rm($delete); + $GLOBALS['_System_temp_files'] = array(); + } + } + + /** + * Get the path of the temporal directory set in the system + * by looking in its environments variables. + * Note: php.ini-recommended removes the "E" from the variables_order setting, + * making unavaible the $_ENV array, that s why we do tests with _ENV + * + * @return string The temporary directory on the system + */ + public static function tmpdir() + { + if (OS_WINDOWS) { + if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) { + return $var; + } + if ($var = isset($_ENV['TEMP']) ? $_ENV['TEMP'] : getenv('TEMP')) { + return $var; + } + if ($var = isset($_ENV['USERPROFILE']) ? $_ENV['USERPROFILE'] : getenv('USERPROFILE')) { + return $var; + } + if ($var = isset($_ENV['windir']) ? $_ENV['windir'] : getenv('windir')) { + return $var; + } + return getenv('SystemRoot') . '\temp'; + } + if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) { + return $var; + } + return realpath('/tmp'); + } + + /** + * The "which" command (show the full path of a command) + * + * @param string $program The command to search for + * @param mixed $fallback Value to return if $program is not found + * + * @return mixed A string with the full path or false if not found + * @author Stig Bakken + */ + public static function which($program, $fallback = false) + { + // enforce API + if (!is_string($program) || '' == $program) { + return $fallback; + } + + // full path given + if (basename($program) != $program) { + $path_elements[] = dirname($program); + $program = basename($program); + } else { + $path = getenv('PATH'); + if (!$path) { + $path = getenv('Path'); // some OSes are just stupid enough to do this + } + + $path_elements = explode(PATH_SEPARATOR, $path); + } + + if (OS_WINDOWS) { + $exe_suffixes = getenv('PATHEXT') + ? explode(PATH_SEPARATOR, getenv('PATHEXT')) + : array('.exe','.bat','.cmd','.com'); + // allow passing a command.exe param + if (strpos($program, '.') !== false) { + array_unshift($exe_suffixes, ''); + } + } else { + $exe_suffixes = array(''); + } + + foreach ($exe_suffixes as $suff) { + foreach ($path_elements as $dir) { + $file = $dir . DIRECTORY_SEPARATOR . $program . $suff; + // It's possible to run a .bat on Windows that is_executable + // would return false for. The is_executable check is meaningless... + if (OS_WINDOWS) { + return $file; + } else { + if (is_executable($file)) { + return $file; + } + } + } + } + return $fallback; + } + + /** + * The "find" command + * + * Usage: + * + * System::find($dir); + * System::find("$dir -type d"); + * System::find("$dir -type f"); + * System::find("$dir -name *.php"); + * System::find("$dir -name *.php -name *.htm*"); + * System::find("$dir -maxdepth 1"); + * + * Params implemented: + * $dir -> Start the search at this directory + * -type d -> return only directories + * -type f -> return only files + * -maxdepth -> max depth of recursion + * -name -> search pattern (bash style). Multiple -name param allowed + * + * @param mixed Either array or string with the command line + * @return array Array of found files + */ + public static function find($args) + { + if (!is_array($args)) { + $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY); + } + $dir = realpath(array_shift($args)); + if (!$dir) { + return array(); + } + $patterns = array(); + $depth = 0; + $do_files = $do_dirs = true; + $args_count = count($args); + for ($i = 0; $i < $args_count; $i++) { + switch ($args[$i]) { + case '-type': + if (in_array($args[$i+1], array('d', 'f'))) { + if ($args[$i+1] == 'd') { + $do_files = false; + } else { + $do_dirs = false; + } + } + $i++; + break; + case '-name': + $name = preg_quote($args[$i+1], '#'); + // our magic characters ? and * have just been escaped, + // so now we change the escaped versions to PCRE operators + $name = strtr($name, array('\?' => '.', '\*' => '.*')); + $patterns[] = '('.$name.')'; + $i++; + break; + case '-maxdepth': + $depth = $args[$i+1]; + break; + } + } + $path = System::_dirToStruct($dir, $depth, 0, true); + if ($do_files && $do_dirs) { + $files = array_merge($path['files'], $path['dirs']); + } elseif ($do_dirs) { + $files = $path['dirs']; + } else { + $files = $path['files']; + } + if (count($patterns)) { + $dsq = preg_quote(DIRECTORY_SEPARATOR, '#'); + $pattern = '#(^|'.$dsq.')'.implode('|', $patterns).'($|'.$dsq.')#'; + $ret = array(); + $files_count = count($files); + for ($i = 0; $i < $files_count; $i++) { + // only search in the part of the file below the current directory + $filepart = basename($files[$i]); + if (preg_match($pattern, $filepart)) { + $ret[] = $files[$i]; + } + } + return $ret; + } + return $files; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear_exception/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear_exception/.gitignore Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,6 @@ +PEAR_Exception*.tgz + +# composer related +composer.lock +composer.phar +vendor diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear_exception/.travis.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear_exception/.travis.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,7 @@ +language: php +php: + - 5.6 + - 5.5 + - 5.4 +script: + - cd tests && phpunit --coverage-text . diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear_exception/LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear_exception/LICENSE Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,27 @@ +Copyright (c) 1997-2009, + Stig Bakken , + Gregory Beaver , + Helgi Þormar Þorbjörnsson , + Tomas V.V.Cox , + Martin Jansen . +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear_exception/PEAR/Exception.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear_exception/PEAR/Exception.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,456 @@ + + * @author Hans Lellelid + * @author Bertrand Mansion + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR_Exception + * @since File available since Release 1.0.0 + */ + + +/** + * Base PEAR_Exception Class + * + * 1) Features: + * + * - Nestable exceptions (throw new PEAR_Exception($msg, $prev_exception)) + * - Definable triggers, shot when exceptions occur + * - Pretty and informative error messages + * - Added more context info available (like class, method or cause) + * - cause can be a PEAR_Exception or an array of mixed + * PEAR_Exceptions/PEAR_ErrorStack warnings + * - callbacks for specific exception classes and their children + * + * 2) Ideas: + * + * - Maybe a way to define a 'template' for the output + * + * 3) Inherited properties from PHP Exception Class: + * + * protected $message + * protected $code + * protected $line + * protected $file + * private $trace + * + * 4) Inherited methods from PHP Exception Class: + * + * __clone + * __construct + * getMessage + * getCode + * getFile + * getLine + * getTraceSafe + * getTraceSafeAsString + * __toString + * + * 5) Usage example + * + * + * require_once 'PEAR/Exception.php'; + * + * class Test { + * function foo() { + * throw new PEAR_Exception('Error Message', ERROR_CODE); + * } + * } + * + * function myLogger($pear_exception) { + * echo $pear_exception->getMessage(); + * } + * // each time a exception is thrown the 'myLogger' will be called + * // (its use is completely optional) + * PEAR_Exception::addObserver('myLogger'); + * $test = new Test; + * try { + * $test->foo(); + * } catch (PEAR_Exception $e) { + * print $e; + * } + * + * + * @category PEAR + * @package PEAR_Exception + * @author Tomas V.V.Cox + * @author Hans Lellelid + * @author Bertrand Mansion + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PEAR_Exception + * @since Class available since Release 1.0.0 + */ +class PEAR_Exception extends Exception +{ + const OBSERVER_PRINT = -2; + const OBSERVER_TRIGGER = -4; + const OBSERVER_DIE = -8; + protected $cause; + private static $_observers = array(); + private static $_uniqueid = 0; + private $_trace; + + /** + * Supported signatures: + * - PEAR_Exception(string $message); + * - PEAR_Exception(string $message, int $code); + * - PEAR_Exception(string $message, Exception $cause); + * - PEAR_Exception(string $message, Exception $cause, int $code); + * - PEAR_Exception(string $message, PEAR_Error $cause); + * - PEAR_Exception(string $message, PEAR_Error $cause, int $code); + * - PEAR_Exception(string $message, array $causes); + * - PEAR_Exception(string $message, array $causes, int $code); + * + * @param string $message exception message + * @param int|Exception|PEAR_Error|array|null $p2 exception cause + * @param int|null $p3 exception code or null + */ + public function __construct($message, $p2 = null, $p3 = null) + { + if (is_int($p2)) { + $code = $p2; + $this->cause = null; + } elseif (is_object($p2) || is_array($p2)) { + // using is_object allows both Exception and PEAR_Error + if (is_object($p2) && !($p2 instanceof Exception)) { + if (!class_exists('PEAR_Error') || !($p2 instanceof PEAR_Error)) { + throw new PEAR_Exception( + 'exception cause must be Exception, ' . + 'array, or PEAR_Error' + ); + } + } + $code = $p3; + if (is_array($p2) && isset($p2['message'])) { + // fix potential problem of passing in a single warning + $p2 = array($p2); + } + $this->cause = $p2; + } else { + $code = null; + $this->cause = null; + } + parent::__construct($message, $code); + $this->signal(); + } + + /** + * Add an exception observer + * + * @param mixed $callback - A valid php callback, see php func is_callable() + * - A PEAR_Exception::OBSERVER_* constant + * - An array(const PEAR_Exception::OBSERVER_*, + * mixed $options) + * @param string $label The name of the observer. Use this if you want + * to remove it later with removeObserver() + * + * @return void + */ + public static function addObserver($callback, $label = 'default') + { + self::$_observers[$label] = $callback; + } + + /** + * Remove an exception observer + * + * @param string $label Name of the observer + * + * @return void + */ + public static function removeObserver($label = 'default') + { + unset(self::$_observers[$label]); + } + + /** + * Generate a unique ID for an observer + * + * @return int unique identifier for an observer + */ + public static function getUniqueId() + { + return self::$_uniqueid++; + } + + /** + * Send a signal to all observers + * + * @return void + */ + protected function signal() + { + foreach (self::$_observers as $func) { + if (is_callable($func)) { + call_user_func($func, $this); + continue; + } + settype($func, 'array'); + switch ($func[0]) { + case self::OBSERVER_PRINT : + $f = (isset($func[1])) ? $func[1] : '%s'; + printf($f, $this->getMessage()); + break; + case self::OBSERVER_TRIGGER : + $f = (isset($func[1])) ? $func[1] : E_USER_NOTICE; + trigger_error($this->getMessage(), $f); + break; + case self::OBSERVER_DIE : + $f = (isset($func[1])) ? $func[1] : '%s'; + die(printf($f, $this->getMessage())); + break; + default: + trigger_error('invalid observer type', E_USER_WARNING); + } + } + } + + /** + * Return specific error information that can be used for more detailed + * error messages or translation. + * + * This method may be overridden in child exception classes in order + * to add functionality not present in PEAR_Exception and is a placeholder + * to define API + * + * The returned array must be an associative array of parameter => value like so: + *
    +     * array('name' => $name, 'context' => array(...))
    +     * 
    + * + * @return array + */ + public function getErrorData() + { + return array(); + } + + /** + * Returns the exception that caused this exception to be thrown + * + * @return Exception|array The context of the exception + */ + public function getCause() + { + return $this->cause; + } + + /** + * Function must be public to call on caused exceptions + * + * @param array $causes Array that gets filled. + * + * @return void + */ + public function getCauseMessage(&$causes) + { + $trace = $this->getTraceSafe(); + $cause = array('class' => get_class($this), + 'message' => $this->message, + 'file' => 'unknown', + 'line' => 'unknown'); + if (isset($trace[0])) { + if (isset($trace[0]['file'])) { + $cause['file'] = $trace[0]['file']; + $cause['line'] = $trace[0]['line']; + } + } + $causes[] = $cause; + if ($this->cause instanceof PEAR_Exception) { + $this->cause->getCauseMessage($causes); + } elseif ($this->cause instanceof Exception) { + $causes[] = array('class' => get_class($this->cause), + 'message' => $this->cause->getMessage(), + 'file' => $this->cause->getFile(), + 'line' => $this->cause->getLine()); + } elseif (class_exists('PEAR_Error') && $this->cause instanceof PEAR_Error) { + $causes[] = array('class' => get_class($this->cause), + 'message' => $this->cause->getMessage(), + 'file' => 'unknown', + 'line' => 'unknown'); + } elseif (is_array($this->cause)) { + foreach ($this->cause as $cause) { + if ($cause instanceof PEAR_Exception) { + $cause->getCauseMessage($causes); + } elseif ($cause instanceof Exception) { + $causes[] = array('class' => get_class($cause), + 'message' => $cause->getMessage(), + 'file' => $cause->getFile(), + 'line' => $cause->getLine()); + } elseif (class_exists('PEAR_Error') + && $cause instanceof PEAR_Error + ) { + $causes[] = array('class' => get_class($cause), + 'message' => $cause->getMessage(), + 'file' => 'unknown', + 'line' => 'unknown'); + } elseif (is_array($cause) && isset($cause['message'])) { + // PEAR_ErrorStack warning + $causes[] = array( + 'class' => $cause['package'], + 'message' => $cause['message'], + 'file' => isset($cause['context']['file']) ? + $cause['context']['file'] : + 'unknown', + 'line' => isset($cause['context']['line']) ? + $cause['context']['line'] : + 'unknown', + ); + } + } + } + } + + /** + * Build a backtrace and return it + * + * @return array Backtrace + */ + public function getTraceSafe() + { + if (!isset($this->_trace)) { + $this->_trace = $this->getTrace(); + if (empty($this->_trace)) { + $backtrace = debug_backtrace(); + $this->_trace = array($backtrace[count($backtrace)-1]); + } + } + return $this->_trace; + } + + /** + * Gets the first class of the backtrace + * + * @return string Class name + */ + public function getErrorClass() + { + $trace = $this->getTraceSafe(); + return $trace[0]['class']; + } + + /** + * Gets the first method of the backtrace + * + * @return string Method/function name + */ + public function getErrorMethod() + { + $trace = $this->getTraceSafe(); + return $trace[0]['function']; + } + + /** + * Converts the exception to a string (HTML or plain text) + * + * @return string String representation + * + * @see toHtml() + * @see toText() + */ + public function __toString() + { + if (isset($_SERVER['REQUEST_URI'])) { + return $this->toHtml(); + } + return $this->toText(); + } + + /** + * Generates a HTML representation of the exception + * + * @return string HTML code + */ + public function toHtml() + { + $trace = $this->getTraceSafe(); + $causes = array(); + $this->getCauseMessage($causes); + $html = '' . "\n"; + foreach ($causes as $i => $cause) { + $html .= '\n"; + } + $html .= '' . "\n" + . '' + . '' + . '' . "\n"; + + foreach ($trace as $k => $v) { + $html .= '' + . '' + . '' . "\n"; + } + $html .= '' + . '' + . '' . "\n" + . '
    ' + . str_repeat('-', $i) . ' ' . $cause['class'] . ': ' + . htmlspecialchars($cause['message']) + . ' in ' . $cause['file'] . ' ' + . 'on line ' . $cause['line'] . '' + . "
    Exception trace
    #FunctionLocation
    ' . $k . ''; + if (!empty($v['class'])) { + $html .= $v['class'] . $v['type']; + } + $html .= $v['function']; + $args = array(); + if (!empty($v['args'])) { + foreach ($v['args'] as $arg) { + if (is_null($arg)) { + $args[] = 'null'; + } else if (is_array($arg)) { + $args[] = 'Array'; + } else if (is_object($arg)) { + $args[] = 'Object('.get_class($arg).')'; + } else if (is_bool($arg)) { + $args[] = $arg ? 'true' : 'false'; + } else if (is_int($arg) || is_double($arg)) { + $args[] = $arg; + } else { + $arg = (string)$arg; + $str = htmlspecialchars(substr($arg, 0, 16)); + if (strlen($arg) > 16) { + $str .= '…'; + } + $args[] = "'" . $str . "'"; + } + } + } + $html .= '(' . implode(', ', $args) . ')' + . '' . (isset($v['file']) ? $v['file'] : 'unknown') + . ':' . (isset($v['line']) ? $v['line'] : 'unknown') + . '
    ' . ($k+1) . '{main} 
    '; + return $html; + } + + /** + * Generates text representation of the exception and stack trace + * + * @return string + */ + public function toText() + { + $causes = array(); + $this->getCauseMessage($causes); + $causeMsg = ''; + foreach ($causes as $i => $cause) { + $causeMsg .= str_repeat(' ', $i) . $cause['class'] . ': ' + . $cause['message'] . ' in ' . $cause['file'] + . ' on line ' . $cause['line'] . "\n"; + } + return $causeMsg . $this->getTraceAsString(); + } +} +?> diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear_exception/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear_exception/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,43 @@ +{ + "name": "pear/pear_exception", + "description": "The PEAR Exception base class.", + "type": "class", + "keywords": [ + "exception" + ], + "homepage": "https://github.com/pear/PEAR_Exception", + "license": "BSD-2-Clause", + "authors": [ + { + "name": "Helgi Thormar", + "email": "dufuz@php.net" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net" + } + ], + "require": { + "php": ">=4.4.0" + }, + "autoload": { + "psr-0": { + "PEAR": "" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "include-path": [ + "." + ], + "support": { + "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PEAR_Exception", + "source": "https://github.com/pear/PEAR_Exception" + }, + "require-dev": { + "phpunit/phpunit": "*" + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear_exception/package.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear_exception/package.xml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,120 @@ + + + PEAR_Exception + pear.php.net + The PEAR Exception base class + PEAR_Exception PHP5 error handling mechanism + + + Christian Weiske + cweiske + cweiske@php.net + yes + + + Helgi Thormar + dufuz + dufuz@php.net + no + + + Greg Beaver + cellog + cellog@php.net + no + + + 2015-02-10 + + + 1.0.0 + 1.0.0 + + + stable + stable + + New BSD License + + This package was split out from the PEAR package. + If you use PEAR_Exception in your package and use nothing from the PEAR package + then it's better to depend on just PEAR_Exception. + + + + + + + + + + + + + + + + + + 5.4.0 + + + 1.9.5 + + + + + + + + + + 1.0.0 + 1.0.0 + + + stable + stable + + 2015-02-10 + New BSD License + Release stable version + + + + + 1.0.0beta2 + 1.0.0 + + + beta + stable + + 2014-02-21 + New BSD License + Bump up PEAR dependency. + + + + + 1.0.0beta1 + 1.0.0 + + + beta + stable + + 2012-05-10 + New BSD License + +This packge was split out from the PEAR package. If you use PEAR_Exception in your package +and use nothing from the PEAR package then it's better to depend on just PEAR_Exception. + + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/pear/pear_exception/tests/PEAR/ExceptionTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/pear_exception/tests/PEAR/ExceptionTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,78 @@ +assertNull($e->getCause()); + } + + public function testGetCauseException() + { + $cause = new Exception('foo bar'); + $e = new PEAR_Exception('I caught an exception', $cause); + $this->assertNotNull($e->getCause()); + $this->assertInstanceOf('Exception', $e->getCause()); + $this->assertEquals($cause, $e->getCause()); + } + + public function testGetCauseMessage() + { + $cause = new Exception('foo bar'); + $e = new PEAR_Exception('I caught an exception', $cause); + + $e->getCauseMessage($causes); + $this->assertEquals('I caught an exception', $causes[0]['message']); + $this->assertEquals('foo bar', $causes[1]['message']); + } + + public function testGetTraceSafe() + { + $e = new PEAR_Exception('oops'); + $this->assertInternalType('array', $e->getTraceSafe()); + } + + public function testGetErrorClass() + { + $e = new PEAR_Exception('oops'); + $this->assertEquals('PEAR_ExceptionTest', $e->getErrorClass()); + } + + public function testGetErrorMethod() + { + $e = new PEAR_Exception('oops'); + $this->assertEquals('testGetErrorMethod', $e->getErrorMethod()); + } + + public function test__toString() + { + $e = new PEAR_Exception('oops'); + $this->assertInternalType('string', (string) $e); + $this->assertContains('oops', (string) $e); + } + + public function testToHtml() + { + $e = new PEAR_Exception('oops'); + $html = $e->toHtml(); + $this->assertInternalType('string', $html); + $this->assertContains('oops', $html); + } +} +?> diff -r 129ea1e6d783 -r af1871eacc83 vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php Thu May 09 15:33:08 2019 +0100 @@ -57,7 +57,7 @@ Assert::stringNotEmpty($name); Assert::notNull($descriptionFactory); - $description = $descriptionFactory && $body ? $descriptionFactory->create($body, $context) : null; + $description = $descriptionFactory && $body !== "" ? $descriptionFactory->create($body, $context) : null; return new static($name, $description); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/README.md --- a/vendor/squizlabs/php_codesniffer/README.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/README.md Thu May 09 15:33:08 2019 +0100 @@ -8,6 +8,9 @@ PHP\_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements. +If you're using PHP_CodeSniffer as part of a team, or you're running it on a [CI](https://en.wikipedia.org/wiki/Continuous_integration) server, you may want to configure your project's settings [using a configuration file](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file). + + ## Installation The easiest way to get started with PHP\_CodeSniffer is to download the Phar files for each of the commands: @@ -99,7 +102,7 @@ - backwards-compatible changes are made to the API used by sniff developers, or - new sniffs are added to an included standard -> NOTE: Backwards-compatible changes to the API used by sniff develpers will allow an existing sniff to continue running without producing fatal errors but may not result in the sniff reporting the same errors as it did previously without changes being required. +> NOTE: Backwards-compatible changes to the API used by sniff developers will allow an existing sniff to continue running without producing fatal errors but may not result in the sniff reporting the same errors as it did previously without changes being required. The `PATCH` version is incremented when: - backwards-compatible bug fixes are made diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/autoload.php --- a/vendor/squizlabs/php_codesniffer/autoload.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/autoload.php Thu May 09 15:33:08 2019 +0100 @@ -23,7 +23,7 @@ /** * The composer autoloader. * - * @var Composer\Autoload\ClassLoader + * @var \Composer\Autoload\ClassLoader */ private static $composerAutoloader = null; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/composer.json --- a/vendor/squizlabs/php_codesniffer/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/composer.json Thu May 09 15:33:08 2019 +0100 @@ -6,7 +6,7 @@ "phpcs", "standards" ], - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "license": "BSD-3-Clause", "authors": [ { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/phpcs.xml.dist --- a/vendor/squizlabs/php_codesniffer/phpcs.xml.dist Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/phpcs.xml.dist Thu May 09 15:33:08 2019 +0100 @@ -8,7 +8,8 @@ src tests - */Standards/*/Tests/*\.(inc|css|js) + */src/Standards/*/Tests/*\.(inc|css|js)$ + */tests/Core/*/*Test\.(inc|css|js)$ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/phpstan.neon --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/phpstan.neon Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ +parameters: + ignoreErrors: + - + message: '~^Undefined variable: \$phpCodeSnifferConfig$~' + path: %currentWorkingDirectory%/src/Config.php + + dynamicConstantNames: + - PHP_CODESNIFFER_IN_TESTS + - PHP_CODESNIFFER_CBF + - PHP_CODESNIFFER_VERBOSITY + + excludes_analyse: + - */Tests/* diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/scripts/ValidatePEAR/FileList.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/scripts/ValidatePEAR/FileList.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,99 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +/** + * Class to create a file list with filtering. + */ +class FileList +{ + + /** + * The path to the project root directory. + * + * @var string + */ + protected $rootPath; + + /** + * Recursive directory iterator. + * + * @var \DirectoryIterator + */ + protected $fileIterator; + + /** + * Base regex to use if no filter regex is provided. + * + * Matches based on: + * - File path starts with the project root (replacement done in constructor). + * - Don't match .git/ files. + * - Don't match dot files, i.e. "." or "..". + * - Don't match backup files. + * - Match everything else in a case-insensitive manner. + * + * @var string + */ + private $baseRegex = '`^%s(?!\.git/)(?!(.*/)?\.+$)(?!.*\.(bak|orig)).*$`Dix'; + + + /** + * Constructor. + * + * @param string $directory The directory to examine. + * @param string $rootPath Path to the project root. + * @param string $filter PCRE regular expression to filter the file list with. + */ + public function __construct($directory, $rootPath='', $filter='') + { + $this->rootPath = $rootPath; + + $directory = new \RecursiveDirectoryIterator( + $directory, + \RecursiveDirectoryIterator::UNIX_PATHS + ); + $flattened = new \RecursiveIteratorIterator( + $directory, + \RecursiveIteratorIterator::LEAVES_ONLY, + \RecursiveIteratorIterator::CATCH_GET_CHILD + ); + + if ($filter === '') { + $filter = sprintf($this->baseRegex, preg_quote($this->rootPath)); + } + + $this->fileIterator = new \RegexIterator($flattened, $filter); + + return $this; + + }//end __construct() + + + /** + * Retrieve the filtered file list as an array. + * + * @return array + */ + public function getList() + { + $fileList = []; + + foreach ($this->fileIterator as $file) { + $fileList[] = str_replace($this->rootPath, '', $file); + } + + return $fileList; + + }//end getList() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/scripts/ValidatePEAR/ValidatePEARPackageXML.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/scripts/ValidatePEAR/ValidatePEARPackageXML.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,360 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +/** + * Validate the PHP_CodeSniffer PEAR package.xml file. + */ +class ValidatePEARPackageXML +{ + + /** + * The root directory of the project. + * + * @var string + */ + protected $projectRoot = ''; + + /** + * The contents of the package.xml file. + * + * @var \SimpleXMLElement + */ + protected $packageXML; + + /** + * List of all files in the repo. + * + * @var array + */ + protected $allFiles = []; + + /** + * Valid file roles. + * + * @var array + * + * @link https://pear.php.net/manual/en/developers.packagedef.intro.php#developers.packagedef.roles + */ + private $validRoles = [ + 'data' => true, + 'doc' => true, + 'ext' => true, + 'extsrc' => true, + 'php' => true, + 'script' => true, + 'src' => true, + 'test' => true, + ]; + + /** + * Files encountered in the package.xml tag. + * + * @var array + */ + private $listedContents = []; + + + /** + * Constructor. + */ + public function __construct() + { + $this->projectRoot = dirname(dirname(__DIR__)).'/'; + $this->packageXML = simplexml_load_file($this->projectRoot.'package.xml'); + + $allFiles = (new FileList($this->projectRoot, $this->projectRoot))->getList(); + $this->allFiles = array_flip($allFiles); + + }//end __construct() + + + /** + * Validate the file listings in the package.xml file. + * + * @return void + */ + public function validate() + { + $exitCode = 0; + if ($this->checkContents() !== true) { + $exitCode = 1; + } + + if ($this->checkPHPRelease() !== true) { + $exitCode = 1; + } + + exit($exitCode); + + }//end validate() + + + /** + * Validate the file listings in the tag. + * + * @return bool + */ + protected function checkContents() + { + echo PHP_EOL.'Checking Contents tag'.PHP_EOL; + echo '====================='.PHP_EOL; + + $valid = true; + + /* + * - Check that every file that is mentioned in the `` tag exists in the repo. + * - Check that the "role" value is valid. + * - Check that the "baseinstalldir" value is valid. + */ + + $valid = $this->walkDirTag($this->packageXML->contents); + if ($valid === true) { + echo "Existing listings in the Contents tag are valid.".PHP_EOL; + } + + /* + * Verify that all files in the `src` and the `tests` directories are listed in the `` tag. + */ + + $srcFiles = (new FileList( + $this->projectRoot.'src/', + $this->projectRoot, + '`\.(css|fixed|inc|js|php|xml)$`Di' + ))->getList(); + $testsFiles = (new FileList( + $this->projectRoot.'tests/', + $this->projectRoot, + '`\.(css|inc|js|php|xml)$`Di' + ))->getList(); + $files = array_merge($srcFiles, $testsFiles); + + foreach ($files as $file) { + if (isset($this->listedContents[$file]) === true) { + continue; + } + + echo "- File '{$file}' is missing from Contents tag.".PHP_EOL; + $valid = false; + } + + if ($valid === true) { + echo "No missing files in the Contents tag.".PHP_EOL; + } + + return $valid; + + }//end checkContents() + + + /** + * Validate all child tags within a tag. + * + * @param \SimpleXMLElement $tag The current XML tag to examine. + * @param string $currentDirectory The complete relative path to the + * directory being examined. + * + * @return bool + */ + protected function walkDirTag($tag, $currentDirectory='') + { + $valid = true; + $name = (string) $tag['name']; + if ($name !== '/' && empty($name) === false) { + $currentDirectory .= $name.'/'; + } + + $children = $tag->children(); + foreach ($children as $key => $value) { + if ($key === 'dir') { + if ($this->walkDirTag($value, $currentDirectory) === false) { + $valid = false; + } + } + + if ($key === 'file') { + if ($this->checkFileTag($value, $currentDirectory) === false) { + $valid = false; + } + } + } + + return $valid; + + }//end walkDirTag() + + + /** + * Validate the information within a tag. + * + * @param \SimpleXMLElement $tag The current XML tag to examine. + * @param string $currentDirectory The complete relative path to the + * directory being examined. + * + * @return bool + */ + protected function checkFileTag($tag, $currentDirectory='') + { + $valid = true; + $attributes = $tag->attributes(); + $baseinstalldir = (string) $attributes['baseinstalldir']; + $name = $currentDirectory.(string) $attributes['name']; + $role = (string) $attributes['role']; + + $this->listedContents[$name] = true; + + if (empty($name) === true) { + echo "- Name attribute missing.".PHP_EOL; + $valid = false; + } else { + if (isset($this->allFiles[$name]) === false) { + echo "- File '{$name}' does not exist.".PHP_EOL; + $valid = false; + } + + if (empty($role) === true) { + echo "- Role attribute missing for file '{$name}'.".PHP_EOL; + $valid = false; + } else { + if (isset($this->validRoles[$role]) === false) { + echo "- Role for file '{$name}' is invalid.".PHP_EOL; + $valid = false; + } else { + // Limited validation of the "role" tags. + if (strpos($name, 'Test.') !== false && $role !== 'test') { + echo "- Test files should have the role 'test'. Found: '$role' for file '{$name}'.".PHP_EOL; + $valid = false; + } else if ((strpos($name, 'Standard.xml') !== false || strpos($name, 'Sniff.php') !== false) + && $role !== 'php' + ) { + echo "- Sniff files, including sniff documentation files should have the role 'php'. Found: '$role' for file '{$name}'.".PHP_EOL; + $valid = false; + } + } + + if (empty($baseinstalldir) === true) { + if ($role !== 'script' && strpos($name, 'tests/') !== 0) { + echo "- Baseinstalldir attribute missing for file '{$name}'.".PHP_EOL; + $valid = false; + } + } else { + if ($role === 'script' || strpos($name, 'tests/') === 0) { + echo "- Baseinstalldir for file '{$name}' should be empty.".PHP_EOL; + $valid = false; + } + + if ($role !== 'script' && $baseinstalldir !== 'PHP/CodeSniffer') { + echo "- Baseinstalldir for file '{$name}' is invalid.".PHP_EOL; + $valid = false; + } + } + }//end if + }//end if + + return $valid; + + }//end checkFileTag() + + + /** + * Validate the file listings in the tags. + * + * @return bool True if the info in the "phprelease" tags is valid. False otherwise. + */ + protected function checkPHPRelease() + { + echo PHP_EOL.'Checking PHPRelease tags'.PHP_EOL; + echo '========================'.PHP_EOL; + + $valid = true; + $listedFiles = []; + $releaseTags = 1; + + /* + * - Check that every file that is mentioned in the `` tags exists in the repo. + * - Check that the "as" value is valid. + */ + + foreach ($this->packageXML->phprelease as $release) { + foreach ($release->filelist->install as $install) { + $attributes = $install->attributes(); + $name = (string) $attributes['name']; + $as = (string) $attributes['as']; + + $listedFiles[$releaseTags][$name] = $as; + + if (empty($as) === true || empty($name) === true) { + continue; + } + + if (isset($this->allFiles[$name]) === false) { + echo "- File '{$name}' does not exist.".PHP_EOL; + $valid = false; + } + + // Rest of the checks only apply to the test files. + if (strpos($name, 'tests/') !== 0) { + continue; + } + + // Check validity of the tags for files in the tests root directory. + if (preg_match('`^tests/([^/]+\.php)$`', $name, $matches) === 1 + && ($as === $name || $as === $matches[1]) + ) { + continue; + } + + // Check validity of the tags for files in the tests root subdirectories. + if (preg_match('`^tests/.+\.(php|inc|js|css|xml)$`', $name) === 1 + && $as === str_replace('tests/', 'CodeSniffer/', $name) + ) { + continue; + } + + echo "- Invalid 'as' attribute '{$as}' for test file '{$name}'.".PHP_EOL; + $valid = false; + }//end foreach + + ++$releaseTags; + }//end foreach + + if ($valid === true) { + echo "Existing PHPRelease tags are valid.".PHP_EOL; + } + + /* + * Verify that all files in the `tests` directory are listed in both `` tags. + */ + + $testFiles = (new FileList($this->projectRoot.'tests/', $this->projectRoot, '`\.(inc|php|js|css|xml)$`Di'))->getList(); + + foreach ($testFiles as $file) { + foreach ($listedFiles as $key => $listed) { + if (isset($listed[$file]) === true) { + continue; + } + + echo "- File '{$file}' is missing from PHPRelease tag [{$key}] .".PHP_EOL; + $valid = false; + } + } + + if ($valid === true) { + echo "No missing PHPRelease tags.".PHP_EOL; + } + + return $valid; + + }//end checkPHPRelease() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/scripts/validate-pear-package.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/scripts/validate-pear-package.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,19 @@ +#!/usr/bin/env php + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +require_once __DIR__.'/ValidatePEAR/FileList.php'; +require_once __DIR__.'/ValidatePEAR/ValidatePEARPackageXML.php'; + +$validate = new ValidatePEARPackageXML(); +$validate->validate(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Config.php --- a/vendor/squizlabs/php_codesniffer/src/Config.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Config.php Thu May 09 15:33:08 2019 +0100 @@ -23,7 +23,7 @@ * * @var string */ - const VERSION = '3.4.0'; + const VERSION = '3.4.2'; /** * Package stability; either stable, beta or alpha. @@ -188,7 +188,7 @@ * @param string $name The name of the property. * * @return mixed - * @throws RuntimeException If the setting name is invalid. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the setting name is invalid. */ public function __get($name) { @@ -208,7 +208,7 @@ * @param mixed $value The value of the property. * * @return void - * @throws RuntimeException If the setting name is invalid. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the setting name is invalid. */ public function __set($name, $value) { @@ -1366,7 +1366,7 @@ echo ' [--standard=] [--sniffs=] [--exclude=]'.PHP_EOL; echo ' [--encoding=] [--parallel=] [--generator=]'.PHP_EOL; echo ' [--extensions=] [--ignore=] [--ignore-annotations]'.PHP_EOL; - echo ' [--stdin-path=] [--file-list=] - ...'.PHP_EOL; + echo ' [--stdin-path=] [--file-list=] [--filter=] - ...'.PHP_EOL; echo PHP_EOL; echo ' - Check STDIN instead of local files and directories'.PHP_EOL; echo ' -n Do not print warnings (shortcut for --warning-severity=0)'.PHP_EOL; @@ -1396,19 +1396,21 @@ echo ' Use a specific file for caching (uses a temporary file by default)'.PHP_EOL; echo ' A path to strip from the front of file paths inside reports'.PHP_EOL; echo ' A comma separated list of files to run before processing begins'.PHP_EOL; - echo ' One or more files and/or directories to check'.PHP_EOL; - echo ' A file containing a list of files and/or directories to check (one per line)'.PHP_EOL; echo ' The encoding of the files being checked (default is utf-8)'.PHP_EOL; echo ' A comma separated list of file extensions to check'.PHP_EOL; echo ' The type of the file can be specified using: ext/type'.PHP_EOL; echo ' e.g., module/php,es/js'.PHP_EOL; + echo ' One or more files and/or directories to check'.PHP_EOL; + echo ' A file containing a list of files and/or directories to check (one per line)'.PHP_EOL; + echo ' Use the "gitmodified" filter, or specify the path to a custom filter class'.PHP_EOL; echo ' Uses either the "HTML", "Markdown" or "Text" generator'.PHP_EOL; echo ' (forces documentation generation instead of checking)'.PHP_EOL; echo ' A comma separated list of patterns to ignore files and directories'.PHP_EOL; echo ' How many files should be checked simultaneously (default is 1)'.PHP_EOL; echo ' Print either the "full", "xml", "checkstyle", "csv"'.PHP_EOL; echo ' "json", "junit", "emacs", "source", "summary", "diff"'.PHP_EOL; - echo ' "svnblame", "gitblame", "hgblame" or "notifysend" report'.PHP_EOL; + echo ' "svnblame", "gitblame", "hgblame" or "notifysend" report,'.PHP_EOL; + echo ' or specify the path to a custom report class'.PHP_EOL; echo ' (the "full" report is printed by default)'.PHP_EOL; echo ' Write the report to the specified file path'.PHP_EOL; echo ' How many columns wide screen reports should be printed'.PHP_EOL; @@ -1435,7 +1437,7 @@ echo ' [--severity=] [--error-severity=] [--warning-severity=]'.PHP_EOL; echo ' [--tab-width=] [--encoding=] [--parallel=]'.PHP_EOL; echo ' [--basepath=] [--extensions=] [--ignore=]'.PHP_EOL; - echo ' [--stdin-path=] [--file-list=] - ...'.PHP_EOL; + echo ' [--stdin-path=] [--file-list=] [--filter=] - ...'.PHP_EOL; echo PHP_EOL; echo ' - Fix STDIN instead of local files and directories'.PHP_EOL; echo ' -n Do not fix warnings (shortcut for --warning-severity=0)'.PHP_EOL; @@ -1455,12 +1457,13 @@ echo PHP_EOL; echo ' A path to strip from the front of file paths inside reports'.PHP_EOL; echo ' A comma separated list of files to run before processing begins'.PHP_EOL; - echo ' One or more files and/or directories to fix'.PHP_EOL; - echo ' A file containing a list of files and/or directories to fix (one per line)'.PHP_EOL; echo ' The encoding of the files being fixed (default is utf-8)'.PHP_EOL; echo ' A comma separated list of file extensions to fix'.PHP_EOL; echo ' The type of the file can be specified using: ext/type'.PHP_EOL; echo ' e.g., module/php,es/js'.PHP_EOL; + echo ' One or more files and/or directories to fix'.PHP_EOL; + echo ' A file containing a list of files and/or directories to fix (one per line)'.PHP_EOL; + echo ' Use the "gitmodified" filter, or specify the path to a custom filter class'.PHP_EOL; echo ' A comma separated list of patterns to ignore files and directories'.PHP_EOL; echo ' How many files should be fixed simultaneously (default is 1)'.PHP_EOL; echo ' The minimum severity required to fix an error or warning'.PHP_EOL; @@ -1555,7 +1558,7 @@ * * @return bool * @see getConfigData() - * @throws RuntimeException If the config file can not be written. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the config file can not be written. */ public static function setConfigData($key, $value, $temp=false) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php --- a/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php Thu May 09 15:33:08 2019 +0100 @@ -9,7 +9,7 @@ namespace PHP_CodeSniffer\Exceptions; -class RuntimeException extends \Exception +class RuntimeException extends \RuntimeException { }//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php --- a/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php Thu May 09 15:33:08 2019 +0100 @@ -54,7 +54,7 @@ $path = $config->stdinPath; } - return parent::__construct($path, $ruleset, $config); + parent::__construct($path, $ruleset, $config); }//end __construct() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Files/File.php --- a/vendor/squizlabs/php_codesniffer/src/Files/File.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Files/File.php Thu May 09 15:33:08 2019 +0100 @@ -27,7 +27,7 @@ public $path = ''; /** - * The absolute path to the file associated with this object. + * The content of the file. * * @var string */ @@ -392,26 +392,13 @@ } else if (substr($commentTextLower, 0, 9) === 'phpcs:set' || substr($commentTextLower, 0, 10) === '@phpcs:set' ) { - // If the @phpcs: syntax is being used, strip the @ to make - // comparisons easier. - if ($commentText[0] === '@') { - $commentText = substr($commentText, 1); - } - - // Need to maintain case here, to get the correct sniff code. - $parts = explode(' ', substr($commentText, 10)); - if (count($parts) >= 2) { - $sniffParts = explode('.', $parts[0]); - if (count($sniffParts) >= 3) { - // If the sniff code is not known to us, it has not been registered in this run. - // But don't throw an error as it could be there for a different standard to use. - if (isset($this->ruleset->sniffCodes[$parts[0]]) === true) { - $listenerCode = array_shift($parts); - $propertyCode = array_shift($parts); - $propertyValue = rtrim(implode(' ', $parts), " */\r\n"); - $listenerClass = $this->ruleset->sniffCodes[$listenerCode]; - $this->ruleset->setSniffProperty($listenerClass, $propertyCode, $propertyValue); - } + if (isset($token['sniffCode']) === true) { + $listenerCode = $token['sniffCode']; + if (isset($this->ruleset->sniffCodes[$listenerCode]) === true) { + $propertyCode = $token['sniffProperty']; + $propertyValue = $token['sniffPropertyValue']; + $listenerClass = $this->ruleset->sniffCodes[$listenerCode]; + $this->ruleset->setSniffProperty($listenerClass, $propertyCode, $propertyValue); } } }//end if @@ -908,9 +895,9 @@ // due to the use of the --sniffs command line argument. if ($includeAll === false && ((empty($this->configCache['sniffs']) === false - && in_array(strtolower($listenerCode), $this->configCache['sniffs']) === false) + && in_array(strtolower($listenerCode), $this->configCache['sniffs'], true) === false) || (empty($this->configCache['exclude']) === false - && in_array(strtolower($listenerCode), $this->configCache['exclude']) === true)) + && in_array(strtolower($listenerCode), $this->configCache['exclude'], true) === true)) ) { return false; } @@ -1134,18 +1121,6 @@ /** - * Returns the number of successes recorded. - * - * @return int - */ - public function getSuccessCount() - { - return $this->successCount; - - }//end getSuccessCount() - - - /** * Returns the number of fixable errors/warnings raised. * * @return int @@ -1991,20 +1966,20 @@ * * Returns false if no token can be found. * - * @param int|array $types The type(s) of tokens to search for. - * @param int $start The position to start searching from in the - * token stack. - * @param int $end The end position to fail if no token is found. - * if not specified or null, end will default to - * the start of the token stack. - * @param bool $exclude If true, find the previous token that is NOT of - * the types specified in $types. - * @param string $value The value that the token(s) must be equal to. - * If value is omitted, tokens with any value will - * be returned. - * @param bool $local If true, tokens outside the current statement - * will not be checked. IE. checking will stop - * at the previous semi-colon found. + * @param int|string|array $types The type(s) of tokens to search for. + * @param int $start The position to start searching from in the + * token stack. + * @param int $end The end position to fail if no token is found. + * if not specified or null, end will default to + * the start of the token stack. + * @param bool $exclude If true, find the previous token that is NOT of + * the types specified in $types. + * @param string $value The value that the token(s) must be equal to. + * If value is omitted, tokens with any value will + * be returned. + * @param bool $local If true, tokens outside the current statement + * will not be checked. IE. checking will stop + * at the previous semi-colon found. * * @return int|bool * @see findNext() @@ -2072,20 +2047,20 @@ * * Returns false if no token can be found. * - * @param int|array $types The type(s) of tokens to search for. - * @param int $start The position to start searching from in the - * token stack. - * @param int $end The end position to fail if no token is found. - * if not specified or null, end will default to - * the end of the token stack. - * @param bool $exclude If true, find the next token that is NOT of - * a type specified in $types. - * @param string $value The value that the token(s) must be equal to. - * If value is omitted, tokens with any value will - * be returned. - * @param bool $local If true, tokens outside the current statement - * will not be checked. i.e., checking will stop - * at the next semi-colon found. + * @param int|string|array $types The type(s) of tokens to search for. + * @param int $start The position to start searching from in the + * token stack. + * @param int $end The end position to fail if no token is found. + * if not specified or null, end will default to + * the end of the token stack. + * @param bool $exclude If true, find the next token that is NOT of + * a type specified in $types. + * @param string $value The value that the token(s) must be equal to. + * If value is omitted, tokens with any value will + * be returned. + * @param bool $local If true, tokens outside the current statement + * will not be checked. i.e., checking will stop + * at the next semi-colon found. * * @return int|bool * @see findPrevious() @@ -2154,9 +2129,7 @@ if ($ignore !== null) { $ignore = (array) $ignore; foreach ($ignore as $code) { - if (isset($endTokens[$code]) === true) { - unset($endTokens[$code]); - } + unset($endTokens[$code]); } } @@ -2222,9 +2195,7 @@ if ($ignore !== null) { $ignore = (array) $ignore; foreach ($ignore as $code) { - if (isset($endTokens[$code]) === true) { - unset($endTokens[$code]); - } + unset($endTokens[$code]); } } @@ -2281,15 +2252,15 @@ * * Returns false if no token can be found. * - * @param int|array $types The type(s) of tokens to search for. - * @param int $start The position to start searching from in the - * token stack. The first token matching on - * this line before this token will be returned. - * @param bool $exclude If true, find the token that is NOT of - * the types specified in $types. - * @param string $value The value that the token must be equal to. - * If value is omitted, tokens with any value will - * be returned. + * @param int|string|array $types The type(s) of tokens to search for. + * @param int $start The position to start searching from in the + * token stack. The first token matching on + * this line before this token will be returned. + * @param bool $exclude If true, find the token that is NOT of + * the types specified in $types. + * @param string $value The value that the token must be equal to. + * If value is omitted, tokens with any value will + * be returned. * * @return int | bool */ @@ -2338,8 +2309,8 @@ /** * Determine if the passed token has a condition of one of the passed types. * - * @param int $stackPtr The position of the token we are checking. - * @param int|array $types The type(s) of tokens to search for. + * @param int $stackPtr The position of the token we are checking. + * @param int|string|array $types The type(s) of tokens to search for. * * @return boolean */ @@ -2359,7 +2330,7 @@ $conditions = $this->tokens[$stackPtr]['conditions']; foreach ($types as $type) { - if (in_array($type, $conditions) === true) { + if (in_array($type, $conditions, true) === true) { // We found a token with the required type. return true; } @@ -2375,8 +2346,8 @@ * * Returns FALSE if the token does not have the condition. * - * @param int $stackPtr The position of the token we are checking. - * @param int $type The type of token to search for. + * @param int $stackPtr The position of the token we are checking. + * @param int|string $type The type of token to search for. * * @return int */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Files/FileList.php --- a/vendor/squizlabs/php_codesniffer/src/Files/FileList.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Files/FileList.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ namespace PHP_CodeSniffer\Files; +use PHP_CodeSniffer\Autoload; use PHP_CodeSniffer\Util; use PHP_CodeSniffer\Ruleset; use PHP_CodeSniffer\Config; @@ -151,7 +152,7 @@ throw new DeepExitException($error, 3); } - $filterClass = \PHP_CodeSniffer\Autoload::loadFile($filename); + $filterClass = Autoload::loadFile($filename); } else { $filterClass = '\PHP_CodeSniffer\Filters\\'.$filterType; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php --- a/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php Thu May 09 15:33:08 2019 +0100 @@ -59,7 +59,7 @@ $this->reloadContent(); - return parent::__construct($this->path, $ruleset, $config); + parent::__construct($this->path, $ruleset, $config); }//end __construct() @@ -88,7 +88,8 @@ } if ($this->configCache['cache'] === false) { - return parent::process(); + parent::process(); + return; } $hash = md5_file($this->path); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php --- a/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php Thu May 09 15:33:08 2019 +0100 @@ -47,6 +47,11 @@ foreach ($output as $path) { $path = Util\Common::realpath($path); + + if ($path === false) { + continue; + } + do { $modified[$path] = true; $path = dirname($path); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Fixer.php --- a/vendor/squizlabs/php_codesniffer/src/Fixer.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Fixer.php Thu May 09 15:33:08 2019 +0100 @@ -638,7 +638,7 @@ * * @param int $stackPtr The position of the token in the token stack. * @param int $start The first character to keep. - * @param int $length The number of chacters to keep. If NULL, the content of + * @param int $length The number of characters to keep. If NULL, the content of * the token from $start to the end of the content is kept. * * @return bool If the change was accepted. diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Reporter.php --- a/vendor/squizlabs/php_codesniffer/src/Reporter.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Reporter.php Thu May 09 15:33:08 2019 +0100 @@ -92,7 +92,7 @@ * @param \PHP_CodeSniffer\Config $config The config data for the run. * * @return void - * @throws RuntimeException If a report is not available. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If a report is not available. */ public function __construct(Config $config) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php --- a/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php Thu May 09 15:33:08 2019 +0100 @@ -68,7 +68,7 @@ $showOk = Config::getConfigData('notifysend_showok'); if ($showOk !== null) { - $this->showOk = (boolean) $showOk; + $this->showOk = (bool) $showOk; } $this->version = str_replace( diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Ruleset.php --- a/vendor/squizlabs/php_codesniffer/src/Ruleset.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Ruleset.php Thu May 09 15:33:08 2019 +0100 @@ -67,7 +67,7 @@ * The key is the fully qualified name of the sniff class * and the value is the sniff object. * - * @var array + * @var array */ public $sniffs = []; @@ -87,7 +87,7 @@ * The key is the token name being listened for and the value * is the sniff object. * - * @var array + * @var array */ public $tokenListeners = []; @@ -161,8 +161,7 @@ $this->name .= ', '; } - $this->name .= $standardName; - $this->paths[] = $standard; + $this->name .= $standardName; // Allow autoloading of custom files inside this standard. if (isset($ruleset['namespace']) === true) { @@ -305,7 +304,7 @@ * is only used for debug output. * * @return string[] - * @throws RuntimeException If the ruleset path is invalid. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the ruleset path is invalid. */ public function processRuleset($rulesetPath, $depth=0) { @@ -315,15 +314,26 @@ echo 'Processing ruleset '.Util\Common::stripBasepath($rulesetPath, $this->config->basepath).PHP_EOL; } - $ruleset = @simplexml_load_string(file_get_contents($rulesetPath)); + libxml_use_internal_errors(true); + $ruleset = simplexml_load_string(file_get_contents($rulesetPath)); if ($ruleset === false) { - throw new RuntimeException("Ruleset $rulesetPath is not valid"); + $errorMsg = "Ruleset $rulesetPath is not valid".PHP_EOL; + $errors = libxml_get_errors(); + foreach ($errors as $error) { + $errorMsg .= '- On line '.$error->line.', column '.$error->column.': '.$error->message; + } + + libxml_clear_errors(); + throw new RuntimeException($errorMsg); } + libxml_use_internal_errors(false); + $ownSniffs = []; $includedSniffs = []; $excludedSniffs = []; + $this->paths[] = $rulesetPath; $rulesetDir = dirname($rulesetPath); $this->rulesetDirs[] = $rulesetDir; @@ -410,7 +420,7 @@ } } else if (empty($newSniffs) === false) { $newSniff = $newSniffs[0]; - if (in_array($newSniff, $ownSniffs) === false) { + if (in_array($newSniff, $ownSniffs, true) === false) { // Including a sniff that hasn't been included higher up, but // only including a single message from it. So turn off all messages in // the sniff, except this one. @@ -457,7 +467,7 @@ } else { $excludedSniffs = array_merge( $excludedSniffs, - $this->expandRulesetReference($exclude['name'], $rulesetDir, ($depth + 1)) + $this->expandRulesetReference((string) $exclude['name'], $rulesetDir, ($depth + 1)) ); } }//end foreach @@ -578,7 +588,7 @@ // sniff list, but filter out any excluded sniffs. $files = []; foreach ($includedSniffs as $sniff) { - if (in_array($sniff, $excludedSniffs) === true) { + if (in_array($sniff, $excludedSniffs, true) === true) { continue; } else { $files[] = Util\Common::realpath($sniff); @@ -660,7 +670,7 @@ * is only used for debug output. * * @return array - * @throws RuntimeException If the reference is invalid. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the reference is invalid. */ private function expandRulesetReference($ref, $rulesetDir, $depth=0) { @@ -715,7 +725,7 @@ if (Util\Common::isPharFile($path) === true && strpos($path, 'ruleset.xml') === false) { // If the ruleset exists inside the phar file, use it. if (file_exists($path.DIRECTORY_SEPARATOR.'ruleset.xml') === true) { - $path = $path.DIRECTORY_SEPARATOR.'ruleset.xml'; + $path .= DIRECTORY_SEPARATOR.'ruleset.xml'; } else { $path = null; } @@ -836,13 +846,13 @@ /** * Processes a rule from a ruleset XML file, overriding built-in defaults. * - * @param SimpleXMLElement $rule The rule object from a ruleset XML file. - * @param string[] $newSniffs An array of sniffs that got included by this rule. - * @param int $depth How many nested processing steps we are in. - * This is only used for debug output. + * @param \SimpleXMLElement $rule The rule object from a ruleset XML file. + * @param string[] $newSniffs An array of sniffs that got included by this rule. + * @param int $depth How many nested processing steps we are in. + * This is only used for debug output. * * @return void - * @throws RuntimeException If rule settings are invalid. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If rule settings are invalid. */ private function processRule($rule, $newSniffs, $depth=0) { @@ -1073,7 +1083,7 @@ /** * Determine if an element should be processed or ignored. * - * @param SimpleXMLElement $element An object from a ruleset XML file. + * @param \SimpleXMLElement $element An object from a ruleset XML file. * * @return bool */ @@ -1174,7 +1184,7 @@ * Populates the array of PHP_CodeSniffer_Sniff's for this file. * * @return void - * @throws RuntimeException If sniff registration fails. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If sniff registration fails. */ public function populateTokenListeners() { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Runner.php --- a/vendor/squizlabs/php_codesniffer/src/Runner.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Runner.php Thu May 09 15:33:08 2019 +0100 @@ -230,9 +230,10 @@ /** - * Exits if the minimum requirements of PHP_CodSniffer are not met. + * Exits if the minimum requirements of PHP_CodeSniffer are not met. * * @return array + * @throws \PHP_CodeSniffer\Exceptions\DeepExitException */ public function checkRequirements() { @@ -242,8 +243,34 @@ throw new DeepExitException($error, 3); } - if (extension_loaded('tokenizer') === false) { - $error = 'ERROR: PHP_CodeSniffer requires the tokenizer extension to be enabled.'.PHP_EOL; + $requiredExtensions = [ + 'tokenizer', + 'xmlwriter', + 'SimpleXML', + ]; + $missingExtensions = []; + + foreach ($requiredExtensions as $extension) { + if (extension_loaded($extension) === false) { + $missingExtensions[] = $extension; + } + } + + if (empty($missingExtensions) === false) { + $last = array_pop($requiredExtensions); + $required = implode(', ', $requiredExtensions); + $required .= ' and '.$last; + + if (count($missingExtensions) === 1) { + $missing = $missingExtensions[0]; + } else { + $last = array_pop($missingExtensions); + $missing = implode(', ', $missingExtensions); + $missing .= ' and '.$last; + } + + $error = 'ERROR: PHP_CodeSniffer requires the %s extensions to be enabled. Please enable %s.'.PHP_EOL; + $error = sprintf($error, $required, $missing); throw new DeepExitException($error, 3); } @@ -254,6 +281,7 @@ * Init the rulesets and other high-level settings. * * @return void + * @throws \PHP_CodeSniffer\Exceptions\DeepExitException */ public function init() { @@ -265,6 +293,9 @@ // be detected properly for files created on a Mac with the /r line ending. ini_set('auto_detect_line_endings', true); + // Disable the PCRE JIT as this caused issues with parallel running. + ini_set('pcre.jit', false); + // Check that the standards are valid. foreach ($this->config->standards as $standard) { if (Util\Standards::isInstalledStandard($standard) === false) { @@ -280,7 +311,7 @@ } // Saves passing the Config object into other objects that only need - // the verbostity flag for deubg output. + // the verbosity flag for debug output. if (defined('PHP_CODESNIFFER_VERBOSITY') === false) { define('PHP_CODESNIFFER_VERBOSITY', $this->config->verbosity); } @@ -312,6 +343,8 @@ * Performs the run. * * @return int The number of errors and warnings found. + * @throws \PHP_CodeSniffer\Exceptions\DeepExitException + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException */ private function run() { @@ -506,7 +539,10 @@ }//end if }//end for - $this->processChildProcs($childProcs); + $success = $this->processChildProcs($childProcs); + if ($success === false) { + throw new RuntimeException('One or more child processes failed to run'); + } }//end if restore_error_handler(); @@ -558,6 +594,7 @@ * @param int $line The line number the error was raised at. * * @return void + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException */ public function handleErrors($code, $message, $file, $line) { @@ -577,6 +614,7 @@ * @param \PHP_CodeSniffer\Files\File $file The file to be processed. * * @return void + * @throws \PHP_CodeSniffer\Exceptions\DeepExitException */ public function processFile($file) { @@ -677,20 +715,35 @@ $numProcessed = 0; $totalBatches = count($childProcs); + $success = true; + while (count($childProcs) > 0) { foreach ($childProcs as $key => $procData) { $res = pcntl_waitpid($procData['pid'], $status, WNOHANG); if ($res === $procData['pid']) { if (file_exists($procData['out']) === true) { include $procData['out']; - if (isset($childOutput) === true) { - $this->reporter->totalFiles += $childOutput['totalFiles']; - $this->reporter->totalErrors += $childOutput['totalErrors']; - $this->reporter->totalWarnings += $childOutput['totalWarnings']; - $this->reporter->totalFixable += $childOutput['totalFixable']; - $this->reporter->totalFixed += $childOutput['totalFixed']; + + unlink($procData['out']); + unset($childProcs[$key]); + + $numProcessed++; + + if (isset($childOutput) === false) { + // The child process died, so the run has failed. + $file = new DummyFile(null, $this->ruleset, $this->config); + $file->setErrorCounts(1, 0, 0, 0); + $this->printProgress($file, $totalBatches, $numProcessed); + $success = false; + continue; } + $this->reporter->totalFiles += $childOutput['totalFiles']; + $this->reporter->totalErrors += $childOutput['totalErrors']; + $this->reporter->totalWarnings += $childOutput['totalWarnings']; + $this->reporter->totalFixable += $childOutput['totalFixable']; + $this->reporter->totalFixed += $childOutput['totalFixed']; + if (isset($debugOutput) === true) { echo $debugOutput; } @@ -701,11 +754,6 @@ } } - unlink($procData['out']); - unset($childProcs[$key]); - - $numProcessed++; - // Fake a processed file so we can print progress output for the batch. $file = new DummyFile(null, $this->ruleset, $this->config); $file->setErrorCounts( @@ -720,20 +768,22 @@ }//end foreach }//end while + return $success; + }//end processChildProcs() /** * Print progress information for a single processed file. * - * @param File $file The file that was processed. - * @param int $numFiles The total number of files to process. - * @param int $numProcessed The number of files that have been processed, - * including this one. + * @param \PHP_CodeSniffer\Files\File $file The file that was processed. + * @param int $numFiles The total number of files to process. + * @param int $numProcessed The number of files that have been processed, + * including this one. * * @return void */ - public function printProgress($file, $numFiles, $numProcessed) + public function printProgress(File $file, $numFiles, $numProcessed) { if (PHP_CODESNIFFER_VERBOSITY > 0 || $this->config->showProgress === false diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php Thu May 09 15:33:08 2019 +0100 @@ -1,6 +1,6 @@ * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php Thu May 09 15:33:08 2019 +0100 @@ -153,7 +153,7 @@ * * @return int The position in the pattern that this test should register * as the listener. - * @throws RuntimeException If we could not determine a token to listen for. + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If we could not determine a token to listen for. */ private function getListenerTokenPos($pattern) { @@ -195,7 +195,7 @@ $tokens = $phpcsFile->getTokens(); - if (in_array($tokens[$stackPtr]['code'], $this->supplementaryTokens) === true) { + if (in_array($tokens[$stackPtr]['code'], $this->supplementaryTokens, true) === true) { $this->processSupplementary($phpcsFile, $stackPtr); } @@ -260,10 +260,9 @@ $errors = []; $found = ''; - $ignoreTokens = [T_WHITESPACE]; + $ignoreTokens = [T_WHITESPACE => T_WHITESPACE]; if ($this->ignoreComments === true) { - $ignoreTokens - = array_merge($ignoreTokens, Tokens::$commentTokens); + $ignoreTokens += Tokens::$commentTokens; } $origStackPtr = $stackPtr; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php Thu May 09 15:33:08 2019 +0100 @@ -64,7 +64,7 @@ /** - * Processes the token in the specified PHP_CodeSniffer_File. + * Processes the token in the specified PHP_CodeSniffer\Files\File. * * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this * token was found. @@ -92,7 +92,7 @@ return; } - // If this token is inside nested inside a function at a deeper + // If this token is nested inside a function at a deeper // level than the current OO scope that was found, it's a normal // variable and not a member var. $conditions = array_reverse($tokens[$stackPtr]['conditions'], true); @@ -119,7 +119,7 @@ if ($inFunction === false && isset($tokens[$stackPtr]['nested_parenthesis']) === true) { foreach ($tokens[$stackPtr]['nested_parenthesis'] as $opener => $closer) { if (isset($tokens[$opener]['parenthesis_owner']) === false) { - // Check if this is a USE statement in a closure. + // Check if this is a USE statement for a closure. $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), null, true); if ($tokens[$prev]['code'] === T_USE) { $inFunction = true; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php Thu May 09 15:33:08 2019 +0100 @@ -34,7 +34,7 @@ * ); * * - * @return int[] + * @return mixed[] * @see Tokens.php */ public function register(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneObjectStructurePerFileStandard.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneObjectStructurePerFileStandard.xml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,29 @@ + + + + + + + trait Foo +{ +} + ]]> + + + trait Foo +{ +} + +class Bar +{ +} + ]]> + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneTraitPerFileStandard.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneTraitPerFileStandard.xml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,29 @@ + + + + + + + trait Foo +{ +} + ]]> + + + trait Foo +{ +} + +trait Bar +{ +} + ]]> + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php Thu May 09 15:33:08 2019 +0100 @@ -101,7 +101,7 @@ } else if ($tokens[($openingBrace - 1)]['content'] === "\t") { $length = '\t'; } else { - $length = strlen($tokens[($openingBrace - 1)]['content']); + $length = $tokens[($openingBrace - 1)]['length']; } if ($length !== 1) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -262,11 +262,12 @@ if ($paramGroupid === $groupid && $tokens[$tag]['content'] !== '@param' ) { - $error = 'Tag cannot be grouped with parameter tags in a doc comment'; - $phpcsFile->addError($error, $tag, 'NonParamGroup'); + $error = 'Tag %s cannot be grouped with parameter tags in a doc comment'; + $data = [$tokens[$tag]['content']]; + $phpcsFile->addError($error, $tag, 'NonParamGroup', $data); } - $tagLength = strlen($tokens[$tag]['content']); + $tagLength = $tokens[$tag]['length']; if ($tagLength > $maxLength) { $maxLength = $tagLength; } @@ -274,7 +275,7 @@ // Check for a value. No value means no padding needed. $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); if ($string !== false && $tokens[$string]['line'] === $tokens[$tag]['line']) { - $paddings[$tag] = strlen($tokens[($tag + 1)]['content']); + $paddings[$tag] = $tokens[($tag + 1)]['length']; } } @@ -306,11 +307,12 @@ // Now check paddings. foreach ($paddings as $tag => $padding) { - $required = ($maxLength - strlen($tokens[$tag]['content']) + 1); + $required = ($maxLength - $tokens[$tag]['length'] + 1); if ($padding !== $required) { - $error = 'Tag value indented incorrectly; expected %s spaces but found %s'; + $error = 'Tag value for %s tag indented incorrectly; expected %s spaces but found %s'; $data = [ + $tokens[$tag]['content'], $required, $padding, ]; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php Thu May 09 15:33:08 2019 +0100 @@ -110,6 +110,38 @@ } }//end if + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false + && $tokens[$stackPtr]['code'] !== T_ELSE + ) { + if ($tokens[$stackPtr]['code'] !== T_DO) { + // Live coding or parse error. + return; + } + + $nextWhile = $phpcsFile->findNext(T_WHILE, ($stackPtr + 1)); + if ($nextWhile !== false + && isset($tokens[$nextWhile]['parenthesis_opener'], $tokens[$nextWhile]['parenthesis_closer']) === false + ) { + // Live coding or parse error. + return; + } + + unset($nextWhile); + } + + $start = $stackPtr; + if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { + $start = $tokens[$stackPtr]['parenthesis_closer']; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($start + 1), null, true); + if ($nextNonEmpty === false) { + // Live coding or parse error. + return; + } + + unset($nextNonEmpty, $start); + // This is a control structure without an opening brace, // so it is an inline statement. if ($this->error === true) { @@ -153,7 +185,7 @@ break; } - if (in_array($tokens[$end]['code'], $fixableScopeOpeners) === true + if (in_array($tokens[$end]['code'], $fixableScopeOpeners, true) === true && isset($tokens[$end]['scope_opener']) === false ) { // The best way to fix nested inline scopes is middle-out. diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php Thu May 09 15:33:08 2019 +0100 @@ -51,28 +51,36 @@ { $rhinoPath = Config::getExecutablePath('rhino'); $jshintPath = Config::getExecutablePath('jshint'); - if ($rhinoPath === null || $jshintPath === null) { + if ($rhinoPath === null && $jshintPath === null) { return; } - $fileName = $phpcsFile->getFilename(); - - $rhinoPath = escapeshellcmd($rhinoPath); + $fileName = $phpcsFile->getFilename(); $jshintPath = escapeshellcmd($jshintPath); - $cmd = "$rhinoPath \"$jshintPath\" ".escapeshellarg($fileName); - exec($cmd, $output, $retval); + if ($rhinoPath !== null) { + $rhinoPath = escapeshellcmd($rhinoPath); + $cmd = "$rhinoPath \"$jshintPath\" ".escapeshellarg($fileName); + exec($cmd, $output, $retval); + + $regex = '`^(?P.+)\(.+:(?P[0-9]+).*:[0-9]+\)$`'; + } else { + $cmd = "$jshintPath ".escapeshellarg($fileName); + exec($cmd, $output, $retval); + + $regex = '`^(.+?): line (?P[0-9]+), col [0-9]+, (?P.+)$`'; + } if (is_array($output) === true) { foreach ($output as $finding) { $matches = []; - $numMatches = preg_match('/^(.+)\(.+:([0-9]+).*:[0-9]+\)$/', $finding, $matches); + $numMatches = preg_match($regex, $finding, $matches); if ($numMatches === 0) { continue; } - $line = (int) $matches[2]; - $message = 'jshint says: '.trim($matches[1]); + $line = (int) $matches['line']; + $message = 'jshint says: '.trim($matches['error']); $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php Thu May 09 15:33:08 2019 +0100 @@ -55,7 +55,7 @@ $stackPtr = ($phpcsFile->numTokens - 1); if ($tokens[$stackPtr]['content'] === '') { - $stackPtr--; + --$stackPtr; } $eolCharLen = strlen($phpcsFile->eolChar); @@ -64,8 +64,18 @@ $error = 'File must not end with a newline character'; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); if ($fix === true) { - $newContent = substr($tokens[$stackPtr]['content'], 0, ($eolCharLen * -1)); - $phpcsFile->fixer->replaceToken($stackPtr, $newContent); + $phpcsFile->fixer->beginChangeset(); + + for ($i = $stackPtr; $i > 0; $i--) { + $newContent = rtrim($tokens[$i]['content'], $phpcsFile->eolChar); + $phpcsFile->fixer->replaceToken($i, $newContent); + + if ($newContent !== '') { + break; + } + } + + $phpcsFile->fixer->endChangeset(); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php Thu May 09 15:33:08 2019 +0100 @@ -120,11 +120,16 @@ $tokenContent = $tokens[$i]['content']; } + if ($tokenContent === '') { + // Special case for JS/CSS close tag. + continue; + } + $newContent = rtrim($tokenContent, "\r\n"); $newContent .= $eolChar; $phpcsFile->fixer->replaceToken($i, $newContent); } - } + }//end for }//end if // Ignore the rest of the file. diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php Thu May 09 15:33:08 2019 +0100 @@ -39,16 +39,24 @@ */ public function process(File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); + $tokens = $phpcsFile->getTokens(); + $fixable = true; + $prev = $stackPtr; - $prev = $phpcsFile->findPrevious([T_SEMICOLON, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO], ($stackPtr - 1)); - if ($prev === false - || $tokens[$prev]['code'] === T_OPEN_TAG - || $tokens[$prev]['code'] === T_OPEN_TAG_WITH_ECHO - ) { - $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); - return; - } + do { + $prev = $phpcsFile->findPrevious([T_SEMICOLON, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_PHPCS_IGNORE], ($prev - 1)); + if ($prev === false + || $tokens[$prev]['code'] === T_OPEN_TAG + || $tokens[$prev]['code'] === T_OPEN_TAG_WITH_ECHO + ) { + $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); + return; + } + + if ($tokens[$prev]['code'] === T_PHPCS_IGNORE) { + $fixable = false; + } + } while ($tokens[$prev]['code'] === T_PHPCS_IGNORE); // Ignore multiple statements in a FOR condition. if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { @@ -69,7 +77,13 @@ $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'yes'); $error = 'Each PHP statement must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SameLine'); + $code = 'SameLine'; + if ($fixable === false) { + $phpcsFile->addError($error, $stackPtr, $code); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); if ($fix === true) { $phpcsFile->fixer->beginChangeset(); $phpcsFile->fixer->addNewline($prev); @@ -81,7 +95,7 @@ } } else { $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); - } + }//end if }//end process() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php Thu May 09 15:33:08 2019 +0100 @@ -45,10 +45,8 @@ { $tokens = $phpcsFile->getTokens(); - $findTokens = array_merge( - Tokens::$emptyTokens, - [T_BITWISE_AND] - ); + $findTokens = Tokens::$emptyTokens; + $findTokens[] = T_BITWISE_AND; $prev = $phpcsFile->findPrevious($findTokens, ($stackPtr - 1), null, true); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -24,13 +24,16 @@ */ public function register() { - $tokens = Tokens::$functionNameTokens; - - $tokens[] = T_VARIABLE; - $tokens[] = T_CLOSE_CURLY_BRACKET; - $tokens[] = T_CLOSE_PARENTHESIS; - - return $tokens; + return[ + T_STRING, + T_ISSET, + T_UNSET, + T_SELF, + T_STATIC, + T_VARIABLE, + T_CLOSE_CURLY_BRACKET, + T_CLOSE_PARENTHESIS, + ]; }//end register() @@ -69,7 +72,7 @@ } // If the next non-whitespace token after the function or method call - // is not an opening parenthesis then it cant really be a *call*. + // is not an opening parenthesis then it can't really be a *call*. $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($functionName + 1), null, true); if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { return; @@ -86,11 +89,14 @@ T_COMMA, T_VARIABLE, T_CLOSURE, + T_ANON_CLASS, T_OPEN_SHORT_ARRAY, ]; while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { - if ($tokens[$nextSeparator]['code'] === T_CLOSURE) { + if ($tokens[$nextSeparator]['code'] === T_CLOSURE + || $tokens[$nextSeparator]['code'] === T_ANON_CLASS + ) { // Skip closures. $nextSeparator = $tokens[$nextSeparator]['scope_closer']; continue; @@ -140,7 +146,7 @@ // each argument on a newline, which is valid, so ignore it. $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextSeparator + 1), null, true); if ($tokens[$next]['line'] === $tokens[$nextSeparator]['line']) { - $space = strlen($tokens[($nextSeparator + 1)]['content']); + $space = $tokens[($nextSeparator + 1)]['length']; if ($space > 1) { $error = 'Expected 1 space after comma in function call; %s found'; $data = [$space]; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php Thu May 09 15:33:08 2019 +0100 @@ -110,7 +110,7 @@ $constName = substr($constName, ($splitPos + 2)); } - // Strip namesspace from constant like /foo/bar/CONSTANT. + // Strip namespace from constant like /foo/bar/CONSTANT. $splitPos = strrpos($constName, '\\'); if ($splitPos !== false) { $prefix = substr($constName, 0, ($splitPos + 1)); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php Thu May 09 15:33:08 2019 +0100 @@ -48,7 +48,7 @@ } if ($this->phpVersion < 70000) { - $this->aspTags = (boolean) ini_get('asp_tags'); + $this->aspTags = (bool) ini_get('asp_tags'); } return [ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php Thu May 09 15:33:08 2019 +0100 @@ -29,7 +29,7 @@ T_OPEN_TAG_WITH_ECHO, ]; - $shortOpenTags = (boolean) ini_get('short_open_tag'); + $shortOpenTags = (bool) ini_get('short_open_tag'); if ($shortOpenTags === false) { $targets[] = T_INLINE_HTML; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php Thu May 09 15:33:08 2019 +0100 @@ -74,9 +74,18 @@ // If we are not pattern matching, we need to work out what // tokens to listen for. - $string = 'forbiddenFunctionNames as $name) { - $string .= $name.'();'; + if ($name === '__halt_compiler') { + $hasHaltCompiler = true; + } else { + $string .= $name.'();'; + } + } + + if ($hasHaltCompiler === true) { + $string .= '__halt_compiler();'; } $register = []; @@ -173,7 +182,7 @@ // Remove the pattern delimiters and modifier. $pattern = substr($pattern, 1, -2); } else { - if (in_array($function, $this->forbiddenFunctionNames) === false) { + if (in_array($function, $this->forbiddenFunctionNames, true) === false) { return; } }//end if diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -142,11 +142,12 @@ } } - $lastOpenTag = $stackPtr; - $lastCloseTag = null; - $openScopes = []; - $adjustments = []; - $setIndents = []; + $lastOpenTag = $stackPtr; + $lastCloseTag = null; + $openScopes = []; + $adjustments = []; + $setIndents = []; + $disableExactEnd = 0; $tokens = $phpcsFile->getTokens(); $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); @@ -180,20 +181,65 @@ $this->exact = (bool) $this->exact; $this->tabIndent = (bool) $this->tabIndent; + $checkAnnotations = $phpcsFile->config->annotations; + for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { if ($i === false) { // Something has gone very wrong; maybe a parse error. break; } + if ($checkAnnotations === true + && $tokens[$i]['code'] === T_PHPCS_SET + && isset($tokens[$i]['sniffCode']) === true + && $tokens[$i]['sniffCode'] === 'Generic.WhiteSpace.ScopeIndent' + && $tokens[$i]['sniffProperty'] === 'exact' + ) { + $value = $tokens[$i]['sniffPropertyValue']; + if ($value === 'true') { + $value = true; + } else if ($value === 'false') { + $value = false; + } else { + $value = (bool) $value; + } + + $this->exact = $value; + + if ($this->debug === true) { + $line = $tokens[$i]['line']; + if ($this->exact === true) { + $value = 'true'; + } else { + $value = 'false'; + } + + echo "* token $i on line $line set exact flag to $value *".PHP_EOL; + } + }//end if + $checkToken = null; $checkIndent = null; - $exact = (bool) $this->exact; - if ($exact === true && isset($tokens[$i]['nested_parenthesis']) === true) { - // Don't check indents exactly between parenthesis as they - // tend to have custom rules, such as with multi-line function calls - // and control structure conditions. + /* + Don't check indents exactly between parenthesis or arrays as they + tend to have custom rules, such as with multi-line function calls + and control structure conditions. + */ + + $exact = $this->exact; + + if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { + $disableExactEnd = max($disableExactEnd, $tokens[$i]['bracket_closer']); + } + + if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS + && isset($tokens[$i]['parenthesis_closer']) === true + ) { + $disableExactEnd = max($disableExactEnd, $tokens[$i]['parenthesis_closer']); + } + + if ($exact === true && $i < $disableExactEnd) { $exact = false; } @@ -238,8 +284,9 @@ if (isset($tokens[$parenCloser]['nested_parenthesis']) === true && empty($tokens[$parenCloser]['nested_parenthesis']) === false ) { - end($tokens[$parenCloser]['nested_parenthesis']); - $parens = key($tokens[$parenCloser]['nested_parenthesis']); + $parens = $tokens[$parenCloser]['nested_parenthesis']; + end($parens); + $parens = key($parens); if ($this->debug === true) { $line = $tokens[$parens]['line']; echo "\t* token has nested parenthesis $parens on line $line *".PHP_EOL; @@ -249,9 +296,12 @@ $condition = 0; if (isset($tokens[$parenCloser]['conditions']) === true && empty($tokens[$parenCloser]['conditions']) === false + && (isset($tokens[$parenCloser]['parenthesis_owner']) === false + || $parens > 0) ) { - end($tokens[$parenCloser]['conditions']); - $condition = key($tokens[$parenCloser]['conditions']); + $condition = $tokens[$parenCloser]['conditions']; + end($condition); + $condition = key($condition); if ($this->debug === true) { $line = $tokens[$condition]['line']; $type = $tokens[$condition]['type']; @@ -348,15 +398,20 @@ echo "\t* previous is $type on line $line *".PHP_EOL; } - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $prev, true); - $prev = $phpcsFile->findStartOfStatement($first, T_COMMA); - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $prev, true); + $first = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], $prev, true); + if ($first !== false) { + $prev = $phpcsFile->findStartOfStatement($first, T_COMMA); + $first = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], $prev, true); + } else { + $first = $prev; + } + if ($this->debug === true) { $line = $tokens[$first]['line']; $type = $tokens[$first]['type']; echo "\t* amended first token is $first ($type) on line $line *".PHP_EOL; } - } + }//end if if (isset($tokens[$first]['scope_closer']) === true && $tokens[$first]['scope_closer'] === $first @@ -387,7 +442,7 @@ } }//end if } else { - // Don't force current indent to divisible because there could be custom + // Don't force current indent to be divisible because there could be custom // rules in place between parenthesis, such as with arrays. $currentIndent = ($tokens[$first]['column'] - 1); if (isset($adjustments[$first]) === true) { @@ -511,8 +566,9 @@ && $tokens[$checkToken]['scope_opener'] === $checkToken)) ) { if (empty($tokens[$checkToken]['conditions']) === false) { - end($tokens[$checkToken]['conditions']); - $condition = key($tokens[$checkToken]['conditions']); + $condition = $tokens[$checkToken]['conditions']; + end($condition); + $condition = key($condition); } else { $condition = $tokens[$checkToken]['scope_condition']; } @@ -544,7 +600,7 @@ if ($this->debug === true) { $line = $tokens[$checkToken]['line']; $type = $tokens[$checkToken]['type']; - echo "\t=> Add adjustment of ".$adjustments[$checkToken]." for token $checkToken ($type) on line $line".PHP_EOL; + echo "\t=> add adjustment of ".$adjustments[$checkToken]." for token $checkToken ($type) on line $line".PHP_EOL; } }//end if }//end if @@ -578,8 +634,13 @@ $scopeCloser = $checkToken; if ($scopeCloser === null) { $scopeCloser = $i; - } else { - array_pop($openScopes); + } + + $conditionToken = array_pop($openScopes); + if ($this->debug === true) { + $line = $tokens[$conditionToken]['line']; + $type = $tokens[$conditionToken]['type']; + echo "\t=> removed open scope $conditionToken ($type) on line $line".PHP_EOL; } if (isset($tokens[$scopeCloser]['scope_condition']) === true) { @@ -606,11 +667,6 @@ $currentIndent += $adjustments[$first]; } - // Make sure it is divisible by our expected indent. - if ($tokens[$tokens[$scopeCloser]['scope_condition']]['code'] !== T_CLOSURE) { - $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); - } - $setIndents[$scopeCloser] = $currentIndent; if ($this->debug === true) { @@ -646,15 +702,21 @@ if ($scopeCloser === null) { $scopeCloser = $i; } else { - array_pop($openScopes); + $conditionToken = array_pop($openScopes); + if ($this->debug === true) { + $line = $tokens[$conditionToken]['line']; + $type = $tokens[$conditionToken]['type']; + echo "\t=> removed open scope $conditionToken ($type) on line $line".PHP_EOL; + } } $parens = 0; if (isset($tokens[$scopeCloser]['nested_parenthesis']) === true && empty($tokens[$scopeCloser]['nested_parenthesis']) === false ) { - end($tokens[$scopeCloser]['nested_parenthesis']); - $parens = key($tokens[$scopeCloser]['nested_parenthesis']); + $parens = $tokens[$scopeCloser]['nested_parenthesis']; + end($parens); + $parens = key($parens); if ($this->debug === true) { $line = $tokens[$parens]['line']; echo "\t* token has nested parenthesis $parens on line $line *".PHP_EOL; @@ -665,8 +727,9 @@ if (isset($tokens[$scopeCloser]['conditions']) === true && empty($tokens[$scopeCloser]['conditions']) === false ) { - end($tokens[$scopeCloser]['conditions']); - $condition = key($tokens[$scopeCloser]['conditions']); + $condition = $tokens[$scopeCloser]['conditions']; + end($condition); + $condition = key($condition); if ($this->debug === true) { $line = $tokens[$condition]['line']; $type = $tokens[$condition]['type']; @@ -730,7 +793,7 @@ if ($checkToken !== null && isset(Tokens::$scopeOpeners[$tokens[$checkToken]['code']]) === true - && in_array($tokens[$checkToken]['code'], $this->nonIndentingScopes) === false + && in_array($tokens[$checkToken]['code'], $this->nonIndentingScopes, true) === false && isset($tokens[$checkToken]['scope_opener']) === true ) { $exact = true; @@ -905,7 +968,7 @@ if ($accepted === true && $this->debug === true) { $line = $tokens[$checkToken]['line']; $type = $tokens[$checkToken]['type']; - echo "\t=> Add adjustment of ".$adjustments[$checkToken]." for token $checkToken ($type) on line $line".PHP_EOL; + echo "\t=> add adjustment of ".$adjustments[$checkToken]." for token $checkToken ($type) on line $line".PHP_EOL; } } }//end if @@ -1050,6 +1113,15 @@ $currentIndent = (($tokens[$first]['column'] - 1) + $this->indent); $openScopes[$tokens[$i]['scope_closer']] = $tokens[$i]['scope_condition']; + if ($this->debug === true) { + $closerToken = $tokens[$i]['scope_closer']; + $closerLine = $tokens[$closerToken]['line']; + $closerType = $tokens[$closerToken]['type']; + $conditionToken = $tokens[$i]['scope_condition']; + $conditionLine = $tokens[$conditionToken]['line']; + $conditionType = $tokens[$conditionToken]['type']; + echo "\t=> added open scope $closerToken ($closerType) on line $closerLine, pointing to condition $conditionToken ($conditionType) on line $conditionLine".PHP_EOL; + } if (isset($adjustments[$first]) === true) { $currentIndent += $adjustments[$first]; @@ -1087,7 +1159,7 @@ $condition = $tokens[$tokens[$i]['scope_condition']]['code']; if (isset(Tokens::$scopeOpeners[$condition]) === true - && in_array($condition, $this->nonIndentingScopes) === false + && in_array($condition, $this->nonIndentingScopes, true) === false ) { if ($this->debug === true) { $line = $tokens[$i]['line']; @@ -1098,6 +1170,15 @@ $currentIndent += $this->indent; $setIndents[$i] = $currentIndent; $openScopes[$tokens[$i]['scope_closer']] = $tokens[$i]['scope_condition']; + if ($this->debug === true) { + $closerToken = $tokens[$i]['scope_closer']; + $closerLine = $tokens[$closerToken]['line']; + $closerType = $tokens[$closerToken]['type']; + $conditionToken = $tokens[$i]['scope_condition']; + $conditionLine = $tokens[$conditionToken]['line']; + $conditionType = $tokens[$conditionToken]['type']; + echo "\t=> added open scope $closerToken ($closerType) on line $closerLine, pointing to condition $conditionToken ($conditionType) on line $conditionLine".PHP_EOL; + } if ($this->debug === true) { $type = $tokens[$i]['type']; @@ -1105,7 +1186,7 @@ } continue; - } + }//end if }//end if // JS objects set the indent level. @@ -1181,8 +1262,9 @@ if (isset($tokens[$i]['nested_parenthesis']) === true && empty($tokens[$i]['nested_parenthesis']) === false ) { - end($tokens[$i]['nested_parenthesis']); - $parens = key($tokens[$i]['nested_parenthesis']); + $parens = $tokens[$i]['nested_parenthesis']; + end($parens); + $parens = key($parens); if ($this->debug === true) { $line = $tokens[$parens]['line']; echo "\t* token has nested parenthesis $parens on line $line *".PHP_EOL; @@ -1193,8 +1275,9 @@ if (isset($tokens[$i]['conditions']) === true && empty($tokens[$i]['conditions']) === false ) { - end($tokens[$i]['conditions']); - $condition = key($tokens[$i]['conditions']); + $condition = $tokens[$i]['conditions']; + end($condition); + $condition = key($condition); if ($this->debug === true) { $line = $tokens[$condition]['line']; $type = $tokens[$condition]['type']; @@ -1314,7 +1397,7 @@ * @param int $change The difference in length between * the old and new indent. * - * @return void + * @return bool */ protected function adjustIndent(File $phpcsFile, $stackPtr, $length, $change) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,7 @@ $it->next(); } -for (;(($it1->valid() && $foo) || (!$it2->value && ($bar || false)));/*Could be ingored*/) { +for (;(($it1->valid() && $foo) || (!$it2->value && ($bar || false)));/*Could be ignored*/) { $it1->next(); $it2->next(); } \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -99,7 +99,7 @@ * Short description * over multiple lines. * - * Long descrption. + * Long description. * * @param * @@ -213,4 +213,40 @@ /**doc comment */ + /** + * Document behaviour with missing blank lines with indented docblocks. + * @param + * @param + * @tag one + * + */ + + /** Indented doc comment */ + +/** + * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. + * The below is "correctly" aligned. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. + * The below is incorrectly aligned. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + /** No docblock close tag. Must be last test without new line. \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,257 @@ + + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * Comment + * + * @one + * @two + * @one + * + * @two something + * here + * @two foo + * @three something + * here + * @three bar + */ + +/** + * @ var Comment + */ + +/** + * @var Database $mockedDatabase +*/ +/** + * @var Container $mockedContainer +*/ + +/** + * 这是一条测试评论. + */ + +/** + * I'm a function short-description + * + * @return boolean + */ + +/** + * this is a test + * + * @author test + * @param boolean $foo blah + * @return boolean + * @param boolean $bar Blah. + */ + +/** + * Short description. + * + * @tag one + * @param int $number + * @param string $text + * @return something + */ + +/** + * + * @param int $number + * @param string $text + * @return something + */ + +/** + * @param int $number + */ + +/** + * étude des ... + */ + +/** +* doc comment +*/ + + /** + * Document behaviour with missing blank lines with indented docblocks. + * + * @param + * @param + * @tag one + */ + + /** + * Indented doc comment +*/ + +/** + * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. + * The below is "correctly" aligned. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. + * The below is incorrectly aligned. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** No docblock close tag. Must be last test without new line. \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js Thu May 09 15:33:08 2019 +0100 @@ -99,7 +99,7 @@ * Short description * over multiple lines. * - * Long descrption. + * Long description. * * @param * @@ -212,3 +212,39 @@ */ /**doc comment */ + + /** + * Document behaviour with missing blank lines with indented docblocks. + * @param + * @param + * @tag one + * + */ + + /** Indented doc comment */ + +/** + * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. + * The below is "correctly" aligned. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. + * The below is incorrectly aligned. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.js.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,255 @@ + +/** + * Short description. + * + * Long description + * over multiple lines. + * + * @tag1 one + * @tag2 two + * @tag3 three + */ + +/** + * short description + * + * long description + * over multiple lines. + * + * @tag1 one + */ + +/** + * Short description + * + * Long description + * over multiple lines + * + * @tag1 one + */ + +/* + This is not a doc block. + */ + +/** + * Short description. + * + * @tag one + * @tag2 two + * @tagThree three + * @tagFour four + */ + +/** + * Short description. + * + * @tag one + * + * @param + * @param + */ + +/** + * Short description. + * + * @param + * @param + * @tag one + */ + +/** + * Short description. + * + * @param + * + * @param + * + * @tag one + */ + + /** + * Short description. + * + * @param + * + * @tag one + * @param + */ + +/** + * Short description. + * + * @groupOne one + * @groupOne two + * + * @group2 one + * @group2 two + * + * @g3 + * @g3 two + */ + + /** + * Short description + * over multiple lines. + * + * Long description. + * + * @param + * + * @tag one + */ + +/** + * Short description. + * + * @tag1 one some comment across + * multiple lines + * @tag1 two some comment across + * multiple lines + * @tag1 three some comment across + * multiple lines + */ + + /** + * Returns true if the specified string is in the camel caps format. + * + * @param boolean $classFormat If true, check to see if the string is in the + * class format. Class format strings must start + * with a capital letter and contain no + * underscores. + * @param boolean $strict If true, the string must not have two capital + * letters next to each other. If false, a + * relaxed camel caps policy is used to allow + * for acronyms. + * + * @return boolean + */ + + /** + * Verifies that a @throws tag exists for a function that throws exceptions. + * Verifies the number of @throws tags and the number of throw tokens matches. + * Verifies the exception type. + * + * PHP version 5 + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + + /** + * Comment + * + * @one + * @two + * @one + * + * @two something + * here + * @two foo + * @three something + * here + * @three bar + */ + + /** + * @ var Comment + */ + +/** + * @var Database $mockedDatabase +*/ +/** + * @var Container $mockedContainer +*/ + +/** + * 这是一条测试评论. + */ + +/** + * I'm a function short-description + * + * @return boolean + */ + +/** + * this is a test + * + * @author test + * @param boolean $foo blah + * @return boolean + * @param boolean $bar Blah. + */ + +/** + * Short description. + * + * @tag one + * @param int $number + * @param string $text + * @return something + */ + +/** + * + * @param int $number + * @param string $text + * @return something + */ + +/** + * @param int $number + */ + +/** + * étude des ... + */ + +/** +* doc comment +*/ + + /** + * Document behaviour with missing blank lines with indented docblocks. + * + * @param + * @param + * @tag one + */ + + /** + * Indented doc comment +*/ + +/** + * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. + * The below is "correctly" aligned. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. + * The below is incorrectly aligned. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -16,6 +16,21 @@ /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + $config->tabWidth = 4; + + }//end setCliValues() + + + /** * Returns the lines where errors should occur. * * The key of the array should represent the line number and the value @@ -64,6 +79,15 @@ 206 => 1, 211 => 1, 214 => 4, + 218 => 1, + 220 => 2, + 222 => 1, + 224 => 3, + 243 => 1, + 244 => 1, + 246 => 1, + 248 => 1, + 249 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,240 @@ + 0; $i--) echo 'hello'; + +while ($something) echo 'hello'; + +do { + $i--; +} while ($something); + +if(true) + $someObject->{$name}; + +if (true) : + $foo = true; +endif; + +while (true) : + $foo = true; +endwhile; + +for ($i; $i > 0; $i--) : + echo 'hello'; +endfor; + +foreach ($array as $element) : + echo 'hello'; +endforeach; + +while (!$this->readLine($tokens, $tag)); +while (!$this->readLine($tokens, $tag)); //skip to end of file + +foreach ($cookies as $cookie) + if ($cookie->match($uri, $matchSessionCookies, $now)) + $ret[] = $cookie; + +foreach ($stringParade as $hit) + $hitParade[] = $hit + 0; //cast to integer + +if ($foo) : + echo 'true'; +elseif ($something) : + echo 'foo'; +else: + echo 'false'; +endif; + +function test() +{ + if ($a) + $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); +} + +if ($a) + foreach ($b as $c) { + if ($d) { + $e=$f; + $g=$h; + } elseif ($i==0) { + $j=$k; + } + } + +?> +
    + scenario == 'simple') $widget->renderPager() ?> +
    + +error): + case Shop_Customer :: ERROR_INVALID_GENDER: ?> + Ungültiges Geschlecht! + + Die eingetragene E-Mail-Adresse ist bereits registriert. + allowShopping !== true): + if ($this->status != Shop_Cart :: OK): + switch ($this->status): + case Shop_Cart :: NOT_FOUND: + echo 'foo'; + endswitch; + endif; +else: + echo 'foo'; +endif; + +// ELSE IF split over multiple lines (not inline) +if ($test) { +} else + if ($test) { + } else { + } + +switch($response = \Bar::baz('bat', function ($foo) { + return 'bar'; +})) { + case 1: + return 'test'; + + case 2: + return 'other'; +} + +$stuff = [1,2,3]; +foreach($stuff as $num) + if ($num %2 ) { + echo "even"; + } else { + echo "odd"; + } + +$i = 0; +foreach($stuff as $num) + do { + echo $i; + $i++; + } while ($i < 5); + +foreach($stuff as $num) + if (true) { + echo "true1\n"; + } + if (true) { + echo "true2\n"; + } + +if ($foo) echo 'foo'; +elseif ($bar) echo 'bar'; +else echo 'baz'; + +switch ($type) { + case 1: + if ($foo) { + return true; + } elseif ($baz) + return true; + else { + echo 'else'; + } + break; +} + +foreach ($sql as $s) + if (!$this->execute) echo "
    ",$s.";\n
    "; + else { + $ok = $this->connDest->Execute($s); + if (!$ok) + if ($this->neverAbort) $ret = false; + else return false; + } + +if ($bar) + if ($foo) echo 'hi'; // lol + +if ($level == 'district') + \DB::update(<< $num) + return bar( + baz( + "foobarbaz" + ) + ); + break; +} + +do { + $i++; +} +// Comment +while ($i < 10); + +if ($this) { + if ($that) + foo(${$a[$b]}); +} + +while (!$this->readLine($tokens, $tag)); //phpcs:ignore Standard.Category.Sniff + +while (!$this->readLine($tokens, $tag)); // comment + +while (!$this->readLine($tokens, $tag)); /* comment */ + +foreach ($stringParade as $hit) + $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff + +if ($bar) + if ($foo) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ + +if (true) $callable = function () { + return true; +}; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,275 @@ + 0; $i--) { echo 'hello'; +} + +while ($something) { echo 'hello'; +} + +do { + $i--; +} while ($something); + +if(true) { + $someObject->{$name}; +} + +if (true) : + $foo = true; +endif; + +while (true) : + $foo = true; +endwhile; + +for ($i; $i > 0; $i--) : + echo 'hello'; +endfor; + +foreach ($array as $element) : + echo 'hello'; +endforeach; + +while (!$this->readLine($tokens, $tag)) {} +while (!$this->readLine($tokens, $tag)) { +//skip to end of file +} +foreach ($cookies as $cookie) { + if ($cookie->match($uri, $matchSessionCookies, $now)) { + $ret[] = $cookie; + } +} + +foreach ($stringParade as $hit) { + $hitParade[] = $hit + 0; //cast to integer +} + +if ($foo) : + echo 'true'; +elseif ($something) : + echo 'foo'; +else: + echo 'false'; +endif; + +function test() +{ + if ($a) { + $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); + } +} + +if ($a) { + foreach ($b as $c) { + if ($d) { + $e=$f; + $g=$h; + } elseif ($i==0) { + $j=$k; + } + } +} + +?> +
    + scenario == 'simple') { $widget->renderPager(); } ?> +
    + +error): + case Shop_Customer :: ERROR_INVALID_GENDER: ?> + Ungültiges Geschlecht! + + Die eingetragene E-Mail-Adresse ist bereits registriert. + allowShopping !== true): + if ($this->status != Shop_Cart :: OK): + switch ($this->status): + case Shop_Cart :: NOT_FOUND: + echo 'foo'; + endswitch; + endif; +else: + echo 'foo'; +endif; + +// ELSE IF split over multiple lines (not inline) +if ($test) { +} else + if ($test) { + } else { + } + +switch($response = \Bar::baz('bat', function ($foo) { + return 'bar'; +})) { + case 1: + return 'test'; + + case 2: + return 'other'; +} + +$stuff = [1,2,3]; +foreach($stuff as $num) { + if ($num %2 ) { + echo "even"; + } else { + echo "odd"; + } +} + +$i = 0; +foreach($stuff as $num) { + do { + echo $i; + $i++; + } while ($i < 5); +} + +foreach($stuff as $num) { + if (true) { + echo "true1\n"; + } +} + if (true) { + echo "true2\n"; + } + +if ($foo) { echo 'foo'; +} elseif ($bar) { echo 'bar'; +} else { echo 'baz'; +} + +switch ($type) { + case 1: + if ($foo) { + return true; + } elseif ($baz) { + return true; + } else { + echo 'else'; + } + break; +} + +foreach ($sql as $s) { + if (!$this->execute) { echo "
    ",$s.";\n
    "; + } else { + $ok = $this->connDest->Execute($s); + if (!$ok) { + if ($this->neverAbort) { $ret = false; + } else { return false; + } + } + } +} + +if ($bar) { + if ($foo) { echo 'hi'; // lol + } +} + +if ($level == 'district') { + \DB::update(<< $num) { + return bar( + baz( + "foobarbaz" + ) + ); + } + break; +} + +do { + $i++; +} +// Comment +while ($i < 10); + +if ($this) { + if ($that) { + foo(${$a[$b]}); + } +} + +while (!$this->readLine($tokens, $tag)) {} //phpcs:ignore Standard.Category.Sniff + +while (!$this->readLine($tokens, $tag)) { +// comment +} +while (!$this->readLine($tokens, $tag)) { /* comment */ + +} +foreach ($stringParade as $hit) { + $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff +} +if ($bar) { + if ($foo) { echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ + } +} +if (true) { $callable = function () { + return true; +}; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.2.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.2.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,8 @@ + 0; $i--) echo 'hello'; - -while ($something) echo 'hello'; - -do { - $i--; -} while ($something); - -if(true) - $someObject->{$name}; - -if (true) : - $foo = true; -endif; - -while (true) : - $foo = true; -endwhile; - -for ($i; $i > 0; $i--) : - echo 'hello'; -endfor; - -foreach ($array as $element) : - echo 'hello'; -endforeach; - -while (!$this->readLine($tokens, $tag)); -while (!$this->readLine($tokens, $tag)); //skip to end of file - -foreach ($cookies as $cookie) - if ($cookie->match($uri, $matchSessionCookies, $now)) - $ret[] = $cookie; - -foreach ($stringParade as $hit) - $hitParade[] = $hit + 0; //cast to integer - -if ($foo) : - echo 'true'; -elseif ($something) : - echo 'foo'; -else: - echo 'false'; -endif; - -function test() -{ - if ($a) - $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); -} - -if ($a) - foreach ($b as $c) { - if ($d) { - $e=$f; - $g=$h; - } elseif ($i==0) { - $j=$k; - } - } - -?> -
    - scenario == 'simple') $widget->renderPager() ?> -
    - -error): - case Shop_Customer :: ERROR_INVALID_GENDER: ?> - Ungültiges Geschlecht! - - Die eingetragene E-Mail-Adresse ist bereits registriert. - allowShopping !== true): - if ($this->status != Shop_Cart :: OK): - switch ($this->status): - case Shop_Cart :: NOT_FOUND: - echo 'foo'; - endswitch; - endif; -else: - echo 'foo'; -endif; - -// ELSE IF split over multiple lines (not inline) -if ($test) { -} else - if ($test) { - } else { - } - -switch($response = \Bar::baz('bat', function ($foo) { - return 'bar'; -})) { - case 1: - return 'test'; - - case 2: - return 'other'; -} - -$stuff = [1,2,3]; -foreach($stuff as $num) - if ($num %2 ) { - echo "even"; - } else { - echo "odd"; - } - -$i = 0; -foreach($stuff as $num) - do { - echo $i; - $i++; - } while ($i < 5); - -foreach($stuff as $num) - if (true) { - echo "true1\n"; - } - if (true) { - echo "true2\n"; - } - -if ($foo) echo 'foo'; -elseif ($bar) echo 'bar'; -else echo 'baz'; - -switch ($type) { - case 1: - if ($foo) { - return true; - } elseif ($baz) - return true; - else { - echo 'else'; - } - break; -} - -foreach ($sql as $s) - if (!$this->execute) echo "
    ",$s.";\n
    "; - else { - $ok = $this->connDest->Execute($s); - if (!$ok) - if ($this->neverAbort) $ret = false; - else return false; - } - -if ($bar) - if ($foo) echo 'hi'; // lol - -if ($level == 'district') - \DB::update(<< $num) - return bar( - baz( - "foobarbaz" - ) - ); - break; -} - -do { - $i++; -} -// Comment -while ($i < 10); - -if ($this) { - if ($that) - foo(${$a[$b]}); -} - -while (!$this->readLine($tokens, $tag)); //phpcs:ignore Standard.Category.Sniff - -while (!$this->readLine($tokens, $tag)); // comment - -while (!$this->readLine($tokens, $tag)); /* comment */ - -foreach ($stringParade as $hit) - $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff - -if ($bar) - if ($foo) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ - -if (true) $callable = function () { - return true; -}; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ - 0; $i--) { echo 'hello'; -} - -while ($something) { echo 'hello'; -} - -do { - $i--; -} while ($something); - -if(true) { - $someObject->{$name}; -} - -if (true) : - $foo = true; -endif; - -while (true) : - $foo = true; -endwhile; - -for ($i; $i > 0; $i--) : - echo 'hello'; -endfor; - -foreach ($array as $element) : - echo 'hello'; -endforeach; - -while (!$this->readLine($tokens, $tag)) {} -while (!$this->readLine($tokens, $tag)) { -//skip to end of file -} -foreach ($cookies as $cookie) { - if ($cookie->match($uri, $matchSessionCookies, $now)) { - $ret[] = $cookie; - } -} - -foreach ($stringParade as $hit) { - $hitParade[] = $hit + 0; //cast to integer -} - -if ($foo) : - echo 'true'; -elseif ($something) : - echo 'foo'; -else: - echo 'false'; -endif; - -function test() -{ - if ($a) { - $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); - } -} - -if ($a) { - foreach ($b as $c) { - if ($d) { - $e=$f; - $g=$h; - } elseif ($i==0) { - $j=$k; - } - } -} - -?> -
    - scenario == 'simple') { $widget->renderPager(); } ?> -
    - -error): - case Shop_Customer :: ERROR_INVALID_GENDER: ?> - Ungültiges Geschlecht! - - Die eingetragene E-Mail-Adresse ist bereits registriert. - allowShopping !== true): - if ($this->status != Shop_Cart :: OK): - switch ($this->status): - case Shop_Cart :: NOT_FOUND: - echo 'foo'; - endswitch; - endif; -else: - echo 'foo'; -endif; - -// ELSE IF split over multiple lines (not inline) -if ($test) { -} else - if ($test) { - } else { - } - -switch($response = \Bar::baz('bat', function ($foo) { - return 'bar'; -})) { - case 1: - return 'test'; - - case 2: - return 'other'; -} - -$stuff = [1,2,3]; -foreach($stuff as $num) { - if ($num %2 ) { - echo "even"; - } else { - echo "odd"; - } -} - -$i = 0; -foreach($stuff as $num) { - do { - echo $i; - $i++; - } while ($i < 5); -} - -foreach($stuff as $num) { - if (true) { - echo "true1\n"; - } -} - if (true) { - echo "true2\n"; - } - -if ($foo) { echo 'foo'; -} elseif ($bar) { echo 'bar'; -} else { echo 'baz'; -} - -switch ($type) { - case 1: - if ($foo) { - return true; - } elseif ($baz) { - return true; - } else { - echo 'else'; - } - break; -} - -foreach ($sql as $s) { - if (!$this->execute) { echo "
    ",$s.";\n
    "; - } else { - $ok = $this->connDest->Execute($s); - if (!$ok) { - if ($this->neverAbort) { $ret = false; - } else { return false; - } - } - } -} - -if ($bar) { - if ($foo) { echo 'hi'; // lol - } -} - -if ($level == 'district') { - \DB::update(<< $num) { - return bar( - baz( - "foobarbaz" - ) - ); - } - break; -} - -do { - $i++; -} -// Comment -while ($i < 10); - -if ($this) { - if ($that) { - foo(${$a[$b]}); - } -} - -while (!$this->readLine($tokens, $tag)) {} //phpcs:ignore Standard.Category.Sniff - -while (!$this->readLine($tokens, $tag)) { -// comment -} -while (!$this->readLine($tokens, $tag)) { /* comment */ - -} -foreach ($stringParade as $hit) { - $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff -} -if ($bar) { - if ($foo) { echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ - } -} -if (true) { $callable = function () { - return true; -}; -} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -25,10 +25,10 @@ * * @return array */ - public function getErrorList($testFile='InlineControlStructureUnitTest.inc') + public function getErrorList($testFile='InlineControlStructureUnitTest.1.inc') { switch ($testFile) { - case 'InlineControlStructureUnitTest.inc': + case 'InlineControlStructureUnitTest.1.inc': return [ 3 => 1, 7 => 1, @@ -76,7 +76,7 @@ 236 => 1, 238 => 1, ]; - break; + case 'InlineControlStructureUnitTest.js': return [ 3 => 1, @@ -88,10 +88,9 @@ 27 => 1, 30 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,6 @@ +/*csslint important: true, order-alphabetical: true, zero-units: true */ + +.selector-with-errors { + font-size: 10px !important; + border: 0px; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,70 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Config; + +class CSSLintUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Should this test be skipped for some reason. + * + * @return void + */ + protected function shouldSkipTest() + { + $csslintPath = Config::getExecutablePath('csslint'); + if ($csslintPath === null) { + return true; + } + + return false; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//end getErrorList() + + + /** + * Returns the lines where warnings should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of warnings that should occur on that line. + * + * @return array + */ + public function getWarningList() + { + return [ + 3 => 1, + 4 => 1, + 5 => 1, + ]; + + }//end getWarningList() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.js Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,6 @@ +/** + * My function + */ +function something() { + return a; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,69 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Config; + +class ClosureLinterUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Should this test be skipped for some reason. + * + * @return void + */ + protected function shouldSkipTest() + { + $lintPath = Config::getExecutablePath('gjslint'); + if ($lintPath === null) { + return true; + } + + return false; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//end getErrorList() + + + /** + * Returns the lines where warnings should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of warnings that should occur on that line. + * + * @return array + */ + public function getWarningList() + { + return [ + 3 => 1, + 5 => 1, + ]; + + }//end getWarningList() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.js Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +var foo = bar; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,113 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Config; + +class ESLintUnitTest extends AbstractSniffUnitTest +{ + + /** + * Basic ESLint config to use for testing the sniff. + * + * @var string + */ + const ESLINT_CONFIG = '{ + "parserOptions": { + "ecmaVersion": 5, + "sourceType": "script", + "ecmaFeatures": {} + }, + "rules": { + "no-undef": 2, + "no-unused-vars": 2 + } +}'; + + + /** + * Sets up this unit test. + * + * @return void + */ + protected function setUp() + { + parent::setUp(); + + $cwd = getcwd(); + file_put_contents($cwd.'/.eslintrc.json', self::ESLINT_CONFIG); + + }//end setUp() + + + /** + * Remove artifact. + * + * @return void + */ + protected function tearDown() + { + parent::tearDown(); + + $cwd = getcwd(); + unlink($cwd.'/.eslintrc.json'); + + }//end tearDown() + + + /** + * Should this test be skipped for some reason. + * + * @return void + */ + protected function shouldSkipTest() + { + $eslintPath = Config::getExecutablePath('eslint'); + if ($eslintPath === null) { + return true; + } + + return false; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [1 => 2]; + + }//end getErrorList() + + + /** + * Returns the lines where warnings should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of warnings that should occur on that line. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.js Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,3 @@ +/* jshint undef: true, unused: true */ + +var foo = bar; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,67 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Config; + +class JSHintUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Should this test be skipped for some reason. + * + * @return void + */ + protected function shouldSkipTest() + { + $rhinoPath = Config::getExecutablePath('rhino'); + $jshintPath = Config::getExecutablePath('jshint'); + if ($rhinoPath === null && $jshintPath === null) { + return true; + } + + return false; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//end getErrorList() + + + /** + * Returns the lines where warnings should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of warnings that should occur on that line. + * + * @return array + */ + public function getWarningList() + { + return [3 => 2]; + + }//end getWarningList() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ + +#login-container {} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.js.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.js.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ + +alert('hi); \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.6.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.6.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ + 1]; - case 'EndFileNoNewlineUnitTest.5.inc': - return []; default: return []; }//end switch diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,3 @@ +#login-container { + margin-left: -225px; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.js.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.js.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ +alert('hi'); +alert('hi'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -11,3 +11,6 @@
    + +wizardid = 10; +$this->paint(); +echo 'x'; +?> +
    +
    +
    +
    + + 1, - 6 => 1, - 7 => 1, - 8 => 2, + 2 => 1, + 6 => 1, + 7 => 1, + 8 => 2, + 16 => 2, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -183,7 +183,7 @@ // Valid $error = false; -while (list($h, $f) = each($handle)) { +while (list($h, $f) = getKeyAndValue($handle)) { $error = true; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -183,7 +183,7 @@ // Valid $error = false; -while (list($h, $f) = each($handle)) { +while (list($h, $f) = getKeyAndValue($handle)) { $error = true; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js Thu May 09 15:33:08 2019 +0100 @@ -83,7 +83,7 @@ var spinButtonid = [this.id, '-positionFormats-spinButton'].join(''); var spinButtonWidget = WidgetStore.get(spinButtonid); var position = spinButtonWidget.getValue(); -var posForamatsList = WidgetStore.get([self.id, '-positionFormats-list'].join('')); +var posFormatsList = WidgetStore.get([self.id, '-positionFormats-list'].join('')); dfx.stripTags = function(content, allowedTags) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed Thu May 09 15:33:08 2019 +0100 @@ -83,7 +83,7 @@ var spinButtonid = [this.id, '-positionFormats-spinButton'].join(''); var spinButtonWidget = WidgetStore.get(spinButtonid); var position = spinButtonWidget.getValue(); -var posForamatsList = WidgetStore.get([self.id, '-positionFormats-list'].join('')); +var posFormatsList = WidgetStore.get([self.id, '-positionFormats-list'].join('')); dfx.stripTags = function(content, allowedTags) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -133,3 +133,19 @@ ,'e' // phpcs:ignore Standard.Category.Sniff -- for reasons. , 'f' ); + +$foobar = php73_function_call_trailing_comma( + $foo, + $bar, +); + +$foobar = functionCallAnonClassParam( + new class() { + public $foo=1; + public function methodName($param='foo',$paramTwo='bar') { + $bar=false; + $foo = array(1,2,3); + } + }, + $args=array(), +); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -133,3 +133,19 @@ 'e', // phpcs:ignore Standard.Category.Sniff -- for reasons. 'f' ); + +$foobar = php73_function_call_trailing_comma( + $foo, + $bar, +); + +$foobar = functionCallAnonClassParam( + new class() { + public $foo=1; + public function methodName($param='foo',$paramTwo='bar') { + $bar=false; + $foo = array(1,2,3); + } + }, + $args = array(), +); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -52,6 +52,7 @@ 132 => 2, 133 => 2, 134 => 1, + 150 => 2, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -2,7 +2,7 @@ function complexityOne() { } -function comlexityFive() +function complexityFive() { if ($condition) { } @@ -17,7 +17,7 @@ } } -function comlexityTen() +function complexityTen() { while ($condition === true) { if ($condition) { @@ -42,7 +42,7 @@ } } -function comlexityEleven() +function complexityEleven() { while ($condition === true) { if ($condition) { @@ -69,7 +69,7 @@ } -function comlexityTwenty() +function complexityTwenty() { while ($condition === true) { if ($condition) { @@ -113,7 +113,7 @@ } -function comlexityTwentyOne() +function complexityTwentyOne() { while ($condition === true) { if ($condition) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,4 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +class DeprecatedFunctionsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + $errors = []; + + if (PHP_VERSION_ID >= 70200) { + $errors[3] = 1; + } + + if (PHP_VERSION_ID >= 70300) { + $errors[4] = 1; + } + + return $errors; + + }//end getErrorList() + + + /** + * Returns the lines where warnings should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of warnings that should occur on that line. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -28,7 +28,7 @@ $aspTags = false; if (PHP_VERSION_ID < 70000) { - $aspTags = (boolean) ini_get('asp_tags'); + $aspTags = (bool) ini_get('asp_tags'); } if ($aspTags === true) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -26,7 +26,7 @@ { $testFiles = [$testFileBase.'1.inc']; - $option = (boolean) ini_get('short_open_tag'); + $option = (bool) ini_get('short_open_tag'); if ($option === true) { $testFiles[] = $testFileBase.'2.inc'; } else { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -10,7 +10,6 @@ namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; -use PHP_CodeSniffer\Config; use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; class SyntaxUnitTest extends AbstractSniffUnitTest diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,3 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +class SubversionPropertiesUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Should this test be skipped for some reason. + * + * @return void + */ + protected function shouldSkipTest() + { + // This sniff cannot be tested as no SVN version control directory is available. + return true; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//end getErrorList() + + + /** + * Returns the lines where warnings should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of warnings that should occur on that line. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc Thu May 09 15:33:08 2019 +0100 @@ -1294,6 +1294,26 @@ break; } +// phpcs:set Generic.WhiteSpace.ScopeIndent exact true +$shortArray = [ + 'hello', +'world', +]; + +$shortArray = array( + 'hello', +'world', +); + +function foo() { + echo 'foo'; + echo 'bar'; + if ($foo) { + echo 'baz'; + } +} +// phpcs:set Generic.WhiteSpace.ScopeIndent exact false + function test() { return [ <<<'SQLDATA' @@ -1332,6 +1352,61 @@ } ?> +
    + +
    + + +
    + + + +
    + + +
    + +
    + + +
    + + + +
    + + +
    + +
    + + +
    + + + +
    + + +
    + +
    + + +
    + + + +
    + + 1, 10 => 1, @@ -162,20 +166,22 @@ 1290 => 1, 1292 => 1, 1293 => 1, - 1307 => 1, - 1308 => 1, - 1309 => 1, 1310 => 1, - 1311 => 1, 1312 => 1, - 1315 => 1, - 1320 => 1, - 1322 => 1, - 1325 => 1, - 1336 => 1, - 1337 => 1, - 1338 => 1, - 1339 => 1, + 1327 => 1, + 1328 => 1, + 1329 => 1, + 1330 => 1, + 1331 => 1, + 1332 => 1, + 1335 => 1, + 1340 => 1, + 1342 => 1, + 1345 => 1, + 1411 => 1, + 1412 => 1, + 1413 => 1, + 1414 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php Thu May 09 15:33:08 2019 +0100 @@ -42,7 +42,7 @@ /** - * Constructs a Squiz_Sniffs_Scope_MethodScopeSniff. + * Constructs an AbstractScopeSniff. */ public function __construct() { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php Thu May 09 15:33:08 2019 +0100 @@ -141,8 +141,9 @@ // Note that we use this endBracket down further when checking // for a RETURN statement. - $endBracket = end($tokens[$i]['nested_parenthesis']); - $bracket = key($tokens[$i]['nested_parenthesis']); + $nestedParens = $tokens[$i]['nested_parenthesis']; + $endBracket = end($nestedParens); + $bracket = key($nestedParens); $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php Thu May 09 15:33:08 2019 +0100 @@ -47,7 +47,12 @@ // Make sure it is an API function. We know this by the doc comment. $commentEnd = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, $stackPtr); $commentStart = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($commentEnd - 1)); - $comment = $phpcsFile->getTokensAsString($commentStart, ($commentEnd - $commentStart)); + // If function doesn't contain any doc comments - skip it. + if ($commentEnd === false || $commentStart === false) { + return; + } + + $comment = $phpcsFile->getTokensAsString($commentStart, ($commentEnd - $commentStart)); if (strpos($comment, '* @api') === false) { return; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js Thu May 09 15:33:08 2019 +0100 @@ -30,7 +30,7 @@ callback.call(self, div); }); - // Never good to return a vaue. + // Never good to return a value. return something; callback.call(self); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -1,4 +1,8 @@ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -41,12 +41,12 @@ public function getWarningList() { return [ - 37 => 1, - 49 => 1, - 60 => 1, - 73 => 1, - 88 => 1, - 118 => 1, + 41 => 1, + 53 => 1, + 64 => 1, + 77 => 1, + 92 => 1, + 122 => 1, ]; }//end getWarningList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -101,9 +101,16 @@ if ($tokens[($curlyBrace + 1)]['content'] !== $phpcsFile->eolChar) { $error = 'Opening %s brace must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); - if ($fix === true) { - $phpcsFile->fixer->addNewline($curlyBrace); + + $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($curlyBrace + 1), null, true); + if ($tokens[$nextNonWhitespace]['code'] === T_PHPCS_IGNORE) { + // Don't auto-fix if the next thing is a PHPCS ignore annotation. + $phpcsFile->addError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); + } else { + $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); + if ($fix === true) { + $phpcsFile->fixer->addNewline($curlyBrace); + } } } @@ -112,8 +119,7 @@ if ($prevContent === $phpcsFile->eolChar) { $spaces = 0; } else { - $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); - $spaces = strlen($blankSpace); + $spaces = $tokens[($curlyBrace - 1)]['length']; } $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -161,7 +161,7 @@ T_PROPERTY, ]; - if (in_array($tokens[$nextToken]['code'], $ignore) === true) { + if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); return ($phpcsFile->numTokens + 1); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php Thu May 09 15:33:08 2019 +0100 @@ -73,7 +73,7 @@ if (strpos($tokens[($openBracket + 1)]['content'], $phpcsFile->eolChar) !== false) { $spaceAfterOpen = 'newline'; } else { - $spaceAfterOpen = strlen($tokens[($openBracket + 1)]['content']); + $spaceAfterOpen = $tokens[($openBracket + 1)]['length']; } } @@ -100,7 +100,7 @@ } if ($i >= 0 && $tokens[$i]['code'] === T_WHITESPACE) { - $statementIndent = strlen($tokens[$i]['content']); + $statementIndent = $tokens[$i]['length']; } // Each line between the parenthesis should be indented 4 spaces @@ -157,7 +157,7 @@ if ($tokens[$i]['code'] !== T_WHITESPACE) { $foundIndent = 0; } else { - $foundIndent = strlen($tokens[$i]['content']); + $foundIndent = $tokens[$i]['length']; } if ($expectedIndent !== $foundIndent) { @@ -247,7 +247,7 @@ } else if ($openBrace === ($closeBracket + 2) && $tokens[($closeBracket + 1)]['code'] === T_WHITESPACE ) { - $length = strlen($tokens[($closeBracket + 1)]['content']); + $length = $tokens[($closeBracket + 1)]['length']; } else { // Confused, so don't check. $length = 1; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -83,14 +83,14 @@ } if ($tokens[$i]['code'] === T_WHITESPACE) { - $assignmentIndent = strlen($tokens[$i]['content']); + $assignmentIndent = $tokens[$i]['length']; } // Find the actual indent. $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1)); $expectedIndent = ($assignmentIndent + $this->indent); - $foundIndent = strlen($tokens[$prev]['content']); + $foundIndent = $tokens[$prev]['length']; if ($foundIndent !== $expectedIndent) { $error = 'Multi-line assignment not indented correctly; expected %s spaces but found %s'; $data = [ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php Thu May 09 15:33:08 2019 +0100 @@ -176,7 +176,7 @@ * @param array $tokens The stack of tokens that make up * the file. * - * @return void + * @return bool */ public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) { @@ -230,7 +230,7 @@ } else if ($requiredSpacesAfterOpen > 0) { $spaceAfterOpen = 0; if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = strlen($tokens[($openBracket + 1)]['content']); + $spaceAfterOpen = $tokens[($openBracket + 1)]['length']; } if ($spaceAfterOpen !== $requiredSpacesAfterOpen) { @@ -262,7 +262,7 @@ if ($tokens[$prev]['line'] !== $tokens[$closer]['line']) { $spaceBeforeClose = 'newline'; } else if ($tokens[($closer - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = strlen($tokens[($closer - 1)]['content']); + $spaceBeforeClose = $tokens[($closer - 1)]['length']; } if ($spaceBeforeClose !== $requiredSpacesBeforeClose) { @@ -505,7 +505,7 @@ $foundIndent = 0; } } else { - $foundIndent = strlen($tokens[$i]['content']); + $foundIndent = $tokens[$i]['length']; } if ($foundIndent < $expectedIndent diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -80,7 +80,7 @@ if ($tokens[($stackPtr + 1)]['content'] === $phpcsFile->eolChar) { $spaces = 'newline'; } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $spaces = strlen($tokens[($stackPtr + 1)]['content']); + $spaces = $tokens[($stackPtr + 1)]['length']; } else { $spaces = 0; } @@ -110,7 +110,7 @@ if ($tokens[($openBracket - 1)]['content'] === $phpcsFile->eolChar) { $spaces = 'newline'; } else if ($tokens[($openBracket - 1)]['code'] === T_WHITESPACE) { - $spaces = strlen($tokens[($openBracket - 1)]['content']); + $spaces = $tokens[($openBracket - 1)]['length']; } else { $spaces = 0; } @@ -130,7 +130,7 @@ if ($tokens[($end - 1)]['content'] === $phpcsFile->eolChar) { $spaces = 'newline'; } else if ($tokens[($end - 1)]['code'] === T_WHITESPACE) { - $spaces = strlen($tokens[($end - 1)]['content']); + $spaces = $tokens[($end - 1)]['length']; } else { $spaces = 0; } @@ -155,7 +155,7 @@ } else if ($tokens[($use + 1)]['content'] === "\t") { $length = '\t'; } else { - $length = strlen($tokens[($use + 1)]['content']); + $length = $tokens[($use + 1)]['length']; } if ($length !== 1) { @@ -176,7 +176,7 @@ } else if ($tokens[($use - 1)]['content'] === "\t") { $length = '\t'; } else { - $length = strlen($tokens[($use - 1)]['content']); + $length = $tokens[($use - 1)]['length']; } if ($length !== 1) { @@ -214,7 +214,7 @@ * @param array $tokens The stack of tokens that make up * the file. * - * @return void + * @return bool */ public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) { @@ -296,7 +296,7 @@ $i++; if ($tokens[$i]['code'] === T_WHITESPACE) { - $functionIndent = strlen($tokens[$i]['content']); + $functionIndent = $tokens[$i]['length']; } // The closing parenthesis must be on a new line, even @@ -377,7 +377,7 @@ $phpcsFile->fixer->replaceToken($i, ''); } } else { - $foundIndent = strlen($tokens[$i]['content']); + $foundIndent = $tokens[$i]['length']; } if ($expectedIndent !== $foundIndent) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -73,7 +73,7 @@ $requiredIndent = 0; if ($i >= 0 && $tokens[$i]['code'] === T_WHITESPACE) { - $requiredIndent = strlen($tokens[$i]['content']); + $requiredIndent = $tokens[$i]['length']; } $requiredIndent += $this->indent; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,112 @@ +setLogger(new class {}); + +var_dump(new class(10) extends SomeClass implements SomeInterface { + private $num; + + public function __construct($num) + { + $this->num = $num; + } + + use SomeTrait; +}); + +class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ { +} + +class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration +/* Comment */ +{ +} + +// Don't move phpcs:ignore comments. +class PHPCSIgnoreAnnotationAfterOpeningBrace +{ // phpcs:ignore Standard.Cat.Sniff -- for reasons. +} + +// Moving any of the other trailing phpcs: comments is ok. +class PHPCSAnnotationAfterOpeningBrace +{ // phpcs:disable Standard.Cat.Sniff -- for reasons. +} + +if (!class_exists('ClassOpeningBraceShouldBeIndented')) { + abstract class ClassOpeningBraceShouldBeIndented +{ +} +} + +if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { + final class ClassOpeningBraceTooMuchIndentation + { + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,121 @@ +setLogger(new class {}); + +var_dump(new class(10) extends SomeClass implements SomeInterface { + private $num; + + public function __construct($num) + { + $this->num = $num; + } + + use SomeTrait; +}); + +class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ +{ +} + +class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration +/* Comment */ +{ +} + +// Don't move phpcs:ignore comments. +class PHPCSIgnoreAnnotationAfterOpeningBrace +{ // phpcs:ignore Standard.Cat.Sniff -- for reasons. +} + +// Moving any of the other trailing phpcs: comments is ok. +class PHPCSAnnotationAfterOpeningBrace +{ + // phpcs:disable Standard.Cat.Sniff -- for reasons. +} + +if (!class_exists('ClassOpeningBraceShouldBeIndented')) { + abstract class ClassOpeningBraceShouldBeIndented + { +} +} + +if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { + final class ClassOpeningBraceTooMuchIndentation + { + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,11 @@ +setLogger(new class {}); - -var_dump(new class(10) extends SomeClass implements SomeInterface { - private $num; - - public function __construct($num) - { - $this->num = $num; - } - - use SomeTrait; -}); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -16,24 +16,56 @@ /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + if ($testFile === 'ClassDeclarationUnitTest.1.inc') { + return; + } + + $config->tabWidth = 4; + + }//end setCliValues() + + + /** * Returns the lines where errors should occur. * * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * + * @param string $testFile The name of the file being tested. + * * @return array */ - public function getErrorList() + public function getErrorList($testFile='') { - return [ - 21 => 1, - 22 => 1, - 23 => 1, - 27 => 1, - 33 => 1, - 38 => 1, - 49 => 1, - ]; + switch ($testFile) { + case 'ClassDeclarationUnitTest.1.inc': + return [ + 21 => 1, + 22 => 1, + 23 => 1, + 27 => 1, + 33 => 1, + 38 => 1, + 49 => 1, + 84 => 1, + 94 => 1, + 99 => 1, + 104 => 1, + 110 => 1, + ]; + + default: + return []; + }//end switch }//end getErrorList() @@ -44,11 +76,17 @@ * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * + * @param string $testFile The name of the file being tested. + * * @return array */ - public function getWarningList() + public function getWarningList($testFile='') { - return []; + if ($testFile === 'ClassDeclarationUnitTest.2.inc') { + return [11 => 1]; + } + + return[]; }//end getWarningList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,29 @@ + + + + + + + doBar() + { + } +} + ]]> + + + do_bar() + { + } +} + ]]> + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -1,6 +1,6 @@ * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) @@ -87,8 +87,8 @@ return; } - $error = 'Parenthesis must be used when instantiating a new class'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MissingParenthesis'); + $error = 'Parentheses must be used when instantiating a new class'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MissingParentheses'); if ($fix === true) { $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($classNameEnd - 1), null, true); $phpcsFile->fixer->addContent($prev, '()'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -11,7 +11,6 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; class NullableTypeDeclarationSniff implements Sniff { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php Thu May 09 15:33:08 2019 +0100 @@ -42,24 +42,31 @@ */ public function process(File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); + $tokens = $phpcsFile->getTokens(); + $typecast = str_replace(' ', '', $tokens[$stackPtr]['content']); + $typecast = str_replace("\t", '', $typecast); + $typecast = trim($typecast, '()'); + $typecastLc = strtolower($typecast); if (($tokens[$stackPtr]['code'] === T_BOOL_CAST - && strtolower($tokens[$stackPtr]['content']) === '(bool)') + && $typecastLc === 'bool') || ($tokens[$stackPtr]['code'] === T_INT_CAST - && strtolower($tokens[$stackPtr]['content']) === '(int)') + && $typecastLc === 'int') ) { return; } - $error = 'Short form type keywords must be used'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'LongFound'); + $error = 'Short form type keywords must be used. Found: %s'; + $data = [$tokens[$stackPtr]['content']]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'LongFound', $data); if ($fix === true) { if ($tokens[$stackPtr]['code'] === T_BOOL_CAST) { - $phpcsFile->fixer->replaceToken($stackPtr, '(bool)'); + $replacement = str_replace($typecast, 'bool', $tokens[$stackPtr]['content']); } else { - $phpcsFile->fixer->replaceToken($stackPtr, '(int)'); + $replacement = str_replace($typecast, 'int', $tokens[$stackPtr]['content']); } + + $phpcsFile->fixer->replaceToken($stackPtr, $replacement); } }//end process() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -24,20 +24,16 @@ */ public function register() { - return array_unique( - array_merge( - Tokens::$comparisonTokens, - Tokens::$operators, - Tokens::$assignmentTokens, - Tokens::$booleanOperators, - [ - T_INLINE_THEN, - T_INLINE_ELSE, - T_STRING_CONCAT, - T_INSTANCEOF, - ] - ) - ); + $targets = Tokens::$comparisonTokens; + $targets += Tokens::$operators; + $targets += Tokens::$assignmentTokens; + $targets += Tokens::$booleanOperators; + $targets[] = T_INLINE_THEN; + $targets[] = T_INLINE_ELSE; + $targets[] = T_STRING_CONCAT; + $targets[] = T_INSTANCEOF; + + return $targets; }//end register() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -6,3 +6,9 @@ $bar = (int) $foo; $bar = (integer) $foo; $bar = (INT) $foo; + +// Test recognition with whitespace within the cast. +$bar = ( bool ) $foo; +$bar = ( int ) $foo; +$bar = ( boolean ) $foo; +$bar = ( integer) $foo; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -6,3 +6,9 @@ $bar = (int) $foo; $bar = (int) $foo; $bar = (INT) $foo; + +// Test recognition with whitespace within the cast. +$bar = ( bool ) $foo; +$bar = ( int ) $foo; +$bar = ( bool ) $foo; +$bar = ( int) $foo; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -26,9 +26,11 @@ public function getErrorList() { return [ - 3 => 1, - 5 => 1, - 7 => 1, + 3 => 1, + 5 => 1, + 7 => 1, + 13 => 1, + 14 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml Thu May 09 15:33:08 2019 +0100 @@ -10,6 +10,8 @@ + + @@ -85,7 +87,7 @@ - + When a file contains a mix of HTML and PHP, any of the above sections may still be used. If so, they MUST be present at the top of the file, even if the remainder of the code consists of a closing PHP tag and then a mixture of HTML and PHP. --> + + @@ -128,9 +131,9 @@ - + - + @@ -139,11 +142,14 @@ - + + + @@ -177,14 +183,21 @@ - + - + + + + + + + @@ -213,13 +226,19 @@ There MUST be one space between the closing parenthesis and the opening brace The structure body MUST be indented once The closing brace MUST be on the next line after the body - The body of each structure MUST be enclosed by braces. This standardizes how the structures look, and reduces the likelihood of introducing errors as new lines get added to the body. --> + The body of each structure MUST be enclosed by braces. This standardizes how the structures look and reduces the likelihood of introducing errors as new lines get added to the body. --> + + 0 + + + 0 + @@ -245,7 +264,11 @@ - + + + + + @@ -259,9 +282,13 @@ - + + + + + + - @@ -274,10 +301,17 @@ + + - + + + + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -71,7 +71,7 @@ $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); $spaces = strlen($blankSpace); - if (in_array($tokens[($stackPtr - 2)]['code'], [T_ABSTRACT, T_FINAL]) === true + if (in_array($tokens[($stackPtr - 2)]['code'], [T_ABSTRACT, T_FINAL], true) === true && $spaces !== 1 ) { $prevContent = strtolower($tokens[($stackPtr - 2)]['content']); @@ -113,7 +113,7 @@ // We changed lines. if ($tokens[($i + 1)]['code'] === T_WHITESPACE) { - $classIndent = strlen($tokens[($i + 1)]['content']); + $classIndent = $tokens[($i + 1)]['length']; } break; @@ -168,20 +168,37 @@ $fix = $phpcsFile->addFixableError($error, $keyword, ucfirst($keywordType).'Line', $data); if ($fix === true) { $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $keyword; $i++) { - if ($tokens[$i]['line'] !== $tokens[($i + 1)]['line']) { - $phpcsFile->fixer->substrToken($i, 0, (strlen($phpcsFile->eolChar) * -1)); + $comments = []; + + for ($i = ($stackPtr + 1); $i < $keyword; ++$i) { + if ($tokens[$i]['code'] === T_COMMENT) { + $comments[] = trim($tokens[$i]['content']); + } + + if ($tokens[$i]['code'] === T_WHITESPACE + || $tokens[$i]['code'] === T_COMMENT + ) { + $phpcsFile->fixer->replaceToken($i, ' '); } } - $phpcsFile->fixer->addContentBefore($keyword, ' '); + $phpcsFile->fixer->addContent($stackPtr, ' '); + if (empty($comments) === false) { + $i = $keyword; + while ($tokens[($i + 1)]['line'] === $tokens[$keyword]['line']) { + ++$i; + } + + $phpcsFile->fixer->addContentBefore($i, ' '.implode(' ', $comments)); + } + $phpcsFile->fixer->endChangeset(); - } + }//end if } else { // Check the whitespace before. Whitespace after is checked // later by looking at the whitespace before the first class name // in the list. - $gap = strlen($tokens[($keyword - 1)]['content']); + $gap = $tokens[($keyword - 1)]['length']; if ($gap !== 1) { $error = 'Expected 1 space before '.$keywordType.' keyword; %s found'; $data = [$gap]; @@ -231,10 +248,11 @@ $classCount = count($classNames); $checkingImplements = false; $implementsToken = null; - foreach ($classNames as $i => $className) { + foreach ($classNames as $n => $className) { if ($tokens[$className]['code'] === $keywordTokenType) { $checkingImplements = true; $implementsToken = $className; + continue; } @@ -302,7 +320,7 @@ if ($tokens[$prev]['line'] !== $tokens[$className]['line']) { $found = 0; } else { - $found = strlen($tokens[$prev]['content']); + $found = $tokens[$prev]['length']; } $expected = ($classIndent + $this->indent); @@ -344,19 +362,32 @@ $prev = ($className - 1); } - $spaceBefore = strlen($tokens[$prev]['content']); - if ($spaceBefore !== 1) { + $last = $phpcsFile->findPrevious(T_WHITESPACE, $prev, null, true); + $content = $phpcsFile->getTokensAsString(($last + 1), ($prev - $last)); + if ($content !== ' ') { + $found = strlen($content); + $error = 'Expected 1 space before "%s"; %s found'; $data = [ $tokens[$className]['content'], - $spaceBefore, + $found, ]; $fix = $phpcsFile->addFixableError($error, $className, 'SpaceBeforeName', $data); if ($fix === true) { - $phpcsFile->fixer->replaceToken($prev, ' '); + if ($tokens[$prev]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($prev, ' '); + while ($tokens[--$prev]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($prev, ' '); + } + + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->addContent($prev, ' '); + } } - } + }//end if }//end if }//end if @@ -364,14 +395,14 @@ && $tokens[($className + 1)]['code'] !== T_NS_SEPARATOR && $tokens[($className + 1)]['code'] !== T_COMMA ) { - if ($i !== ($classCount - 1)) { + if ($n !== ($classCount - 1)) { // This is not the last class name, and the comma // is not where we expect it to be. if ($tokens[($className + 2)]['code'] !== $keywordTokenType) { $error = 'Expected 0 spaces between "%s" and comma; %s found'; $data = [ $tokens[$className]['content'], - strlen($tokens[($className + 1)]['content']), + $tokens[($className + 1)]['length'], ]; $fix = $phpcsFile->addFixableError($error, $className, 'SpaceBeforeComma', $data); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -38,8 +38,12 @@ // Detect multiple properties defined at the same time. Throw an error // for this, but also only process the first property in the list so we don't // repeat errors. - $find = Tokens::$scopeModifiers; - $find = array_merge($find, [T_VARIABLE, T_VAR, T_SEMICOLON, T_OPEN_CURLY_BRACKET]); + $find = Tokens::$scopeModifiers; + $find[] = T_VARIABLE; + $find[] = T_VAR; + $find[] = T_SEMICOLON; + $find[] = T_OPEN_CURLY_BRACKET; + $prev = $phpcsFile->findPrevious($find, ($stackPtr - 1)); if ($tokens[$prev]['code'] === T_VARIABLE) { return; @@ -61,7 +65,7 @@ if (empty($propertyInfo) === true) { return; } - } catch (Exception $e) { + } catch (\Exception $e) { // Turns out not to be a property after all. return; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -82,7 +82,7 @@ if (strpos($tokens[($parenOpener + 1)]['content'], $phpcsFile->eolChar) !== false) { $spaceAfterOpen = 'newline'; } else { - $spaceAfterOpen = strlen($tokens[($parenOpener + 1)]['content']); + $spaceAfterOpen = $tokens[($parenOpener + 1)]['length']; } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php Thu May 09 15:33:08 2019 +0100 @@ -74,7 +74,7 @@ continue; } - // Don't remove any identation before the brace. + // Don't remove any indentation before the brace. if ($tokens[$i]['line'] === $tokens[$closeBrace]['line']) { break; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -274,7 +274,7 @@ * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * - * @return void + * @return bool */ private function shouldIgnoreUse($phpcsFile, $stackPtr) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -163,3 +163,71 @@ { } // phpcs:ignore Standard.Category.Sniff + +interface I1 extends + Foo +{ +} + +interface I2 extends + Bar +{ +} + +interface I3 extends + Foo, + Bar +{ +} + +class C1 extends + Foo +{ +} + +class C2 extends + Bar +{ +} + +class C3 extends Foo implements + Bar +{ +} + +class C4 extends Foo implements + Bar +{ +} + +class C5 extends Foo implements + Bar, + Baz +{ +} + +class C6 extends \Foo\Bar implements + \Baz\Bar +{ +} + +interface I4 extends + \Baz + \Bar +{ +} + +interface I5 extends /* comment */ + \Foo\Bar +{ +} + +interface I6 extends // comment + \Foo\Bar +{ +} + +class C7 extends // comment + \Foo\Bar implements \Baz\Bar +{ +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -161,3 +161,67 @@ { } // phpcs:ignore Standard.Category.Sniff + +interface I1 extends + Foo +{ +} + +interface I2 extends + Bar +{ +} + +interface I3 extends + Foo, + Bar +{ +} + +class C1 extends Foo +{ +} + +class C2 extends Bar +{ +} + +class C3 extends Foo implements + Bar +{ +} + +class C4 extends Foo implements + Bar +{ +} + +class C5 extends Foo implements + Bar, + Baz +{ +} + +class C6 extends \Foo\Bar implements + \Baz\Bar +{ +} + +interface I4 extends + \Baz\Bar +{ +} + +interface I5 extends /* comment */ + \Foo\Bar +{ +} + +interface I6 extends // comment + \Foo\Bar +{ +} + +class C7 extends \Foo\Bar implements \Baz\Bar // comment +{ +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -50,6 +50,18 @@ 130 => 2, 131 => 1, 158 => 1, + 168 => 1, + 178 => 1, + 179 => 1, + 184 => 1, + 189 => 1, + 194 => 1, + 204 => 1, + 205 => 1, + 210 => 1, + 215 => 2, + 216 => 1, + 231 => 2, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,5 @@ + 1]; + case 'ClosingTagUnitTest.6.inc': + return [5 => 1]; + default: return []; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ + + + 0 + + + 0 + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -514,7 +514,7 @@ }//end if }//end for - // Check for mutli-line arrays that should be single-line. + // Check for multi-line arrays that should be single-line. $singleValue = false; if (empty($indices) === true) { @@ -681,6 +681,11 @@ $indexLine = $tokens[$stackPtr]['line']; $lastIndexLine = null; foreach ($indices as $index) { + if ($index['value'] === false) { + // Syntax error or live coding. + continue; + } + if (isset($index['index']) === false) { // Array value only. if ($tokens[$index['value']]['line'] === $tokens[$stackPtr]['line'] && $numValues > 1) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php Thu May 09 15:33:08 2019 +0100 @@ -48,33 +48,57 @@ public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); + $next = $stackPtr; + while (true) { + $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); + if ($next === false) { + return; + } - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === false) { - return; + if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true + && $tokens[$next]['line'] === $tokens[$stackPtr]['line'] + ) { + // Trailing comment. + continue; + } + + break; } if ($tokens[$next]['code'] !== T_CLOSE_TAG) { $found = (($tokens[$next]['line'] - $tokens[$stackPtr]['line']) - 1); if ($found !== 1) { $error = 'Expected one blank line after closing brace of class definition; %s found'; - $data = [$found]; + $data = [max(0, $found)]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterClose', $data); if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addNewline($stackPtr); + $firstOnLine = $next; + while ($tokens[$firstOnLine]['column'] !== 1) { + --$firstOnLine; + } + + if ($found < 0) { + // Next statement on same line as the closing brace. + $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); + } else if ($found === 0) { + // Next statement on next line, no blank line. + $phpcsFile->fixer->addContentBefore($firstOnLine, $phpcsFile->eolChar); } else { - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + // Too many blank lines. $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < ($nextContent - 1); $i++) { + for ($i = ($firstOnLine - 1); $i > $stackPtr; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + $phpcsFile->fixer->replaceToken($i, ''); } - $phpcsFile->fixer->addNewline($i); + $phpcsFile->fixer->addContentBefore($firstOnLine, $phpcsFile->eolChar.$phpcsFile->eolChar); $phpcsFile->fixer->endChangeset(); } - } + }//end if }//end if }//end if diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -49,6 +49,11 @@ { $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Syntax error or live coding, bow out. + return; + } + // Do not check nested style definitions as, for example, in @media style rules. $nested = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']); if ($nested !== false) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php Thu May 09 15:33:08 2019 +0100 @@ -47,79 +47,124 @@ */ public function process(File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); + $tokens = $phpcsFile->getTokens(); + $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before opening brace of class definition; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoneBefore'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + if ($prevNonWhitespace !== false) { + $length = 0; + if ($tokens[$stackPtr]['line'] !== $tokens[$prevNonWhitespace]['line']) { + $length = 'newline'; + } else if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + if (strpos($tokens[($stackPtr - 1)]['content'], "\t") !== false) { + $length = 'tab'; + } else { + $length = $tokens[($stackPtr - 1)]['length']; + } } - } else { - $content = $tokens[($stackPtr - 1)]['content']; - if ($content !== ' ') { - if ($tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line']) { - $length = 'newline'; - } else { - $length = strlen($content); - if ($length === 1) { - $length = 'tab'; - } + + if ($length === 0) { + $error = 'Expected 1 space before opening brace of class definition; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoneBefore'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); } - + } else if ($length !== 1) { $error = 'Expected 1 space before opening brace of class definition; %s found'; $data = [$length]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before', $data); if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); + $phpcsFile->fixer->beginChangeset(); + + for ($i = ($stackPtr - 1); $i > $prevNonWhitespace; $i--) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + $phpcsFile->fixer->endChangeset(); } - } + }//end if }//end if - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { return; } - // Check for nested class definitions. - $nested = false; - $found = $phpcsFile->findNext( - T_OPEN_CURLY_BRACKET, - ($stackPtr + 1), - $tokens[$stackPtr]['bracket_closer'] - ); - - if ($found !== false) { - $nested = true; - } - - if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { + if ($tokens[$nextNonEmpty]['line'] === $tokens[$stackPtr]['line']) { $error = 'Opening brace should be the last content on the line'; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBefore'); if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); $phpcsFile->fixer->addNewline($stackPtr); + + // Remove potentially left over trailing whitespace. + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + + $phpcsFile->fixer->endChangeset(); } } else { - $foundLines = ($tokens[$next]['line'] - $tokens[$stackPtr]['line'] - 1); - if ($nested === true) { - if ($foundLines !== 1) { - $error = 'Expected 1 blank line after opening brace of nesting class definition; %s found'; - $data = [$foundLines]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AfterNesting', $data); + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Syntax error or live coding, bow out. + return; + } - if ($fix === true) { - if ($foundLines === 0) { - $phpcsFile->fixer->addNewline($stackPtr); - } else { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < ($next + 1); $i++) { - $phpcsFile->fixer->replaceToken($i, ''); + // Check for nested class definitions. + $found = $phpcsFile->findNext( + T_OPEN_CURLY_BRACKET, + ($stackPtr + 1), + $tokens[$stackPtr]['bracket_closer'] + ); + + if ($found === false) { + // Not nested. + return; + } + + $lastOnLine = $stackPtr; + for ($lastOnLine; $lastOnLine < $tokens[$stackPtr]['bracket_closer']; $lastOnLine++) { + if ($tokens[$lastOnLine]['line'] !== $tokens[($lastOnLine + 1)]['line']) { + break; + } + } + + $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($lastOnLine + 1), null, true); + if ($nextNonWhiteSpace === false) { + return; + } + + $foundLines = ($tokens[$nextNonWhiteSpace]['line'] - $tokens[$stackPtr]['line'] - 1); + if ($foundLines !== 1) { + $error = 'Expected 1 blank line after opening brace of nesting class definition; %s found'; + $data = [max(0, $foundLines)]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AfterNesting', $data); + + if ($fix === true) { + $firstOnNextLine = $nextNonWhiteSpace; + while ($tokens[$firstOnNextLine]['column'] !== 1) { + --$firstOnNextLine; + } + + if ($found < 0) { + // First statement on same line as the opening brace. + $phpcsFile->fixer->addContentBefore($nextNonWhiteSpace, $phpcsFile->eolChar.$phpcsFile->eolChar); + } else if ($found === 0) { + // Next statement on next line, no blank line. + $phpcsFile->fixer->addNewlineBefore($firstOnNextLine); + } else { + // Too many blank lines. + $phpcsFile->fixer->beginChangeset(); + for ($i = ($firstOnNextLine - 1); $i > $stackPtr; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; } - $phpcsFile->fixer->addNewline($stackPtr); - $phpcsFile->fixer->endChangeset(); + $phpcsFile->fixer->replaceToken($i, ''); } + + $phpcsFile->fixer->addContentBefore($firstOnNextLine, $phpcsFile->eolChar.$phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); } }//end if }//end if diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php Thu May 09 15:33:08 2019 +0100 @@ -48,6 +48,11 @@ { $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Syntax error or live coding, bow out. + return; + } + // Find the content of each style definition name. $styleNames = []; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php Thu May 09 15:33:08 2019 +0100 @@ -26,7 +26,7 @@ * A list of forbidden styles with their alternatives. * * The value is NULL if no alternative exists. i.e., the - * function should just not be used. + * style should just not be used. * * @var array */ @@ -115,7 +115,7 @@ // Remove the pattern delimiters and modifier. $pattern = substr($pattern, 1, -2); } else { - if (in_array($style, $this->forbiddenStyleNames) === false) { + if (in_array($style, $this->forbiddenStyleNames, true) === false) { return; } }//end if diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -70,6 +70,12 @@ if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { $indentLevel++; + if (isset($tokens[$i]['bracket_closer']) === false) { + // Syntax error or live coding. + // Anything after this would receive incorrect fixes, so bow out. + return; + } + // Check for nested class definitions. $found = $phpcsFile->findNext( T_OPEN_CURLY_BRACKET, diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php Thu May 09 15:33:08 2019 +0100 @@ -46,7 +46,13 @@ */ public function process(File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Syntax error or live coding, bow out. + return; + } + $lastLine = $tokens[$stackPtr]['line']; $end = $tokens[$stackPtr]['bracket_closer']; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ use PHP_CodeSniffer\Sniffs\Sniff; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; class OpacitySniff implements Sniff { @@ -52,7 +53,10 @@ return; } - $next = $phpcsFile->findNext([T_COLON, T_WHITESPACE], ($stackPtr + 1), null, true); + $ignore = Tokens::$emptyTokens; + $ignore[] = T_COLON; + + $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); if ($next === false || ($tokens[$next]['code'] !== T_DNUMBER diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ use PHP_CodeSniffer\Sniffs\Sniff; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; class SemicolonSpacingSniff implements Sniff { @@ -48,21 +49,52 @@ { $tokens = $phpcsFile->getTokens(); - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1)); - if ($semicolon === false || $tokens[$semicolon]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'Style definitions must end with a semicolon'; - $phpcsFile->addError($error, $stackPtr, 'NotAtEnd'); + $nextStatement = $phpcsFile->findNext([T_STYLE, T_CLOSE_CURLY_BRACKET], ($stackPtr + 1)); + if ($nextStatement === false) { return; } - if ($tokens[($semicolon - 1)]['code'] === T_WHITESPACE) { - $length = strlen($tokens[($semicolon - 1)]['content']); - $error = 'Expected 0 spaces before semicolon in style definition; %s found'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceFound', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($semicolon - 1), ''); + $ignore = Tokens::$emptyTokens; + if ($tokens[$nextStatement]['code'] === T_STYLE) { + // Allow for star-prefix hack. + $ignore[] = T_MULTIPLY; + } + + $endOfThisStatement = $phpcsFile->findPrevious($ignore, ($nextStatement - 1), null, true); + if ($tokens[$endOfThisStatement]['code'] !== T_SEMICOLON) { + $error = 'Style definitions must end with a semicolon'; + $phpcsFile->addError($error, $endOfThisStatement, 'NotAtEnd'); + return; + } + + if ($tokens[($endOfThisStatement - 1)]['code'] !== T_WHITESPACE) { + return; + } + + // There is a semi-colon, so now find the last token in the statement. + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($endOfThisStatement - 1), null, true); + $found = $tokens[($endOfThisStatement - 1)]['length']; + if ($tokens[$prevNonEmpty]['line'] !== $tokens[$endOfThisStatement]['line']) { + $found = 'newline'; + } + + $error = 'Expected 0 spaces before semicolon in style definition; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $prevNonEmpty, 'SpaceFound', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($prevNonEmpty, ';'); + $phpcsFile->fixer->replaceToken($endOfThisStatement, ''); + + for ($i = ($endOfThisStatement - 1); $i > $prevNonEmpty; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); } + + $phpcsFile->fixer->endChangeset(); } }//end process() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php Thu May 09 15:33:08 2019 +0100 @@ -69,10 +69,16 @@ return; } + $end = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1)); + if ($end === false) { + // Live coding or parse error. + return; + } + // Get the whole style content. - $end = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1)); $origContent = $phpcsFile->getTokensAsString(($stackPtr + 1), ($end - $stackPtr - 1)); - $origContent = trim($origContent, ': '); + $origContent = trim($origContent, ':'); + $origContent = trim($origContent); // Account for a !important annotation. $content = $origContent; @@ -85,7 +91,7 @@ $content = preg_replace('/\s+/', ' ', $content); $values = []; $num = preg_match_all( - '/([0-9]+)([a-zA-Z]{2}\s+|%\s+|\s+)/', + '/(?:[0-9]+)(?:[a-zA-Z]{2}\s+|%\s+|\s+)/', $content.' ', $values, PREG_SET_ORDER @@ -107,7 +113,7 @@ } if ($num === 3) { - $expected = trim($content.' '.$values[1][1].$values[1][2]); + $expected = trim($content.' '.$values[1][0]); $error = 'Shorthand syntax not allowed here; use %s instead'; $data = [$expected]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAllowed', $data); @@ -142,13 +148,11 @@ if ($values[0][0] === $values[1][0]) { // All values are the same. - $expected = $values[0][0]; + $expected = trim($values[0][0]); } else { - $expected = $values[0][0].' '.$values[1][0]; + $expected = trim($values[0][0]).' '.trim($values[1][0]); } - $expected = preg_replace('/\s+/', ' ', trim($expected)); - $error = 'Size definitions must use shorthand if available; expected "%s" but found "%s"'; $data = [ $expected, @@ -162,8 +166,8 @@ $expected .= ' !important'; } - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 2), null, true); - $phpcsFile->fixer->replaceToken($next, $expected); + $next = $phpcsFile->findNext(T_COLON, ($stackPtr + 1)); + $phpcsFile->fixer->addContent($next, ' '.$expected); for ($next++; $next < $end; $next++) { $phpcsFile->fixer->replaceToken($next, ''); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ use PHP_CodeSniffer\Sniffs\Sniff; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; class LowercaseClassKeywordsSniff implements Sniff { @@ -23,17 +24,15 @@ */ public function register() { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_EXTENDS, - T_IMPLEMENTS, - T_ABSTRACT, - T_FINAL, - T_VAR, - T_CONST, - ]; + $targets = Tokens::$ooScopeTokens; + $targets[] = T_EXTENDS; + $targets[] = T_IMPLEMENTS; + $targets[] = T_ABSTRACT; + $targets[] = T_FINAL; + $targets[] = T_VAR; + $targets[] = T_CONST; + + return $targets; }//end register() @@ -51,18 +50,19 @@ { $tokens = $phpcsFile->getTokens(); - $content = $tokens[$stackPtr]['content']; - if ($content !== strtolower($content)) { + $content = $tokens[$stackPtr]['content']; + $contentLc = strtolower($content); + if ($content !== $contentLc) { $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; $data = [ strtoupper($content), - strtolower($content), + $contentLc, $content, ]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, strtolower($content)); + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php Thu May 09 15:33:08 2019 +0100 @@ -127,7 +127,7 @@ }//end if if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $found = strlen($tokens[($stackPtr - 1)]['content']); + $found = $tokens[($stackPtr - 1)]['length']; $error = 'Expected 0 spaces before double colon; %s found'; $data = [$found]; $fix = $phpcsFile->addFixableError($error, ($stackPtr - 1), 'SpaceBefore', $data); @@ -144,7 +144,7 @@ } if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $found = strlen($tokens[($stackPtr + 1)]['content']); + $found = $tokens[($stackPtr + 1)]['length']; $error = 'Expected 0 spaces after double colon; %s found'; $data = [$found]; $fix = $phpcsFile->addFixableError($error, ($stackPtr - 1), 'SpaceAfter', $data); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -144,7 +144,7 @@ && $tokens[($i + 1)]['content'] !== ' ' ) { $error = 'Expected 1 space after asterisk; %s found'; - $data = [strlen($tokens[($i + 1)]['content'])]; + $data = [$tokens[($i + 1)]['length']]; $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterStar', $data); if ($fix === true) { $phpcsFile->fixer->replaceToken(($i + 1), ' '); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -99,7 +99,7 @@ T_REQUIRE_ONCE, ]; - if (in_array($tokens[$nextToken]['code'], $ignore) === true) { + if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); return ($phpcsFile->numTokens + 1); @@ -133,7 +133,7 @@ $name = $tokens[$tag]['content']; $isRequired = isset($required[$name]); - if ($isRequired === true && in_array($name, $foundTags) === true) { + if ($isRequired === true && in_array($name, $foundTags, true) === true) { $error = 'Only one %s tag is allowed in a file comment'; $data = [$name]; $phpcsFile->addError($error, $tag, 'Duplicate'.ucfirst(substr($name, 1)).'Tag', $data); @@ -183,7 +183,7 @@ // Check if the tags are in the correct position. $pos = 0; foreach ($required as $tag => $true) { - if (in_array($tag, $foundTags) === false) { + if (in_array($tag, $foundTags, true) === false) { $error = 'Missing %s tag in file comment'; $data = [$tag]; $phpcsFile->addError($error, $commentEnd, 'Missing'.ucfirst(substr($tag, 1)).'Tag', $data); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -78,7 +78,7 @@ $suggestedNames = []; foreach ($typeNames as $i => $typeName) { $suggestedName = Common::suggestType($typeName); - if (in_array($suggestedName, $suggestedNames) === false) { + if (in_array($suggestedName, $suggestedNames, true) === false) { $suggestedNames[] = $suggestedName; } } @@ -319,7 +319,7 @@ if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { $indent = 0; if ($tokens[($i - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { - $indent = strlen($tokens[($i - 1)]['content']); + $indent = $tokens[($i - 1)]['length']; } $comment .= ' '.$tokens[$i]['content']; @@ -397,7 +397,7 @@ $suggestedTypeHint = 'callable'; } else if (strpos($suggestedName, 'callback') !== false) { $suggestedTypeHint = 'callable'; - } else if (in_array($suggestedName, Common::$allowedTypes) === false) { + } else if (in_array($suggestedName, Common::$allowedTypes, true) === false) { $suggestedTypeHint = $suggestedName; } @@ -548,7 +548,7 @@ // Check number of spaces after the var name. $this->checkSpacingAfterParamName($phpcsFile, $param, $maxVar); - // Param comments must start with a capital letter and end with the full stop. + // Param comments must start with a capital letter and end with a full stop. if (preg_match('/^(\p{Ll}|\P{L})/u', $param['comment']) === 1) { $error = 'Parameter comment must start with a capital letter'; $phpcsFile->addError($error, $param['tag'], 'ParamCommentNotCapital'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php Thu May 09 15:33:08 2019 +0100 @@ -51,15 +51,8 @@ $find[] = T_WHITESPACE; $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - // Function is using the wrong type of comment. - return; - } - - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT - ) { - // Function doesn't have a doc comment. + if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG) { + // Function doesn't have a doc comment or is using the wrong type of comment. return; } @@ -69,6 +62,7 @@ $thrownExceptions = []; $currPos = $stackPtr; $foundThrows = false; + $unknownCount = 0; do { $currPos = $phpcsFile->findNext([T_THROW, T_ANON_CLASS, T_CLOSURE], ($currPos + 1), $stackPtrEnd); if ($currPos === false) { @@ -156,6 +150,8 @@ } } } + } else { + ++$unknownCount; }//end if } while ($currPos < $stackPtrEnd && $currPos !== false); @@ -196,7 +192,7 @@ } // Make sure @throws tag count matches thrown count. - $thrownCount = count($thrownExceptions); + $thrownCount = (count($thrownExceptions) + $unknownCount); $tagCount = count($throwTags); if ($thrownCount !== $tagCount) { $error = 'Expected %s @throws tag(s) in function comment; %s found'; @@ -209,11 +205,19 @@ } foreach ($thrownExceptions as $throw) { - if (isset($throwTags[$throw]) === false) { - $error = 'Missing @throws tag for "%s" exception'; - $data = [$throw]; - $phpcsFile->addError($error, $commentEnd, 'Missing', $data); + if (isset($throwTags[$throw]) === true) { + continue; } + + foreach ($throwTags as $tag => $ignore) { + if (strrpos($tag, $throw) === (strlen($tag) - strlen($throw))) { + continue 2; + } + } + + $error = 'Missing @throws tag for "%s" exception'; + $data = [$throw]; + $phpcsFile->addError($error, $commentEnd, 'Missing', $data); } }//end process() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -86,7 +86,7 @@ T_REQUIRE_ONCE, ]; - if (in_array($tokens[$nextToken]['code'], $ignore) === true) { + if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { return; } @@ -133,8 +133,8 @@ } } - // We don't want end of block comments. If the last comment is a closing - // curly brace. + // We don't want end of block comments. Check if the last token before the + // comment is a closing curly brace. $previousContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); if ($tokens[$previousContent]['line'] === $tokens[$stackPtr]['line']) { if ($tokens[$previousContent]['code'] === T_CLOSE_CURLY_BRACKET) { @@ -266,7 +266,7 @@ 'or question marks' => '?', ]; - if (in_array($commentCloser, $acceptedClosers) === false) { + if (in_array($commentCloser, $acceptedClosers, true) === false) { $error = 'Inline comments must end in %s'; $ender = ''; foreach ($acceptedClosers as $closerName => $symbol) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -93,7 +93,7 @@ $endBrace = $tokens[$stackPtr]; // We are only interested in some code blocks. - if (in_array($startCondition['code'], self::$openers) === false) { + if (in_array($startCondition['code'], self::$openers, true) === false) { return; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -25,6 +25,23 @@ 'JS', ]; + /** + * Exceptions to the rule. + * + * If post statement comments are found within the condition + * parenthesis of these structures, leave them alone. + * + * @var array + */ + private $controlStructureExceptions = [ + T_IF => true, + T_ELSEIF => true, + T_SWITCH => true, + T_WHILE => true, + T_FOR => true, + T_FOREACH => true, + ]; + /** * Returns an array of tokens this test wants to listen for. @@ -58,7 +75,10 @@ $commentLine = $tokens[$stackPtr]['line']; $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$lastContent]['line'] !== $commentLine) { + if ($lastContent === false + || $tokens[$lastContent]['line'] !== $commentLine + || $tokens[$stackPtr]['column'] === 1 + ) { return; } @@ -66,16 +86,28 @@ return; } - // Special case for JS files. + // Special case for JS files and PHP closures. if ($tokens[$lastContent]['code'] === T_COMMA || $tokens[$lastContent]['code'] === T_SEMICOLON ) { $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($lastContent - 1), null, true); - if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { + if ($lastContent === false || $tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { return; } } + // Special case for (trailing) comments within multi-line control structures. + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; + foreach ($nestedParens as $open => $close) { + if (isset($tokens[$open]['parenthesis_owner']) === true + && isset($this->controlStructureExceptions[$tokens[$tokens[$open]['parenthesis_owner']]['code']]) === true + ) { + return; + } + } + } + $error = 'Comments may not appear after statements'; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); if ($fix === true) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -111,7 +111,7 @@ $suggestedNames = []; foreach ($typeNames as $i => $typeName) { $suggestedName = Common::suggestType($typeName); - if (in_array($suggestedName, $suggestedNames) === false) { + if (in_array($suggestedName, $suggestedNames, true) === false) { $suggestedNames[] = $suggestedName; } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php Thu May 09 15:33:08 2019 +0100 @@ -71,7 +71,8 @@ { $tokens = $phpcsFile->getTokens(); - if (isset($tokens[($stackPtr + 1)]) === false) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { return; } @@ -98,7 +99,7 @@ if (strpos($tokens[($stackPtr + 1)]['content'], $phpcsFile->eolChar) !== false) { $found = 'newline'; } else { - $found = strlen($tokens[($stackPtr + 1)]['content']); + $found = $tokens[($stackPtr + 1)]['length']; } } @@ -236,7 +237,7 @@ if (strpos($tokens[($closer + 1)]['content'], $phpcsFile->eolChar) !== false) { $found = 'newline'; } else { - $found = strlen($tokens[($closer + 1)]['content']); + $found = $tokens[($closer + 1)]['length']; } } @@ -291,7 +292,7 @@ } else if ($tokens[$closer]['line'] !== $tokens[$stackPtr]['line']) { $found = 'newline'; } else if ($tokens[($closer + 1)]['content'] !== ' ') { - $found = strlen($tokens[($closer + 1)]['content']); + $found = $tokens[($closer + 1)]['length']; } if ($found !== 1) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -82,7 +82,7 @@ } else if ($this->requiredSpacesAfterOpen > 0) { $spaceAfterOpen = 0; if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = strlen($tokens[($openingBracket + 1)]['content']); + $spaceAfterOpen = $tokens[($openingBracket + 1)]['length']; } if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { @@ -112,7 +112,7 @@ } else if ($this->requiredSpacesBeforeClose > 0) { $spaceBeforeClose = 0; if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = strlen($tokens[($closingBracket - 1)]['content']); + $spaceBeforeClose = $tokens[($closingBracket - 1)]['length']; } if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { @@ -165,8 +165,8 @@ $phpcsFile->fixer->addContentBefore($doubleArrow, ' '); } } else { - if (strlen($tokens[($doubleArrow - 1)]['content']) !== 1) { - $spaces = strlen($tokens[($doubleArrow - 1)]['content']); + if ($tokens[($doubleArrow - 1)]['length'] !== 1) { + $spaces = $tokens[($doubleArrow - 1)]['length']; $error = 'Expected 1 space before "=>"; %s found'; $data = [$spaces]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeArrow', $data); @@ -183,8 +183,8 @@ $phpcsFile->fixer->addContent($doubleArrow, ' '); } } else { - if (strlen($tokens[($doubleArrow + 1)]['content']) !== 1) { - $spaces = strlen($tokens[($doubleArrow + 1)]['content']); + if ($tokens[($doubleArrow + 1)]['length'] !== 1) { + $spaces = $tokens[($doubleArrow + 1)]['length']; $error = 'Expected 1 space after "=>"; %s found'; $data = [$spaces]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterArrow', $data); @@ -202,8 +202,8 @@ $phpcsFile->fixer->addContentBefore($asToken, ' '); } } else { - if (strlen($tokens[($asToken - 1)]['content']) !== 1) { - $spaces = strlen($tokens[($asToken - 1)]['content']); + if ($tokens[($asToken - 1)]['length'] !== 1) { + $spaces = $tokens[($asToken - 1)]['length']; $error = 'Expected 1 space before "as"; %s found'; $data = [$spaces]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeAs', $data); @@ -220,8 +220,8 @@ $phpcsFile->fixer->addContent($asToken, ' '); } } else { - if (strlen($tokens[($asToken + 1)]['content']) !== 1) { - $spaces = strlen($tokens[($asToken + 1)]['content']); + if ($tokens[($asToken + 1)]['length'] !== 1) { + $spaces = $tokens[($asToken + 1)]['length']; $error = 'Expected 1 space after "as"; %s found'; $data = [$spaces]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterAs', $data); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ use PHP_CodeSniffer\Sniffs\Sniff; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; class ForLoopDeclarationSniff implements Sniff { @@ -77,15 +78,27 @@ $closingBracket = $tokens[$openingBracket]['parenthesis_closer']; if ($this->requiredSpacesAfterOpen === 0 && $tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $error = 'Space found after opening bracket of FOR loop'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen'); + $error = 'Whitespace found after opening bracket of FOR loop'; + $fix = $phpcsFile->addFixableError($error, $openingBracket, 'SpacingAfterOpen'); if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openingBracket + 1), ''); + $phpcsFile->fixer->beginChangeset(); + for ($i = ($openingBracket + 1); $i < $closingBracket; $i++) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); } } else if ($this->requiredSpacesAfterOpen > 0) { - $spaceAfterOpen = 0; - if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = strlen($tokens[($openingBracket + 1)]['content']); + $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($openingBracket + 1), $closingBracket, true); + $spaceAfterOpen = 0; + if ($tokens[$openingBracket]['line'] !== $tokens[$nextNonWhiteSpace]['line']) { + $spaceAfterOpen = 'newline'; + } else if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { + $spaceAfterOpen = $tokens[($openingBracket + 1)]['length']; } if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { @@ -94,28 +107,58 @@ $this->requiredSpacesAfterOpen, $spaceAfterOpen, ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); + $fix = $phpcsFile->addFixableError($error, $openingBracket, 'SpacingAfterOpen', $data); if ($fix === true) { $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); if ($spaceAfterOpen === 0) { $phpcsFile->fixer->addContent($openingBracket, $padding); } else { + $phpcsFile->fixer->beginChangeset(); $phpcsFile->fixer->replaceToken(($openingBracket + 1), $padding); + for ($i = ($openingBracket + 2); $i < $nextNonWhiteSpace; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); } } - } + }//end if }//end if + $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingBracket - 1), $openingBracket, true); + $beforeClosefixable = true; + if ($tokens[$prevNonWhiteSpace]['line'] !== $tokens[$closingBracket]['line'] + && isset(Tokens::$emptyTokens[$tokens[$prevNonWhiteSpace]['code']]) === true + ) { + $beforeClosefixable = false; + } + if ($this->requiredSpacesBeforeClose === 0 && $tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $error = 'Space found before closing bracket of FOR loop'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closingBracket - 1), ''); + $error = 'Whitespace found before closing bracket of FOR loop'; + + if ($beforeClosefixable === false) { + $phpcsFile->addError($error, $closingBracket, 'SpacingBeforeClose'); + } else { + $fix = $phpcsFile->addFixableError($error, $closingBracket, 'SpacingBeforeClose'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($closingBracket - 1); $i > $openingBracket; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } } } else if ($this->requiredSpacesBeforeClose > 0) { $spaceBeforeClose = 0; - if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = strlen($tokens[($closingBracket - 1)]['content']); + if ($tokens[$closingBracket]['line'] !== $tokens[$prevNonWhiteSpace]['line']) { + $spaceBeforeClose = 'newline'; + } else if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { + $spaceBeforeClose = $tokens[($closingBracket - 1)]['length']; } if ($this->requiredSpacesBeforeClose !== $spaceBeforeClose) { @@ -124,92 +167,121 @@ $this->requiredSpacesBeforeClose, $spaceBeforeClose, ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($closingBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($closingBracket - 1), $padding); + + if ($beforeClosefixable === false) { + $phpcsFile->addError($error, $closingBracket, 'SpacingBeforeClose', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $closingBracket, 'SpacingBeforeClose', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); + if ($spaceBeforeClose === 0) { + $phpcsFile->fixer->addContentBefore($closingBracket, $padding); + } else { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($closingBracket - 1), $padding); + for ($i = ($closingBracket - 2); $i > $prevNonWhiteSpace; $i--) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } } } - } + }//end if }//end if - $firstSemicolon = $phpcsFile->findNext(T_SEMICOLON, $openingBracket, $closingBracket); + /* + * Check whitespace around each of the semicolon tokens. + */ - // Check whitespace around each of the tokens. - if ($firstSemicolon !== false) { - if ($tokens[($firstSemicolon - 1)]['code'] === T_WHITESPACE) { - $error = 'Space found before first semicolon of FOR loop'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeFirst'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($firstSemicolon - 1), ''); - } + $semicolonCount = 0; + $semicolon = $openingBracket; + $targetNestinglevel = 0; + if (isset($tokens[$openingBracket]['conditions']) === true) { + $targetNestinglevel += count($tokens[$openingBracket]['conditions']); + } + + do { + $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($semicolon + 1), $closingBracket); + if ($semicolon === false) { + break; } - if ($tokens[($firstSemicolon + 1)]['code'] !== T_WHITESPACE - && $tokens[($firstSemicolon + 1)]['code'] !== T_SEMICOLON + if (isset($tokens[$semicolon]['conditions']) === true + && count($tokens[$semicolon]['conditions']) > $targetNestinglevel ) { - $error = 'Expected 1 space after first semicolon of FOR loop; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterFirst'); - if ($fix === true) { - $phpcsFile->fixer->addContent($firstSemicolon, ' '); - } - } else { - if (strlen($tokens[($firstSemicolon + 1)]['content']) !== 1) { - $spaces = strlen($tokens[($firstSemicolon + 1)]['content']); - $error = 'Expected 1 space after first semicolon of FOR loop; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterFirst', $data); + // Semicolon doesn't belong to the for(). + continue; + } + + ++$semicolonCount; + + $humanReadableCount = 'first'; + if ($semicolonCount !== 1) { + $humanReadableCount = 'second'; + } + + $humanReadableCode = ucfirst($humanReadableCount); + $data = [$humanReadableCount]; + + // Only examine the space before the first semicolon if the first expression is not empty. + // If it *is* empty, leave it up to the `SpacingAfterOpen` logic. + $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($semicolon - 1), $openingBracket, true); + if ($semicolonCount !== 1 || $prevNonWhiteSpace !== $openingBracket) { + if ($tokens[($semicolon - 1)]['code'] === T_WHITESPACE) { + $error = 'Whitespace found before %s semicolon of FOR loop'; + $errorCode = 'SpacingBefore'.$humanReadableCode; + $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); if ($fix === true) { - $phpcsFile->fixer->replaceToken(($firstSemicolon + 1), ' '); + $phpcsFile->fixer->beginChangeset(); + for ($i = ($semicolon - 1); $i > $prevNonWhiteSpace; $i--) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); } } } - $secondSemicolon = $phpcsFile->findNext(T_SEMICOLON, ($firstSemicolon + 1)); + // Only examine the space after the second semicolon if the last expression is not empty. + // If it *is* empty, leave it up to the `SpacingBeforeClose` logic. + $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), ($closingBracket + 1), true); + if ($semicolonCount !== 2 || $nextNonWhiteSpace !== $closingBracket) { + if ($tokens[($semicolon + 1)]['code'] !== T_WHITESPACE + && $tokens[($semicolon + 1)]['code'] !== T_SEMICOLON + ) { + $error = 'Expected 1 space after %s semicolon of FOR loop; 0 found'; + $errorCode = 'NoSpaceAfter'.$humanReadableCode; + $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($semicolon, ' '); + } + } else if ($tokens[($semicolon + 1)]['code'] === T_WHITESPACE + && $tokens[$nextNonWhiteSpace]['code'] !== T_SEMICOLON + ) { + $spaces = $tokens[($semicolon + 1)]['length']; + if ($tokens[$semicolon]['line'] !== $tokens[$nextNonWhiteSpace]['line']) { + $spaces = 'newline'; + } - if ($secondSemicolon !== false) { - if ($tokens[($secondSemicolon - 1)]['code'] === T_WHITESPACE - && $tokens[($firstSemicolon + 1)]['code'] !== T_SEMICOLON - ) { - $error = 'Space found before second semicolon of FOR loop'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeSecond'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($secondSemicolon - 1), ''); - } - } + if ($spaces !== 1) { + $error = 'Expected 1 space after %s semicolon of FOR loop; %s found'; + $errorCode = 'SpacingAfter'.$humanReadableCode; + $data[] = $spaces; + $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($semicolon + 1), ' '); + for ($i = ($semicolon + 2); $i < $nextNonWhiteSpace; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } - if (($secondSemicolon + 1) !== $closingBracket - && $tokens[($secondSemicolon + 1)]['code'] !== T_WHITESPACE - ) { - $error = 'Expected 1 space after second semicolon of FOR loop; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterSecond'); - if ($fix === true) { - $phpcsFile->fixer->addContent($secondSemicolon, ' '); - } - } else { - if (strlen($tokens[($secondSemicolon + 1)]['content']) !== 1) { - $spaces = strlen($tokens[($secondSemicolon + 1)]['content']); - $data = [$spaces]; - if (($secondSemicolon + 2) === $closingBracket) { - $error = 'Expected no space after second semicolon of FOR loop; %s found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterSecondNoThird', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($secondSemicolon + 1), ''); - } - } else { - $error = 'Expected 1 space after second semicolon of FOR loop; %s found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterSecond', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($secondSemicolon + 1), ' '); - } + $phpcsFile->fixer->endChangeset(); } } }//end if }//end if - }//end if + } while ($semicolonCount < 2); }//end process() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php Thu May 09 15:33:08 2019 +0100 @@ -52,18 +52,19 @@ { $tokens = $phpcsFile->getTokens(); - $content = $tokens[$stackPtr]['content']; - if ($content !== strtolower($content)) { + $content = $tokens[$stackPtr]['content']; + $contentLc = strtolower($content); + if ($content !== $contentLc) { $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; $data = [ strtoupper($content), - strtolower($content), + $contentLc, $content, ]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, strtolower($content)); + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php Thu May 09 15:33:08 2019 +0100 @@ -138,6 +138,7 @@ T_NS_SEPARATOR, T_THIS, T_SELF, + T_STATIC, T_OBJECT_OPERATOR, T_DOUBLE_COLON, T_OPEN_SQUARE_BRACKET, @@ -166,7 +167,7 @@ // We allow simple operations to not be bracketed. // For example, ceil($one / $two). for ($prev = ($stackPtr - 1); $prev > $bracket; $prev--) { - if (in_array($tokens[$prev]['code'], $allowed) === true) { + if (in_array($tokens[$prev]['code'], $allowed, true) === true) { continue; } @@ -182,7 +183,7 @@ } for ($next = ($stackPtr + 1); $next < $endBracket; $next++) { - if (in_array($tokens[$next]['code'], $allowed) === true) { + if (in_array($tokens[$next]['code'], $allowed, true) === true) { continue; } @@ -198,7 +199,7 @@ } }//end if - if (in_array($prevCode, Tokens::$scopeOpeners) === true) { + if (in_array($prevCode, Tokens::$scopeOpeners, true) === true) { // This operation is inside a control structure like FOREACH // or IF, but has no bracket of it's own. // The only control structure allowed to do this is SWITCH. @@ -280,6 +281,7 @@ T_NS_SEPARATOR => true, T_THIS => true, T_SELF => true, + T_STATIC => true, T_OBJECT_OPERATOR => true, T_DOUBLE_COLON => true, T_MODULUS => true, diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -121,7 +121,7 @@ // Check parameter default spacing. $spacesBefore = 0; if (($nextToken - $nextParam) > 1) { - $spacesBefore = strlen($tokens[($nextParam + 1)]['content']); + $spacesBefore = $tokens[($nextParam + 1)]['length']; } if ($spacesBefore !== $this->equalsSpacing) { @@ -144,7 +144,7 @@ $spacesAfter = 0; if ($tokens[($nextToken + 1)]['code'] === T_WHITESPACE) { - $spacesAfter = strlen($tokens[($nextToken + 1)]['content']); + $spacesAfter = $tokens[($nextToken + 1)]['length']; } if ($spacesAfter !== $this->equalsSpacing) { @@ -174,7 +174,7 @@ $error = 'Expected 0 spaces between argument "%s" and comma; %s found'; $data = [ $tokens[$nextParam]['content'], - strlen($tokens[($nextComma - 1)]['content']), + $tokens[($nextComma - 1)]['length'], ]; $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpaceBeforeComma', $data); @@ -211,7 +211,7 @@ $gap = 0; if ($tokens[$whitespace]['code'] === T_WHITESPACE) { - $gap = strlen($tokens[$whitespace]['content']); + $gap = $tokens[$whitespace]['length']; } if ($nextToken !== $nextParam) { @@ -244,7 +244,7 @@ $phpcsFile->fixer->addContent($comma, ' '); } } else { - $gap = strlen($tokens[($comma + 1)]['content']); + $gap = $tokens[($comma + 1)]['length']; if ($gap !== 1) { $error = 'Expected 1 space between comma and type hint "%s"; %s found'; $data = [ @@ -286,7 +286,7 @@ } else { $gap = 0; if ($tokens[$whitespace]['code'] === T_WHITESPACE) { - $gap = strlen($tokens[$whitespace]['content']); + $gap = $tokens[$whitespace]['length']; } $arg = $tokens[$nextParam]['content']; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php Thu May 09 15:33:08 2019 +0100 @@ -48,7 +48,7 @@ for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { if ($tokens[$i]['code'] === T_VARIABLE) { $variable = $tokens[$i]['content']; - if (in_array($variable, $foundVariables) === true) { + if (in_array($variable, $foundVariables, true) === true) { $error = 'Variable "%s" appears more than once in function declaration'; $data = [$variable]; $phpcsFile->addError($error, $i, 'Found', $data); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php Thu May 09 15:33:08 2019 +0100 @@ -12,6 +12,7 @@ use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; use PHP_CodeSniffer\Util\Common; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; class ValidVariableNameSniff extends AbstractVariableSniff { @@ -73,7 +74,7 @@ // this: MyClass::$_variable, so we don't know its scope. $inClass = true; } else { - $inClass = $phpcsFile->hasCondition($stackPtr, [T_CLASS, T_INTERFACE, T_TRAIT]); + $inClass = $phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens); } if ($inClass === true) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php Thu May 09 15:33:08 2019 +0100 @@ -328,7 +328,7 @@ // The open tag token always contains a single space after it. $leadingSpace = 1; if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $leadingSpace = (strlen($tokens[($stackPtr + 1)]['content']) + 1); + $leadingSpace = ($tokens[($stackPtr + 1)]['length'] + 1); } if ($leadingSpace !== 1) { @@ -371,7 +371,7 @@ $trailingSpace = 0; if ($tokens[($closeTag - 1)]['code'] === T_WHITESPACE) { - $trailingSpace = strlen($tokens[($closeTag - 1)]['content']); + $trailingSpace = $tokens[($closeTag - 1)]['length']; } else if (($tokens[($closeTag - 1)]['code'] === T_COMMENT || isset(Tokens::$phpcsCommentTokens[$tokens[($closeTag - 1)]['code']]) === true) && substr($tokens[($closeTag - 1)]['content'], -1) === ' ' diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,7 @@ use PHP_CodeSniffer\Sniffs\Sniff; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; class LowercasePHPFunctionsSniff implements Sniff { @@ -60,27 +61,71 @@ { $tokens = $phpcsFile->getTokens(); - // Make sure this is a function call. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + $content = $tokens[$stackPtr]['content']; + $contentLc = strtolower($content); + if ($content === $contentLc) { + return; + } + + // Make sure it is an inbuilt PHP function. + // PHP_CodeSniffer can possibly include user defined functions + // through the use of vendor/autoload.php. + if (isset($this->builtInFunctions[$contentLc]) === false) { + return; + } + + // Make sure this is a function call or a use statement. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($next === false) { // Not a function call. return; } + $ignore = Tokens::$emptyTokens; + $ignore[] = T_BITWISE_AND; + $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); + $pprev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); + if ($tokens[$next]['code'] !== T_OPEN_PARENTHESIS) { - // Not a function call. + // Is this a use statement importing a PHP native function ? + if ($tokens[$next]['code'] !== T_NS_SEPARATOR + && $tokens[$prev]['code'] === T_STRING + && $tokens[$prev]['content'] === 'function' + && $pprev !== false + && $tokens[$pprev]['code'] === T_USE + ) { + $error = 'Use statements for PHP native functions must be lowercase; expected "%s" but found "%s"'; + $data = [ + $contentLc, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseStatementUppercase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); + } + } + + // No open parenthesis; not a "use function" statement nor a function call. return; - } + }//end if - $prev = $phpcsFile->findPrevious([T_WHITESPACE, T_BITWISE_AND], ($stackPtr - 1), null, true); if ($tokens[$prev]['code'] === T_FUNCTION) { // Function declaration, not a function call. return; } if ($tokens[$prev]['code'] === T_NS_SEPARATOR) { - // Namespaced class/function, not an inbuilt function. - return; + if ($pprev !== false + && ($tokens[$pprev]['code'] === T_STRING + || $tokens[$pprev]['code'] === T_NAMESPACE + || $tokens[$pprev]['code'] === T_NEW) + ) { + // Namespaced class/function, not an inbuilt function. + // Could potentially give false negatives for non-namespaced files + // when namespace\functionName() is encountered. + return; + } } if ($tokens[$prev]['code'] === T_NEW) { @@ -98,25 +143,15 @@ return; } - // Make sure it is an inbuilt PHP function. - // PHP_CodeSniffer can possibly include user defined functions - // through the use of vendor/autoload.php. - $content = $tokens[$stackPtr]['content']; - if (isset($this->builtInFunctions[strtolower($content)]) === false) { - return; - } + $error = 'Calls to PHP native functions must be lowercase; expected "%s" but found "%s"'; + $data = [ + $contentLc, + $content, + ]; - if ($content !== strtolower($content)) { - $error = 'Calls to inbuilt PHP functions must be lowercase; expected "%s" but found "%s"'; - $data = [ - strtolower($content), - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'CallUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, strtolower($content)); - } + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'CallUppercase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); } }//end process() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php Thu May 09 15:33:08 2019 +0100 @@ -55,7 +55,7 @@ $tokens = $phpcsFile->getTokens(); if (isset($tokens[$stackPtr]['scope_opener']) === false) { - // Probably an interface method. + // Probably an interface or abstract method. return; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -40,7 +40,7 @@ /** * Original properties as set in a custom ruleset (if any). * - * @var array + * @var array|null */ private $rulesetProperties = null; @@ -142,12 +142,11 @@ } } + $requiredSpacing = $this->spacing; + $errorCode = 'After'; if ($isLast === true) { $requiredSpacing = $this->spacingAfterLast; $errorCode = 'AfterLast'; - } else { - $requiredSpacing = $this->spacing; - $errorCode = 'After'; } $foundLines = 0; @@ -164,7 +163,7 @@ // should be done by an EOF sniff. $foundLines = $requiredSpacing; } else { - $foundLines += ($tokens[$nextContent]['line'] - $tokens[$nextLineToken]['line']); + $foundLines = ($tokens[$nextContent]['line'] - $tokens[$nextLineToken]['line']); } } @@ -202,7 +201,7 @@ */ $prevLineToken = null; - for ($i = $stackPtr; $i > 0; $i--) { + for ($i = $stackPtr; $i >= 0; $i--) { if (strpos($tokens[$i]['content'], $phpcsFile->eolChar) === false) { continue; } else { @@ -214,8 +213,9 @@ if ($prevLineToken === null) { // Never found the previous line, which means // there are 0 blank lines before the function. - $foundLines = 0; - $prevContent = 0; + $foundLines = 0; + $prevContent = 0; + $prevLineToken = 0; } else { $currentLine = $tokens[$stackPtr]['line']; @@ -235,6 +235,8 @@ $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$prevContent]['comment_opener'] - 1), null, true); } + $prevLineToken = $prevContent; + // Before we throw an error, check that we are not throwing an error // for another function. We don't want to error for no blank lines after // the previous function and no blank lines before this one as well. @@ -249,7 +251,7 @@ return; } } else if ($tokens[$i]['code'] === T_FUNCTION) { - // Found another interface function. + // Found another interface or abstract function. return; } @@ -269,12 +271,11 @@ }//end while }//end if + $requiredSpacing = $this->spacing; + $errorCode = 'Before'; if ($isFirst === true) { $requiredSpacing = $this->spacingBeforeFirst; $errorCode = 'BeforeFirst'; - } else { - $requiredSpacing = $this->spacing; - $errorCode = 'Before'; } if ($foundLines !== $requiredSpacing) { @@ -291,18 +292,14 @@ $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); if ($fix === true) { - if ($prevContent === 0) { - $nextSpace = 0; - } else { - $nextSpace = $phpcsFile->findNext(T_WHITESPACE, ($prevContent + 1), $stackPtr); - if ($nextSpace === false) { - $nextSpace = ($stackPtr - 1); - } + $nextSpace = $phpcsFile->findNext(T_WHITESPACE, ($prevContent + 1), $stackPtr); + if ($nextSpace === false) { + $nextSpace = ($stackPtr - 1); } if ($foundLines < $requiredSpacing) { $padding = str_repeat($phpcsFile->eolChar, ($requiredSpacing - $foundLines)); - $phpcsFile->fixer->addContentBefore($nextSpace, $padding); + $phpcsFile->fixer->addContent($prevLineToken, $padding); } else { $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($nextSpace + 1), null, true); $phpcsFile->fixer->beginChangeset(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -62,9 +62,9 @@ } else { $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); if ($tokens[$stackPtr]['line'] === $tokens[$prev]['line'] - && strlen($tokens[($stackPtr - 1)]['content']) !== 1 + && $tokens[($stackPtr - 1)]['length'] !== 1 ) { - $found = strlen($tokens[($stackPtr - 1)]['content']); + $found = $tokens[($stackPtr - 1)]['length']; $error = 'Expected 1 space before logical operator; %s found'; $data = [$found]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceBefore', $data); @@ -84,9 +84,9 @@ } else { $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); if ($tokens[$stackPtr]['line'] === $tokens[$next]['line'] - && strlen($tokens[($stackPtr + 1)]['content']) !== 1 + && $tokens[($stackPtr + 1)]['length'] !== 1 ) { - $found = strlen($tokens[($stackPtr + 1)]['content']); + $found = $tokens[($stackPtr + 1)]['length']; $error = 'Expected 1 space after logical operator; %s found'; $data = [$found]; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceAfter', $data); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -41,17 +41,13 @@ */ public function register() { - $comparison = Tokens::$comparisonTokens; - $operators = Tokens::$operators; - $assignment = Tokens::$assignmentTokens; - $inlineIf = [ - T_INLINE_THEN, - T_INLINE_ELSE, - ]; + $targets = Tokens::$comparisonTokens; + $targets += Tokens::$operators; + $targets += Tokens::$assignmentTokens; + $targets[] = T_INLINE_THEN; + $targets[] = T_INLINE_ELSE; - return array_unique( - array_merge($comparison, $operators, $assignment, $inlineIf) - ); + return $targets; }//end register() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php Thu May 09 15:33:08 2019 +0100 @@ -62,7 +62,8 @@ // Detect whether this is a semi-colons for a conditions in a `for()` control structure. $forCondition = false; if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $closeParenthesis = end($tokens[$stackPtr]['nested_parenthesis']); + $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; + $closeParenthesis = end($nestedParens); if (isset($tokens[$closeParenthesis]['parenthesis_owner']) === true) { $owner = $tokens[$closeParenthesis]['parenthesis_owner']; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php Thu May 09 15:33:08 2019 +0100 @@ -78,7 +78,7 @@ */ if ($phpcsFile->tokenizerType !== 'PHP') { - // The first token is always the open tag inserted when tokenizsed + // The first token is always the open tag inserted when tokenized // and the second token is always the first piece of content in // the file. If the second token is whitespace, there was // whitespace at the start of the file. @@ -228,6 +228,13 @@ && $tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] && $tokens[($stackPtr - 2)]['line'] === $tokens[($stackPtr - 1)]['line'] ) { + // Properties and functions in nested classes have their own rules for spacing. + $conditions = $tokens[$stackPtr]['conditions']; + $deepestScope = end($conditions); + if ($deepestScope === T_ANON_CLASS) { + return; + } + // This is an empty line and the line before this one is not // empty, so this could be the start of a multiple empty // line block. diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc Thu May 09 15:33:08 2019 +0100 @@ -403,3 +403,8 @@ Init::ROOT_DIR.'/тип' => 'авто', Init::ROOT_DIR.'/цвет' => 'синий', ); + +// Intentional syntax error. +$a = array( + 'a' => + ); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -431,3 +431,8 @@ Init::ROOT_DIR.'/тип' => 'авто', Init::ROOT_DIR.'/цвет' => 'синий', ); + +// Intentional syntax error. +$a = array( + 'a' => + ); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc Thu May 09 15:33:08 2019 +0100 @@ -392,3 +392,8 @@ Init::ROOT_DIR.'/тип' => 'авто', Init::ROOT_DIR.'/цвет' => 'синий', ]; + +// Intentional syntax error. +$a = [ + 'a' => + ]; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -418,3 +418,8 @@ Init::ROOT_DIR.'/тип' => 'авто', Init::ROOT_DIR.'/цвет' => 'синий', ]; + +// Intentional syntax error. +$a = [ + 'a' => + ]; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -45,3 +45,37 @@ } .GUITextBox.container:after {} + +@media screen and (max-device-width: 769px) { + .no-blank-line-after { + } + .no-blank-line-after-second-def { + } .my-style { + } + + .no-blank-line-and-trailing-comment { + } /* end long class */ + .too-many-blank-lines-and-trailing-comment-extra-whitespace-after-brace { + } /* end long class */ + + + + .has-blank-line-and-trailing-comment { + } /* end long class */ + + .no-blank-line-and-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + .too-many-blank-lines-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + + + + .has-blank-line-and-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%;}} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,85 @@ +.my-style { +} + +.my-style { +} + +/* Comment */ + +.my-style { +} + +/* Comment */ + +.my-style { + float: left; + +} + +.AssetLineageWidgetType-item { + color: #CCC; +} + +/*.AssetLineageWidgetType-item2 .selected, +.AssetLineageWidgetType-item .selected { +}*/ + +.AssetLineageWidgetType-item.selected { +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +.GUITextBox.container:after { +} + +@media screen and (max-device-width: 769px) { + .no-blank-line-after { + } + + .no-blank-line-after-second-def { + } + +.my-style { + } + + .no-blank-line-and-trailing-comment { + } /* end long class */ + + .too-many-blank-lines-and-trailing-comment-extra-whitespace-after-brace { + } /* end long class */ + + .has-blank-line-and-trailing-comment { + } /* end long class */ + + .no-blank-line-and-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + + .too-many-blank-lines-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + + .has-blank-line-and-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; +} + +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -30,6 +30,13 @@ 11 => 1, 44 => 1, 47 => 1, + 51 => 1, + 53 => 1, + 57 => 1, + 59 => 1, + 67 => 1, + 69 => 1, + 81 => 2, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -60,3 +60,7 @@ { border: none; } + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -41,3 +41,68 @@ } .GUITextBox.container:after {} + +.single-line {float: left;} + +#opening-brace-on-different-line + + +{ + color: #FFFFFF; +} + +#opening-brace-on-different-line-and-inline-style + + +{color: #FFFFFF;} + +@media screen and (max-device-width: 769px) { .everything-on-one-line { float: left; } } + +/* Document handling of comments in various places */ +.no-space-before-opening-with-comment /* comment*/{ + float: left; +} + +.space-before-opening-with-comment-on-next-line +/* comment*/ { + float: left; +} + +#opening-brace-on-different-line-with-comment-between +/*comment*/ +{ + padding: 0; +} + +.single-line-with-comment { /* comment*/ float: left; } + +.multi-line-with-trailing-comment { /* comment*/ + float: left; +} + + +@media screen and (max-device-width: 769px) { + /*comment*/ + .comment-line-after-nesting-class-opening { + } +} + +@media screen and (max-device-width: 769px) { + + /*comment*/ + .blank-line-and-comment-line-after-nesting-class-opening { + } +} + +@media screen and (max-device-width: 769px) { + + + + /* phpcs:ignore Standard.Category.Sniffname -- for reasons */ + .blank-line-and-annotation-after-nesting-class-opening { + } +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,106 @@ +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + + float: left; +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +.GUITextBox.container:after { +} + +.single-line { +float: left;} + +#opening-brace-on-different-line { + color: #FFFFFF; +} + +#opening-brace-on-different-line-and-inline-style { +color: #FFFFFF;} + +@media screen and (max-device-width: 769px) { + +.everything-on-one-line { +float: left; } } + +/* Document handling of comments in various places */ +.no-space-before-opening-with-comment /* comment*/ { + float: left; +} + +.space-before-opening-with-comment-on-next-line +/* comment*/ { + float: left; +} + +#opening-brace-on-different-line-with-comment-between +/*comment*/ { + padding: 0; +} + +.single-line-with-comment { +/* comment*/ float: left; } + +.multi-line-with-trailing-comment { /* comment*/ + float: left; +} + + +@media screen and (max-device-width: 769px) { + + /*comment*/ + .comment-line-after-nesting-class-opening { + } +} + +@media screen and (max-device-width: 769px) { + + /*comment*/ + .blank-line-and-comment-line-after-nesting-class-opening { + } +} + +@media screen and (max-device-width: 769px) { + + /* phpcs:ignore Standard.Category.Sniffname -- for reasons */ + .blank-line-and-annotation-after-nesting-class-opening { + } +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -32,6 +32,15 @@ 26 => 1, 33 => 1, 43 => 1, + 45 => 1, + 50 => 1, + 57 => 2, + 59 => 2, + 62 => 1, + 73 => 1, + 77 => 1, + 84 => 1, + 97 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -4,6 +4,12 @@ border-bottom: 1px dotted #F0F0F0; border-top: 1px dotted #FF00FF; background: #08f7db url(diag_lines_bg.gif) top left; + + /* The sniff only deals with HEX colours. */ + color: DarkSlateGray; + background-color: rgb(255, 0, 0); + background-color: rgba(0, 0, 255, 0.3); + background-color: hsl(120, 100%, 50%); } #add-new-comment { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,16 @@ +#title-bar-bottom-right { + background-color: #333; + padding: 10px; + border-bottom: 1px dotted #F0F0F0; + border-top: 1px dotted #F0F; + background: #08F7DB url(diag_lines_bg.gif) top left; + + /* The sniff only deals with HEX colours. */ + color: DarkSlateGray; + background-color: rgb(255, 0, 0); + background-color: rgba(0, 0, 255, 0.3); + background-color: hsl(120, 100%, 50%); +} + +#add-new-comment { +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -10,3 +10,8 @@ background:url(/images//bullet.gif) left px no-repeat; margin:0px; padding-left:10px; margin-bottom:px; line-height:13px; filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); } + +/* Document handling of comments and annotations. */ +div#annotations {-webkit-tap-highlight-color:transparent;/* phpcs:disable Standard.Cat.SniffName */-webkit-touch-callout:none;/*phpcs:enable*/-webkit-user-select:none;} + +div#comments {height:100%;/*comment*/width:100%;} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,27 @@ +.SettingsTabPaneWidgetType-tab-mid { + background: transparent url(tab_inact_mid.png) repeat-x; + height: 100%; +float: left; + line-height: -25px; + cursor: pointer; +margin: 10px; +float: right; +} + +/* testing embedded PHP */ +li { + background:url(/images//bullet.gif) left px no-repeat; +margin:0px; +padding-left:10px; +margin-bottom:px; +line-height:13px; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); +} + +/* Document handling of comments and annotations. */ +div#annotations {-webkit-tap-highlight-color:transparent;/* phpcs:disable Standard.Cat.SniffName */ +-webkit-touch-callout:none;/*phpcs:enable*/ +-webkit-user-select:none;} + +div#comments {height:100%;/*comment*/ +width:100%;} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -29,6 +29,8 @@ 3 => 1, 5 => 2, 10 => 4, + 15 => 2, + 17 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -21,3 +21,7 @@ header nav.meta a { display: none; } header nav.meta a.search { display: block; } } + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,18 @@ +#add-new-comment { + border-radius: 1px; + border-radius: 1px; + border-radius: 1px; + + border-top-left-radius: 1px; + border-top-right-radius: 1px; + border-bottom-right-radius: 1px; + border-bottom-left-radius: 1px; + border-top-left-radius: 1px; + border-top-right-radius: 1px; + border-bottom-right-radius: 1px; + border-bottom-left-radius: 1px; + + box-shadow: 1px; + box-shadow: 1px; + box-shadow: 1px; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,79 @@ +body { + + font-family: Arial, Helvetica, sans-serif; + margin: 40px 0 0 0; +padding: 0; + background: #8FB7DB url(diag_lines_bg.gif) top left; + +} + +td { + margin: 40px; + + padding: 20px; +} + +/* +#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { + background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; +} +#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { + background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; +} +*/ + +.GUITextBox.container:after {} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + padding: 20px; + margin: 40px; + } +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + + header #logo img { + min-width: 100%; + } + +} + +td { + margin: 40px; + + padding: 20px; + + +} + +.GUIFileUpload { +/* opacity: 0.25; */ +} + +.foo +{ + border: none; +} + +.mortgage-calculator h2 { + background: #072237; + color: #fff; + font-weight: normal; + height: 50px; + line-height: 50px; + padding: 0 0 0 30px; + } + +.WhitelistCommentIndentationShouldBeIgnored { +/* phpcs:disable Standard.Category.Sniff -- for reasons. */ +} + +/* syntax error */ +--------------------------------------------- */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,73 @@ +body { + font-family: Arial, Helvetica, sans-serif; + margin: 40px 0 0 0; + padding: 0; + background: #8FB7DB url(diag_lines_bg.gif) top left; +} + +td { + margin: 40px; + padding: 20px; +} + +/* +#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { + background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; +} +#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { + background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; +} +*/ + +.GUITextBox.container:after {} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + padding: 20px; + margin: 40px; + } +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + + header #logo img { + min-width: 100%; + } + +} + +td { + margin: 40px; + padding: 20px; +} + +.GUIFileUpload { +/* opacity: 0.25; */ +} + +.foo +{ + border: none; +} + +.mortgage-calculator h2 { + background: #072237; + color: #fff; + font-weight: normal; + height: 50px; + line-height: 50px; + padding: 0 0 0 30px; +} + +.WhitelistCommentIndentationShouldBeIgnored { +/* phpcs:disable Standard.Category.Sniff -- for reasons. */ +} + +/* syntax error */ +--------------------------------------------- */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,3 @@ +/* Live coding. Has to be the last (only) test in the file. */ +.intentional-parse-error { + float: left diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -body { - - font-family: Arial, Helvetica, sans-serif; - margin: 40px 0 0 0; -padding: 0; - background: #8FB7DB url(diag_lines_bg.gif) top left; - -} - -td { - margin: 40px; - - padding: 20px; -} - -/* -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { - background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; -} -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { - background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; -} -*/ - -.GUITextBox.container:after {} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - padding: 20px; - margin: 40px; - } -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - - header #logo img { - min-width: 100%; - } - -} - -td { - margin: 40px; - - padding: 20px; - - -} - -.GUIFileUpload { -/* opacity: 0.25; */ -} - -.foo -{ - border: none; -} - -.mortgage-calculator h2 { - background: #072237; - color: #fff; - font-weight: normal; - height: 50px; - line-height: 50px; - padding: 0 0 0 30px; - } - -.WhitelistCommentIndentationShouldBeIgnored { -/* phpcs:disable Standard.Category.Sniff -- for reasons. */ -} - -/* syntax error */ ---------------------------------------------- */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.css.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.css.fixed Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -body { - font-family: Arial, Helvetica, sans-serif; - margin: 40px 0 0 0; - padding: 0; - background: #8FB7DB url(diag_lines_bg.gif) top left; -} - -td { - margin: 40px; - padding: 20px; -} - -/* -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { - background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; -} -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { - background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; -} -*/ - -.GUITextBox.container:after {} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - padding: 20px; - margin: 40px; - } -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - - header #logo img { - min-width: 100%; - } - -} - -td { - margin: 40px; - padding: 20px; -} - -.GUIFileUpload { -/* opacity: 0.25; */ -} - -.foo -{ - border: none; -} - -.mortgage-calculator h2 { - background: #072237; - color: #fff; - font-weight: normal; - height: 50px; - line-height: 50px; - padding: 0 0 0 30px; -} - -.WhitelistCommentIndentationShouldBeIgnored { -/* phpcs:disable Standard.Category.Sniff -- for reasons. */ -} - -/* syntax error */ ---------------------------------------------- */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -21,30 +21,38 @@ * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * + * @param string $testFile The name of the file being tested. + * * @return array */ - public function getErrorList() + public function getErrorList($testFile='') { - return [ - 2 => 1, - 3 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 12 => 1, - 30 => 1, - 32 => 1, - 50 => 1, - 52 => 1, - 53 => 1, - 66 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 70 => 1, - 71 => 1, - 72 => 1, - ]; + switch ($testFile) { + case 'IndentationUnitTest.1.css': + return [ + 2 => 1, + 3 => 1, + 5 => 1, + 6 => 1, + 7 => 1, + 12 => 1, + 30 => 1, + 32 => 1, + 50 => 1, + 52 => 1, + 53 => 1, + 66 => 1, + 67 => 1, + 68 => 1, + 69 => 1, + 70 => 1, + 71 => 1, + 72 => 1, + ]; + + default: + return []; + }//end switch }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -15,3 +15,7 @@ #foo { background-color: #FF0000; } + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -25,3 +25,11 @@ background: url(../1/2/3/4-5-6_7_100x100.png) repeat scroll 50% 50% #EEE; opacity: -1; } + +.my-commented-style { + opacity: /*comment*/ 0; + opacity: /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + 0.0; + opacity: /*comment*/ 1.0; + opacity: /*comment*/ .5; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,35 @@ +.my-style { + opacity: 0; + opacity: 0; + opacity: 1; + opacity: 1; + opacity: 1.5; + opacity: 0.5; + opacity: 0.5; + opacity: 2; + opacity: -1; + opacity: 0.55; +} + +div { + font-size: 1.2em; + background: linear-gradient(to bottom, #00F, #0F0) repeat scroll 50% 50% #EEE; + min-width: 250px; + max-width: 100%; + padding-bottom: 50px; + box-shadow: 2px -3px 3px rgba(100, 100, 100, 0.33); + border-left: 1px solid #000; + border-right: 1px solid #000; + border-top: 1px solid #000; + border-bottom: 1px dotted #000; + background: url(../1/2/3/4-5-6_7_100x100.png) repeat scroll 50% 50% #EEE; + opacity: -1; +} + +.my-commented-style { + opacity: /*comment*/ 0; + opacity: /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + 0; + opacity: /*comment*/ 1; + opacity: /*comment*/ 0.5; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -34,6 +34,9 @@ 10 => 1, 11 => 1, 26 => 1, + 32 => 1, + 33 => 1, + 34 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -25,3 +25,37 @@ visibility: hidden; } } + +#single-line-multi-statement-no-semicolon { + padding: 0 border: 20; +} + +#multi-line-style-no-semicolon { + padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + border: + 20 + margin: + 0px /* top */ + 10px /* right + left */ +} + +#multi-line-style-whitespace { + padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ ; + border: + 20 ; + margin: + 10px /* top */ + 0px /* right + left */ + + + ; +} + +.allow-for-star-hack { + cursor: pointer; + *cursor: hand; +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,58 @@ +.HelpWidgetType-new-bug-title { + width: 308px + float: left; +} + +#MetadataAdminScreen-addField-add { + float: left; +} + +.TableWidgetType .recover:hover { + background-color: #FFF; +} + +#clearCache-settings:rootNodes-list_0 { + border-top: none; +} + +.HelpWidgetType-list { + list-style-image: url(); +} + +@media (min-width: 320px) and (max-width: 961px) { + .tooltipsrt:hover span.tltp, + .tooltipstp:hover span.tltp { + visibility: hidden; + } +} + +#single-line-multi-statement-no-semicolon { + padding: 0 border: 20; +} + +#multi-line-style-no-semicolon { + padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + border: + 20 + margin: + 0px /* top */ + 10px /* right + left */ +} + +#multi-line-style-whitespace { + padding: 0; /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + border: + 20; + margin: + 10px /* top */ + 0px; /* right + left */ +} + +.allow-for-star-hack { + cursor: pointer; + *cursor: hand; +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -26,8 +26,15 @@ public function getErrorList() { return [ - 2 => 1, - 7 => 1, + 2 => 1, + 7 => 1, + 30 => 1, + 34 => 1, + 36 => 1, + 39 => 1, + 43 => 1, + 45 => 1, + 48 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css Thu May 09 15:33:08 2019 +0100 @@ -4,7 +4,7 @@ border-bottom: 1px dotted #F0F0F0; border-top: 1px dotted #FF00FF; background: #8fb7db url(diag_lines_bg.gif) top left; - page-break-inside: 1; + tab-size: 1; margin: 8px 8px 8px 8px; margin: 8px 8px; margin: 0 0 0 0; @@ -18,9 +18,28 @@ border-width: 1px 2px 2px 4px; margin: 97px auto 0 auto; text-shadow: 0 1px 0 #fff; + border-width: + 2px + 4px + 2px + 4px; - /* These are black-listed style names. */ + /* These are style names excluded from this rule. */ background-position: 0 0; box-shadow: 2px 2px 2px 2px; transform-origin: 0 110% 0; + + /* Sizes with comments between them will be ignored for the purposes of this sniff. */ + margin: 8px /*top*/ 8px /*right*/ 8px /*bottom*/ 8px /*left*/; + + /* Same with PHPCS annotations. */ + border-width: + 2px /* phpcs:ignore Standard.Category.SniffName -- for reasons */ + 4px + 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ + 4px; } + +/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */ +#live-coding { + margin: 8px 8px 8px 8px diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,41 @@ +#add-new-comment { + background-color: #333333; + padding: 10px; + border-bottom: 1px dotted #F0F0F0; + border-top: 1px dotted #FF00FF; + background: #8fb7db url(diag_lines_bg.gif) top left; + tab-size: 1; + margin: 8px; + margin: 8px; + margin: 0; + margin: 0 8px; + margin: 8px 4px; + margin: 8px 4%; + margin: 6px 2px 9px 2px; + margin: 6px 2px 9px 2px; + border-radius: 2px !important; + border-width: 2px; + border-width: 1px 2px 2px 4px; + margin: 97px auto 0 auto; + text-shadow: 0 1px 0 #fff; + border-width: 2px 4px; + + /* These are style names excluded from this rule. */ + background-position: 0 0; + box-shadow: 2px 2px 2px 2px; + transform-origin: 0 110% 0; + + /* Sizes with comments between them will be ignored for the purposes of this sniff. */ + margin: 8px /*top*/ 8px /*right*/ 8px /*bottom*/ 8px /*left*/; + + /* Same with PHPCS annotations. */ + border-width: + 2px /* phpcs:ignore Standard.Category.SniffName -- for reasons */ + 4px + 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ + 4px; +} + +/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */ +#live-coding { + margin: 8px 8px 8px 8px diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -35,6 +35,7 @@ 15 => 1, 16 => 1, 17 => 1, + 21 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -9,4 +9,5 @@ Var $myVar = null; Const myConst = true; } -?> + +$a = new CLASS() {}; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,13 @@ + 1, 9 => 1, 10 => 1, + 13 => 1, ]; return $errors; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,43 @@ + +* @author +* @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) +* @license http://www.php.net/license/3_0.txt +* @summary An unknown summary tag +* +*/ + + +?> + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js Thu May 09 15:33:08 2019 +0100 @@ -1,10 +1,40 @@ + + + + /** - * File comment. - * - * @package Package - * @subpackage Subpackage - * @author Squiz Pty Ltd - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ +* +* 0Multi-line short description without full stop +* +* +* asdasd +* long description for file (if any) +* asdasdadada +* +* PHP versio +* +* LICENSE: This source file is subject to version 3.0 of the PHP license +* that is available through the world-wide-web at the following URI: +* http://www.php.net/license/3_0.txt. If you did not receive a copy of +* the PHP License and are unable to obtain it through the web, please +* send a note to license@php.net so we can mail you a copy immediately. +* @package SquizCMS +* @package ADDITIONAL PACKAGE TAG +* @subpkg not_camelcased +* @author Antônio Carlos Venâncio Júnior +* @author +* @copyright 1997~1994 The PHP Group +* @copyright 1994-1997 The PHP Group +* @copyright The PHP Group +* @license http://www.php.net/license/3_0.txt +* @summary An unknown summary tag +* +*/ -print 'hi'; \ No newline at end of file + +/** +* This bit here is not qualified as file comment +* +* as it is not the first comment in the file +* +*/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,40 @@ + + + + +/** +* +* 0Multi-line short description without full stop +* +* +* asdasd +* long description for file (if any) +* asdasdadada +* +* PHP versio +* +* LICENSE: This source file is subject to version 3.0 of the PHP license +* that is available through the world-wide-web at the following URI: +* http://www.php.net/license/3_0.txt. If you did not receive a copy of +* the PHP License and are unable to obtain it through the web, please +* send a note to license@php.net so we can mail you a copy immediately. +* @package SquizCMS +* @package ADDITIONAL PACKAGE TAG +* @subpkg not_camelcased +* @author Squiz Pty Ltd +* @author +* @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) +* @license http://www.php.net/license/3_0.txt +* @summary An unknown summary tag +* +*/ + + +/** +* This bit here is not qualified as file comment +* +* as it is not the first comment in the file +* +*/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,10 @@ +/** + * File comment. + * + * @package Package + * @subpackage Subpackage + * @author Squiz Pty Ltd + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ + +print 'hi'; \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,3 @@ + + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ + +class Foo { +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.js --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.js Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ - - - - -/** -* -* 0Multi-line short description without full stop -* -* -* asdasd -* long description for file (if any) -* asdasdadada -* -* PHP versio -* -* LICENSE: This source file is subject to version 3.0 of the PHP license -* that is available through the world-wide-web at the following URI: -* http://www.php.net/license/3_0.txt. If you did not receive a copy of -* the PHP License and are unable to obtain it through the web, please -* send a note to license@php.net so we can mail you a copy immediately. -* @package SquizCMS -* @package ADDITIONAL PACKAGE TAG -* @subpkg not_camelcased -* @author Antônio Carlos Venâncio Júnior -* @author -* @copyright 1997~1994 The PHP Group -* @copyright 1994-1997 The PHP Group -* @copyright The PHP Group -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -/** -* This bit here is not qualified as file comment -* -* as it is not the first comment in the file -* -*/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -29,7 +29,7 @@ { switch ($testFile) { case 'FileCommentUnitTest.1.inc': - case 'FileCommentUnitTest.js': + case 'FileCommentUnitTest.1.js': return [ 1 => 1, 22 => 2, @@ -41,6 +41,14 @@ 28 => 2, 32 => 2, ]; + + case 'FileCommentUnitTest.4.inc': + case 'FileCommentUnitTest.6.inc': + return [1 => 1]; + + case 'FileCommentUnitTest.5.inc': + return [2 => 1]; + default: return []; }//end switch diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -410,3 +410,77 @@ */ abstract public function getGroups(); } + +class SomeClass { + /** + * Validates something. + * + * @param string $method The set method parameter. + * + * @return string The validated method. + * + * @throws Prefix_Invalid_Argument_Exception The invalid argument exception. + * @throws InvalidArgumentException The invalid argument exception. + */ + protected function validate_something( $something ) { + if ( ! Prefix_Validator::is_string( $something ) ) { + throw Prefix_Invalid_Argument_Exception::invalid_string_parameter( $something, 'something' ); + } + + if ( ! in_array( $something, $this->valid_http_something, true ) ) { + throw new InvalidArgumentException( sprintf( '%s is not a valid HTTP something', $something ) ); + } + + return $something; + } +} + +namespace Test\Admin { + class NameSpacedClass { + /** + * @throws \ExceptionFromGlobalNamespace + */ + public function ExceptionInGlobalNamespace() { + throw new \ExceptionFromGlobalNamespace(); + } + + /** + * @throws ExceptionFromSameNamespace + */ + public function ExceptionInSameNamespace() { + throw new ExceptionFromSameNamespace(); + } + + /** + * @throws \Test\Admin\ExceptionFromSameNamespace + */ + public function ExceptionInSameNamespaceToo() { + throw new ExceptionFromSameNamespace(); + } + + /** + * @throws \Different\NameSpaceName\ExceptionFromDifferentNamespace + */ + public function ExceptionInSameNamespaceToo() { + throw new \Different\NameSpaceName\ExceptionFromDifferentNamespace(); + } + } +} + +namespace { + class GlobalNameSpaceClass { + /** + * @throws SomeGlobalException + */ + public function ThrowGlobalException() { + throw new SomeGlobalException(); + } + + /** + * @throws \SomeGlobalException + */ + public function ThrowGlobalExceptionToo() { + throw new SomeGlobalException(); + } + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js Thu May 09 15:33:08 2019 +0100 @@ -441,4 +441,4 @@ // Wrong comment if (condition) { condition = true; -}//end foreach \ No newline at end of file +}//end foreach diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,444 @@ +function long_function() +{ + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + }//end if + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + }//end if + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + } else { + // Short ELSE + }//end if + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + } else { + // Short ELSE + }//end if +} + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end for + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + for (val =1; val < 20; val++) { + // Short for. + } + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end for + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end while + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + while (something) { + // Short while. + } + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end while + +if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } +} //end if + +if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } +} else { + // Short ELSE +} //end if + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} //end for + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} //end while + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end while + +if (true) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} else if (condition) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} else { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end if + +if (something) { + // Line 1 + // Line 2 +} else if (somethingElse) { + // Line 1 + // Line 2 +} else { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end if + +switch (something) { + case '1': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '2': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '3': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '4': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '5': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; +}//end switch + +// Wrong comment +if (condition) { + condition = true; +}//end if diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,36 @@ +function test(id, buttons) // cool function +{ + alert('hello'); + alert('hello again'); // And again. + // Valid comment. + +}//end test() + +var good = true; // Indeed. + +mig.Gallery.prototype = { + + init: function(cb) + { + + },//end init() + + imageClicked: function(id) + { + + }//end imageClicked() + +}; + +dfx.getIframeDocument = function(iframe) +{ + + return doc; + +};//end dfx.getIframeDocument() + +// Verify that multi-line control structure with comments and annotations are left alone. +if (condition // comment + && anotherCondition) { + condition = true; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,39 @@ +function test(id, buttons) +// cool function +{ + alert('hello'); + alert('hello again'); +// And again. + // Valid comment. + +}//end test() + +var good = true; +// Indeed. + +mig.Gallery.prototype = { + + init: function(cb) + { + + },//end init() + + imageClicked: function(id) + { + + }//end imageClicked() + +}; + +dfx.getIframeDocument = function(iframe) +{ + + return doc; + +};//end dfx.getIframeDocument() + +// Verify that multi-line control structure with comments and annotations are left alone. +if (condition // comment + && anotherCondition) { + condition = true; +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ +// Comment as first thing in a JS file. +var i = 100; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -7,7 +7,7 @@ // Valid comment. } -function test() // This is a function +function testing() // This is a function { }//end test() @@ -22,3 +22,27 @@ if (true || -1 == $b) { /* test */ } $y = 10 + /* test */ -2; + +$a = function() { +};//end closure + +$array = [ + function($a) { + }, // phpcs:ignore Standard.Category.SniffName -- for reasons. + 'key' => function($b) { + }, // comment. + 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. + 'key' => 'value', // comment. +]; + +// Verify that multi-line control structure with comments and annotations are left alone. +for ( + $i = 0; /* Start */ + $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ + $i++ // comment + +) {} + +if ( $condition === true // comment + && $anotherCondition === false +) {} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -8,7 +8,7 @@ // Valid comment. } -function test() +function testing() // This is a function { @@ -25,3 +25,28 @@ if (true || -1 == $b) { /* test */ } $y = 10 + /* test */ -2; + +$a = function() { +};//end closure + +$array = [ + function($a) { + }, // phpcs:ignore Standard.Category.SniffName -- for reasons. + 'key' => function($b) { + }, // comment. + 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. + 'key' => 'value', +// comment. +]; + +// Verify that multi-line control structure with comments and annotations are left alone. +for ( + $i = 0; /* Start */ + $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ + $i++ // comment + +) {} + +if ( $condition === true // comment + && $anotherCondition === false +) {} diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.js --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.js Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -function test(id, buttons) // cool function -{ - alert('hello'); - alert('hello again'); // And again. - // Valid comment. - -}//end test() - -var good = true; // Indeed. - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -dfx.getIframeDocument = function(iframe) -{ - - return doc; - -};//end dfx.getIframeDocument() \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.js.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.js.fixed Thu Feb 28 13:21:36 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -function test(id, buttons) -// cool function -{ - alert('hello'); - alert('hello again'); -// And again. - // Valid comment. - -}//end test() - -var good = true; -// Indeed. - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -dfx.getIframeDocument = function(iframe) -{ - - return doc; - -};//end dfx.getIframeDocument() \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -33,18 +33,18 @@ 6 => 1, 10 => 1, 18 => 1, + 35 => 1, ]; - break; - case 'PostStatementCommentUnitTest.js': + + case 'PostStatementCommentUnitTest.1.js': return [ 1 => 1, 4 => 1, 9 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -289,3 +289,7 @@ if ($that) foo(${$a[$b]}); } + +// Intentional parse error. This should be the last test in the file. +foreach + // Some unrelated comment. diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -292,3 +292,7 @@ if ($that) foo(${$a[$b]}); } + +// Intentional parse error. This should be the last test in the file. +foreach + // Some unrelated comment. diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -12,5 +12,3 @@ } else if ($somethingElse) { } elseif ($another) { } - -?> \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,14 @@ +i ; }; $i < function() { return $this->max; }; $i++) {} +for ($i = function() { return $this->i; }; $i < function() { return $this->max; } ; $i++) {} + +// This test has to be the last one in the file! Intentional parse error check. +for diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,85 @@ +i ; }; $i < function() { return $this->max; }; $i++) {} +for ($i = function() { return $this->i; }; $i < function() { return $this->max; }; $i++) {} + +// This test has to be the last one in the file! Intentional parse error check. +for diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js Thu May 09 15:33:08 2019 +0100 @@ -45,3 +45,81 @@ for ( var i = 0; i < 10; i++ ) {} // phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 // phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +for ( ; i < 10; i++) {} +for (; i < 10; i++) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( ; i < 10; i++ ) {} +for ( ; i < 10; i++ ) {} +for (; i < 10; i++ ) {} + +for ( i = 0; i < 10; ) {} +for ( i = 0; i < 10;) {} +for ( i = 0; i < 10; ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +// Test handling of comments and inline annotations. +for ( /*phpcs:enable*/ i = 0 /*start*/ ; /*end*/i < 10/*comment*/; i++ /*comment*/ ) {} + +// Test multi-line FOR control structure. +for ( + i = 0; + i < 10; + i++ +) {} + +// Test multi-line FOR control structure with comments and annotations. +for ( + i = 0; /* Start */ + i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ + i++ // comment + +) {} + +// Test fixing each error in one go. Note: lines 84 + 88 contain trailing whitespace on purpose. +for ( + + + i = 0 + + ; + + i < 10 + + ; + + i++ + + +) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( + + + + i = 0 + + ; + + i < 10 + + ; + + i++ + + +) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +// Test with semi-colon not belonging to for. +for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {} +for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);} ; i++) {} + +// This test has to be the last one in the file! Intentional parse error check. +for diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,91 @@ +// Valid. +for (var i = 0; i < 10; i++) { +} + +// Invalid. +for (i = 0; i < 10; i++) { +} + +for (i = 0; i < 10; i++) { +} + +for (var i = 0; i < 10; i++) { +} + +for (i = 0; i < 10; i++) { +} + +// The works. +for (var i = 0; i < 10; i++) { +} + +this.formats = {}; +dfx.inherits('ContentFormat', 'Widget'); + +for (var widgetid in this.loadedContents) { + if (dfx.isset(widget) === true) { + widget.loadAutoSaveCWidgetStore.setData('activeScreen', null);widget.getContents(this.loadedContents[widgetid], function() {self.widgetLoaded(widget.id);}); + } +} + +for (var i = 0; i < 10;) { +} +for (var i = 0; i < 10;) { +} + +for (var i = 0;; i++) { +} +for (var i = 0;; i++) { +} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( var i = 0; i < 10; i++ ) {} +for ( var i = 0; i < 10; i++ ) {} +for ( var i = 0; i < 10; i++ ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +for (; i < 10; i++) {} +for (; i < 10; i++) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( ; i < 10; i++ ) {} +for ( ; i < 10; i++ ) {} +for ( ; i < 10; i++ ) {} + +for ( i = 0; i < 10; ) {} +for ( i = 0; i < 10; ) {} +for ( i = 0; i < 10; ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +// Test handling of comments and inline annotations. +for (/*phpcs:enable*/ i = 0 /*start*/; /*end*/i < 10/*comment*/; i++ /*comment*/) {} + +// Test multi-line FOR control structure. +for (i = 0; i < 10; i++) {} + +// Test multi-line FOR control structure with comments and annotations. +for (i = 0; /* Start */ + i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ + i++ // comment + +) {} + +// Test fixing each error in one go. Note: lines 84 + 88 contain trailing whitespace on purpose. +for (i = 0; i < 10; i++) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( i = 0; i < 10; i++ ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +// Test with semi-colon not belonging to for. +for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {} +for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);}; i++) {} + +// This test has to be the last one in the file! Intentional parse error check. +for diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -30,33 +30,74 @@ switch ($testFile) { case 'ForLoopDeclarationUnitTest.inc': return [ - 8 => 2, - 11 => 2, - 14 => 2, - 17 => 2, - 21 => 6, - 27 => 1, - 30 => 1, - 37 => 2, - 39 => 2, + 8 => 2, + 11 => 2, + 14 => 2, + 17 => 2, + 21 => 6, + 27 => 1, + 30 => 1, + 37 => 2, + 39 => 2, + 43 => 1, + 49 => 1, + 50 => 1, + 53 => 1, + 54 => 1, + 59 => 4, + 62 => 1, + 63 => 1, + 64 => 1, + 66 => 1, + 69 => 1, + 74 => 1, + 77 => 1, + 82 => 2, + 86 => 2, + 91 => 1, + 95 => 1, + 101 => 2, + 105 => 2, + 110 => 1, + 116 => 2, ]; - break; + case 'ForLoopDeclarationUnitTest.js': return [ - 6 => 2, - 9 => 2, - 12 => 2, - 15 => 2, - 19 => 6, - 33 => 1, - 36 => 1, - 43 => 2, - 45 => 2, + 6 => 2, + 9 => 2, + 12 => 2, + 15 => 2, + 19 => 6, + 33 => 1, + 36 => 1, + 43 => 2, + 45 => 2, + 49 => 1, + 55 => 1, + 56 => 1, + 59 => 1, + 60 => 1, + 65 => 4, + 68 => 1, + 69 => 1, + 70 => 1, + 72 => 1, + 75 => 1, + 80 => 1, + 83 => 1, + 88 => 2, + 92 => 2, + 97 => 1, + 101 => 1, + 107 => 2, + 111 => 2, + 116 => 1, + 122 => 2, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() @@ -68,11 +109,22 @@ * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * + * @param string $testFile The name of the file being tested. + * * @return array */ - public function getWarningList() + public function getWarningList($testFile='ForLoopDeclarationUnitTest.inc') { - return []; + switch ($testFile) { + case 'ForLoopDeclarationUnitTest.inc': + return [119 => 1]; + + case 'ForLoopDeclarationUnitTest.js': + return [125 => 1]; + + default: + return []; + }//end switch }//end getWarningList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -16,7 +16,7 @@ /** - * Get a list of CLI values to set befor the file is tested. + * Get a list of CLI values to set before the file is tested. * * @param string $testFile The name of the file being tested. * diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -20,4 +20,3 @@ TRY { } Catch (Exception $e) { } -?> \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,22 @@ + 1, 114 => 1, 123 => 1, + 138 => 1, + 141 => 1, ]; return $errors; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -21,3 +21,21 @@ } $connection = new Db\Adapter\Pdo\Mysql($config); + +namespace Strtolower\Silly; + +use function strToUpper as somethingElse; +use function MyClass\WordsToUpper as UCWords; // Intentional redeclared function error. +use function strToUpper\NotTheFunction; + +class ArrayUnique {} + +$sillyComments = strToLower /*comment*/ ($string); + +$callToGlobalFunction = \STR_REPEAT($a, 2); +$callToGlobalFunction = \ /*comment*/ str_Repeat($a, 2); + +$callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT($a, 2); +$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative. + +$filePath = new \File($path); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,41 @@ +Count(); +$count = $object::Count(); +$count = $object->count(); +$count = $object::count(); +class MyClass { + public function Count() {} +} + +function &Sort() { + +} + +$connection = new Db\Adapter\Pdo\Mysql($config); + +namespace Strtolower\Silly; + +use function strtoupper as somethingElse; +use function MyClass\WordsToUpper as UCWords; // Intentional redeclared function error. +use function strToUpper\NotTheFunction; + +class ArrayUnique {} + +$sillyComments = strtolower /*comment*/ ($string); + +$callToGlobalFunction = \str_repeat($a, 2); +$callToGlobalFunction = \ /*comment*/ str_repeat($a, 2); + +$callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT($a, 2); +$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative. + +$filePath = new \File($path); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -26,8 +26,12 @@ public function getErrorList() { return [ - 2 => 1, - 4 => 1, + 2 => 1, + 4 => 1, + 27 => 1, + 33 => 1, + 35 => 1, + 36 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -37,4 +37,18 @@ }//end emptyFunction(); public function register(); -?> + +function allOnOneLine() { echo 'abc'; } + +$a = function() +{ + echo 'Testing a closure'; +}; + +$a = function() +{ + + + + echo 'Testing a closure'; +}; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,49 @@ + 1, 25 => 1, + 49 => 1, ]; - break; + case 'FunctionOpeningBraceSpaceUnitTest.js': return [ 11 => 1, @@ -41,10 +42,9 @@ 38 => 1, 88 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,451 @@ +setLogger(new class { + public function a(){} + private function b(){} + protected function c(){} +}); + +?> + +setLogger(new class { + + public function a(){} + + private function b(){} + + protected function c(){} + +}); + +?> + +setLogger(new class { - public function a(){} - private function b(){} - protected function c(){} -}); - -?> - -setLogger(new class { - - public function a(){} - - private function b(){} - - protected function c(){} - -}); - -?> - - */ - public function getErrorList() + public function getErrorList($testFile='') { - return [ - 20 => 1, - 29 => 1, - 38 => 1, - 45 => 1, - 49 => 1, - 55 => 1, - 58 => 1, - 60 => 1, - 75 => 1, - 94 => 1, - 105 => 1, - 107 => 1, - 113 => 2, - 135 => 1, - 154 => 1, - 167 => 2, - 184 => 1, - 218 => 2, - 275 => 1, - 276 => 1, - 289 => 1, - 291 => 1, - 297 => 1, - 321 => 1, - 323 => 1, - 332 => 1, - 338 => 1, - 339 => 1, - 348 => 2, - 349 => 1, - 350 => 1, - 354 => 2, - 355 => 1, - 356 => 1, - 379 => 1, - 393 => 1, - 405 => 2, - 412 => 2, - ]; + switch ($testFile) { + case 'FunctionSpacingUnitTest.1.inc': + return [ + 26 => 1, + 35 => 1, + 44 => 1, + 51 => 1, + 55 => 1, + 61 => 1, + 64 => 1, + 66 => 1, + 81 => 1, + 100 => 1, + 111 => 1, + 113 => 1, + 119 => 2, + 141 => 1, + 160 => 1, + 173 => 2, + 190 => 1, + 224 => 2, + 281 => 1, + 282 => 1, + 295 => 1, + 297 => 1, + 303 => 1, + 327 => 1, + 329 => 1, + 338 => 1, + 344 => 1, + 345 => 1, + 354 => 2, + 355 => 1, + 356 => 1, + 360 => 2, + 361 => 1, + 362 => 1, + 385 => 1, + 399 => 1, + 411 => 2, + 418 => 2, + 426 => 2, + 432 => 1, + 437 => 1, + 438 => 1, + 442 => 2, + 444 => 1, + 449 => 1, + ]; + + case 'FunctionSpacingUnitTest.2.inc': + return [2 => 1]; + + case 'FunctionSpacingUnitTest.3.inc': + return [7 => 1]; + + case 'FunctionSpacingUnitTest.5.inc': + return [5 => 1]; + + case 'FunctionSpacingUnitTest.6.inc': + return [10 => 1]; + + default: + return []; + }//end switch }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -17,5 +17,3 @@ &&$baz ) { } - -?> diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,19 @@ + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -48,4 +48,21 @@ // Уберём из системных свойств все кроме информации об услугах +class Nested_Function { + public function getAnonymousClass() { + return new class() { + + + static private final function _nested_function() { + echo 'code here'; + + echo 'code here'; + + } + + + }; + } +} + ?> diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -40,7 +40,9 @@ 28 => 1, 33 => 1, 49 => 1, - 55 => 1, + 62 => 1, + 65 => 1, + 73 => 1, ]; break; case 'SuperfluousWhitespaceUnitTest.2.inc': diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php Thu May 09 15:33:08 2019 +0100 @@ -56,11 +56,11 @@ // There is the possibility to pass "--ide" as an option to the analyzer. // This would result in an output format which would be easier to parse. - // The problem here is that no cleartext error messages are returnwd; only + // The problem here is that no cleartext error messages are returned; only // error-code-labels. So for a start we go for cleartext output. $exitCode = exec($cmd, $output, $retval); - // Variable $exitCode is the last line of $output if no error occures, on + // Variable $exitCode is the last line of $output if no error occurs, on // error it is numeric. Try to handle various error conditions and // provide useful error reporting. if (is_numeric($exitCode) === true && $exitCode > 0) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php Thu May 09 15:33:08 2019 +0100 @@ -57,6 +57,7 @@ $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($last - 1), null, true); if ($tokens[$prev]['code'] !== T_SEMICOLON && $tokens[$prev]['code'] !== T_CLOSE_CURLY_BRACKET + && $tokens[$prev]['code'] !== T_OPEN_TAG ) { $phpcsFile->fixer->addContent($prev, ';'); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php Thu May 09 15:33:08 2019 +0100 @@ -12,6 +12,7 @@ use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; use PHP_CodeSniffer\Util\Common; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; class ValidVariableNameSniff extends AbstractVariableSniff { @@ -79,7 +80,7 @@ // this: MyClass::$_variable, so we don't know its scope. $inClass = true; } else { - $inClass = $phpcsFile->hasCondition($stackPtr, [T_CLASS, T_INTERFACE, T_TRAIT]); + $inClass = $phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens); } if ($inClass === true) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,3 @@ + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,3 @@ + diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ + 1]; - break; + case 'ClosingTagUnitTest.3.inc': case 'ClosingTagUnitTest.4.inc': case 'ClosingTagUnitTest.5.inc': + case 'ClosingTagUnitTest.7.inc': return [1 => 1]; - break; + + case 'ClosingTagUnitTest.6.inc': + return [3 => 1]; + default: return []; - break; } }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc Thu May 09 15:33:08 2019 +0100 @@ -108,3 +108,11 @@ public function __construct(); } + +$anonClass = new class() { + public function foo($foo, $_foo, $foo_bar) { + $bar = 1; + $_bar = 2; + $bar_foo = 3; + } +}; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php Thu May 09 15:33:08 2019 +0100 @@ -26,31 +26,33 @@ public function getErrorList() { return [ - 3 => 1, - 5 => 1, - 11 => 1, - 13 => 1, - 17 => 1, - 19 => 1, - 23 => 1, - 25 => 1, - 29 => 1, - 31 => 1, - 36 => 1, - 38 => 1, - 42 => 1, - 44 => 1, - 48 => 1, - 50 => 1, - 61 => 1, - 67 => 1, - 72 => 1, - 74 => 1, - 75 => 1, - 76 => 1, - 79 => 1, - 96 => 1, - 99 => 1, + 3 => 1, + 5 => 1, + 11 => 1, + 13 => 1, + 17 => 1, + 19 => 1, + 23 => 1, + 25 => 1, + 29 => 1, + 31 => 1, + 36 => 1, + 38 => 1, + 42 => 1, + 44 => 1, + 48 => 1, + 50 => 1, + 61 => 1, + 67 => 1, + 72 => 1, + 74 => 1, + 75 => 1, + 76 => 1, + 79 => 1, + 96 => 1, + 99 => 1, + 113 => 1, + 116 => 1, ]; }//end getErrorList() diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php Thu May 09 15:33:08 2019 +0100 @@ -27,7 +27,7 @@ * @param string $eolChar The EOL char used in the content. * * @return void - * @throws TokenizerException If the file appears to be minified. + * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. */ public function __construct($content, Config $config, $eolChar='\n') { @@ -35,7 +35,7 @@ throw new TokenizerException('File appears to be minified and cannot be processed'); } - return parent::__construct($content, $config, $eolChar); + parent::__construct($content, $config, $eolChar); }//end __construct() @@ -97,6 +97,9 @@ $token['code'] = T_STRING; } + $token['content'] = str_replace('^PHPCS_CSS_T_OPEN_TAG^', '', $token['content']); + if (PHP_CODESNIFFER_VERBOSITY > 1) { $type = $token['type']; $content = Util\Common::prepareForOutput($token['content']); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php Thu May 09 15:33:08 2019 +0100 @@ -257,7 +257,7 @@ * @param string $eolChar The EOL char used in the content. * * @return void - * @throws TokenizerException If the file appears to be minified. + * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. */ public function __construct($content, Config $config, $eolChar='\n') { @@ -265,7 +265,7 @@ throw new TokenizerException('File appears to be minified and cannot be processed'); } - return parent::__construct($content, $config, $eolChar); + parent::__construct($content, $config, $eolChar); }//end __construct() @@ -446,14 +446,7 @@ // Special case for T_DIVIDE which can actually be // the start of a regular expression. if ($buffer === $char && $char === '/' && $chars[($i + 1)] !== '*') { - $regex = $this->getRegexToken( - $i, - $string, - $chars, - $tokens, - $this->eolChar - ); - + $regex = $this->getRegexToken($i, $string, $chars, $tokens); if ($regex !== null) { $tokens[] = [ 'code' => T_REGULAR_EXPRESSION, @@ -832,7 +825,7 @@ $numLines = count($tokenLines); for ($i = 0; $i < $numLines; $i++) { - $newToken['content'] = $tokenLines[$i]; + $newToken = ['content' => $tokenLines[$i]]; if ($i === ($numLines - 1)) { if ($tokenLines[$i] === '') { break; @@ -918,7 +911,7 @@ * @param string $chars An array of characters being tokenized. * @param string $tokens The current array of tokens found in the string. * - * @return void + * @return array|null */ public function getRegexToken($char, $string, $chars, $tokens) { @@ -1111,8 +1104,8 @@ && isset($this->tokens[$i]['scope_condition']) === false && isset($this->tokens[$i]['bracket_closer']) === true ) { - $condition = end($this->tokens[$i]['conditions']); - reset($this->tokens[$i]['conditions']); + $condition = $this->tokens[$i]['conditions']; + $condition = end($condition); if ($condition === T_CLASS) { // Possibly an ES6 method. To be classified as one, the previous // non-empty tokens need to be a set of parenthesis, and then a string diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php Thu May 09 15:33:08 2019 +0100 @@ -266,7 +266,7 @@ * A list of tokens that end the scope. * * This array is just a unique collection of the end tokens - * from the _scopeOpeners array. The data is duplicated here to + * from the scopeOpeners array. The data is duplicated here to * save time during parsing of the file. * * @var array @@ -504,7 +504,9 @@ echo ": $type => $content"; }//end if - if ($newStackPtr > 0 && $finalTokens[($newStackPtr - 1)]['code'] !== T_WHITESPACE) { + if ($newStackPtr > 0 + && isset(Util\Tokens::$emptyTokens[$finalTokens[($newStackPtr - 1)]['code']]) === false + ) { $lastNotEmptyToken = ($newStackPtr - 1); } @@ -782,8 +784,8 @@ && strtolower($tokens[($stackPtr + 2)][1]) === 'from' ) { // Could be multi-line, so just the token stack. - $token[0] = T_YIELD_FROM; - $token[1] = $token[1].$tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; + $token[0] = T_YIELD_FROM; + $token[1] .= $tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; if (PHP_CODESNIFFER_VERBOSITY > 1) { for ($i = ($stackPtr + 1); $i <= ($stackPtr + 2); $i++) { @@ -816,8 +818,8 @@ && strtolower($tokens[($stackPtr + 2)][1]) === 'from' ) { // Could be multi-line, so just just the token stack. - $token[0] = T_YIELD_FROM; - $token[1] = $token[1].$tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; + $token[0] = T_YIELD_FROM; + $token[1] .= $tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; if (PHP_CODESNIFFER_VERBOSITY > 1) { for ($i = ($stackPtr + 1); $i <= ($stackPtr + 2); $i++) { @@ -1001,7 +1003,7 @@ $newToken['code'] = T_NULLABLE; $newToken['type'] = 'T_NULLABLE'; break; - } else if (in_array($tokenType, [T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, '=', '{', ';']) === true) { + } else if (in_array($tokenType, [T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, '=', '{', ';'], true) === true) { $newToken['code'] = T_INLINE_THEN; $newToken['type'] = 'T_INLINE_THEN'; @@ -1125,7 +1127,7 @@ if (is_array($tokens[$x]) === true && isset(Util\Tokens::$emptyTokens[$tokens[$x][0]]) === true ) { - // Whitespace or coments before the return type. + // Whitespace or comments before the return type. continue; } @@ -1281,6 +1283,7 @@ T_NAMESPACE => true, T_PAAMAYIM_NEKUDOTAYIM => true, ]; + if (isset($context[$finalTokens[$lastNotEmptyToken]['code']]) === true) { // Special case for syntax like: return new self // where self should not be a string. diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php Thu May 09 15:33:08 2019 +0100 @@ -37,6 +37,27 @@ protected $tokens = []; /** + * The number of tokens in the tokens array. + * + * @var integer + */ + protected $numTokens = 0; + + /** + * A list of tokens that are allowed to open a scope. + * + * @var array + */ + public $scopeOpeners = []; + + /** + * A list of tokens that end the scope. + * + * @var array + */ + public $endScopeTokens = []; + + /** * Known lengths of tokens. * * @var array @@ -59,7 +80,7 @@ * @param string $eolChar The EOL char used in the content. * * @return void - * @throws TokenizerException If the file appears to be minified. + * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. */ public function __construct($content, $config, $eolChar='\n') { @@ -163,7 +184,7 @@ $encoding = $this->config->encoding; $tabWidth = $this->config->tabWidth; - $this->tokensWithTabs = [ + $tokensWithTabs = [ T_WHITESPACE => true, T_COMMENT => true, T_DOC_COMMENT => true, @@ -186,7 +207,7 @@ $length = $this->knownLengths[$this->tokens[$i]['code']]; $currColumn += $length; } else if ($tabWidth === 0 - || isset($this->tokensWithTabs[$this->tokens[$i]['code']]) === false + || isset($tokensWithTabs[$this->tokens[$i]['code']]) === false || strpos($this->tokens[$i]['content'], "\t") === false ) { // There are no tabs in this content, or we aren't replacing them. @@ -369,6 +390,17 @@ $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; } + // Need to maintain case here, to get the correct sniff code. + $parts = explode(' ', substr($commentText, 10)); + if (count($parts) >= 2) { + $sniffParts = explode('.', $parts[0]); + if (count($sniffParts) >= 3) { + $this->tokens[$i]['sniffCode'] = array_shift($parts); + $this->tokens[$i]['sniffProperty'] = array_shift($parts); + $this->tokens[$i]['sniffPropertyValue'] = rtrim(implode(' ', $parts), " */\r\n"); + } + } + $this->tokens[$i]['code'] = T_PHPCS_SET; $this->tokens[$i]['type'] = 'T_PHPCS_SET'; } else if (substr($commentTextLower, 0, 16) === 'phpcs:ignorefile') { @@ -502,7 +534,7 @@ } if ($lineHasOtherContent === false) { - // Completely ignore the comment line, and set the folllowing + // Completely ignore the comment line, and set the following // line to include the ignore rules we've set. $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; $this->ignoredLines[($this->tokens[$i]['line'] + 1)] = $ignoreRules; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Util/Common.php --- a/vendor/squizlabs/php_codesniffer/src/Util/Common.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Util/Common.php Thu May 09 15:33:08 2019 +0100 @@ -226,31 +226,31 @@ public static function prepareForOutput($content, $exclude=[]) { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - if (in_array("\r", $exclude) === false) { + if (in_array("\r", $exclude, true) === false) { $content = str_replace("\r", '\r', $content); } - if (in_array("\n", $exclude) === false) { + if (in_array("\n", $exclude, true) === false) { $content = str_replace("\n", '\n', $content); } - if (in_array("\t", $exclude) === false) { + if (in_array("\t", $exclude, true) === false) { $content = str_replace("\t", '\t', $content); } } else { - if (in_array("\r", $exclude) === false) { + if (in_array("\r", $exclude, true) === false) { $content = str_replace("\r", "\033[30;1m\\r\033[0m", $content); } - if (in_array("\n", $exclude) === false) { + if (in_array("\n", $exclude, true) === false) { $content = str_replace("\n", "\033[30;1m\\n\033[0m", $content); } - if (in_array("\t", $exclude) === false) { + if (in_array("\t", $exclude, true) === false) { $content = str_replace("\t", "\033[30;1m\\t\033[0m", $content); } - if (in_array(' ', $exclude) === false) { + if (in_array(' ', $exclude, true) === false) { $content = str_replace(' ', "\033[30;1m·\033[0m", $content); } }//end if @@ -384,9 +384,9 @@ /** - * Returns a valid variable type for param/var tag. + * Returns a valid variable type for param/var tags. * - * If type is not one of the standard type, it must be a custom type. + * If type is not one of the standard types, it must be a custom type. * Returns the correct type name suggestion if type name is invalid. * * @param string $varType The variable type to process. @@ -399,7 +399,7 @@ return ''; } - if (in_array($varType, self::$allowedTypes) === true) { + if (in_array($varType, self::$allowedTypes, true) === true) { return $varType; } else { $lowerVarType = strtolower($varType); @@ -445,7 +445,7 @@ } else { return 'array'; }//end if - } else if (in_array($lowerVarType, self::$allowedTypes) === true) { + } else if (in_array($lowerVarType, self::$allowedTypes, true) === true) { // A valid type, but not lower cased. return $lowerVarType; } else { diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/src/Util/Standards.php --- a/vendor/squizlabs/php_codesniffer/src/Util/Standards.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/src/Util/Standards.php Thu May 09 15:33:08 2019 +0100 @@ -116,7 +116,7 @@ $installedStandards = []; foreach ($rulesets as $rulesetPath) { - $ruleset = simplexml_load_string(file_get_contents($rulesetPath)); + $ruleset = @simplexml_load_string(file_get_contents($rulesetPath)); if ($ruleset === false) { continue; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/tests/AllTests.php --- a/vendor/squizlabs/php_codesniffer/tests/AllTests.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/tests/AllTests.php Thu May 09 15:33:08 2019 +0100 @@ -9,8 +9,6 @@ namespace PHP_CodeSniffer\Tests; -use PHPUnit\TextUI\TestRunner; - if (is_file(__DIR__.'/../autoload.php') === true) { include_once 'Core/AllTests.php'; include_once 'Standards/AllSniffs.php'; diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/tests/Core/ErrorSuppressionTest.php --- a/vendor/squizlabs/php_codesniffer/tests/Core/ErrorSuppressionTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/tests/Core/ErrorSuppressionTest.php Thu May 09 15:33:08 2019 +0100 @@ -1115,7 +1115,7 @@ $this->assertEquals(1, $numWarnings); $this->assertCount(1, $warnings); - // Add to supression. + // Add to suppression. $content = 'process(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc Thu May 09 15:33:08 2019 +0100 @@ -1,5 +1,4 @@ 0) { $fixes = count($GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES']); $percent = round(($fixes / $codeCount * 100), 2); - echo "; $fixes were fixable ($percent%)"; + + $output .= '; %d were fixable (%d%%)'; + $data[] = $fixes; + $data[] = $percent; } + vprintf($output, $data); + }//end printPHPCodeSnifferTestOutput() diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/browser-kit/Client.php --- a/vendor/symfony/browser-kit/Client.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/browser-kit/Client.php Thu May 09 15:33:08 2019 +0100 @@ -452,7 +452,7 @@ { do { $request = $this->history->back(); - } while (array_key_exists(serialize($request), $this->redirects)); + } while (\array_key_exists(serialize($request), $this->redirects)); return $this->requestFromRequest($request, false); } @@ -466,7 +466,7 @@ { do { $request = $this->history->forward(); - } while (array_key_exists(serialize($request), $this->redirects)); + } while (\array_key_exists(serialize($request), $this->redirects)); return $this->requestFromRequest($request, false); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Application.php --- a/vendor/symfony/console/Application.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Application.php Thu May 09 15:33:08 2019 +0100 @@ -202,6 +202,13 @@ return 0; } + try { + // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. + $input->bind($this->getDefinition()); + } catch (ExceptionInterface $e) { + // Errors must be ignored, full binding/validation happens later when the command is known. + } + $name = $this->getCommandName($input); if (true === $input->hasParameterOption(['--help', '-h'], true)) { if (!$name) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Helper/ProgressBar.php --- a/vendor/symfony/console/Helper/ProgressBar.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Helper/ProgressBar.php Thu May 09 15:33:08 2019 +0100 @@ -466,19 +466,16 @@ { if ($this->overwrite) { if (!$this->firstRun) { - // Move the cursor to the beginning of the line - $this->output->write("\x0D"); - - // Erase the line - $this->output->write("\x1B[2K"); - // Erase previous lines if ($this->formatLineCount > 0) { - $this->output->write(str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount)); + $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message; } + + // Move the cursor to the beginning of the line and erase the line + $message = "\x0D\x1B[2K$message"; } } elseif ($this->step > 0) { - $this->output->writeln(''); + $message = PHP_EOL.$message; } $this->firstRun = false; diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Helper/QuestionHelper.php --- a/vendor/symfony/console/Helper/QuestionHelper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Helper/QuestionHelper.php Thu May 09 15:33:08 2019 +0100 @@ -49,7 +49,13 @@ if (!$input->isInteractive()) { $default = $question->getDefault(); - if (null !== $default && $question instanceof ChoiceQuestion) { + if (null === $default) { + return $default; + } + + if ($validator = $question->getValidator()) { + return \call_user_func($question->getValidator(), $default); + } elseif ($question instanceof ChoiceQuestion) { $choices = $question->getChoices(); if (!$question->isMultiselect()) { @@ -166,7 +172,7 @@ if (false === $ret) { $ret = fgets($inputStream, 4096); if (false === $ret) { - throw new RuntimeException('Aborted'); + throw new RuntimeException('Aborted.'); } $ret = trim($ret); } @@ -252,8 +258,11 @@ while (!feof($inputStream)) { $c = fread($inputStream, 1); - // Backspace Character - if ("\177" === $c) { + // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. + if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { + shell_exec(sprintf('stty %s', $sttyMode)); + throw new RuntimeException('Aborted.'); + } elseif ("\177" === $c) { // Backspace Character if (0 === $numMatches && 0 !== $i) { --$i; // Move cursor backwards @@ -306,6 +315,10 @@ continue; } else { + if ("\x80" <= $c) { + $c .= fread($inputStream, ["\xC0" => 1, "\xD0" => 1, "\xE0" => 2, "\xF0" => 3][$c & "\xF0"]); + } + $output->write($c); $ret .= $c; ++$i; @@ -380,7 +393,7 @@ shell_exec(sprintf('stty %s', $sttyMode)); if (false === $value) { - throw new RuntimeException('Aborted'); + throw new RuntimeException('Aborted.'); } $value = trim($value); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Input/ArgvInput.php --- a/vendor/symfony/console/Input/ArgvInput.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Input/ArgvInput.php Thu May 09 15:33:08 2019 +0100 @@ -262,8 +262,27 @@ */ public function getFirstArgument() { - foreach ($this->tokens as $token) { + $isOption = false; + foreach ($this->tokens as $i => $token) { if ($token && '-' === $token[0]) { + if (false !== strpos($token, '=') || !isset($this->tokens[$i + 1])) { + continue; + } + + // If it's a long option, consider that everything after "--" is the option name. + // Otherwise, use the last char (if it's a short option set, only the last one can take a value with space separator) + $name = '-' === $token[1] ? substr($token, 2) : substr($token, -1); + if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) { + // noop + } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) { + $isOption = true; + } + + continue; + } + + if ($isOption) { + $isOption = false; continue; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Input/ArrayInput.php --- a/vendor/symfony/console/Input/ArrayInput.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Input/ArrayInput.php Thu May 09 15:33:08 2019 +0100 @@ -19,7 +19,7 @@ * * Usage: * - * $input = new ArrayInput(['name' => 'foo', '--bar' => 'foobar']); + * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']); * * @author Fabien Potencier */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Input/Input.php --- a/vendor/symfony/console/Input/Input.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Input/Input.php Thu May 09 15:33:08 2019 +0100 @@ -69,7 +69,7 @@ $givenArguments = $this->arguments; $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { - return !array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); + return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); }); if (\count($missingArguments) > 0) { @@ -150,7 +150,7 @@ throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); } - return array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); + return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Input/InputDefinition.php --- a/vendor/symfony/console/Input/InputDefinition.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Input/InputDefinition.php Thu May 09 15:33:08 2019 +0100 @@ -338,8 +338,10 @@ * @return string The InputOption name * * @throws InvalidArgumentException When option given does not exist + * + * @internal */ - private function shortcutToName($shortcut) + public function shortcutToName($shortcut) { if (!isset($this->shortcuts[$shortcut])) { throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Tester/ApplicationTester.php --- a/vendor/symfony/console/Tester/ApplicationTester.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Tester/ApplicationTester.php Thu May 09 15:33:08 2019 +0100 @@ -66,7 +66,7 @@ $this->input->setInteractive($options['interactive']); } - $this->captureStreamsIndependently = array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; + $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; if (!$this->captureStreamsIndependently) { $this->output = new StreamOutput(fopen('php://memory', 'w', false)); if (isset($options['decorated'])) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/console/Tester/CommandTester.php --- a/vendor/symfony/console/Tester/CommandTester.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/console/Tester/CommandTester.php Thu May 09 15:33:08 2019 +0100 @@ -62,9 +62,8 @@ } $this->input = new ArrayInput($input); - if ($this->inputs) { - $this->input->setStream(self::createStream($this->inputs)); - } + // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. + $this->input->setStream(self::createStream($this->inputs)); if (isset($options['interactive'])) { $this->input->setInteractive($options['interactive']); @@ -88,6 +87,10 @@ */ public function getDisplay($normalize = false) { + if (null === $this->output) { + throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); + } + rewind($this->output->getStream()); $display = stream_get_contents($this->output->getStream()); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/debug/DebugClassLoader.php --- a/vendor/symfony/debug/DebugClassLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/debug/DebugClassLoader.php Thu May 09 15:33:08 2019 +0100 @@ -233,7 +233,7 @@ // Detect annotations on the class if (false !== $doc = $refl->getDocComment()) { foreach (['final', 'deprecated', 'internal'] as $annotation) { - if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) { + if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) { self::${$annotation}[$class] = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : ''; } } @@ -258,7 +258,7 @@ if (!isset(self::$checkedClasses[$use])) { $this->checkClass($use); } - if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len)) { + if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len) && !isset(self::$deprecated[$class])) { $type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait'); $verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses'); @@ -307,7 +307,7 @@ } foreach (['final', 'internal'] as $annotation) { - if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) { + if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) { $message = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : ''; self::${$annotation.'Methods'}[$class][$method->name] = [$class, $message]; } @@ -390,6 +390,11 @@ $dirFiles = self::$darwinCache[$kDir][1]; + if (!isset($dirFiles[$file]) && ') : eval()\'d code' === substr($file, -17)) { + // Get the file name from "file_name.php(123) : eval()'d code" + $file = substr($file, 0, strrpos($file, '(', -17)); + } + if (isset($dirFiles[$file])) { return $real .= $dirFiles[$file]; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/debug/ErrorHandler.php --- a/vendor/symfony/debug/ErrorHandler.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/debug/ErrorHandler.php Thu May 09 15:33:08 2019 +0100 @@ -222,7 +222,7 @@ } if (!\is_array($log)) { $log = [$log]; - } elseif (!array_key_exists(0, $log)) { + } elseif (!\array_key_exists(0, $log)) { throw new \InvalidArgumentException('No logger provided'); } if (null === $log[0]) { @@ -517,6 +517,11 @@ $errorAsException ? ['exception' => $errorAsException] : [], ]; } else { + if (!\defined('HHVM_VERSION')) { + $currentErrorHandler = set_error_handler('var_dump'); + restore_error_handler(); + } + try { $this->isRecursive = true; $level = ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG; @@ -525,7 +530,7 @@ $this->isRecursive = false; if (!\defined('HHVM_VERSION')) { - set_error_handler([$this, __FUNCTION__]); + set_error_handler($currentErrorHandler); } } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/debug/ExceptionHandler.php --- a/vendor/symfony/debug/ExceptionHandler.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/debug/ExceptionHandler.php Thu May 09 15:33:08 2019 +0100 @@ -372,7 +372,7 @@ $fmt = $this->fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); if (!$fmt) { - return sprintf('in %s%s', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : ''); + return sprintf('in %s%s', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : ''); } if (\is_string($fmt)) { @@ -388,7 +388,11 @@ $link = strtr($fmt[0], ['%f' => $path, '%l' => $line]); } else { - $link = $fmt->format($path, $line); + try { + $link = $fmt->format($path, $line); + } catch (\Exception $e) { + return sprintf('in %s%s', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : ''); + } } return sprintf('in %s%s', $this->escapeHtml($link), $file, 0 < $line ? ' line '.$line : ''); @@ -435,6 +439,6 @@ private function getSymfonyGhostAsSvg() { - return ''; + return ''; } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/ChildDefinition.php --- a/vendor/symfony/dependency-injection/ChildDefinition.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/ChildDefinition.php Thu May 09 15:33:08 2019 +0100 @@ -71,7 +71,7 @@ */ public function getArgument($index) { - if (array_key_exists('index_'.$index, $this->arguments)) { + if (\array_key_exists('index_'.$index, $this->arguments)) { return $this->arguments['index_'.$index]; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Compiler/AutowirePass.php --- a/vendor/symfony/dependency-injection/Compiler/AutowirePass.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Compiler/AutowirePass.php Thu May 09 15:33:08 2019 +0100 @@ -181,7 +181,15 @@ if ($method instanceof \ReflectionFunctionAbstract) { $reflectionMethod = $method; } else { - $reflectionMethod = $this->getReflectionMethod(new Definition($reflectionClass->name), $method); + $definition = new Definition($reflectionClass->name); + try { + $reflectionMethod = $this->getReflectionMethod($definition, $method); + } catch (RuntimeException $e) { + if ($definition->getFactory()) { + continue; + } + throw $e; + } } $arguments = $this->autowireMethod($reflectionMethod, $arguments); @@ -214,7 +222,7 @@ } foreach ($parameters as $index => $parameter) { - if (array_key_exists($index, $arguments) && '' !== $arguments[$index]) { + if (\array_key_exists($index, $arguments) && '' !== $arguments[$index]) { continue; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Compiler/RegisterServiceSubscribersPass.php --- a/vendor/symfony/dependency-injection/Compiler/RegisterServiceSubscribersPass.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Compiler/RegisterServiceSubscribersPass.php Thu May 09 15:33:08 2019 +0100 @@ -43,10 +43,10 @@ if ([] !== array_diff(array_keys($attributes), ['id', 'key'])) { throw new InvalidArgumentException(sprintf('The "container.service_subscriber" tag accepts only the "key" and "id" attributes, "%s" given for service "%s".', implode('", "', array_keys($attributes)), $this->currentId)); } - if (!array_key_exists('id', $attributes)) { + if (!\array_key_exists('id', $attributes)) { throw new InvalidArgumentException(sprintf('Missing "id" attribute on "container.service_subscriber" tag with key="%s" for service "%s".', $attributes['key'], $this->currentId)); } - if (!array_key_exists('key', $attributes)) { + if (!\array_key_exists('key', $attributes)) { $attributes['key'] = $attributes['id']; } if (isset($serviceMap[$attributes['key']])) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Compiler/ResolveBindingsPass.php --- a/vendor/symfony/dependency-injection/Compiler/ResolveBindingsPass.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Compiler/ResolveBindingsPass.php Thu May 09 15:33:08 2019 +0100 @@ -34,6 +34,8 @@ */ public function process(ContainerBuilder $container) { + $this->usedBindings = $container->getRemovedBindingIds(); + try { parent::process($container); @@ -115,15 +117,22 @@ if ($method instanceof \ReflectionFunctionAbstract) { $reflectionMethod = $method; } else { - $reflectionMethod = $this->getReflectionMethod($value, $method); + try { + $reflectionMethod = $this->getReflectionMethod($value, $method); + } catch (RuntimeException $e) { + if ($value->getFactory()) { + continue; + } + throw $e; + } } foreach ($reflectionMethod->getParameters() as $key => $parameter) { - if (array_key_exists($key, $arguments) && '' !== $arguments[$key]) { + if (\array_key_exists($key, $arguments) && '' !== $arguments[$key]) { continue; } - if (array_key_exists('$'.$parameter->name, $bindings)) { + if (\array_key_exists('$'.$parameter->name, $bindings)) { $arguments[$key] = $this->getBindingValue($bindings['$'.$parameter->name]); continue; diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php --- a/vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php Thu May 09 15:33:08 2019 +0100 @@ -71,7 +71,7 @@ $typeFound = false; foreach ($parameters as $j => $p) { - if (!array_key_exists($j, $resolvedArguments) && ProxyHelper::getTypeHint($r, $p, true) === $key) { + if (!\array_key_exists($j, $resolvedArguments) && ProxyHelper::getTypeHint($r, $p, true) === $key) { $resolvedArguments[$j] = $argument; $typeFound = true; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Container.php --- a/vendor/symfony/dependency-injection/Container.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Container.php Thu May 09 15:33:08 2019 +0100 @@ -159,7 +159,7 @@ /** * Sets a service. * - * Setting a service to null resets the service: has() returns false and get() + * Setting a synthetic service to null resets it: has() returns false and get() * behaves in the same way as if the service was never created. * * @param string $id The service identifier @@ -466,7 +466,7 @@ if (isset($this->resolving[$envName = "env($name)"])) { throw new ParameterCircularReferenceException(array_keys($this->resolving)); } - if (isset($this->envCache[$name]) || array_key_exists($name, $this->envCache)) { + if (isset($this->envCache[$name]) || \array_key_exists($name, $this->envCache)) { return $this->envCache[$name]; } if (!$this->has($id = 'container.env_var_processors_locator')) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/ContainerBuilder.php --- a/vendor/symfony/dependency-injection/ContainerBuilder.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/ContainerBuilder.php Thu May 09 15:33:08 2019 +0100 @@ -123,6 +123,8 @@ private $removedIds = []; + private $removedBindingIds = []; + private static $internalTypes = [ 'int' => true, 'float' => true, @@ -866,6 +868,10 @@ { $alias = $this->normalizeId($alias); + if ('' === $alias || '\\' === substr($alias, -1) || \strlen($alias) !== strcspn($alias, "\0\r\n'")) { + throw new InvalidArgumentException(sprintf('Invalid alias id: "%s"', $alias)); + } + if (\is_string($id)) { $id = new Alias($this->normalizeId($id)); } elseif (!$id instanceof Alias) { @@ -1019,6 +1025,10 @@ $id = $this->normalizeId($id); + if ('' === $id || '\\' === substr($id, -1) || \strlen($id) !== strcspn($id, "\0\r\n'")) { + throw new InvalidArgumentException(sprintf('Invalid service id: "%s"', $id)); + } + unset($this->aliasDefinitions[$id], $this->removedIds[$id]); return $this->definitions[$id] = $definition; @@ -1505,6 +1515,35 @@ } /** + * Gets removed binding ids. + * + * @return array + * + * @internal + */ + public function getRemovedBindingIds() + { + return $this->removedBindingIds; + } + + /** + * Removes bindings for a service. + * + * @param string $id The service identifier + * + * @internal + */ + public function removeBindings($id) + { + if ($this->hasDefinition($id)) { + foreach ($this->getDefinition($id)->getBindings() as $key => $binding) { + list(, $bindingId) = $binding->getValues(); + $this->removedBindingIds[(int) $bindingId] = true; + } + } + } + + /** * Returns the Service Conditionals. * * @param mixed $value An array of conditionals to return diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Definition.php --- a/vendor/symfony/dependency-injection/Definition.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Definition.php Thu May 09 15:33:08 2019 +0100 @@ -263,7 +263,7 @@ throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, \count($this->arguments) - 1)); } - if (!array_key_exists($index, $this->arguments)) { + if (!\array_key_exists($index, $this->arguments)) { throw new OutOfBoundsException(sprintf('The argument "%s" doesn\'t exist.', $index)); } @@ -308,7 +308,7 @@ */ public function getArgument($index) { - if (!array_key_exists($index, $this->arguments)) { + if (!\array_key_exists($index, $this->arguments)) { throw new OutOfBoundsException(sprintf('The argument "%s" doesn\'t exist.', $index)); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Dumper/GraphvizDumper.php --- a/vendor/symfony/dependency-injection/Dumper/GraphvizDumper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Dumper/GraphvizDumper.php Thu May 09 15:33:08 2019 +0100 @@ -193,7 +193,7 @@ } foreach ($container->getServiceIds() as $id) { - if (array_key_exists($id, $container->getAliases())) { + if (\array_key_exists($id, $container->getAliases())) { continue; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Dumper/PhpDumper.php --- a/vendor/symfony/dependency-injection/Dumper/PhpDumper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Dumper/PhpDumper.php Thu May 09 15:33:08 2019 +0100 @@ -483,7 +483,7 @@ $instantiation = ''; if (!$isProxyCandidate && $definition->isShared()) { - $instantiation = "\$this->services['$id'] = ".($isSimpleInstance ? '' : '$instance'); + $instantiation = sprintf('$this->services[%s] = %s', $this->doExport($id), $isSimpleInstance ? '' : '$instance'); } elseif (!$isSimpleInstance) { $instantiation = '$instance'; } @@ -679,6 +679,9 @@ * Gets the $public '$id'$shared$autowired service. * * $return +EOF; + $code = str_replace('*/', ' ', $code).<<getProxyDumper()->isProxyCandidate($definition)) { $factoryCode = $asFile ? "\$this->load('%s.php', false)" : '$this->%s(false)'; - $code .= $this->getProxyDumper()->getProxyFactoryCode($definition, $id, sprintf($factoryCode, $methodName)); + $code .= $this->getProxyDumper()->getProxyFactoryCode($definition, $id, sprintf($factoryCode, $methodName, $this->doExport($id))); } if ($definition->isDeprecated()) { @@ -767,14 +770,14 @@ $code .= sprintf(<<<'EOTXT' - if (isset($this->%s['%s'])) { - return $this->%1$s['%2$s']; + if (isset($this->%s[%s])) { + return $this->%1$s[%2$s]; } EOTXT , 'services', - $id + $this->doExport($id) ); return $code; @@ -1530,14 +1533,14 @@ if (!$this->container->hasDefinition($service)) { return 'false'; } - $conditions[] = sprintf("isset(\$this->services['%s'])", $service); + $conditions[] = sprintf('isset($this->services[%s])', $this->doExport($service)); } foreach (ContainerBuilder::getServiceConditionals($value) as $service) { if ($this->container->hasDefinition($service) && !$this->container->getDefinition($service)->isPublic()) { continue; } - $conditions[] = sprintf("\$this->has('%s')", $service); + $conditions[] = sprintf('$this->has(%s)', $this->doExport($service)); } if (!$conditions) { @@ -1776,6 +1779,8 @@ */ private function dumpParameter($name) { + $name = (string) $name; + if ($this->container->isCompiled() && $this->container->hasParameter($name)) { $value = $this->container->getParameter($name); $dumpedValue = $this->dumpValue($value, false); @@ -1785,11 +1790,11 @@ } if (!preg_match("/\\\$this->(?:getEnv\('(?:\w++:)*+\w++'\)|targetDirs\[\d++\])/", $dumpedValue)) { - return sprintf("\$this->parameters['%s']", $name); + return sprintf('$this->parameters[%s]', $this->doExport($name)); } } - return sprintf("\$this->getParameter('%s')", $name); + return sprintf('$this->getParameter(%s)', $this->doExport($name)); } /** @@ -1813,7 +1818,7 @@ if ($this->container->hasDefinition($id) && $definition = $this->container->getDefinition($id)) { if ($definition->isSynthetic()) { - $code = sprintf('$this->get(\'%s\'%s)', $id, null !== $reference ? ', '.$reference->getInvalidBehavior() : ''); + $code = sprintf('$this->get(%s%s)', $this->doExport($id), null !== $reference ? ', '.$reference->getInvalidBehavior() : ''); } elseif (null !== $reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $reference->getInvalidBehavior()) { $code = 'null'; if (!$definition->isShared()) { @@ -1822,7 +1827,7 @@ } elseif ($this->isTrivialInstance($definition)) { $code = substr($this->addNewInstance($definition, '', '', $id), 8, -2); if ($definition->isShared()) { - $code = sprintf('$this->services[\'%s\'] = %s', $id, $code); + $code = sprintf('$this->services[%s] = %s', $this->doExport($id), $code); } $code = "($code)"; } elseif ($this->asFiles && $definition->isShared() && !$this->isHotPath($definition)) { @@ -1833,14 +1838,14 @@ } elseif (null !== $reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $reference->getInvalidBehavior()) { return 'null'; } elseif (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { - $code = sprintf('$this->get(\'%s\', /* ContainerInterface::NULL_ON_INVALID_REFERENCE */ %d)', $id, ContainerInterface::NULL_ON_INVALID_REFERENCE); + $code = sprintf('$this->get(%s, /* ContainerInterface::NULL_ON_INVALID_REFERENCE */ %d)', $this->doExport($id), ContainerInterface::NULL_ON_INVALID_REFERENCE); } else { - $code = sprintf('$this->get(\'%s\')', $id); + $code = sprintf('$this->get(%s)', $this->doExport($id)); } // The following is PHP 5.5 syntax for what could be written as "(\$this->services['$id'] ?? $code)" on PHP>=7.0 - return "\${(\$_ = isset(\$this->services['$id']) ? \$this->services['$id'] : $code) && false ?: '_'}"; + return sprintf("\${(\$_ = isset(\$this->services[%s]) ? \$this->services[%1\$s] : %s) && false ?: '_'}", $this->doExport($id), $code); } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Dumper/XmlDumper.php --- a/vendor/symfony/dependency-injection/Dumper/XmlDumper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Dumper/XmlDumper.php Thu May 09 15:33:08 2019 +0100 @@ -47,7 +47,7 @@ $container = $this->document->createElementNS('http://symfony.com/schema/dic/services', 'container'); $container->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $container->setAttribute('xsi:schemaLocation', 'http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd'); + $container->setAttribute('xsi:schemaLocation', 'http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd'); $this->addParameters($container); $this->addServices($container); @@ -290,12 +290,12 @@ } elseif ($value instanceof Reference) { $element->setAttribute('type', 'service'); $element->setAttribute('id', (string) $value); - $behaviour = $value->getInvalidBehavior(); - if (ContainerInterface::NULL_ON_INVALID_REFERENCE == $behaviour) { + $behavior = $value->getInvalidBehavior(); + if (ContainerInterface::NULL_ON_INVALID_REFERENCE == $behavior) { $element->setAttribute('on-invalid', 'null'); - } elseif (ContainerInterface::IGNORE_ON_INVALID_REFERENCE == $behaviour) { + } elseif (ContainerInterface::IGNORE_ON_INVALID_REFERENCE == $behavior) { $element->setAttribute('on-invalid', 'ignore'); - } elseif (ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE == $behaviour) { + } elseif (ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE == $behavior) { $element->setAttribute('on-invalid', 'ignore_uninitialized'); } } elseif ($value instanceof Definition) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Extension/Extension.php --- a/vendor/symfony/dependency-injection/Extension/Extension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Extension/Extension.php Thu May 09 15:33:08 2019 +0100 @@ -115,7 +115,7 @@ */ protected function isConfigEnabled(ContainerBuilder $container, array $config) { - if (!array_key_exists('enabled', $config)) { + if (!\array_key_exists('enabled', $config)) { throw new InvalidArgumentException("The config array has no 'enabled' key."); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php --- a/vendor/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php Thu May 09 15:33:08 2019 +0100 @@ -17,7 +17,7 @@ /** * {@inheritdoc} * - * Noop proxy instantiator - simply produces the real service instead of a proxy instance. + * Noop proxy instantiator - produces the real service instead of a proxy instance. * * @author Marco Pivetta */ diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Loader/Configurator/ServiceConfigurator.php --- a/vendor/symfony/dependency-injection/Loader/Configurator/ServiceConfigurator.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Loader/Configurator/ServiceConfigurator.php Thu May 09 15:33:08 2019 +0100 @@ -59,6 +59,8 @@ { parent::__destruct(); + $this->container->removeBindings($this->id); + if (!$this->definition instanceof ChildDefinition) { $this->container->setDefinition($this->id, $this->definition->setInstanceofConditionals($this->instanceof)); } else { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Loader/FileLoader.php --- a/vendor/symfony/dependency-injection/Loader/FileLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Loader/FileLoader.php Thu May 09 15:33:08 2019 +0100 @@ -91,6 +91,8 @@ */ protected function setDefinition($id, Definition $definition) { + $this->container->removeBindings($id); + if ($this->isLoadingInstanceof) { if (!$definition instanceof ChildDefinition) { throw new InvalidArgumentException(sprintf('Invalid type definition "%s": ChildDefinition expected, "%s" given.', $id, \get_class($definition))); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Loader/XmlFileLoader.php --- a/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php Thu May 09 15:33:08 2019 +0100 @@ -333,7 +333,7 @@ continue; } - if (false !== strpos($name, '-') && false === strpos($name, '_') && !array_key_exists($normalizedName = str_replace('-', '_', $name), $parameters)) { + if (false !== strpos($name, '-') && false === strpos($name, '_') && !\array_key_exists($normalizedName = str_replace('-', '_', $name), $parameters)) { $parameters[$normalizedName] = XmlUtils::phpize($node->nodeValue); } // keep not normalized key @@ -584,7 +584,8 @@ } if (($extension = $this->container->getExtension($items[$i])) && false !== $extension->getXsdValidationBasePath()) { - $path = str_replace($extension->getNamespace(), str_replace('\\', '/', $extension->getXsdValidationBasePath()).'/', $items[$i + 1]); + $ns = $extension->getNamespace(); + $path = str_replace([$ns, str_replace('http://', 'https://', $ns)], str_replace('\\', '/', $extension->getXsdValidationBasePath()).'/', $items[$i + 1]); if (!is_file($path)) { throw new RuntimeException(sprintf('Extension "%s" references a non-existent XSD file "%s"', \get_class($extension), $path)); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/Loader/YamlFileLoader.php --- a/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php Thu May 09 15:33:08 2019 +0100 @@ -213,7 +213,7 @@ throw new InvalidArgumentException(sprintf('The "services" key should contain an array in %s. Check your YAML syntax.', $file)); } - if (array_key_exists('_instanceof', $content['services'])) { + if (\array_key_exists('_instanceof', $content['services'])) { $instanceof = $content['services']['_instanceof']; unset($content['services']['_instanceof']); @@ -250,7 +250,7 @@ */ private function parseDefaults(array &$content, $file) { - if (!array_key_exists('_defaults', $content['services'])) { + if (!\array_key_exists('_defaults', $content['services'])) { return []; } $defaults = $content['services']['_defaults']; @@ -361,7 +361,7 @@ if (isset($service['alias'])) { $this->container->setAlias($id, $alias = new Alias($service['alias'])); - if (array_key_exists('public', $service)) { + if (\array_key_exists('public', $service)) { $alias->setPublic($service['public']); } elseif (isset($defaults['public'])) { $alias->setPublic($defaults['public']); @@ -438,7 +438,7 @@ $definition->setAbstract($service['abstract']); } - if (array_key_exists('deprecated', $service)) { + if (\array_key_exists('deprecated', $service)) { $definition->setDeprecated(true, $service['deprecated']); } @@ -571,11 +571,11 @@ } } - if (array_key_exists('namespace', $service) && !array_key_exists('resource', $service)) { + if (\array_key_exists('namespace', $service) && !\array_key_exists('resource', $service)) { throw new InvalidArgumentException(sprintf('A "resource" attribute must be set when the "namespace" attribute is set for service "%s" in %s. Check your YAML syntax.', $id, $file)); } - if (array_key_exists('resource', $service)) { + if (\array_key_exists('resource', $service)) { if (!\is_string($service['resource'])) { throw new InvalidArgumentException(sprintf('A "resource" attribute must be of type string for service "%s" in %s. Check your YAML syntax.', $id, $file)); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php --- a/vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php Thu May 09 15:33:08 2019 +0100 @@ -70,7 +70,7 @@ { $name = $this->normalizeName($name); - if (!array_key_exists($name, $this->parameters)) { + if (!\array_key_exists($name, $this->parameters)) { if (!$name) { throw new ParameterNotFoundException($name); } @@ -121,7 +121,7 @@ */ public function has($name) { - return array_key_exists($this->normalizeName($name), $this->parameters); + return \array_key_exists($this->normalizeName($name), $this->parameters); } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dom-crawler/Crawler.php --- a/vendor/symfony/dom-crawler/Crawler.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dom-crawler/Crawler.php Thu May 09 15:33:08 2019 +0100 @@ -968,7 +968,7 @@ $expressions = []; // An expression which will never match to replace expressions which cannot match in the crawler - // We cannot simply drop + // We cannot drop $nonMatchingExpression = 'a[name() = "b"]'; $xpathLen = \strlen($xpath); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dom-crawler/Field/FileFormField.php --- a/vendor/symfony/dom-crawler/Field/FileFormField.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dom-crawler/Field/FileFormField.php Thu May 09 15:33:08 2019 +0100 @@ -60,7 +60,7 @@ // copy to a tmp location $tmp = sys_get_temp_dir().'/'.strtr(substr(base64_encode(hash('sha256', uniqid(mt_rand(), true), true)), 0, 7), '/', '_'); - if (array_key_exists('extension', $info)) { + if (\array_key_exists('extension', $info)) { $tmp .= '.'.$info['extension']; } if (is_file($tmp)) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/dom-crawler/FormFieldRegistry.php --- a/vendor/symfony/dom-crawler/FormFieldRegistry.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/dom-crawler/FormFieldRegistry.php Thu May 09 15:33:08 2019 +0100 @@ -57,7 +57,7 @@ $target = &$this->fields; while (\count($segments) > 1) { $path = array_shift($segments); - if (!array_key_exists($path, $target)) { + if (!\array_key_exists($path, $target)) { return; } $target = &$target[$path]; @@ -80,7 +80,7 @@ $target = &$this->fields; while ($segments) { $path = array_shift($segments); - if (!array_key_exists($path, $target)) { + if (!\array_key_exists($path, $target)) { throw new \InvalidArgumentException(sprintf('Unreachable field "%s"', $path)); } $target = &$target[$path]; diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php --- a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php Thu May 09 15:33:08 2019 +0100 @@ -290,10 +290,6 @@ if (null !== $this->logger) { $this->logger->debug('Notified event "{event}" to listener "{listener}".', $context); } - - if (!isset($this->called[$eventName])) { - $this->called[$eventName] = new \SplObjectStorage(); - } } else { $this->callStack->detach($listener); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/event-dispatcher/Debug/WrappedListener.php --- a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php Thu May 09 15:33:08 2019 +0100 @@ -29,6 +29,7 @@ private $dispatcher; private $pretty; private $stub; + private $priority; private static $hasClassStub; public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) @@ -96,7 +97,7 @@ return [ 'event' => $eventName, - 'priority' => null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null, + 'priority' => null !== $this->priority ? $this->priority : (null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null), 'pretty' => $this->pretty, 'stub' => $this->stub, ]; @@ -104,11 +105,14 @@ public function __invoke(Event $event, $eventName, EventDispatcherInterface $dispatcher) { + $dispatcher = $this->dispatcher ?: $dispatcher; + $this->called = true; + $this->priority = $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); - \call_user_func($this->listener, $event, $eventName, $this->dispatcher ?: $dispatcher); + \call_user_func($this->listener, $event, $eventName, $dispatcher); if ($e->isStarted()) { $e->stop(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php --- a/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php Thu May 09 15:33:08 2019 +0100 @@ -106,7 +106,7 @@ $definition->addMethodCall('addListener', $args); if (isset($this->hotPathEvents[$args[0]])) { - $container->getDefinition($id)->addTag('container.hot_path'); + $container->getDefinition($id)->addTag($this->hotPathTagName); } } $extractingDispatcher->listeners = []; diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/event-dispatcher/GenericEvent.php --- a/vendor/symfony/event-dispatcher/GenericEvent.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/event-dispatcher/GenericEvent.php Thu May 09 15:33:08 2019 +0100 @@ -111,7 +111,7 @@ */ public function hasArgument($key) { - return array_key_exists($key, $this->arguments); + return \array_key_exists($key, $this->arguments); } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/finder/Finder.php --- a/vendor/symfony/finder/Finder.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/finder/Finder.php Thu May 09 15:33:08 2019 +0100 @@ -29,7 +29,7 @@ * * All rules may be invoked several times. * - * All methods return the current Finder object to allow easy chaining: + * All methods return the current Finder object to allow chaining: * * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); * @@ -645,12 +645,15 @@ */ private function searchInDirectory($dir) { + $exclude = $this->exclude; + $notPaths = $this->notPaths; + if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $this->exclude = array_merge($this->exclude, self::$vcsPatterns); + $exclude = array_merge($exclude, self::$vcsPatterns); } if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $this->notPaths[] = '#(^|/)\..+(/|$)#'; + $notPaths[] = '#(^|/)\..+(/|$)#'; } $minDepth = 0; @@ -683,8 +686,8 @@ $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - if ($this->exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $this->exclude); + if ($exclude) { + $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); } $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); @@ -717,8 +720,8 @@ $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); } - if ($this->paths || $this->notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $this->notPaths); + if ($this->paths || $notPaths) { + $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); } if ($this->sort) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/finder/Tests/FinderTest.php --- a/vendor/symfony/finder/Tests/FinderTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/finder/Tests/FinderTest.php Thu May 09 15:33:08 2019 +0100 @@ -199,6 +199,18 @@ $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->in(self::$tmpDir)->getIterator()); } + public function testIgnoreVCSCanBeDisabledAfterFirstIteration() + { + $finder = $this->buildFinder(); + $finder->in(self::$tmpDir); + $finder->ignoreDotFiles(false); + + $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->getIterator()); + + $finder->ignoreVCS(false); + $this->assertIterator($this->toAbsolute(['.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->getIterator()); + } + public function testIgnoreDotFiles() { $finder = $this->buildFinder(); @@ -214,6 +226,17 @@ $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar']), $finder->in(self::$tmpDir)->getIterator()); } + public function testIgnoreDotFilesCanBeDisabledAfterFirstIteration() + { + $finder = $this->buildFinder(); + $finder->in(self::$tmpDir); + + $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar']), $finder->getIterator()); + + $finder->ignoreDotFiles(false); + $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->getIterator()); + } + public function testSortByName() { $finder = $this->buildFinder(); @@ -316,6 +339,10 @@ public function testInWithGlobBrace() { + if (!\defined('GLOB_BRACE')) { + $this->markTestSkipped('Glob brace is not supported on this system.'); + } + $finder = $this->buildFinder(); $finder->in([__DIR__.'/Fixtures/{A,copy/A}/B/C'])->getIterator(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/CHANGELOG.md --- a/vendor/symfony/http-foundation/CHANGELOG.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/CHANGELOG.md Thu May 09 15:33:08 2019 +0100 @@ -144,10 +144,10 @@ * Added `FlashBag`. Flashes expire when retrieved by `get()` or `all()`. This implementation is ESI compatible. * Added `AutoExpireFlashBag` (default) to replicate Symfony 2.0.x auto expire - behaviour of messages auto expiring after one page page load. Messages must + behavior of messages auto expiring after one page page load. Messages must be retrieved by `get()` or `all()`. * Added `Symfony\Component\HttpFoundation\Attribute\AttributeBag` to replicate - attributes storage behaviour from 2.0.x (default). + attributes storage behavior from 2.0.x (default). * Added `Symfony\Component\HttpFoundation\Attribute\NamespacedAttributeBag` for namespace session attributes. * Flash API can stores messages in an array so there may be multiple messages diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php --- a/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php Thu May 09 15:33:08 2019 +0100 @@ -808,6 +808,12 @@ */ public function guess($mimeType) { - return isset($this->defaultExtensions[$mimeType]) ? $this->defaultExtensions[$mimeType] : null; + if (isset($this->defaultExtensions[$mimeType])) { + return $this->defaultExtensions[$mimeType]; + } + + $lcMimeType = strtolower($mimeType); + + return isset($this->defaultExtensions[$lcMimeType]) ? $this->defaultExtensions[$lcMimeType] : null; } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/HeaderBag.php --- a/vendor/symfony/http-foundation/HeaderBag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/HeaderBag.php Thu May 09 15:33:08 2019 +0100 @@ -112,7 +112,7 @@ $key = str_replace('_', '-', strtolower($key)); $headers = $this->all(); - if (!array_key_exists($key, $headers)) { + if (!\array_key_exists($key, $headers)) { if (null === $default) { return $first ? null : []; } @@ -168,7 +168,7 @@ */ public function has($key) { - return array_key_exists(str_replace('_', '-', strtolower($key)), $this->all()); + return \array_key_exists(str_replace('_', '-', strtolower($key)), $this->all()); } /** @@ -245,7 +245,7 @@ */ public function hasCacheControlDirective($key) { - return array_key_exists($key, $this->cacheControl); + return \array_key_exists($key, $this->cacheControl); } /** @@ -257,7 +257,7 @@ */ public function getCacheControlDirective($key) { - return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; + return \array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/ParameterBag.php --- a/vendor/symfony/http-foundation/ParameterBag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/ParameterBag.php Thu May 09 15:33:08 2019 +0100 @@ -81,7 +81,7 @@ */ public function get($key, $default = null) { - return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default; + return \array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default; } /** @@ -104,7 +104,7 @@ */ public function has($key) { - return array_key_exists($key, $this->parameters); + return \array_key_exists($key, $this->parameters); } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/RedirectResponse.php --- a/vendor/symfony/http-foundation/RedirectResponse.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/RedirectResponse.php Thu May 09 15:33:08 2019 +0100 @@ -42,7 +42,7 @@ throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status)); } - if (301 == $status && !array_key_exists('cache-control', $headers)) { + if (301 == $status && !\array_key_exists('cache-control', $headers)) { $this->headers->remove('cache-control'); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/Request.php --- a/vendor/symfony/http-foundation/Request.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/Request.php Thu May 09 15:33:08 2019 +0100 @@ -303,10 +303,10 @@ // HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH fields. $server = $_SERVER; if ('cli-server' === \PHP_SAPI) { - if (array_key_exists('HTTP_CONTENT_LENGTH', $_SERVER)) { + if (\array_key_exists('HTTP_CONTENT_LENGTH', $_SERVER)) { $server['CONTENT_LENGTH'] = $_SERVER['HTTP_CONTENT_LENGTH']; } - if (array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) { + if (\array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) { $server['CONTENT_TYPE'] = $_SERVER['HTTP_CONTENT_TYPE']; } } @@ -691,7 +691,7 @@ $key = self::HEADER_CLIENT_PROTO; } elseif ('client_port' === $key) { $key = self::HEADER_CLIENT_PORT; - } elseif (!array_key_exists($key, self::$trustedHeaders)) { + } elseif (!\array_key_exists($key, self::$trustedHeaders)) { throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key)); } @@ -722,7 +722,7 @@ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the Request::getTrustedHeaderSet() method instead.', __METHOD__), E_USER_DEPRECATED); } - if (!array_key_exists($key, self::$trustedHeaders)) { + if (!\array_key_exists($key, self::$trustedHeaders)) { throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key)); } @@ -1346,22 +1346,37 @@ */ public function getMethod() { - if (null === $this->method) { - $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET')); - - if ('POST' === $this->method) { - if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) { - $this->method = strtoupper($method); - } elseif (self::$httpMethodParameterOverride) { - $method = $this->request->get('_method', $this->query->get('_method', 'POST')); - if (\is_string($method)) { - $this->method = strtoupper($method); - } - } - } + if (null !== $this->method) { + return $this->method; } - return $this->method; + $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET')); + + if ('POST' !== $this->method) { + return $this->method; + } + + $method = $this->headers->get('X-HTTP-METHOD-OVERRIDE'); + + if (!$method && self::$httpMethodParameterOverride) { + $method = $this->request->get('_method', $this->query->get('_method', 'POST')); + } + + if (!\is_string($method)) { + return $this->method; + } + + $method = strtoupper($method); + + if (\in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'PATCH', 'PURGE', 'TRACE'], true)) { + return $this->method = $method; + } + + if (!preg_match('/^[A-Z]++$/D', $method)) { + throw new SuspiciousOperationException(sprintf('Invalid method override "%s".', $method)); + } + + return $this->method = $method; } /** @@ -1462,7 +1477,7 @@ * * @param string|null $default The default format * - * @return string The request format + * @return string|null The request format */ public function getRequestFormat($default = 'html') { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/Response.php --- a/vendor/symfony/http-foundation/Response.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/Response.php Thu May 09 15:33:08 2019 +0100 @@ -310,9 +310,9 @@ } // Check if we need to send extra expire info headers - if ('1.0' == $this->getProtocolVersion() && false !== strpos($this->headers->get('Cache-Control'), 'no-cache')) { - $this->headers->set('pragma', 'no-cache'); - $this->headers->set('expires', -1); + if ('1.0' == $this->getProtocolVersion() && false !== strpos($headers->get('Cache-Control'), 'no-cache')) { + $headers->set('pragma', 'no-cache'); + $headers->set('expires', -1); } $this->ensureIEOverSSLCompatibility($request); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/ResponseHeaderBag.php --- a/vendor/symfony/http-foundation/ResponseHeaderBag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/ResponseHeaderBag.php Thu May 09 15:33:08 2019 +0100 @@ -160,7 +160,7 @@ */ public function hasCacheControlDirective($key) { - return array_key_exists($key, $this->computedCacheControl); + return \array_key_exists($key, $this->computedCacheControl); } /** @@ -168,7 +168,7 @@ */ public function getCacheControlDirective($key) { - return array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : null; + return \array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : null; } public function setCookie(Cookie $cookie) diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php --- a/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php Thu May 09 15:33:08 2019 +0100 @@ -63,7 +63,7 @@ */ public function has($name) { - return array_key_exists($name, $this->attributes); + return \array_key_exists($name, $this->attributes); } /** @@ -71,7 +71,7 @@ */ public function get($name, $default = null) { - return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default; + return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default; } /** @@ -107,7 +107,7 @@ public function remove($name) { $retval = null; - if (array_key_exists($name, $this->attributes)) { + if (\array_key_exists($name, $this->attributes)) { $retval = $this->attributes[$name]; unset($this->attributes[$name]); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php --- a/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php Thu May 09 15:33:08 2019 +0100 @@ -44,7 +44,7 @@ return false; } - return array_key_exists($name, $attributes); + return \array_key_exists($name, $attributes); } /** @@ -60,7 +60,7 @@ return $default; } - return array_key_exists($name, $attributes) ? $attributes[$name] : $default; + return \array_key_exists($name, $attributes) ? $attributes[$name] : $default; } /** @@ -81,7 +81,7 @@ $retval = null; $attributes = &$this->resolveAttributePath($name); $name = $this->resolveKey($name); - if (null !== $attributes && array_key_exists($name, $attributes)) { + if (null !== $attributes && \array_key_exists($name, $attributes)) { $retval = $attributes[$name]; unset($attributes[$name]); } @@ -123,7 +123,7 @@ unset($parts[\count($parts) - 1]); foreach ($parts as $part) { - if (null !== $array && !array_key_exists($part, $array)) { + if (null !== $array && !\array_key_exists($part, $array)) { if (!$writeContext) { $null = null; diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php --- a/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php Thu May 09 15:33:08 2019 +0100 @@ -53,7 +53,7 @@ // The logic: messages from the last request will be stored in new, so we move them to previous // This request we will show what is in 'display'. What is placed into 'new' this time round will // be moved to display next time round. - $this->flashes['display'] = array_key_exists('new', $this->flashes) ? $this->flashes['new'] : []; + $this->flashes['display'] = \array_key_exists('new', $this->flashes) ? $this->flashes['new'] : []; $this->flashes['new'] = []; } @@ -78,7 +78,7 @@ */ public function peekAll() { - return array_key_exists('display', $this->flashes) ? (array) $this->flashes['display'] : []; + return \array_key_exists('display', $this->flashes) ? (array) $this->flashes['display'] : []; } /** @@ -132,7 +132,7 @@ */ public function has($type) { - return array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type]; + return \array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type]; } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-foundation/Session/Flash/FlashBag.php --- a/vendor/symfony/http-foundation/Session/Flash/FlashBag.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-foundation/Session/Flash/FlashBag.php Thu May 09 15:33:08 2019 +0100 @@ -123,7 +123,7 @@ */ public function has($type) { - return array_key_exists($type, $this->flashes) && $this->flashes[$type]; + return \array_key_exists($type, $this->flashes) && $this->flashes[$type]; } /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/Controller/ControllerResolver.php --- a/vendor/symfony/http-kernel/Controller/ControllerResolver.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/Controller/ControllerResolver.php Thu May 09 15:33:08 2019 +0100 @@ -131,7 +131,7 @@ $attributes = $request->attributes->all(); $arguments = []; foreach ($parameters as $param) { - if (array_key_exists($param->name, $attributes)) { + if (\array_key_exists($param->name, $attributes)) { if ($this->supportsVariadic && $param->isVariadic() && \is_array($attributes[$param->name])) { $arguments = array_merge($arguments, array_values($attributes[$param->name])); } else { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/DataCollector/DataCollector.php --- a/vendor/symfony/http-kernel/DataCollector/DataCollector.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/DataCollector/DataCollector.php Thu May 09 15:33:08 2019 +0100 @@ -40,9 +40,6 @@ */ private $cloner; - /** - * @internal - */ public function serialize() { $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2); @@ -51,9 +48,6 @@ return $isCalledFromOverridingMethod ? $this->data : serialize($this->data); } - /** - * @internal - */ public function unserialize($data) { $this->data = \is_array($data) ? $data : unserialize($data); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php --- a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php Thu May 09 15:33:08 2019 +0100 @@ -176,9 +176,6 @@ $this->clonesIndex = 0; } - /** - * @internal - */ public function serialize() { if ($this->clonesCount !== $this->clonesIndex) { @@ -198,9 +195,6 @@ return $ser; } - /** - * @internal - */ public function unserialize($data) { $this->data = unserialize($data); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php --- a/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php Thu May 09 15:33:08 2019 +0100 @@ -126,9 +126,13 @@ return []; } + if ('' === $logContent = trim(file_get_contents($file))) { + return []; + } + $bootTime = filemtime($file); $logs = []; - foreach (unserialize(file_get_contents($file)) as $log) { + foreach (unserialize($logContent) as $log) { $log['context'] = ['exception' => new SilencedErrorContext($log['type'], $log['file'], $log['line'], $log['trace'], $log['count'])]; $log['timestamp'] = $bootTime; $log['priority'] = 100; diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php --- a/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php Thu May 09 15:33:08 2019 +0100 @@ -47,6 +47,7 @@ 'token' => $response->headers->get('X-Debug-Token'), 'start_time' => $startTime * 1000, 'events' => [], + 'stopwatch_installed' => \class_exists(Stopwatch::class, false), ]; } @@ -140,6 +141,14 @@ } /** + * @return bool whether or not the stopwatch component is installed + */ + public function isStopwatchInstalled() + { + return $this->data['stopwatch_installed']; + } + + /** * {@inheritdoc} */ public function getName() diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php --- a/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php Thu May 09 15:33:08 2019 +0100 @@ -19,6 +19,7 @@ use Symfony\Component\Debug\ExceptionHandler; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; use Symfony\Component\HttpKernel\Event\KernelEvent; use Symfony\Component\HttpKernel\KernelEvents; @@ -40,13 +41,13 @@ private $hasTerminatedWithException; /** - * @param callable|null $exceptionHandler A handler that will be called on Exception - * @param LoggerInterface|null $logger A PSR-3 logger - * @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants - * @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value - * @param bool $scream Enables/disables screaming mode, where even silenced errors are logged - * @param string|array $fileLinkFormat The format for links to source files - * @param bool $scope Enables/disables scoping mode + * @param callable|null $exceptionHandler A handler that will be called on Exception + * @param LoggerInterface|null $logger A PSR-3 logger + * @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants + * @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value + * @param bool $scream Enables/disables screaming mode, where even silenced errors are logged + * @param string|FileLinkFormatter|null $fileLinkFormat The format for links to source files + * @param bool $scope Enables/disables scoping mode */ public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = E_ALL, $throwAt = E_ALL, $scream = true, $fileLinkFormat = null, $scope = true) { @@ -105,7 +106,7 @@ if (method_exists($kernel = $event->getKernel(), 'terminateWithException')) { $request = $event->getRequest(); $hasRun = &$this->hasTerminatedWithException; - $this->exceptionHandler = function (\Exception $e) use ($kernel, $request, &$hasRun) { + $this->exceptionHandler = static function (\Exception $e) use ($kernel, $request, &$hasRun) { if ($hasRun) { throw $e; } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/EventListener/ExceptionListener.php --- a/vendor/symfony/http-kernel/EventListener/ExceptionListener.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/EventListener/ExceptionListener.php Thu May 09 15:33:08 2019 +0100 @@ -56,13 +56,12 @@ } catch (\Exception $e) { $this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', \get_class($e), $e->getMessage(), $e->getFile(), $e->getLine())); - $wrapper = $e; - - while ($prev = $wrapper->getPrevious()) { + $prev = $e; + do { if ($exception === $wrapper = $prev) { throw $e; } - } + } while ($prev = $wrapper->getPrevious()); $prev = new \ReflectionProperty($wrapper instanceof \Exception ? \Exception::class : \Error::class, 'previous'); $prev->setAccessible(true); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php --- a/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php Thu May 09 15:33:08 2019 +0100 @@ -80,7 +80,7 @@ return SubRequestHandler::handle($this->kernel, $subRequest, HttpKernelInterface::SUB_REQUEST, false); } catch (\Exception $e) { // we dispatch the exception event to trigger the logging - // the response that comes back is simply ignored + // the response that comes back is ignored if (isset($options['ignore_errors']) && $options['ignore_errors'] && $this->dispatcher) { $event = new GetResponseForExceptionEvent($this->kernel, $request, HttpKernelInterface::SUB_REQUEST, $e); diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php --- a/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php Thu May 09 15:33:08 2019 +0100 @@ -5,10 +5,6 @@ * * (c) Fabien Potencier * - * This code is partially based on the Rack-Cache library by Ryan Tomayko, - * which is released under the MIT license. - * (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801) - * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ @@ -28,30 +24,69 @@ */ class ResponseCacheStrategy implements ResponseCacheStrategyInterface { - private $cacheable = true; + /** + * Cache-Control headers that are sent to the final response if they appear in ANY of the responses. + */ + private static $overrideDirectives = ['private', 'no-cache', 'no-store', 'no-transform', 'must-revalidate', 'proxy-revalidate']; + + /** + * Cache-Control headers that are sent to the final response if they appear in ALL of the responses. + */ + private static $inheritDirectives = ['public', 'immutable']; + private $embeddedResponses = 0; - private $ttls = []; - private $maxAges = []; private $isNotCacheableResponseEmbedded = false; + private $age = 0; + private $flagDirectives = [ + 'no-cache' => null, + 'no-store' => null, + 'no-transform' => null, + 'must-revalidate' => null, + 'proxy-revalidate' => null, + 'public' => null, + 'private' => null, + 'immutable' => null, + ]; + private $ageDirectives = [ + 'max-age' => null, + 's-maxage' => null, + 'expires' => null, + ]; /** * {@inheritdoc} */ public function add(Response $response) { - if (!$response->isFresh() || !$response->isCacheable()) { - $this->cacheable = false; - } else { - $maxAge = $response->getMaxAge(); - $this->ttls[] = $response->getTtl(); - $this->maxAges[] = $maxAge; + ++$this->embeddedResponses; - if (null === $maxAge) { - $this->isNotCacheableResponseEmbedded = true; + foreach (self::$overrideDirectives as $directive) { + if ($response->headers->hasCacheControlDirective($directive)) { + $this->flagDirectives[$directive] = true; } } - ++$this->embeddedResponses; + foreach (self::$inheritDirectives as $directive) { + if (false !== $this->flagDirectives[$directive]) { + $this->flagDirectives[$directive] = $response->headers->hasCacheControlDirective($directive); + } + } + + $age = $response->getAge(); + $this->age = max($this->age, $age); + + if ($this->willMakeFinalResponseUncacheable($response)) { + $this->isNotCacheableResponseEmbedded = true; + + return; + } + + $this->storeRelativeAgeDirective('max-age', $response->headers->getCacheControlDirective('max-age'), $age); + $this->storeRelativeAgeDirective('s-maxage', $response->headers->getCacheControlDirective('s-maxage') ?: $response->headers->getCacheControlDirective('max-age'), $age); + + $expires = $response->getExpires(); + $expires = null !== $expires ? $expires->format('U') - $response->getDate()->format('U') : null; + $this->storeRelativeAgeDirective('expires', $expires >= 0 ? $expires : null, 0); } /** @@ -64,33 +99,124 @@ return; } - // Remove validation related headers in order to avoid browsers using - // their own cache, because some of the response content comes from - // at least one embedded response (which likely has a different caching strategy). - if ($response->isValidateable()) { - $response->setEtag(null); - $response->setLastModified(null); - } + // Remove validation related headers of the master response, + // because some of the response content comes from at least + // one embedded response (which likely has a different caching strategy). + $response->setEtag(null); + $response->setLastModified(null); - if (!$response->isFresh() || !$response->isCacheable()) { - $this->cacheable = false; - } + $this->add($response); - if (!$this->cacheable) { - $response->headers->set('Cache-Control', 'no-cache, must-revalidate'); + $response->headers->set('Age', $this->age); + + if ($this->isNotCacheableResponseEmbedded) { + $response->setExpires($response->getDate()); + + if ($this->flagDirectives['no-store']) { + $response->headers->set('Cache-Control', 'no-cache, no-store, must-revalidate'); + } else { + $response->headers->set('Cache-Control', 'no-cache, must-revalidate'); + } return; } - $this->ttls[] = $response->getTtl(); - $this->maxAges[] = $response->getMaxAge(); + $flags = array_filter($this->flagDirectives); - if ($this->isNotCacheableResponseEmbedded) { - $response->headers->removeCacheControlDirective('s-maxage'); - } elseif (null !== $maxAge = min($this->maxAges)) { - $response->setSharedMaxAge($maxAge); - $response->headers->set('Age', $maxAge - min($this->ttls)); + if (isset($flags['must-revalidate'])) { + $flags['no-cache'] = true; } - $response->setMaxAge(0); + + $response->headers->set('Cache-Control', implode(', ', array_keys($flags))); + + $maxAge = null; + $sMaxage = null; + + if (\is_numeric($this->ageDirectives['max-age'])) { + $maxAge = $this->ageDirectives['max-age'] + $this->age; + $response->headers->addCacheControlDirective('max-age', $maxAge); + } + + if (\is_numeric($this->ageDirectives['s-maxage'])) { + $sMaxage = $this->ageDirectives['s-maxage'] + $this->age; + + if ($maxAge !== $sMaxage) { + $response->headers->addCacheControlDirective('s-maxage', $sMaxage); + } + } + + if (\is_numeric($this->ageDirectives['expires'])) { + $date = clone $response->getDate(); + $date->modify('+'.($this->ageDirectives['expires'] + $this->age).' seconds'); + $response->setExpires($date); + } + } + + /** + * RFC2616, Section 13.4. + * + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4 + * + * @return bool + */ + private function willMakeFinalResponseUncacheable(Response $response) + { + // RFC2616: A response received with a status code of 200, 203, 300, 301 or 410 + // MAY be stored by a cache […] unless a cache-control directive prohibits caching. + if ($response->headers->hasCacheControlDirective('no-cache') + || $response->headers->getCacheControlDirective('no-store') + ) { + return true; + } + + // Last-Modified and Etag headers cannot be merged, they render the response uncacheable + // by default (except if the response also has max-age etc.). + if (\in_array($response->getStatusCode(), [200, 203, 300, 301, 410]) + && null === $response->getLastModified() + && null === $response->getEtag() + ) { + return false; + } + + // RFC2616: A response received with any other status code (e.g. status codes 302 and 307) + // MUST NOT be returned in a reply to a subsequent request unless there are + // cache-control directives or another header(s) that explicitly allow it. + $cacheControl = ['max-age', 's-maxage', 'must-revalidate', 'proxy-revalidate', 'public', 'private']; + foreach ($cacheControl as $key) { + if ($response->headers->hasCacheControlDirective($key)) { + return false; + } + } + + if ($response->headers->has('Expires')) { + return false; + } + + return true; + } + + /** + * Store lowest max-age/s-maxage/expires for the final response. + * + * The response might have been stored in cache a while ago. To keep things comparable, + * we have to subtract the age so that the value is normalized for an age of 0. + * + * If the value is lower than the currently stored value, we update the value, to keep a rolling + * minimal value of each instruction. If the value is NULL, the directive will not be set on the final response. + * + * @param string $directive + * @param int|null $value + * @param int $age + */ + private function storeRelativeAgeDirective($directive, $value, $age) + { + if (null === $value) { + $this->ageDirectives[$directive] = false; + } + + if (false !== $this->ageDirectives[$directive]) { + $value -= $age; + $this->ageDirectives[$directive] = null !== $this->ageDirectives[$directive] ? min($this->ageDirectives[$directive], $value) : $value; + } } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/Kernel.php --- a/vendor/symfony/http-kernel/Kernel.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/Kernel.php Thu May 09 15:33:08 2019 +0100 @@ -67,11 +67,11 @@ private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.22'; - const VERSION_ID = 30422; + const VERSION = '3.4.27'; + const VERSION_ID = 30427; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; - const RELEASE_VERSION = 22; + const RELEASE_VERSION = 27; const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2020'; diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/Log/Logger.php --- a/vendor/symfony/http-kernel/Log/Logger.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/Log/Logger.php Thu May 09 15:33:08 2019 +0100 @@ -40,7 +40,7 @@ public function __construct($minLevel = null, $output = 'php://stderr', callable $formatter = null) { if (null === $minLevel) { - $minLevel = LogLevel::WARNING; + $minLevel = 'php://stdout' === $output || 'php://stderr' === $output ? LogLevel::CRITICAL : LogLevel::WARNING; if (isset($_ENV['SHELL_VERBOSITY']) || isset($_SERVER['SHELL_VERBOSITY'])) { switch ((int) (isset($_ENV['SHELL_VERBOSITY']) ? $_ENV['SHELL_VERBOSITY'] : $_SERVER['SHELL_VERBOSITY'])) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/symfony/http-kernel/Resources/welcome.html.php --- a/vendor/symfony/http-kernel/Resources/welcome.html.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/symfony/http-kernel/Resources/welcome.html.php Thu May 09 15:33:08 2019 +0100 @@ -51,21 +51,7 @@
    - * - * @param array $array An array - * - * @return array The keys - */ -function twig_get_array_keys_filter($array) -{ - if ($array instanceof Traversable) { - while ($array instanceof IteratorAggregate) { - $array = $array->getIterator(); - } - - if ($array instanceof Iterator) { - $keys = []; - $array->rewind(); - while ($array->valid()) { - $keys[] = $array->key(); - $array->next(); - } - - return $keys; - } - - $keys = []; - foreach ($array as $key => $item) { - $keys[] = $key; - } - - return $keys; - } - - if (!is_array($array)) { - return []; - } - - return array_keys($array); -} - -/** - * Reverses a variable. - * - * @param Twig_Environment $env - * @param array|Traversable|string $item An array, a Traversable instance, or a string - * @param bool $preserveKeys Whether to preserve key or not - * - * @return mixed The reversed input - */ -function twig_reverse_filter(Twig_Environment $env, $item, $preserveKeys = false) -{ - if ($item instanceof Traversable) { - return array_reverse(iterator_to_array($item), $preserveKeys); - } - - if (is_array($item)) { - return array_reverse($item, $preserveKeys); - } - - if (null !== $charset = $env->getCharset()) { - $string = (string) $item; - - if ('UTF-8' !== $charset) { - $item = twig_convert_encoding($string, 'UTF-8', $charset); - } - - preg_match_all('/./us', $item, $matches); - - $string = implode('', array_reverse($matches[0])); - - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, $charset, 'UTF-8'); - } - - return $string; - } - - return strrev((string) $item); -} - -/** - * Sorts an array. - * - * @param array|Traversable $array - * - * @return array - */ -function twig_sort_filter($array) -{ - if ($array instanceof Traversable) { - $array = iterator_to_array($array); - } elseif (!is_array($array)) { - throw new Twig_Error_Runtime(sprintf('The sort filter only works with arrays or "Traversable", got "%s".', gettype($array))); - } - - asort($array); - - return $array; -} - -/** - * @internal - */ -function twig_in_filter($value, $compare) -{ - if (is_array($compare)) { - return in_array($value, $compare, is_object($value) || is_resource($value)); - } elseif (is_string($compare) && (is_string($value) || is_int($value) || is_float($value))) { - return '' === $value || false !== strpos($compare, (string) $value); - } elseif ($compare instanceof Traversable) { - if (is_object($value) || is_resource($value)) { - foreach ($compare as $item) { - if ($item === $value) { - return true; - } - } - } else { - foreach ($compare as $item) { - if ($item == $value) { - return true; - } - } - } - - return false; - } - - return false; -} - -/** - * Returns a trimmed string. - * - * @return string - * - * @throws Twig_Error_Runtime When an invalid trimming side is used (not a string or not 'left', 'right', or 'both') - */ -function twig_trim_filter($string, $characterMask = null, $side = 'both') -{ - if (null === $characterMask) { - $characterMask = " \t\n\r\0\x0B"; - } - - switch ($side) { - case 'both': - return trim($string, $characterMask); - case 'left': - return ltrim($string, $characterMask); - case 'right': - return rtrim($string, $characterMask); - default: - throw new Twig_Error_Runtime('Trimming side must be "left", "right" or "both".'); - } -} - -/** - * Escapes a string. - * - * @param Twig_Environment $env - * @param mixed $string The value to be escaped - * @param string $strategy The escaping strategy - * @param string $charset The charset - * @param bool $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false) - * - * @return string - */ -function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false) -{ - if ($autoescape && $string instanceof Twig_Markup) { - return $string; - } - - if (!is_string($string)) { - if (is_object($string) && method_exists($string, '__toString')) { - $string = (string) $string; - } elseif (in_array($strategy, ['html', 'js', 'css', 'html_attr', 'url'])) { - return $string; - } - } - - if ('' === $string) { - return ''; - } - - if (null === $charset) { - $charset = $env->getCharset(); - } - - switch ($strategy) { - case 'html': - // see https://secure.php.net/htmlspecialchars - - // Using a static variable to avoid initializing the array - // each time the function is called. Moving the declaration on the - // top of the function slow downs other escaping strategies. - static $htmlspecialcharsCharsets = [ - 'ISO-8859-1' => true, 'ISO8859-1' => true, - 'ISO-8859-15' => true, 'ISO8859-15' => true, - 'utf-8' => true, 'UTF-8' => true, - 'CP866' => true, 'IBM866' => true, '866' => true, - 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, - '1251' => true, - 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, - 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, - 'BIG5' => true, '950' => true, - 'GB2312' => true, '936' => true, - 'BIG5-HKSCS' => true, - 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true, - 'EUC-JP' => true, 'EUCJP' => true, - 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true, - ]; - - if (isset($htmlspecialcharsCharsets[$charset])) { - return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); - } - - if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) { - // cache the lowercase variant for future iterations - $htmlspecialcharsCharsets[$charset] = true; - - return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); - } - - $string = twig_convert_encoding($string, 'UTF-8', $charset); - $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); - - return twig_convert_encoding($string, $charset, 'UTF-8'); - - case 'js': - // escape all non-alphanumeric characters - // into their \x or \uHHHH representations - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, 'UTF-8', $charset); - } - - if (!preg_match('//u', $string)) { - throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); - } - - $string = preg_replace_callback('#[^a-zA-Z0-9,\._]#Su', '_twig_escape_js_callback', $string); - - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, $charset, 'UTF-8'); - } - - return $string; - - case 'css': - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, 'UTF-8', $charset); - } - - if (!preg_match('//u', $string)) { - throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); - } - - $string = preg_replace_callback('#[^a-zA-Z0-9]#Su', '_twig_escape_css_callback', $string); - - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, $charset, 'UTF-8'); - } - - return $string; - - case 'html_attr': - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, 'UTF-8', $charset); - } - - if (!preg_match('//u', $string)) { - throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); - } - - $string = preg_replace_callback('#[^a-zA-Z0-9,\.\-_]#Su', '_twig_escape_html_attr_callback', $string); - - if ('UTF-8' !== $charset) { - $string = twig_convert_encoding($string, $charset, 'UTF-8'); - } - - return $string; - - case 'url': - return rawurlencode($string); - - default: - static $escapers; - - if (null === $escapers) { - $escapers = $env->getExtension('Twig_Extension_Core')->getEscapers(); - } - - if (isset($escapers[$strategy])) { - return call_user_func($escapers[$strategy], $env, $string, $charset); - } - - $validStrategies = implode(', ', array_merge(['html', 'js', 'url', 'css', 'html_attr'], array_keys($escapers))); - - throw new Twig_Error_Runtime(sprintf('Invalid escaping strategy "%s" (valid ones: %s).', $strategy, $validStrategies)); - } -} - -/** - * @internal - */ -function twig_escape_filter_is_safe(Twig_Node $filterArgs) -{ - foreach ($filterArgs as $arg) { - if ($arg instanceof Twig_Node_Expression_Constant) { - return [$arg->getAttribute('value')]; - } - - return []; - } - - return ['html']; -} - -if (function_exists('mb_convert_encoding')) { - function twig_convert_encoding($string, $to, $from) - { - return mb_convert_encoding($string, $to, $from); - } -} elseif (function_exists('iconv')) { - function twig_convert_encoding($string, $to, $from) - { - return iconv($from, $to, $string); - } -} else { - function twig_convert_encoding($string, $to, $from) - { - throw new Twig_Error_Runtime('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).'); - } -} - -if (function_exists('mb_ord')) { - function twig_ord($string) - { - return mb_ord($string, 'UTF-8'); - } -} else { - function twig_ord($string) - { - $code = ($string = unpack('C*', substr($string, 0, 4))) ? $string[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($string[2] - 0x80) << 12) + (($string[3] - 0x80) << 6) + $string[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($string[2] - 0x80) << 6) + $string[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $string[2] - 0x80; - } - - return $code; - } -} - -function _twig_escape_js_callback($matches) -{ - $char = $matches[0]; - - /* - * A few characters have short escape sequences in JSON and JavaScript. - * Escape sequences supported only by JavaScript, not JSON, are ommitted. - * \" is also supported but omitted, because the resulting string is not HTML safe. - */ - static $shortMap = [ - '\\' => '\\\\', - '/' => '\\/', - "\x08" => '\b', - "\x0C" => '\f', - "\x0A" => '\n', - "\x0D" => '\r', - "\x09" => '\t', - ]; - - if (isset($shortMap[$char])) { - return $shortMap[$char]; - } - - // \uHHHH - $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); - $char = strtoupper(bin2hex($char)); - - if (4 >= strlen($char)) { - return sprintf('\u%04s', $char); - } - - return sprintf('\u%04s\u%04s', substr($char, 0, -4), substr($char, -4)); -} - -function _twig_escape_css_callback($matches) -{ - $char = $matches[0]; - - return sprintf('\\%X ', 1 === strlen($char) ? ord($char) : twig_ord($char)); -} - -/** - * This function is adapted from code coming from Zend Framework. - * - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com) - * @license https://framework.zend.com/license/new-bsd New BSD License - */ -function _twig_escape_html_attr_callback($matches) -{ - $chr = $matches[0]; - $ord = ord($chr); - - /* - * The following replaces characters undefined in HTML with the - * hex entity for the Unicode replacement character. - */ - if (($ord <= 0x1f && "\t" != $chr && "\n" != $chr && "\r" != $chr) || ($ord >= 0x7f && $ord <= 0x9f)) { - return '�'; - } - - /* - * Check if the current character to escape has a name entity we should - * replace it with while grabbing the hex value of the character. - */ - if (1 == strlen($chr)) { - /* - * While HTML supports far more named entities, the lowest common denominator - * has become HTML5's XML Serialisation which is restricted to the those named - * entities that XML supports. Using HTML entities would result in this error: - * XML Parsing Error: undefined entity - */ - static $entityMap = [ - 34 => '"', /* quotation mark */ - 38 => '&', /* ampersand */ - 60 => '<', /* less-than sign */ - 62 => '>', /* greater-than sign */ - ]; - - if (isset($entityMap[$ord])) { - return $entityMap[$ord]; - } - - return sprintf('&#x%02X;', $ord); - } - - /* - * Per OWASP recommendations, we'll use hex entities for any other - * characters where a named entity does not exist. - */ - return sprintf('&#x%04X;', twig_ord($chr)); -} - -// add multibyte extensions if possible -if (function_exists('mb_get_info')) { - /** - * Returns the length of a variable. - * - * @param Twig_Environment $env - * @param mixed $thing A variable - * - * @return int The length of the value - */ - function twig_length_filter(Twig_Environment $env, $thing) - { - if (null === $thing) { - return 0; - } - - if (is_scalar($thing)) { - return mb_strlen($thing, $env->getCharset()); - } - - if ($thing instanceof \SimpleXMLElement) { - return count($thing); - } - - if (is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) { - return mb_strlen((string) $thing, $env->getCharset()); - } - - if ($thing instanceof \Countable || is_array($thing)) { - return count($thing); - } - - if ($thing instanceof \IteratorAggregate) { - return iterator_count($thing); - } - - return 1; - } - - /** - * Converts a string to uppercase. - * - * @param Twig_Environment $env - * @param string $string A string - * - * @return string The uppercased string - */ - function twig_upper_filter(Twig_Environment $env, $string) - { - if (null !== $charset = $env->getCharset()) { - return mb_strtoupper($string, $charset); - } - - return strtoupper($string); - } - - /** - * Converts a string to lowercase. - * - * @param Twig_Environment $env - * @param string $string A string - * - * @return string The lowercased string - */ - function twig_lower_filter(Twig_Environment $env, $string) - { - if (null !== $charset = $env->getCharset()) { - return mb_strtolower($string, $charset); - } - - return strtolower($string); - } - - /** - * Returns a titlecased string. - * - * @param Twig_Environment $env - * @param string $string A string - * - * @return string The titlecased string - */ - function twig_title_string_filter(Twig_Environment $env, $string) - { - if (null !== $charset = $env->getCharset()) { - return mb_convert_case($string, MB_CASE_TITLE, $charset); - } - - return ucwords(strtolower($string)); - } - - /** - * Returns a capitalized string. - * - * @param Twig_Environment $env - * @param string $string A string - * - * @return string The capitalized string - */ - function twig_capitalize_string_filter(Twig_Environment $env, $string) - { - if (null !== $charset = $env->getCharset()) { - return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset).mb_strtolower(mb_substr($string, 1, mb_strlen($string, $charset), $charset), $charset); - } - - return ucfirst(strtolower($string)); - } -} -// and byte fallback -else { - /** - * Returns the length of a variable. - * - * @param Twig_Environment $env - * @param mixed $thing A variable - * - * @return int The length of the value - */ - function twig_length_filter(Twig_Environment $env, $thing) - { - if (null === $thing) { - return 0; - } - - if (is_scalar($thing)) { - return strlen($thing); - } - - if ($thing instanceof \SimpleXMLElement) { - return count($thing); - } - - if (is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) { - return strlen((string) $thing); - } - - if ($thing instanceof \Countable || is_array($thing)) { - return count($thing); - } - - if ($thing instanceof \IteratorAggregate) { - return iterator_count($thing); - } - - return 1; - } - - /** - * Returns a titlecased string. - * - * @param Twig_Environment $env - * @param string $string A string - * - * @return string The titlecased string - */ - function twig_title_string_filter(Twig_Environment $env, $string) - { - return ucwords(strtolower($string)); - } - - /** - * Returns a capitalized string. - * - * @param Twig_Environment $env - * @param string $string A string - * - * @return string The capitalized string - */ - function twig_capitalize_string_filter(Twig_Environment $env, $string) - { - return ucfirst(strtolower($string)); - } -} - -/** - * @internal - */ -function twig_ensure_traversable($seq) -{ - if ($seq instanceof Traversable || is_array($seq)) { - return $seq; - } - - return []; -} - -/** - * Checks if a variable is empty. - * - *
    - * {# evaluates to true if the foo variable is null, false, or the empty string #}
    - * {% if foo is empty %}
    - *     {# ... #}
    - * {% endif %}
    - * 
    - * - * @param mixed $value A variable - * - * @return bool true if the value is empty, false otherwise - */ -function twig_test_empty($value) -{ - if ($value instanceof Countable) { - return 0 == count($value); - } - - if (is_object($value) && method_exists($value, '__toString')) { - return '' === (string) $value; - } - - return '' === $value || false === $value || null === $value || [] === $value; -} - -/** - * Checks if a variable is traversable. - * - *
    - * {# evaluates to true if the foo variable is an array or a traversable object #}
    - * {% if foo is iterable %}
    - *     {# ... #}
    - * {% endif %}
    - * 
    - * - * @param mixed $value A variable - * - * @return bool true if the value is traversable - */ -function twig_test_iterable($value) -{ - return $value instanceof Traversable || is_array($value); -} - -/** - * Renders a template. - * - * @param Twig_Environment $env - * @param array $context - * @param string|array $template The template to render or an array of templates to try consecutively - * @param array $variables The variables to pass to the template - * @param bool $withContext - * @param bool $ignoreMissing Whether to ignore missing templates or not - * @param bool $sandboxed Whether to sandbox the template or not - * - * @return string The rendered template - */ -function twig_include(Twig_Environment $env, $context, $template, $variables = [], $withContext = true, $ignoreMissing = false, $sandboxed = false) -{ - $alreadySandboxed = false; - $sandbox = null; - if ($withContext) { - $variables = array_merge($context, $variables); - } - - if ($isSandboxed = $sandboxed && $env->hasExtension('Twig_Extension_Sandbox')) { - $sandbox = $env->getExtension('Twig_Extension_Sandbox'); - if (!$alreadySandboxed = $sandbox->isSandboxed()) { - $sandbox->enableSandbox(); - } - } - - $result = ''; - try { - $result = $env->resolveTemplate($template)->render($variables); - } catch (Twig_Error_Loader $e) { - if (!$ignoreMissing) { - if ($isSandboxed && !$alreadySandboxed) { - $sandbox->disableSandbox(); - } - - throw $e; - } - } catch (Throwable $e) { - if ($isSandboxed && !$alreadySandboxed) { - $sandbox->disableSandbox(); - } - - throw $e; - } catch (Exception $e) { - if ($isSandboxed && !$alreadySandboxed) { - $sandbox->disableSandbox(); - } - - throw $e; - } - - if ($isSandboxed && !$alreadySandboxed) { - $sandbox->disableSandbox(); - } - - return $result; -} - -/** - * Returns a template content without rendering it. - * - * @param Twig_Environment $env - * @param string $name The template name - * @param bool $ignoreMissing Whether to ignore missing templates or not - * - * @return string The template source - */ -function twig_source(Twig_Environment $env, $name, $ignoreMissing = false) -{ - $loader = $env->getLoader(); - try { - if (!$loader instanceof Twig_SourceContextLoaderInterface) { - return $loader->getSource($name); - } else { - return $loader->getSourceContext($name)->getCode(); - } - } catch (Twig_Error_Loader $e) { - if (!$ignoreMissing) { - throw $e; - } - } -} - -/** - * Provides the ability to get constants from instances as well as class/global constants. - * - * @param string $constant The name of the constant - * @param object|null $object The object to get the constant from - * - * @return string - */ -function twig_constant($constant, $object = null) -{ - if (null !== $object) { - $constant = get_class($object).'::'.$constant; - } - - return constant($constant); -} - -/** - * Checks if a constant exists. - * - * @param string $constant The name of the constant - * @param object|null $object The object to get the constant from - * - * @return bool - */ -function twig_constant_is_defined($constant, $object = null) -{ - if (null !== $object) { - $constant = get_class($object).'::'.$constant; - } - - return defined($constant); -} - -/** - * Batches item. - * - * @param array $items An array of items - * @param int $size The size of the batch - * @param mixed $fill A value used to fill missing items - * - * @return array - */ -function twig_array_batch($items, $size, $fill = null) -{ - if ($items instanceof Traversable) { - $items = iterator_to_array($items, false); - } - - $size = ceil($size); - - $result = array_chunk($items, $size, true); - - if (null !== $fill && !empty($result)) { - $last = count($result) - 1; - if ($fillCount = $size - count($result[$last])) { - $result[$last] = array_merge( - $result[$last], - array_fill(0, $fillCount, $fill) - ); - } - } - - return $result; -} - -class_alias('Twig_Extension_Core', 'Twig\Extension\CoreExtension', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/Debug.php --- a/vendor/twig/twig/lib/Twig/Extension/Debug.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Debug.php Thu May 09 15:33:08 2019 +0100 @@ -1,67 +1,11 @@ $isDumpOutputHtmlSafe ? ['html'] : [], 'needs_context' => true, 'needs_environment' => true]), - ]; - } - - public function getName() - { - return 'debug'; } } - -function twig_var_dump(Twig_Environment $env, $context) -{ - if (!$env->isDebug()) { - return; - } - - ob_start(); - - $count = func_num_args(); - if (2 === $count) { - $vars = []; - foreach ($context as $key => $value) { - if (!$value instanceof Twig_Template) { - $vars[$key] = $value; - } - } - - var_dump($vars); - } else { - for ($i = 2; $i < $count; ++$i) { - var_dump(func_get_arg($i)); - } - } - - return ob_get_clean(); -} - -class_alias('Twig_Extension_Debug', 'Twig\Extension\DebugExtension', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/Escaper.php --- a/vendor/twig/twig/lib/Twig/Extension/Escaper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Escaper.php Thu May 09 15:33:08 2019 +0100 @@ -1,112 +1,11 @@ setDefaultStrategy($defaultStrategy); - } - - public function getTokenParsers() - { - return [new Twig_TokenParser_AutoEscape()]; - } - - public function getNodeVisitors() - { - return [new Twig_NodeVisitor_Escaper()]; - } - - public function getFilters() - { - return [ - new Twig_SimpleFilter('raw', 'twig_raw_filter', ['is_safe' => ['all']]), - ]; - } - - /** - * Sets the default strategy to use when not defined by the user. - * - * The strategy can be a valid PHP callback that takes the template - * name as an argument and returns the strategy to use. - * - * @param string|false|callable $defaultStrategy An escaping strategy - */ - public function setDefaultStrategy($defaultStrategy) - { - // for BC - if (true === $defaultStrategy) { - @trigger_error('Using "true" as the default strategy is deprecated since version 1.21. Use "html" instead.', E_USER_DEPRECATED); - - $defaultStrategy = 'html'; - } - - if ('filename' === $defaultStrategy) { - @trigger_error('Using "filename" as the default strategy is deprecated since version 1.27. Use "name" instead.', E_USER_DEPRECATED); - - $defaultStrategy = 'name'; - } - - if ('name' === $defaultStrategy) { - $defaultStrategy = ['Twig_FileExtensionEscapingStrategy', 'guess']; - } - - $this->defaultStrategy = $defaultStrategy; - } - - /** - * Gets the default strategy to use when not defined by the user. - * - * @param string $name The template name - * - * @return string|false The default strategy to use for the template - */ - public function getDefaultStrategy($name) - { - // disable string callables to avoid calling a function named html or js, - // or any other upcoming escaping strategy - if (!is_string($this->defaultStrategy) && false !== $this->defaultStrategy) { - return call_user_func($this->defaultStrategy, $name); - } - - return $this->defaultStrategy; - } - - public function getName() - { - return 'escaper'; } } - -/** - * Marks a variable as being safe. - * - * @param string $string A PHP variable - * - * @return string - */ -function twig_raw_filter($string) -{ - return $string; -} - -class_alias('Twig_Extension_Escaper', 'Twig\Extension\EscaperExtension', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php --- a/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,24 +1,11 @@ - */ -interface Twig_Extension_GlobalsInterface -{ +class_exists('Twig\Extension\GlobalsInterface'); + +if (\false) { + class Twig_Extension_GlobalsInterface extends GlobalsInterface + { + } } - -class_alias('Twig_Extension_GlobalsInterface', 'Twig\Extension\GlobalsInterface', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php --- a/vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,24 +1,11 @@ - */ -interface Twig_Extension_InitRuntimeInterface -{ +class_exists('Twig\Extension\InitRuntimeInterface'); + +if (\false) { + class Twig_Extension_InitRuntimeInterface extends InitRuntimeInterface + { + } } - -class_alias('Twig_Extension_InitRuntimeInterface', 'Twig\Extension\InitRuntimeInterface', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/Optimizer.php --- a/vendor/twig/twig/lib/Twig/Extension/Optimizer.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Optimizer.php Thu May 09 15:33:08 2019 +0100 @@ -1,35 +1,11 @@ optimizers = $optimizers; - } - - public function getNodeVisitors() - { - return [new Twig_NodeVisitor_Optimizer($this->optimizers)]; - } - - public function getName() - { - return 'optimizer'; } } - -class_alias('Twig_Extension_Optimizer', 'Twig\Extension\OptimizerExtension', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/Profiler.php --- a/vendor/twig/twig/lib/Twig/Extension/Profiler.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Profiler.php Thu May 09 15:33:08 2019 +0100 @@ -1,49 +1,11 @@ actives[] = $profile; - } - - public function enter(Twig_Profiler_Profile $profile) - { - $this->actives[0]->addProfile($profile); - array_unshift($this->actives, $profile); - } - - public function leave(Twig_Profiler_Profile $profile) - { - $profile->leave(); - array_shift($this->actives); - - if (1 === count($this->actives)) { - $this->actives[0]->leave(); - } - } - - public function getNodeVisitors() - { - return [new Twig_Profiler_NodeVisitor_Profiler(get_class($this))]; - } - - public function getName() - { - return 'profiler'; } } - -class_alias('Twig_Extension_Profiler', 'Twig\Extension\ProfilerExtension', false); -class_exists('Twig_Profiler_Profile'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/Sandbox.php --- a/vendor/twig/twig/lib/Twig/Extension/Sandbox.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Sandbox.php Thu May 09 15:33:08 2019 +0100 @@ -1,103 +1,11 @@ policy = $policy; - $this->sandboxedGlobally = $sandboxed; - } - - public function getTokenParsers() - { - return [new Twig_TokenParser_Sandbox()]; - } - - public function getNodeVisitors() - { - return [new Twig_NodeVisitor_Sandbox()]; - } - - public function enableSandbox() - { - $this->sandboxed = true; - } - - public function disableSandbox() - { - $this->sandboxed = false; - } - - public function isSandboxed() - { - return $this->sandboxedGlobally || $this->sandboxed; - } - - public function isSandboxedGlobally() - { - return $this->sandboxedGlobally; - } - - public function setSecurityPolicy(Twig_Sandbox_SecurityPolicyInterface $policy) - { - $this->policy = $policy; - } - - public function getSecurityPolicy() - { - return $this->policy; - } - - public function checkSecurity($tags, $filters, $functions) - { - if ($this->isSandboxed()) { - $this->policy->checkSecurity($tags, $filters, $functions); - } - } - - public function checkMethodAllowed($obj, $method) - { - if ($this->isSandboxed()) { - $this->policy->checkMethodAllowed($obj, $method); - } - } - - public function checkPropertyAllowed($obj, $method) - { - if ($this->isSandboxed()) { - $this->policy->checkPropertyAllowed($obj, $method); - } - } - - public function ensureToStringAllowed($obj) - { - if ($this->isSandboxed() && is_object($obj)) { - $this->policy->checkMethodAllowed($obj, '__toString'); - } - - return $obj; - } - - public function getName() - { - return 'sandbox'; } } - -class_alias('Twig_Extension_Sandbox', 'Twig\Extension\SandboxExtension', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/Staging.php --- a/vendor/twig/twig/lib/Twig/Extension/Staging.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Staging.php Thu May 09 15:33:08 2019 +0100 @@ -1,112 +1,11 @@ - * - * @internal - */ -class Twig_Extension_Staging extends Twig_Extension -{ - protected $functions = []; - protected $filters = []; - protected $visitors = []; - protected $tokenParsers = []; - protected $globals = []; - protected $tests = []; +class_exists('Twig\Extension\StagingExtension'); - public function addFunction($name, $function) +if (\false) { + class Twig_Extension_Staging extends StagingExtension { - if (isset($this->functions[$name])) { - @trigger_error(sprintf('Overriding function "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); - } - - $this->functions[$name] = $function; - } - - public function getFunctions() - { - return $this->functions; - } - - public function addFilter($name, $filter) - { - if (isset($this->filters[$name])) { - @trigger_error(sprintf('Overriding filter "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); - } - - $this->filters[$name] = $filter; - } - - public function getFilters() - { - return $this->filters; - } - - public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) - { - $this->visitors[] = $visitor; - } - - public function getNodeVisitors() - { - return $this->visitors; - } - - public function addTokenParser(Twig_TokenParserInterface $parser) - { - if (isset($this->tokenParsers[$parser->getTag()])) { - @trigger_error(sprintf('Overriding tag "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $parser->getTag()), E_USER_DEPRECATED); - } - - $this->tokenParsers[$parser->getTag()] = $parser; - } - - public function getTokenParsers() - { - return $this->tokenParsers; - } - - public function addGlobal($name, $value) - { - $this->globals[$name] = $value; - } - - public function getGlobals() - { - return $this->globals; - } - - public function addTest($name, $test) - { - if (isset($this->tests[$name])) { - @trigger_error(sprintf('Overriding test "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); - } - - $this->tests[$name] = $test; - } - - public function getTests() - { - return $this->tests; - } - - public function getName() - { - return 'staging'; } } - -class_alias('Twig_Extension_Staging', 'Twig\Extension\StagingExtension', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Extension/StringLoader.php --- a/vendor/twig/twig/lib/Twig/Extension/StringLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/StringLoader.php Thu May 09 15:33:08 2019 +0100 @@ -1,47 +1,11 @@ true]), - ]; - } - - public function getName() - { - return 'string_loader'; } } - -/** - * Loads a template from a string. - * - *
    - * {{ include(template_from_string("Hello {{ name }}")) }}
    - * 
    - * - * @param Twig_Environment $env A Twig_Environment instance - * @param string $template A template as a string or object implementing __toString() - * - * @return Twig_Template - */ -function twig_template_from_string(Twig_Environment $env, $template) -{ - return $env->createTemplate((string) $template); -} - -class_alias('Twig_Extension_StringLoader', 'Twig\Extension\StringLoaderExtension', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/ExtensionInterface.php --- a/vendor/twig/twig/lib/Twig/ExtensionInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/ExtensionInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,90 +1,11 @@ - */ -interface Twig_ExtensionInterface -{ - /** - * Initializes the runtime environment. - * - * This is where you can load some file that contains filter functions for instance. - * - * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead - */ - public function initRuntime(Twig_Environment $environment); +class_exists('Twig\Extension\ExtensionInterface'); - /** - * Returns the token parser instances to add to the existing list. - * - * @return Twig_TokenParserInterface[] - */ - public function getTokenParsers(); - - /** - * Returns the node visitor instances to add to the existing list. - * - * @return Twig_NodeVisitorInterface[] - */ - public function getNodeVisitors(); - - /** - * Returns a list of filters to add to the existing list. - * - * @return Twig_SimpleFilter[] - */ - public function getFilters(); - - /** - * Returns a list of tests to add to the existing list. - * - * @return Twig_SimpleTest[] - */ - public function getTests(); - - /** - * Returns a list of functions to add to the existing list. - * - * @return Twig_SimpleFunction[] - */ - public function getFunctions(); - - /** - * Returns a list of operators to add to the existing list. - * - * @return array First array of unary operators, second array of binary operators - */ - public function getOperators(); - - /** - * Returns a list of global variables to add to the existing list. - * - * @return array An array of global variables - * - * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead - */ - public function getGlobals(); - - /** - * Returns the name of the extension. - * - * @return string The extension name - * - * @deprecated since 1.26 (to be removed in 2.0), not used anymore internally - */ - public function getName(); +if (\false) { + class Twig_ExtensionInterface extends ExtensionInterface + { + } } - -class_alias('Twig_ExtensionInterface', 'Twig\Extension\ExtensionInterface', false); -class_exists('Twig_Environment'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php --- a/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php Thu May 09 15:33:08 2019 +0100 @@ -1,39 +1,11 @@ - */ -class Twig_FactoryRuntimeLoader implements Twig_RuntimeLoaderInterface -{ - private $map; +class_exists('Twig\RuntimeLoader\FactoryRuntimeLoader'); - /** - * @param array $map An array where keys are class names and values factory callables - */ - public function __construct($map = []) +if (\false) { + class Twig_FactoryRuntimeLoader extends FactoryRuntimeLoader { - $this->map = $map; - } - - public function load($class) - { - if (isset($this->map[$class])) { - $runtimeFactory = $this->map[$class]; - - return $runtimeFactory(); - } } } - -class_alias('Twig_FactoryRuntimeLoader', 'Twig\RuntimeLoader\FactoryRuntimeLoader', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php --- a/vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php Thu May 09 15:33:08 2019 +0100 @@ -1,60 +1,11 @@ - */ -class Twig_FileExtensionEscapingStrategy -{ - /** - * Guesses the best autoescaping strategy based on the file name. - * - * @param string $name The template name - * - * @return string|false The escaping strategy name to use or false to disable - */ - public static function guess($name) +class_exists('Twig\FileExtensionEscapingStrategy'); + +if (\false) { + class Twig_FileExtensionEscapingStrategy extends FileExtensionEscapingStrategy { - if (in_array(substr($name, -1), ['/', '\\'])) { - return 'html'; // return html for directories - } - - if ('.twig' === substr($name, -5)) { - $name = substr($name, 0, -5); - } - - $extension = pathinfo($name, PATHINFO_EXTENSION); - - switch ($extension) { - case 'js': - return 'js'; - - case 'css': - return 'css'; - - case 'txt': - return false; - - default: - return 'html'; - } } } - -class_alias('Twig_FileExtensionEscapingStrategy', 'Twig\FileExtensionEscapingStrategy', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Filter.php --- a/vendor/twig/twig/lib/Twig/Filter.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Filter.php Thu May 09 15:33:08 2019 +0100 @@ -9,12 +9,14 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Filter class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', E_USER_DEPRECATED); +use Twig\Node\Node; + +@trigger_error('The Twig_Filter class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED); /** * Represents a template filter. * - * Use Twig_SimpleFilter instead. + * Use \Twig\TwigFilter instead. * * @author Fabien Potencier * @@ -56,14 +58,14 @@ return $this->options['needs_context']; } - public function getSafe(Twig_Node $filterArgs) + public function getSafe(Node $filterArgs) { if (isset($this->options['is_safe'])) { return $this->options['is_safe']; } if (isset($this->options['is_safe_callback'])) { - return call_user_func($this->options['is_safe_callback'], $filterArgs); + return \call_user_func($this->options['is_safe_callback'], $filterArgs); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Filter/Function.php --- a/vendor/twig/twig/lib/Twig/Filter/Function.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Filter/Function.php Thu May 09 15:33:08 2019 +0100 @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Filter_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', E_USER_DEPRECATED); +@trigger_error('The Twig_Filter_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED); /** * Represents a function template filter. * - * Use Twig_SimpleFilter instead. + * Use \Twig\TwigFilter instead. * * @author Fabien Potencier * diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Filter/Method.php --- a/vendor/twig/twig/lib/Twig/Filter/Method.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Filter/Method.php Thu May 09 15:33:08 2019 +0100 @@ -9,12 +9,14 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Filter_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', E_USER_DEPRECATED); +use Twig\Extension\ExtensionInterface; + +@trigger_error('The Twig_Filter_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED); /** * Represents a method template filter. * - * Use Twig_SimpleFilter instead. + * Use \Twig\TwigFilter instead. * * @author Fabien Potencier * @@ -25,7 +27,7 @@ protected $extension; protected $method; - public function __construct(Twig_ExtensionInterface $extension, $method, array $options = []) + public function __construct(ExtensionInterface $extension, $method, array $options = []) { $options['callable'] = [$extension, $method]; @@ -37,6 +39,6 @@ public function compile() { - return sprintf('$this->env->getExtension(\'%s\')->%s', get_class($this->extension), $this->method); + return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Filter/Node.php --- a/vendor/twig/twig/lib/Twig/Filter/Node.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Filter/Node.php Thu May 09 15:33:08 2019 +0100 @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Filter_Node class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', E_USER_DEPRECATED); +@trigger_error('The Twig_Filter_Node class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED); /** * Represents a template filter as a node. * - * Use Twig_SimpleFilter instead. + * Use \Twig\TwigFilter instead. * * @author Fabien Potencier * diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/FilterCallableInterface.php --- a/vendor/twig/twig/lib/Twig/FilterCallableInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/FilterCallableInterface.php Thu May 09 15:33:08 2019 +0100 @@ -12,7 +12,7 @@ /** * Represents a callable template filter. * - * Use Twig_SimpleFilter instead. + * Use \Twig\TwigFilter instead. * * @author Fabien Potencier * diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/FilterInterface.php --- a/vendor/twig/twig/lib/Twig/FilterInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/FilterInterface.php Thu May 09 15:33:08 2019 +0100 @@ -9,10 +9,12 @@ * file that was distributed with this source code. */ +use Twig\Node\Node; + /** * Represents a template filter. * - * Use Twig_SimpleFilter instead. + * Use \Twig\TwigFilter instead. * * @author Fabien Potencier * @@ -31,7 +33,7 @@ public function needsContext(); - public function getSafe(Twig_Node $filterArgs); + public function getSafe(Node $filterArgs); public function getPreservesSafety(); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Function.php --- a/vendor/twig/twig/lib/Twig/Function.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Function.php Thu May 09 15:33:08 2019 +0100 @@ -9,12 +9,14 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED); +use Twig\Node\Node; + +@trigger_error('The Twig_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED); /** * Represents a template function. * - * Use Twig_SimpleFunction instead. + * Use \Twig\TwigFunction instead. * * @author Fabien Potencier * @@ -54,14 +56,14 @@ return $this->options['needs_context']; } - public function getSafe(Twig_Node $functionArgs) + public function getSafe(Node $functionArgs) { if (isset($this->options['is_safe'])) { return $this->options['is_safe']; } if (isset($this->options['is_safe_callback'])) { - return call_user_func($this->options['is_safe_callback'], $functionArgs); + return \call_user_func($this->options['is_safe_callback'], $functionArgs); } return []; diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Function/Function.php --- a/vendor/twig/twig/lib/Twig/Function/Function.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Function/Function.php Thu May 09 15:33:08 2019 +0100 @@ -10,12 +10,12 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Function_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED); +@trigger_error('The Twig_Function_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED); /** * Represents a function template function. * - * Use Twig_SimpleFunction instead. + * Use \Twig\TwigFunction instead. * * @author Arnaud Le Blanc * diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Function/Method.php --- a/vendor/twig/twig/lib/Twig/Function/Method.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Function/Method.php Thu May 09 15:33:08 2019 +0100 @@ -10,12 +10,14 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Function_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED); +use Twig\Extension\ExtensionInterface; + +@trigger_error('The Twig_Function_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED); /** * Represents a method template function. * - * Use Twig_SimpleFunction instead. + * Use \Twig\TwigFunction instead. * * @author Arnaud Le Blanc * @@ -26,7 +28,7 @@ protected $extension; protected $method; - public function __construct(Twig_ExtensionInterface $extension, $method, array $options = []) + public function __construct(ExtensionInterface $extension, $method, array $options = []) { $options['callable'] = [$extension, $method]; @@ -38,6 +40,6 @@ public function compile() { - return sprintf('$this->env->getExtension(\'%s\')->%s', get_class($this->extension), $this->method); + return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Function/Node.php --- a/vendor/twig/twig/lib/Twig/Function/Node.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Function/Node.php Thu May 09 15:33:08 2019 +0100 @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Function_Node class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED); +@trigger_error('The Twig_Function_Node class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED); /** * Represents a template function as a node. * - * Use Twig_SimpleFunction instead. + * Use \Twig\TwigFunction instead. * * @author Fabien Potencier * diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/FunctionCallableInterface.php --- a/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php Thu May 09 15:33:08 2019 +0100 @@ -12,7 +12,7 @@ /** * Represents a callable template function. * - * Use Twig_SimpleFunction instead. + * Use \Twig\TwigFunction instead. * * @author Fabien Potencier * diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/FunctionInterface.php --- a/vendor/twig/twig/lib/Twig/FunctionInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/FunctionInterface.php Thu May 09 15:33:08 2019 +0100 @@ -10,10 +10,12 @@ * file that was distributed with this source code. */ +use Twig\Node\Node; + /** * Represents a template function. * - * Use Twig_SimpleFunction instead. + * Use \Twig\TwigFunction instead. * * @author Arnaud Le Blanc * @@ -32,7 +34,7 @@ public function needsContext(); - public function getSafe(Twig_Node $filterArgs); + public function getSafe(Node $filterArgs); public function setArguments($arguments); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Lexer.php --- a/vendor/twig/twig/lib/Twig/Lexer.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Lexer.php Thu May 09 15:33:08 2019 +0100 @@ -1,427 +1,11 @@ - */ -class Twig_Lexer implements Twig_LexerInterface -{ - protected $tokens; - protected $code; - protected $cursor; - protected $lineno; - protected $end; - protected $state; - protected $states; - protected $brackets; - protected $env; - // to be renamed to $name in 2.0 (where it is private) - protected $filename; - protected $options; - protected $regexes; - protected $position; - protected $positions; - protected $currentVarBlockLine; +class_exists('Twig\Lexer'); - private $source; - - const STATE_DATA = 0; - const STATE_BLOCK = 1; - const STATE_VAR = 2; - const STATE_STRING = 3; - const STATE_INTERPOLATION = 4; - - const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; - const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'; - const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; - const REGEX_DQ_STRING_DELIM = '/"/A'; - const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; - const PUNCTUATION = '()[]{}?:.,|'; - - public function __construct(Twig_Environment $env, array $options = []) +if (\false) { + class Twig_Lexer extends Lexer { - $this->env = $env; - - $this->options = array_merge([ - 'tag_comment' => ['{#', '#}'], - 'tag_block' => ['{%', '%}'], - 'tag_variable' => ['{{', '}}'], - 'whitespace_trim' => '-', - 'interpolation' => ['#{', '}'], - ], $options); - - $this->regexes = [ - 'lex_var' => '/\s*'.preg_quote($this->options['whitespace_trim'].$this->options['tag_variable'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_variable'][1], '/').'/A', - 'lex_block' => '/\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')\n?/A', - 'lex_raw_data' => '/('.preg_quote($this->options['tag_block'][0].$this->options['whitespace_trim'], '/').'|'.preg_quote($this->options['tag_block'][0], '/').')\s*(?:end%s)\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')/s', - 'operator' => $this->getOperatorRegex(), - 'lex_comment' => '/(?:'.preg_quote($this->options['whitespace_trim'], '/').preg_quote($this->options['tag_comment'][1], '/').'\s*|'.preg_quote($this->options['tag_comment'][1], '/').')\n?/s', - 'lex_block_raw' => '/\s*(raw|verbatim)\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')/As', - 'lex_block_line' => '/\s*line\s+(\d+)\s*'.preg_quote($this->options['tag_block'][1], '/').'/As', - 'lex_tokens_start' => '/('.preg_quote($this->options['tag_variable'][0], '/').'|'.preg_quote($this->options['tag_block'][0], '/').'|'.preg_quote($this->options['tag_comment'][0], '/').')('.preg_quote($this->options['whitespace_trim'], '/').')?/s', - 'interpolation_start' => '/'.preg_quote($this->options['interpolation'][0], '/').'\s*/A', - 'interpolation_end' => '/\s*'.preg_quote($this->options['interpolation'][1], '/').'/A', - ]; - } - - public function tokenize($code, $name = null) - { - if (!$code instanceof Twig_Source) { - @trigger_error(sprintf('Passing a string as the $code argument of %s() is deprecated since version 1.27 and will be removed in 2.0. Pass a Twig_Source instance instead.', __METHOD__), E_USER_DEPRECATED); - $this->source = new Twig_Source($code, $name); - } else { - $this->source = $code; - } - - if (((int) ini_get('mbstring.func_overload')) & 2) { - @trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED); - } - - if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); - } else { - $mbEncoding = null; - } - - $this->code = str_replace(["\r\n", "\r"], "\n", $this->source->getCode()); - $this->filename = $this->source->getName(); - $this->cursor = 0; - $this->lineno = 1; - $this->end = strlen($this->code); - $this->tokens = []; - $this->state = self::STATE_DATA; - $this->states = []; - $this->brackets = []; - $this->position = -1; - - // find all token starts in one go - preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE); - $this->positions = $matches; - - while ($this->cursor < $this->end) { - // dispatch to the lexing functions depending - // on the current state - switch ($this->state) { - case self::STATE_DATA: - $this->lexData(); - break; - - case self::STATE_BLOCK: - $this->lexBlock(); - break; - - case self::STATE_VAR: - $this->lexVar(); - break; - - case self::STATE_STRING: - $this->lexString(); - break; - - case self::STATE_INTERPOLATION: - $this->lexInterpolation(); - break; - } - } - - $this->pushToken(Twig_Token::EOF_TYPE); - - if (!empty($this->brackets)) { - list($expect, $lineno) = array_pop($this->brackets); - throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); - } - - if ($mbEncoding) { - mb_internal_encoding($mbEncoding); - } - - return new Twig_TokenStream($this->tokens, $this->source); - } - - protected function lexData() - { - // if no matches are left we return the rest of the template as simple text token - if ($this->position == count($this->positions[0]) - 1) { - $this->pushToken(Twig_Token::TEXT_TYPE, substr($this->code, $this->cursor)); - $this->cursor = $this->end; - - return; - } - - // Find the first token after the current cursor - $position = $this->positions[0][++$this->position]; - while ($position[1] < $this->cursor) { - if ($this->position == count($this->positions[0]) - 1) { - return; - } - $position = $this->positions[0][++$this->position]; - } - - // push the template text first - $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor); - if (isset($this->positions[2][$this->position][0])) { - $text = rtrim($text); - } - $this->pushToken(Twig_Token::TEXT_TYPE, $text); - $this->moveCursor($textContent.$position[0]); - - switch ($this->positions[1][$this->position][0]) { - case $this->options['tag_comment'][0]: - $this->lexComment(); - break; - - case $this->options['tag_block'][0]: - // raw data? - if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, null, $this->cursor)) { - $this->moveCursor($match[0]); - $this->lexRawData($match[1]); - // {% line \d+ %} - } elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, null, $this->cursor)) { - $this->moveCursor($match[0]); - $this->lineno = (int) $match[1]; - } else { - $this->pushToken(Twig_Token::BLOCK_START_TYPE); - $this->pushState(self::STATE_BLOCK); - $this->currentVarBlockLine = $this->lineno; - } - break; - - case $this->options['tag_variable'][0]: - $this->pushToken(Twig_Token::VAR_START_TYPE); - $this->pushState(self::STATE_VAR); - $this->currentVarBlockLine = $this->lineno; - break; - } - } - - protected function lexBlock() - { - if (empty($this->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, null, $this->cursor)) { - $this->pushToken(Twig_Token::BLOCK_END_TYPE); - $this->moveCursor($match[0]); - $this->popState(); - } else { - $this->lexExpression(); - } - } - - protected function lexVar() - { - if (empty($this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, null, $this->cursor)) { - $this->pushToken(Twig_Token::VAR_END_TYPE); - $this->moveCursor($match[0]); - $this->popState(); - } else { - $this->lexExpression(); - } - } - - protected function lexExpression() - { - // whitespace - if (preg_match('/\s+/A', $this->code, $match, null, $this->cursor)) { - $this->moveCursor($match[0]); - - if ($this->cursor >= $this->end) { - throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', self::STATE_BLOCK === $this->state ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source); - } - } - - // operators - if (preg_match($this->regexes['operator'], $this->code, $match, null, $this->cursor)) { - $this->pushToken(Twig_Token::OPERATOR_TYPE, preg_replace('/\s+/', ' ', $match[0])); - $this->moveCursor($match[0]); - } - // names - elseif (preg_match(self::REGEX_NAME, $this->code, $match, null, $this->cursor)) { - $this->pushToken(Twig_Token::NAME_TYPE, $match[0]); - $this->moveCursor($match[0]); - } - // numbers - elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, null, $this->cursor)) { - $number = (float) $match[0]; // floats - if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) { - $number = (int) $match[0]; // integers lower than the maximum - } - $this->pushToken(Twig_Token::NUMBER_TYPE, $number); - $this->moveCursor($match[0]); - } - // punctuation - elseif (false !== strpos(self::PUNCTUATION, $this->code[$this->cursor])) { - // opening bracket - if (false !== strpos('([{', $this->code[$this->cursor])) { - $this->brackets[] = [$this->code[$this->cursor], $this->lineno]; - } - // closing bracket - elseif (false !== strpos(')]}', $this->code[$this->cursor])) { - if (empty($this->brackets)) { - throw new Twig_Error_Syntax(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); - } - - list($expect, $lineno) = array_pop($this->brackets); - if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) { - throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); - } - } - - $this->pushToken(Twig_Token::PUNCTUATION_TYPE, $this->code[$this->cursor]); - ++$this->cursor; - } - // strings - elseif (preg_match(self::REGEX_STRING, $this->code, $match, null, $this->cursor)) { - $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1))); - $this->moveCursor($match[0]); - } - // opening double quoted string - elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { - $this->brackets[] = ['"', $this->lineno]; - $this->pushState(self::STATE_STRING); - $this->moveCursor($match[0]); - } - // unlexable - else { - throw new Twig_Error_Syntax(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); - } - } - - protected function lexRawData($tag) - { - if ('raw' === $tag) { - @trigger_error(sprintf('Twig Tag "raw" is deprecated since version 1.21. Use "verbatim" instead in %s at line %d.', $this->filename, $this->lineno), E_USER_DEPRECATED); - } - - if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { - throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block.', $tag), $this->lineno, $this->source); - } - - $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor); - $this->moveCursor($text.$match[0][0]); - - if (false !== strpos($match[1][0], $this->options['whitespace_trim'])) { - $text = rtrim($text); - } - - $this->pushToken(Twig_Token::TEXT_TYPE, $text); - } - - protected function lexComment() - { - if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { - throw new Twig_Error_Syntax('Unclosed comment.', $this->lineno, $this->source); - } - - $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]); - } - - protected function lexString() - { - if (preg_match($this->regexes['interpolation_start'], $this->code, $match, null, $this->cursor)) { - $this->brackets[] = [$this->options['interpolation'][0], $this->lineno]; - $this->pushToken(Twig_Token::INTERPOLATION_START_TYPE); - $this->moveCursor($match[0]); - $this->pushState(self::STATE_INTERPOLATION); - } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, null, $this->cursor) && strlen($match[0]) > 0) { - $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes($match[0])); - $this->moveCursor($match[0]); - } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { - list($expect, $lineno) = array_pop($this->brackets); - if ('"' != $this->code[$this->cursor]) { - throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); - } - - $this->popState(); - ++$this->cursor; - } else { - // unlexable - throw new Twig_Error_Syntax(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); - } - } - - protected function lexInterpolation() - { - $bracket = end($this->brackets); - if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, null, $this->cursor)) { - array_pop($this->brackets); - $this->pushToken(Twig_Token::INTERPOLATION_END_TYPE); - $this->moveCursor($match[0]); - $this->popState(); - } else { - $this->lexExpression(); - } - } - - protected function pushToken($type, $value = '') - { - // do not push empty text tokens - if (Twig_Token::TEXT_TYPE === $type && '' === $value) { - return; - } - - $this->tokens[] = new Twig_Token($type, $value, $this->lineno); - } - - protected function moveCursor($text) - { - $this->cursor += strlen($text); - $this->lineno += substr_count($text, "\n"); - } - - protected function getOperatorRegex() - { - $operators = array_merge( - ['='], - array_keys($this->env->getUnaryOperators()), - array_keys($this->env->getBinaryOperators()) - ); - - $operators = array_combine($operators, array_map('strlen', $operators)); - arsort($operators); - - $regex = []; - foreach ($operators as $operator => $length) { - // an operator that ends with a character must be followed by - // a whitespace or a parenthesis - if (ctype_alpha($operator[$length - 1])) { - $r = preg_quote($operator, '/').'(?=[\s()])'; - } else { - $r = preg_quote($operator, '/'); - } - - // an operator with a space can be any amount of whitespaces - $r = preg_replace('/\s+/', '\s+', $r); - - $regex[] = $r; - } - - return '/'.implode('|', $regex).'/A'; - } - - protected function pushState($state) - { - $this->states[] = $this->state; - $this->state = $state; - } - - protected function popState() - { - if (0 === count($this->states)) { - throw new Exception('Cannot pop state without a previous state.'); - } - - $this->state = array_pop($this->states); } } - -class_alias('Twig_Lexer', 'Twig\Lexer', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/LexerInterface.php --- a/vendor/twig/twig/lib/Twig/LexerInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/LexerInterface.php Thu May 09 15:33:08 2019 +0100 @@ -9,6 +9,10 @@ * file that was distributed with this source code. */ +use Twig\Error\SyntaxError; +use Twig\Source; +use Twig\TokenStream; + /** * Interface implemented by lexer classes. * @@ -21,12 +25,12 @@ /** * Tokenizes a source code. * - * @param string|Twig_Source $code The source code - * @param string $name A unique identifier for the source code + * @param string|Source $code The source code + * @param string $name A unique identifier for the source code * - * @return Twig_TokenStream + * @return TokenStream * - * @throws Twig_Error_Syntax When the code is syntactically wrong + * @throws SyntaxError When the code is syntactically wrong */ public function tokenize($code, $name = null); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Loader/Array.php --- a/vendor/twig/twig/lib/Twig/Loader/Array.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Loader/Array.php Thu May 09 15:33:08 2019 +0100 @@ -1,97 +1,11 @@ - */ -class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface -{ - protected $templates = []; +class_exists('Twig\Loader\ArrayLoader'); - /** - * @param array $templates An array of templates (keys are the names, and values are the source code) - */ - public function __construct(array $templates = []) +if (\false) { + class Twig_Loader_Array extends ArrayLoader { - $this->templates = $templates; - } - - /** - * Adds or overrides a template. - * - * @param string $name The template name - * @param string $template The template source - */ - public function setTemplate($name, $template) - { - $this->templates[(string) $name] = $template; - } - - public function getSource($name) - { - @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED); - - $name = (string) $name; - if (!isset($this->templates[$name])) { - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); - } - - return $this->templates[$name]; - } - - public function getSourceContext($name) - { - $name = (string) $name; - if (!isset($this->templates[$name])) { - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); - } - - return new Twig_Source($this->templates[$name], $name); - } - - public function exists($name) - { - return isset($this->templates[(string) $name]); - } - - public function getCacheKey($name) - { - $name = (string) $name; - if (!isset($this->templates[$name])) { - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); - } - - return $name.':'.$this->templates[$name]; - } - - public function isFresh($name, $time) - { - $name = (string) $name; - if (!isset($this->templates[$name])) { - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); - } - - return true; } } - -class_alias('Twig_Loader_Array', 'Twig\Loader\ArrayLoader', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Loader/Chain.php --- a/vendor/twig/twig/lib/Twig/Loader/Chain.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Loader/Chain.php Thu May 09 15:33:08 2019 +0100 @@ -1,151 +1,11 @@ - */ -class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface -{ - private $hasSourceCache = []; - protected $loaders = []; +class_exists('Twig\Loader\ChainLoader'); - /** - * @param Twig_LoaderInterface[] $loaders - */ - public function __construct(array $loaders = []) +if (\false) { + class Twig_Loader_Chain extends ChainLoader { - foreach ($loaders as $loader) { - $this->addLoader($loader); - } - } - - public function addLoader(Twig_LoaderInterface $loader) - { - $this->loaders[] = $loader; - $this->hasSourceCache = []; - } - - public function getSource($name) - { - @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED); - - $exceptions = []; - foreach ($this->loaders as $loader) { - if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { - continue; - } - - try { - return $loader->getSource($name); - } catch (Twig_Error_Loader $e) { - $exceptions[] = $e->getMessage(); - } - } - - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); - } - - public function getSourceContext($name) - { - $exceptions = []; - foreach ($this->loaders as $loader) { - if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { - continue; - } - - try { - if ($loader instanceof Twig_SourceContextLoaderInterface) { - return $loader->getSourceContext($name); - } - - return new Twig_Source($loader->getSource($name), $name); - } catch (Twig_Error_Loader $e) { - $exceptions[] = $e->getMessage(); - } - } - - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); - } - - public function exists($name) - { - $name = (string) $name; - - if (isset($this->hasSourceCache[$name])) { - return $this->hasSourceCache[$name]; - } - - foreach ($this->loaders as $loader) { - if ($loader instanceof Twig_ExistsLoaderInterface) { - if ($loader->exists($name)) { - return $this->hasSourceCache[$name] = true; - } - - continue; - } - - try { - if ($loader instanceof Twig_SourceContextLoaderInterface) { - $loader->getSourceContext($name); - } else { - $loader->getSource($name); - } - - return $this->hasSourceCache[$name] = true; - } catch (Twig_Error_Loader $e) { - } - } - - return $this->hasSourceCache[$name] = false; - } - - public function getCacheKey($name) - { - $exceptions = []; - foreach ($this->loaders as $loader) { - if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { - continue; - } - - try { - return $loader->getCacheKey($name); - } catch (Twig_Error_Loader $e) { - $exceptions[] = get_class($loader).': '.$e->getMessage(); - } - } - - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); - } - - public function isFresh($name, $time) - { - $exceptions = []; - foreach ($this->loaders as $loader) { - if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { - continue; - } - - try { - return $loader->isFresh($name, $time); - } catch (Twig_Error_Loader $e) { - $exceptions[] = get_class($loader).': '.$e->getMessage(); - } - } - - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); } } - -class_alias('Twig_Loader_Chain', 'Twig\Loader\ChainLoader', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Loader/Filesystem.php --- a/vendor/twig/twig/lib/Twig/Loader/Filesystem.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Loader/Filesystem.php Thu May 09 15:33:08 2019 +0100 @@ -1,298 +1,11 @@ - */ -class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface -{ - /** Identifier of the main namespace. */ - const MAIN_NAMESPACE = '__main__'; +class_exists('Twig\Loader\FilesystemLoader'); - protected $paths = []; - protected $cache = []; - protected $errorCache = []; - - private $rootPath; - - /** - * @param string|array $paths A path or an array of paths where to look for templates - * @param string|null $rootPath The root path common to all relative paths (null for getcwd()) - */ - public function __construct($paths = [], $rootPath = null) +if (\false) { + class Twig_Loader_Filesystem extends FilesystemLoader { - $this->rootPath = (null === $rootPath ? getcwd() : $rootPath).DIRECTORY_SEPARATOR; - if (false !== $realPath = realpath($rootPath)) { - $this->rootPath = $realPath.DIRECTORY_SEPARATOR; - } - - if ($paths) { - $this->setPaths($paths); - } - } - - /** - * Returns the paths to the templates. - * - * @param string $namespace A path namespace - * - * @return array The array of paths where to look for templates - */ - public function getPaths($namespace = self::MAIN_NAMESPACE) - { - return isset($this->paths[$namespace]) ? $this->paths[$namespace] : []; - } - - /** - * Returns the path namespaces. - * - * The main namespace is always defined. - * - * @return array The array of defined namespaces - */ - public function getNamespaces() - { - return array_keys($this->paths); - } - - /** - * Sets the paths where templates are stored. - * - * @param string|array $paths A path or an array of paths where to look for templates - * @param string $namespace A path namespace - */ - public function setPaths($paths, $namespace = self::MAIN_NAMESPACE) - { - if (!is_array($paths)) { - $paths = [$paths]; - } - - $this->paths[$namespace] = []; - foreach ($paths as $path) { - $this->addPath($path, $namespace); - } - } - - /** - * Adds a path where templates are stored. - * - * @param string $path A path where to look for templates - * @param string $namespace A path namespace - * - * @throws Twig_Error_Loader - */ - public function addPath($path, $namespace = self::MAIN_NAMESPACE) - { - // invalidate the cache - $this->cache = $this->errorCache = []; - - $checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path; - if (!is_dir($checkPath)) { - throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath)); - } - - $this->paths[$namespace][] = rtrim($path, '/\\'); - } - - /** - * Prepends a path where templates are stored. - * - * @param string $path A path where to look for templates - * @param string $namespace A path namespace - * - * @throws Twig_Error_Loader - */ - public function prependPath($path, $namespace = self::MAIN_NAMESPACE) - { - // invalidate the cache - $this->cache = $this->errorCache = []; - - $checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path; - if (!is_dir($checkPath)) { - throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath)); - } - - $path = rtrim($path, '/\\'); - - if (!isset($this->paths[$namespace])) { - $this->paths[$namespace][] = $path; - } else { - array_unshift($this->paths[$namespace], $path); - } - } - - public function getSource($name) - { - @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED); - - return file_get_contents($this->findTemplate($name)); - } - - public function getSourceContext($name) - { - $path = $this->findTemplate($name); - - return new Twig_Source(file_get_contents($path), $name, $path); - } - - public function getCacheKey($name) - { - $path = $this->findTemplate($name); - $len = strlen($this->rootPath); - if (0 === strncmp($this->rootPath, $path, $len)) { - return substr($path, $len); - } - - return $path; - } - - public function exists($name) - { - $name = $this->normalizeName($name); - - if (isset($this->cache[$name])) { - return true; - } - - try { - return false !== $this->findTemplate($name, false); - } catch (Twig_Error_Loader $exception) { - @trigger_error(sprintf('In %s::findTemplate(), you must accept a second argument that when set to "false" returns "false" instead of throwing an exception. Not supporting this argument is deprecated since version 1.27.', get_class($this)), E_USER_DEPRECATED); - - return false; - } - } - - public function isFresh($name, $time) - { - return filemtime($this->findTemplate($name)) < $time; - } - - protected function findTemplate($name) - { - $throw = func_num_args() > 1 ? func_get_arg(1) : true; - $name = $this->normalizeName($name); - - if (isset($this->cache[$name])) { - return $this->cache[$name]; - } - - if (isset($this->errorCache[$name])) { - if (!$throw) { - return false; - } - - throw new Twig_Error_Loader($this->errorCache[$name]); - } - - try { - $this->validateName($name); - - list($namespace, $shortname) = $this->parseName($name); - } catch (Twig_Error_Loader $e) { - if (!$throw) { - return false; - } - - throw $e; - } - - if (!isset($this->paths[$namespace])) { - $this->errorCache[$name] = sprintf('There are no registered paths for namespace "%s".', $namespace); - - if (!$throw) { - return false; - } - - throw new Twig_Error_Loader($this->errorCache[$name]); - } - - foreach ($this->paths[$namespace] as $path) { - if (!$this->isAbsolutePath($path)) { - $path = $this->rootPath.'/'.$path; - } - - if (is_file($path.'/'.$shortname)) { - if (false !== $realpath = realpath($path.'/'.$shortname)) { - return $this->cache[$name] = $realpath; - } - - return $this->cache[$name] = $path.'/'.$shortname; - } - } - - $this->errorCache[$name] = sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace])); - - if (!$throw) { - return false; - } - - throw new Twig_Error_Loader($this->errorCache[$name]); - } - - protected function parseName($name, $default = self::MAIN_NAMESPACE) - { - if (isset($name[0]) && '@' == $name[0]) { - if (false === $pos = strpos($name, '/')) { - throw new Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); - } - - $namespace = substr($name, 1, $pos - 1); - $shortname = substr($name, $pos + 1); - - return [$namespace, $shortname]; - } - - return [$default, $name]; - } - - protected function normalizeName($name) - { - return preg_replace('#/{2,}#', '/', str_replace('\\', '/', (string) $name)); - } - - protected function validateName($name) - { - if (false !== strpos($name, "\0")) { - throw new Twig_Error_Loader('A template name cannot contain NUL bytes.'); - } - - $name = ltrim($name, '/'); - $parts = explode('/', $name); - $level = 0; - foreach ($parts as $part) { - if ('..' === $part) { - --$level; - } elseif ('.' !== $part) { - ++$level; - } - - if ($level < 0) { - throw new Twig_Error_Loader(sprintf('Looks like you try to load a template outside configured directories (%s).', $name)); - } - } - } - - private function isAbsolutePath($file) - { - return strspn($file, '/\\', 0, 1) - || (strlen($file) > 3 && ctype_alpha($file[0]) - && ':' === substr($file, 1, 1) - && strspn($file, '/\\', 2, 1) - ) - || null !== parse_url($file, PHP_URL_SCHEME) - ; } } - -class_alias('Twig_Loader_Filesystem', 'Twig\Loader\FilesystemLoader', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Loader/String.php --- a/vendor/twig/twig/lib/Twig/Loader/String.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Loader/String.php Thu May 09 15:33:08 2019 +0100 @@ -9,7 +9,12 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use Twig_Loader_Array instead or Twig_Environment::createTemplate().', E_USER_DEPRECATED); +use Twig\Loader\ExistsLoaderInterface; +use Twig\Loader\LoaderInterface; +use Twig\Loader\SourceContextLoaderInterface; +use Twig\Source; + +@trigger_error('The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use "Twig\Loader\ArrayLoader" instead or "Twig\Environment::createTemplate()".', E_USER_DEPRECATED); /** * Loads a template from a string. @@ -27,18 +32,18 @@ * * @author Fabien Potencier */ -class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface +class Twig_Loader_String implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface { public function getSource($name) { - @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED); + @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED); return $name; } public function getSourceContext($name) { - return new Twig_Source($name, $name); + return new Source($name, $name); } public function exists($name) diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/LoaderInterface.php --- a/vendor/twig/twig/lib/Twig/LoaderInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/LoaderInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,57 +1,11 @@ - */ -interface Twig_LoaderInterface -{ - /** - * Gets the source code of a template, given its name. - * - * @param string $name The name of the template to load - * - * @return string The template source code - * - * @throws Twig_Error_Loader When $name is not found - * - * @deprecated since 1.27 (to be removed in 2.0), implement Twig_SourceContextLoaderInterface - */ - public function getSource($name); +class_exists('Twig\Loader\LoaderInterface'); - /** - * Gets the cache key to use for the cache for a given template name. - * - * @param string $name The name of the template to load - * - * @return string The cache key - * - * @throws Twig_Error_Loader When $name is not found - */ - public function getCacheKey($name); - - /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param int $time Timestamp of the last modification time of the - * cached template - * - * @return bool true if the template is fresh, false otherwise - * - * @throws Twig_Error_Loader When $name is not found - */ - public function isFresh($name, $time); +if (\false) { + class Twig_LoaderInterface extends LoaderInterface + { + } } - -class_alias('Twig_LoaderInterface', 'Twig\Loader\LoaderInterface', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Markup.php --- a/vendor/twig/twig/lib/Twig/Markup.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Markup.php Thu May 09 15:33:08 2019 +0100 @@ -1,39 +1,11 @@ - */ -class Twig_Markup implements Countable -{ - protected $content; - protected $charset; +class_exists('Twig\Markup'); - public function __construct($content, $charset) +if (\false) { + class Twig_Markup extends Markup { - $this->content = (string) $content; - $this->charset = $charset; - } - - public function __toString() - { - return $this->content; - } - - public function count() - { - return function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : strlen($this->content); } } - -class_alias('Twig_Markup', 'Twig\Markup', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node.php --- a/vendor/twig/twig/lib/Twig/Node.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node.php Thu May 09 15:33:08 2019 +0100 @@ -1,256 +1,11 @@ - */ -class Twig_Node implements Twig_NodeInterface -{ - protected $nodes; - protected $attributes; - protected $lineno; - protected $tag; +class_exists('Twig\Node\Node'); - private $name; - - /** - * Constructor. - * - * The nodes are automatically made available as properties ($this->node). - * The attributes are automatically made available as array items ($this['name']). - * - * @param array $nodes An array of named nodes - * @param array $attributes An array of attributes (should not be nodes) - * @param int $lineno The line number - * @param string $tag The tag name associated with the Node - */ - public function __construct(array $nodes = [], array $attributes = [], $lineno = 0, $tag = null) +if (\false) { + class Twig_Node extends Node { - foreach ($nodes as $name => $node) { - if (!$node instanceof Twig_NodeInterface) { - @trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', is_object($node) ? get_class($node) : null === $node ? 'null' : gettype($node), $name, get_class($this)), E_USER_DEPRECATED); - } - } - $this->nodes = $nodes; - $this->attributes = $attributes; - $this->lineno = $lineno; - $this->tag = $tag; - } - - public function __toString() - { - $attributes = []; - foreach ($this->attributes as $name => $value) { - $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true))); - } - - $repr = [get_class($this).'('.implode(', ', $attributes)]; - - if (count($this->nodes)) { - foreach ($this->nodes as $name => $node) { - $len = strlen($name) + 4; - $noderepr = []; - foreach (explode("\n", (string) $node) as $line) { - $noderepr[] = str_repeat(' ', $len).$line; - } - - $repr[] = sprintf(' %s: %s', $name, ltrim(implode("\n", $noderepr))); - } - - $repr[] = ')'; - } else { - $repr[0] .= ')'; - } - - return implode("\n", $repr); - } - - /** - * @deprecated since 1.16.1 (to be removed in 2.0) - */ - public function toXml($asDom = false) - { - @trigger_error(sprintf('%s is deprecated since version 1.16.1 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); - - $dom = new DOMDocument('1.0', 'UTF-8'); - $dom->formatOutput = true; - $dom->appendChild($xml = $dom->createElement('twig')); - - $xml->appendChild($node = $dom->createElement('node')); - $node->setAttribute('class', get_class($this)); - - foreach ($this->attributes as $name => $value) { - $node->appendChild($attribute = $dom->createElement('attribute')); - $attribute->setAttribute('name', $name); - $attribute->appendChild($dom->createTextNode($value)); - } - - foreach ($this->nodes as $name => $n) { - if (null === $n) { - continue; - } - - $child = $n->toXml(true)->getElementsByTagName('node')->item(0); - $child = $dom->importNode($child, true); - $child->setAttribute('name', $name); - - $node->appendChild($child); - } - - return $asDom ? $dom : $dom->saveXML(); - } - - public function compile(Twig_Compiler $compiler) - { - foreach ($this->nodes as $node) { - $node->compile($compiler); - } - } - - public function getTemplateLine() - { - return $this->lineno; - } - - /** - * @deprecated since 1.27 (to be removed in 2.0) - */ - public function getLine() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateLine() instead.', E_USER_DEPRECATED); - - return $this->lineno; - } - - public function getNodeTag() - { - return $this->tag; - } - - /** - * @return bool - */ - public function hasAttribute($name) - { - return array_key_exists($name, $this->attributes); - } - - /** - * @return mixed - */ - public function getAttribute($name) - { - if (!array_key_exists($name, $this->attributes)) { - throw new LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, get_class($this))); - } - - return $this->attributes[$name]; - } - - /** - * @param string $name - * @param mixed $value - */ - public function setAttribute($name, $value) - { - $this->attributes[$name] = $value; - } - - public function removeAttribute($name) - { - unset($this->attributes[$name]); - } - - /** - * @return bool - */ - public function hasNode($name) - { - return array_key_exists($name, $this->nodes); - } - - /** - * @return Twig_Node - */ - public function getNode($name) - { - if (!array_key_exists($name, $this->nodes)) { - throw new LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, get_class($this))); - } - - return $this->nodes[$name]; - } - - public function setNode($name, $node = null) - { - if (!$node instanceof Twig_NodeInterface) { - @trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', is_object($node) ? get_class($node) : null === $node ? 'null' : gettype($node), $name, get_class($this)), E_USER_DEPRECATED); - } - - $this->nodes[$name] = $node; - } - - public function removeNode($name) - { - unset($this->nodes[$name]); - } - - public function count() - { - return count($this->nodes); - } - - public function getIterator() - { - return new ArrayIterator($this->nodes); - } - - public function setTemplateName($name) - { - $this->name = $name; - foreach ($this->nodes as $node) { - if (null !== $node) { - $node->setTemplateName($name); - } - } - } - - public function getTemplateName() - { - return $this->name; - } - - /** - * @deprecated since 1.27 (to be removed in 2.0) - */ - public function setFilename($name) - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use setTemplateName() instead.', E_USER_DEPRECATED); - - $this->setTemplateName($name); - } - - /** - * @deprecated since 1.27 (to be removed in 2.0) - */ - public function getFilename() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateName() instead.', E_USER_DEPRECATED); - - return $this->name; } } - -class_alias('Twig_Node', 'Twig\Node\Node', false); -class_exists('Twig_Compiler'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/AutoEscape.php --- a/vendor/twig/twig/lib/Twig/Node/AutoEscape.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/AutoEscape.php Thu May 09 15:33:08 2019 +0100 @@ -1,36 +1,11 @@ - */ -class Twig_Node_AutoEscape extends Twig_Node -{ - public function __construct($value, Twig_NodeInterface $body, $lineno, $tag = 'autoescape') +class_exists('Twig\Node\AutoEscapeNode'); + +if (\false) { + class Twig_Node_AutoEscape extends AutoEscapeNode { - parent::__construct(['body' => $body], ['value' => $value], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->subcompile($this->getNode('body')); } } - -class_alias('Twig_Node_AutoEscape', 'Twig\Node\AutoEscapeNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Block.php --- a/vendor/twig/twig/lib/Twig/Node/Block.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Block.php Thu May 09 15:33:08 2019 +0100 @@ -1,41 +1,11 @@ - */ -class Twig_Node_Block extends Twig_Node -{ - public function __construct($name, Twig_NodeInterface $body, $lineno, $tag = null) +class_exists('Twig\Node\BlockNode'); + +if (\false) { + class Twig_Node_Block extends BlockNode { - parent::__construct(['body' => $body], ['name' => $name], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write(sprintf("public function block_%s(\$context, array \$blocks = [])\n", $this->getAttribute('name')), "{\n") - ->indent() - ; - - $compiler - ->subcompile($this->getNode('body')) - ->outdent() - ->write("}\n\n") - ; } } - -class_alias('Twig_Node_Block', 'Twig\Node\BlockNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/BlockReference.php --- a/vendor/twig/twig/lib/Twig/Node/BlockReference.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/BlockReference.php Thu May 09 15:33:08 2019 +0100 @@ -1,34 +1,11 @@ - */ -class Twig_Node_BlockReference extends Twig_Node implements Twig_NodeOutputInterface -{ - public function __construct($name, $lineno, $tag = null) +class_exists('Twig\Node\BlockReferenceNode'); + +if (\false) { + class Twig_Node_BlockReference extends BlockReferenceNode { - parent::__construct([], ['name' => $name], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name'))) - ; } } - -class_alias('Twig_Node_BlockReference', 'Twig\Node\BlockReferenceNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Body.php --- a/vendor/twig/twig/lib/Twig/Node/Body.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Body.php Thu May 09 15:33:08 2019 +0100 @@ -1,21 +1,11 @@ - */ -class Twig_Node_Body extends Twig_Node -{ +class_exists('Twig\Node\BodyNode'); + +if (\false) { + class Twig_Node_Body extends BodyNode + { + } } - -class_alias('Twig_Node_Body', 'Twig\Node\BodyNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/CheckSecurity.php --- a/vendor/twig/twig/lib/Twig/Node/CheckSecurity.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/CheckSecurity.php Thu May 09 15:33:08 2019 +0100 @@ -1,80 +1,11 @@ - */ -class Twig_Node_CheckSecurity extends Twig_Node -{ - protected $usedFilters; - protected $usedTags; - protected $usedFunctions; +class_exists('Twig\Node\CheckSecurityNode'); - public function __construct(array $usedFilters, array $usedTags, array $usedFunctions) +if (\false) { + class Twig_Node_CheckSecurity extends CheckSecurityNode { - $this->usedFilters = $usedFilters; - $this->usedTags = $usedTags; - $this->usedFunctions = $usedFunctions; - - parent::__construct(); - } - - public function compile(Twig_Compiler $compiler) - { - $tags = $filters = $functions = []; - foreach (['tags', 'filters', 'functions'] as $type) { - foreach ($this->{'used'.ucfirst($type)} as $name => $node) { - if ($node instanceof Twig_Node) { - ${$type}[$name] = $node->getTemplateLine(); - } else { - ${$type}[$node] = null; - } - } - } - - $compiler - ->write('$tags = ')->repr(array_filter($tags))->raw(";\n") - ->write('$filters = ')->repr(array_filter($filters))->raw(";\n") - ->write('$functions = ')->repr(array_filter($functions))->raw(";\n\n") - ->write("try {\n") - ->indent() - ->write("\$this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity(\n") - ->indent() - ->write(!$tags ? "[],\n" : "['".implode("', '", array_keys($tags))."'],\n") - ->write(!$filters ? "[],\n" : "['".implode("', '", array_keys($filters))."'],\n") - ->write(!$functions ? "[]\n" : "['".implode("', '", array_keys($functions))."']\n") - ->outdent() - ->write(");\n") - ->outdent() - ->write("} catch (Twig_Sandbox_SecurityError \$e) {\n") - ->indent() - ->write("\$e->setSourceContext(\$this->getSourceContext());\n\n") - ->write("if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$tags[\$e->getTagName()]);\n") - ->outdent() - ->write("} elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$filters[\$e->getFilterName()]);\n") - ->outdent() - ->write("} elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$functions[\$e->getFunctionName()]);\n") - ->outdent() - ->write("}\n\n") - ->write("throw \$e;\n") - ->outdent() - ->write("}\n\n") - ; } } - -class_alias('Twig_Node_CheckSecurity', 'Twig\Node\CheckSecurityNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Deprecated.php --- a/vendor/twig/twig/lib/Twig/Node/Deprecated.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Deprecated.php Thu May 09 15:33:08 2019 +0100 @@ -1,49 +1,11 @@ - */ -class Twig_Node_Deprecated extends Twig_Node -{ - public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) +class_exists('Twig\Node\DeprecatedNode'); + +if (\false) { + class Twig_Node_Deprecated extends DeprecatedNode { - parent::__construct(['expr' => $expr], [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - - $expr = $this->getNode('expr'); - - if ($expr instanceof Twig_Node_Expression_Constant) { - $compiler->write('@trigger_error(') - ->subcompile($expr); - } else { - $varName = $compiler->getVarName(); - $compiler->write(sprintf('$%s = ', $varName)) - ->subcompile($expr) - ->raw(";\n") - ->write(sprintf('@trigger_error($%s', $varName)); - } - - $compiler - ->raw('.') - ->string(sprintf(' ("%s" at line %d).', $this->getTemplateName(), $this->getTemplateLine())) - ->raw(", E_USER_DEPRECATED);\n") - ; } } - -class_alias('Twig_Node_Deprecated', 'Twig\Node\DeprecatedNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Do.php --- a/vendor/twig/twig/lib/Twig/Node/Do.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Do.php Thu May 09 15:33:08 2019 +0100 @@ -1,35 +1,11 @@ - */ -class Twig_Node_Do extends Twig_Node -{ - public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) +class_exists('Twig\Node\DoNode'); + +if (\false) { + class Twig_Node_Do extends DoNode { - parent::__construct(['expr' => $expr], [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('') - ->subcompile($this->getNode('expr')) - ->raw(";\n") - ; } } - -class_alias('Twig_Node_Do', 'Twig\Node\DoNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Embed.php --- a/vendor/twig/twig/lib/Twig/Node/Embed.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Embed.php Thu May 09 15:33:08 2019 +0100 @@ -1,46 +1,11 @@ - */ -class Twig_Node_Embed extends Twig_Node_Include -{ - // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module) - public function __construct($name, $index, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) +class_exists('Twig\Node\EmbedNode'); + +if (\false) { + class Twig_Node_Embed extends EmbedNode { - parent::__construct(new Twig_Node_Expression_Constant('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag); - - $this->setAttribute('name', $name); - // to be removed in 2.0, used name instead - $this->setAttribute('filename', $name); - $this->setAttribute('index', $index); - } - - protected function addGetTemplate(Twig_Compiler $compiler) - { - $compiler - ->write('$this->loadTemplate(') - ->string($this->getAttribute('name')) - ->raw(', ') - ->repr($this->getTemplateName()) - ->raw(', ') - ->repr($this->getTemplateLine()) - ->raw(', ') - ->string($this->getAttribute('index')) - ->raw(')') - ; } } - -class_alias('Twig_Node_Embed', 'Twig\Node\EmbedNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression.php --- a/vendor/twig/twig/lib/Twig/Node/Expression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression.php Thu May 09 15:33:08 2019 +0100 @@ -1,22 +1,11 @@ - */ -abstract class Twig_Node_Expression extends Twig_Node -{ +class_exists('Twig\Node\Expression\AbstractExpression'); + +if (\false) { + class Twig_Node_Expression extends AbstractExpression + { + } } - -class_alias('Twig_Node_Expression', 'Twig\Node\Expression\AbstractExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Array.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Array.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Array.php Thu May 09 15:33:08 2019 +0100 @@ -1,83 +1,11 @@ index = -1; - foreach ($this->getKeyValuePairs() as $pair) { - if ($pair['key'] instanceof Twig_Node_Expression_Constant && ctype_digit((string) $pair['key']->getAttribute('value')) && $pair['key']->getAttribute('value') > $this->index) { - $this->index = $pair['key']->getAttribute('value'); - } - } - } - - public function getKeyValuePairs() - { - $pairs = []; - - foreach (array_chunk($this->nodes, 2) as $pair) { - $pairs[] = [ - 'key' => $pair[0], - 'value' => $pair[1], - ]; - } - - return $pairs; - } - - public function hasElement(Twig_Node_Expression $key) - { - foreach ($this->getKeyValuePairs() as $pair) { - // we compare the string representation of the keys - // to avoid comparing the line numbers which are not relevant here. - if ((string) $key === (string) $pair['key']) { - return true; - } - } - - return false; - } - - public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $key = null) - { - if (null === $key) { - $key = new Twig_Node_Expression_Constant(++$this->index, $value->getTemplateLine()); - } - - array_push($this->nodes, $key, $value); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->raw('['); - $first = true; - foreach ($this->getKeyValuePairs() as $pair) { - if (!$first) { - $compiler->raw(', '); - } - $first = false; - - $compiler - ->subcompile($pair['key']) - ->raw(' => ') - ->subcompile($pair['value']) - ; - } - $compiler->raw(']'); } } - -class_alias('Twig_Node_Expression_Array', 'Twig\Node\Expression\ArrayExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php Thu May 09 15:33:08 2019 +0100 @@ -1,25 +1,11 @@ raw('$context[') - ->string($this->getAttribute('name')) - ->raw(']') - ; } } - -class_alias('Twig_Node_Expression_AssignName', 'Twig\Node\Expression\AssignNameExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php Thu May 09 15:33:08 2019 +0100 @@ -1,37 +1,11 @@ $left, 'right' => $right], [], $lineno); } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->raw('(') - ->subcompile($this->getNode('left')) - ->raw(' ') - ; - $this->operator($compiler); - $compiler - ->raw(' ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - abstract public function operator(Twig_Compiler $compiler); } - -class_alias('Twig_Node_Expression_Binary', 'Twig\Node\Expression\Binary\AbstractBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('+'); } } - -class_alias('Twig_Node_Expression_Binary_Add', 'Twig\Node\Expression\Binary\AddBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('&&'); } } - -class_alias('Twig_Node_Expression_Binary_And', 'Twig\Node\Expression\Binary\AndBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('&'); } } - -class_alias('Twig_Node_Expression_Binary_BitwiseAnd', 'Twig\Node\Expression\Binary\BitwiseAndBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('|'); } } - -class_alias('Twig_Node_Expression_Binary_BitwiseOr', 'Twig\Node\Expression\Binary\BitwiseOrBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('^'); } } - -class_alias('Twig_Node_Expression_Binary_BitwiseXor', 'Twig\Node\Expression\Binary\BitwiseXorBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('.'); } } - -class_alias('Twig_Node_Expression_Binary_Concat', 'Twig\Node\Expression\Binary\ConcatBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('/'); } } - -class_alias('Twig_Node_Expression_Binary_Div', 'Twig\Node\Expression\Binary\DivBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php Thu May 09 15:33:08 2019 +0100 @@ -1,32 +1,11 @@ getVarName(); - $right = $compiler->getVarName(); - $compiler - ->raw(sprintf('(is_string($%s = ', $left)) - ->subcompile($this->getNode('left')) - ->raw(sprintf(') && is_string($%s = ', $right)) - ->subcompile($this->getNode('right')) - ->raw(sprintf(') && (\'\' === $%2$s || $%2$s === substr($%1$s, -strlen($%2$s))))', $left, $right)) - ; - } - - public function operator(Twig_Compiler $compiler) - { - return $compiler->raw(''); } } - -class_alias('Twig_Node_Expression_Binary_EndsWith', 'Twig\Node\Expression\Binary\EndsWithBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php Thu May 09 15:33:08 2019 +0100 @@ -1,19 +1,11 @@ raw('=='); } } - -class_alias('Twig_Node_Expression_Binary_Equal', 'Twig\Node\Expression\Binary\EqualBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php Thu May 09 15:33:08 2019 +0100 @@ -1,26 +1,11 @@ raw('(int) floor('); - parent::compile($compiler); - $compiler->raw(')'); - } - - public function operator(Twig_Compiler $compiler) - { - return $compiler->raw('/'); } } - -class_alias('Twig_Node_Expression_Binary_FloorDiv', 'Twig\Node\Expression\Binary\FloorDivBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php Thu May 09 15:33:08 2019 +0100 @@ -1,19 +1,11 @@ raw('>'); } } - -class_alias('Twig_Node_Expression_Binary_Greater', 'Twig\Node\Expression\Binary\GreaterBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php Thu May 09 15:33:08 2019 +0100 @@ -1,19 +1,11 @@ raw('>='); } } - -class_alias('Twig_Node_Expression_Binary_GreaterEqual', 'Twig\Node\Expression\Binary\GreaterEqualBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php Thu May 09 15:33:08 2019 +0100 @@ -1,30 +1,11 @@ raw('twig_in_filter(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Twig_Compiler $compiler) - { - return $compiler->raw('in'); } } - -class_alias('Twig_Node_Expression_Binary_In', 'Twig\Node\Expression\Binary\InBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php Thu May 09 15:33:08 2019 +0100 @@ -1,19 +1,11 @@ raw('<'); } } - -class_alias('Twig_Node_Expression_Binary_Less', 'Twig\Node\Expression\Binary\LessBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php Thu May 09 15:33:08 2019 +0100 @@ -1,19 +1,11 @@ raw('<='); } } - -class_alias('Twig_Node_Expression_Binary_LessEqual', 'Twig\Node\Expression\Binary\LessEqualBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php Thu May 09 15:33:08 2019 +0100 @@ -1,30 +1,11 @@ raw('preg_match(') - ->subcompile($this->getNode('right')) - ->raw(', ') - ->subcompile($this->getNode('left')) - ->raw(')') - ; - } - - public function operator(Twig_Compiler $compiler) - { - return $compiler->raw(''); } } - -class_alias('Twig_Node_Expression_Binary_Matches', 'Twig\Node\Expression\Binary\MatchesBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('%'); } } - -class_alias('Twig_Node_Expression_Binary_Mod', 'Twig\Node\Expression\Binary\ModBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('*'); } } - -class_alias('Twig_Node_Expression_Binary_Mul', 'Twig\Node\Expression\Binary\MulBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php Thu May 09 15:33:08 2019 +0100 @@ -1,19 +1,11 @@ raw('!='); } } - -class_alias('Twig_Node_Expression_Binary_NotEqual', 'Twig\Node\Expression\Binary\NotEqualBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php Thu May 09 15:33:08 2019 +0100 @@ -1,30 +1,11 @@ raw('!twig_in_filter(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Twig_Compiler $compiler) - { - return $compiler->raw('not in'); } } - -class_alias('Twig_Node_Expression_Binary_NotIn', 'Twig\Node\Expression\Binary\NotInBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('||'); } } - -class_alias('Twig_Node_Expression_Binary_Or', 'Twig\Node\Expression\Binary\OrBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php Thu May 09 15:33:08 2019 +0100 @@ -1,34 +1,11 @@ = 50600) { - return parent::compile($compiler); - } - - $compiler - ->raw('pow(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Twig_Compiler $compiler) - { - return $compiler->raw('**'); } } - -class_alias('Twig_Node_Expression_Binary_Power', 'Twig\Node\Expression\Binary\PowerBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php Thu May 09 15:33:08 2019 +0100 @@ -1,30 +1,11 @@ raw('range(') - ->subcompile($this->getNode('left')) - ->raw(', ') - ->subcompile($this->getNode('right')) - ->raw(')') - ; - } - - public function operator(Twig_Compiler $compiler) - { - return $compiler->raw('..'); } } - -class_alias('Twig_Node_Expression_Binary_Range', 'Twig\Node\Expression\Binary\RangeBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php Thu May 09 15:33:08 2019 +0100 @@ -1,32 +1,11 @@ getVarName(); - $right = $compiler->getVarName(); - $compiler - ->raw(sprintf('(is_string($%s = ', $left)) - ->subcompile($this->getNode('left')) - ->raw(sprintf(') && is_string($%s = ', $right)) - ->subcompile($this->getNode('right')) - ->raw(sprintf(') && (\'\' === $%2$s || 0 === strpos($%1$s, $%2$s)))', $left, $right)) - ; - } - - public function operator(Twig_Compiler $compiler) - { - return $compiler->raw(''); } } - -class_alias('Twig_Node_Expression_Binary_StartsWith', 'Twig\Node\Expression\Binary\StartsWithBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('-'); } } - -class_alias('Twig_Node_Expression_Binary_Sub', 'Twig\Node\Expression\Binary\SubBinary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php Thu May 09 15:33:08 2019 +0100 @@ -1,93 +1,11 @@ - */ -class Twig_Node_Expression_BlockReference extends Twig_Node_Expression -{ - /** - * @param Twig_Node|null $template - */ - public function __construct(Twig_NodeInterface $name, $template = null, $lineno, $tag = null) +class_exists('Twig\Node\Expression\BlockReferenceExpression'); + +if (\false) { + class Twig_Node_Expression_BlockReference extends BlockReferenceExpression { - if (is_bool($template)) { - @trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); - - $template = null; - } - - $nodes = ['name' => $name]; - if (null !== $template) { - $nodes['template'] = $template; - } - - parent::__construct($nodes, ['is_defined_test' => false, 'output' => false], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - if ($this->getAttribute('is_defined_test')) { - $this->compileTemplateCall($compiler, 'hasBlock'); - } else { - if ($this->getAttribute('output')) { - $compiler->addDebugInfo($this); - - $this - ->compileTemplateCall($compiler, 'displayBlock') - ->raw(";\n"); - } else { - $this->compileTemplateCall($compiler, 'renderBlock'); - } - } - } - - private function compileTemplateCall(Twig_Compiler $compiler, $method) - { - if (!$this->hasNode('template')) { - $compiler->write('$this'); - } else { - $compiler - ->write('$this->loadTemplate(') - ->subcompile($this->getNode('template')) - ->raw(', ') - ->repr($this->getTemplateName()) - ->raw(', ') - ->repr($this->getTemplateLine()) - ->raw(')') - ; - } - - $compiler->raw(sprintf('->%s', $method)); - $this->compileBlockArguments($compiler); - - return $compiler; - } - - private function compileBlockArguments(Twig_Compiler $compiler) - { - $compiler - ->raw('(') - ->subcompile($this->getNode('name')) - ->raw(', $context'); - - if (!$this->hasNode('template')) { - $compiler->raw(', $blocks'); - } - - return $compiler->raw(')'); } } - -class_alias('Twig_Node_Expression_BlockReference', 'Twig\Node\Expression\BlockReferenceExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Call.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Call.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Call.php Thu May 09 15:33:08 2019 +0100 @@ -1,293 +1,11 @@ hasAttribute('callable') && $callable = $this->getAttribute('callable')) { - if (is_string($callable) && false === strpos($callable, '::')) { - $compiler->raw($callable); - } else { - list($r, $callable) = $this->reflectCallable($callable); - if ($r instanceof ReflectionMethod && is_string($callable[0])) { - if ($r->isStatic()) { - $compiler->raw(sprintf('%s::%s', $callable[0], $callable[1])); - } else { - $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1])); - } - } elseif ($r instanceof ReflectionMethod && $callable[0] instanceof Twig_ExtensionInterface) { - $compiler->raw(sprintf('$this->env->getExtension(\'%s\')->%s', get_class($callable[0]), $callable[1])); - } else { - $type = ucfirst($this->getAttribute('type')); - $compiler->raw(sprintf('call_user_func_array($this->env->get%s(\'%s\')->getCallable(), ', $type, $this->getAttribute('name'))); - $closingParenthesis = true; - $isArray = true; - } - } - } else { - $compiler->raw($this->getAttribute('thing')->compile()); - } - - $this->compileArguments($compiler, $isArray); - - if ($closingParenthesis) { - $compiler->raw(')'); - } - } - - protected function compileArguments(Twig_Compiler $compiler, $isArray = false) - { - $compiler->raw($isArray ? '[' : '('); - - $first = true; - - if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { - $compiler->raw('$this->env'); - $first = false; - } - - if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { - if (!$first) { - $compiler->raw(', '); - } - $compiler->raw('$context'); - $first = false; - } - - if ($this->hasAttribute('arguments')) { - foreach ($this->getAttribute('arguments') as $argument) { - if (!$first) { - $compiler->raw(', '); - } - $compiler->string($argument); - $first = false; - } - } - - if ($this->hasNode('node')) { - if (!$first) { - $compiler->raw(', '); - } - $compiler->subcompile($this->getNode('node')); - $first = false; - } - - if ($this->hasNode('arguments')) { - $callable = $this->hasAttribute('callable') ? $this->getAttribute('callable') : null; - - $arguments = $this->getArguments($callable, $this->getNode('arguments')); - - foreach ($arguments as $node) { - if (!$first) { - $compiler->raw(', '); - } - $compiler->subcompile($node); - $first = false; - } - } - - $compiler->raw($isArray ? ']' : ')'); - } - - protected function getArguments($callable, $arguments) - { - $callType = $this->getAttribute('type'); - $callName = $this->getAttribute('name'); - - $parameters = []; - $named = false; - foreach ($arguments as $name => $node) { - if (!is_int($name)) { - $named = true; - $name = $this->normalizeName($name); - } elseif ($named) { - throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $callType, $callName), $this->getTemplateLine()); - } - - $parameters[$name] = $node; - } - - $isVariadic = $this->hasAttribute('is_variadic') && $this->getAttribute('is_variadic'); - if (!$named && !$isVariadic) { - return $parameters; - } - - if (!$callable) { - if ($named) { - $message = sprintf('Named arguments are not supported for %s "%s".', $callType, $callName); - } else { - $message = sprintf('Arbitrary positional arguments are not supported for %s "%s".', $callType, $callName); - } - - throw new LogicException($message); - } - - $callableParameters = $this->getCallableParameters($callable, $isVariadic); - $arguments = []; - $names = []; - $missingArguments = []; - $optionalArguments = []; - $pos = 0; - foreach ($callableParameters as $callableParameter) { - $names[] = $name = $this->normalizeName($callableParameter->name); - - if (array_key_exists($name, $parameters)) { - if (array_key_exists($pos, $parameters)) { - throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $callType, $callName), $this->getTemplateLine()); - } - - if (count($missingArguments)) { - throw new Twig_Error_Syntax(sprintf( - 'Argument "%s" could not be assigned for %s "%s(%s)" because it is mapped to an internal PHP function which cannot determine default value for optional argument%s "%s".', - $name, $callType, $callName, implode(', ', $names), count($missingArguments) > 1 ? 's' : '', implode('", "', $missingArguments) - ), $this->getTemplateLine()); - } - - $arguments = array_merge($arguments, $optionalArguments); - $arguments[] = $parameters[$name]; - unset($parameters[$name]); - $optionalArguments = []; - } elseif (array_key_exists($pos, $parameters)) { - $arguments = array_merge($arguments, $optionalArguments); - $arguments[] = $parameters[$pos]; - unset($parameters[$pos]); - $optionalArguments = []; - ++$pos; - } elseif ($callableParameter->isDefaultValueAvailable()) { - $optionalArguments[] = new Twig_Node_Expression_Constant($callableParameter->getDefaultValue(), -1); - } elseif ($callableParameter->isOptional()) { - if (empty($parameters)) { - break; - } else { - $missingArguments[] = $name; - } - } else { - throw new Twig_Error_Syntax(sprintf('Value for argument "%s" is required for %s "%s".', $name, $callType, $callName), $this->getTemplateLine()); - } - } - - if ($isVariadic) { - $arbitraryArguments = new Twig_Node_Expression_Array([], -1); - foreach ($parameters as $key => $value) { - if (is_int($key)) { - $arbitraryArguments->addElement($value); - } else { - $arbitraryArguments->addElement($value, new Twig_Node_Expression_Constant($key, -1)); - } - unset($parameters[$key]); - } - - if ($arbitraryArguments->count()) { - $arguments = array_merge($arguments, $optionalArguments); - $arguments[] = $arbitraryArguments; - } - } - - if (!empty($parameters)) { - $unknownParameter = null; - foreach ($parameters as $parameter) { - if ($parameter instanceof Twig_Node) { - $unknownParameter = $parameter; - break; - } - } - - throw new Twig_Error_Syntax(sprintf( - 'Unknown argument%s "%s" for %s "%s(%s)".', - count($parameters) > 1 ? 's' : '', implode('", "', array_keys($parameters)), $callType, $callName, implode(', ', $names) - ), $unknownParameter ? $unknownParameter->getTemplateLine() : $this->getTemplateLine()); - } - - return $arguments; - } - - protected function normalizeName($name) - { - return strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], ['\\1_\\2', '\\1_\\2'], $name)); - } - - private function getCallableParameters($callable, $isVariadic) - { - list($r) = $this->reflectCallable($callable); - if (null === $r) { - return []; - } - - $parameters = $r->getParameters(); - if ($this->hasNode('node')) { - array_shift($parameters); - } - if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { - array_shift($parameters); - } - if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { - array_shift($parameters); - } - if ($this->hasAttribute('arguments') && null !== $this->getAttribute('arguments')) { - foreach ($this->getAttribute('arguments') as $argument) { - array_shift($parameters); - } - } - if ($isVariadic) { - $argument = end($parameters); - if ($argument && $argument->isArray() && $argument->isDefaultValueAvailable() && [] === $argument->getDefaultValue()) { - array_pop($parameters); - } else { - $callableName = $r->name; - if ($r instanceof ReflectionMethod) { - $callableName = $r->getDeclaringClass()->name.'::'.$callableName; - } - - throw new LogicException(sprintf('The last parameter of "%s" for %s "%s" must be an array with default value, eg. "array $arg = []".', $callableName, $this->getAttribute('type'), $this->getAttribute('name'))); - } - } - - return $parameters; - } - - private function reflectCallable($callable) - { - if (null !== $this->reflector) { - return $this->reflector; - } - - if (is_array($callable)) { - if (!method_exists($callable[0], $callable[1])) { - // __call() - return [null, []]; - } - $r = new ReflectionMethod($callable[0], $callable[1]); - } elseif (is_object($callable) && !$callable instanceof Closure) { - $r = new ReflectionObject($callable); - $r = $r->getMethod('__invoke'); - $callable = [$callable, '__invoke']; - } elseif (is_string($callable) && false !== $pos = strpos($callable, '::')) { - $class = substr($callable, 0, $pos); - $method = substr($callable, $pos + 2); - if (!method_exists($class, $method)) { - // __staticCall() - return [null, []]; - } - $r = new ReflectionMethod($callable); - $callable = [$class, $method]; - } else { - $r = new ReflectionFunction($callable); - } - - return $this->reflector = [$r, $callable]; } } - -class_alias('Twig_Node_Expression_Call', 'Twig\Node\Expression\CallExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ $expr1, 'expr2' => $expr2, 'expr3' => $expr3], [], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->raw('((') - ->subcompile($this->getNode('expr1')) - ->raw(') ? (') - ->subcompile($this->getNode('expr2')) - ->raw(') : (') - ->subcompile($this->getNode('expr3')) - ->raw('))') - ; } } - -class_alias('Twig_Node_Expression_Conditional', 'Twig\Node\Expression\ConditionalExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Constant.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php Thu May 09 15:33:08 2019 +0100 @@ -1,25 +1,11 @@ $value], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->repr($this->getAttribute('value')); } } - -class_alias('Twig_Node_Expression_Constant', 'Twig\Node\Expression\ConstantExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php Thu May 09 15:33:08 2019 +0100 @@ -9,6 +9,9 @@ * file that was distributed with this source code. */ +use Twig\Compiler; +use Twig\Node\Expression\AbstractExpression; + @trigger_error('The Twig_Node_Expression_ExtensionReference class is deprecated since version 1.23 and will be removed in 2.0.', E_USER_DEPRECATED); /** @@ -18,14 +21,14 @@ * * @deprecated since 1.23 and will be removed in 2.0. */ -class Twig_Node_Expression_ExtensionReference extends Twig_Node_Expression +class Twig_Node_Expression_ExtensionReference extends AbstractExpression { public function __construct($name, $lineno, $tag = null) { parent::__construct([], ['name' => $name], $lineno, $tag); } - public function compile(Twig_Compiler $compiler) + public function compile(Compiler $compiler) { $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name'))); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Filter.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php Thu May 09 15:33:08 2019 +0100 @@ -1,41 +1,11 @@ $node, 'filter' => $filterName, 'arguments' => $arguments], [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $name = $this->getNode('filter')->getAttribute('value'); - $filter = $compiler->getEnvironment()->getFilter($name); - - $this->setAttribute('name', $name); - $this->setAttribute('type', 'filter'); - $this->setAttribute('thing', $filter); - $this->setAttribute('needs_environment', $filter->needsEnvironment()); - $this->setAttribute('needs_context', $filter->needsContext()); - $this->setAttribute('arguments', $filter->getArguments()); - if ($filter instanceof Twig_FilterCallableInterface || $filter instanceof Twig_SimpleFilter) { - $this->setAttribute('callable', $filter->getCallable()); - } - if ($filter instanceof Twig_SimpleFilter) { - $this->setAttribute('is_variadic', $filter->isVariadic()); - } - - $this->compileCallable($compiler); } } - -class_alias('Twig_Node_Expression_Filter', 'Twig\Node\Expression\FilterExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php Thu May 09 15:33:08 2019 +0100 @@ -1,45 +1,11 @@ - * {{ var.foo|default('foo item on var is not defined') }} - *
    - * - * @author Fabien Potencier - */ -class Twig_Node_Expression_Filter_Default extends Twig_Node_Expression_Filter -{ - public function __construct(Twig_NodeInterface $node, Twig_Node_Expression_Constant $filterName, Twig_NodeInterface $arguments, $lineno, $tag = null) +class_exists('Twig\Node\Expression\Filter\DefaultFilter'); + +if (\false) { + class Twig_Node_Expression_Filter_Default extends DefaultFilter { - $default = new Twig_Node_Expression_Filter($node, new Twig_Node_Expression_Constant('default', $node->getTemplateLine()), $arguments, $node->getTemplateLine()); - - if ('default' === $filterName->getAttribute('value') && ($node instanceof Twig_Node_Expression_Name || $node instanceof Twig_Node_Expression_GetAttr)) { - $test = new Twig_Node_Expression_Test_Defined(clone $node, 'defined', new Twig_Node(), $node->getTemplateLine()); - $false = count($arguments) ? $arguments->getNode(0) : new Twig_Node_Expression_Constant('', $node->getTemplateLine()); - - $node = new Twig_Node_Expression_Conditional($test, $default, $false, $node->getTemplateLine()); - } else { - $node = $default; - } - - parent::__construct($node, $filterName, $arguments, $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->subcompile($this->getNode('node')); } } - -class_alias('Twig_Node_Expression_Filter_Default', 'Twig\Node\Expression\Filter\DefaultFilter', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Function.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Function.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Function.php Thu May 09 15:33:08 2019 +0100 @@ -1,45 +1,11 @@ $arguments], ['name' => $name, 'is_defined_test' => false], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - $name = $this->getAttribute('name'); - $function = $compiler->getEnvironment()->getFunction($name); - - $this->setAttribute('name', $name); - $this->setAttribute('type', 'function'); - $this->setAttribute('thing', $function); - $this->setAttribute('needs_environment', $function->needsEnvironment()); - $this->setAttribute('needs_context', $function->needsContext()); - $this->setAttribute('arguments', $function->getArguments()); - if ($function instanceof Twig_FunctionCallableInterface || $function instanceof Twig_SimpleFunction) { - $callable = $function->getCallable(); - if ('constant' === $name && $this->getAttribute('is_defined_test')) { - $callable = 'twig_constant_is_defined'; - } - - $this->setAttribute('callable', $callable); - } - if ($function instanceof Twig_SimpleFunction) { - $this->setAttribute('is_variadic', $function->isVariadic()); - } - - $this->compileCallable($compiler); } } - -class_alias('Twig_Node_Expression_Function', 'Twig\Node\Expression\FunctionExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php Thu May 09 15:33:08 2019 +0100 @@ -1,74 +1,11 @@ $node, 'attribute' => $attribute]; - if (null !== $arguments) { - $nodes['arguments'] = $arguments; - } - - parent::__construct($nodes, ['type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - if ($this->getAttribute('disable_c_ext')) { - @trigger_error(sprintf('Using the "disable_c_ext" attribute on %s is deprecated since version 1.30 and will be removed in 2.0.', __CLASS__), E_USER_DEPRECATED); - } - - if (function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) { - $compiler->raw('twig_template_get_attributes($this, '); - } else { - $compiler->raw('$this->getAttribute('); - } - - if ($this->getAttribute('ignore_strict_check')) { - $this->getNode('node')->setAttribute('ignore_strict_check', true); - } - - $compiler->subcompile($this->getNode('node')); - - $compiler->raw(', ')->subcompile($this->getNode('attribute')); - - // only generate optional arguments when needed (to make generated code more readable) - $needFourth = $this->getAttribute('ignore_strict_check'); - $needThird = $needFourth || $this->getAttribute('is_defined_test'); - $needSecond = $needThird || Twig_Template::ANY_CALL !== $this->getAttribute('type'); - $needFirst = $needSecond || $this->hasNode('arguments'); - - if ($needFirst) { - if ($this->hasNode('arguments')) { - $compiler->raw(', ')->subcompile($this->getNode('arguments')); - } else { - $compiler->raw(', []'); - } - } - - if ($needSecond) { - $compiler->raw(', ')->repr($this->getAttribute('type')); - } - - if ($needThird) { - $compiler->raw(', ')->repr($this->getAttribute('is_defined_test')); - } - - if ($needFourth) { - $compiler->raw(', ')->repr($this->getAttribute('ignore_strict_check')); - } - - $compiler->raw(')'); } } - -class_alias('Twig_Node_Expression_GetAttr', 'Twig\Node\Expression\GetAttrExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php Thu May 09 15:33:08 2019 +0100 @@ -1,43 +1,11 @@ $node, 'arguments' => $arguments], ['method' => $method, 'safe' => false], $lineno); - - if ($node instanceof Twig_Node_Expression_Name) { - $node->setAttribute('always_defined', true); - } - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->subcompile($this->getNode('node')) - ->raw('->') - ->raw($this->getAttribute('method')) - ->raw('(') - ; - $first = true; - foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { - if (!$first) { - $compiler->raw(', '); - } - $first = false; - - $compiler->subcompile($pair['value']); - } - $compiler->raw(')'); } } - -class_alias('Twig_Node_Expression_MethodCall', 'Twig\Node\Expression\MethodCallExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Name.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Name.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Name.php Thu May 09 15:33:08 2019 +0100 @@ -1,107 +1,11 @@ '$this', - '_context' => '$context', - '_charset' => '$this->env->getCharset()', - ]; +use Twig\Node\Expression\NameExpression; - public function __construct($name, $lineno) +class_exists('Twig\Node\Expression\NameExpression'); + +if (\false) { + class Twig_Node_Expression_Name extends NameExpression { - parent::__construct([], ['name' => $name, 'is_defined_test' => false, 'ignore_strict_check' => false, 'always_defined' => false], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - $name = $this->getAttribute('name'); - - $compiler->addDebugInfo($this); - - if ($this->getAttribute('is_defined_test')) { - if ($this->isSpecial()) { - $compiler->repr(true); - } else { - $compiler - ->raw('(isset($context[') - ->string($name) - ->raw(']) || array_key_exists(') - ->string($name) - ->raw(', $context))'); - } - } elseif ($this->isSpecial()) { - $compiler->raw($this->specialVars[$name]); - } elseif ($this->getAttribute('always_defined')) { - $compiler - ->raw('$context[') - ->string($name) - ->raw(']') - ; - } else { - if (PHP_VERSION_ID >= 70000) { - // use PHP 7 null coalescing operator - $compiler - ->raw('($context[') - ->string($name) - ->raw('] ?? ') - ; - - if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { - $compiler->raw('null)'); - } else { - $compiler->raw('$this->getContext($context, ')->string($name)->raw('))'); - } - } elseif (PHP_VERSION_ID >= 50400) { - // PHP 5.4 ternary operator performance was optimized - $compiler - ->raw('(isset($context[') - ->string($name) - ->raw(']) ? $context[') - ->string($name) - ->raw('] : ') - ; - - if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { - $compiler->raw('null)'); - } else { - $compiler->raw('$this->getContext($context, ')->string($name)->raw('))'); - } - } else { - $compiler - ->raw('$this->getContext($context, ') - ->string($name) - ; - - if ($this->getAttribute('ignore_strict_check')) { - $compiler->raw(', true'); - } - - $compiler - ->raw(')') - ; - } - } - } - - public function isSpecial() - { - return isset($this->specialVars[$this->getAttribute('name')]); - } - - public function isSimple() - { - return !$this->isSpecial() && !$this->getAttribute('is_defined_test'); } } - -class_alias('Twig_Node_Expression_Name', 'Twig\Node\Expression\NameExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php Thu May 09 15:33:08 2019 +0100 @@ -1,48 +1,11 @@ getTemplateLine()), - new Twig_Node_Expression_Unary_Not(new Twig_Node_Expression_Test_Null($left, 'null', new Twig_Node(), $left->getTemplateLine()), $left->getTemplateLine()), - $left->getTemplateLine() - ); - - parent::__construct($test, $left, $right, $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - /* - * This optimizes only one case. PHP 7 also supports more complex expressions - * that can return null. So, for instance, if log is defined, log("foo") ?? "..." works, - * but log($a["foo"]) ?? "..." does not if $a["foo"] is not defined. More advanced - * cases might be implemented as an optimizer node visitor, but has not been done - * as benefits are probably not worth the added complexity. - */ - if (PHP_VERSION_ID >= 70000 && $this->getNode('expr2') instanceof Twig_Node_Expression_Name) { - $this->getNode('expr2')->setAttribute('always_defined', true); - $compiler - ->raw('((') - ->subcompile($this->getNode('expr2')) - ->raw(') ?? (') - ->subcompile($this->getNode('expr3')) - ->raw('))') - ; - } else { - parent::compile($compiler); - } } } - -class_alias('Twig_Node_Expression_NullCoalesce', 'Twig\Node\Expression\NullCoalesceExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Parent.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php Thu May 09 15:33:08 2019 +0100 @@ -1,44 +1,11 @@ - */ -class Twig_Node_Expression_Parent extends Twig_Node_Expression -{ - public function __construct($name, $lineno, $tag = null) +class_exists('Twig\Node\Expression\ParentExpression'); + +if (\false) { + class Twig_Node_Expression_Parent extends ParentExpression { - parent::__construct([], ['output' => false, 'name' => $name], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - if ($this->getAttribute('output')) { - $compiler - ->addDebugInfo($this) - ->write('$this->displayParentBlock(') - ->string($this->getAttribute('name')) - ->raw(", \$context, \$blocks);\n") - ; - } else { - $compiler - ->raw('$this->renderParentBlock(') - ->string($this->getAttribute('name')) - ->raw(', $context, $blocks)') - ; - } } } - -class_alias('Twig_Node_Expression_Parent', 'Twig\Node\Expression\ParentExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/TempName.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php Thu May 09 15:33:08 2019 +0100 @@ -1,28 +1,11 @@ $name], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->raw('$_') - ->raw($this->getAttribute('name')) - ->raw('_') - ; } } - -class_alias('Twig_Node_Expression_TempName', 'Twig\Node\Expression\TempNameExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Test.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test.php Thu May 09 15:33:08 2019 +0100 @@ -1,45 +1,11 @@ $node]; - if (null !== $arguments) { - $nodes['arguments'] = $arguments; - } - - parent::__construct($nodes, ['name' => $name], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - $name = $this->getAttribute('name'); - $test = $compiler->getEnvironment()->getTest($name); - - $this->setAttribute('name', $name); - $this->setAttribute('type', 'test'); - $this->setAttribute('thing', $test); - if ($test instanceof Twig_SimpleTest) { - $this->setAttribute('arguments', $test->getArguments()); - } - if ($test instanceof Twig_TestCallableInterface || $test instanceof Twig_SimpleTest) { - $this->setAttribute('callable', $test->getCallable()); - } - if ($test instanceof Twig_SimpleTest) { - $this->setAttribute('is_variadic', $test->isVariadic()); - } - - $this->compileCallable($compiler); } } - -class_alias('Twig_Node_Expression_Test', 'Twig\Node\Expression\TestExpression', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php Thu May 09 15:33:08 2019 +0100 @@ -1,48 +1,11 @@ - * {% if post.status is constant('Post::PUBLISHED') %} - * the status attribute is exactly the same as Post::PUBLISHED - * {% endif %} - * - * - * @author Fabien Potencier - */ -class Twig_Node_Expression_Test_Constant extends Twig_Node_Expression_Test -{ - public function compile(Twig_Compiler $compiler) +class_exists('Twig\Node\Expression\Test\ConstantTest'); + +if (\false) { + class Twig_Node_Expression_Test_Constant extends ConstantTest { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' === constant(') - ; - - if ($this->getNode('arguments')->hasNode(1)) { - $compiler - ->raw('get_class(') - ->subcompile($this->getNode('arguments')->getNode(1)) - ->raw(')."::".') - ; - } - - $compiler - ->subcompile($this->getNode('arguments')->getNode(0)) - ->raw('))') - ; } } - -class_alias('Twig_Node_Expression_Test_Constant', 'Twig\Node\Expression\Test\ConstantTest', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php Thu May 09 15:33:08 2019 +0100 @@ -1,61 +1,11 @@ - * {# defined works with variable names and variable attributes #} - * {% if foo is defined %} - * {# ... #} - * {% endif %} - * - * - * @author Fabien Potencier - */ -class Twig_Node_Expression_Test_Defined extends Twig_Node_Expression_Test -{ - public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno) +class_exists('Twig\Node\Expression\Test\DefinedTest'); + +if (\false) { + class Twig_Node_Expression_Test_Defined extends DefinedTest { - if ($node instanceof Twig_Node_Expression_Name) { - $node->setAttribute('is_defined_test', true); - } elseif ($node instanceof Twig_Node_Expression_GetAttr) { - $node->setAttribute('is_defined_test', true); - $this->changeIgnoreStrictCheck($node); - } elseif ($node instanceof Twig_Node_Expression_BlockReference) { - $node->setAttribute('is_defined_test', true); - } elseif ($node instanceof Twig_Node_Expression_Function && 'constant' === $node->getAttribute('name')) { - $node->setAttribute('is_defined_test', true); - } elseif ($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array) { - $node = new Twig_Node_Expression_Constant(true, $node->getTemplateLine()); - } else { - throw new Twig_Error_Syntax('The "defined" test only works with simple variables.', $this->getTemplateLine()); - } - - parent::__construct($node, $name, $arguments, $lineno); - } - - protected function changeIgnoreStrictCheck(Twig_Node_Expression_GetAttr $node) - { - $node->setAttribute('ignore_strict_check', true); - - if ($node->getNode('node') instanceof Twig_Node_Expression_GetAttr) { - $this->changeIgnoreStrictCheck($node->getNode('node')); - } - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->subcompile($this->getNode('node')); } } - -class_alias('Twig_Node_Expression_Test_Defined', 'Twig\Node\Expression\Test\DefinedTest', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php Thu May 09 15:33:08 2019 +0100 @@ -1,35 +1,11 @@ - * {% if loop.index is divisible by(3) %} - * - * - * @author Fabien Potencier - */ -class Twig_Node_Expression_Test_Divisibleby extends Twig_Node_Expression_Test -{ - public function compile(Twig_Compiler $compiler) +class_exists('Twig\Node\Expression\Test\DivisiblebyTest'); + +if (\false) { + class Twig_Node_Expression_Test_Divisibleby extends DivisiblebyTest { - $compiler - ->raw('(0 == ') - ->subcompile($this->getNode('node')) - ->raw(' % ') - ->subcompile($this->getNode('arguments')->getNode(0)) - ->raw(')') - ; } } - -class_alias('Twig_Node_Expression_Test_Divisibleby', 'Twig\Node\Expression\Test\DivisiblebyTest', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php Thu May 09 15:33:08 2019 +0100 @@ -1,34 +1,11 @@ - * {{ var is even }} - * - * - * @author Fabien Potencier - */ -class Twig_Node_Expression_Test_Even extends Twig_Node_Expression_Test -{ - public function compile(Twig_Compiler $compiler) +class_exists('Twig\Node\Expression\Test\EvenTest'); + +if (\false) { + class Twig_Node_Expression_Test_Even extends EvenTest { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' % 2 == 0') - ->raw(')') - ; } } - -class_alias('Twig_Node_Expression_Test_Even', 'Twig\Node\Expression\Test\EvenTest', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ - * {{ var is none }} - * - * - * @author Fabien Potencier - */ -class Twig_Node_Expression_Test_Null extends Twig_Node_Expression_Test -{ - public function compile(Twig_Compiler $compiler) +class_exists('Twig\Node\Expression\Test\NullTest'); + +if (\false) { + class Twig_Node_Expression_Test_Null extends NullTest { - $compiler - ->raw('(null === ') - ->subcompile($this->getNode('node')) - ->raw(')') - ; } } - -class_alias('Twig_Node_Expression_Test_Null', 'Twig\Node\Expression\Test\NullTest', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php Thu May 09 15:33:08 2019 +0100 @@ -1,34 +1,11 @@ - * {{ var is odd }} - * - * - * @author Fabien Potencier - */ -class Twig_Node_Expression_Test_Odd extends Twig_Node_Expression_Test -{ - public function compile(Twig_Compiler $compiler) +class_exists('Twig\Node\Expression\Test\OddTest'); + +if (\false) { + class Twig_Node_Expression_Test_Odd extends OddTest { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' % 2 == 1') - ->raw(')') - ; } } - -class_alias('Twig_Node_Expression_Test_Odd', 'Twig\Node\Expression\Test\OddTest', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php Thu May 09 15:33:08 2019 +0100 @@ -1,31 +1,11 @@ - */ -class Twig_Node_Expression_Test_Sameas extends Twig_Node_Expression_Test -{ - public function compile(Twig_Compiler $compiler) +class_exists('Twig\Node\Expression\Test\SameasTest'); + +if (\false) { + class Twig_Node_Expression_Test_Sameas extends SameasTest { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' === ') - ->subcompile($this->getNode('arguments')->getNode(0)) - ->raw(')') - ; } } - -class_alias('Twig_Node_Expression_Test_Sameas', 'Twig\Node\Expression\Test\SameasTest', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Unary.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php Thu May 09 15:33:08 2019 +0100 @@ -1,29 +1,11 @@ $node], [], $lineno); } - - public function compile(Twig_Compiler $compiler) - { - $compiler->raw(' '); - $this->operator($compiler); - $compiler->subcompile($this->getNode('node')); - } - - abstract public function operator(Twig_Compiler $compiler); } - -class_alias('Twig_Node_Expression_Unary', 'Twig\Node\Expression\Unary\AbstractUnary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('-'); } } - -class_alias('Twig_Node_Expression_Unary_Neg', 'Twig\Node\Expression\Unary\NegUnary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('!'); } } - -class_alias('Twig_Node_Expression_Unary_Not', 'Twig\Node\Expression\Unary\NotUnary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php Thu May 09 15:33:08 2019 +0100 @@ -1,20 +1,11 @@ raw('+'); } } - -class_alias('Twig_Node_Expression_Unary_Pos', 'Twig\Node\Expression\Unary\PosUnary', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Flush.php --- a/vendor/twig/twig/lib/Twig/Node/Flush.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Flush.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ - */ -class Twig_Node_Flush extends Twig_Node -{ - public function __construct($lineno, $tag) +class_exists('Twig\Node\FlushNode'); + +if (\false) { + class Twig_Node_Flush extends FlushNode { - parent::__construct([], [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write("flush();\n") - ; } } - -class_alias('Twig_Node_Flush', 'Twig\Node\FlushNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/For.php --- a/vendor/twig/twig/lib/Twig/Node/For.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/For.php Thu May 09 15:33:08 2019 +0100 @@ -1,113 +1,11 @@ - */ -class Twig_Node_For extends Twig_Node -{ - protected $loop; +class_exists('Twig\Node\ForNode'); - public function __construct(Twig_Node_Expression_AssignName $keyTarget, Twig_Node_Expression_AssignName $valueTarget, Twig_Node_Expression $seq, Twig_Node_Expression $ifexpr = null, Twig_NodeInterface $body, Twig_NodeInterface $else = null, $lineno, $tag = null) +if (\false) { + class Twig_Node_For extends ForNode { - $body = new Twig_Node([$body, $this->loop = new Twig_Node_ForLoop($lineno, $tag)]); - - if (null !== $ifexpr) { - $body = new Twig_Node_If(new Twig_Node([$ifexpr, $body]), null, $lineno, $tag); - } - - $nodes = ['key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body]; - if (null !== $else) { - $nodes['else'] = $else; - } - - parent::__construct($nodes, ['with_loop' => true, 'ifexpr' => null !== $ifexpr], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write("\$context['_parent'] = \$context;\n") - ->write("\$context['_seq'] = twig_ensure_traversable(") - ->subcompile($this->getNode('seq')) - ->raw(");\n") - ; - - if ($this->hasNode('else')) { - $compiler->write("\$context['_iterated'] = false;\n"); - } - - if ($this->getAttribute('with_loop')) { - $compiler - ->write("\$context['loop'] = [\n") - ->write(" 'parent' => \$context['_parent'],\n") - ->write(" 'index0' => 0,\n") - ->write(" 'index' => 1,\n") - ->write(" 'first' => true,\n") - ->write("];\n") - ; - - if (!$this->getAttribute('ifexpr')) { - $compiler - ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) {\n") - ->indent() - ->write("\$length = count(\$context['_seq']);\n") - ->write("\$context['loop']['revindex0'] = \$length - 1;\n") - ->write("\$context['loop']['revindex'] = \$length;\n") - ->write("\$context['loop']['length'] = \$length;\n") - ->write("\$context['loop']['last'] = 1 === \$length;\n") - ->outdent() - ->write("}\n") - ; - } - } - - $this->loop->setAttribute('else', $this->hasNode('else')); - $this->loop->setAttribute('with_loop', $this->getAttribute('with_loop')); - $this->loop->setAttribute('ifexpr', $this->getAttribute('ifexpr')); - - $compiler - ->write("foreach (\$context['_seq'] as ") - ->subcompile($this->getNode('key_target')) - ->raw(' => ') - ->subcompile($this->getNode('value_target')) - ->raw(") {\n") - ->indent() - ->subcompile($this->getNode('body')) - ->outdent() - ->write("}\n") - ; - - if ($this->hasNode('else')) { - $compiler - ->write("if (!\$context['_iterated']) {\n") - ->indent() - ->subcompile($this->getNode('else')) - ->outdent() - ->write("}\n") - ; - } - - $compiler->write("\$_parent = \$context['_parent'];\n"); - - // remove some "private" loop variables (needed for nested loops) - $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n"); - - // keep the values set in the inner context for variables defined in the outer context - $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n"); } } - -class_alias('Twig_Node_For', 'Twig\Node\ForNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/ForLoop.php --- a/vendor/twig/twig/lib/Twig/Node/ForLoop.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/ForLoop.php Thu May 09 15:33:08 2019 +0100 @@ -1,52 +1,11 @@ - */ -class Twig_Node_ForLoop extends Twig_Node -{ - public function __construct($lineno, $tag = null) +class_exists('Twig\Node\ForLoopNode'); + +if (\false) { + class Twig_Node_ForLoop extends ForLoopNode { - parent::__construct([], ['with_loop' => false, 'ifexpr' => false, 'else' => false], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - if ($this->getAttribute('else')) { - $compiler->write("\$context['_iterated'] = true;\n"); - } - - if ($this->getAttribute('with_loop')) { - $compiler - ->write("++\$context['loop']['index0'];\n") - ->write("++\$context['loop']['index'];\n") - ->write("\$context['loop']['first'] = false;\n") - ; - - if (!$this->getAttribute('ifexpr')) { - $compiler - ->write("if (isset(\$context['loop']['length'])) {\n") - ->indent() - ->write("--\$context['loop']['revindex0'];\n") - ->write("--\$context['loop']['revindex'];\n") - ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") - ->outdent() - ->write("}\n") - ; - } - } } } - -class_alias('Twig_Node_ForLoop', 'Twig\Node\ForLoopNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/If.php --- a/vendor/twig/twig/lib/Twig/Node/If.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/If.php Thu May 09 15:33:08 2019 +0100 @@ -1,68 +1,11 @@ - */ -class Twig_Node_If extends Twig_Node -{ - public function __construct(Twig_NodeInterface $tests, Twig_NodeInterface $else = null, $lineno, $tag = null) +class_exists('Twig\Node\IfNode'); + +if (\false) { + class Twig_Node_If extends IfNode { - $nodes = ['tests' => $tests]; - if (null !== $else) { - $nodes['else'] = $else; - } - - parent::__construct($nodes, [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - for ($i = 0, $count = count($this->getNode('tests')); $i < $count; $i += 2) { - if ($i > 0) { - $compiler - ->outdent() - ->write('} elseif (') - ; - } else { - $compiler - ->write('if (') - ; - } - - $compiler - ->subcompile($this->getNode('tests')->getNode($i)) - ->raw(") {\n") - ->indent() - ->subcompile($this->getNode('tests')->getNode($i + 1)) - ; - } - - if ($this->hasNode('else')) { - $compiler - ->outdent() - ->write("} else {\n") - ->indent() - ->subcompile($this->getNode('else')) - ; - } - - $compiler - ->outdent() - ->write("}\n"); } } - -class_alias('Twig_Node_If', 'Twig\Node\IfNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Import.php --- a/vendor/twig/twig/lib/Twig/Node/Import.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Import.php Thu May 09 15:33:08 2019 +0100 @@ -1,51 +1,11 @@ - */ -class Twig_Node_Import extends Twig_Node -{ - public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $var, $lineno, $tag = null) +class_exists('Twig\Node\ImportNode'); + +if (\false) { + class Twig_Node_Import extends ImportNode { - parent::__construct(['expr' => $expr, 'var' => $var], [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('') - ->subcompile($this->getNode('var')) - ->raw(' = ') - ; - - if ($this->getNode('expr') instanceof Twig_Node_Expression_Name && '_self' === $this->getNode('expr')->getAttribute('name')) { - $compiler->raw('$this'); - } else { - $compiler - ->raw('$this->loadTemplate(') - ->subcompile($this->getNode('expr')) - ->raw(', ') - ->repr($this->getTemplateName()) - ->raw(', ') - ->repr($this->getTemplateLine()) - ->raw(')') - ; - } - - $compiler->raw(";\n"); } } - -class_alias('Twig_Node_Import', 'Twig\Node\ImportNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Include.php --- a/vendor/twig/twig/lib/Twig/Node/Include.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Include.php Thu May 09 15:33:08 2019 +0100 @@ -1,90 +1,11 @@ - */ -class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface -{ - public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) +class_exists('Twig\Node\IncludeNode'); + +if (\false) { + class Twig_Node_Include extends IncludeNode { - $nodes = ['expr' => $expr]; - if (null !== $variables) { - $nodes['variables'] = $variables; - } - - parent::__construct($nodes, ['only' => (bool) $only, 'ignore_missing' => (bool) $ignoreMissing], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - - if ($this->getAttribute('ignore_missing')) { - $compiler - ->write("try {\n") - ->indent() - ; - } - - $this->addGetTemplate($compiler); - - $compiler->raw('->display('); - - $this->addTemplateArguments($compiler); - - $compiler->raw(");\n"); - - if ($this->getAttribute('ignore_missing')) { - $compiler - ->outdent() - ->write("} catch (Twig_Error_Loader \$e) {\n") - ->indent() - ->write("// ignore missing template\n") - ->outdent() - ->write("}\n\n") - ; - } - } - - protected function addGetTemplate(Twig_Compiler $compiler) - { - $compiler - ->write('$this->loadTemplate(') - ->subcompile($this->getNode('expr')) - ->raw(', ') - ->repr($this->getTemplateName()) - ->raw(', ') - ->repr($this->getTemplateLine()) - ->raw(')') - ; - } - - protected function addTemplateArguments(Twig_Compiler $compiler) - { - if (!$this->hasNode('variables')) { - $compiler->raw(false === $this->getAttribute('only') ? '$context' : '[]'); - } elseif (false === $this->getAttribute('only')) { - $compiler - ->raw('array_merge($context, ') - ->subcompile($this->getNode('variables')) - ->raw(')') - ; - } else { - $compiler->subcompile($this->getNode('variables')); - } } } - -class_alias('Twig_Node_Include', 'Twig\Node\IncludeNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Macro.php --- a/vendor/twig/twig/lib/Twig/Node/Macro.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Macro.php Thu May 09 15:33:08 2019 +0100 @@ -1,125 +1,11 @@ - */ -class Twig_Node_Macro extends Twig_Node -{ - const VARARGS_NAME = 'varargs'; +class_exists('Twig\Node\MacroNode'); - public function __construct($name, Twig_NodeInterface $body, Twig_NodeInterface $arguments, $lineno, $tag = null) +if (\false) { + class Twig_Node_Macro extends MacroNode { - foreach ($arguments as $argumentName => $argument) { - if (self::VARARGS_NAME === $argumentName) { - throw new Twig_Error_Syntax(sprintf('The argument "%s" in macro "%s" cannot be defined because the variable "%s" is reserved for arbitrary arguments.', self::VARARGS_NAME, $name, self::VARARGS_NAME), $argument->getTemplateLine()); - } - } - - parent::__construct(['body' => $body, 'arguments' => $arguments], ['name' => $name], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write(sprintf('public function get%s(', $this->getAttribute('name'))) - ; - - $count = count($this->getNode('arguments')); - $pos = 0; - foreach ($this->getNode('arguments') as $name => $default) { - $compiler - ->raw('$__'.$name.'__ = ') - ->subcompile($default) - ; - - if (++$pos < $count) { - $compiler->raw(', '); - } - } - - if (PHP_VERSION_ID >= 50600) { - if ($count) { - $compiler->raw(', '); - } - - $compiler->raw('...$__varargs__'); - } - - $compiler - ->raw(")\n") - ->write("{\n") - ->indent() - ; - - $compiler - ->write("\$context = \$this->env->mergeGlobals([\n") - ->indent() - ; - - foreach ($this->getNode('arguments') as $name => $default) { - $compiler - ->write('') - ->string($name) - ->raw(' => $__'.$name.'__') - ->raw(",\n") - ; - } - - $compiler - ->write('') - ->string(self::VARARGS_NAME) - ->raw(' => ') - ; - - if (PHP_VERSION_ID >= 50600) { - $compiler->raw("\$__varargs__,\n"); - } else { - $compiler - ->raw('func_num_args() > ') - ->repr($count) - ->raw(' ? array_slice(func_get_args(), ') - ->repr($count) - ->raw(") : [],\n") - ; - } - - $compiler - ->outdent() - ->write("]);\n\n") - ->write("\$blocks = [];\n\n") - ->write("ob_start();\n") - ->write("try {\n") - ->indent() - ->subcompile($this->getNode('body')) - ->outdent() - ->write("} catch (Exception \$e) {\n") - ->indent() - ->write("ob_end_clean();\n\n") - ->write("throw \$e;\n") - ->outdent() - ->write("} catch (Throwable \$e) {\n") - ->indent() - ->write("ob_end_clean();\n\n") - ->write("throw \$e;\n") - ->outdent() - ->write("}\n\n") - ->write("return ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset());\n") - ->outdent() - ->write("}\n\n") - ; } } - -class_alias('Twig_Node_Macro', 'Twig\Node\MacroNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Module.php --- a/vendor/twig/twig/lib/Twig/Node/Module.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Module.php Thu May 09 15:33:08 2019 +0100 @@ -1,466 +1,11 @@ - */ -class Twig_Node_Module extends Twig_Node -{ - private $source; +class_exists('Twig\Node\ModuleNode'); - public function __construct(Twig_NodeInterface $body, Twig_Node_Expression $parent = null, Twig_NodeInterface $blocks, Twig_NodeInterface $macros, Twig_NodeInterface $traits, $embeddedTemplates, $name, $source = '') +if (\false) { + class Twig_Node_Module extends ModuleNode { - if (!$name instanceof Twig_Source) { - @trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a Twig_Source instance instead.', __METHOD__), E_USER_DEPRECATED); - $this->source = new Twig_Source($source, $name); - } else { - $this->source = $name; - } - - $nodes = [ - 'body' => $body, - 'blocks' => $blocks, - 'macros' => $macros, - 'traits' => $traits, - 'display_start' => new Twig_Node(), - 'display_end' => new Twig_Node(), - 'constructor_start' => new Twig_Node(), - 'constructor_end' => new Twig_Node(), - 'class_end' => new Twig_Node(), - ]; - if (null !== $parent) { - $nodes['parent'] = $parent; - } - - // embedded templates are set as attributes so that they are only visited once by the visitors - parent::__construct($nodes, [ - // source to be remove in 2.0 - 'source' => $this->source->getCode(), - // filename to be remove in 2.0 (use getTemplateName() instead) - 'filename' => $this->source->getName(), - 'index' => null, - 'embedded_templates' => $embeddedTemplates, - ], 1); - - // populate the template name of all node children - $this->setTemplateName($this->source->getName()); - } - - public function setIndex($index) - { - $this->setAttribute('index', $index); - } - - public function compile(Twig_Compiler $compiler) - { - $this->compileTemplate($compiler); - - foreach ($this->getAttribute('embedded_templates') as $template) { - $compiler->subcompile($template); - } - } - - protected function compileTemplate(Twig_Compiler $compiler) - { - if (!$this->getAttribute('index')) { - $compiler->write('compileClassHeader($compiler); - - if ( - count($this->getNode('blocks')) - || count($this->getNode('traits')) - || !$this->hasNode('parent') - || $this->getNode('parent') instanceof Twig_Node_Expression_Constant - || count($this->getNode('constructor_start')) - || count($this->getNode('constructor_end')) - ) { - $this->compileConstructor($compiler); - } - - $this->compileGetParent($compiler); - - $this->compileDisplay($compiler); - - $compiler->subcompile($this->getNode('blocks')); - - $this->compileMacros($compiler); - - $this->compileGetTemplateName($compiler); - - $this->compileIsTraitable($compiler); - - $this->compileDebugInfo($compiler); - - $this->compileGetSource($compiler); - - $this->compileGetSourceContext($compiler); - - $this->compileClassFooter($compiler); - } - - protected function compileGetParent(Twig_Compiler $compiler) - { - if (!$this->hasNode('parent')) { - return; - } - $parent = $this->getNode('parent'); - - $compiler - ->write("protected function doGetParent(array \$context)\n", "{\n") - ->indent() - ->addDebugInfo($parent) - ->write('return ') - ; - - if ($parent instanceof Twig_Node_Expression_Constant) { - $compiler->subcompile($parent); - } else { - $compiler - ->raw('$this->loadTemplate(') - ->subcompile($parent) - ->raw(', ') - ->repr($this->source->getName()) - ->raw(', ') - ->repr($parent->getTemplateLine()) - ->raw(')') - ; - } - - $compiler - ->raw(";\n") - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileClassHeader(Twig_Compiler $compiler) - { - $compiler - ->write("\n\n") - // if the template name contains */, add a blank to avoid a PHP parse error - ->write('/* '.str_replace('*/', '* /', $this->source->getName())." */\n") - ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->source->getName(), $this->getAttribute('index'))) - ->raw(sprintf(" extends %s\n", $compiler->getEnvironment()->getBaseTemplateClass())) - ->write("{\n") - ->indent() - ; - } - - protected function compileConstructor(Twig_Compiler $compiler) - { - $compiler - ->write("public function __construct(Twig_Environment \$env)\n", "{\n") - ->indent() - ->subcompile($this->getNode('constructor_start')) - ->write("parent::__construct(\$env);\n\n") - ; - - // parent - if (!$this->hasNode('parent')) { - $compiler->write("\$this->parent = false;\n\n"); - } elseif (($parent = $this->getNode('parent')) && $parent instanceof Twig_Node_Expression_Constant) { - $compiler - ->addDebugInfo($parent) - ->write('$this->parent = $this->loadTemplate(') - ->subcompile($parent) - ->raw(', ') - ->repr($this->source->getName()) - ->raw(', ') - ->repr($parent->getTemplateLine()) - ->raw(");\n") - ; - } - - $countTraits = count($this->getNode('traits')); - if ($countTraits) { - // traits - foreach ($this->getNode('traits') as $i => $trait) { - $this->compileLoadTemplate($compiler, $trait->getNode('template'), sprintf('$_trait_%s', $i)); - - $compiler - ->addDebugInfo($trait->getNode('template')) - ->write(sprintf("if (!\$_trait_%s->isTraitable()) {\n", $i)) - ->indent() - ->write("throw new Twig_Error_Runtime('Template \"'.") - ->subcompile($trait->getNode('template')) - ->raw(".'\" cannot be used as a trait.');\n") - ->outdent() - ->write("}\n") - ->write(sprintf("\$_trait_%s_blocks = \$_trait_%s->getBlocks();\n\n", $i, $i)) - ; - - foreach ($trait->getNode('targets') as $key => $value) { - $compiler - ->write(sprintf('if (!isset($_trait_%s_blocks[', $i)) - ->string($key) - ->raw("])) {\n") - ->indent() - ->write("throw new Twig_Error_Runtime(sprintf('Block ") - ->string($key) - ->raw(' is not defined in trait ') - ->subcompile($trait->getNode('template')) - ->raw(".'));\n") - ->outdent() - ->write("}\n\n") - - ->write(sprintf('$_trait_%s_blocks[', $i)) - ->subcompile($value) - ->raw(sprintf('] = $_trait_%s_blocks[', $i)) - ->string($key) - ->raw(sprintf(']; unset($_trait_%s_blocks[', $i)) - ->string($key) - ->raw("]);\n\n") - ; - } - } - - if ($countTraits > 1) { - $compiler - ->write("\$this->traits = array_merge(\n") - ->indent() - ; - - for ($i = 0; $i < $countTraits; ++$i) { - $compiler - ->write(sprintf('$_trait_%s_blocks'.($i == $countTraits - 1 ? '' : ',')."\n", $i)) - ; - } - - $compiler - ->outdent() - ->write(");\n\n") - ; - } else { - $compiler - ->write("\$this->traits = \$_trait_0_blocks;\n\n") - ; - } - - $compiler - ->write("\$this->blocks = array_merge(\n") - ->indent() - ->write("\$this->traits,\n") - ->write("[\n") - ; - } else { - $compiler - ->write("\$this->blocks = [\n") - ; - } - - // blocks - $compiler - ->indent() - ; - - foreach ($this->getNode('blocks') as $name => $node) { - $compiler - ->write(sprintf("'%s' => [\$this, 'block_%s'],\n", $name, $name)) - ; - } - - if ($countTraits) { - $compiler - ->outdent() - ->write("]\n") - ->outdent() - ->write(");\n") - ; - } else { - $compiler - ->outdent() - ->write("];\n") - ; - } - - $compiler - ->outdent() - ->subcompile($this->getNode('constructor_end')) - ->write("}\n\n") - ; - } - - protected function compileDisplay(Twig_Compiler $compiler) - { - $compiler - ->write("protected function doDisplay(array \$context, array \$blocks = [])\n", "{\n") - ->indent() - ->subcompile($this->getNode('display_start')) - ->subcompile($this->getNode('body')) - ; - - if ($this->hasNode('parent')) { - $parent = $this->getNode('parent'); - $compiler->addDebugInfo($parent); - if ($parent instanceof Twig_Node_Expression_Constant) { - $compiler->write('$this->parent'); - } else { - $compiler->write('$this->getParent($context)'); - } - $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); - } - - $compiler - ->subcompile($this->getNode('display_end')) - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileClassFooter(Twig_Compiler $compiler) - { - $compiler - ->subcompile($this->getNode('class_end')) - ->outdent() - ->write("}\n") - ; - } - - protected function compileMacros(Twig_Compiler $compiler) - { - $compiler->subcompile($this->getNode('macros')); - } - - protected function compileGetTemplateName(Twig_Compiler $compiler) - { - $compiler - ->write("public function getTemplateName()\n", "{\n") - ->indent() - ->write('return ') - ->repr($this->source->getName()) - ->raw(";\n") - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileIsTraitable(Twig_Compiler $compiler) - { - // A template can be used as a trait if: - // * it has no parent - // * it has no macros - // * it has no body - // - // Put another way, a template can be used as a trait if it - // only contains blocks and use statements. - $traitable = !$this->hasNode('parent') && 0 === count($this->getNode('macros')); - if ($traitable) { - if ($this->getNode('body') instanceof Twig_Node_Body) { - $nodes = $this->getNode('body')->getNode(0); - } else { - $nodes = $this->getNode('body'); - } - - if (!count($nodes)) { - $nodes = new Twig_Node([$nodes]); - } - - foreach ($nodes as $node) { - if (!count($node)) { - continue; - } - - if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) { - continue; - } - - if ($node instanceof Twig_Node_BlockReference) { - continue; - } - - $traitable = false; - break; - } - } - - if ($traitable) { - return; - } - - $compiler - ->write("public function isTraitable()\n", "{\n") - ->indent() - ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false')) - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileDebugInfo(Twig_Compiler $compiler) - { - $compiler - ->write("public function getDebugInfo()\n", "{\n") - ->indent() - ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true)))) - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileGetSource(Twig_Compiler $compiler) - { - $compiler - ->write("/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */\n") - ->write("public function getSource()\n", "{\n") - ->indent() - ->write("@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);\n\n") - ->write('return $this->getSourceContext()->getCode();') - ->raw("\n") - ->outdent() - ->write("}\n\n") - ; - } - - protected function compileGetSourceContext(Twig_Compiler $compiler) - { - $compiler - ->write("public function getSourceContext()\n", "{\n") - ->indent() - ->write('return new Twig_Source(') - ->string($compiler->getEnvironment()->isDebug() ? $this->source->getCode() : '') - ->raw(', ') - ->string($this->source->getName()) - ->raw(', ') - ->string($this->source->getPath()) - ->raw(");\n") - ->outdent() - ->write("}\n") - ; - } - - protected function compileLoadTemplate(Twig_Compiler $compiler, $node, $var) - { - if ($node instanceof Twig_Node_Expression_Constant) { - $compiler - ->write(sprintf('%s = $this->loadTemplate(', $var)) - ->subcompile($node) - ->raw(', ') - ->repr($node->getTemplateName()) - ->raw(', ') - ->repr($node->getTemplateLine()) - ->raw(");\n") - ; - } else { - throw new LogicException('Trait templates can only be constant nodes.'); - } } } - -class_alias('Twig_Node_Module', 'Twig\Node\ModuleNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Print.php --- a/vendor/twig/twig/lib/Twig/Node/Print.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Print.php Thu May 09 15:33:08 2019 +0100 @@ -1,36 +1,11 @@ - */ -class Twig_Node_Print extends Twig_Node implements Twig_NodeOutputInterface -{ - public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) +class_exists('Twig\Node\PrintNode'); + +if (\false) { + class Twig_Node_Print extends PrintNode { - parent::__construct(['expr' => $expr], [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('echo ') - ->subcompile($this->getNode('expr')) - ->raw(";\n") - ; } } - -class_alias('Twig_Node_Print', 'Twig\Node\PrintNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Sandbox.php --- a/vendor/twig/twig/lib/Twig/Node/Sandbox.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Sandbox.php Thu May 09 15:33:08 2019 +0100 @@ -1,44 +1,11 @@ - */ -class Twig_Node_Sandbox extends Twig_Node -{ - public function __construct(Twig_NodeInterface $body, $lineno, $tag = null) +class_exists('Twig\Node\SandboxNode'); + +if (\false) { + class Twig_Node_Sandbox extends SandboxNode { - parent::__construct(['body' => $body], [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write("\$sandbox = \$this->env->getExtension('Twig_Extension_Sandbox');\n") - ->write("if (!\$alreadySandboxed = \$sandbox->isSandboxed()) {\n") - ->indent() - ->write("\$sandbox->enableSandbox();\n") - ->outdent() - ->write("}\n") - ->subcompile($this->getNode('body')) - ->write("if (!\$alreadySandboxed) {\n") - ->indent() - ->write("\$sandbox->disableSandbox();\n") - ->outdent() - ->write("}\n") - ; } } - -class_alias('Twig_Node_Sandbox', 'Twig\Node\SandboxNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php --- a/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php Thu May 09 15:33:08 2019 +0100 @@ -1,51 +1,11 @@ - */ -class Twig_Node_SandboxedPrint extends Twig_Node_Print -{ - public function compile(Twig_Compiler $compiler) +class_exists('Twig\Node\SandboxedPrintNode'); + +if (\false) { + class Twig_Node_SandboxedPrint extends SandboxedPrintNode { - $compiler - ->addDebugInfo($this) - ->write('echo $this->env->getExtension(\'Twig_Extension_Sandbox\')->ensureToStringAllowed(') - ->subcompile($this->getNode('expr')) - ->raw(");\n") - ; - } - - /** - * Removes node filters. - * - * This is mostly needed when another visitor adds filters (like the escaper one). - * - * @return Twig_Node - */ - protected function removeNodeFilter(Twig_Node $node) - { - if ($node instanceof Twig_Node_Expression_Filter) { - return $this->removeNodeFilter($node->getNode('node')); - } - - return $node; } } - -class_alias('Twig_Node_SandboxedPrint', 'Twig\Node\SandboxedPrintNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Set.php --- a/vendor/twig/twig/lib/Twig/Node/Set.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Set.php Thu May 09 15:33:08 2019 +0100 @@ -1,98 +1,11 @@ - */ -class Twig_Node_Set extends Twig_Node implements Twig_NodeCaptureInterface -{ - public function __construct($capture, Twig_NodeInterface $names, Twig_NodeInterface $values, $lineno, $tag = null) +class_exists('Twig\Node\SetNode'); + +if (\false) { + class Twig_Node_Set extends SetNode { - parent::__construct(['names' => $names, 'values' => $values], ['capture' => $capture, 'safe' => false], $lineno, $tag); - - /* - * Optimizes the node when capture is used for a large block of text. - * - * {% set foo %}foo{% endset %} is compiled to $context['foo'] = new Twig_Markup("foo"); - */ - if ($this->getAttribute('capture')) { - $this->setAttribute('safe', true); - - $values = $this->getNode('values'); - if ($values instanceof Twig_Node_Text) { - $this->setNode('values', new Twig_Node_Expression_Constant($values->getAttribute('data'), $values->getTemplateLine())); - $this->setAttribute('capture', false); - } - } - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - - if (count($this->getNode('names')) > 1) { - $compiler->write('list('); - foreach ($this->getNode('names') as $idx => $node) { - if ($idx) { - $compiler->raw(', '); - } - - $compiler->subcompile($node); - } - $compiler->raw(')'); - } else { - if ($this->getAttribute('capture')) { - $compiler - ->write("ob_start();\n") - ->subcompile($this->getNode('values')) - ; - } - - $compiler->subcompile($this->getNode('names'), false); - - if ($this->getAttribute('capture')) { - $compiler->raw(" = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())"); - } - } - - if (!$this->getAttribute('capture')) { - $compiler->raw(' = '); - - if (count($this->getNode('names')) > 1) { - $compiler->write('['); - foreach ($this->getNode('values') as $idx => $value) { - if ($idx) { - $compiler->raw(', '); - } - - $compiler->subcompile($value); - } - $compiler->raw(']'); - } else { - if ($this->getAttribute('safe')) { - $compiler - ->raw("('' === \$tmp = ") - ->subcompile($this->getNode('values')) - ->raw(") ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())") - ; - } else { - $compiler->subcompile($this->getNode('values')); - } - } - } - - $compiler->raw(";\n"); } } - -class_alias('Twig_Node_Set', 'Twig\Node\SetNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/SetTemp.php --- a/vendor/twig/twig/lib/Twig/Node/SetTemp.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/SetTemp.php Thu May 09 15:33:08 2019 +0100 @@ -1,40 +1,11 @@ $name], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - $name = $this->getAttribute('name'); - $compiler - ->addDebugInfo($this) - ->write('if (isset($context[') - ->string($name) - ->raw('])) { $_') - ->raw($name) - ->raw('_ = $context[') - ->repr($name) - ->raw(']; } else { $_') - ->raw($name) - ->raw("_ = null; }\n") - ; } } - -class_alias('Twig_Node_SetTemp', 'Twig\Node\SetTempNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Spaceless.php --- a/vendor/twig/twig/lib/Twig/Node/Spaceless.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Spaceless.php Thu May 09 15:33:08 2019 +0100 @@ -1,37 +1,11 @@ - */ -class Twig_Node_Spaceless extends Twig_Node -{ - public function __construct(Twig_NodeInterface $body, $lineno, $tag = 'spaceless') +class_exists('Twig\Node\SpacelessNode'); + +if (\false) { + class Twig_Node_Spaceless extends SpacelessNode { - parent::__construct(['body' => $body], [], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write("ob_start();\n") - ->subcompile($this->getNode('body')) - ->write("echo trim(preg_replace('/>\s+<', ob_get_clean()));\n") - ; } } - -class_alias('Twig_Node_Spaceless', 'Twig\Node\SpacelessNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/Text.php --- a/vendor/twig/twig/lib/Twig/Node/Text.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Text.php Thu May 09 15:33:08 2019 +0100 @@ -1,36 +1,11 @@ - */ -class Twig_Node_Text extends Twig_Node implements Twig_NodeOutputInterface -{ - public function __construct($data, $lineno) +class_exists('Twig\Node\TextNode'); + +if (\false) { + class Twig_Node_Text extends TextNode { - parent::__construct([], ['data' => $data], $lineno); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('echo ') - ->string($this->getAttribute('data')) - ->raw(";\n") - ; } } - -class_alias('Twig_Node_Text', 'Twig\Node\TextNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Node/With.php --- a/vendor/twig/twig/lib/Twig/Node/With.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/With.php Thu May 09 15:33:08 2019 +0100 @@ -1,64 +1,11 @@ - */ -class Twig_Node_With extends Twig_Node -{ - public function __construct(Twig_Node $body, Twig_Node $variables = null, $only = false, $lineno, $tag = null) +class_exists('Twig\Node\WithNode'); + +if (\false) { + class Twig_Node_With extends WithNode { - $nodes = ['body' => $body]; - if (null !== $variables) { - $nodes['variables'] = $variables; - } - - parent::__construct($nodes, ['only' => (bool) $only], $lineno, $tag); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - - if ($this->hasNode('variables')) { - $varsName = $compiler->getVarName(); - $compiler - ->write(sprintf('$%s = ', $varsName)) - ->subcompile($this->getNode('variables')) - ->raw(";\n") - ->write(sprintf("if (!is_array(\$%s)) {\n", $varsName)) - ->indent() - ->write("throw new Twig_Error_Runtime('Variables passed to the \"with\" tag must be a hash.');\n") - ->outdent() - ->write("}\n") - ; - - if ($this->getAttribute('only')) { - $compiler->write("\$context = ['_parent' => \$context];\n"); - } else { - $compiler->write("\$context['_parent'] = \$context;\n"); - } - - $compiler->write(sprintf("\$context = array_merge(\$context, \$%s);\n", $varsName)); - } else { - $compiler->write("\$context['_parent'] = \$context;\n"); - } - - $compiler - ->subcompile($this->getNode('body')) - ->write("\$context = \$context['_parent'];\n") - ; } } - -class_alias('Twig_Node_With', 'Twig\Node\WithNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeCaptureInterface.php --- a/vendor/twig/twig/lib/Twig/NodeCaptureInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeCaptureInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,21 +1,11 @@ - */ -interface Twig_NodeCaptureInterface -{ +class_exists('Twig\Node\NodeCaptureInterface'); + +if (\false) { + class Twig_NodeCaptureInterface extends NodeCaptureInterface + { + } } - -class_alias('Twig_NodeCaptureInterface', 'Twig\Node\NodeCaptureInterface', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeInterface.php --- a/vendor/twig/twig/lib/Twig/NodeInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeInterface.php Thu May 09 15:33:08 2019 +0100 @@ -9,6 +9,8 @@ * file that was distributed with this source code. */ +use Twig\Compiler; + /** * Represents a node in the AST. * @@ -16,12 +18,12 @@ * * @deprecated since 1.12 (to be removed in 3.0) */ -interface Twig_NodeInterface extends Countable, IteratorAggregate +interface Twig_NodeInterface extends \Countable, \IteratorAggregate { /** * Compiles the node to PHP. */ - public function compile(Twig_Compiler $compiler); + public function compile(Compiler $compiler); /** * @deprecated since 1.27 (to be removed in 2.0) diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeOutputInterface.php --- a/vendor/twig/twig/lib/Twig/NodeOutputInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeOutputInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,21 +1,11 @@ - */ -interface Twig_NodeOutputInterface -{ +class_exists('Twig\Node\NodeOutputInterface'); + +if (\false) { + class Twig_NodeOutputInterface extends NodeOutputInterface + { + } } - -class_alias('Twig_NodeOutputInterface', 'Twig\Node\NodeOutputInterface', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeTraverser.php --- a/vendor/twig/twig/lib/Twig/NodeTraverser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeTraverser.php Thu May 09 15:33:08 2019 +0100 @@ -1,86 +1,11 @@ - */ -class Twig_NodeTraverser -{ - protected $env; - protected $visitors = []; +class_exists('Twig\NodeTraverser'); - /** - * @param Twig_Environment $env - * @param Twig_NodeVisitorInterface[] $visitors - */ - public function __construct(Twig_Environment $env, array $visitors = []) +if (\false) { + class Twig_NodeTraverser extends NodeTraverser { - $this->env = $env; - foreach ($visitors as $visitor) { - $this->addVisitor($visitor); - } - } - - public function addVisitor(Twig_NodeVisitorInterface $visitor) - { - if (!isset($this->visitors[$visitor->getPriority()])) { - $this->visitors[$visitor->getPriority()] = []; - } - - $this->visitors[$visitor->getPriority()][] = $visitor; - } - - /** - * Traverses a node and calls the registered visitors. - * - * @return Twig_NodeInterface - */ - public function traverse(Twig_NodeInterface $node) - { - ksort($this->visitors); - foreach ($this->visitors as $visitors) { - foreach ($visitors as $visitor) { - $node = $this->traverseForVisitor($visitor, $node); - } - } - - return $node; - } - - protected function traverseForVisitor(Twig_NodeVisitorInterface $visitor, Twig_NodeInterface $node = null) - { - if (null === $node) { - return; - } - - $node = $visitor->enterNode($node, $this->env); - - foreach ($node as $k => $n) { - if (false !== $m = $this->traverseForVisitor($visitor, $n)) { - if ($m !== $n) { - $node->setNode($k, $m); - } - } else { - $node->removeNode($k); - } - } - - return $visitor->leaveNode($node, $this->env); } } - -class_alias('Twig_NodeTraverser', 'Twig\NodeTraverser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php --- a/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php Thu May 09 15:33:08 2019 +0100 @@ -1,154 +1,11 @@ - */ -class Twig_NodeVisitor_Escaper extends Twig_BaseNodeVisitor -{ - protected $statusStack = []; - protected $blocks = []; - protected $safeAnalysis; - protected $traverser; - protected $defaultStrategy = false; - protected $safeVars = []; +class_exists('Twig\NodeVisitor\EscaperNodeVisitor'); - public function __construct() +if (\false) { + class Twig_NodeVisitor_Escaper extends EscaperNodeVisitor { - $this->safeAnalysis = new Twig_NodeVisitor_SafeAnalysis(); - } - - protected function doEnterNode(Twig_Node $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_Module) { - if ($env->hasExtension('Twig_Extension_Escaper') && $defaultStrategy = $env->getExtension('Twig_Extension_Escaper')->getDefaultStrategy($node->getTemplateName())) { - $this->defaultStrategy = $defaultStrategy; - } - $this->safeVars = []; - $this->blocks = []; - } elseif ($node instanceof Twig_Node_AutoEscape) { - $this->statusStack[] = $node->getAttribute('value'); - } elseif ($node instanceof Twig_Node_Block) { - $this->statusStack[] = isset($this->blocks[$node->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env); - } elseif ($node instanceof Twig_Node_Import) { - $this->safeVars[] = $node->getNode('var')->getAttribute('name'); - } - - return $node; - } - - protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_Module) { - $this->defaultStrategy = false; - $this->safeVars = []; - $this->blocks = []; - } elseif ($node instanceof Twig_Node_Expression_Filter) { - return $this->preEscapeFilterNode($node, $env); - } elseif ($node instanceof Twig_Node_Print) { - return $this->escapePrintNode($node, $env, $this->needEscaping($env)); - } - - if ($node instanceof Twig_Node_AutoEscape || $node instanceof Twig_Node_Block) { - array_pop($this->statusStack); - } elseif ($node instanceof Twig_Node_BlockReference) { - $this->blocks[$node->getAttribute('name')] = $this->needEscaping($env); - } - - return $node; - } - - protected function escapePrintNode(Twig_Node_Print $node, Twig_Environment $env, $type) - { - if (false === $type) { - return $node; - } - - $expression = $node->getNode('expr'); - - if ($this->isSafeFor($type, $expression, $env)) { - return $node; - } - - $class = get_class($node); - - return new $class( - $this->getEscaperFilter($type, $expression), - $node->getTemplateLine() - ); - } - - protected function preEscapeFilterNode(Twig_Node_Expression_Filter $filter, Twig_Environment $env) - { - $name = $filter->getNode('filter')->getAttribute('value'); - - $type = $env->getFilter($name)->getPreEscape(); - if (null === $type) { - return $filter; - } - - $node = $filter->getNode('node'); - if ($this->isSafeFor($type, $node, $env)) { - return $filter; - } - - $filter->setNode('node', $this->getEscaperFilter($type, $node)); - - return $filter; - } - - protected function isSafeFor($type, Twig_NodeInterface $expression, $env) - { - $safe = $this->safeAnalysis->getSafe($expression); - - if (null === $safe) { - if (null === $this->traverser) { - $this->traverser = new Twig_NodeTraverser($env, [$this->safeAnalysis]); - } - - $this->safeAnalysis->setSafeVars($this->safeVars); - - $this->traverser->traverse($expression); - $safe = $this->safeAnalysis->getSafe($expression); - } - - return in_array($type, $safe) || in_array('all', $safe); - } - - protected function needEscaping(Twig_Environment $env) - { - if (count($this->statusStack)) { - return $this->statusStack[count($this->statusStack) - 1]; - } - - return $this->defaultStrategy ? $this->defaultStrategy : false; - } - - protected function getEscaperFilter($type, Twig_NodeInterface $node) - { - $line = $node->getTemplateLine(); - $name = new Twig_Node_Expression_Constant('escape', $line); - $args = new Twig_Node([new Twig_Node_Expression_Constant((string) $type, $line), new Twig_Node_Expression_Constant(null, $line), new Twig_Node_Expression_Constant(true, $line)]); - - return new Twig_Node_Expression_Filter($node, $name, $args, $line); - } - - public function getPriority() - { - return 0; } } - -class_alias('Twig_NodeVisitor_Escaper', 'Twig\NodeVisitor\EscaperNodeVisitor', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php --- a/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php Thu May 09 15:33:08 2019 +0100 @@ -1,253 +1,11 @@ - */ -class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor -{ - const OPTIMIZE_ALL = -1; - const OPTIMIZE_NONE = 0; - const OPTIMIZE_FOR = 2; - const OPTIMIZE_RAW_FILTER = 4; - const OPTIMIZE_VAR_ACCESS = 8; +class_exists('Twig\NodeVisitor\OptimizerNodeVisitor'); - protected $loops = []; - protected $loopsTargets = []; - protected $optimizers; - protected $prependedNodes = []; - protected $inABody = false; - - /** - * @param int $optimizers The optimizer mode - */ - public function __construct($optimizers = -1) +if (\false) { + class Twig_NodeVisitor_Optimizer extends OptimizerNodeVisitor { - if (!is_int($optimizers) || $optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER | self::OPTIMIZE_VAR_ACCESS)) { - throw new InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers)); - } - - $this->optimizers = $optimizers; - } - - protected function doEnterNode(Twig_Node $node, Twig_Environment $env) - { - if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { - $this->enterOptimizeFor($node, $env); - } - - if (PHP_VERSION_ID < 50400 && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('Twig_Extension_Sandbox')) { - if ($this->inABody) { - if (!$node instanceof Twig_Node_Expression) { - if ('Twig_Node' !== get_class($node)) { - array_unshift($this->prependedNodes, []); - } - } else { - $node = $this->optimizeVariables($node, $env); - } - } elseif ($node instanceof Twig_Node_Body) { - $this->inABody = true; - } - } - - return $node; - } - - protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) - { - $expression = $node instanceof Twig_Node_Expression; - - if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { - $this->leaveOptimizeFor($node, $env); - } - - if (self::OPTIMIZE_RAW_FILTER === (self::OPTIMIZE_RAW_FILTER & $this->optimizers)) { - $node = $this->optimizeRawFilter($node, $env); - } - - $node = $this->optimizePrintNode($node, $env); - - if (self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('Twig_Extension_Sandbox')) { - if ($node instanceof Twig_Node_Body) { - $this->inABody = false; - } elseif ($this->inABody) { - if (!$expression && 'Twig_Node' !== get_class($node) && $prependedNodes = array_shift($this->prependedNodes)) { - $nodes = []; - foreach (array_unique($prependedNodes) as $name) { - $nodes[] = new Twig_Node_SetTemp($name, $node->getTemplateLine()); - } - - $nodes[] = $node; - $node = new Twig_Node($nodes); - } - } - } - - return $node; - } - - protected function optimizeVariables(Twig_NodeInterface $node, Twig_Environment $env) - { - if ('Twig_Node_Expression_Name' === get_class($node) && $node->isSimple()) { - $this->prependedNodes[0][] = $node->getAttribute('name'); - - return new Twig_Node_Expression_TempName($node->getAttribute('name'), $node->getTemplateLine()); - } - - return $node; - } - - /** - * Optimizes print nodes. - * - * It replaces: - * - * * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()" - * - * @return Twig_NodeInterface - */ - protected function optimizePrintNode(Twig_NodeInterface $node, Twig_Environment $env) - { - if (!$node instanceof Twig_Node_Print) { - return $node; - } - - $exprNode = $node->getNode('expr'); - if ( - $exprNode instanceof Twig_Node_Expression_BlockReference || - $exprNode instanceof Twig_Node_Expression_Parent - ) { - $exprNode->setAttribute('output', true); - - return $exprNode; - } - - return $node; - } - - /** - * Removes "raw" filters. - * - * @return Twig_NodeInterface - */ - protected function optimizeRawFilter(Twig_NodeInterface $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_Expression_Filter && 'raw' == $node->getNode('filter')->getAttribute('value')) { - return $node->getNode('node'); - } - - return $node; - } - - /** - * Optimizes "for" tag by removing the "loop" variable creation whenever possible. - */ - protected function enterOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_For) { - // disable the loop variable by default - $node->setAttribute('with_loop', false); - array_unshift($this->loops, $node); - array_unshift($this->loopsTargets, $node->getNode('value_target')->getAttribute('name')); - array_unshift($this->loopsTargets, $node->getNode('key_target')->getAttribute('name')); - } elseif (!$this->loops) { - // we are outside a loop - return; - } - - // when do we need to add the loop variable back? - - // the loop variable is referenced for the current loop - elseif ($node instanceof Twig_Node_Expression_Name && 'loop' === $node->getAttribute('name')) { - $node->setAttribute('always_defined', true); - $this->addLoopToCurrent(); - } - - // optimize access to loop targets - elseif ($node instanceof Twig_Node_Expression_Name && in_array($node->getAttribute('name'), $this->loopsTargets)) { - $node->setAttribute('always_defined', true); - } - - // block reference - elseif ($node instanceof Twig_Node_BlockReference || $node instanceof Twig_Node_Expression_BlockReference) { - $this->addLoopToCurrent(); - } - - // include without the only attribute - elseif ($node instanceof Twig_Node_Include && !$node->getAttribute('only')) { - $this->addLoopToAll(); - } - - // include function without the with_context=false parameter - elseif ($node instanceof Twig_Node_Expression_Function - && 'include' === $node->getAttribute('name') - && (!$node->getNode('arguments')->hasNode('with_context') - || false !== $node->getNode('arguments')->getNode('with_context')->getAttribute('value') - ) - ) { - $this->addLoopToAll(); - } - - // the loop variable is referenced via an attribute - elseif ($node instanceof Twig_Node_Expression_GetAttr - && (!$node->getNode('attribute') instanceof Twig_Node_Expression_Constant - || 'parent' === $node->getNode('attribute')->getAttribute('value') - ) - && (true === $this->loops[0]->getAttribute('with_loop') - || ($node->getNode('node') instanceof Twig_Node_Expression_Name - && 'loop' === $node->getNode('node')->getAttribute('name') - ) - ) - ) { - $this->addLoopToAll(); - } - } - - /** - * Optimizes "for" tag by removing the "loop" variable creation whenever possible. - */ - protected function leaveOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_For) { - array_shift($this->loops); - array_shift($this->loopsTargets); - array_shift($this->loopsTargets); - } - } - - protected function addLoopToCurrent() - { - $this->loops[0]->setAttribute('with_loop', true); - } - - protected function addLoopToAll() - { - foreach ($this->loops as $loop) { - $loop->setAttribute('with_loop', true); - } - } - - public function getPriority() - { - return 255; } } - -class_alias('Twig_NodeVisitor_Optimizer', 'Twig\NodeVisitor\OptimizerNodeVisitor', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php --- a/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php Thu May 09 15:33:08 2019 +0100 @@ -1,150 +1,11 @@ safeVars = $safeVars; - } - - public function getSafe(Twig_NodeInterface $node) - { - $hash = spl_object_hash($node); - if (!isset($this->data[$hash])) { - return; - } - - foreach ($this->data[$hash] as $bucket) { - if ($bucket['key'] !== $node) { - continue; - } - - if (in_array('html_attr', $bucket['value'])) { - $bucket['value'][] = 'html'; - } - - return $bucket['value']; - } - } - - protected function setSafe(Twig_NodeInterface $node, array $safe) - { - $hash = spl_object_hash($node); - if (isset($this->data[$hash])) { - foreach ($this->data[$hash] as &$bucket) { - if ($bucket['key'] === $node) { - $bucket['value'] = $safe; - - return; - } - } - } - $this->data[$hash][] = [ - 'key' => $node, - 'value' => $safe, - ]; - } - - protected function doEnterNode(Twig_Node $node, Twig_Environment $env) - { - return $node; - } - - protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_Expression_Constant) { - // constants are marked safe for all - $this->setSafe($node, ['all']); - } elseif ($node instanceof Twig_Node_Expression_BlockReference) { - // blocks are safe by definition - $this->setSafe($node, ['all']); - } elseif ($node instanceof Twig_Node_Expression_Parent) { - // parent block is safe by definition - $this->setSafe($node, ['all']); - } elseif ($node instanceof Twig_Node_Expression_Conditional) { - // intersect safeness of both operands - $safe = $this->intersectSafe($this->getSafe($node->getNode('expr2')), $this->getSafe($node->getNode('expr3'))); - $this->setSafe($node, $safe); - } elseif ($node instanceof Twig_Node_Expression_Filter) { - // filter expression is safe when the filter is safe - $name = $node->getNode('filter')->getAttribute('value'); - $args = $node->getNode('arguments'); - if (false !== $filter = $env->getFilter($name)) { - $safe = $filter->getSafe($args); - if (null === $safe) { - $safe = $this->intersectSafe($this->getSafe($node->getNode('node')), $filter->getPreservesSafety()); - } - $this->setSafe($node, $safe); - } else { - $this->setSafe($node, []); - } - } elseif ($node instanceof Twig_Node_Expression_Function) { - // function expression is safe when the function is safe - $name = $node->getAttribute('name'); - $args = $node->getNode('arguments'); - $function = $env->getFunction($name); - if (false !== $function) { - $this->setSafe($node, $function->getSafe($args)); - } else { - $this->setSafe($node, []); - } - } elseif ($node instanceof Twig_Node_Expression_MethodCall) { - if ($node->getAttribute('safe')) { - $this->setSafe($node, ['all']); - } else { - $this->setSafe($node, []); - } - } elseif ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name) { - $name = $node->getNode('node')->getAttribute('name'); - // attributes on template instances are safe - if ('_self' == $name || in_array($name, $this->safeVars)) { - $this->setSafe($node, ['all']); - } else { - $this->setSafe($node, []); - } - } else { - $this->setSafe($node, []); - } - - return $node; - } - - protected function intersectSafe(array $a = null, array $b = null) - { - if (null === $a || null === $b) { - return []; - } - - if (in_array('all', $a)) { - return $b; - } - - if (in_array('all', $b)) { - return $a; - } - - return array_intersect($a, $b); - } - - public function getPriority() - { - return 0; } } - -class_alias('Twig_NodeVisitor_SafeAnalysis', 'Twig\NodeVisitor\SafeAnalysisNodeVisitor', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php --- a/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php Thu May 09 15:33:08 2019 +0100 @@ -1,82 +1,11 @@ - */ -class Twig_NodeVisitor_Sandbox extends Twig_BaseNodeVisitor -{ - protected $inAModule = false; - protected $tags; - protected $filters; - protected $functions; +class_exists('Twig\NodeVisitor\SandboxNodeVisitor'); - protected function doEnterNode(Twig_Node $node, Twig_Environment $env) +if (\false) { + class Twig_NodeVisitor_Sandbox extends SandboxNodeVisitor { - if ($node instanceof Twig_Node_Module) { - $this->inAModule = true; - $this->tags = []; - $this->filters = []; - $this->functions = []; - - return $node; - } elseif ($this->inAModule) { - // look for tags - if ($node->getNodeTag() && !isset($this->tags[$node->getNodeTag()])) { - $this->tags[$node->getNodeTag()] = $node; - } - - // look for filters - if ($node instanceof Twig_Node_Expression_Filter && !isset($this->filters[$node->getNode('filter')->getAttribute('value')])) { - $this->filters[$node->getNode('filter')->getAttribute('value')] = $node; - } - - // look for functions - if ($node instanceof Twig_Node_Expression_Function && !isset($this->functions[$node->getAttribute('name')])) { - $this->functions[$node->getAttribute('name')] = $node; - } - - // the .. operator is equivalent to the range() function - if ($node instanceof Twig_Node_Expression_Binary_Range && !isset($this->functions['range'])) { - $this->functions['range'] = $node; - } - - // wrap print to check __toString() calls - if ($node instanceof Twig_Node_Print) { - return new Twig_Node_SandboxedPrint($node->getNode('expr'), $node->getTemplateLine(), $node->getNodeTag()); - } - } - - return $node; - } - - protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_Module) { - $this->inAModule = false; - - $node->setNode('display_start', new Twig_Node([new Twig_Node_CheckSecurity($this->filters, $this->tags, $this->functions), $node->getNode('display_start')])); - } - - return $node; - } - - public function getPriority() - { - return 0; } } - -class_alias('Twig_NodeVisitor_Sandbox', 'Twig\NodeVisitor\SandboxNodeVisitor', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/NodeVisitorInterface.php --- a/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,45 +1,11 @@ - */ -interface Twig_NodeVisitorInterface -{ - /** - * Called before child nodes are visited. - * - * @return Twig_NodeInterface The modified node - */ - public function enterNode(Twig_NodeInterface $node, Twig_Environment $env); +class_exists('Twig\NodeVisitor\NodeVisitorInterface'); - /** - * Called after child nodes are visited. - * - * @return Twig_NodeInterface|false The modified node or false if the node must be removed - */ - public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env); - - /** - * Returns the priority for this visitor. - * - * Priority should be between -10 and 10 (0 is the default). - * - * @return int The priority level - */ - public function getPriority(); +if (\false) { + class Twig_NodeVisitorInterface extends NodeVisitorInterface + { + } } - -class_alias('Twig_NodeVisitorInterface', 'Twig\NodeVisitor\NodeVisitorInterface', false); -class_exists('Twig_Environment'); -class_exists('Twig_Node'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Parser.php --- a/vendor/twig/twig/lib/Twig/Parser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Parser.php Thu May 09 15:33:08 2019 +0100 @@ -1,416 +1,11 @@ - */ -class Twig_Parser implements Twig_ParserInterface -{ - protected $stack = []; - protected $stream; - protected $parent; - protected $handlers; - protected $visitors; - protected $expressionParser; - protected $blocks; - protected $blockStack; - protected $macros; - protected $env; - protected $reservedMacroNames; - protected $importedSymbols; - protected $traits; - protected $embeddedTemplates = []; - private $varNameSalt = 0; +class_exists('Twig\Parser'); - public function __construct(Twig_Environment $env) +if (\false) { + class Twig_Parser extends Parser { - $this->env = $env; - } - - /** - * @deprecated since 1.27 (to be removed in 2.0) - */ - public function getEnvironment() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); - - return $this->env; - } - - public function getVarName() - { - return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->stream->getSourceContext()->getCode().$this->varNameSalt++)); - } - - /** - * @deprecated since 1.27 (to be removed in 2.0). Use $parser->getStream()->getSourceContext()->getPath() instead. - */ - public function getFilename() - { - @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use $parser->getStream()->getSourceContext()->getPath() instead.', __METHOD__), E_USER_DEPRECATED); - - return $this->stream->getSourceContext()->getName(); - } - - public function parse(Twig_TokenStream $stream, $test = null, $dropNeedle = false) - { - // push all variables into the stack to keep the current state of the parser - // using get_object_vars() instead of foreach would lead to https://bugs.php.net/71336 - // This hack can be removed when min version if PHP 7.0 - $vars = []; - foreach ($this as $k => $v) { - $vars[$k] = $v; - } - - unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames']); - $this->stack[] = $vars; - - // tag handlers - if (null === $this->handlers) { - $this->handlers = $this->env->getTokenParsers(); - $this->handlers->setParser($this); - } - - // node visitors - if (null === $this->visitors) { - $this->visitors = $this->env->getNodeVisitors(); - } - - if (null === $this->expressionParser) { - $this->expressionParser = new Twig_ExpressionParser($this, $this->env); - } - - $this->stream = $stream; - $this->parent = null; - $this->blocks = []; - $this->macros = []; - $this->traits = []; - $this->blockStack = []; - $this->importedSymbols = [[]]; - $this->embeddedTemplates = []; - $this->varNameSalt = 0; - - try { - $body = $this->subparse($test, $dropNeedle); - - if (null !== $this->parent && null === $body = $this->filterBodyNodes($body)) { - $body = new Twig_Node(); - } - } catch (Twig_Error_Syntax $e) { - if (!$e->getSourceContext()) { - $e->setSourceContext($this->stream->getSourceContext()); - } - - if (!$e->getTemplateLine()) { - $e->setTemplateLine($this->stream->getCurrent()->getLine()); - } - - throw $e; - } - - $node = new Twig_Node_Module(new Twig_Node_Body([$body]), $this->parent, new Twig_Node($this->blocks), new Twig_Node($this->macros), new Twig_Node($this->traits), $this->embeddedTemplates, $stream->getSourceContext()); - - $traverser = new Twig_NodeTraverser($this->env, $this->visitors); - - $node = $traverser->traverse($node); - - // restore previous stack so previous parse() call can resume working - foreach (array_pop($this->stack) as $key => $val) { - $this->$key = $val; - } - - return $node; - } - - public function subparse($test, $dropNeedle = false) - { - $lineno = $this->getCurrentToken()->getLine(); - $rv = []; - while (!$this->stream->isEOF()) { - switch ($this->getCurrentToken()->getType()) { - case Twig_Token::TEXT_TYPE: - $token = $this->stream->next(); - $rv[] = new Twig_Node_Text($token->getValue(), $token->getLine()); - break; - - case Twig_Token::VAR_START_TYPE: - $token = $this->stream->next(); - $expr = $this->expressionParser->parseExpression(); - $this->stream->expect(Twig_Token::VAR_END_TYPE); - $rv[] = new Twig_Node_Print($expr, $token->getLine()); - break; - - case Twig_Token::BLOCK_START_TYPE: - $this->stream->next(); - $token = $this->getCurrentToken(); - - if (Twig_Token::NAME_TYPE !== $token->getType()) { - throw new Twig_Error_Syntax('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext()); - } - - if (null !== $test && call_user_func($test, $token)) { - if ($dropNeedle) { - $this->stream->next(); - } - - if (1 === count($rv)) { - return $rv[0]; - } - - return new Twig_Node($rv, [], $lineno); - } - - $subparser = $this->handlers->getTokenParser($token->getValue()); - if (null === $subparser) { - if (null !== $test) { - $e = new Twig_Error_Syntax(sprintf('Unexpected "%s" tag', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); - - if (is_array($test) && isset($test[0]) && $test[0] instanceof Twig_TokenParserInterface) { - $e->appendMessage(sprintf(' (expecting closing tag for the "%s" tag defined near line %s).', $test[0]->getTag(), $lineno)); - } - } else { - $e = new Twig_Error_Syntax(sprintf('Unknown "%s" tag.', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); - $e->addSuggestions($token->getValue(), array_keys($this->env->getTags())); - } - - throw $e; - } - - $this->stream->next(); - - $node = $subparser->parse($token); - if (null !== $node) { - $rv[] = $node; - } - break; - - default: - throw new Twig_Error_Syntax('Lexer or parser ended up in unsupported state.', $this->getCurrentToken()->getLine(), $this->stream->getSourceContext()); - } - } - - if (1 === count($rv)) { - return $rv[0]; - } - - return new Twig_Node($rv, [], $lineno); - } - - /** - * @deprecated since 1.27 (to be removed in 2.0) - */ - public function addHandler($name, $class) - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); - - $this->handlers[$name] = $class; - } - - /** - * @deprecated since 1.27 (to be removed in 2.0) - */ - public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); - - $this->visitors[] = $visitor; - } - - public function getBlockStack() - { - return $this->blockStack; - } - - public function peekBlockStack() - { - return $this->blockStack[count($this->blockStack) - 1]; - } - - public function popBlockStack() - { - array_pop($this->blockStack); - } - - public function pushBlockStack($name) - { - $this->blockStack[] = $name; - } - - public function hasBlock($name) - { - return isset($this->blocks[$name]); - } - - public function getBlock($name) - { - return $this->blocks[$name]; - } - - public function setBlock($name, Twig_Node_Block $value) - { - $this->blocks[$name] = new Twig_Node_Body([$value], [], $value->getTemplateLine()); - } - - public function hasMacro($name) - { - return isset($this->macros[$name]); - } - - public function setMacro($name, Twig_Node_Macro $node) - { - if ($this->isReservedMacroName($name)) { - throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node->getTemplateLine(), $this->stream->getSourceContext()); - } - - $this->macros[$name] = $node; - } - - public function isReservedMacroName($name) - { - if (null === $this->reservedMacroNames) { - $this->reservedMacroNames = []; - $r = new ReflectionClass($this->env->getBaseTemplateClass()); - foreach ($r->getMethods() as $method) { - $methodName = strtolower($method->getName()); - - if ('get' === substr($methodName, 0, 3) && isset($methodName[3])) { - $this->reservedMacroNames[] = substr($methodName, 3); - } - } - } - - return in_array(strtolower($name), $this->reservedMacroNames); - } - - public function addTrait($trait) - { - $this->traits[] = $trait; - } - - public function hasTraits() - { - return count($this->traits) > 0; - } - - public function embedTemplate(Twig_Node_Module $template) - { - $template->setIndex(mt_rand()); - - $this->embeddedTemplates[] = $template; - } - - public function addImportedSymbol($type, $alias, $name = null, Twig_Node_Expression $node = null) - { - $this->importedSymbols[0][$type][$alias] = ['name' => $name, 'node' => $node]; - } - - public function getImportedSymbol($type, $alias) - { - foreach ($this->importedSymbols as $functions) { - if (isset($functions[$type][$alias])) { - return $functions[$type][$alias]; - } - } - } - - public function isMainScope() - { - return 1 === count($this->importedSymbols); - } - - public function pushLocalScope() - { - array_unshift($this->importedSymbols, []); - } - - public function popLocalScope() - { - array_shift($this->importedSymbols); - } - - /** - * @return Twig_ExpressionParser - */ - public function getExpressionParser() - { - return $this->expressionParser; - } - - public function getParent() - { - return $this->parent; - } - - public function setParent($parent) - { - $this->parent = $parent; - } - - /** - * @return Twig_TokenStream - */ - public function getStream() - { - return $this->stream; - } - - /** - * @return Twig_Token - */ - public function getCurrentToken() - { - return $this->stream->getCurrent(); - } - - protected function filterBodyNodes(Twig_NodeInterface $node) - { - // check that the body does not contain non-empty output nodes - if ( - ($node instanceof Twig_Node_Text && !ctype_space($node->getAttribute('data'))) - || - (!$node instanceof Twig_Node_Text && !$node instanceof Twig_Node_BlockReference && $node instanceof Twig_NodeOutputInterface) - ) { - if (false !== strpos((string) $node, chr(0xEF).chr(0xBB).chr(0xBF))) { - $t = substr($node->getAttribute('data'), 3); - if ('' === $t || ctype_space($t)) { - // bypass empty nodes starting with a BOM - return; - } - } - - throw new Twig_Error_Syntax('A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag?', $node->getTemplateLine(), $this->stream->getSourceContext()); - } - - // bypass nodes that will "capture" the output - if ($node instanceof Twig_NodeCaptureInterface) { - return $node; - } - - if ($node instanceof Twig_NodeOutputInterface) { - return; - } - - foreach ($node as $k => $n) { - if (null !== $n && null === $this->filterBodyNodes($n)) { - $node->removeNode($k); - } - } - - return $node; } } - -class_alias('Twig_Parser', 'Twig\Parser', false); -class_exists('Twig_Node'); -class_exists('Twig_TokenStream'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/ParserInterface.php --- a/vendor/twig/twig/lib/Twig/ParserInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/ParserInterface.php Thu May 09 15:33:08 2019 +0100 @@ -9,6 +9,10 @@ * file that was distributed with this source code. */ +use Twig\Error\SyntaxError; +use Twig\Node\ModuleNode; +use Twig\TokenStream; + /** * Interface implemented by parser classes. * @@ -21,9 +25,9 @@ /** * Converts a token stream to a node tree. * - * @return Twig_Node_Module + * @return ModuleNode * - * @throws Twig_Error_Syntax When the token stream is syntactically or semantically wrong + * @throws SyntaxError When the token stream is syntactically or semantically wrong */ - public function parse(Twig_TokenStream $stream); + public function parse(TokenStream $stream); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php --- a/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php Thu May 09 15:33:08 2019 +0100 @@ -1,62 +1,11 @@ - */ -abstract class Twig_Profiler_Dumper_Base -{ - private $root; +class_exists('Twig\Profiler\Dumper\BaseDumper'); - public function dump(Twig_Profiler_Profile $profile) +if (\false) { + class Twig_Profiler_Dumper_Base extends BaseDumper { - return $this->dumpProfile($profile); - } - - abstract protected function formatTemplate(Twig_Profiler_Profile $profile, $prefix); - - abstract protected function formatNonTemplate(Twig_Profiler_Profile $profile, $prefix); - - abstract protected function formatTime(Twig_Profiler_Profile $profile, $percent); - - private function dumpProfile(Twig_Profiler_Profile $profile, $prefix = '', $sibling = false) - { - if ($profile->isRoot()) { - $this->root = $profile->getDuration(); - $start = $profile->getName(); - } else { - if ($profile->isTemplate()) { - $start = $this->formatTemplate($profile, $prefix); - } else { - $start = $this->formatNonTemplate($profile, $prefix); - } - $prefix .= $sibling ? '│ ' : ' '; - } - - $percent = $this->root ? $profile->getDuration() / $this->root * 100 : 0; - - if ($profile->getDuration() * 1000 < 1) { - $str = $start."\n"; - } else { - $str = sprintf("%s %s\n", $start, $this->formatTime($profile, $percent)); - } - - $nCount = count($profile->getProfiles()); - foreach ($profile as $i => $p) { - $str .= $this->dumpProfile($p, $prefix, $i + 1 !== $nCount); - } - - return $str; } } - -class_alias('Twig_Profiler_Dumper_Base', 'Twig\Profiler\Dumper\BaseDumper', false); -class_exists('Twig_Profiler_Profile'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php --- a/vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php Thu May 09 15:33:08 2019 +0100 @@ -1,72 +1,11 @@ - * - * @final - */ -class Twig_Profiler_Dumper_Blackfire -{ - public function dump(Twig_Profiler_Profile $profile) +class_exists('Twig\Profiler\Dumper\BlackfireDumper'); + +if (\false) { + class Twig_Profiler_Dumper_Blackfire extends BlackfireDumper { - $data = []; - $this->dumpProfile('main()', $profile, $data); - $this->dumpChildren('main()', $profile, $data); - - $start = sprintf('%f', microtime(true)); - $str = << $values) { - $str .= "{$name}//{$values['ct']} {$values['wt']} {$values['mu']} {$values['pmu']}\n"; - } - - return $str; - } - - private function dumpChildren($parent, Twig_Profiler_Profile $profile, &$data) - { - foreach ($profile as $p) { - if ($p->isTemplate()) { - $name = $p->getTemplate(); - } else { - $name = sprintf('%s::%s(%s)', $p->getTemplate(), $p->getType(), $p->getName()); - } - $this->dumpProfile(sprintf('%s==>%s', $parent, $name), $p, $data); - $this->dumpChildren($name, $p, $data); - } - } - - private function dumpProfile($edge, Twig_Profiler_Profile $profile, &$data) - { - if (isset($data[$edge])) { - ++$data[$edge]['ct']; - $data[$edge]['wt'] += floor($profile->getDuration() * 1000000); - $data[$edge]['mu'] += $profile->getMemoryUsage(); - $data[$edge]['pmu'] += $profile->getPeakMemoryUsage(); - } else { - $data[$edge] = [ - 'ct' => 1, - 'wt' => floor($profile->getDuration() * 1000000), - 'mu' => $profile->getMemoryUsage(), - 'pmu' => $profile->getPeakMemoryUsage(), - ]; - } } } - -class_alias('Twig_Profiler_Dumper_Blackfire', 'Twig\Profiler\Dumper\BlackfireDumper', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php --- a/vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php Thu May 09 15:33:08 2019 +0100 @@ -1,47 +1,11 @@ - * - * @final - */ -class Twig_Profiler_Dumper_Html extends Twig_Profiler_Dumper_Base -{ - private static $colors = [ - 'block' => '#dfd', - 'macro' => '#ddf', - 'template' => '#ffd', - 'big' => '#d44', - ]; +class_exists('Twig\Profiler\Dumper\HtmlDumper'); - public function dump(Twig_Profiler_Profile $profile) +if (\false) { + class Twig_Profiler_Dumper_Html extends HtmlDumper { - return '
    '.parent::dump($profile).'
    '; - } - - protected function formatTemplate(Twig_Profiler_Profile $profile, $prefix) - { - return sprintf('%s└ %s', $prefix, self::$colors['template'], $profile->getTemplate()); - } - - protected function formatNonTemplate(Twig_Profiler_Profile $profile, $prefix) - { - return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), isset(self::$colors[$profile->getType()]) ? self::$colors[$profile->getType()] : 'auto', $profile->getName()); - } - - protected function formatTime(Twig_Profiler_Profile $profile, $percent) - { - return sprintf('%.2fms/%.0f%%', $percent > 20 ? self::$colors['big'] : 'auto', $profile->getDuration() * 1000, $percent); } } - -class_alias('Twig_Profiler_Dumper_Html', 'Twig\Profiler\Dumper\HtmlDumper', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php --- a/vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php Thu May 09 15:33:08 2019 +0100 @@ -1,35 +1,11 @@ - * - * @final - */ -class Twig_Profiler_Dumper_Text extends Twig_Profiler_Dumper_Base -{ - protected function formatTemplate(Twig_Profiler_Profile $profile, $prefix) +class_exists('Twig\Profiler\Dumper\TextDumper'); + +if (\false) { + class Twig_Profiler_Dumper_Text extends TextDumper { - return sprintf('%s└ %s', $prefix, $profile->getTemplate()); - } - - protected function formatNonTemplate(Twig_Profiler_Profile $profile, $prefix) - { - return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), $profile->getName()); - } - - protected function formatTime(Twig_Profiler_Profile $profile, $percent) - { - return sprintf('%.2fms/%.0f%%', $profile->getDuration() * 1000, $percent); } } - -class_alias('Twig_Profiler_Dumper_Text', 'Twig\Profiler\Dumper\TextDumper', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php --- a/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php Thu May 09 15:33:08 2019 +0100 @@ -1,39 +1,11 @@ - */ -class Twig_Profiler_Node_EnterProfile extends Twig_Node -{ - public function __construct($extensionName, $type, $name, $varName) +class_exists('Twig\Profiler\Node\EnterProfileNode'); + +if (\false) { + class Twig_Profiler_Node_EnterProfile extends EnterProfileNode { - parent::__construct([], ['extension_name' => $extensionName, 'name' => $name, 'type' => $type, 'var_name' => $varName]); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->write(sprintf('$%s = $this->env->getExtension(', $this->getAttribute('var_name'))) - ->repr($this->getAttribute('extension_name')) - ->raw(");\n") - ->write(sprintf('$%s->enter($%s = new Twig_Profiler_Profile($this->getTemplateName(), ', $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof')) - ->repr($this->getAttribute('type')) - ->raw(', ') - ->repr($this->getAttribute('name')) - ->raw("));\n\n") - ; } } - -class_alias('Twig_Profiler_Node_EnterProfile', 'Twig\Profiler\Node\EnterProfileNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php --- a/vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ - */ -class Twig_Profiler_Node_LeaveProfile extends Twig_Node -{ - public function __construct($varName) +class_exists('Twig\Profiler\Node\LeaveProfileNode'); + +if (\false) { + class Twig_Profiler_Node_LeaveProfile extends LeaveProfileNode { - parent::__construct([], ['var_name' => $varName]); - } - - public function compile(Twig_Compiler $compiler) - { - $compiler - ->write("\n") - ->write(sprintf("\$%s->leave(\$%s);\n\n", $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof')) - ; } } - -class_alias('Twig_Profiler_Node_LeaveProfile', 'Twig\Profiler\Node\LeaveProfileNode', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php --- a/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php Thu May 09 15:33:08 2019 +0100 @@ -1,67 +1,11 @@ - * - * @final - */ -class Twig_Profiler_NodeVisitor_Profiler extends Twig_BaseNodeVisitor -{ - private $extensionName; +class_exists('Twig\Profiler\NodeVisitor\ProfilerNodeVisitor'); - public function __construct($extensionName) +if (\false) { + class Twig_Profiler_NodeVisitor_Profiler extends ProfilerNodeVisitor { - $this->extensionName = $extensionName; - } - - protected function doEnterNode(Twig_Node $node, Twig_Environment $env) - { - return $node; - } - - protected function doLeaveNode(Twig_Node $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_Module) { - $varName = $this->getVarName(); - $node->setNode('display_start', new Twig_Node([new Twig_Profiler_Node_EnterProfile($this->extensionName, Twig_Profiler_Profile::TEMPLATE, $node->getTemplateName(), $varName), $node->getNode('display_start')])); - $node->setNode('display_end', new Twig_Node([new Twig_Profiler_Node_LeaveProfile($varName), $node->getNode('display_end')])); - } elseif ($node instanceof Twig_Node_Block) { - $varName = $this->getVarName(); - $node->setNode('body', new Twig_Node_Body([ - new Twig_Profiler_Node_EnterProfile($this->extensionName, Twig_Profiler_Profile::BLOCK, $node->getAttribute('name'), $varName), - $node->getNode('body'), - new Twig_Profiler_Node_LeaveProfile($varName), - ])); - } elseif ($node instanceof Twig_Node_Macro) { - $varName = $this->getVarName(); - $node->setNode('body', new Twig_Node_Body([ - new Twig_Profiler_Node_EnterProfile($this->extensionName, Twig_Profiler_Profile::MACRO, $node->getAttribute('name'), $varName), - $node->getNode('body'), - new Twig_Profiler_Node_LeaveProfile($varName), - ])); - } - - return $node; - } - - private function getVarName() - { - return sprintf('__internal_%s', hash('sha256', $this->extensionName)); - } - - public function getPriority() - { - return 0; } } - -class_alias('Twig_Profiler_NodeVisitor_Profiler', 'Twig\Profiler\NodeVisitor\ProfilerNodeVisitor', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Profiler/Profile.php --- a/vendor/twig/twig/lib/Twig/Profiler/Profile.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Profile.php Thu May 09 15:33:08 2019 +0100 @@ -1,170 +1,11 @@ - * - * @final - */ -class Twig_Profiler_Profile implements IteratorAggregate, Serializable -{ - const ROOT = 'ROOT'; - const BLOCK = 'block'; - const TEMPLATE = 'template'; - const MACRO = 'macro'; +class_exists('Twig\Profiler\Profile'); - private $template; - private $name; - private $type; - private $starts = []; - private $ends = []; - private $profiles = []; - - public function __construct($template = 'main', $type = self::ROOT, $name = 'main') +if (\false) { + class Twig_Profiler_Profile extends Profile { - $this->template = $template; - $this->type = $type; - $this->name = 0 === strpos($name, '__internal_') ? 'INTERNAL' : $name; - $this->enter(); - } - - public function getTemplate() - { - return $this->template; - } - - public function getType() - { - return $this->type; - } - - public function getName() - { - return $this->name; - } - - public function isRoot() - { - return self::ROOT === $this->type; - } - - public function isTemplate() - { - return self::TEMPLATE === $this->type; - } - - public function isBlock() - { - return self::BLOCK === $this->type; - } - - public function isMacro() - { - return self::MACRO === $this->type; - } - - public function getProfiles() - { - return $this->profiles; - } - - public function addProfile(self $profile) - { - $this->profiles[] = $profile; - } - - /** - * Returns the duration in microseconds. - * - * @return int - */ - public function getDuration() - { - if ($this->isRoot() && $this->profiles) { - // for the root node with children, duration is the sum of all child durations - $duration = 0; - foreach ($this->profiles as $profile) { - $duration += $profile->getDuration(); - } - - return $duration; - } - - return isset($this->ends['wt']) && isset($this->starts['wt']) ? $this->ends['wt'] - $this->starts['wt'] : 0; - } - - /** - * Returns the memory usage in bytes. - * - * @return int - */ - public function getMemoryUsage() - { - return isset($this->ends['mu']) && isset($this->starts['mu']) ? $this->ends['mu'] - $this->starts['mu'] : 0; - } - - /** - * Returns the peak memory usage in bytes. - * - * @return int - */ - public function getPeakMemoryUsage() - { - return isset($this->ends['pmu']) && isset($this->starts['pmu']) ? $this->ends['pmu'] - $this->starts['pmu'] : 0; - } - - /** - * Starts the profiling. - */ - public function enter() - { - $this->starts = [ - 'wt' => microtime(true), - 'mu' => memory_get_usage(), - 'pmu' => memory_get_peak_usage(), - ]; - } - - /** - * Stops the profiling. - */ - public function leave() - { - $this->ends = [ - 'wt' => microtime(true), - 'mu' => memory_get_usage(), - 'pmu' => memory_get_peak_usage(), - ]; - } - - public function reset() - { - $this->starts = $this->ends = $this->profiles = []; - $this->enter(); - } - - public function getIterator() - { - return new ArrayIterator($this->profiles); - } - - public function serialize() - { - return serialize([$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]); - } - - public function unserialize($data) - { - list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = unserialize($data); } } - -class_alias('Twig_Profiler_Profile', 'Twig\Profiler\Profile', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php --- a/vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,29 +1,11 @@ - */ -interface Twig_RuntimeLoaderInterface -{ - /** - * Creates the runtime implementation of a Twig element (filter/function/test). - * - * @param string $class A runtime class - * - * @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class - */ - public function load($class); +class_exists('Twig\RuntimeLoader\RuntimeLoaderInterface'); + +if (\false) { + class Twig_RuntimeLoaderInterface extends RuntimeLoaderInterface + { + } } - -class_alias('Twig_RuntimeLoaderInterface', 'Twig\RuntimeLoader\RuntimeLoaderInterface', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php Thu May 09 15:33:08 2019 +0100 @@ -1,21 +1,11 @@ - */ -class Twig_Sandbox_SecurityError extends Twig_Error -{ +class_exists('Twig\Sandbox\SecurityError'); + +if (\false) { + class Twig_Sandbox_SecurityError extends SecurityError + { + } } - -class_alias('Twig_Sandbox_SecurityError', 'Twig\Sandbox\SecurityError', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ - */ -class Twig_Sandbox_SecurityNotAllowedFilterError extends Twig_Sandbox_SecurityError -{ - private $filterName; +class_exists('Twig\Sandbox\SecurityNotAllowedFilterError'); - public function __construct($message, $functionName, $lineno = -1, $filename = null, Exception $previous = null) +if (\false) { + class Twig_Sandbox_SecurityNotAllowedFilterError extends SecurityNotAllowedFilterError { - parent::__construct($message, $lineno, $filename, $previous); - $this->filterName = $functionName; - } - - public function getFilterName() - { - return $this->filterName; } } - -class_alias('Twig_Sandbox_SecurityNotAllowedFilterError', 'Twig\Sandbox\SecurityNotAllowedFilterError', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ - */ -class Twig_Sandbox_SecurityNotAllowedFunctionError extends Twig_Sandbox_SecurityError -{ - private $functionName; +class_exists('Twig\Sandbox\SecurityNotAllowedFunctionError'); - public function __construct($message, $functionName, $lineno = -1, $filename = null, Exception $previous = null) +if (\false) { + class Twig_Sandbox_SecurityNotAllowedFunctionError extends SecurityNotAllowedFunctionError { - parent::__construct($message, $lineno, $filename, $previous); - $this->functionName = $functionName; - } - - public function getFunctionName() - { - return $this->functionName; } } - -class_alias('Twig_Sandbox_SecurityNotAllowedFunctionError', 'Twig\Sandbox\SecurityNotAllowedFunctionError', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php Thu May 09 15:33:08 2019 +0100 @@ -1,40 +1,11 @@ - */ -class Twig_Sandbox_SecurityNotAllowedMethodError extends Twig_Sandbox_SecurityError -{ - private $className; - private $methodName; +class_exists('Twig\Sandbox\SecurityNotAllowedMethodError'); - public function __construct($message, $className, $methodName, $lineno = -1, $filename = null, Exception $previous = null) +if (\false) { + class Twig_Sandbox_SecurityNotAllowedMethodError extends SecurityNotAllowedMethodError { - parent::__construct($message, $lineno, $filename, $previous); - $this->className = $className; - $this->methodName = $methodName; - } - - public function getClassName() - { - return $this->className; - } - - public function getMethodName() - { - return $this->methodName; } } - -class_alias('Twig_Sandbox_SecurityNotAllowedMethodError', 'Twig\Sandbox\SecurityNotAllowedMethodError', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php Thu May 09 15:33:08 2019 +0100 @@ -1,40 +1,11 @@ - */ -class Twig_Sandbox_SecurityNotAllowedPropertyError extends Twig_Sandbox_SecurityError -{ - private $className; - private $propertyName; +class_exists('Twig\Sandbox\SecurityNotAllowedPropertyError'); - public function __construct($message, $className, $propertyName, $lineno = -1, $filename = null, Exception $previous = null) +if (\false) { + class Twig_Sandbox_SecurityNotAllowedPropertyError extends SecurityNotAllowedPropertyError { - parent::__construct($message, $lineno, $filename, $previous); - $this->className = $className; - $this->propertyName = $propertyName; - } - - public function getClassName() - { - return $this->className; - } - - public function getPropertyName() - { - return $this->propertyName; } } - -class_alias('Twig_Sandbox_SecurityNotAllowedPropertyError', 'Twig\Sandbox\SecurityNotAllowedPropertyError', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ - */ -class Twig_Sandbox_SecurityNotAllowedTagError extends Twig_Sandbox_SecurityError -{ - private $tagName; +class_exists('Twig\Sandbox\SecurityNotAllowedTagError'); - public function __construct($message, $tagName, $lineno = -1, $filename = null, Exception $previous = null) +if (\false) { + class Twig_Sandbox_SecurityNotAllowedTagError extends SecurityNotAllowedTagError { - parent::__construct($message, $lineno, $filename, $previous); - $this->tagName = $tagName; - } - - public function getTagName() - { - return $this->tagName; } } - -class_alias('Twig_Sandbox_SecurityNotAllowedTagError', 'Twig\Sandbox\SecurityNotAllowedTagError', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php Thu May 09 15:33:08 2019 +0100 @@ -1,125 +1,11 @@ - */ -class Twig_Sandbox_SecurityPolicy implements Twig_Sandbox_SecurityPolicyInterface -{ - protected $allowedTags; - protected $allowedFilters; - protected $allowedMethods; - protected $allowedProperties; - protected $allowedFunctions; +class_exists('Twig\Sandbox\SecurityPolicy'); - public function __construct(array $allowedTags = [], array $allowedFilters = [], array $allowedMethods = [], array $allowedProperties = [], array $allowedFunctions = []) +if (\false) { + class Twig_Sandbox_SecurityPolicy extends SecurityPolicy { - $this->allowedTags = $allowedTags; - $this->allowedFilters = $allowedFilters; - $this->setAllowedMethods($allowedMethods); - $this->allowedProperties = $allowedProperties; - $this->allowedFunctions = $allowedFunctions; - } - - public function setAllowedTags(array $tags) - { - $this->allowedTags = $tags; - } - - public function setAllowedFilters(array $filters) - { - $this->allowedFilters = $filters; - } - - public function setAllowedMethods(array $methods) - { - $this->allowedMethods = []; - foreach ($methods as $class => $m) { - $this->allowedMethods[$class] = array_map('strtolower', is_array($m) ? $m : [$m]); - } - } - - public function setAllowedProperties(array $properties) - { - $this->allowedProperties = $properties; - } - - public function setAllowedFunctions(array $functions) - { - $this->allowedFunctions = $functions; - } - - public function checkSecurity($tags, $filters, $functions) - { - foreach ($tags as $tag) { - if (!in_array($tag, $this->allowedTags)) { - throw new Twig_Sandbox_SecurityNotAllowedTagError(sprintf('Tag "%s" is not allowed.', $tag), $tag); - } - } - - foreach ($filters as $filter) { - if (!in_array($filter, $this->allowedFilters)) { - throw new Twig_Sandbox_SecurityNotAllowedFilterError(sprintf('Filter "%s" is not allowed.', $filter), $filter); - } - } - - foreach ($functions as $function) { - if (!in_array($function, $this->allowedFunctions)) { - throw new Twig_Sandbox_SecurityNotAllowedFunctionError(sprintf('Function "%s" is not allowed.', $function), $function); - } - } - } - - public function checkMethodAllowed($obj, $method) - { - if ($obj instanceof Twig_TemplateInterface || $obj instanceof Twig_Markup) { - return true; - } - - $allowed = false; - $method = strtolower($method); - foreach ($this->allowedMethods as $class => $methods) { - if ($obj instanceof $class) { - $allowed = in_array($method, $methods); - - break; - } - } - - if (!$allowed) { - $class = get_class($obj); - throw new Twig_Sandbox_SecurityNotAllowedMethodError(sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, $class), $class, $method); - } - } - - public function checkPropertyAllowed($obj, $property) - { - $allowed = false; - foreach ($this->allowedProperties as $class => $properties) { - if ($obj instanceof $class) { - $allowed = in_array($property, is_array($properties) ? $properties : [$properties]); - - break; - } - } - - if (!$allowed) { - $class = get_class($obj); - throw new Twig_Sandbox_SecurityNotAllowedPropertyError(sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, $class), $class, $property); - } } } - -class_alias('Twig_Sandbox_SecurityPolicy', 'Twig\Sandbox\SecurityPolicy', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,26 +1,11 @@ - */ -interface Twig_Sandbox_SecurityPolicyInterface -{ - public function checkSecurity($tags, $filters, $functions); +class_exists('Twig\Sandbox\SecurityPolicyInterface'); - public function checkMethodAllowed($obj, $method); - - public function checkPropertyAllowed($obj, $method); +if (\false) { + class Twig_Sandbox_SecurityPolicyInterface extends SecurityPolicyInterface + { + } } - -class_alias('Twig_Sandbox_SecurityPolicyInterface', 'Twig\Sandbox\SecurityPolicyInterface', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/SimpleFilter.php --- a/vendor/twig/twig/lib/Twig/SimpleFilter.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/SimpleFilter.php Thu May 09 15:33:08 2019 +0100 @@ -1,121 +1,11 @@ - */ -class Twig_SimpleFilter -{ - protected $name; - protected $callable; - protected $options; - protected $arguments = []; +class_exists('Twig\TwigFilter'); - public function __construct($name, $callable, array $options = []) +if (\false) { + class Twig_SimpleFilter extends TwigFilter { - $this->name = $name; - $this->callable = $callable; - $this->options = array_merge([ - 'needs_environment' => false, - 'needs_context' => false, - 'is_variadic' => false, - 'is_safe' => null, - 'is_safe_callback' => null, - 'pre_escape' => null, - 'preserves_safety' => null, - 'node_class' => 'Twig_Node_Expression_Filter', - 'deprecated' => false, - 'alternative' => null, - ], $options); - } - - public function getName() - { - return $this->name; - } - - public function getCallable() - { - return $this->callable; - } - - public function getNodeClass() - { - return $this->options['node_class']; - } - - public function setArguments($arguments) - { - $this->arguments = $arguments; - } - - public function getArguments() - { - return $this->arguments; - } - - public function needsEnvironment() - { - return $this->options['needs_environment']; - } - - public function needsContext() - { - return $this->options['needs_context']; - } - - public function getSafe(Twig_Node $filterArgs) - { - if (null !== $this->options['is_safe']) { - return $this->options['is_safe']; - } - - if (null !== $this->options['is_safe_callback']) { - return call_user_func($this->options['is_safe_callback'], $filterArgs); - } - } - - public function getPreservesSafety() - { - return $this->options['preserves_safety']; - } - - public function getPreEscape() - { - return $this->options['pre_escape']; - } - - public function isVariadic() - { - return $this->options['is_variadic']; - } - - public function isDeprecated() - { - return (bool) $this->options['deprecated']; - } - - public function getDeprecatedVersion() - { - return $this->options['deprecated']; - } - - public function getAlternative() - { - return $this->options['alternative']; } } - -class_alias('Twig_SimpleFilter', 'Twig\TwigFilter', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/SimpleFunction.php --- a/vendor/twig/twig/lib/Twig/SimpleFunction.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/SimpleFunction.php Thu May 09 15:33:08 2019 +0100 @@ -1,111 +1,11 @@ - */ -class Twig_SimpleFunction -{ - protected $name; - protected $callable; - protected $options; - protected $arguments = []; +class_exists('Twig\TwigFunction'); - public function __construct($name, $callable, array $options = []) +if (\false) { + class Twig_SimpleFunction extends TwigFunction { - $this->name = $name; - $this->callable = $callable; - $this->options = array_merge([ - 'needs_environment' => false, - 'needs_context' => false, - 'is_variadic' => false, - 'is_safe' => null, - 'is_safe_callback' => null, - 'node_class' => 'Twig_Node_Expression_Function', - 'deprecated' => false, - 'alternative' => null, - ], $options); - } - - public function getName() - { - return $this->name; - } - - public function getCallable() - { - return $this->callable; - } - - public function getNodeClass() - { - return $this->options['node_class']; - } - - public function setArguments($arguments) - { - $this->arguments = $arguments; - } - - public function getArguments() - { - return $this->arguments; - } - - public function needsEnvironment() - { - return $this->options['needs_environment']; - } - - public function needsContext() - { - return $this->options['needs_context']; - } - - public function getSafe(Twig_Node $functionArgs) - { - if (null !== $this->options['is_safe']) { - return $this->options['is_safe']; - } - - if (null !== $this->options['is_safe_callback']) { - return call_user_func($this->options['is_safe_callback'], $functionArgs); - } - - return []; - } - - public function isVariadic() - { - return $this->options['is_variadic']; - } - - public function isDeprecated() - { - return (bool) $this->options['deprecated']; - } - - public function getDeprecatedVersion() - { - return $this->options['deprecated']; - } - - public function getAlternative() - { - return $this->options['alternative']; } } - -class_alias('Twig_SimpleFunction', 'Twig\TwigFunction', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/SimpleTest.php --- a/vendor/twig/twig/lib/Twig/SimpleTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/SimpleTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,85 +1,11 @@ - */ -class Twig_SimpleTest -{ - protected $name; - protected $callable; - protected $options; +class_exists('Twig\TwigTest'); - private $arguments = []; - - public function __construct($name, $callable, array $options = []) +if (\false) { + class Twig_SimpleTest extends TwigTest { - $this->name = $name; - $this->callable = $callable; - $this->options = array_merge([ - 'is_variadic' => false, - 'node_class' => 'Twig_Node_Expression_Test', - 'deprecated' => false, - 'alternative' => null, - ], $options); - } - - public function getName() - { - return $this->name; - } - - public function getCallable() - { - return $this->callable; - } - - public function getNodeClass() - { - return $this->options['node_class']; - } - - public function isVariadic() - { - return $this->options['is_variadic']; - } - - public function isDeprecated() - { - return (bool) $this->options['deprecated']; - } - - public function getDeprecatedVersion() - { - return $this->options['deprecated']; - } - - public function getAlternative() - { - return $this->options['alternative']; - } - - public function setArguments($arguments) - { - $this->arguments = $arguments; - } - - public function getArguments() - { - return $this->arguments; } } - -class_alias('Twig_SimpleTest', 'Twig\TwigTest', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Source.php --- a/vendor/twig/twig/lib/Twig/Source.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Source.php Thu May 09 15:33:08 2019 +0100 @@ -1,53 +1,11 @@ - */ -class Twig_Source -{ - private $code; - private $name; - private $path; +class_exists('Twig\Source'); - /** - * @param string $code The template source code - * @param string $name The template logical name - * @param string $path The filesystem path of the template if any - */ - public function __construct($code, $name, $path = '') +if (\false) { + class Twig_Source extends Source { - $this->code = $code; - $this->name = $name; - $this->path = $path; - } - - public function getCode() - { - return $this->code; - } - - public function getName() - { - return $this->name; - } - - public function getPath() - { - return $this->path; } } - -class_alias('Twig_Source', 'Twig\Source', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php --- a/vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ - * - * @deprecated since 1.27 (to be removed in 3.0) - */ -interface Twig_SourceContextLoaderInterface -{ - /** - * Returns the source context for a given template logical name. - * - * @param string $name The template logical name - * - * @return Twig_Source - * - * @throws Twig_Error_Loader When $name is not found - */ - public function getSourceContext($name); +class_exists('Twig\Loader\SourceContextLoaderInterface'); + +if (\false) { + class Twig_SourceContextLoaderInterface extends SourceContextLoaderInterface + { + } } - -class_alias('Twig_SourceContextLoaderInterface', 'Twig\Loader\SourceContextLoaderInterface', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Template.php --- a/vendor/twig/twig/lib/Twig/Template.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Template.php Thu May 09 15:33:08 2019 +0100 @@ -1,704 +1,11 @@ load() - * instead, which returns an instance of Twig_TemplateWrapper. - * - * @author Fabien Potencier - * - * @internal - */ -abstract class Twig_Template implements Twig_TemplateInterface -{ - /** - * @internal - */ - protected static $cache = []; +class_exists('Twig\Template'); - protected $parent; - protected $parents = []; - protected $env; - protected $blocks = []; - protected $traits = []; - - public function __construct(Twig_Environment $env) +if (\false) { + class Twig_Template extends Template { - $this->env = $env; - } - - /** - * @internal this method will be removed in 2.0 and is only used internally to provide an upgrade path from 1.x to 2.0 - */ - public function __toString() - { - return $this->getTemplateName(); - } - - /** - * Returns the template name. - * - * @return string The template name - */ - abstract public function getTemplateName(); - - /** - * Returns debug information about the template. - * - * @return array Debug information - * - * @internal - */ - public function getDebugInfo() - { - return []; - } - - /** - * Returns the template source code. - * - * @return string The template source code - * - * @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead - */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return ''; - } - - /** - * Returns information about the original template source code. - * - * @return Twig_Source - */ - public function getSourceContext() - { - return new Twig_Source('', $this->getTemplateName()); - } - - /** - * @deprecated since 1.20 (to be removed in 2.0) - */ - public function getEnvironment() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.20 and will be removed in 2.0.', E_USER_DEPRECATED); - - return $this->env; - } - - /** - * Returns the parent template. - * - * This method is for internal use only and should never be called - * directly. - * - * @param array $context - * - * @return Twig_TemplateInterface|Twig_TemplateWrapper|false The parent template or false if there is no parent - * - * @internal - */ - public function getParent(array $context) - { - if (null !== $this->parent) { - return $this->parent; - } - - try { - $parent = $this->doGetParent($context); - - if (false === $parent) { - return false; - } - - if ($parent instanceof self || $parent instanceof Twig_TemplateWrapper) { - return $this->parents[$parent->getSourceContext()->getName()] = $parent; - } - - if (!isset($this->parents[$parent])) { - $this->parents[$parent] = $this->loadTemplate($parent); - } - } catch (Twig_Error_Loader $e) { - $e->setSourceContext(null); - $e->guess(); - - throw $e; - } - - return $this->parents[$parent]; - } - - protected function doGetParent(array $context) - { - return false; - } - - public function isTraitable() - { - return true; - } - - /** - * Displays a parent block. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The block name to display from the parent - * @param array $context The context - * @param array $blocks The current set of blocks - * - * @internal - */ - public function displayParentBlock($name, array $context, array $blocks = []) - { - $name = (string) $name; - - if (isset($this->traits[$name])) { - $this->traits[$name][0]->displayBlock($name, $context, $blocks, false); - } elseif (false !== $parent = $this->getParent($context)) { - $parent->displayBlock($name, $context, $blocks, false); - } else { - throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getSourceContext()); - } - } - - /** - * Displays a block. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The block name to display - * @param array $context The context - * @param array $blocks The current set of blocks - * @param bool $useBlocks Whether to use the current set of blocks - * - * @internal - */ - public function displayBlock($name, array $context, array $blocks = [], $useBlocks = true) - { - $name = (string) $name; - - if ($useBlocks && isset($blocks[$name])) { - $template = $blocks[$name][0]; - $block = $blocks[$name][1]; - } elseif (isset($this->blocks[$name])) { - $template = $this->blocks[$name][0]; - $block = $this->blocks[$name][1]; - } else { - $template = null; - $block = null; - } - - // avoid RCEs when sandbox is enabled - if (null !== $template && !$template instanceof self) { - throw new LogicException('A block must be a method on a Twig_Template instance.'); - } - - if (null !== $template) { - try { - $template->$block($context, $blocks); - } catch (Twig_Error $e) { - if (!$e->getSourceContext()) { - $e->setSourceContext($template->getSourceContext()); - } - - // this is mostly useful for Twig_Error_Loader exceptions - // see Twig_Error_Loader - if (false === $e->getTemplateLine()) { - $e->setTemplateLine(-1); - $e->guess(); - } - - throw $e; - } catch (Exception $e) { - throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e); - } - } elseif (false !== $parent = $this->getParent($context)) { - $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false); - } else { - @trigger_error(sprintf('Silent display of undefined block "%s" in template "%s" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block(\'%s\') is defined" expression to test for block existence.', $name, $this->getTemplateName(), $name), E_USER_DEPRECATED); - } - } - - /** - * Renders a parent block. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The block name to render from the parent - * @param array $context The context - * @param array $blocks The current set of blocks - * - * @return string The rendered block - * - * @internal - */ - public function renderParentBlock($name, array $context, array $blocks = []) - { - ob_start(); - $this->displayParentBlock($name, $context, $blocks); - - return ob_get_clean(); - } - - /** - * Renders a block. - * - * This method is for internal use only and should never be called - * directly. - * - * @param string $name The block name to render - * @param array $context The context - * @param array $blocks The current set of blocks - * @param bool $useBlocks Whether to use the current set of blocks - * - * @return string The rendered block - * - * @internal - */ - public function renderBlock($name, array $context, array $blocks = [], $useBlocks = true) - { - ob_start(); - $this->displayBlock($name, $context, $blocks, $useBlocks); - - return ob_get_clean(); - } - - /** - * Returns whether a block exists or not in the current context of the template. - * - * This method checks blocks defined in the current template - * or defined in "used" traits or defined in parent templates. - * - * @param string $name The block name - * @param array $context The context - * @param array $blocks The current set of blocks - * - * @return bool true if the block exists, false otherwise - * - * @internal - */ - public function hasBlock($name, array $context = null, array $blocks = []) - { - if (null === $context) { - @trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED); - - return isset($this->blocks[(string) $name]); - } - - if (isset($blocks[$name])) { - return $blocks[$name][0] instanceof self; - } - - if (isset($this->blocks[$name])) { - return true; - } - - if (false !== $parent = $this->getParent($context)) { - return $parent->hasBlock($name, $context); - } - - return false; - } - - /** - * Returns all block names in the current context of the template. - * - * This method checks blocks defined in the current template - * or defined in "used" traits or defined in parent templates. - * - * @param array $context The context - * @param array $blocks The current set of blocks - * - * @return array An array of block names - * - * @internal - */ - public function getBlockNames(array $context = null, array $blocks = []) - { - if (null === $context) { - @trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED); - - return array_keys($this->blocks); - } - - $names = array_merge(array_keys($blocks), array_keys($this->blocks)); - - if (false !== $parent = $this->getParent($context)) { - $names = array_merge($names, $parent->getBlockNames($context)); - } - - return array_unique($names); - } - - protected function loadTemplate($template, $templateName = null, $line = null, $index = null) - { - try { - if (is_array($template)) { - return $this->env->resolveTemplate($template); - } - - if ($template instanceof self || $template instanceof Twig_TemplateWrapper) { - return $template; - } - - return $this->env->loadTemplate($template, $index); - } catch (Twig_Error $e) { - if (!$e->getSourceContext()) { - $e->setSourceContext($templateName ? new Twig_Source('', $templateName) : $this->getSourceContext()); - } - - if ($e->getTemplateLine()) { - throw $e; - } - - if (!$line) { - $e->guess(); - } else { - $e->setTemplateLine($line); - } - - throw $e; - } - } - - /** - * Returns all blocks. - * - * This method is for internal use only and should never be called - * directly. - * - * @return array An array of blocks - * - * @internal - */ - public function getBlocks() - { - return $this->blocks; - } - - public function display(array $context, array $blocks = []) - { - $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks)); - } - - public function render(array $context) - { - $level = ob_get_level(); - ob_start(); - try { - $this->display($context); - } catch (Exception $e) { - while (ob_get_level() > $level) { - ob_end_clean(); - } - - throw $e; - } catch (Throwable $e) { - while (ob_get_level() > $level) { - ob_end_clean(); - } - - throw $e; - } - - return ob_get_clean(); - } - - protected function displayWithErrorHandling(array $context, array $blocks = []) - { - try { - $this->doDisplay($context, $blocks); - } catch (Twig_Error $e) { - if (!$e->getSourceContext()) { - $e->setSourceContext($this->getSourceContext()); - } - - // this is mostly useful for Twig_Error_Loader exceptions - // see Twig_Error_Loader - if (false === $e->getTemplateLine()) { - $e->setTemplateLine(-1); - $e->guess(); - } - - throw $e; - } catch (Exception $e) { - throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e); - } - } - - /** - * Auto-generated method to display the template with the given context. - * - * @param array $context An array of parameters to pass to the template - * @param array $blocks An array of blocks to pass to the template - */ - abstract protected function doDisplay(array $context, array $blocks = []); - - /** - * Returns a variable from the context. - * - * This method is for internal use only and should never be called - * directly. - * - * This method should not be overridden in a sub-class as this is an - * implementation detail that has been introduced to optimize variable - * access for versions of PHP before 5.4. This is not a way to override - * the way to get a variable value. - * - * @param array $context The context - * @param string $item The variable to return from the context - * @param bool $ignoreStrictCheck Whether to ignore the strict variable check or not - * - * @return mixed The content of the context variable - * - * @throws Twig_Error_Runtime if the variable does not exist and Twig is running in strict mode - * - * @internal - */ - final protected function getContext($context, $item, $ignoreStrictCheck = false) - { - if (!array_key_exists($item, $context)) { - if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return; - } - - throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist.', $item), -1, $this->getSourceContext()); - } - - return $context[$item]; - } - - /** - * Returns the attribute value for a given array/object. - * - * @param mixed $object The object or array from where to get the item - * @param mixed $item The item to get from the array or object - * @param array $arguments An array of arguments to pass if the item is an object method - * @param string $type The type of attribute (@see Twig_Template constants) - * @param bool $isDefinedTest Whether this is only a defined check - * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not - * - * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true - * - * @throws Twig_Error_Runtime if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false - * - * @internal - */ - protected function getAttribute($object, $item, array $arguments = [], $type = self::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) - { - // array - if (self::METHOD_CALL !== $type) { - $arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item; - - if (((is_array($object) || $object instanceof ArrayObject) && (isset($object[$arrayItem]) || array_key_exists($arrayItem, $object))) - || ($object instanceof ArrayAccess && isset($object[$arrayItem])) - ) { - if ($isDefinedTest) { - return true; - } - - return $object[$arrayItem]; - } - - if (self::ARRAY_CALL === $type || !is_object($object)) { - if ($isDefinedTest) { - return false; - } - - if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return; - } - - if ($object instanceof ArrayAccess) { - $message = sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist.', $arrayItem, get_class($object)); - } elseif (is_object($object)) { - $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface.', $item, get_class($object)); - } elseif (is_array($object)) { - if (empty($object)) { - $message = sprintf('Key "%s" does not exist as the array is empty.', $arrayItem); - } else { - $message = sprintf('Key "%s" for array with keys "%s" does not exist.', $arrayItem, implode(', ', array_keys($object))); - } - } elseif (self::ARRAY_CALL === $type) { - if (null === $object) { - $message = sprintf('Impossible to access a key ("%s") on a null variable.', $item); - } else { - $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s").', $item, gettype($object), $object); - } - } elseif (null === $object) { - $message = sprintf('Impossible to access an attribute ("%s") on a null variable.', $item); - } else { - $message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s").', $item, gettype($object), $object); - } - - throw new Twig_Error_Runtime($message, -1, $this->getSourceContext()); - } - } - - if (!is_object($object)) { - if ($isDefinedTest) { - return false; - } - - if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return; - } - - if (null === $object) { - $message = sprintf('Impossible to invoke a method ("%s") on a null variable.', $item); - } elseif (is_array($object)) { - $message = sprintf('Impossible to invoke a method ("%s") on an array.', $item); - } else { - $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, gettype($object), $object); - } - - throw new Twig_Error_Runtime($message, -1, $this->getSourceContext()); - } - - // object property - if (self::METHOD_CALL !== $type && !$object instanceof self) { // Twig_Template does not have public properties, and we don't want to allow access to internal ones - if (isset($object->$item) || array_key_exists((string) $item, $object)) { - if ($isDefinedTest) { - return true; - } - - if ($this->env->hasExtension('Twig_Extension_Sandbox')) { - $this->env->getExtension('Twig_Extension_Sandbox')->checkPropertyAllowed($object, $item); - } - - return $object->$item; - } - } - - $class = get_class($object); - - // object method - if (!isset(self::$cache[$class])) { - // get_class_methods returns all methods accessible in the scope, but we only want public ones to be accessible in templates - if ($object instanceof self) { - $ref = new ReflectionClass($class); - $methods = []; - - foreach ($ref->getMethods(ReflectionMethod::IS_PUBLIC) as $refMethod) { - // Accessing the environment from templates is forbidden to prevent untrusted changes to the environment - if ('getenvironment' !== strtolower($refMethod->name)) { - $methods[] = $refMethod->name; - } - } - } else { - $methods = get_class_methods($object); - } - // sort values to have consistent behavior, so that "get" methods win precedence over "is" methods - sort($methods); - - $cache = []; - - foreach ($methods as $method) { - $cache[$method] = $method; - $cache[$lcName = strtolower($method)] = $method; - - if ('g' === $lcName[0] && 0 === strpos($lcName, 'get')) { - $name = substr($method, 3); - $lcName = substr($lcName, 3); - } elseif ('i' === $lcName[0] && 0 === strpos($lcName, 'is')) { - $name = substr($method, 2); - $lcName = substr($lcName, 2); - } else { - continue; - } - - // skip get() and is() methods (in which case, $name is empty) - if ($name) { - if (!isset($cache[$name])) { - $cache[$name] = $method; - } - if (!isset($cache[$lcName])) { - $cache[$lcName] = $method; - } - } - } - self::$cache[$class] = $cache; - } - - $call = false; - if (isset(self::$cache[$class][$item])) { - $method = self::$cache[$class][$item]; - } elseif (isset(self::$cache[$class][$lcItem = strtolower($item)])) { - $method = self::$cache[$class][$lcItem]; - } elseif (isset(self::$cache[$class]['__call'])) { - $method = $item; - $call = true; - } else { - if ($isDefinedTest) { - return false; - } - - if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return; - } - - throw new Twig_Error_Runtime(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext()); - } - - if ($isDefinedTest) { - return true; - } - - if ($this->env->hasExtension('Twig_Extension_Sandbox')) { - $this->env->getExtension('Twig_Extension_Sandbox')->checkMethodAllowed($object, $method); - } - - // Some objects throw exceptions when they have __call, and the method we try - // to call is not supported. If ignoreStrictCheck is true, we should return null. - try { - if (!$arguments) { - $ret = $object->$method(); - } else { - $ret = call_user_func_array([$object, $method], $arguments); - } - } catch (BadMethodCallException $e) { - if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) { - return; - } - throw $e; - } - - // @deprecated in 1.28 - if ($object instanceof Twig_TemplateInterface) { - $self = $object->getTemplateName() === $this->getTemplateName(); - $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName()); - if ('renderBlock' === $method || 'displayBlock' === $method) { - $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template'); - } elseif ('hasBlock' === $method) { - $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template'); - } elseif ('render' === $method || 'display' === $method) { - $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName()); - } - @trigger_error($message, E_USER_DEPRECATED); - - return '' === $ret ? '' : new Twig_Markup($ret, $this->env->getCharset()); - } - - return $ret; } } - -class_alias('Twig_Template', 'Twig\Template', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TemplateInterface.php --- a/vendor/twig/twig/lib/Twig/TemplateInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TemplateInterface.php Thu May 09 15:33:08 2019 +0100 @@ -9,6 +9,8 @@ * file that was distributed with this source code. */ +use Twig\Environment; + /** * Interface implemented by all compiled templates. * @@ -42,7 +44,7 @@ /** * Returns the bound environment for this template. * - * @return Twig_Environment + * @return Environment */ public function getEnvironment(); } diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TemplateWrapper.php --- a/vendor/twig/twig/lib/Twig/TemplateWrapper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TemplateWrapper.php Thu May 09 15:33:08 2019 +0100 @@ -1,137 +1,11 @@ - */ -final class Twig_TemplateWrapper -{ - private $env; - private $template; +class_exists('Twig\TemplateWrapper'); - /** - * This method is for internal use only and should never be called - * directly (use Twig_Environment::load() instead). - * - * @internal - */ - public function __construct(Twig_Environment $env, Twig_Template $template) +if (\false) { + class Twig_TemplateWrapper extends TemplateWrapper { - $this->env = $env; - $this->template = $template; - } - - /** - * Renders the template. - * - * @param array $context An array of parameters to pass to the template - * - * @return string The rendered template - */ - public function render($context = []) - { - // using func_get_args() allows to not expose the blocks argument - // as it should only be used by internal code - return $this->template->render($context, func_num_args() > 1 ? func_get_arg(1) : []); - } - - /** - * Displays the template. - * - * @param array $context An array of parameters to pass to the template - */ - public function display($context = []) - { - // using func_get_args() allows to not expose the blocks argument - // as it should only be used by internal code - $this->template->display($context, func_num_args() >= 1 ? func_get_arg(1) : []); - } - - /** - * Checks if a block is defined. - * - * @param string $name The block name - * @param array $context An array of parameters to pass to the template - * - * @return bool - */ - public function hasBlock($name, $context = []) - { - return $this->template->hasBlock($name, $context); - } - - /** - * Returns defined block names in the template. - * - * @param array $context An array of parameters to pass to the template - * - * @return string[] An array of defined template block names - */ - public function getBlockNames($context = []) - { - return $this->template->getBlockNames($context); - } - - /** - * Renders a template block. - * - * @param string $name The block name to render - * @param array $context An array of parameters to pass to the template - * - * @return string The rendered block - */ - public function renderBlock($name, $context = []) - { - $context = $this->env->mergeGlobals($context); - $level = ob_get_level(); - ob_start(); - try { - $this->template->displayBlock($name, $context); - } catch (Exception $e) { - while (ob_get_level() > $level) { - ob_end_clean(); - } - - throw $e; - } catch (Throwable $e) { - while (ob_get_level() > $level) { - ob_end_clean(); - } - - throw $e; - } - - return ob_get_clean(); - } - - /** - * Displays a template block. - * - * @param string $name The block name to render - * @param array $context An array of parameters to pass to the template - */ - public function displayBlock($name, $context = []) - { - $this->template->displayBlock($name, $this->env->mergeGlobals($context)); - } - - /** - * @return Twig_Source - */ - public function getSourceContext() - { - return $this->template->getSourceContext(); } } - -class_alias('Twig_TemplateWrapper', 'Twig\TemplateWrapper', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Test.php --- a/vendor/twig/twig/lib/Twig/Test.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Test.php Thu May 09 15:33:08 2019 +0100 @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Test class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED); +@trigger_error('The Twig_Test class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED); /** * Represents a template test. diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Test/Function.php --- a/vendor/twig/twig/lib/Twig/Test/Function.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Test/Function.php Thu May 09 15:33:08 2019 +0100 @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Test_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED); +@trigger_error('The Twig_Test_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED); /** * Represents a function template test. diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php --- a/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php Thu May 09 15:33:08 2019 +0100 @@ -1,245 +1,11 @@ - * @author Karma Dordrak - */ -abstract class Twig_Test_IntegrationTestCase extends TestCase -{ - /** - * @return string - */ - abstract protected function getFixturesDir(); - - /** - * @return Twig_RuntimeLoaderInterface[] - */ - protected function getRuntimeLoaders() +if (\false) { + class Twig_Test_IntegrationTestCase extends IntegrationTestCase { - return []; - } - - /** - * @return Twig_ExtensionInterface[] - */ - protected function getExtensions() - { - return []; - } - - /** - * @return Twig_SimpleFilter[] - */ - protected function getTwigFilters() - { - return []; - } - - /** - * @return Twig_SimpleFunction[] - */ - protected function getTwigFunctions() - { - return []; - } - - /** - * @return Twig_SimpleTest[] - */ - protected function getTwigTests() - { - return []; - } - - /** - * @dataProvider getTests - */ - public function testIntegration($file, $message, $condition, $templates, $exception, $outputs) - { - $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs); - } - - /** - * @dataProvider getLegacyTests - * @group legacy - */ - public function testLegacyIntegration($file, $message, $condition, $templates, $exception, $outputs) - { - $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs); - } - - public function getTests($name, $legacyTests = false) - { - $fixturesDir = realpath($this->getFixturesDir()); - $tests = []; - - foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fixturesDir), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { - if (!preg_match('/\.test$/', $file)) { - continue; - } - - if ($legacyTests xor false !== strpos($file->getRealpath(), '.legacy.test')) { - continue; - } - - $test = file_get_contents($file->getRealpath()); - - if (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) { - $message = $match[1]; - $condition = $match[2]; - $templates = self::parseTemplates($match[3]); - $exception = $match[5]; - $outputs = [[null, $match[4], null, '']]; - } elseif (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) { - $message = $match[1]; - $condition = $match[2]; - $templates = self::parseTemplates($match[3]); - $exception = false; - preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER); - } else { - throw new InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); - } - - $tests[] = [str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs]; - } - - if ($legacyTests && empty($tests)) { - // add a dummy test to avoid a PHPUnit message - return [['not', '-', '', [], '', []]]; - } - - return $tests; - } - - public function getLegacyTests() - { - return $this->getTests('testLegacyIntegration', true); - } - - protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs) - { - if (!$outputs) { - $this->markTestSkipped('no tests to run'); - } - - if ($condition) { - eval('$ret = '.$condition.';'); - if (!$ret) { - $this->markTestSkipped($condition); - } - } - - $loader = new Twig_Loader_Array($templates); - - foreach ($outputs as $i => $match) { - $config = array_merge([ - 'cache' => false, - 'strict_variables' => true, - ], $match[2] ? eval($match[2].';') : []); - $twig = new Twig_Environment($loader, $config); - $twig->addGlobal('global', 'global'); - foreach ($this->getRuntimeLoaders() as $runtimeLoader) { - $twig->addRuntimeLoader($runtimeLoader); - } - - foreach ($this->getExtensions() as $extension) { - $twig->addExtension($extension); - } - - foreach ($this->getTwigFilters() as $filter) { - $twig->addFilter($filter); - } - - foreach ($this->getTwigTests() as $test) { - $twig->addTest($test); - } - - foreach ($this->getTwigFunctions() as $function) { - $twig->addFunction($function); - } - - $p = new ReflectionProperty($twig, 'templateClassPrefix'); - $p->setAccessible(true); - $p->setValue($twig, '__TwigTemplate_'.hash('sha256', uniqid(mt_rand(), true), false).'_'); - - try { - $template = $twig->loadTemplate('index.twig'); - } catch (Exception $e) { - if (false !== $exception) { - $message = $e->getMessage(); - $this->assertSame(trim($exception), trim(sprintf('%s: %s', get_class($e), $message))); - $last = substr($message, strlen($message) - 1); - $this->assertTrue('.' === $last || '?' === $last, $message, 'Exception message must end with a dot or a question mark.'); - - return; - } - - throw new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e); - } - - try { - $output = trim($template->render(eval($match[1].';')), "\n "); - } catch (Exception $e) { - if (false !== $exception) { - $this->assertSame(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage()))); - - return; - } - - $e = new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e); - - $output = trim(sprintf('%s: %s', get_class($e), $e->getMessage())); - } - - if (false !== $exception) { - list($class) = explode(':', $exception); - $constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception'; - $this->assertThat(null, new $constraintClass($class)); - } - - $expected = trim($match[3], "\n "); - - if ($expected !== $output) { - printf("Compiled templates that failed on case %d:\n", $i + 1); - - foreach (array_keys($templates) as $name) { - echo "Template: $name\n"; - $loader = $twig->getLoader(); - if (!$loader instanceof Twig_SourceContextLoaderInterface) { - $source = new Twig_Source($loader->getSource($name), $name); - } else { - $source = $loader->getSourceContext($name); - } - echo $twig->compile($twig->parse($twig->tokenize($source))); - } - } - $this->assertEquals($expected, $output, $message.' (in '.$file.')'); - } - } - - protected static function parseTemplates($test) - { - $templates = []; - preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER); - foreach ($matches as $match) { - $templates[($match[1] ? $match[1] : 'index.twig')] = $match[2]; - } - - return $templates; } } - -class_alias('Twig_Test_IntegrationTestCase', 'Twig\Test\IntegrationTestCase', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Test/Method.php --- a/vendor/twig/twig/lib/Twig/Test/Method.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Test/Method.php Thu May 09 15:33:08 2019 +0100 @@ -9,7 +9,9 @@ * file that was distributed with this source code. */ -@trigger_error('The Twig_Test_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED); +use Twig\Extension\ExtensionInterface; + +@trigger_error('The Twig_Test_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED); /** * Represents a method template test. @@ -23,7 +25,7 @@ protected $extension; protected $method; - public function __construct(Twig_ExtensionInterface $extension, $method, array $options = []) + public function __construct(ExtensionInterface $extension, $method, array $options = []) { $options['callable'] = [$extension, $method]; @@ -35,6 +37,6 @@ public function compile() { - return sprintf('$this->env->getExtension(\'%s\')->%s', get_class($this->extension), $this->method); + return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Test/NodeTestCase.php --- a/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php Thu May 09 15:33:08 2019 +0100 @@ -1,75 +1,11 @@ assertNodeCompilation($source, $node, $environment, $isPattern); - } - - public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null, $isPattern = false) - { - $compiler = $this->getCompiler($environment); - $compiler->compile($node); - - if ($isPattern) { - $this->assertStringMatchesFormat($source, trim($compiler->getSource())); - } else { - $this->assertEquals($source, trim($compiler->getSource())); - } - } - - protected function getCompiler(Twig_Environment $environment = null) - { - return new Twig_Compiler(null === $environment ? $this->getEnvironment() : $environment); - } - - protected function getEnvironment() - { - return new Twig_Environment(new Twig_Loader_Array([])); - } - - protected function getVariableGetter($name, $line = false) - { - $line = $line > 0 ? "// line {$line}\n" : ''; - - if (PHP_VERSION_ID >= 70000) { - return sprintf('%s($context["%s"] ?? null)', $line, $name, $name); - } - - if (PHP_VERSION_ID >= 50400) { - return sprintf('%s(isset($context["%s"]) ? $context["%s"] : null)', $line, $name, $name); - } - - return sprintf('%s$this->getContext($context, "%s")', $line, $name); - } - - protected function getAttributeGetter() - { - if (function_exists('twig_template_get_attributes')) { - return 'twig_template_get_attributes($this, '; - } - - return '$this->getAttribute('; } } - -class_alias('Twig_Test_NodeTestCase', 'Twig\Test\NodeTestCase', false); -class_exists('Twig_Environment'); -class_exists('Twig_Node'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Token.php --- a/vendor/twig/twig/lib/Twig/Token.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Token.php Thu May 09 15:33:08 2019 +0100 @@ -1,207 +1,11 @@ - * - * @final - */ -class Twig_Token -{ - protected $value; - protected $type; - protected $lineno; +class_exists('Twig\Token'); - const EOF_TYPE = -1; - const TEXT_TYPE = 0; - const BLOCK_START_TYPE = 1; - const VAR_START_TYPE = 2; - const BLOCK_END_TYPE = 3; - const VAR_END_TYPE = 4; - const NAME_TYPE = 5; - const NUMBER_TYPE = 6; - const STRING_TYPE = 7; - const OPERATOR_TYPE = 8; - const PUNCTUATION_TYPE = 9; - const INTERPOLATION_START_TYPE = 10; - const INTERPOLATION_END_TYPE = 11; - - /** - * @param int $type The type of the token - * @param string $value The token value - * @param int $lineno The line position in the source - */ - public function __construct($type, $value, $lineno) +if (\false) { + class Twig_Token extends Token { - $this->type = $type; - $this->value = $value; - $this->lineno = $lineno; - } - - public function __toString() - { - return sprintf('%s(%s)', self::typeToString($this->type, true), $this->value); - } - - /** - * Tests the current token for a type and/or a value. - * - * Parameters may be: - * * just type - * * type and value (or array of possible values) - * * just value (or array of possible values) (NAME_TYPE is used as type) - * - * @param array|string|int $type The type to test - * @param array|string|null $values The token value - * - * @return bool - */ - public function test($type, $values = null) - { - if (null === $values && !is_int($type)) { - $values = $type; - $type = self::NAME_TYPE; - } - - return ($this->type === $type) && ( - null === $values || - (is_array($values) && in_array($this->value, $values)) || - $this->value == $values - ); - } - - /** - * @return int - */ - public function getLine() - { - return $this->lineno; - } - - /** - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Returns the constant representation (internal) of a given type. - * - * @param int $type The type as an integer - * @param bool $short Whether to return a short representation or not - * - * @return string The string representation - */ - public static function typeToString($type, $short = false) - { - switch ($type) { - case self::EOF_TYPE: - $name = 'EOF_TYPE'; - break; - case self::TEXT_TYPE: - $name = 'TEXT_TYPE'; - break; - case self::BLOCK_START_TYPE: - $name = 'BLOCK_START_TYPE'; - break; - case self::VAR_START_TYPE: - $name = 'VAR_START_TYPE'; - break; - case self::BLOCK_END_TYPE: - $name = 'BLOCK_END_TYPE'; - break; - case self::VAR_END_TYPE: - $name = 'VAR_END_TYPE'; - break; - case self::NAME_TYPE: - $name = 'NAME_TYPE'; - break; - case self::NUMBER_TYPE: - $name = 'NUMBER_TYPE'; - break; - case self::STRING_TYPE: - $name = 'STRING_TYPE'; - break; - case self::OPERATOR_TYPE: - $name = 'OPERATOR_TYPE'; - break; - case self::PUNCTUATION_TYPE: - $name = 'PUNCTUATION_TYPE'; - break; - case self::INTERPOLATION_START_TYPE: - $name = 'INTERPOLATION_START_TYPE'; - break; - case self::INTERPOLATION_END_TYPE: - $name = 'INTERPOLATION_END_TYPE'; - break; - default: - throw new LogicException(sprintf('Token of type "%s" does not exist.', $type)); - } - - return $short ? $name : 'Twig_Token::'.$name; - } - - /** - * Returns the English representation of a given type. - * - * @param int $type The type as an integer - * - * @return string The string representation - */ - public static function typeToEnglish($type) - { - switch ($type) { - case self::EOF_TYPE: - return 'end of template'; - case self::TEXT_TYPE: - return 'text'; - case self::BLOCK_START_TYPE: - return 'begin of statement block'; - case self::VAR_START_TYPE: - return 'begin of print statement'; - case self::BLOCK_END_TYPE: - return 'end of statement block'; - case self::VAR_END_TYPE: - return 'end of print statement'; - case self::NAME_TYPE: - return 'name'; - case self::NUMBER_TYPE: - return 'number'; - case self::STRING_TYPE: - return 'string'; - case self::OPERATOR_TYPE: - return 'operator'; - case self::PUNCTUATION_TYPE: - return 'punctuation'; - case self::INTERPOLATION_START_TYPE: - return 'begin of string interpolation'; - case self::INTERPOLATION_END_TYPE: - return 'end of string interpolation'; - default: - throw new LogicException(sprintf('Token of type "%s" does not exist.', $type)); - } } } - -class_alias('Twig_Token', 'Twig\Token', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser.php --- a/vendor/twig/twig/lib/Twig/TokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,33 +1,11 @@ - */ -abstract class Twig_TokenParser implements Twig_TokenParserInterface -{ - /** - * @var Twig_Parser - */ - protected $parser; +class_exists('Twig\TokenParser\AbstractTokenParser'); - /** - * Sets the parser associated with this token parser. - */ - public function setParser(Twig_Parser $parser) +if (\false) { + class Twig_TokenParser extends AbstractTokenParser { - $this->parser = $parser; } } - -class_alias('Twig_TokenParser', 'Twig\TokenParser\AbstractTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php --- a/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php Thu May 09 15:33:08 2019 +0100 @@ -1,83 +1,11 @@ - * {% autoescape true %} - * Everything will be automatically escaped in this block - * {% endautoescape %} - * - * {% autoescape false %} - * Everything will be outputed as is in this block - * {% endautoescape %} - * - * {% autoescape true js %} - * Everything will be automatically escaped in this block - * using the js escaping strategy - * {% endautoescape %} - * - * - * @final - */ -class Twig_TokenParser_AutoEscape extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\AutoEscapeTokenParser'); + +if (\false) { + class Twig_TokenParser_AutoEscape extends AutoEscapeTokenParser { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - - if ($stream->test(Twig_Token::BLOCK_END_TYPE)) { - $value = 'html'; - } else { - $expr = $this->parser->getExpressionParser()->parseExpression(); - if (!$expr instanceof Twig_Node_Expression_Constant) { - throw new Twig_Error_Syntax('An escaping strategy must be a string or a bool.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - $value = $expr->getAttribute('value'); - - $compat = true === $value || false === $value; - - if (true === $value) { - $value = 'html'; - } - - if ($compat && $stream->test(Twig_Token::NAME_TYPE)) { - @trigger_error('Using the autoescape tag with "true" or "false" before the strategy name is deprecated since version 1.21.', E_USER_DEPRECATED); - - if (false === $value) { - throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - - $value = $stream->next()->getValue(); - } - } - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_AutoEscape($value, $body, $lineno, $this->getTag()); - } - - public function decideBlockEnd(Twig_Token $token) - { - return $token->test('endautoescape'); - } - - public function getTag() - { - return 'autoescape'; } } - -class_alias('Twig_TokenParser_AutoEscape', 'Twig\TokenParser\AutoEscapeTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Block.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Block.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Block.php Thu May 09 15:33:08 2019 +0100 @@ -1,73 +1,11 @@ - * {% block head %} - * - * {% block title %}{% endblock %} - My Webpage - * {% endblock %} - * - * - * @final - */ -class Twig_TokenParser_Block extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\BlockTokenParser'); + +if (\false) { + class Twig_TokenParser_Block extends BlockTokenParser { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); - if ($this->parser->hasBlock($name)) { - throw new Twig_Error_Syntax(sprintf("The block '%s' has already been defined line %d.", $name, $this->parser->getBlock($name)->getTemplateLine()), $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - $this->parser->setBlock($name, $block = new Twig_Node_Block($name, new Twig_Node([]), $lineno)); - $this->parser->pushLocalScope(); - $this->parser->pushBlockStack($name); - - if ($stream->nextIf(Twig_Token::BLOCK_END_TYPE)) { - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - if ($token = $stream->nextIf(Twig_Token::NAME_TYPE)) { - $value = $token->getValue(); - - if ($value != $name) { - throw new Twig_Error_Syntax(sprintf('Expected endblock for block "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - } - } else { - $body = new Twig_Node([ - new Twig_Node_Print($this->parser->getExpressionParser()->parseExpression(), $lineno), - ]); - } - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - $block->setNode('body', $body); - $this->parser->popBlockStack(); - $this->parser->popLocalScope(); - - return new Twig_Node_BlockReference($name, $lineno, $this->getTag()); - } - - public function decideBlockEnd(Twig_Token $token) - { - return $token->test('endblock'); - } - - public function getTag() - { - return 'block'; } } - -class_alias('Twig_TokenParser_Block', 'Twig\TokenParser\BlockTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Deprecated.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Deprecated.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Deprecated.php Thu May 09 15:33:08 2019 +0100 @@ -1,42 +1,11 @@ - * {% deprecated 'The "base.twig" template is deprecated, use "layout.twig" instead.' %} - * - * {% extends 'layout.html.twig' %} - * - * - * @author Yonel Ceruto - * - * @final - */ -class Twig_TokenParser_Deprecated extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\DeprecatedTokenParser'); + +if (\false) { + class Twig_TokenParser_Deprecated extends DeprecatedTokenParser { - $expr = $this->parser->getExpressionParser()->parseExpression(); - - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_Deprecated($expr, $token->getLine(), $this->getTag()); - } - - public function getTag() - { - return 'deprecated'; } } - -class_alias('Twig_TokenParser_Deprecated', 'Twig\TokenParser\DeprecatedTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Do.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Do.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Do.php Thu May 09 15:33:08 2019 +0100 @@ -1,34 +1,11 @@ parser->getExpressionParser()->parseExpression(); - - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_Do($expr, $token->getLine(), $this->getTag()); - } - - public function getTag() - { - return 'do'; } } - -class_alias('Twig_TokenParser_Do', 'Twig\TokenParser\DoTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Embed.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Embed.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Embed.php Thu May 09 15:33:08 2019 +0100 @@ -1,67 +1,11 @@ parser->getStream(); - - $parent = $this->parser->getExpressionParser()->parseExpression(); - - list($variables, $only, $ignoreMissing) = $this->parseArguments(); - - $parentToken = $fakeParentToken = new Twig_Token(Twig_Token::STRING_TYPE, '__parent__', $token->getLine()); - if ($parent instanceof Twig_Node_Expression_Constant) { - $parentToken = new Twig_Token(Twig_Token::STRING_TYPE, $parent->getAttribute('value'), $token->getLine()); - } elseif ($parent instanceof Twig_Node_Expression_Name) { - $parentToken = new Twig_Token(Twig_Token::NAME_TYPE, $parent->getAttribute('name'), $token->getLine()); - } - - // inject a fake parent to make the parent() function work - $stream->injectTokens([ - new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', $token->getLine()), - new Twig_Token(Twig_Token::NAME_TYPE, 'extends', $token->getLine()), - $parentToken, - new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', $token->getLine()), - ]); - - $module = $this->parser->parse($stream, [$this, 'decideBlockEnd'], true); - - // override the parent with the correct one - if ($fakeParentToken === $parentToken) { - $module->setNode('parent', $parent); - } - - $this->parser->embedTemplate($module); - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_Embed($module->getTemplateName(), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); - } - - public function decideBlockEnd(Twig_Token $token) - { - return $token->test('endembed'); - } - - public function getTag() - { - return 'embed'; } } - -class_alias('Twig_TokenParser_Embed', 'Twig\TokenParser\EmbedTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Extends.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Extends.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Extends.php Thu May 09 15:33:08 2019 +0100 @@ -1,46 +1,11 @@ - * {% extends "base.html" %} - * - * - * @final - */ -class Twig_TokenParser_Extends extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\ExtendsTokenParser'); + +if (\false) { + class Twig_TokenParser_Extends extends ExtendsTokenParser { - $stream = $this->parser->getStream(); - - if (!$this->parser->isMainScope()) { - throw new Twig_Error_Syntax('Cannot extend from a block.', $token->getLine(), $stream->getSourceContext()); - } - - if (null !== $this->parser->getParent()) { - throw new Twig_Error_Syntax('Multiple extends tags are forbidden.', $token->getLine(), $stream->getSourceContext()); - } - $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - } - - public function getTag() - { - return 'extends'; } } - -class_alias('Twig_TokenParser_Extends', 'Twig\TokenParser\ExtendsTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Filter.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Filter.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Filter.php Thu May 09 15:33:08 2019 +0100 @@ -1,53 +1,11 @@ - * {% filter upper %} - * This text becomes uppercase - * {% endfilter %} - * - * - * @final - */ -class Twig_TokenParser_Filter extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\FilterTokenParser'); + +if (\false) { + class Twig_TokenParser_Filter extends FilterTokenParser { - $name = $this->parser->getVarName(); - $ref = new Twig_Node_Expression_BlockReference(new Twig_Node_Expression_Constant($name, $token->getLine()), null, $token->getLine(), $this->getTag()); - - $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - $block = new Twig_Node_Block($name, $body, $token->getLine()); - $this->parser->setBlock($name, $block); - - return new Twig_Node_Print($filter, $token->getLine(), $this->getTag()); - } - - public function decideBlockEnd(Twig_Token $token) - { - return $token->test('endfilter'); - } - - public function getTag() - { - return 'filter'; } } - -class_alias('Twig_TokenParser_Filter', 'Twig\TokenParser\FilterTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Flush.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Flush.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Flush.php Thu May 09 15:33:08 2019 +0100 @@ -1,34 +1,11 @@ parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_Flush($token->getLine(), $this->getTag()); - } - - public function getTag() - { - return 'flush'; } } - -class_alias('Twig_TokenParser_Flush', 'Twig\TokenParser\FlushTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/For.php --- a/vendor/twig/twig/lib/Twig/TokenParser/For.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/For.php Thu May 09 15:33:08 2019 +0100 @@ -1,127 +1,11 @@ - *
      - * {% for user in users %} - *
    • {{ user.username|e }}
    • - * {% endfor %} - *
    - * - * - * @final - */ -class Twig_TokenParser_For extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\ForTokenParser'); + +if (\false) { + class Twig_TokenParser_For extends ForTokenParser { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - $targets = $this->parser->getExpressionParser()->parseAssignmentExpression(); - $stream->expect(Twig_Token::OPERATOR_TYPE, 'in'); - $seq = $this->parser->getExpressionParser()->parseExpression(); - - $ifexpr = null; - if ($stream->nextIf(Twig_Token::NAME_TYPE, 'if')) { - $ifexpr = $this->parser->getExpressionParser()->parseExpression(); - } - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse([$this, 'decideForFork']); - if ('else' == $stream->next()->getValue()) { - $stream->expect(Twig_Token::BLOCK_END_TYPE); - $else = $this->parser->subparse([$this, 'decideForEnd'], true); - } else { - $else = null; - } - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - if (count($targets) > 1) { - $keyTarget = $targets->getNode(0); - $keyTarget = new Twig_Node_Expression_AssignName($keyTarget->getAttribute('name'), $keyTarget->getTemplateLine()); - $valueTarget = $targets->getNode(1); - $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); - } else { - $keyTarget = new Twig_Node_Expression_AssignName('_key', $lineno); - $valueTarget = $targets->getNode(0); - $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); - } - - if ($ifexpr) { - $this->checkLoopUsageCondition($stream, $ifexpr); - $this->checkLoopUsageBody($stream, $body); - } - - return new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag()); - } - - public function decideForFork(Twig_Token $token) - { - return $token->test(['else', 'endfor']); - } - - public function decideForEnd(Twig_Token $token) - { - return $token->test('endfor'); - } - - // the loop variable cannot be used in the condition - protected function checkLoopUsageCondition(Twig_TokenStream $stream, Twig_NodeInterface $node) - { - if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) { - throw new Twig_Error_Syntax('The "loop" variable cannot be used in a looping condition.', $node->getTemplateLine(), $stream->getSourceContext()); - } - - foreach ($node as $n) { - if (!$n) { - continue; - } - - $this->checkLoopUsageCondition($stream, $n); - } - } - - // check usage of non-defined loop-items - // it does not catch all problems (for instance when a for is included into another or when the variable is used in an include) - protected function checkLoopUsageBody(Twig_TokenStream $stream, Twig_NodeInterface $node) - { - if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) { - $attribute = $node->getNode('attribute'); - if ($attribute instanceof Twig_Node_Expression_Constant && in_array($attribute->getAttribute('value'), ['length', 'revindex0', 'revindex', 'last'])) { - throw new Twig_Error_Syntax(sprintf('The "loop.%s" variable is not defined when looping with a condition.', $attribute->getAttribute('value')), $node->getTemplateLine(), $stream->getSourceContext()); - } - } - - // should check for parent.loop.XXX usage - if ($node instanceof Twig_Node_For) { - return; - } - - foreach ($node as $n) { - if (!$n) { - continue; - } - - $this->checkLoopUsageBody($stream, $n); - } - } - - public function getTag() - { - return 'for'; } } - -class_alias('Twig_TokenParser_For', 'Twig\TokenParser\ForTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/From.php --- a/vendor/twig/twig/lib/Twig/TokenParser/From.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/From.php Thu May 09 15:33:08 2019 +0100 @@ -1,66 +1,11 @@ - * {% from 'forms.html' import forms %} - * - * - * @final - */ -class Twig_TokenParser_From extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\FromTokenParser'); + +if (\false) { + class Twig_TokenParser_From extends FromTokenParser { - $macro = $this->parser->getExpressionParser()->parseExpression(); - $stream = $this->parser->getStream(); - $stream->expect('import'); - - $targets = []; - do { - $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); - - $alias = $name; - if ($stream->nextIf('as')) { - $alias = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); - } - - $targets[$name] = $alias; - - if (!$stream->nextIf(Twig_Token::PUNCTUATION_TYPE, ',')) { - break; - } - } while (true); - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - $node = new Twig_Node_Import($macro, new Twig_Node_Expression_AssignName($this->parser->getVarName(), $token->getLine()), $token->getLine(), $this->getTag()); - - foreach ($targets as $name => $alias) { - if ($this->parser->isReservedMacroName($name)) { - throw new Twig_Error_Syntax(sprintf('"%s" cannot be an imported macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext()); - } - - $this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var')); - } - - return $node; - } - - public function getTag() - { - return 'from'; } } - -class_alias('Twig_TokenParser_From', 'Twig\TokenParser\FromTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/If.php --- a/vendor/twig/twig/lib/Twig/TokenParser/If.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/If.php Thu May 09 15:33:08 2019 +0100 @@ -1,86 +1,11 @@ - * {% if users %} - *
      - * {% for user in users %} - *
    • {{ user.username|e }}
    • - * {% endfor %} - *
    - * {% endif %} - * - * - * @final - */ -class Twig_TokenParser_If extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\IfTokenParser'); + +if (\false) { + class Twig_TokenParser_If extends IfTokenParser { - $lineno = $token->getLine(); - $expr = $this->parser->getExpressionParser()->parseExpression(); - $stream = $this->parser->getStream(); - $stream->expect(Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse([$this, 'decideIfFork']); - $tests = [$expr, $body]; - $else = null; - - $end = false; - while (!$end) { - switch ($stream->next()->getValue()) { - case 'else': - $stream->expect(Twig_Token::BLOCK_END_TYPE); - $else = $this->parser->subparse([$this, 'decideIfEnd']); - break; - - case 'elseif': - $expr = $this->parser->getExpressionParser()->parseExpression(); - $stream->expect(Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse([$this, 'decideIfFork']); - $tests[] = $expr; - $tests[] = $body; - break; - - case 'endif': - $end = true; - break; - - default: - throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d).', $lineno), $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - } - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_If(new Twig_Node($tests), $else, $lineno, $this->getTag()); - } - - public function decideIfFork(Twig_Token $token) - { - return $token->test(['elseif', 'else', 'endif']); - } - - public function decideIfEnd(Twig_Token $token) - { - return $token->test(['endif']); - } - - public function getTag() - { - return 'if'; } } - -class_alias('Twig_TokenParser_If', 'Twig\TokenParser\IfTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Import.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Import.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Import.php Thu May 09 15:33:08 2019 +0100 @@ -1,41 +1,11 @@ - * {% import 'forms.html' as forms %} - * - * - * @final - */ -class Twig_TokenParser_Import extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\ImportTokenParser'); + +if (\false) { + class Twig_TokenParser_Import extends ImportTokenParser { - $macro = $this->parser->getExpressionParser()->parseExpression(); - $this->parser->getStream()->expect('as'); - $var = new Twig_Node_Expression_AssignName($this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(), $token->getLine()); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - $this->parser->addImportedSymbol('template', $var->getAttribute('name')); - - return new Twig_Node_Import($macro, $var, $token->getLine(), $this->getTag()); - } - - public function getTag() - { - return 'import'; } } - -class_alias('Twig_TokenParser_Import', 'Twig\TokenParser\ImportTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Include.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Include.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Include.php Thu May 09 15:33:08 2019 +0100 @@ -1,65 +1,11 @@ - * {% include 'header.html' %} - * Body - * {% include 'footer.html' %} - * - */ -class Twig_TokenParser_Include extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\IncludeTokenParser'); + +if (\false) { + class Twig_TokenParser_Include extends IncludeTokenParser { - $expr = $this->parser->getExpressionParser()->parseExpression(); - - list($variables, $only, $ignoreMissing) = $this->parseArguments(); - - return new Twig_Node_Include($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); - } - - protected function parseArguments() - { - $stream = $this->parser->getStream(); - - $ignoreMissing = false; - if ($stream->nextIf(Twig_Token::NAME_TYPE, 'ignore')) { - $stream->expect(Twig_Token::NAME_TYPE, 'missing'); - - $ignoreMissing = true; - } - - $variables = null; - if ($stream->nextIf(Twig_Token::NAME_TYPE, 'with')) { - $variables = $this->parser->getExpressionParser()->parseExpression(); - } - - $only = false; - if ($stream->nextIf(Twig_Token::NAME_TYPE, 'only')) { - $only = true; - } - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - return [$variables, $only, $ignoreMissing]; - } - - public function getTag() - { - return 'include'; } } - -class_alias('Twig_TokenParser_Include', 'Twig\TokenParser\IncludeTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Macro.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Macro.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Macro.php Thu May 09 15:33:08 2019 +0100 @@ -1,60 +1,11 @@ - * {% macro input(name, value, type, size) %} - * - * {% endmacro %} - * - * - * @final - */ -class Twig_TokenParser_Macro extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\MacroTokenParser'); + +if (\false) { + class Twig_TokenParser_Macro extends MacroTokenParser { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); - - $arguments = $this->parser->getExpressionParser()->parseArguments(true, true); - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - $this->parser->pushLocalScope(); - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - if ($token = $stream->nextIf(Twig_Token::NAME_TYPE)) { - $value = $token->getValue(); - - if ($value != $name) { - throw new Twig_Error_Syntax(sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - } - $this->parser->popLocalScope(); - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - $this->parser->setMacro($name, new Twig_Node_Macro($name, new Twig_Node_Body([$body]), $arguments, $lineno, $this->getTag())); - } - - public function decideBlockEnd(Twig_Token $token) - { - return $token->test('endmacro'); - } - - public function getTag() - { - return 'macro'; } } - -class_alias('Twig_TokenParser_Macro', 'Twig\TokenParser\MacroTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php Thu May 09 15:33:08 2019 +0100 @@ -1,61 +1,11 @@ - * {% sandbox %} - * {% include 'user.html' %} - * {% endsandbox %} - * - * - * @see https://twig.symfony.com/doc/api.html#sandbox-extension for details - * - * @final - */ -class Twig_TokenParser_Sandbox extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\SandboxTokenParser'); + +if (\false) { + class Twig_TokenParser_Sandbox extends SandboxTokenParser { - $stream = $this->parser->getStream(); - $stream->expect(Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - // in a sandbox tag, only include tags are allowed - if (!$body instanceof Twig_Node_Include) { - foreach ($body as $node) { - if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) { - continue; - } - - if (!$node instanceof Twig_Node_Include) { - throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section.', $node->getTemplateLine(), $stream->getSourceContext()); - } - } - } - - return new Twig_Node_Sandbox($body, $token->getLine(), $this->getTag()); - } - - public function decideBlockEnd(Twig_Token $token) - { - return $token->test('endsandbox'); - } - - public function getTag() - { - return 'sandbox'; } } - -class_alias('Twig_TokenParser_Sandbox', 'Twig\TokenParser\SandboxTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Set.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Set.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Set.php Thu May 09 15:33:08 2019 +0100 @@ -1,75 +1,11 @@ - * {% set foo = 'foo' %} - * - * {% set foo = [1, 2] %} - * - * {% set foo = {'foo': 'bar'} %} - * - * {% set foo = 'foo' ~ 'bar' %} - * - * {% set foo, bar = 'foo', 'bar' %} - * - * {% set foo %}Some content{% endset %} - * - * - * @final - */ -class Twig_TokenParser_Set extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\SetTokenParser'); + +if (\false) { + class Twig_TokenParser_Set extends SetTokenParser { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - $names = $this->parser->getExpressionParser()->parseAssignmentExpression(); - - $capture = false; - if ($stream->nextIf(Twig_Token::OPERATOR_TYPE, '=')) { - $values = $this->parser->getExpressionParser()->parseMultitargetExpression(); - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - if (count($names) !== count($values)) { - throw new Twig_Error_Syntax('When using set, you must have the same number of variables and assignments.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - } else { - $capture = true; - - if (count($names) > 1) { - throw new Twig_Error_Syntax('When using set with a block, you cannot have a multi-target.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - $values = $this->parser->subparse([$this, 'decideBlockEnd'], true); - $stream->expect(Twig_Token::BLOCK_END_TYPE); - } - - return new Twig_Node_Set($capture, $names, $values, $lineno, $this->getTag()); - } - - public function decideBlockEnd(Twig_Token $token) - { - return $token->test('endset'); - } - - public function getTag() - { - return 'set'; } } - -class_alias('Twig_TokenParser_Set', 'Twig\TokenParser\SetTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php Thu May 09 15:33:08 2019 +0100 @@ -1,51 +1,11 @@ - * {% spaceless %} - *
    - * foo - *
    - * {% endspaceless %} - * - * {# output will be
    foo
    #} - * - * - * @final - */ -class Twig_TokenParser_Spaceless extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\SpacelessTokenParser'); + +if (\false) { + class Twig_TokenParser_Spaceless extends SpacelessTokenParser { - $lineno = $token->getLine(); - - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse([$this, 'decideSpacelessEnd'], true); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_Spaceless($body, $lineno, $this->getTag()); - } - - public function decideSpacelessEnd(Twig_Token $token) - { - return $token->test('endspaceless'); - } - - public function getTag() - { - return 'spaceless'; } } - -class_alias('Twig_TokenParser_Spaceless', 'Twig\TokenParser\SpacelessTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/Use.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Use.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Use.php Thu May 09 15:33:08 2019 +0100 @@ -1,70 +1,11 @@ - * {% extends "base.html" %} - * - * {% use "blocks.html" %} - * - * {% block title %}{% endblock %} - * {% block content %}{% endblock %} - * - * - * @see https://twig.symfony.com/doc/templates.html#horizontal-reuse for details. - * - * @final - */ -class Twig_TokenParser_Use extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\UseTokenParser'); + +if (\false) { + class Twig_TokenParser_Use extends UseTokenParser { - $template = $this->parser->getExpressionParser()->parseExpression(); - $stream = $this->parser->getStream(); - - if (!$template instanceof Twig_Node_Expression_Constant) { - throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); - } - - $targets = []; - if ($stream->nextIf('with')) { - do { - $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); - - $alias = $name; - if ($stream->nextIf('as')) { - $alias = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); - } - - $targets[$name] = new Twig_Node_Expression_Constant($alias, -1); - - if (!$stream->nextIf(Twig_Token::PUNCTUATION_TYPE, ',')) { - break; - } - } while (true); - } - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - $this->parser->addTrait(new Twig_Node(['template' => $template, 'targets' => new Twig_Node($targets)])); - - return new Twig_Node(); - } - - public function getTag() - { - return 'use'; } } - -class_alias('Twig_TokenParser_Use', 'Twig\TokenParser\UseTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParser/With.php --- a/vendor/twig/twig/lib/Twig/TokenParser/With.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/With.php Thu May 09 15:33:08 2019 +0100 @@ -1,52 +1,11 @@ - * - * @final - */ -class Twig_TokenParser_With extends Twig_TokenParser -{ - public function parse(Twig_Token $token) +class_exists('Twig\TokenParser\WithTokenParser'); + +if (\false) { + class Twig_TokenParser_With extends WithTokenParser { - $stream = $this->parser->getStream(); - - $variables = null; - $only = false; - if (!$stream->test(Twig_Token::BLOCK_END_TYPE)) { - $variables = $this->parser->getExpressionParser()->parseExpression(); - $only = $stream->nextIf(Twig_Token::NAME_TYPE, 'only'); - } - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - $body = $this->parser->subparse([$this, 'decideWithEnd'], true); - - $stream->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_With($body, $variables, $only, $token->getLine(), $this->getTag()); - } - - public function decideWithEnd(Twig_Token $token) - { - return $token->test('endwith'); - } - - public function getTag() - { - return 'with'; } } - -class_alias('Twig_TokenParser_With', 'Twig\TokenParser\WithTokenParser', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParserBroker.php --- a/vendor/twig/twig/lib/Twig/TokenParserBroker.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParserBroker.php Thu May 09 15:33:08 2019 +0100 @@ -10,6 +10,8 @@ * file that was distributed with this source code. */ +use Twig\TokenParser\TokenParserInterface; + /** * Default implementation of a token parser broker. * @@ -24,9 +26,9 @@ protected $brokers = []; /** - * @param array|Traversable $parsers A Traversable of Twig_TokenParserInterface instances - * @param array|Traversable $brokers A Traversable of Twig_TokenParserBrokerInterface instances - * @param bool $triggerDeprecationError + * @param array|\Traversable $parsers A \Traversable of Twig_TokenParserInterface instances + * @param array|\Traversable $brokers A \Traversable of Twig_TokenParserBrokerInterface instances + * @param bool $triggerDeprecationError */ public function __construct($parsers = [], $brokers = [], $triggerDeprecationError = true) { @@ -35,25 +37,25 @@ } foreach ($parsers as $parser) { - if (!$parser instanceof Twig_TokenParserInterface) { - throw new LogicException('$parsers must a an array of Twig_TokenParserInterface.'); + if (!$parser instanceof TokenParserInterface) { + throw new \LogicException('$parsers must a an array of Twig_TokenParserInterface.'); } $this->parsers[$parser->getTag()] = $parser; } foreach ($brokers as $broker) { if (!$broker instanceof Twig_TokenParserBrokerInterface) { - throw new LogicException('$brokers must a an array of Twig_TokenParserBrokerInterface.'); + throw new \LogicException('$brokers must a an array of Twig_TokenParserBrokerInterface.'); } $this->brokers[] = $broker; } } - public function addTokenParser(Twig_TokenParserInterface $parser) + public function addTokenParser(TokenParserInterface $parser) { $this->parsers[$parser->getTag()] = $parser; } - public function removeTokenParser(Twig_TokenParserInterface $parser) + public function removeTokenParser(TokenParserInterface $parser) { $name = $parser->getTag(); if (isset($this->parsers[$name]) && $parser === $this->parsers[$name]) { @@ -80,7 +82,7 @@ * * @param string $tag A tag name * - * @return Twig_TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found + * @return TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found */ public function getTokenParser($tag) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php --- a/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php Thu May 09 15:33:08 2019 +0100 @@ -10,6 +10,8 @@ * file that was distributed with this source code. */ +use Twig\TokenParser\TokenParserInterface; + /** * Interface implemented by token parser brokers. * @@ -26,12 +28,12 @@ * * @param string $tag A tag name * - * @return Twig_TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found + * @return TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found */ public function getTokenParser($tag); /** - * Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of. + * Calls Twig\TokenParser\TokenParserInterface::setParser on all parsers the implementation knows of. */ public function setParser(Twig_ParserInterface $parser); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenParserInterface.php --- a/vendor/twig/twig/lib/Twig/TokenParserInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParserInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,43 +1,11 @@ - */ -interface Twig_TokenParserInterface -{ - /** - * Sets the parser associated with this token parser. - */ - public function setParser(Twig_Parser $parser); +class_exists('Twig\TokenParser\TokenParserInterface'); - /** - * Parses a token and returns a node. - * - * @return Twig_NodeInterface - * - * @throws Twig_Error_Syntax - */ - public function parse(Twig_Token $token); - - /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ - public function getTag(); +if (\false) { + class Twig_TokenParserInterface extends TokenParserInterface + { + } } - -class_alias('Twig_TokenParserInterface', 'Twig\TokenParser\TokenParserInterface', false); -class_exists('Twig_Parser'); -class_exists('Twig_Token'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/TokenStream.php --- a/vendor/twig/twig/lib/Twig/TokenStream.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenStream.php Thu May 09 15:33:08 2019 +0100 @@ -1,196 +1,11 @@ - */ -class Twig_TokenStream -{ - protected $tokens; - protected $current = 0; - protected $filename; +class_exists('Twig\TokenStream'); - private $source; - - /** - * @param array $tokens An array of tokens - * @param string|null $name The name of the template which tokens are associated with - * @param string|null $source The source code associated with the tokens - */ - public function __construct(array $tokens, $name = null, $source = null) +if (\false) { + class Twig_TokenStream extends TokenStream { - if (!$name instanceof Twig_Source) { - if (null !== $name || null !== $source) { - @trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a Twig_Source instance instead.', __METHOD__), E_USER_DEPRECATED); - } - $this->source = new Twig_Source($source, $name); - } else { - $this->source = $name; - } - - $this->tokens = $tokens; - - // deprecated, not used anymore, to be removed in 2.0 - $this->filename = $this->source->getName(); - } - - public function __toString() - { - return implode("\n", $this->tokens); - } - - public function injectTokens(array $tokens) - { - $this->tokens = array_merge(array_slice($this->tokens, 0, $this->current), $tokens, array_slice($this->tokens, $this->current)); - } - - /** - * Sets the pointer to the next token and returns the old one. - * - * @return Twig_Token - */ - public function next() - { - if (!isset($this->tokens[++$this->current])) { - throw new Twig_Error_Syntax('Unexpected end of template.', $this->tokens[$this->current - 1]->getLine(), $this->source); - } - - return $this->tokens[$this->current - 1]; - } - - /** - * Tests a token, sets the pointer to the next one and returns it or throws a syntax error. - * - * @return Twig_Token|null The next token if the condition is true, null otherwise - */ - public function nextIf($primary, $secondary = null) - { - if ($this->tokens[$this->current]->test($primary, $secondary)) { - return $this->next(); - } - } - - /** - * Tests a token and returns it or throws a syntax error. - * - * @return Twig_Token - */ - public function expect($type, $value = null, $message = null) - { - $token = $this->tokens[$this->current]; - if (!$token->test($type, $value)) { - $line = $token->getLine(); - throw new Twig_Error_Syntax(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s).', - $message ? $message.'. ' : '', - Twig_Token::typeToEnglish($token->getType()), $token->getValue(), - Twig_Token::typeToEnglish($type), $value ? sprintf(' with value "%s"', $value) : ''), - $line, - $this->source - ); - } - $this->next(); - - return $token; - } - - /** - * Looks at the next token. - * - * @param int $number - * - * @return Twig_Token - */ - public function look($number = 1) - { - if (!isset($this->tokens[$this->current + $number])) { - throw new Twig_Error_Syntax('Unexpected end of template.', $this->tokens[$this->current + $number - 1]->getLine(), $this->source); - } - - return $this->tokens[$this->current + $number]; - } - - /** - * Tests the current token. - * - * @return bool - */ - public function test($primary, $secondary = null) - { - return $this->tokens[$this->current]->test($primary, $secondary); - } - - /** - * Checks if end of stream was reached. - * - * @return bool - */ - public function isEOF() - { - return Twig_Token::EOF_TYPE === $this->tokens[$this->current]->getType(); - } - - /** - * @return Twig_Token - */ - public function getCurrent() - { - return $this->tokens[$this->current]; - } - - /** - * Gets the name associated with this stream (null if not defined). - * - * @return string|null - * - * @deprecated since 1.27 (to be removed in 2.0) - */ - public function getFilename() - { - @trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); - - return $this->source->getName(); - } - - /** - * Gets the source code associated with this stream. - * - * @return string - * - * @internal Don't use this as it might be empty depending on the environment configuration - * - * @deprecated since 1.27 (to be removed in 2.0) - */ - public function getSource() - { - @trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); - - return $this->source->getCode(); - } - - /** - * Gets the source associated with this stream. - * - * @return Twig_Source - * - * @internal - */ - public function getSourceContext() - { - return $this->source; } } - -class_alias('Twig_TokenStream', 'Twig\TokenStream', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php --- a/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php Thu May 09 15:33:08 2019 +0100 @@ -1,86 +1,11 @@ - * - * @final - */ -class Twig_Util_DeprecationCollector -{ - private $twig; - private $deprecations; +class_exists('Twig\Util\DeprecationCollector'); - public function __construct(Twig_Environment $twig) +if (\false) { + class Twig_Util_DeprecationCollector extends DeprecationCollector { - $this->twig = $twig; - } - - /** - * Returns deprecations for templates contained in a directory. - * - * @param string $dir A directory where templates are stored - * @param string $ext Limit the loaded templates by extension - * - * @return array An array of deprecations - */ - public function collectDir($dir, $ext = '.twig') - { - $iterator = new RegexIterator( - new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY - ), '{'.preg_quote($ext).'$}' - ); - - return $this->collect(new Twig_Util_TemplateDirIterator($iterator)); - } - - /** - * Returns deprecations for passed templates. - * - * @param Traversable $iterator An iterator of templates (where keys are template names and values the contents of the template) - * - * @return array An array of deprecations - */ - public function collect(Traversable $iterator) - { - $this->deprecations = []; - - set_error_handler([$this, 'errorHandler']); - - foreach ($iterator as $name => $contents) { - try { - $this->twig->parse($this->twig->tokenize(new Twig_Source($contents, $name))); - } catch (Twig_Error_Syntax $e) { - // ignore templates containing syntax errors - } - } - - restore_error_handler(); - - $deprecations = $this->deprecations; - $this->deprecations = []; - - return $deprecations; - } - - /** - * @internal - */ - public function errorHandler($type, $msg) - { - if (E_USER_DEPRECATED === $type) { - $this->deprecations[] = $msg; - } } } - -class_alias('Twig_Util_DeprecationCollector', 'Twig\Util\DeprecationCollector', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php --- a/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php Thu May 09 15:33:08 2019 +0100 @@ -1,28 +1,11 @@ - */ -class Twig_Util_TemplateDirIterator extends IteratorIterator -{ - public function current() +class_exists('Twig\Util\TemplateDirIterator'); + +if (\false) { + class Twig_Util_TemplateDirIterator extends TemplateDirIterator { - return file_get_contents(parent::current()); - } - - public function key() - { - return (string) parent::key(); } } - -class_alias('Twig_Util_TemplateDirIterator', 'Twig\Util\TemplateDirIterator', false); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/phpunit.xml.dist --- a/vendor/twig/twig/phpunit.xml.dist Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/phpunit.xml.dist Thu May 09 15:33:08 2019 +0100 @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" bootstrap="vendor/autoload.php" > @@ -19,6 +18,7 @@ + @@ -27,7 +27,7 @@ - ./lib/Twig/ + ./src/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Cache/CacheInterface.php --- a/vendor/twig/twig/src/Cache/CacheInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Cache/CacheInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,60 @@ + */ +interface CacheInterface +{ + /** + * Generates a cache key for the given template class name. + * + * @param string $name The template name + * @param string $className The template class name + * + * @return string + */ + public function generateKey($name, $className); -if (\false) { - interface CacheInterface extends \Twig_CacheInterface - { - } + /** + * Writes the compiled template to cache. + * + * @param string $key The cache key + * @param string $content The template representation as a PHP class + */ + public function write($key, $content); + + /** + * Loads a template from the cache. + * + * @param string $key The cache key + */ + public function load($key); + + /** + * Returns the modification timestamp of a key. + * + * @param string $key The cache key + * + * @return int + */ + public function getTimestamp($key); } + +class_alias('Twig\Cache\CacheInterface', 'Twig_CacheInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Cache/FilesystemCache.php --- a/vendor/twig/twig/src/Cache/FilesystemCache.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Cache/FilesystemCache.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,93 @@ + */ +class FilesystemCache implements CacheInterface +{ + const FORCE_BYTECODE_INVALIDATION = 1; -if (\false) { - class FilesystemCache extends \Twig_Cache_Filesystem + private $directory; + private $options; + + /** + * @param string $directory The root cache directory + * @param int $options A set of options + */ + public function __construct($directory, $options = 0) { + $this->directory = rtrim($directory, '\/').'/'; + $this->options = $options; + } + + public function generateKey($name, $className) + { + $hash = hash('sha256', $className); + + return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php'; + } + + public function load($key) + { + if (file_exists($key)) { + @include_once $key; + } + } + + public function write($key, $content) + { + $dir = \dirname($key); + if (!is_dir($dir)) { + if (false === @mkdir($dir, 0777, true)) { + clearstatcache(true, $dir); + if (!is_dir($dir)) { + throw new \RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir)); + } + } + } elseif (!is_writable($dir)) { + throw new \RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir)); + } + + $tmpFile = tempnam($dir, basename($key)); + if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $key)) { + @chmod($key, 0666 & ~umask()); + + if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) { + // Compile cached file into bytecode cache + if (\function_exists('opcache_invalidate')) { + opcache_invalidate($key, true); + } elseif (\function_exists('apc_compile_file')) { + apc_compile_file($key); + } + } + + return; + } + + throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $key)); + } + + public function getTimestamp($key) + { + if (!file_exists($key)) { + return 0; + } + + return (int) @filemtime($key); } } + +class_alias('Twig\Cache\FilesystemCache', 'Twig_Cache_Filesystem'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Cache/NullCache.php --- a/vendor/twig/twig/src/Cache/NullCache.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Cache/NullCache.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,42 @@ + */ +class NullCache implements CacheInterface +{ + public function generateKey($name, $className) + { + return ''; + } -if (\false) { - class NullCache extends \Twig_Cache_Null + public function write($key, $content) { } + + public function load($key) + { + } + + public function getTimestamp($key) + { + return 0; + } } + +class_alias('Twig\Cache\NullCache', 'Twig_Cache_Null'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Compiler.php --- a/vendor/twig/twig/src/Compiler.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Compiler.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,288 @@ + */ +class Compiler implements \Twig_CompilerInterface +{ + protected $lastLine; + protected $source; + protected $indentation; + protected $env; + protected $debugInfo = []; + protected $sourceOffset; + protected $sourceLine; + protected $filename; + private $varNameSalt = 0; + + public function __construct(Environment $env) { + $this->env = $env; + } + + /** + * @deprecated since 1.25 (to be removed in 2.0) + */ + public function getFilename() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED); + + return $this->filename; + } + + /** + * Returns the environment instance related to this compiler. + * + * @return Environment + */ + public function getEnvironment() + { + return $this->env; + } + + /** + * Gets the current PHP code after compilation. + * + * @return string The PHP code + */ + public function getSource() + { + return $this->source; + } + + /** + * Compiles a node. + * + * @param int $indentation The current indentation + * + * @return $this + */ + public function compile(\Twig_NodeInterface $node, $indentation = 0) + { + $this->lastLine = null; + $this->source = ''; + $this->debugInfo = []; + $this->sourceOffset = 0; + // source code starts at 1 (as we then increment it when we encounter new lines) + $this->sourceLine = 1; + $this->indentation = $indentation; + $this->varNameSalt = 0; + + if ($node instanceof ModuleNode) { + // to be removed in 2.0 + $this->filename = $node->getTemplateName(); + } + + $node->compile($this); + + return $this; + } + + public function subcompile(\Twig_NodeInterface $node, $raw = true) + { + if (false === $raw) { + $this->source .= str_repeat(' ', $this->indentation * 4); + } + + $node->compile($this); + + return $this; + } + + /** + * Adds a raw string to the compiled code. + * + * @param string $string The string + * + * @return $this + */ + public function raw($string) + { + $this->source .= $string; + + return $this; + } + + /** + * Writes a string to the compiled code by adding indentation. + * + * @return $this + */ + public function write() + { + $strings = \func_get_args(); + foreach ($strings as $string) { + $this->source .= str_repeat(' ', $this->indentation * 4).$string; + } + + return $this; + } + + /** + * Appends an indentation to the current PHP code after compilation. + * + * @return $this + * + * @deprecated since 1.27 (to be removed in 2.0). + */ + public function addIndentation() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use write(\'\') instead.', E_USER_DEPRECATED); + + $this->source .= str_repeat(' ', $this->indentation * 4); + + return $this; + } + + /** + * Adds a quoted string to the compiled code. + * + * @param string $value The string + * + * @return $this + */ + public function string($value) + { + $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\")); + + return $this; + } + + /** + * Returns a PHP representation of a given value. + * + * @param mixed $value The value to convert + * + * @return $this + */ + public function repr($value) + { + if (\is_int($value) || \is_float($value)) { + if (false !== $locale = setlocale(LC_NUMERIC, '0')) { + setlocale(LC_NUMERIC, 'C'); + } + + $this->raw(var_export($value, true)); + + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + } elseif (null === $value) { + $this->raw('null'); + } elseif (\is_bool($value)) { + $this->raw($value ? 'true' : 'false'); + } elseif (\is_array($value)) { + $this->raw('['); + $first = true; + foreach ($value as $key => $v) { + if (!$first) { + $this->raw(', '); + } + $first = false; + $this->repr($key); + $this->raw(' => '); + $this->repr($v); + } + $this->raw(']'); + } else { + $this->string($value); + } + + return $this; + } + + /** + * Adds debugging information. + * + * @return $this + */ + public function addDebugInfo(\Twig_NodeInterface $node) + { + if ($node->getTemplateLine() != $this->lastLine) { + $this->write(sprintf("// line %d\n", $node->getTemplateLine())); + + // when mbstring.func_overload is set to 2 + // mb_substr_count() replaces substr_count() + // but they have different signatures! + if (((int) ini_get('mbstring.func_overload')) & 2) { + @trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED); + + // this is much slower than the "right" version + $this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n"); + } else { + $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset); + } + $this->sourceOffset = \strlen($this->source); + $this->debugInfo[$this->sourceLine] = $node->getTemplateLine(); + + $this->lastLine = $node->getTemplateLine(); + } + + return $this; + } + + public function getDebugInfo() + { + ksort($this->debugInfo); + + return $this->debugInfo; + } + + /** + * Indents the generated code. + * + * @param int $step The number of indentation to add + * + * @return $this + */ + public function indent($step = 1) + { + $this->indentation += $step; + + return $this; + } + + /** + * Outdents the generated code. + * + * @param int $step The number of indentation to remove + * + * @return $this + * + * @throws \LogicException When trying to outdent too much so the indentation would become negative + */ + public function outdent($step = 1) + { + // can't outdent by more steps than the current indentation level + if ($this->indentation < $step) { + throw new \LogicException('Unable to call outdent() as the indentation would become negative.'); + } + + $this->indentation -= $step; + + return $this; + } + + public function getVarName() + { + return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++)); } } + +class_alias('Twig\Compiler', 'Twig_Compiler'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Environment.php --- a/vendor/twig/twig/src/Environment.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Environment.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,1638 @@ + */ +class Environment +{ + const VERSION = '1.40.1'; + const VERSION_ID = 14001; + const MAJOR_VERSION = 1; + const MINOR_VERSION = 40; + const RELEASE_VERSION = 1; + const EXTRA_VERSION = ''; + + protected $charset; + protected $loader; + protected $debug; + protected $autoReload; + protected $cache; + protected $lexer; + protected $parser; + protected $compiler; + protected $baseTemplateClass; + protected $extensions; + protected $parsers; + protected $visitors; + protected $filters; + protected $tests; + protected $functions; + protected $globals; + protected $runtimeInitialized = false; + protected $extensionInitialized = false; + protected $loadedTemplates; + protected $strictVariables; + protected $unaryOperators; + protected $binaryOperators; + protected $templateClassPrefix = '__TwigTemplate_'; + protected $functionCallbacks = []; + protected $filterCallbacks = []; + protected $staging; + + private $originalCache; + private $bcWriteCacheFile = false; + private $bcGetCacheFilename = false; + private $lastModifiedExtension = 0; + private $extensionsByClass = []; + private $runtimeLoaders = []; + private $runtimes = []; + private $optionsHash; + + /** + * Constructor. + * + * Available options: + * + * * debug: When set to true, it automatically set "auto_reload" to true as + * well (default to false). + * + * * charset: The charset used by the templates (default to UTF-8). + * + * * base_template_class: The base template class to use for generated + * templates (default to \Twig\Template). + * + * * cache: An absolute path where to store the compiled templates, + * a \Twig\Cache\CacheInterface implementation, + * or false to disable compilation cache (default). + * + * * auto_reload: Whether to reload the template if the original source changed. + * If you don't provide the auto_reload option, it will be + * determined automatically based on the debug value. + * + * * strict_variables: Whether to ignore invalid variables in templates + * (default to false). + * + * * autoescape: Whether to enable auto-escaping (default to html): + * * false: disable auto-escaping + * * true: equivalent to html + * * html, js: set the autoescaping to one of the supported strategies + * * name: set the autoescaping strategy based on the template name extension + * * PHP callback: a PHP callback that returns an escaping strategy based on the template "name" + * + * * optimizations: A flag that indicates which optimizations to apply + * (default to -1 which means that all optimizations are enabled; + * set it to 0 to disable). + */ + public function __construct(LoaderInterface $loader = null, $options = []) { + if (null !== $loader) { + $this->setLoader($loader); + } else { + @trigger_error('Not passing a "Twig\Lodaer\LoaderInterface" as the first constructor argument of "Twig\Environment" is deprecated since version 1.21.', E_USER_DEPRECATED); + } + + $options = array_merge([ + 'debug' => false, + 'charset' => 'UTF-8', + 'base_template_class' => '\Twig\Template', + 'strict_variables' => false, + 'autoescape' => 'html', + 'cache' => false, + 'auto_reload' => null, + 'optimizations' => -1, + ], $options); + + $this->debug = (bool) $options['debug']; + $this->charset = strtoupper($options['charset']); + $this->baseTemplateClass = $options['base_template_class']; + $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload']; + $this->strictVariables = (bool) $options['strict_variables']; + $this->setCache($options['cache']); + + $this->addExtension(new CoreExtension()); + $this->addExtension(new EscaperExtension($options['autoescape'])); + $this->addExtension(new OptimizerExtension($options['optimizations'])); + $this->staging = new StagingExtension(); + + // For BC + if (\is_string($this->originalCache)) { + $r = new \ReflectionMethod($this, 'writeCacheFile'); + if (__CLASS__ !== $r->getDeclaringClass()->getName()) { + @trigger_error('The Twig\Environment::writeCacheFile method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED); + + $this->bcWriteCacheFile = true; + } + + $r = new \ReflectionMethod($this, 'getCacheFilename'); + if (__CLASS__ !== $r->getDeclaringClass()->getName()) { + @trigger_error('The Twig\Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED); + + $this->bcGetCacheFilename = true; + } + } + } + + /** + * Gets the base template class for compiled templates. + * + * @return string The base template class name + */ + public function getBaseTemplateClass() + { + return $this->baseTemplateClass; + } + + /** + * Sets the base template class for compiled templates. + * + * @param string $class The base template class name + */ + public function setBaseTemplateClass($class) + { + $this->baseTemplateClass = $class; + $this->updateOptionsHash(); + } + + /** + * Enables debugging mode. + */ + public function enableDebug() + { + $this->debug = true; + $this->updateOptionsHash(); + } + + /** + * Disables debugging mode. + */ + public function disableDebug() + { + $this->debug = false; + $this->updateOptionsHash(); + } + + /** + * Checks if debug mode is enabled. + * + * @return bool true if debug mode is enabled, false otherwise + */ + public function isDebug() + { + return $this->debug; + } + + /** + * Enables the auto_reload option. + */ + public function enableAutoReload() + { + $this->autoReload = true; + } + + /** + * Disables the auto_reload option. + */ + public function disableAutoReload() + { + $this->autoReload = false; + } + + /** + * Checks if the auto_reload option is enabled. + * + * @return bool true if auto_reload is enabled, false otherwise + */ + public function isAutoReload() + { + return $this->autoReload; + } + + /** + * Enables the strict_variables option. + */ + public function enableStrictVariables() + { + $this->strictVariables = true; + $this->updateOptionsHash(); + } + + /** + * Disables the strict_variables option. + */ + public function disableStrictVariables() + { + $this->strictVariables = false; + $this->updateOptionsHash(); + } + + /** + * Checks if the strict_variables option is enabled. + * + * @return bool true if strict_variables is enabled, false otherwise + */ + public function isStrictVariables() + { + return $this->strictVariables; + } + + /** + * Gets the current cache implementation. + * + * @param bool $original Whether to return the original cache option or the real cache instance + * + * @return CacheInterface|string|false A Twig\Cache\CacheInterface implementation, + * an absolute path to the compiled templates, + * or false to disable cache + */ + public function getCache($original = true) + { + return $original ? $this->originalCache : $this->cache; + } + + /** + * Sets the current cache implementation. + * + * @param CacheInterface|string|false $cache A Twig\Cache\CacheInterface implementation, + * an absolute path to the compiled templates, + * or false to disable cache + */ + public function setCache($cache) + { + if (\is_string($cache)) { + $this->originalCache = $cache; + $this->cache = new FilesystemCache($cache); + } elseif (false === $cache) { + $this->originalCache = $cache; + $this->cache = new NullCache(); + } elseif (null === $cache) { + @trigger_error('Using "null" as the cache strategy is deprecated since version 1.23 and will be removed in Twig 2.0.', E_USER_DEPRECATED); + $this->originalCache = false; + $this->cache = new NullCache(); + } elseif ($cache instanceof CacheInterface) { + $this->originalCache = $this->cache = $cache; + } else { + throw new \LogicException(sprintf('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.')); + } + } + + /** + * Gets the cache filename for a given template. + * + * @param string $name The template name + * + * @return string|false The cache file name or false when caching is disabled + * + * @deprecated since 1.22 (to be removed in 2.0) + */ + public function getCacheFilename($name) + { + @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + $key = $this->cache->generateKey($name, $this->getTemplateClass($name)); + + return !$key ? false : $key; + } + + /** + * Gets the template class associated with the given string. + * + * The generated template class is based on the following parameters: + * + * * The cache key for the given template; + * * The currently enabled extensions; + * * Whether the Twig C extension is available or not; + * * PHP version; + * * Twig version; + * * Options with what environment was created. + * + * @param string $name The name for which to calculate the template class name + * @param int|null $index The index if it is an embedded template + * + * @return string The template class name + */ + public function getTemplateClass($name, $index = null) + { + $key = $this->getLoader()->getCacheKey($name).$this->optionsHash; + + return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '___'.$index); + } + + /** + * Gets the template class prefix. + * + * @return string The template class prefix + * + * @deprecated since 1.22 (to be removed in 2.0) + */ + public function getTemplateClassPrefix() + { + @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + return $this->templateClassPrefix; + } + + /** + * Renders a template. + * + * @param string|TemplateWrapper $name The template name + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered template + * + * @throws LoaderError When the template cannot be found + * @throws SyntaxError When an error occurred during compilation + * @throws RuntimeError When an error occurred during rendering + */ + public function render($name, array $context = []) + { + return $this->load($name)->render($context); + } + + /** + * Displays a template. + * + * @param string|TemplateWrapper $name The template name + * @param array $context An array of parameters to pass to the template + * + * @throws LoaderError When the template cannot be found + * @throws SyntaxError When an error occurred during compilation + * @throws RuntimeError When an error occurred during rendering + */ + public function display($name, array $context = []) + { + $this->load($name)->display($context); + } + + /** + * Loads a template. + * + * @param string|TemplateWrapper|\Twig\Template $name The template name + * + * @throws LoaderError When the template cannot be found + * @throws RuntimeError When a previously generated cache is corrupted + * @throws SyntaxError When an error occurred during compilation + * + * @return TemplateWrapper + */ + public function load($name) + { + if ($name instanceof TemplateWrapper) { + return $name; + } + + if ($name instanceof Template) { + return new TemplateWrapper($this, $name); + } + + return new TemplateWrapper($this, $this->loadTemplate($name)); + } + + /** + * Loads a template internal representation. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The template name + * @param int $index The index if it is an embedded template + * + * @return \Twig_TemplateInterface A template instance representing the given template name + * + * @throws LoaderError When the template cannot be found + * @throws RuntimeError When a previously generated cache is corrupted + * @throws SyntaxError When an error occurred during compilation + * + * @internal + */ + public function loadTemplate($name, $index = null) + { + return $this->loadClass($this->getTemplateClass($name), $name, $index); + } + + /** + * @internal + */ + public function loadClass($cls, $name, $index = null) + { + $mainCls = $cls; + if (null !== $index) { + $cls .= '___'.$index; + } + + if (isset($this->loadedTemplates[$cls])) { + return $this->loadedTemplates[$cls]; + } + + if (!class_exists($cls, false)) { + if ($this->bcGetCacheFilename) { + $key = $this->getCacheFilename($name); + } else { + $key = $this->cache->generateKey($name, $mainCls); + } + + if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) { + $this->cache->load($key); + } + + $source = null; + if (!class_exists($cls, false)) { + $loader = $this->getLoader(); + if (!$loader instanceof SourceContextLoaderInterface) { + $source = new Source($loader->getSource($name), $name); + } else { + $source = $loader->getSourceContext($name); + } + + $content = $this->compileSource($source); + + if ($this->bcWriteCacheFile) { + $this->writeCacheFile($key, $content); + } else { + $this->cache->write($key, $content); + $this->cache->load($key); + } + + if (!class_exists($mainCls, false)) { + /* Last line of defense if either $this->bcWriteCacheFile was used, + * $this->cache is implemented as a no-op or we have a race condition + * where the cache was cleared between the above calls to write to and load from + * the cache. + */ + eval('?>'.$content); + } + } + + if (!class_exists($cls, false)) { + throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source); + } + } + + if (!$this->runtimeInitialized) { + $this->initRuntime(); + } + + return $this->loadedTemplates[$cls] = new $cls($this); + } + + /** + * Creates a template from source. + * + * This method should not be used as a generic way to load templates. + * + * @param string $template The template name + * @param string $name An optional name of the template to be used in error messages + * + * @return TemplateWrapper A template instance representing the given template name + * + * @throws LoaderError When the template cannot be found + * @throws SyntaxError When an error occurred during compilation + */ + public function createTemplate($template, $name = null) + { + $hash = hash('sha256', $template, false); + if (null !== $name) { + $name = sprintf('%s (string template %s)', $name, $hash); + } else { + $name = sprintf('__string_template__%s', $hash); + } + + $loader = new ChainLoader([ + new ArrayLoader([$name => $template]), + $current = $this->getLoader(), + ]); + + $this->setLoader($loader); + try { + $template = new TemplateWrapper($this, $this->loadTemplate($name)); + } catch (\Exception $e) { + $this->setLoader($current); + + throw $e; + } catch (\Throwable $e) { + $this->setLoader($current); + + throw $e; + } + $this->setLoader($current); + + return $template; + } + + /** + * Returns true if the template is still fresh. + * + * Besides checking the loader for freshness information, + * this method also checks if the enabled extensions have + * not changed. + * + * @param string $name The template name + * @param int $time The last modification time of the cached template + * + * @return bool true if the template is fresh, false otherwise + */ + public function isTemplateFresh($name, $time) + { + if (0 === $this->lastModifiedExtension) { + foreach ($this->extensions as $extension) { + $r = new \ReflectionObject($extension); + if (file_exists($r->getFileName()) && ($extensionTime = filemtime($r->getFileName())) > $this->lastModifiedExtension) { + $this->lastModifiedExtension = $extensionTime; + } + } + } + + return $this->lastModifiedExtension <= $time && $this->getLoader()->isFresh($name, $time); + } + + /** + * Tries to load a template consecutively from an array. + * + * Similar to load() but it also accepts instances of \Twig\Template and + * \Twig\TemplateWrapper, and an array of templates where each is tried to be loaded. + * + * @param string|Template|\Twig\TemplateWrapper|array $names A template or an array of templates to try consecutively + * + * @return TemplateWrapper|Template + * + * @throws LoaderError When none of the templates can be found + * @throws SyntaxError When an error occurred during compilation + */ + public function resolveTemplate($names) + { + if (!\is_array($names)) { + $names = [$names]; + } + + foreach ($names as $name) { + if ($name instanceof Template) { + return $name; + } + if ($name instanceof TemplateWrapper) { + return $name; + } + + try { + return $this->loadTemplate($name); + } catch (LoaderError $e) { + if (1 === \count($names)) { + throw $e; + } + } + } + + throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); + } + + /** + * Clears the internal template cache. + * + * @deprecated since 1.18.3 (to be removed in 2.0) + */ + public function clearTemplateCache() + { + @trigger_error(sprintf('The %s method is deprecated since version 1.18.3 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + $this->loadedTemplates = []; + } + + /** + * Clears the template cache files on the filesystem. + * + * @deprecated since 1.22 (to be removed in 2.0) + */ + public function clearCacheFiles() + { + @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + if (\is_string($this->originalCache)) { + foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->originalCache), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if ($file->isFile()) { + @unlink($file->getPathname()); + } + } + } + } + + /** + * Gets the Lexer instance. + * + * @return \Twig_LexerInterface + * + * @deprecated since 1.25 (to be removed in 2.0) + */ + public function getLexer() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED); + + if (null === $this->lexer) { + $this->lexer = new Lexer($this); + } + + return $this->lexer; + } + + public function setLexer(\Twig_LexerInterface $lexer) + { + $this->lexer = $lexer; + } + + /** + * Tokenizes a source code. + * + * @param string|Source $source The template source code + * @param string $name The template name (deprecated) + * + * @return TokenStream + * + * @throws SyntaxError When the code is syntactically wrong + */ + public function tokenize($source, $name = null) + { + if (!$source instanceof Source) { + @trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + $source = new Source($source, $name); + } + + if (null === $this->lexer) { + $this->lexer = new Lexer($this); + } + + return $this->lexer->tokenize($source); + } + + /** + * Gets the Parser instance. + * + * @return \Twig_ParserInterface + * + * @deprecated since 1.25 (to be removed in 2.0) + */ + public function getParser() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED); + + if (null === $this->parser) { + $this->parser = new Parser($this); + } + + return $this->parser; + } + + public function setParser(\Twig_ParserInterface $parser) + { + $this->parser = $parser; + } + + /** + * Converts a token stream to a node tree. + * + * @return ModuleNode + * + * @throws SyntaxError When the token stream is syntactically or semantically wrong + */ + public function parse(TokenStream $stream) + { + if (null === $this->parser) { + $this->parser = new Parser($this); + } + + return $this->parser->parse($stream); + } + + /** + * Gets the Compiler instance. + * + * @return \Twig_CompilerInterface + * + * @deprecated since 1.25 (to be removed in 2.0) + */ + public function getCompiler() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED); + + if (null === $this->compiler) { + $this->compiler = new Compiler($this); + } + + return $this->compiler; + } + + public function setCompiler(\Twig_CompilerInterface $compiler) + { + $this->compiler = $compiler; + } + + /** + * Compiles a node and returns the PHP code. + * + * @return string The compiled PHP source code + */ + public function compile(\Twig_NodeInterface $node) + { + if (null === $this->compiler) { + $this->compiler = new Compiler($this); + } + + return $this->compiler->compile($node)->getSource(); + } + + /** + * Compiles a template source code. + * + * @param string|Source $source The template source code + * @param string $name The template name (deprecated) + * + * @return string The compiled PHP source code + * + * @throws SyntaxError When there was an error during tokenizing, parsing or compiling + */ + public function compileSource($source, $name = null) + { + if (!$source instanceof Source) { + @trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + $source = new Source($source, $name); + } + + try { + return $this->compile($this->parse($this->tokenize($source))); + } catch (Error $e) { + $e->setSourceContext($source); + throw $e; + } catch (\Exception $e) { + throw new SyntaxError(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e); + } + } + + public function setLoader(LoaderInterface $loader) + { + if (!$loader instanceof SourceContextLoaderInterface && 0 !== strpos(\get_class($loader), 'Mock_')) { + @trigger_error(sprintf('Twig loader "%s" should implement Twig\Loader\SourceContextLoaderInterface since version 1.27.', \get_class($loader)), E_USER_DEPRECATED); + } + + $this->loader = $loader; + } + + /** + * Gets the Loader instance. + * + * @return LoaderInterface + */ + public function getLoader() + { + if (null === $this->loader) { + throw new \LogicException('You must set a loader first.'); + } + + return $this->loader; + } + + /** + * Sets the default template charset. + * + * @param string $charset The default charset + */ + public function setCharset($charset) + { + $this->charset = strtoupper($charset); + } + + /** + * Gets the default template charset. + * + * @return string The default charset + */ + public function getCharset() + { + return $this->charset; + } + + /** + * Initializes the runtime environment. + * + * @deprecated since 1.23 (to be removed in 2.0) + */ + public function initRuntime() + { + $this->runtimeInitialized = true; + + foreach ($this->getExtensions() as $name => $extension) { + if (!$extension instanceof InitRuntimeInterface) { + $m = new \ReflectionMethod($extension, 'initRuntime'); + + $parentClass = $m->getDeclaringClass()->getName(); + if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) { + @trigger_error(sprintf('Defining the initRuntime() method in the "%s" extension is deprecated since version 1.23. Use the `needs_environment` option to get the \Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig\Extension\InitRuntimeInterface if needed (not recommended).', $name), E_USER_DEPRECATED); + } + } + + $extension->initRuntime($this); + } + } + + /** + * Returns true if the given extension is registered. + * + * @param string $class The extension class name + * + * @return bool Whether the extension is registered or not + */ + public function hasExtension($class) + { + $class = ltrim($class, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new \ReflectionClass($class); + $class = $class->name; + } + + if (isset($this->extensions[$class])) { + if ($class !== \get_class($this->extensions[$class])) { + @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED); + } + + return true; + } + + return isset($this->extensionsByClass[$class]); + } + + /** + * Adds a runtime loader. + */ + public function addRuntimeLoader(RuntimeLoaderInterface $loader) + { + $this->runtimeLoaders[] = $loader; + } + + /** + * Gets an extension by class name. + * + * @param string $class The extension class name + * + * @return ExtensionInterface + */ + public function getExtension($class) + { + $class = ltrim($class, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new \ReflectionClass($class); + $class = $class->name; + } + + if (isset($this->extensions[$class])) { + if ($class !== \get_class($this->extensions[$class])) { + @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED); + } + + return $this->extensions[$class]; + } + + if (!isset($this->extensionsByClass[$class])) { + throw new RuntimeError(sprintf('The "%s" extension is not enabled.', $class)); + } + + return $this->extensionsByClass[$class]; + } + + /** + * Returns the runtime implementation of a Twig element (filter/function/test). + * + * @param string $class A runtime class name + * + * @return object The runtime implementation + * + * @throws RuntimeError When the template cannot be found + */ + public function getRuntime($class) + { + if (isset($this->runtimes[$class])) { + return $this->runtimes[$class]; + } + + foreach ($this->runtimeLoaders as $loader) { + if (null !== $runtime = $loader->load($class)) { + return $this->runtimes[$class] = $runtime; + } + } + + throw new RuntimeError(sprintf('Unable to load the "%s" runtime.', $class)); + } + + public function addExtension(ExtensionInterface $extension) + { + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName())); + } + + $class = \get_class($extension); + if ($class !== $extension->getName()) { + if (isset($this->extensions[$extension->getName()])) { + unset($this->extensions[$extension->getName()], $this->extensionsByClass[$class]); + @trigger_error(sprintf('The possibility to register the same extension twice ("%s") is deprecated since version 1.23 and will be removed in Twig 2.0. Use proper PHP inheritance instead.', $extension->getName()), E_USER_DEPRECATED); + } + } + + $this->lastModifiedExtension = 0; + $this->extensionsByClass[$class] = $extension; + $this->extensions[$extension->getName()] = $extension; + $this->updateOptionsHash(); + } + + /** + * Removes an extension by name. + * + * This method is deprecated and you should not use it. + * + * @param string $name The extension name + * + * @deprecated since 1.12 (to be removed in 2.0) + */ + public function removeExtension($name) + { + @trigger_error(sprintf('The %s method is deprecated since version 1.12 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to remove extension "%s" as extensions have already been initialized.', $name)); + } + + $class = ltrim($name, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new \ReflectionClass($class); + $class = $class->name; + } + + if (isset($this->extensions[$class])) { + if ($class !== \get_class($this->extensions[$class])) { + @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED); + } + + unset($this->extensions[$class]); + } + + unset($this->extensions[$class]); + $this->updateOptionsHash(); + } + + /** + * Registers an array of extensions. + * + * @param array $extensions An array of extensions + */ + public function setExtensions(array $extensions) + { + foreach ($extensions as $extension) { + $this->addExtension($extension); + } + } + + /** + * Returns all registered extensions. + * + * @return ExtensionInterface[] An array of extensions (keys are for internal usage only and should not be relied on) + */ + public function getExtensions() + { + return $this->extensions; + } + + public function addTokenParser(TokenParserInterface $parser) + { + if ($this->extensionInitialized) { + throw new \LogicException('Unable to add a token parser as extensions have already been initialized.'); + } + + $this->staging->addTokenParser($parser); + } + + /** + * Gets the registered Token Parsers. + * + * @return \Twig_TokenParserBrokerInterface + * + * @internal + */ + public function getTokenParsers() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->parsers; + } + + /** + * Gets registered tags. + * + * Be warned that this method cannot return tags defined by \Twig_TokenParserBrokerInterface classes. + * + * @return TokenParserInterface[] + * + * @internal + */ + public function getTags() + { + $tags = []; + foreach ($this->getTokenParsers()->getParsers() as $parser) { + if ($parser instanceof TokenParserInterface) { + $tags[$parser->getTag()] = $parser; + } + } + + return $tags; + } + + public function addNodeVisitor(NodeVisitorInterface $visitor) + { + if ($this->extensionInitialized) { + throw new \LogicException('Unable to add a node visitor as extensions have already been initialized.'); + } + + $this->staging->addNodeVisitor($visitor); + } + + /** + * Gets the registered Node Visitors. + * + * @return NodeVisitorInterface[] + * + * @internal + */ + public function getNodeVisitors() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->visitors; + } + + /** + * Registers a Filter. + * + * @param string|TwigFilter $name The filter name or a \Twig_SimpleFilter instance + * @param \Twig_FilterInterface|TwigFilter $filter + */ + public function addFilter($name, $filter = null) + { + if (!$name instanceof TwigFilter && !($filter instanceof TwigFilter || $filter instanceof \Twig_FilterInterface)) { + throw new \LogicException('A filter must be an instance of \Twig_FilterInterface or \Twig_SimpleFilter.'); + } + + if ($name instanceof TwigFilter) { + $filter = $name; + $name = $filter->getName(); + } else { + @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFilter" instead when defining filter "%s".', __METHOD__, $name), E_USER_DEPRECATED); + } + + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addFilter($name, $filter); + } + + /** + * Get a filter by name. + * + * Subclasses may override this method and load filters differently; + * so no list of filters is available. + * + * @param string $name The filter name + * + * @return \Twig_Filter|false + * + * @internal + */ + public function getFilter($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->filters[$name])) { + return $this->filters[$name]; + } + + foreach ($this->filters as $pattern => $filter) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $filter->setArguments($matches); + + return $filter; + } + } + } + + foreach ($this->filterCallbacks as $callback) { + if (false !== $filter = \call_user_func($callback, $name)) { + return $filter; + } + } + + return false; + } + + public function registerUndefinedFilterCallback($callable) + { + $this->filterCallbacks[] = $callable; + } + + /** + * Gets the registered Filters. + * + * Be warned that this method cannot return filters defined with registerUndefinedFilterCallback. + * + * @return \Twig_FilterInterface[] + * + * @see registerUndefinedFilterCallback + * + * @internal + */ + public function getFilters() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->filters; + } + + /** + * Registers a Test. + * + * @param string|TwigTest $name The test name or a \Twig_SimpleTest instance + * @param \Twig_TestInterface|TwigTest $test A \Twig_TestInterface instance or a \Twig_SimpleTest instance + */ + public function addTest($name, $test = null) + { + if (!$name instanceof TwigTest && !($test instanceof TwigTest || $test instanceof \Twig_TestInterface)) { + throw new \LogicException('A test must be an instance of \Twig_TestInterface or \Twig_SimpleTest.'); + } + + if ($name instanceof TwigTest) { + $test = $name; + $name = $test->getName(); + } else { + @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleTest" instead when defining test "%s".', __METHOD__, $name), E_USER_DEPRECATED); + } + + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addTest($name, $test); + } + + /** + * Gets the registered Tests. + * + * @return \Twig_TestInterface[] + * + * @internal + */ + public function getTests() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->tests; + } + + /** + * Gets a test by name. + * + * @param string $name The test name + * + * @return \Twig_Test|false + * + * @internal + */ + public function getTest($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->tests[$name])) { + return $this->tests[$name]; + } + + foreach ($this->tests as $pattern => $test) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $test->setArguments($matches); + + return $test; + } + } + } + + return false; + } + + /** + * Registers a Function. + * + * @param string|TwigFunction $name The function name or a \Twig_SimpleFunction instance + * @param \Twig_FunctionInterface|TwigFunction $function + */ + public function addFunction($name, $function = null) + { + if (!$name instanceof TwigFunction && !($function instanceof TwigFunction || $function instanceof \Twig_FunctionInterface)) { + throw new \LogicException('A function must be an instance of \Twig_FunctionInterface or \Twig_SimpleFunction.'); + } + + if ($name instanceof TwigFunction) { + $function = $name; + $name = $function->getName(); + } else { + @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFunction" instead when defining function "%s".', __METHOD__, $name), E_USER_DEPRECATED); + } + + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addFunction($name, $function); + } + + /** + * Get a function by name. + * + * Subclasses may override this method and load functions differently; + * so no list of functions is available. + * + * @param string $name function name + * + * @return \Twig_Function|false + * + * @internal + */ + public function getFunction($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->functions[$name])) { + return $this->functions[$name]; + } + + foreach ($this->functions as $pattern => $function) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $function->setArguments($matches); + + return $function; + } + } + } + + foreach ($this->functionCallbacks as $callback) { + if (false !== $function = \call_user_func($callback, $name)) { + return $function; + } + } + + return false; + } + + public function registerUndefinedFunctionCallback($callable) + { + $this->functionCallbacks[] = $callable; + } + + /** + * Gets registered functions. + * + * Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback. + * + * @return \Twig_FunctionInterface[] + * + * @see registerUndefinedFunctionCallback + * + * @internal + */ + public function getFunctions() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->functions; + } + + /** + * Registers a Global. + * + * New globals can be added before compiling or rendering a template; + * but after, you can only update existing globals. + * + * @param string $name The global name + * @param mixed $value The global value + */ + public function addGlobal($name, $value) + { + if ($this->extensionInitialized || $this->runtimeInitialized) { + if (null === $this->globals) { + $this->globals = $this->initGlobals(); + } + + if (!\array_key_exists($name, $this->globals)) { + // The deprecation notice must be turned into the following exception in Twig 2.0 + @trigger_error(sprintf('Registering global variable "%s" at runtime or when the extensions have already been initialized is deprecated since version 1.21.', $name), E_USER_DEPRECATED); + //throw new \LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name)); + } + } + + if ($this->extensionInitialized || $this->runtimeInitialized) { + // update the value + $this->globals[$name] = $value; + } else { + $this->staging->addGlobal($name, $value); + } + } + + /** + * Gets the registered Globals. + * + * @return array An array of globals + * + * @internal + */ + public function getGlobals() + { + if (!$this->runtimeInitialized && !$this->extensionInitialized) { + return $this->initGlobals(); + } + + if (null === $this->globals) { + $this->globals = $this->initGlobals(); + } + + return $this->globals; + } + + /** + * Merges a context with the defined globals. + * + * @param array $context An array representing the context + * + * @return array The context merged with the globals + */ + public function mergeGlobals(array $context) + { + // we don't use array_merge as the context being generally + // bigger than globals, this code is faster. + foreach ($this->getGlobals() as $key => $value) { + if (!\array_key_exists($key, $context)) { + $context[$key] = $value; + } + } + + return $context; + } + + /** + * Gets the registered unary Operators. + * + * @return array An array of unary operators + * + * @internal + */ + public function getUnaryOperators() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->unaryOperators; + } + + /** + * Gets the registered binary Operators. + * + * @return array An array of binary operators + * + * @internal + */ + public function getBinaryOperators() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->binaryOperators; + } + + /** + * @deprecated since 1.23 (to be removed in 2.0) + */ + public function computeAlternatives($name, $items) + { + @trigger_error(sprintf('The %s method is deprecated since version 1.23 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + return SyntaxError::computeAlternatives($name, $items); + } + + /** + * @internal + */ + protected function initGlobals() + { + $globals = []; + foreach ($this->extensions as $name => $extension) { + if (!$extension instanceof GlobalsInterface) { + $m = new \ReflectionMethod($extension, 'getGlobals'); + + $parentClass = $m->getDeclaringClass()->getName(); + if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) { + @trigger_error(sprintf('Defining the getGlobals() method in the "%s" extension without explicitly implementing Twig\Extension\GlobalsInterface is deprecated since version 1.23.', $name), E_USER_DEPRECATED); + } + } + + $extGlob = $extension->getGlobals(); + if (!\is_array($extGlob)) { + throw new \UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', \get_class($extension))); + } + + $globals[] = $extGlob; + } + + $globals[] = $this->staging->getGlobals(); + + return \call_user_func_array('array_merge', $globals); + } + + /** + * @internal + */ + protected function initExtensions() + { + if ($this->extensionInitialized) { + return; + } + + $this->parsers = new \Twig_TokenParserBroker([], [], false); + $this->filters = []; + $this->functions = []; + $this->tests = []; + $this->visitors = []; + $this->unaryOperators = []; + $this->binaryOperators = []; + + foreach ($this->extensions as $extension) { + $this->initExtension($extension); + } + $this->initExtension($this->staging); + // Done at the end only, so that an exception during initialization does not mark the environment as initialized when catching the exception + $this->extensionInitialized = true; + } + + /** + * @internal + */ + protected function initExtension(ExtensionInterface $extension) + { + // filters + foreach ($extension->getFilters() as $name => $filter) { + if ($filter instanceof TwigFilter) { + $name = $filter->getName(); + } else { + @trigger_error(sprintf('Using an instance of "%s" for filter "%s" is deprecated since version 1.21. Use \Twig_SimpleFilter instead.', \get_class($filter), $name), E_USER_DEPRECATED); + } + + $this->filters[$name] = $filter; + } + + // functions + foreach ($extension->getFunctions() as $name => $function) { + if ($function instanceof TwigFunction) { + $name = $function->getName(); + } else { + @trigger_error(sprintf('Using an instance of "%s" for function "%s" is deprecated since version 1.21. Use \Twig_SimpleFunction instead.', \get_class($function), $name), E_USER_DEPRECATED); + } + + $this->functions[$name] = $function; + } + + // tests + foreach ($extension->getTests() as $name => $test) { + if ($test instanceof TwigTest) { + $name = $test->getName(); + } else { + @trigger_error(sprintf('Using an instance of "%s" for test "%s" is deprecated since version 1.21. Use \Twig_SimpleTest instead.', \get_class($test), $name), E_USER_DEPRECATED); + } + + $this->tests[$name] = $test; + } + + // token parsers + foreach ($extension->getTokenParsers() as $parser) { + if ($parser instanceof TokenParserInterface) { + $this->parsers->addTokenParser($parser); + } elseif ($parser instanceof \Twig_TokenParserBrokerInterface) { + @trigger_error('Registering a \Twig_TokenParserBrokerInterface instance is deprecated since version 1.21.', E_USER_DEPRECATED); + + $this->parsers->addTokenParserBroker($parser); + } else { + throw new \LogicException('getTokenParsers() must return an array of \Twig_TokenParserInterface or \Twig_TokenParserBrokerInterface instances.'); + } + } + + // node visitors + foreach ($extension->getNodeVisitors() as $visitor) { + $this->visitors[] = $visitor; + } + + // operators + if ($operators = $extension->getOperators()) { + if (!\is_array($operators)) { + throw new \InvalidArgumentException(sprintf('"%s::getOperators()" must return an array with operators, got "%s".', \get_class($extension), \is_object($operators) ? \get_class($operators) : \gettype($operators).(\is_resource($operators) ? '' : '#'.$operators))); + } + + if (2 !== \count($operators)) { + throw new \InvalidArgumentException(sprintf('"%s::getOperators()" must return an array of 2 elements, got %d.', \get_class($extension), \count($operators))); + } + + $this->unaryOperators = array_merge($this->unaryOperators, $operators[0]); + $this->binaryOperators = array_merge($this->binaryOperators, $operators[1]); + } + } + + /** + * @deprecated since 1.22 (to be removed in 2.0) + */ + protected function writeCacheFile($file, $content) + { + $this->cache->write($file, $content); + } + + private function updateOptionsHash() + { + $hashParts = array_merge( + array_keys($this->extensions), + [ + (int) \function_exists('twig_template_get_attributes'), + PHP_MAJOR_VERSION, + PHP_MINOR_VERSION, + self::VERSION, + (int) $this->debug, + $this->baseTemplateClass, + (int) $this->strictVariables, + ] + ); + $this->optionsHash = implode(':', $hashParts); } } + +class_alias('Twig\Environment', 'Twig_Environment'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Error/Error.php --- a/vendor/twig/twig/src/Error/Error.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Error/Error.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,325 @@ + */ +class Error extends \Exception +{ + protected $lineno; + // to be renamed to name in 2.0 + protected $filename; + protected $rawMessage; + + private $sourcePath; + private $sourceCode; + + /** + * Constructor. + * + * Set the line number to -1 to enable its automatic guessing. + * Set the name to null to enable its automatic guessing. + * + * @param string $message The error message + * @param int $lineno The template line where the error occurred + * @param Source|string|null $source The source context where the error occurred + * @param \Exception $previous The previous exception + */ + public function __construct($message, $lineno = -1, $source = null, \Exception $previous = null) { + if (null === $source) { + $name = null; + } elseif (!$source instanceof Source) { + // for compat with the Twig C ext., passing the template name as string is accepted + $name = $source; + } else { + $name = $source->getName(); + $this->sourceCode = $source->getCode(); + $this->sourcePath = $source->getPath(); + } + parent::__construct('', 0, $previous); + + $this->lineno = $lineno; + $this->filename = $name; + $this->rawMessage = $message; + $this->updateRepr(); + } + + /** + * Gets the raw message. + * + * @return string The raw message + */ + public function getRawMessage() + { + return $this->rawMessage; + } + + /** + * Gets the logical name where the error occurred. + * + * @return string The name + * + * @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead. + */ + public function getTemplateFile() + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->filename; + } + + /** + * Sets the logical name where the error occurred. + * + * @param string $name The name + * + * @deprecated since 1.27 (to be removed in 2.0). Use setSourceContext() instead. + */ + public function setTemplateFile($name) + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + $this->filename = $name; + + $this->updateRepr(); + } + + /** + * Gets the logical name where the error occurred. + * + * @return string The name + * + * @deprecated since 1.29 (to be removed in 2.0). Use getSourceContext() instead. + */ + public function getTemplateName() + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->filename; + } + + /** + * Sets the logical name where the error occurred. + * + * @param string $name The name + * + * @deprecated since 1.29 (to be removed in 2.0). Use setSourceContext() instead. + */ + public function setTemplateName($name) + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + $this->filename = $name; + $this->sourceCode = $this->sourcePath = null; + + $this->updateRepr(); + } + + /** + * Gets the template line where the error occurred. + * + * @return int The template line + */ + public function getTemplateLine() + { + return $this->lineno; + } + + /** + * Sets the template line where the error occurred. + * + * @param int $lineno The template line + */ + public function setTemplateLine($lineno) + { + $this->lineno = $lineno; + + $this->updateRepr(); + } + + /** + * Gets the source context of the Twig template where the error occurred. + * + * @return Source|null + */ + public function getSourceContext() + { + return $this->filename ? new Source($this->sourceCode, $this->filename, $this->sourcePath) : null; + } + + /** + * Sets the source context of the Twig template where the error occurred. + */ + public function setSourceContext(Source $source = null) + { + if (null === $source) { + $this->sourceCode = $this->filename = $this->sourcePath = null; + } else { + $this->sourceCode = $source->getCode(); + $this->filename = $source->getName(); + $this->sourcePath = $source->getPath(); + } + + $this->updateRepr(); + } + + public function guess() + { + $this->guessTemplateInfo(); + $this->updateRepr(); + } + + public function appendMessage($rawMessage) + { + $this->rawMessage .= $rawMessage; + $this->updateRepr(); + } + + /** + * @internal + */ + protected function updateRepr() + { + $this->message = $this->rawMessage; + + if ($this->sourcePath && $this->lineno > 0) { + $this->file = $this->sourcePath; + $this->line = $this->lineno; + + return; + } + + $dot = false; + if ('.' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $dot = true; + } + + $questionMark = false; + if ('?' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $questionMark = true; + } + + if ($this->filename) { + if (\is_string($this->filename) || (\is_object($this->filename) && method_exists($this->filename, '__toString'))) { + $name = sprintf('"%s"', $this->filename); + } else { + $name = json_encode($this->filename); + } + $this->message .= sprintf(' in %s', $name); + } + + if ($this->lineno && $this->lineno >= 0) { + $this->message .= sprintf(' at line %d', $this->lineno); + } + + if ($dot) { + $this->message .= '.'; + } + + if ($questionMark) { + $this->message .= '?'; + } + } + + /** + * @internal + */ + protected function guessTemplateInfo() + { + $template = null; + $templateClass = null; + + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); + foreach ($backtrace as $trace) { + if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig_Template' !== \get_class($trace['object'])) { + $currentClass = \get_class($trace['object']); + $isEmbedContainer = 0 === strpos($templateClass, $currentClass); + if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) { + $template = $trace['object']; + $templateClass = \get_class($trace['object']); + } + } + } + + // update template name + if (null !== $template && null === $this->filename) { + $this->filename = $template->getTemplateName(); + } + + // update template path if any + if (null !== $template && null === $this->sourcePath) { + $src = $template->getSourceContext(); + $this->sourceCode = $src->getCode(); + $this->sourcePath = $src->getPath(); + } + + if (null === $template || $this->lineno > -1) { + return; + } + + $r = new \ReflectionObject($template); + $file = $r->getFileName(); + + $exceptions = [$e = $this]; + while ($e instanceof self && $e = $e->getPrevious()) { + $exceptions[] = $e; + } + + while ($e = array_pop($exceptions)) { + $traces = $e->getTrace(); + array_unshift($traces, ['file' => $e->getFile(), 'line' => $e->getLine()]); + + while ($trace = array_shift($traces)) { + if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) { + continue; + } + + foreach ($template->getDebugInfo() as $codeLine => $templateLine) { + if ($codeLine <= $trace['line']) { + // update template line + $this->lineno = $templateLine; + + return; + } + } + } + } } } + +class_alias('Twig\Error\Error', 'Twig_Error'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Error/LoaderError.php --- a/vendor/twig/twig/src/Error/LoaderError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Error/LoaderError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,23 @@ + */ +class LoaderError extends Error +{ +} -if (\false) { - class LoaderError extends \Twig_Error_Loader - { - } -} +class_alias('Twig\Error\LoaderError', 'Twig_Error_Loader'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Error/RuntimeError.php --- a/vendor/twig/twig/src/Error/RuntimeError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Error/RuntimeError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,24 @@ + */ +class RuntimeError extends Error +{ +} -if (\false) { - class RuntimeError extends \Twig_Error_Runtime - { - } -} +class_alias('Twig\Error\RuntimeError', 'Twig_Error_Runtime'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Error/SyntaxError.php --- a/vendor/twig/twig/src/Error/SyntaxError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Error/SyntaxError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,57 @@ + */ +class SyntaxError extends Error +{ + /** + * Tweaks the error message to include suggestions. + * + * @param string $name The original name of the item that does not exist + * @param array $items An array of possible items + */ + public function addSuggestions($name, array $items) + { + if (!$alternatives = self::computeAlternatives($name, $items)) { + return; + } -if (\false) { - class SyntaxError extends \Twig_Error_Syntax + $this->appendMessage(sprintf(' Did you mean "%s"?', implode('", "', $alternatives))); + } + + /** + * @internal + * + * To be merged with the addSuggestions() method in 2.0. + */ + public static function computeAlternatives($name, $items) { + $alternatives = []; + foreach ($items as $item) { + $lev = levenshtein($name, $item); + if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) { + $alternatives[$item] = $lev; + } + } + asort($alternatives); + + return array_keys($alternatives); } } + +class_alias('Twig\Error\SyntaxError', 'Twig_Error_Syntax'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/ExpressionParser.php --- a/vendor/twig/twig/src/ExpressionParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/ExpressionParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,765 @@ + * + * @internal + */ +class ExpressionParser +{ + const OPERATOR_LEFT = 1; + const OPERATOR_RIGHT = 2; + + protected $parser; + protected $unaryOperators; + protected $binaryOperators; + + private $env; + + public function __construct(Parser $parser, $env = null) { + $this->parser = $parser; + + if ($env instanceof Environment) { + $this->env = $env; + $this->unaryOperators = $env->getUnaryOperators(); + $this->binaryOperators = $env->getBinaryOperators(); + } else { + @trigger_error('Passing the operators as constructor arguments to '.__METHOD__.' is deprecated since version 1.27. Pass the environment instead.', E_USER_DEPRECATED); + + $this->env = $parser->getEnvironment(); + $this->unaryOperators = func_get_arg(1); + $this->binaryOperators = func_get_arg(2); + } + } + + public function parseExpression($precedence = 0) + { + $expr = $this->getPrimary(); + $token = $this->parser->getCurrentToken(); + while ($this->isBinary($token) && $this->binaryOperators[$token->getValue()]['precedence'] >= $precedence) { + $op = $this->binaryOperators[$token->getValue()]; + $this->parser->getStream()->next(); + + if ('is not' === $token->getValue()) { + $expr = $this->parseNotTestExpression($expr); + } elseif ('is' === $token->getValue()) { + $expr = $this->parseTestExpression($expr); + } elseif (isset($op['callable'])) { + $expr = \call_user_func($op['callable'], $this->parser, $expr); + } else { + $expr1 = $this->parseExpression(self::OPERATOR_LEFT === $op['associativity'] ? $op['precedence'] + 1 : $op['precedence']); + $class = $op['class']; + $expr = new $class($expr, $expr1, $token->getLine()); + } + + $token = $this->parser->getCurrentToken(); + } + + if (0 === $precedence) { + return $this->parseConditionalExpression($expr); + } + + return $expr; + } + + protected function getPrimary() + { + $token = $this->parser->getCurrentToken(); + + if ($this->isUnary($token)) { + $operator = $this->unaryOperators[$token->getValue()]; + $this->parser->getStream()->next(); + $expr = $this->parseExpression($operator['precedence']); + $class = $operator['class']; + + return $this->parsePostfixExpression(new $class($expr, $token->getLine())); + } elseif ($token->test(Token::PUNCTUATION_TYPE, '(')) { + $this->parser->getStream()->next(); + $expr = $this->parseExpression(); + $this->parser->getStream()->expect(Token::PUNCTUATION_TYPE, ')', 'An opened parenthesis is not properly closed'); + + return $this->parsePostfixExpression($expr); + } + + return $this->parsePrimaryExpression(); + } + + protected function parseConditionalExpression($expr) + { + while ($this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, '?')) { + if (!$this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ':')) { + $expr2 = $this->parseExpression(); + if ($this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ':')) { + $expr3 = $this->parseExpression(); + } else { + $expr3 = new ConstantExpression('', $this->parser->getCurrentToken()->getLine()); + } + } else { + $expr2 = $expr; + $expr3 = $this->parseExpression(); + } + + $expr = new ConditionalExpression($expr, $expr2, $expr3, $this->parser->getCurrentToken()->getLine()); + } + + return $expr; + } + + protected function isUnary(Token $token) + { + return $token->test(Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->getValue()]); + } + + protected function isBinary(Token $token) + { + return $token->test(Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->getValue()]); + } + + public function parsePrimaryExpression() + { + $token = $this->parser->getCurrentToken(); + switch ($token->getType()) { + case Token::NAME_TYPE: + $this->parser->getStream()->next(); + switch ($token->getValue()) { + case 'true': + case 'TRUE': + $node = new ConstantExpression(true, $token->getLine()); + break; + + case 'false': + case 'FALSE': + $node = new ConstantExpression(false, $token->getLine()); + break; + + case 'none': + case 'NONE': + case 'null': + case 'NULL': + $node = new ConstantExpression(null, $token->getLine()); + break; + + default: + if ('(' === $this->parser->getCurrentToken()->getValue()) { + $node = $this->getFunctionNode($token->getValue(), $token->getLine()); + } else { + $node = new NameExpression($token->getValue(), $token->getLine()); + } + } + break; + + case Token::NUMBER_TYPE: + $this->parser->getStream()->next(); + $node = new ConstantExpression($token->getValue(), $token->getLine()); + break; + + case Token::STRING_TYPE: + case Token::INTERPOLATION_START_TYPE: + $node = $this->parseStringExpression(); + break; + + case Token::OPERATOR_TYPE: + if (preg_match(Lexer::REGEX_NAME, $token->getValue(), $matches) && $matches[0] == $token->getValue()) { + // in this context, string operators are variable names + $this->parser->getStream()->next(); + $node = new NameExpression($token->getValue(), $token->getLine()); + break; + } elseif (isset($this->unaryOperators[$token->getValue()])) { + $class = $this->unaryOperators[$token->getValue()]['class']; + + $ref = new \ReflectionClass($class); + $negClass = 'Twig\Node\Expression\Unary\NegUnary'; + $posClass = 'Twig\Node\Expression\Unary\PosUnary'; + if (!(\in_array($ref->getName(), [$negClass, $posClass, 'Twig_Node_Expression_Unary_Neg', 'Twig_Node_Expression_Unary_Pos']) + || $ref->isSubclassOf($negClass) || $ref->isSubclassOf($posClass) + || $ref->isSubclassOf('Twig_Node_Expression_Unary_Neg') || $ref->isSubclassOf('Twig_Node_Expression_Unary_Pos')) + ) { + throw new SyntaxError(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); + } + + $this->parser->getStream()->next(); + $expr = $this->parsePrimaryExpression(); + + $node = new $class($expr, $token->getLine()); + break; + } + + // no break + default: + if ($token->test(Token::PUNCTUATION_TYPE, '[')) { + $node = $this->parseArrayExpression(); + } elseif ($token->test(Token::PUNCTUATION_TYPE, '{')) { + $node = $this->parseHashExpression(); + } elseif ($token->test(Token::OPERATOR_TYPE, '=') && ('==' === $this->parser->getStream()->look(-1)->getValue() || '!=' === $this->parser->getStream()->look(-1)->getValue())) { + throw new SyntaxError(sprintf('Unexpected operator of value "%s". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead.', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); + } else { + throw new SyntaxError(sprintf('Unexpected token "%s" of value "%s".', Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); + } + } + + return $this->parsePostfixExpression($node); + } + + public function parseStringExpression() + { + $stream = $this->parser->getStream(); + + $nodes = []; + // a string cannot be followed by another string in a single expression + $nextCanBeString = true; + while (true) { + if ($nextCanBeString && $token = $stream->nextIf(Token::STRING_TYPE)) { + $nodes[] = new ConstantExpression($token->getValue(), $token->getLine()); + $nextCanBeString = false; + } elseif ($stream->nextIf(Token::INTERPOLATION_START_TYPE)) { + $nodes[] = $this->parseExpression(); + $stream->expect(Token::INTERPOLATION_END_TYPE); + $nextCanBeString = true; + } else { + break; + } + } + + $expr = array_shift($nodes); + foreach ($nodes as $node) { + $expr = new ConcatBinary($expr, $node, $node->getTemplateLine()); + } + + return $expr; + } + + public function parseArrayExpression() + { + $stream = $this->parser->getStream(); + $stream->expect(Token::PUNCTUATION_TYPE, '[', 'An array element was expected'); + + $node = new ArrayExpression([], $stream->getCurrent()->getLine()); + $first = true; + while (!$stream->test(Token::PUNCTUATION_TYPE, ']')) { + if (!$first) { + $stream->expect(Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma'); + + // trailing ,? + if ($stream->test(Token::PUNCTUATION_TYPE, ']')) { + break; + } + } + $first = false; + + $node->addElement($this->parseExpression()); + } + $stream->expect(Token::PUNCTUATION_TYPE, ']', 'An opened array is not properly closed'); + + return $node; + } + + public function parseHashExpression() + { + $stream = $this->parser->getStream(); + $stream->expect(Token::PUNCTUATION_TYPE, '{', 'A hash element was expected'); + + $node = new ArrayExpression([], $stream->getCurrent()->getLine()); + $first = true; + while (!$stream->test(Token::PUNCTUATION_TYPE, '}')) { + if (!$first) { + $stream->expect(Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma'); + + // trailing ,? + if ($stream->test(Token::PUNCTUATION_TYPE, '}')) { + break; + } + } + $first = false; + + // a hash key can be: + // + // * a number -- 12 + // * a string -- 'a' + // * a name, which is equivalent to a string -- a + // * an expression, which must be enclosed in parentheses -- (1 + 2) + if (($token = $stream->nextIf(Token::STRING_TYPE)) || ($token = $stream->nextIf(Token::NAME_TYPE)) || $token = $stream->nextIf(Token::NUMBER_TYPE)) { + $key = new ConstantExpression($token->getValue(), $token->getLine()); + } elseif ($stream->test(Token::PUNCTUATION_TYPE, '(')) { + $key = $this->parseExpression(); + } else { + $current = $stream->getCurrent(); + + throw new SyntaxError(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s".', Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $stream->getSourceContext()); + } + + $stream->expect(Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)'); + $value = $this->parseExpression(); + + $node->addElement($value, $key); + } + $stream->expect(Token::PUNCTUATION_TYPE, '}', 'An opened hash is not properly closed'); + + return $node; + } + + public function parsePostfixExpression($node) + { + while (true) { + $token = $this->parser->getCurrentToken(); + if (Token::PUNCTUATION_TYPE == $token->getType()) { + if ('.' == $token->getValue() || '[' == $token->getValue()) { + $node = $this->parseSubscriptExpression($node); + } elseif ('|' == $token->getValue()) { + $node = $this->parseFilterExpression($node); + } else { + break; + } + } else { + break; + } + } + + return $node; + } + + public function getFunctionNode($name, $line) + { + switch ($name) { + case 'parent': + $this->parseArguments(); + if (!\count($this->parser->getBlockStack())) { + throw new SyntaxError('Calling "parent" outside a block is forbidden.', $line, $this->parser->getStream()->getSourceContext()); + } + + if (!$this->parser->getParent() && !$this->parser->hasTraits()) { + throw new SyntaxError('Calling "parent" on a template that does not extend nor "use" another template is forbidden.', $line, $this->parser->getStream()->getSourceContext()); + } + + return new ParentExpression($this->parser->peekBlockStack(), $line); + case 'block': + $args = $this->parseArguments(); + if (\count($args) < 1) { + throw new SyntaxError('The "block" function takes one argument (the block name).', $line, $this->parser->getStream()->getSourceContext()); + } + + return new BlockReferenceExpression($args->getNode(0), \count($args) > 1 ? $args->getNode(1) : null, $line); + case 'attribute': + $args = $this->parseArguments(); + if (\count($args) < 2) { + throw new SyntaxError('The "attribute" function takes at least two arguments (the variable and the attributes).', $line, $this->parser->getStream()->getSourceContext()); + } + + return new GetAttrExpression($args->getNode(0), $args->getNode(1), \count($args) > 2 ? $args->getNode(2) : null, Template::ANY_CALL, $line); + default: + if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) { + $arguments = new ArrayExpression([], $line); + foreach ($this->parseArguments() as $n) { + $arguments->addElement($n); + } + + $node = new MethodCallExpression($alias['node'], $alias['name'], $arguments, $line); + $node->setAttribute('safe', true); + + return $node; + } + + $args = $this->parseArguments(true); + $class = $this->getFunctionNodeClass($name, $line); + + return new $class($name, $args, $line); + } + } + + public function parseSubscriptExpression($node) + { + $stream = $this->parser->getStream(); + $token = $stream->next(); + $lineno = $token->getLine(); + $arguments = new ArrayExpression([], $lineno); + $type = Template::ANY_CALL; + if ('.' == $token->getValue()) { + $token = $stream->next(); + if ( + Token::NAME_TYPE == $token->getType() + || + Token::NUMBER_TYPE == $token->getType() + || + (Token::OPERATOR_TYPE == $token->getType() && preg_match(Lexer::REGEX_NAME, $token->getValue())) + ) { + $arg = new ConstantExpression($token->getValue(), $lineno); + + if ($stream->test(Token::PUNCTUATION_TYPE, '(')) { + $type = Template::METHOD_CALL; + foreach ($this->parseArguments() as $n) { + $arguments->addElement($n); + } + } + } else { + throw new SyntaxError('Expected name or number.', $lineno, $stream->getSourceContext()); + } + + if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) { + if (!$arg instanceof ConstantExpression) { + throw new SyntaxError(sprintf('Dynamic macro names are not supported (called on "%s").', $node->getAttribute('name')), $token->getLine(), $stream->getSourceContext()); + } + + $name = $arg->getAttribute('value'); + + if ($this->parser->isReservedMacroName($name)) { + throw new SyntaxError(sprintf('"%s" cannot be called as macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext()); + } + + $node = new MethodCallExpression($node, 'get'.$name, $arguments, $lineno); + $node->setAttribute('safe', true); + + return $node; + } + } else { + $type = Template::ARRAY_CALL; + + // slice? + $slice = false; + if ($stream->test(Token::PUNCTUATION_TYPE, ':')) { + $slice = true; + $arg = new ConstantExpression(0, $token->getLine()); + } else { + $arg = $this->parseExpression(); + } + + if ($stream->nextIf(Token::PUNCTUATION_TYPE, ':')) { + $slice = true; + } + + if ($slice) { + if ($stream->test(Token::PUNCTUATION_TYPE, ']')) { + $length = new ConstantExpression(null, $token->getLine()); + } else { + $length = $this->parseExpression(); + } + + $class = $this->getFilterNodeClass('slice', $token->getLine()); + $arguments = new Node([$arg, $length]); + $filter = new $class($node, new ConstantExpression('slice', $token->getLine()), $arguments, $token->getLine()); + + $stream->expect(Token::PUNCTUATION_TYPE, ']'); + + return $filter; + } + + $stream->expect(Token::PUNCTUATION_TYPE, ']'); + } + + return new GetAttrExpression($node, $arg, $arguments, $type, $lineno); + } + + public function parseFilterExpression($node) + { + $this->parser->getStream()->next(); + + return $this->parseFilterExpressionRaw($node); + } + + public function parseFilterExpressionRaw($node, $tag = null) + { + while (true) { + $token = $this->parser->getStream()->expect(Token::NAME_TYPE); + + $name = new ConstantExpression($token->getValue(), $token->getLine()); + if (!$this->parser->getStream()->test(Token::PUNCTUATION_TYPE, '(')) { + $arguments = new Node(); + } else { + $arguments = $this->parseArguments(true); + } + + $class = $this->getFilterNodeClass($name->getAttribute('value'), $token->getLine()); + + $node = new $class($node, $name, $arguments, $token->getLine(), $tag); + + if (!$this->parser->getStream()->test(Token::PUNCTUATION_TYPE, '|')) { + break; + } + + $this->parser->getStream()->next(); + } + + return $node; + } + + /** + * Parses arguments. + * + * @param bool $namedArguments Whether to allow named arguments or not + * @param bool $definition Whether we are parsing arguments for a function definition + * + * @return Node + * + * @throws SyntaxError + */ + public function parseArguments($namedArguments = false, $definition = false) + { + $args = []; + $stream = $this->parser->getStream(); + + $stream->expect(Token::PUNCTUATION_TYPE, '(', 'A list of arguments must begin with an opening parenthesis'); + while (!$stream->test(Token::PUNCTUATION_TYPE, ')')) { + if (!empty($args)) { + $stream->expect(Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma'); + } + + if ($definition) { + $token = $stream->expect(Token::NAME_TYPE, null, 'An argument must be a name'); + $value = new NameExpression($token->getValue(), $this->parser->getCurrentToken()->getLine()); + } else { + $value = $this->parseExpression(); + } + + $name = null; + if ($namedArguments && $token = $stream->nextIf(Token::OPERATOR_TYPE, '=')) { + if (!$value instanceof NameExpression) { + throw new SyntaxError(sprintf('A parameter name must be a string, "%s" given.', \get_class($value)), $token->getLine(), $stream->getSourceContext()); + } + $name = $value->getAttribute('name'); + + if ($definition) { + $value = $this->parsePrimaryExpression(); + + if (!$this->checkConstantExpression($value)) { + throw new SyntaxError(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $stream->getSourceContext()); + } + } else { + $value = $this->parseExpression(); + } + } + + if ($definition) { + if (null === $name) { + $name = $value->getAttribute('name'); + $value = new ConstantExpression(null, $this->parser->getCurrentToken()->getLine()); + } + $args[$name] = $value; + } else { + if (null === $name) { + $args[] = $value; + } else { + $args[$name] = $value; + } + } + } + $stream->expect(Token::PUNCTUATION_TYPE, ')', 'A list of arguments must be closed by a parenthesis'); + + return new Node($args); + } + + public function parseAssignmentExpression() + { + $stream = $this->parser->getStream(); + $targets = []; + while (true) { + $token = $stream->expect(Token::NAME_TYPE, null, 'Only variables can be assigned to'); + $value = $token->getValue(); + if (\in_array(strtolower($value), ['true', 'false', 'none', 'null'])) { + throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext()); + } + $targets[] = new AssignNameExpression($value, $token->getLine()); + + if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } + + return new Node($targets); + } + + public function parseMultitargetExpression() + { + $targets = []; + while (true) { + $targets[] = $this->parseExpression(); + if (!$this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } + + return new Node($targets); + } + + private function parseNotTestExpression(\Twig_NodeInterface $node) + { + return new NotUnary($this->parseTestExpression($node), $this->parser->getCurrentToken()->getLine()); + } + + private function parseTestExpression(\Twig_NodeInterface $node) + { + $stream = $this->parser->getStream(); + list($name, $test) = $this->getTest($node->getTemplateLine()); + + $class = $this->getTestNodeClass($test); + $arguments = null; + if ($stream->test(Token::PUNCTUATION_TYPE, '(')) { + $arguments = $this->parser->getExpressionParser()->parseArguments(true); + } + + return new $class($node, $name, $arguments, $this->parser->getCurrentToken()->getLine()); + } + + private function getTest($line) + { + $stream = $this->parser->getStream(); + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + + if ($test = $this->env->getTest($name)) { + return [$name, $test]; + } + + if ($stream->test(Token::NAME_TYPE)) { + // try 2-words tests + $name = $name.' '.$this->parser->getCurrentToken()->getValue(); + + if ($test = $this->env->getTest($name)) { + $stream->next(); + + return [$name, $test]; + } + } + + $e = new SyntaxError(sprintf('Unknown "%s" test.', $name), $line, $stream->getSourceContext()); + $e->addSuggestions($name, array_keys($this->env->getTests())); + + throw $e; + } + + private function getTestNodeClass($test) + { + if ($test instanceof TwigTest && $test->isDeprecated()) { + $stream = $this->parser->getStream(); + $message = sprintf('Twig Test "%s" is deprecated', $test->getName()); + if (!\is_bool($test->getDeprecatedVersion())) { + $message .= sprintf(' since version %s', $test->getDeprecatedVersion()); + } + if ($test->getAlternative()) { + $message .= sprintf('. Use "%s" instead', $test->getAlternative()); + } + $src = $stream->getSourceContext(); + $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $stream->getCurrent()->getLine()); + + @trigger_error($message, E_USER_DEPRECATED); + } + + if ($test instanceof TwigTest) { + return $test->getNodeClass(); + } + + return $test instanceof \Twig_Test_Node ? $test->getClass() : 'Twig\Node\Expression\TestExpression'; + } + + protected function getFunctionNodeClass($name, $line) + { + if (false === $function = $this->env->getFunction($name)) { + $e = new SyntaxError(sprintf('Unknown "%s" function.', $name), $line, $this->parser->getStream()->getSourceContext()); + $e->addSuggestions($name, array_keys($this->env->getFunctions())); + + throw $e; + } + + if ($function instanceof TwigFunction && $function->isDeprecated()) { + $message = sprintf('Twig Function "%s" is deprecated', $function->getName()); + if (!\is_bool($function->getDeprecatedVersion())) { + $message .= sprintf(' since version %s', $function->getDeprecatedVersion()); + } + if ($function->getAlternative()) { + $message .= sprintf('. Use "%s" instead', $function->getAlternative()); + } + $src = $this->parser->getStream()->getSourceContext(); + $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line); + + @trigger_error($message, E_USER_DEPRECATED); + } + + if ($function instanceof TwigFunction) { + return $function->getNodeClass(); + } + + return $function instanceof \Twig_Function_Node ? $function->getClass() : 'Twig\Node\Expression\FunctionExpression'; + } + + protected function getFilterNodeClass($name, $line) + { + if (false === $filter = $this->env->getFilter($name)) { + $e = new SyntaxError(sprintf('Unknown "%s" filter.', $name), $line, $this->parser->getStream()->getSourceContext()); + $e->addSuggestions($name, array_keys($this->env->getFilters())); + + throw $e; + } + + if ($filter instanceof TwigFilter && $filter->isDeprecated()) { + $message = sprintf('Twig Filter "%s" is deprecated', $filter->getName()); + if (!\is_bool($filter->getDeprecatedVersion())) { + $message .= sprintf(' since version %s', $filter->getDeprecatedVersion()); + } + if ($filter->getAlternative()) { + $message .= sprintf('. Use "%s" instead', $filter->getAlternative()); + } + $src = $this->parser->getStream()->getSourceContext(); + $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line); + + @trigger_error($message, E_USER_DEPRECATED); + } + + if ($filter instanceof TwigFilter) { + return $filter->getNodeClass(); + } + + return $filter instanceof \Twig_Filter_Node ? $filter->getClass() : 'Twig\Node\Expression\FilterExpression'; + } + + // checks that the node only contains "constant" elements + protected function checkConstantExpression(\Twig_NodeInterface $node) + { + if (!($node instanceof ConstantExpression || $node instanceof ArrayExpression + || $node instanceof NegUnary || $node instanceof PosUnary + )) { + return false; + } + + foreach ($node as $n) { + if (!$this->checkConstantExpression($n)) { + return false; + } + } + + return true; } } + +class_alias('Twig\ExpressionParser', 'Twig_ExpressionParser'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/AbstractExtension.php --- a/vendor/twig/twig/src/Extension/AbstractExtension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/AbstractExtension.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,72 @@ escapers[$strategy] = $callable; + } + + /** + * Gets all defined escapers. + * + * @return array An array of escapers + */ + public function getEscapers() + { + return $this->escapers; + } + + /** + * Sets the default format to be used by the date filter. + * + * @param string $format The default date format string + * @param string $dateIntervalFormat The default date interval format string + */ + public function setDateFormat($format = null, $dateIntervalFormat = null) + { + if (null !== $format) { + $this->dateFormats[0] = $format; + } + + if (null !== $dateIntervalFormat) { + $this->dateFormats[1] = $dateIntervalFormat; + } + } + + /** + * Gets the default format to be used by the date filter. + * + * @return array The default date format string and the default date interval format string + */ + public function getDateFormat() + { + return $this->dateFormats; + } + + /** + * Sets the default timezone to be used by the date filter. + * + * @param \DateTimeZone|string $timezone The default timezone string or a \DateTimeZone object + */ + public function setTimezone($timezone) + { + $this->timezone = $timezone instanceof \DateTimeZone ? $timezone : new \DateTimeZone($timezone); + } + + /** + * Gets the default timezone to be used by the date filter. + * + * @return \DateTimeZone The default timezone currently in use + */ + public function getTimezone() + { + if (null === $this->timezone) { + $this->timezone = new \DateTimeZone(date_default_timezone_get()); + } + + return $this->timezone; + } + + /** + * Sets the default format to be used by the number_format filter. + * + * @param int $decimal the number of decimal places to use + * @param string $decimalPoint the character(s) to use for the decimal point + * @param string $thousandSep the character(s) to use for the thousands separator + */ + public function setNumberFormat($decimal, $decimalPoint, $thousandSep) + { + $this->numberFormat = [$decimal, $decimalPoint, $thousandSep]; + } + + /** + * Get the default format used by the number_format filter. + * + * @return array The arguments for number_format() + */ + public function getNumberFormat() + { + return $this->numberFormat; + } + + public function getTokenParsers() + { + return [ + new ApplyTokenParser(), + new ForTokenParser(), + new IfTokenParser(), + new ExtendsTokenParser(), + new IncludeTokenParser(), + new BlockTokenParser(), + new UseTokenParser(), + new FilterTokenParser(), + new MacroTokenParser(), + new ImportTokenParser(), + new FromTokenParser(), + new SetTokenParser(), + new SpacelessTokenParser(), + new FlushTokenParser(), + new DoTokenParser(), + new EmbedTokenParser(), + new WithTokenParser(), + new DeprecatedTokenParser(), + ]; + } + + public function getFilters() + { + $filters = [ + // formatting filters + new TwigFilter('date', 'twig_date_format_filter', ['needs_environment' => true]), + new TwigFilter('date_modify', 'twig_date_modify_filter', ['needs_environment' => true]), + new TwigFilter('format', 'sprintf'), + new TwigFilter('replace', 'twig_replace_filter'), + new TwigFilter('number_format', 'twig_number_format_filter', ['needs_environment' => true]), + new TwigFilter('abs', 'abs'), + new TwigFilter('round', 'twig_round'), + + // encoding + new TwigFilter('url_encode', 'twig_urlencode_filter'), + new TwigFilter('json_encode', 'twig_jsonencode_filter'), + new TwigFilter('convert_encoding', 'twig_convert_encoding'), + + // string filters + new TwigFilter('title', 'twig_title_string_filter', ['needs_environment' => true]), + new TwigFilter('capitalize', 'twig_capitalize_string_filter', ['needs_environment' => true]), + new TwigFilter('upper', 'strtoupper'), + new TwigFilter('lower', 'strtolower'), + new TwigFilter('striptags', 'strip_tags'), + new TwigFilter('trim', 'twig_trim_filter'), + new TwigFilter('nl2br', 'nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), + new TwigFilter('spaceless', 'twig_spaceless', ['is_safe' => ['html']]), + + // array helpers + new TwigFilter('join', 'twig_join_filter'), + new TwigFilter('split', 'twig_split_filter', ['needs_environment' => true]), + new TwigFilter('sort', 'twig_sort_filter'), + new TwigFilter('merge', 'twig_array_merge'), + new TwigFilter('batch', 'twig_array_batch'), + + // string/array filters + new TwigFilter('reverse', 'twig_reverse_filter', ['needs_environment' => true]), + new TwigFilter('length', 'twig_length_filter', ['needs_environment' => true]), + new TwigFilter('slice', 'twig_slice', ['needs_environment' => true]), + new TwigFilter('first', 'twig_first', ['needs_environment' => true]), + new TwigFilter('last', 'twig_last', ['needs_environment' => true]), + + // iteration and runtime + new TwigFilter('default', '_twig_default_filter', ['node_class' => '\Twig\Node\Expression\Filter\DefaultFilter']), + new TwigFilter('keys', 'twig_get_array_keys_filter'), + + // escaping + new TwigFilter('escape', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']), + new TwigFilter('e', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']), + ]; + + if (\function_exists('mb_get_info')) { + $filters[] = new TwigFilter('upper', 'twig_upper_filter', ['needs_environment' => true]); + $filters[] = new TwigFilter('lower', 'twig_lower_filter', ['needs_environment' => true]); + } + + return $filters; + } + + public function getFunctions() + { + return [ + new TwigFunction('max', 'max'), + new TwigFunction('min', 'min'), + new TwigFunction('range', 'range'), + new TwigFunction('constant', 'twig_constant'), + new TwigFunction('cycle', 'twig_cycle'), + new TwigFunction('random', 'twig_random', ['needs_environment' => true]), + new TwigFunction('date', 'twig_date_converter', ['needs_environment' => true]), + new TwigFunction('include', 'twig_include', ['needs_environment' => true, 'needs_context' => true, 'is_safe' => ['all']]), + new TwigFunction('source', 'twig_source', ['needs_environment' => true, 'is_safe' => ['all']]), + ]; + } + + public function getTests() + { + return [ + new TwigTest('even', null, ['node_class' => '\Twig\Node\Expression\Test\EvenTest']), + new TwigTest('odd', null, ['node_class' => '\Twig\Node\Expression\Test\OddTest']), + new TwigTest('defined', null, ['node_class' => '\Twig\Node\Expression\Test\DefinedTest']), + new TwigTest('sameas', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest', 'deprecated' => '1.21', 'alternative' => 'same as']), + new TwigTest('same as', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest']), + new TwigTest('none', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']), + new TwigTest('null', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']), + new TwigTest('divisibleby', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest', 'deprecated' => '1.21', 'alternative' => 'divisible by']), + new TwigTest('divisible by', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest']), + new TwigTest('constant', null, ['node_class' => '\Twig\Node\Expression\Test\ConstantTest']), + new TwigTest('empty', 'twig_test_empty'), + new TwigTest('iterable', 'twig_test_iterable'), + ]; + } + + public function getOperators() + { + return [ + [ + 'not' => ['precedence' => 50, 'class' => '\Twig\Node\Expression\Unary\NotUnary'], + '-' => ['precedence' => 500, 'class' => '\Twig\Node\Expression\Unary\NegUnary'], + '+' => ['precedence' => 500, 'class' => '\Twig\Node\Expression\Unary\PosUnary'], + ], + [ + 'or' => ['precedence' => 10, 'class' => '\Twig\Node\Expression\Binary\OrBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'and' => ['precedence' => 15, 'class' => '\Twig\Node\Expression\Binary\AndBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'b-or' => ['precedence' => 16, 'class' => '\Twig\Node\Expression\Binary\BitwiseOrBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'b-xor' => ['precedence' => 17, 'class' => '\Twig\Node\Expression\Binary\BitwiseXorBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'b-and' => ['precedence' => 18, 'class' => '\Twig\Node\Expression\Binary\BitwiseAndBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '==' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\EqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '!=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '<' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '>' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '>=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '<=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'not in' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotInBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'in' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\InBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'matches' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\MatchesBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'starts with' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\StartsWithBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'ends with' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\EndsWithBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '..' => ['precedence' => 25, 'class' => '\Twig\Node\Expression\Binary\RangeBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '+' => ['precedence' => 30, 'class' => '\Twig\Node\Expression\Binary\AddBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '-' => ['precedence' => 30, 'class' => '\Twig\Node\Expression\Binary\SubBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '~' => ['precedence' => 40, 'class' => '\Twig\Node\Expression\Binary\ConcatBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '*' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\MulBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '/' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\DivBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '//' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\FloorDivBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '%' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\ModBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'is' => ['precedence' => 100, 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'is not' => ['precedence' => 100, 'associativity' => ExpressionParser::OPERATOR_LEFT], + '**' => ['precedence' => 200, 'class' => '\Twig\Node\Expression\Binary\PowerBinary', 'associativity' => ExpressionParser::OPERATOR_RIGHT], + '??' => ['precedence' => 300, 'class' => '\Twig\Node\Expression\NullCoalesceExpression', 'associativity' => ExpressionParser::OPERATOR_RIGHT], + ], + ]; + } + + public function getName() + { + return 'core'; } } + +class_alias('Twig\Extension\CoreExtension', 'Twig_Extension_Core'); +} + +namespace { +use Twig\Environment; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Loader\SourceContextLoaderInterface; +use Twig\Markup; +use Twig\Node\Expression\ConstantExpression; +use Twig\Node\Node; + +/** + * Cycles over a value. + * + * @param \ArrayAccess|array $values + * @param int $position The cycle position + * + * @return string The next value in the cycle + */ +function twig_cycle($values, $position) +{ + if (!\is_array($values) && !$values instanceof \ArrayAccess) { + return $values; + } + + return $values[$position % \count($values)]; +} + +/** + * Returns a random value depending on the supplied parameter type: + * - a random item from a \Traversable or array + * - a random character from a string + * - a random integer between 0 and the integer parameter. + * + * @param \Traversable|array|int|float|string $values The values to pick a random item from + * @param int|null $max Maximum value used when $values is an int + * + * @throws RuntimeError when $values is an empty array (does not apply to an empty string which is returned as is) + * + * @return mixed A random value from the given sequence + */ +function twig_random(Environment $env, $values = null, $max = null) +{ + if (null === $values) { + return null === $max ? mt_rand() : mt_rand(0, $max); + } + + if (\is_int($values) || \is_float($values)) { + if (null === $max) { + if ($values < 0) { + $max = 0; + $min = $values; + } else { + $max = $values; + $min = 0; + } + } else { + $min = $values; + $max = $max; + } + + return mt_rand($min, $max); + } + + if (\is_string($values)) { + if ('' === $values) { + return ''; + } + if (null !== $charset = $env->getCharset()) { + if ('UTF-8' !== $charset) { + $values = twig_convert_encoding($values, 'UTF-8', $charset); + } + + // unicode version of str_split() + // split at all positions, but not after the start and not before the end + $values = preg_split('/(? $value) { + $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8'); + } + } + } else { + return $values[mt_rand(0, \strlen($values) - 1)]; + } + } + + if (!twig_test_iterable($values)) { + return $values; + } + + $values = twig_to_array($values); + + if (0 === \count($values)) { + throw new RuntimeError('The random function cannot pick from an empty array.'); + } + + return $values[array_rand($values, 1)]; +} + +/** + * Converts a date to the given format. + * + * {{ post.published_at|date("m/d/Y") }} + * + * @param \DateTime|\DateTimeInterface|\DateInterval|string $date A date + * @param string|null $format The target format, null to use the default + * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged + * + * @return string The formatted date + */ +function twig_date_format_filter(Environment $env, $date, $format = null, $timezone = null) +{ + if (null === $format) { + $formats = $env->getExtension('\Twig\Extension\CoreExtension')->getDateFormat(); + $format = $date instanceof \DateInterval ? $formats[1] : $formats[0]; + } + + if ($date instanceof \DateInterval) { + return $date->format($format); + } + + return twig_date_converter($env, $date, $timezone)->format($format); +} + +/** + * Returns a new date object modified. + * + * {{ post.published_at|date_modify("-1day")|date("m/d/Y") }} + * + * @param \DateTime|string $date A date + * @param string $modifier A modifier string + * + * @return \DateTime + */ +function twig_date_modify_filter(Environment $env, $date, $modifier) +{ + $date = twig_date_converter($env, $date, false); + $resultDate = $date->modify($modifier); + + // This is a hack to ensure PHP 5.2 support and support for \DateTimeImmutable + // \DateTime::modify does not return the modified \DateTime object < 5.3.0 + // and \DateTimeImmutable does not modify $date. + return null === $resultDate ? $date : $resultDate; +} + +/** + * Converts an input to a \DateTime instance. + * + * {% if date(user.created_at) < date('+2days') %} + * {# do something #} + * {% endif %} + * + * @param \DateTime|\DateTimeInterface|string|null $date A date + * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged + * + * @return \DateTime + */ +function twig_date_converter(Environment $env, $date = null, $timezone = null) +{ + // determine the timezone + if (false !== $timezone) { + if (null === $timezone) { + $timezone = $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone(); + } elseif (!$timezone instanceof \DateTimeZone) { + $timezone = new \DateTimeZone($timezone); + } + } + + // immutable dates + if ($date instanceof \DateTimeImmutable) { + return false !== $timezone ? $date->setTimezone($timezone) : $date; + } + + if ($date instanceof \DateTime || $date instanceof \DateTimeInterface) { + $date = clone $date; + if (false !== $timezone) { + $date->setTimezone($timezone); + } + + return $date; + } + + if (null === $date || 'now' === $date) { + return new \DateTime($date, false !== $timezone ? $timezone : $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone()); + } + + $asString = (string) $date; + if (ctype_digit($asString) || (!empty($asString) && '-' === $asString[0] && ctype_digit(substr($asString, 1)))) { + $date = new \DateTime('@'.$date); + } else { + $date = new \DateTime($date, $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone()); + } + + if (false !== $timezone) { + $date->setTimezone($timezone); + } + + return $date; +} + +/** + * Replaces strings within a string. + * + * @param string $str String to replace in + * @param array|\Traversable $from Replace values + * @param string|null $to Replace to, deprecated (@see https://secure.php.net/manual/en/function.strtr.php) + * + * @return string + */ +function twig_replace_filter($str, $from, $to = null) +{ + if (\is_string($from) && \is_string($to)) { + @trigger_error('Using "replace" with character by character replacement is deprecated since version 1.22 and will be removed in Twig 2.0', E_USER_DEPRECATED); + + return strtr($str, $from, $to); + } + + if (!twig_test_iterable($from)) { + throw new RuntimeError(sprintf('The "replace" filter expects an array or "Traversable" as replace values, got "%s".', \is_object($from) ? \get_class($from) : \gettype($from))); + } + + return strtr($str, twig_to_array($from)); +} + +/** + * Rounds a number. + * + * @param int|float $value The value to round + * @param int|float $precision The rounding precision + * @param string $method The method to use for rounding + * + * @return int|float The rounded number + */ +function twig_round($value, $precision = 0, $method = 'common') +{ + if ('common' == $method) { + return round($value, $precision); + } + + if ('ceil' != $method && 'floor' != $method) { + throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.'); + } + + return $method($value * pow(10, $precision)) / pow(10, $precision); +} + +/** + * Number format filter. + * + * All of the formatting options can be left null, in that case the defaults will + * be used. Supplying any of the parameters will override the defaults set in the + * environment object. + * + * @param mixed $number A float/int/string of the number to format + * @param int $decimal the number of decimal points to display + * @param string $decimalPoint the character(s) to use for the decimal point + * @param string $thousandSep the character(s) to use for the thousands separator + * + * @return string The formatted number + */ +function twig_number_format_filter(Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null) +{ + $defaults = $env->getExtension('\Twig\Extension\CoreExtension')->getNumberFormat(); + if (null === $decimal) { + $decimal = $defaults[0]; + } + + if (null === $decimalPoint) { + $decimalPoint = $defaults[1]; + } + + if (null === $thousandSep) { + $thousandSep = $defaults[2]; + } + + return number_format((float) $number, $decimal, $decimalPoint, $thousandSep); +} + +/** + * URL encodes (RFC 3986) a string as a path segment or an array as a query string. + * + * @param string|array $url A URL or an array of query parameters + * + * @return string The URL encoded value + */ +function twig_urlencode_filter($url) +{ + if (\is_array($url)) { + if (\defined('PHP_QUERY_RFC3986')) { + return http_build_query($url, '', '&', PHP_QUERY_RFC3986); + } + + return http_build_query($url, '', '&'); + } + + return rawurlencode($url); +} + +/** + * JSON encodes a variable. + * + * @param mixed $value the value to encode + * @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT + * + * @return mixed The JSON encoded value + */ +function twig_jsonencode_filter($value, $options = 0) +{ + if ($value instanceof Markup) { + $value = (string) $value; + } elseif (\is_array($value)) { + array_walk_recursive($value, '_twig_markup2string'); + } + + return json_encode($value, $options); +} + +function _twig_markup2string(&$value) +{ + if ($value instanceof Markup) { + $value = (string) $value; + } +} + +/** + * Merges an array with another one. + * + * {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} + * + * {% set items = items|merge({ 'peugeot': 'car' }) %} + * + * {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #} + * + * @param array|\Traversable $arr1 An array + * @param array|\Traversable $arr2 An array + * + * @return array The merged array + */ +function twig_array_merge($arr1, $arr2) +{ + if (!twig_test_iterable($arr1)) { + throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($arr1))); + } + + if (!twig_test_iterable($arr2)) { + throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as second argument.', \gettype($arr2))); + } + + return array_merge(twig_to_array($arr1), twig_to_array($arr2)); +} + +/** + * Slices a variable. + * + * @param mixed $item A variable + * @param int $start Start of the slice + * @param int $length Size of the slice + * @param bool $preserveKeys Whether to preserve key or not (when the input is an array) + * + * @return mixed The sliced variable + */ +function twig_slice(Environment $env, $item, $start, $length = null, $preserveKeys = false) +{ + if ($item instanceof \Traversable) { + while ($item instanceof \IteratorAggregate) { + $item = $item->getIterator(); + } + + if ($start >= 0 && $length >= 0 && $item instanceof \Iterator) { + try { + return iterator_to_array(new \LimitIterator($item, $start, null === $length ? -1 : $length), $preserveKeys); + } catch (\OutOfBoundsException $e) { + return []; + } + } + + $item = iterator_to_array($item, $preserveKeys); + } + + if (\is_array($item)) { + return \array_slice($item, $start, $length, $preserveKeys); + } + + $item = (string) $item; + + if (\function_exists('mb_get_info') && null !== $charset = $env->getCharset()) { + return (string) mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset); + } + + return (string) (null === $length ? substr($item, $start) : substr($item, $start, $length)); +} + +/** + * Returns the first element of the item. + * + * @param mixed $item A variable + * + * @return mixed The first element of the item + */ +function twig_first(Environment $env, $item) +{ + $elements = twig_slice($env, $item, 0, 1, false); + + return \is_string($elements) ? $elements : current($elements); +} + +/** + * Returns the last element of the item. + * + * @param mixed $item A variable + * + * @return mixed The last element of the item + */ +function twig_last(Environment $env, $item) +{ + $elements = twig_slice($env, $item, -1, 1, false); + + return \is_string($elements) ? $elements : current($elements); +} + +/** + * Joins the values to a string. + * + * The separators between elements are empty strings per default, you can define them with the optional parameters. + * + * {{ [1, 2, 3]|join(', ', ' and ') }} + * {# returns 1, 2 and 3 #} + * + * {{ [1, 2, 3]|join('|') }} + * {# returns 1|2|3 #} + * + * {{ [1, 2, 3]|join }} + * {# returns 123 #} + * + * @param array $value An array + * @param string $glue The separator + * @param string|null $and The separator for the last pair + * + * @return string The concatenated string + */ +function twig_join_filter($value, $glue = '', $and = null) +{ + if (!twig_test_iterable($value)) { + $value = (array) $value; + } + + $value = twig_to_array($value, false); + + if (0 === \count($value)) { + return ''; + } + + if (null === $and || $and === $glue) { + return implode($glue, $value); + } + + if (1 === \count($value)) { + return $value[0]; + } + + return implode($glue, \array_slice($value, 0, -1)).$and.$value[\count($value) - 1]; +} + +/** + * Splits the string into an array. + * + * {{ "one,two,three"|split(',') }} + * {# returns [one, two, three] #} + * + * {{ "one,two,three,four,five"|split(',', 3) }} + * {# returns [one, two, "three,four,five"] #} + * + * {{ "123"|split('') }} + * {# returns [1, 2, 3] #} + * + * {{ "aabbcc"|split('', 2) }} + * {# returns [aa, bb, cc] #} + * + * @param string $value A string + * @param string $delimiter The delimiter + * @param int $limit The limit + * + * @return array The split string as an array + */ +function twig_split_filter(Environment $env, $value, $delimiter, $limit = null) +{ + if (!empty($delimiter)) { + return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); + } + + if (!\function_exists('mb_get_info') || null === $charset = $env->getCharset()) { + return str_split($value, null === $limit ? 1 : $limit); + } + + if ($limit <= 1) { + return preg_split('/(?getIterator(); + } + + if ($array instanceof \Iterator) { + $keys = []; + $array->rewind(); + while ($array->valid()) { + $keys[] = $array->key(); + $array->next(); + } + + return $keys; + } + + $keys = []; + foreach ($array as $key => $item) { + $keys[] = $key; + } + + return $keys; + } + + if (!\is_array($array)) { + return []; + } + + return array_keys($array); +} + +/** + * Reverses a variable. + * + * @param array|\Traversable|string $item An array, a \Traversable instance, or a string + * @param bool $preserveKeys Whether to preserve key or not + * + * @return mixed The reversed input + */ +function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) +{ + if ($item instanceof \Traversable) { + return array_reverse(iterator_to_array($item), $preserveKeys); + } + + if (\is_array($item)) { + return array_reverse($item, $preserveKeys); + } + + if (null !== $charset = $env->getCharset()) { + $string = (string) $item; + + if ('UTF-8' !== $charset) { + $item = twig_convert_encoding($string, 'UTF-8', $charset); + } + + preg_match_all('/./us', $item, $matches); + + $string = implode('', array_reverse($matches[0])); + + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + } + + return strrev((string) $item); +} + +/** + * Sorts an array. + * + * @param array|\Traversable $array + * + * @return array + */ +function twig_sort_filter($array) +{ + if ($array instanceof \Traversable) { + $array = iterator_to_array($array); + } elseif (!\is_array($array)) { + throw new RuntimeError(sprintf('The sort filter only works with arrays or "Traversable", got "%s".', \gettype($array))); + } + + asort($array); + + return $array; +} + +/** + * @internal + */ +function twig_in_filter($value, $compare) +{ + if ($value instanceof Markup) { + $value = (string) $value; + } + + if (\is_array($compare)) { + return \in_array($value, $compare, \is_object($value) || \is_resource($value)); + } elseif (\is_string($compare) && (\is_string($value) || \is_int($value) || \is_float($value))) { + return '' === $value || false !== strpos($compare, (string) $value); + } elseif ($compare instanceof \Traversable) { + if (\is_object($value) || \is_resource($value)) { + foreach ($compare as $item) { + if ($item === $value) { + return true; + } + } + } else { + foreach ($compare as $item) { + if ($item == $value) { + return true; + } + } + } + + return false; + } + + return false; +} + +/** + * Returns a trimmed string. + * + * @return string + * + * @throws RuntimeError When an invalid trimming side is used (not a string or not 'left', 'right', or 'both') + */ +function twig_trim_filter($string, $characterMask = null, $side = 'both') +{ + if (null === $characterMask) { + $characterMask = " \t\n\r\0\x0B"; + } + + switch ($side) { + case 'both': + return trim($string, $characterMask); + case 'left': + return ltrim($string, $characterMask); + case 'right': + return rtrim($string, $characterMask); + default: + throw new RuntimeError('Trimming side must be "left", "right" or "both".'); + } +} + +/** + * Removes whitespaces between HTML tags. + * + * @return string + */ +function twig_spaceless($content) +{ + return trim(preg_replace('/>\s+<', $content)); +} + +/** + * Escapes a string. + * + * @param mixed $string The value to be escaped + * @param string $strategy The escaping strategy + * @param string $charset The charset + * @param bool $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false) + * + * @return string + */ +function twig_escape_filter(Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false) +{ + if ($autoescape && $string instanceof Markup) { + return $string; + } + + if (!\is_string($string)) { + if (\is_object($string) && method_exists($string, '__toString')) { + $string = (string) $string; + } elseif (\in_array($strategy, ['html', 'js', 'css', 'html_attr', 'url'])) { + return $string; + } + } + + if ('' === $string) { + return ''; + } + + if (null === $charset) { + $charset = $env->getCharset(); + } + + switch ($strategy) { + case 'html': + // see https://secure.php.net/htmlspecialchars + + // Using a static variable to avoid initializing the array + // each time the function is called. Moving the declaration on the + // top of the function slow downs other escaping strategies. + static $htmlspecialcharsCharsets = [ + 'ISO-8859-1' => true, 'ISO8859-1' => true, + 'ISO-8859-15' => true, 'ISO8859-15' => true, + 'utf-8' => true, 'UTF-8' => true, + 'CP866' => true, 'IBM866' => true, '866' => true, + 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, + '1251' => true, + 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, + 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, + 'BIG5' => true, '950' => true, + 'GB2312' => true, '936' => true, + 'BIG5-HKSCS' => true, + 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true, + 'EUC-JP' => true, 'EUCJP' => true, + 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true, + ]; + + if (isset($htmlspecialcharsCharsets[$charset])) { + return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + } + + if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) { + // cache the lowercase variant for future iterations + $htmlspecialcharsCharsets[$charset] = true; + + return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + } + + $string = twig_convert_encoding($string, 'UTF-8', $charset); + $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + + return twig_convert_encoding($string, $charset, 'UTF-8'); + + case 'js': + // escape all non-alphanumeric characters + // into their \x or \uHHHH representations + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (!preg_match('//u', $string)) { + throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9,\._]#Su', '_twig_escape_js_callback', $string); + + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'css': + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (!preg_match('//u', $string)) { + throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9]#Su', '_twig_escape_css_callback', $string); + + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'html_attr': + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (!preg_match('//u', $string)) { + throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9,\.\-_]#Su', '_twig_escape_html_attr_callback', $string); + + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'url': + return rawurlencode($string); + + default: + static $escapers; + + if (null === $escapers) { + $escapers = $env->getExtension('\Twig\Extension\CoreExtension')->getEscapers(); + } + + if (isset($escapers[$strategy])) { + return \call_user_func($escapers[$strategy], $env, $string, $charset); + } + + $validStrategies = implode(', ', array_merge(['html', 'js', 'url', 'css', 'html_attr'], array_keys($escapers))); + + throw new RuntimeError(sprintf('Invalid escaping strategy "%s" (valid ones: %s).', $strategy, $validStrategies)); + } +} + +/** + * @internal + */ +function twig_escape_filter_is_safe(Node $filterArgs) +{ + foreach ($filterArgs as $arg) { + if ($arg instanceof ConstantExpression) { + return [$arg->getAttribute('value')]; + } + + return []; + } + + return ['html']; +} + +if (\function_exists('mb_convert_encoding')) { + function twig_convert_encoding($string, $to, $from) + { + return mb_convert_encoding($string, $to, $from); + } +} elseif (\function_exists('iconv')) { + function twig_convert_encoding($string, $to, $from) + { + return iconv($from, $to, $string); + } +} else { + function twig_convert_encoding($string, $to, $from) + { + throw new RuntimeError('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).'); + } +} + +if (\function_exists('mb_ord')) { + function twig_ord($string) + { + return mb_ord($string, 'UTF-8'); + } +} else { + function twig_ord($string) + { + $code = ($string = unpack('C*', substr($string, 0, 4))) ? $string[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($string[2] - 0x80) << 12) + (($string[3] - 0x80) << 6) + $string[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($string[2] - 0x80) << 6) + $string[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $string[2] - 0x80; + } + + return $code; + } +} + +function _twig_escape_js_callback($matches) +{ + $char = $matches[0]; + + /* + * A few characters have short escape sequences in JSON and JavaScript. + * Escape sequences supported only by JavaScript, not JSON, are ommitted. + * \" is also supported but omitted, because the resulting string is not HTML safe. + */ + static $shortMap = [ + '\\' => '\\\\', + '/' => '\\/', + "\x08" => '\b', + "\x0C" => '\f', + "\x0A" => '\n', + "\x0D" => '\r', + "\x09" => '\t', + ]; + + if (isset($shortMap[$char])) { + return $shortMap[$char]; + } + + // \uHHHH + $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); + $char = strtoupper(bin2hex($char)); + + if (4 >= \strlen($char)) { + return sprintf('\u%04s', $char); + } + + return sprintf('\u%04s\u%04s', substr($char, 0, -4), substr($char, -4)); +} + +function _twig_escape_css_callback($matches) +{ + $char = $matches[0]; + + return sprintf('\\%X ', 1 === \strlen($char) ? \ord($char) : twig_ord($char)); +} + +/** + * This function is adapted from code coming from Zend Framework. + * + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com) + * @license https://framework.zend.com/license/new-bsd New BSD License + */ +function _twig_escape_html_attr_callback($matches) +{ + $chr = $matches[0]; + $ord = \ord($chr); + + /* + * The following replaces characters undefined in HTML with the + * hex entity for the Unicode replacement character. + */ + if (($ord <= 0x1f && "\t" != $chr && "\n" != $chr && "\r" != $chr) || ($ord >= 0x7f && $ord <= 0x9f)) { + return '�'; + } + + /* + * Check if the current character to escape has a name entity we should + * replace it with while grabbing the hex value of the character. + */ + if (1 == \strlen($chr)) { + /* + * While HTML supports far more named entities, the lowest common denominator + * has become HTML5's XML Serialisation which is restricted to the those named + * entities that XML supports. Using HTML entities would result in this error: + * XML Parsing Error: undefined entity + */ + static $entityMap = [ + 34 => '"', /* quotation mark */ + 38 => '&', /* ampersand */ + 60 => '<', /* less-than sign */ + 62 => '>', /* greater-than sign */ + ]; + + if (isset($entityMap[$ord])) { + return $entityMap[$ord]; + } + + return sprintf('&#x%02X;', $ord); + } + + /* + * Per OWASP recommendations, we'll use hex entities for any other + * characters where a named entity does not exist. + */ + return sprintf('&#x%04X;', twig_ord($chr)); +} + +// add multibyte extensions if possible +if (\function_exists('mb_get_info')) { + /** + * Returns the length of a variable. + * + * @param mixed $thing A variable + * + * @return int The length of the value + */ + function twig_length_filter(Environment $env, $thing) + { + if (null === $thing) { + return 0; + } + + if (is_scalar($thing)) { + return mb_strlen($thing, $env->getCharset()); + } + + if ($thing instanceof \Countable || \is_array($thing) || $thing instanceof \SimpleXMLElement) { + return \count($thing); + } + + if ($thing instanceof \Traversable) { + return iterator_count($thing); + } + + if (\is_object($thing) && method_exists($thing, '__toString')) { + return mb_strlen((string) $thing, $env->getCharset()); + } + + return 1; + } + + /** + * Converts a string to uppercase. + * + * @param string $string A string + * + * @return string The uppercased string + */ + function twig_upper_filter(Environment $env, $string) + { + if (null !== $charset = $env->getCharset()) { + return mb_strtoupper($string, $charset); + } + + return strtoupper($string); + } + + /** + * Converts a string to lowercase. + * + * @param string $string A string + * + * @return string The lowercased string + */ + function twig_lower_filter(Environment $env, $string) + { + if (null !== $charset = $env->getCharset()) { + return mb_strtolower($string, $charset); + } + + return strtolower($string); + } + + /** + * Returns a titlecased string. + * + * @param string $string A string + * + * @return string The titlecased string + */ + function twig_title_string_filter(Environment $env, $string) + { + if (null !== $charset = $env->getCharset()) { + return mb_convert_case($string, MB_CASE_TITLE, $charset); + } + + return ucwords(strtolower($string)); + } + + /** + * Returns a capitalized string. + * + * @param string $string A string + * + * @return string The capitalized string + */ + function twig_capitalize_string_filter(Environment $env, $string) + { + if (null !== $charset = $env->getCharset()) { + return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset).mb_strtolower(mb_substr($string, 1, mb_strlen($string, $charset), $charset), $charset); + } + + return ucfirst(strtolower($string)); + } +} +// and byte fallback +else { + /** + * Returns the length of a variable. + * + * @param mixed $thing A variable + * + * @return int The length of the value + */ + function twig_length_filter(Environment $env, $thing) + { + if (null === $thing) { + return 0; + } + + if (is_scalar($thing)) { + return \strlen($thing); + } + + if ($thing instanceof \SimpleXMLElement) { + return \count($thing); + } + + if (\is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) { + return \strlen((string) $thing); + } + + if ($thing instanceof \Countable || \is_array($thing)) { + return \count($thing); + } + + if ($thing instanceof \IteratorAggregate) { + return iterator_count($thing); + } + + return 1; + } + + /** + * Returns a titlecased string. + * + * @param string $string A string + * + * @return string The titlecased string + */ + function twig_title_string_filter(Environment $env, $string) + { + return ucwords(strtolower($string)); + } + + /** + * Returns a capitalized string. + * + * @param string $string A string + * + * @return string The capitalized string + */ + function twig_capitalize_string_filter(Environment $env, $string) + { + return ucfirst(strtolower($string)); + } +} + +/** + * @internal + */ +function twig_ensure_traversable($seq) +{ + if ($seq instanceof \Traversable || \is_array($seq)) { + return $seq; + } + + return []; +} + +/** + * @internal + */ +function twig_to_array($seq, $preserveKeys = true) +{ + if ($seq instanceof \Traversable) { + return iterator_to_array($seq, $preserveKeys); + } + + if (!\is_array($seq)) { + return $seq; + } + + return $preserveKeys ? $seq : array_values($seq); +} + +/** + * Checks if a variable is empty. + * + * {# evaluates to true if the foo variable is null, false, or the empty string #} + * {% if foo is empty %} + * {# ... #} + * {% endif %} + * + * @param mixed $value A variable + * + * @return bool true if the value is empty, false otherwise + */ +function twig_test_empty($value) +{ + if ($value instanceof \Countable) { + return 0 == \count($value); + } + + if (\is_object($value) && method_exists($value, '__toString')) { + return '' === (string) $value; + } + + return '' === $value || false === $value || null === $value || [] === $value; +} + +/** + * Checks if a variable is traversable. + * + * {# evaluates to true if the foo variable is an array or a traversable object #} + * {% if foo is iterable %} + * {# ... #} + * {% endif %} + * + * @param mixed $value A variable + * + * @return bool true if the value is traversable + */ +function twig_test_iterable($value) +{ + return $value instanceof \Traversable || \is_array($value); +} + +/** + * Renders a template. + * + * @param array $context + * @param string|array $template The template to render or an array of templates to try consecutively + * @param array $variables The variables to pass to the template + * @param bool $withContext + * @param bool $ignoreMissing Whether to ignore missing templates or not + * @param bool $sandboxed Whether to sandbox the template or not + * + * @return string The rendered template + */ +function twig_include(Environment $env, $context, $template, $variables = [], $withContext = true, $ignoreMissing = false, $sandboxed = false) +{ + $alreadySandboxed = false; + $sandbox = null; + if ($withContext) { + $variables = array_merge($context, $variables); + } + + if ($isSandboxed = $sandboxed && $env->hasExtension('\Twig\Extension\SandboxExtension')) { + $sandbox = $env->getExtension('\Twig\Extension\SandboxExtension'); + if (!$alreadySandboxed = $sandbox->isSandboxed()) { + $sandbox->enableSandbox(); + } + } + + $loaded = null; + try { + $loaded = $env->resolveTemplate($template); + } catch (LoaderError $e) { + if (!$ignoreMissing) { + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + throw $e; + } + } catch (\Throwable $e) { + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + throw $e; + } catch (\Exception $e) { + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + throw $e; + } + + try { + $ret = $loaded ? $loaded->render($variables) : ''; + } catch (\Exception $e) { + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + throw $e; + } + + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + return $ret; +} + +/** + * Returns a template content without rendering it. + * + * @param string $name The template name + * @param bool $ignoreMissing Whether to ignore missing templates or not + * + * @return string The template source + */ +function twig_source(Environment $env, $name, $ignoreMissing = false) +{ + $loader = $env->getLoader(); + try { + if (!$loader instanceof SourceContextLoaderInterface) { + return $loader->getSource($name); + } else { + return $loader->getSourceContext($name)->getCode(); + } + } catch (LoaderError $e) { + if (!$ignoreMissing) { + throw $e; + } + } +} + +/** + * Provides the ability to get constants from instances as well as class/global constants. + * + * @param string $constant The name of the constant + * @param object|null $object The object to get the constant from + * + * @return string + */ +function twig_constant($constant, $object = null) +{ + if (null !== $object) { + $constant = \get_class($object).'::'.$constant; + } + + return \constant($constant); +} + +/** + * Checks if a constant exists. + * + * @param string $constant The name of the constant + * @param object|null $object The object to get the constant from + * + * @return bool + */ +function twig_constant_is_defined($constant, $object = null) +{ + if (null !== $object) { + $constant = \get_class($object).'::'.$constant; + } + + return \defined($constant); +} + +/** + * Batches item. + * + * @param array $items An array of items + * @param int $size The size of the batch + * @param mixed $fill A value used to fill missing items + * + * @return array + */ +function twig_array_batch($items, $size, $fill = null, $preserveKeys = true) +{ + if (!twig_test_iterable($items)) { + throw new RuntimeError(sprintf('The "batch" filter expects an array or "Traversable", got "%s".', \is_object($items) ? \get_class($items) : \gettype($items))); + } + + $size = ceil($size); + + $result = array_chunk(twig_to_array($items, $preserveKeys), $size, $preserveKeys); + + if (null !== $fill && $result) { + $last = \count($result) - 1; + if ($fillCount = $size - \count($result[$last])) { + for ($i = 0; $i < $fillCount; ++$i) { + $result[$last][] = $fill; + } + } + } + + return $result; +} +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/DebugExtension.php --- a/vendor/twig/twig/src/Extension/DebugExtension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/DebugExtension.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,76 @@ $isDumpOutputHtmlSafe ? ['html'] : [], 'needs_context' => true, 'needs_environment' => true, 'is_variadic' => true]), + ]; + } + + public function getName() + { + return 'debug'; } } + +class_alias('Twig\Extension\DebugExtension', 'Twig_Extension_Debug'); +} + +namespace { +use Twig\Environment; +use Twig\Template; +use Twig\TemplateWrapper; + +function twig_var_dump(Environment $env, $context, array $vars = []) +{ + if (!$env->isDebug()) { + return; + } + + ob_start(); + + if (!$vars) { + $vars = []; + foreach ($context as $key => $value) { + if (!$value instanceof Template && !$value instanceof TemplateWrapper) { + $vars[$key] = $value; + } + } + + var_dump($vars); + } else { + foreach ($vars as $var) { + var_dump($var); + } + } + + return ob_get_clean(); +} +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/EscaperExtension.php --- a/vendor/twig/twig/src/Extension/EscaperExtension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/EscaperExtension.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,120 @@ setDefaultStrategy($defaultStrategy); + } + + public function getTokenParsers() + { + return [new AutoEscapeTokenParser()]; + } + + public function getNodeVisitors() + { + return [new EscaperNodeVisitor()]; + } + + public function getFilters() + { + return [ + new TwigFilter('raw', 'twig_raw_filter', ['is_safe' => ['all']]), + ]; + } + + /** + * Sets the default strategy to use when not defined by the user. + * + * The strategy can be a valid PHP callback that takes the template + * name as an argument and returns the strategy to use. + * + * @param string|false|callable $defaultStrategy An escaping strategy + */ + public function setDefaultStrategy($defaultStrategy) + { + // for BC + if (true === $defaultStrategy) { + @trigger_error('Using "true" as the default strategy is deprecated since version 1.21. Use "html" instead.', E_USER_DEPRECATED); + + $defaultStrategy = 'html'; + } + + if ('filename' === $defaultStrategy) { + @trigger_error('Using "filename" as the default strategy is deprecated since version 1.27. Use "name" instead.', E_USER_DEPRECATED); + + $defaultStrategy = 'name'; + } + + if ('name' === $defaultStrategy) { + $defaultStrategy = ['\Twig\FileExtensionEscapingStrategy', 'guess']; + } + + $this->defaultStrategy = $defaultStrategy; + } + + /** + * Gets the default strategy to use when not defined by the user. + * + * @param string $name The template name + * + * @return string|false The default strategy to use for the template + */ + public function getDefaultStrategy($name) + { + // disable string callables to avoid calling a function named html or js, + // or any other upcoming escaping strategy + if (!\is_string($this->defaultStrategy) && false !== $this->defaultStrategy) { + return \call_user_func($this->defaultStrategy, $name); + } + + return $this->defaultStrategy; + } + + public function getName() + { + return 'escaper'; } } + +class_alias('Twig\Extension\EscaperExtension', 'Twig_Extension_Escaper'); +} + +namespace { +/** + * Marks a variable as being safe. + * + * @param string $string A PHP variable + * + * @return string + */ +function twig_raw_filter($string) +{ + return $string; +} +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/ExtensionInterface.php --- a/vendor/twig/twig/src/Extension/ExtensionInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/ExtensionInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,101 @@ + */ +interface ExtensionInterface +{ + /** + * Initializes the runtime environment. + * + * This is where you can load some file that contains filter functions for instance. + * + * @deprecated since 1.23 (to be removed in 2.0), implement \Twig_Extension_InitRuntimeInterface instead + */ + public function initRuntime(Environment $environment); + + /** + * Returns the token parser instances to add to the existing list. + * + * @return TokenParserInterface[] + */ + public function getTokenParsers(); + + /** + * Returns the node visitor instances to add to the existing list. + * + * @return NodeVisitorInterface[] + */ + public function getNodeVisitors(); + + /** + * Returns a list of filters to add to the existing list. + * + * @return TwigFilter[] + */ + public function getFilters(); + + /** + * Returns a list of tests to add to the existing list. + * + * @return TwigTest[] + */ + public function getTests(); + + /** + * Returns a list of functions to add to the existing list. + * + * @return TwigFunction[] + */ + public function getFunctions(); + + /** + * Returns a list of operators to add to the existing list. + * + * @return array First array of unary operators, second array of binary operators + */ + public function getOperators(); + + /** + * Returns a list of global variables to add to the existing list. + * + * @return array An array of global variables + * + * @deprecated since 1.23 (to be removed in 2.0), implement \Twig_Extension_GlobalsInterface instead + */ + public function getGlobals(); + + /** + * Returns the name of the extension. + * + * @return string The extension name + * + * @deprecated since 1.26 (to be removed in 2.0), not used anymore internally + */ + public function getName(); } + +class_alias('Twig\Extension\ExtensionInterface', 'Twig_ExtensionInterface'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Environment'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/GlobalsInterface.php --- a/vendor/twig/twig/src/Extension/GlobalsInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/GlobalsInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,26 @@ + */ +interface GlobalsInterface +{ +} -if (\false) { - interface GlobalsInterface extends \Twig_Extension_GlobalsInterface - { - } -} +class_alias('Twig\Extension\GlobalsInterface', 'Twig_Extension_GlobalsInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/InitRuntimeInterface.php --- a/vendor/twig/twig/src/Extension/InitRuntimeInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/InitRuntimeInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,26 @@ + */ +interface InitRuntimeInterface +{ +} -if (\false) { - interface InitRuntimeInterface extends \Twig_Extension_InitRuntimeInterface - { - } -} +class_alias('Twig\Extension\InitRuntimeInterface', 'Twig_Extension_InitRuntimeInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/OptimizerExtension.php --- a/vendor/twig/twig/src/Extension/OptimizerExtension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/OptimizerExtension.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,39 @@ optimizers = $optimizers; + } + + public function getNodeVisitors() + { + return [new OptimizerNodeVisitor($this->optimizers)]; + } + + public function getName() + { + return 'optimizer'; } } + +class_alias('Twig\Extension\OptimizerExtension', 'Twig_Extension_Optimizer'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/ProfilerExtension.php --- a/vendor/twig/twig/src/Extension/ProfilerExtension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/ProfilerExtension.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,53 @@ actives[] = $profile; + } + + public function enter(Profile $profile) + { + $this->actives[0]->addProfile($profile); + array_unshift($this->actives, $profile); + } + + public function leave(Profile $profile) + { + $profile->leave(); + array_shift($this->actives); + + if (1 === \count($this->actives)) { + $this->actives[0]->leave(); + } + } + + public function getNodeVisitors() + { + return [new ProfilerNodeVisitor(\get_class($this))]; + } + + public function getName() + { + return 'profiler'; } } + +class_alias('Twig\Extension\ProfilerExtension', 'Twig_Extension_Profiler'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/SandboxExtension.php --- a/vendor/twig/twig/src/Extension/SandboxExtension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/SandboxExtension.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,109 @@ policy = $policy; + $this->sandboxedGlobally = $sandboxed; + } + + public function getTokenParsers() + { + return [new SandboxTokenParser()]; + } + + public function getNodeVisitors() + { + return [new SandboxNodeVisitor()]; + } + + public function enableSandbox() + { + $this->sandboxed = true; + } + + public function disableSandbox() + { + $this->sandboxed = false; + } + + public function isSandboxed() + { + return $this->sandboxedGlobally || $this->sandboxed; + } + + public function isSandboxedGlobally() + { + return $this->sandboxedGlobally; + } + + public function setSecurityPolicy(SecurityPolicyInterface $policy) + { + $this->policy = $policy; + } + + public function getSecurityPolicy() + { + return $this->policy; + } + + public function checkSecurity($tags, $filters, $functions) + { + if ($this->isSandboxed()) { + $this->policy->checkSecurity($tags, $filters, $functions); + } + } + + public function checkMethodAllowed($obj, $method) + { + if ($this->isSandboxed()) { + $this->policy->checkMethodAllowed($obj, $method); + } + } + + public function checkPropertyAllowed($obj, $method) + { + if ($this->isSandboxed()) { + $this->policy->checkPropertyAllowed($obj, $method); + } + } + + public function ensureToStringAllowed($obj) + { + if ($this->isSandboxed() && \is_object($obj) && method_exists($obj, '__toString')) { + $this->policy->checkMethodAllowed($obj, '__toString'); + } + + return $obj; + } + + public function getName() + { + return 'sandbox'; } } + +class_alias('Twig\Extension\SandboxExtension', 'Twig_Extension_Sandbox'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/StagingExtension.php --- a/vendor/twig/twig/src/Extension/StagingExtension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/StagingExtension.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,117 @@ + * + * @internal + */ +class StagingExtension extends AbstractExtension +{ + protected $functions = []; + protected $filters = []; + protected $visitors = []; + protected $tokenParsers = []; + protected $globals = []; + protected $tests = []; + + public function addFunction($name, $function) { + if (isset($this->functions[$name])) { + @trigger_error(sprintf('Overriding function "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); + } + + $this->functions[$name] = $function; + } + + public function getFunctions() + { + return $this->functions; + } + + public function addFilter($name, $filter) + { + if (isset($this->filters[$name])) { + @trigger_error(sprintf('Overriding filter "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); + } + + $this->filters[$name] = $filter; + } + + public function getFilters() + { + return $this->filters; + } + + public function addNodeVisitor(NodeVisitorInterface $visitor) + { + $this->visitors[] = $visitor; + } + + public function getNodeVisitors() + { + return $this->visitors; + } + + public function addTokenParser(TokenParserInterface $parser) + { + if (isset($this->tokenParsers[$parser->getTag()])) { + @trigger_error(sprintf('Overriding tag "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $parser->getTag()), E_USER_DEPRECATED); + } + + $this->tokenParsers[$parser->getTag()] = $parser; + } + + public function getTokenParsers() + { + return $this->tokenParsers; + } + + public function addGlobal($name, $value) + { + $this->globals[$name] = $value; + } + + public function getGlobals() + { + return $this->globals; + } + + public function addTest($name, $test) + { + if (isset($this->tests[$name])) { + @trigger_error(sprintf('Overriding test "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); + } + + $this->tests[$name] = $test; + } + + public function getTests() + { + return $this->tests; + } + + public function getName() + { + return 'staging'; } } + +class_alias('Twig\Extension\StagingExtension', 'Twig_Extension_Staging'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Extension/StringLoaderExtension.php --- a/vendor/twig/twig/src/Extension/StringLoaderExtension.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Extension/StringLoaderExtension.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,54 @@ true]), + ]; + } + + public function getName() + { + return 'string_loader'; } } + +class_alias('Twig\Extension\StringLoaderExtension', 'Twig_Extension_StringLoader'); +} + +namespace { +use Twig\Environment; +use Twig\TemplateWrapper; + +/** + * Loads a template from a string. + * + * {{ include(template_from_string("Hello {{ name }}")) }} + * + * @param string $template A template as a string or object implementing __toString() + * @param string $name An optional name of the template to be used in error messages + * + * @return TemplateWrapper + */ +function twig_template_from_string(Environment $env, $template, $name = null) +{ + return $env->createTemplate((string) $template, $name); +} +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/FileExtensionEscapingStrategy.php --- a/vendor/twig/twig/src/FileExtensionEscapingStrategy.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/FileExtensionEscapingStrategy.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,62 @@ + */ +class FileExtensionEscapingStrategy +{ + /** + * Guesses the best autoescaping strategy based on the file name. + * + * @param string $name The template name + * + * @return string|false The escaping strategy name to use or false to disable + */ + public static function guess($name) + { + if (\in_array(substr($name, -1), ['/', '\\'])) { + return 'html'; // return html for directories + } -if (\false) { - class FileExtensionEscapingStrategy extends \Twig_FileExtensionEscapingStrategy - { + if ('.twig' === substr($name, -5)) { + $name = substr($name, 0, -5); + } + + $extension = pathinfo($name, PATHINFO_EXTENSION); + + switch ($extension) { + case 'js': + return 'js'; + + case 'css': + return 'css'; + + case 'txt': + return false; + + default: + return 'html'; + } } } + +class_alias('Twig\FileExtensionEscapingStrategy', 'Twig_FileExtensionEscapingStrategy'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Lexer.php --- a/vendor/twig/twig/src/Lexer.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Lexer.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,529 @@ + */ +class Lexer implements \Twig_LexerInterface +{ + protected $tokens; + protected $code; + protected $cursor; + protected $lineno; + protected $end; + protected $state; + protected $states; + protected $brackets; + protected $env; + // to be renamed to $name in 2.0 (where it is private) + protected $filename; + protected $options; + protected $regexes; + protected $position; + protected $positions; + protected $currentVarBlockLine; + + private $source; + + const STATE_DATA = 0; + const STATE_BLOCK = 1; + const STATE_VAR = 2; + const STATE_STRING = 3; + const STATE_INTERPOLATION = 4; + + const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; + const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'; + const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; + const REGEX_DQ_STRING_DELIM = '/"/A'; + const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; + const PUNCTUATION = '()[]{}?:.,|'; + + public function __construct(Environment $env, array $options = []) { + $this->env = $env; + + $this->options = array_merge([ + 'tag_comment' => ['{#', '#}'], + 'tag_block' => ['{%', '%}'], + 'tag_variable' => ['{{', '}}'], + 'whitespace_trim' => '-', + 'whitespace_line_trim' => '~', + 'whitespace_line_chars' => ' \t\0\x0B', + 'interpolation' => ['#{', '}'], + ], $options); + + // when PHP 7.3 is the min version, we will be able to remove the '#' part in preg_quote as it's part of the default + $this->regexes = [ + // }} + 'lex_var' => '{ + \s* + (?:'. + preg_quote($this->options['whitespace_trim'].$this->options['tag_variable'][1], '#').'\s*'. // -}}\s* + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_variable'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~}}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_variable'][1], '#'). // }} + ') + }Ax', + + // %} + 'lex_block' => '{ + \s* + (?:'. + preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*\n?'. // -%}\s*\n? + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_block'][1], '#').'\n?'. // %}\n? + ') + }Ax', + + // {% endverbatim %} + 'lex_raw_data' => '{'. + preg_quote($this->options['tag_block'][0], '#'). // {% + '('. + $this->options['whitespace_trim']. // - + '|'. + $this->options['whitespace_line_trim']. // ~ + ')?\s*'. + '(?:end%s)'. // endraw or endverbatim + '\s*'. + '(?:'. + preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*'. // -%} + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_block'][1], '#'). // %} + ') + }sx', + + 'operator' => $this->getOperatorRegex(), + + // #} + 'lex_comment' => '{ + (?:'. + preg_quote($this->options['whitespace_trim']).preg_quote($this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n? + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_comment'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~#}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_comment'][1], '#').'\n?'. // #}\n? + ') + }sx', + + // verbatim %} + 'lex_block_raw' => '{ + \s* + (raw|verbatim) + \s* + (?:'. + preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*'. // -%}\s* + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_block'][1], '#'). // %} + ') + }Asx', + + 'lex_block_line' => '{\s*line\s+(\d+)\s*'.preg_quote($this->options['tag_block'][1], '#').'}As', + + // {{ or {% or {# + 'lex_tokens_start' => '{ + ('. + preg_quote($this->options['tag_variable'][0], '#'). // {{ + '|'. + preg_quote($this->options['tag_block'][0], '#'). // {% + '|'. + preg_quote($this->options['tag_comment'][0], '#'). // {# + ')('. + preg_quote($this->options['whitespace_trim'], '#'). // - + '|'. + preg_quote($this->options['whitespace_line_trim'], '#'). // ~ + ')? + }sx', + 'interpolation_start' => '{'.preg_quote($this->options['interpolation'][0], '#').'\s*}A', + 'interpolation_end' => '{\s*'.preg_quote($this->options['interpolation'][1], '#').'}A', + ]; + } + + public function tokenize($code, $name = null) + { + if (!$code instanceof Source) { + @trigger_error(sprintf('Passing a string as the $code argument of %s() is deprecated since version 1.27 and will be removed in 2.0. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + $this->source = new Source($code, $name); + } else { + $this->source = $code; + } + + if (((int) ini_get('mbstring.func_overload')) & 2) { + @trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED); + } + + if (\function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } else { + $mbEncoding = null; + } + + $this->code = str_replace(["\r\n", "\r"], "\n", $this->source->getCode()); + $this->filename = $this->source->getName(); + $this->cursor = 0; + $this->lineno = 1; + $this->end = \strlen($this->code); + $this->tokens = []; + $this->state = self::STATE_DATA; + $this->states = []; + $this->brackets = []; + $this->position = -1; + + // find all token starts in one go + preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE); + $this->positions = $matches; + + while ($this->cursor < $this->end) { + // dispatch to the lexing functions depending + // on the current state + switch ($this->state) { + case self::STATE_DATA: + $this->lexData(); + break; + + case self::STATE_BLOCK: + $this->lexBlock(); + break; + + case self::STATE_VAR: + $this->lexVar(); + break; + + case self::STATE_STRING: + $this->lexString(); + break; + + case self::STATE_INTERPOLATION: + $this->lexInterpolation(); + break; + } + } + + $this->pushToken(Token::EOF_TYPE); + + if (!empty($this->brackets)) { + list($expect, $lineno) = array_pop($this->brackets); + throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); + } + + if ($mbEncoding) { + mb_internal_encoding($mbEncoding); + } + + return new TokenStream($this->tokens, $this->source); + } + + protected function lexData() + { + // if no matches are left we return the rest of the template as simple text token + if ($this->position == \count($this->positions[0]) - 1) { + $this->pushToken(Token::TEXT_TYPE, substr($this->code, $this->cursor)); + $this->cursor = $this->end; + + return; + } + + // Find the first token after the current cursor + $position = $this->positions[0][++$this->position]; + while ($position[1] < $this->cursor) { + if ($this->position == \count($this->positions[0]) - 1) { + return; + } + $position = $this->positions[0][++$this->position]; + } + + // push the template text first + $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor); + + // trim? + if (isset($this->positions[2][$this->position][0])) { + if ($this->options['whitespace_trim'] === $this->positions[2][$this->position][0]) { + // whitespace_trim detected ({%-, {{- or {#-) + $text = rtrim($text); + } else { + // whitespace_line_trim detected ({%~, {{~ or {#~) + // don't trim \r and \n + $text = rtrim($text, " \t\0\x0B"); + } + } + $this->pushToken(Token::TEXT_TYPE, $text); + $this->moveCursor($textContent.$position[0]); + + switch ($this->positions[1][$this->position][0]) { + case $this->options['tag_comment'][0]: + $this->lexComment(); + break; + + case $this->options['tag_block'][0]: + // raw data? + if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, 0, $this->cursor)) { + $this->moveCursor($match[0]); + $this->lexRawData($match[1]); + // {% line \d+ %} + } elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, 0, $this->cursor)) { + $this->moveCursor($match[0]); + $this->lineno = (int) $match[1]; + } else { + $this->pushToken(Token::BLOCK_START_TYPE); + $this->pushState(self::STATE_BLOCK); + $this->currentVarBlockLine = $this->lineno; + } + break; + + case $this->options['tag_variable'][0]: + $this->pushToken(Token::VAR_START_TYPE); + $this->pushState(self::STATE_VAR); + $this->currentVarBlockLine = $this->lineno; + break; + } + } + + protected function lexBlock() + { + if (empty($this->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::BLOCK_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function lexVar() + { + if (empty($this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::VAR_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function lexExpression() + { + // whitespace + if (preg_match('/\s+/A', $this->code, $match, 0, $this->cursor)) { + $this->moveCursor($match[0]); + + if ($this->cursor >= $this->end) { + throw new SyntaxError(sprintf('Unclosed "%s".', self::STATE_BLOCK === $this->state ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source); + } + } + + // operators + if (preg_match($this->regexes['operator'], $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::OPERATOR_TYPE, preg_replace('/\s+/', ' ', $match[0])); + $this->moveCursor($match[0]); + } + // names + elseif (preg_match(self::REGEX_NAME, $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::NAME_TYPE, $match[0]); + $this->moveCursor($match[0]); + } + // numbers + elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, 0, $this->cursor)) { + $number = (float) $match[0]; // floats + if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) { + $number = (int) $match[0]; // integers lower than the maximum + } + $this->pushToken(Token::NUMBER_TYPE, $number); + $this->moveCursor($match[0]); + } + // punctuation + elseif (false !== strpos(self::PUNCTUATION, $this->code[$this->cursor])) { + // opening bracket + if (false !== strpos('([{', $this->code[$this->cursor])) { + $this->brackets[] = [$this->code[$this->cursor], $this->lineno]; + } + // closing bracket + elseif (false !== strpos(')]}', $this->code[$this->cursor])) { + if (empty($this->brackets)) { + throw new SyntaxError(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); + } + + list($expect, $lineno) = array_pop($this->brackets); + if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) { + throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); + } + } + + $this->pushToken(Token::PUNCTUATION_TYPE, $this->code[$this->cursor]); + ++$this->cursor; + } + // strings + elseif (preg_match(self::REGEX_STRING, $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1))); + $this->moveCursor($match[0]); + } + // opening double quoted string + elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) { + $this->brackets[] = ['"', $this->lineno]; + $this->pushState(self::STATE_STRING); + $this->moveCursor($match[0]); + } + // unlexable + else { + throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); + } + } + + protected function lexRawData($tag) + { + if ('raw' === $tag) { + @trigger_error(sprintf('Twig Tag "raw" is deprecated since version 1.21. Use "verbatim" instead in %s at line %d.', $this->filename, $this->lineno), E_USER_DEPRECATED); + } + + if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + throw new SyntaxError(sprintf('Unexpected end of file: Unclosed "%s" block.', $tag), $this->lineno, $this->source); + } + + $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor); + $this->moveCursor($text.$match[0][0]); + + // trim? + if (isset($match[1][0])) { + if ($this->options['whitespace_trim'] === $match[1][0]) { + // whitespace_trim detected ({%-, {{- or {#-) + $text = rtrim($text); + } else { + // whitespace_line_trim detected ({%~, {{~ or {#~) + // don't trim \r and \n + $text = rtrim($text, " \t\0\x0B"); + } + } + + $this->pushToken(Token::TEXT_TYPE, $text); + } + + protected function lexComment() + { + if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + throw new SyntaxError('Unclosed comment.', $this->lineno, $this->source); + } + + $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]); + } + + protected function lexString() + { + if (preg_match($this->regexes['interpolation_start'], $this->code, $match, 0, $this->cursor)) { + $this->brackets[] = [$this->options['interpolation'][0], $this->lineno]; + $this->pushToken(Token::INTERPOLATION_START_TYPE); + $this->moveCursor($match[0]); + $this->pushState(self::STATE_INTERPOLATION); + } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, 0, $this->cursor) && \strlen($match[0]) > 0) { + $this->pushToken(Token::STRING_TYPE, stripcslashes($match[0])); + $this->moveCursor($match[0]); + } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) { + list($expect, $lineno) = array_pop($this->brackets); + if ('"' != $this->code[$this->cursor]) { + throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); + } + + $this->popState(); + ++$this->cursor; + } else { + // unlexable + throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); + } + } + + protected function lexInterpolation() + { + $bracket = end($this->brackets); + if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, 0, $this->cursor)) { + array_pop($this->brackets); + $this->pushToken(Token::INTERPOLATION_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function pushToken($type, $value = '') + { + // do not push empty text tokens + if (Token::TEXT_TYPE === $type && '' === $value) { + return; + } + + $this->tokens[] = new Token($type, $value, $this->lineno); + } + + protected function moveCursor($text) + { + $this->cursor += \strlen($text); + $this->lineno += substr_count($text, "\n"); + } + + protected function getOperatorRegex() + { + $operators = array_merge( + ['='], + array_keys($this->env->getUnaryOperators()), + array_keys($this->env->getBinaryOperators()) + ); + + $operators = array_combine($operators, array_map('strlen', $operators)); + arsort($operators); + + $regex = []; + foreach ($operators as $operator => $length) { + // an operator that ends with a character must be followed by + // a whitespace or a parenthesis + if (ctype_alpha($operator[$length - 1])) { + $r = preg_quote($operator, '/').'(?=[\s()])'; + } else { + $r = preg_quote($operator, '/'); + } + + // an operator with a space can be any amount of whitespaces + $r = preg_replace('/\s+/', '\s+', $r); + + $regex[] = $r; + } + + return '/'.implode('|', $regex).'/A'; + } + + protected function pushState($state) + { + $this->states[] = $this->state; + $this->state = $state; + } + + protected function popState() + { + if (0 === \count($this->states)) { + throw new \LogicException('Cannot pop state without a previous state.'); + } + + $this->state = array_pop($this->states); } } + +class_alias('Twig\Lexer', 'Twig_Lexer'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Loader/ArrayLoader.php --- a/vendor/twig/twig/src/Loader/ArrayLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Loader/ArrayLoader.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,102 @@ + */ +class ArrayLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +{ + protected $templates = []; + + /** + * @param array $templates An array of templates (keys are the names, and values are the source code) + */ + public function __construct(array $templates = []) { + $this->templates = $templates; + } + + /** + * Adds or overrides a template. + * + * @param string $name The template name + * @param string $template The template source + */ + public function setTemplate($name, $template) + { + $this->templates[(string) $name] = $template; + } + + public function getSource($name) + { + @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED); + + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); + } + + return $this->templates[$name]; + } + + public function getSourceContext($name) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); + } + + return new Source($this->templates[$name], $name); + } + + public function exists($name) + { + return isset($this->templates[(string) $name]); + } + + public function getCacheKey($name) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); + } + + return $name.':'.$this->templates[$name]; + } + + public function isFresh($name, $time) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); + } + + return true; } } + +class_alias('Twig\Loader\ArrayLoader', 'Twig_Loader_Array'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Loader/ChainLoader.php --- a/vendor/twig/twig/src/Loader/ChainLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Loader/ChainLoader.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,164 @@ + */ +class ChainLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +{ + private $hasSourceCache = []; + protected $loaders = []; + + /** + * @param LoaderInterface[] $loaders + */ + public function __construct(array $loaders = []) { + foreach ($loaders as $loader) { + $this->addLoader($loader); + } + } + + public function addLoader(LoaderInterface $loader) + { + $this->loaders[] = $loader; + $this->hasSourceCache = []; + } + + /** + * @return LoaderInterface[] + */ + public function getLoaders() + { + return $this->loaders; + } + + public function getSource($name) + { + @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED); + + $exceptions = []; + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->getSource($name); + } catch (LoaderError $e) { + $exceptions[] = $e->getMessage(); + } + } + + throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); + } + + public function getSourceContext($name) + { + $exceptions = []; + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + if ($loader instanceof SourceContextLoaderInterface) { + return $loader->getSourceContext($name); + } + + return new Source($loader->getSource($name), $name); + } catch (LoaderError $e) { + $exceptions[] = $e->getMessage(); + } + } + + throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); + } + + public function exists($name) + { + $name = (string) $name; + + if (isset($this->hasSourceCache[$name])) { + return $this->hasSourceCache[$name]; + } + + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface) { + if ($loader->exists($name)) { + return $this->hasSourceCache[$name] = true; + } + + continue; + } + + try { + if ($loader instanceof SourceContextLoaderInterface) { + $loader->getSourceContext($name); + } else { + $loader->getSource($name); + } + + return $this->hasSourceCache[$name] = true; + } catch (LoaderError $e) { + } + } + + return $this->hasSourceCache[$name] = false; + } + + public function getCacheKey($name) + { + $exceptions = []; + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->getCacheKey($name); + } catch (LoaderError $e) { + $exceptions[] = \get_class($loader).': '.$e->getMessage(); + } + } + + throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); + } + + public function isFresh($name, $time) + { + $exceptions = []; + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->isFresh($name, $time); + } catch (LoaderError $e) { + $exceptions[] = \get_class($loader).': '.$e->getMessage(); + } + } + + throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); } } + +class_alias('Twig\Loader\ChainLoader', 'Twig_Loader_Chain'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Loader/ExistsLoaderInterface.php --- a/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,33 @@ + * + * @deprecated since 1.12 (to be removed in 3.0) + */ +interface ExistsLoaderInterface +{ + /** + * Check if we have the source code of a template, given its name. + * + * @param string $name The name of the template to check if we can load + * + * @return bool If the template source code is handled by this loader or not + */ + public function exists($name); +} -if (\false) { - interface ExistsLoaderInterface extends \Twig_ExistsLoaderInterface - { - } -} +class_alias('Twig\Loader\ExistsLoaderInterface', 'Twig_ExistsLoaderInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Loader/FilesystemLoader.php --- a/vendor/twig/twig/src/Loader/FilesystemLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Loader/FilesystemLoader.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,324 @@ + */ +class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +{ + /** Identifier of the main namespace. */ + const MAIN_NAMESPACE = '__main__'; + + protected $paths = []; + protected $cache = []; + protected $errorCache = []; + + private $rootPath; + + /** + * @param string|array $paths A path or an array of paths where to look for templates + * @param string|null $rootPath The root path common to all relative paths (null for getcwd()) + */ + public function __construct($paths = [], $rootPath = null) { + $this->rootPath = (null === $rootPath ? getcwd() : $rootPath).\DIRECTORY_SEPARATOR; + if (false !== $realPath = realpath($rootPath)) { + $this->rootPath = $realPath.\DIRECTORY_SEPARATOR; + } + + if ($paths) { + $this->setPaths($paths); + } + } + + /** + * Returns the paths to the templates. + * + * @param string $namespace A path namespace + * + * @return array The array of paths where to look for templates + */ + public function getPaths($namespace = self::MAIN_NAMESPACE) + { + return isset($this->paths[$namespace]) ? $this->paths[$namespace] : []; + } + + /** + * Returns the path namespaces. + * + * The main namespace is always defined. + * + * @return array The array of defined namespaces + */ + public function getNamespaces() + { + return array_keys($this->paths); + } + + /** + * Sets the paths where templates are stored. + * + * @param string|array $paths A path or an array of paths where to look for templates + * @param string $namespace A path namespace + */ + public function setPaths($paths, $namespace = self::MAIN_NAMESPACE) + { + if (!\is_array($paths)) { + $paths = [$paths]; + } + + $this->paths[$namespace] = []; + foreach ($paths as $path) { + $this->addPath($path, $namespace); + } + } + + /** + * Adds a path where templates are stored. + * + * @param string $path A path where to look for templates + * @param string $namespace A path namespace + * + * @throws LoaderError + */ + public function addPath($path, $namespace = self::MAIN_NAMESPACE) + { + // invalidate the cache + $this->cache = $this->errorCache = []; + + $checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path; + if (!is_dir($checkPath)) { + throw new LoaderError(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath)); + } + + $this->paths[$namespace][] = rtrim($path, '/\\'); + } + + /** + * Prepends a path where templates are stored. + * + * @param string $path A path where to look for templates + * @param string $namespace A path namespace + * + * @throws LoaderError + */ + public function prependPath($path, $namespace = self::MAIN_NAMESPACE) + { + // invalidate the cache + $this->cache = $this->errorCache = []; + + $checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path; + if (!is_dir($checkPath)) { + throw new LoaderError(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath)); + } + + $path = rtrim($path, '/\\'); + + if (!isset($this->paths[$namespace])) { + $this->paths[$namespace][] = $path; + } else { + array_unshift($this->paths[$namespace], $path); + } + } + + public function getSource($name) + { + @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED); + + if (null === ($path = $this->findTemplate($name)) || false === $path) { + return ''; + } + + return file_get_contents($path); + } + + public function getSourceContext($name) + { + if (null === ($path = $this->findTemplate($name)) || false === $path) { + return new Source('', $name, ''); + } + + return new Source(file_get_contents($path), $name, $path); + } + + public function getCacheKey($name) + { + if (null === ($path = $this->findTemplate($name)) || false === $path) { + return ''; + } + $len = \strlen($this->rootPath); + if (0 === strncmp($this->rootPath, $path, $len)) { + return substr($path, $len); + } + + return $path; + } + + public function exists($name) + { + $name = $this->normalizeName($name); + + if (isset($this->cache[$name])) { + return true; + } + + try { + return null !== ($path = $this->findTemplate($name, false)) && false !== $path; + } catch (LoaderError $e) { + @trigger_error(sprintf('In %s::findTemplate(), you must accept a second argument that when set to "false" returns "false" instead of throwing an exception. Not supporting this argument is deprecated since version 1.27.', \get_class($this)), E_USER_DEPRECATED); + + return false; + } + } + + public function isFresh($name, $time) + { + // false support to be removed in 3.0 + if (null === ($path = $this->findTemplate($name)) || false === $path) { + return false; + } + + return filemtime($path) < $time; + } + + /** + * Checks if the template can be found. + * + * @param string $name The template name + * + * @return string|false The template name or false + * @return string|false|null The template name or false/null + */ + protected function findTemplate($name) + { + $throw = \func_num_args() > 1 ? func_get_arg(1) : true; + $name = $this->normalizeName($name); + + if (isset($this->cache[$name])) { + return $this->cache[$name]; + } + + if (isset($this->errorCache[$name])) { + if (!$throw) { + return false; + } + + throw new LoaderError($this->errorCache[$name]); + } + + try { + $this->validateName($name); + + list($namespace, $shortname) = $this->parseName($name); + } catch (LoaderError $e) { + if (!$throw) { + return false; + } + + throw $e; + } + + if (!isset($this->paths[$namespace])) { + $this->errorCache[$name] = sprintf('There are no registered paths for namespace "%s".', $namespace); + + if (!$throw) { + return false; + } + + throw new LoaderError($this->errorCache[$name]); + } + + foreach ($this->paths[$namespace] as $path) { + if (!$this->isAbsolutePath($path)) { + $path = $this->rootPath.$path; + } + + if (is_file($path.'/'.$shortname)) { + if (false !== $realpath = realpath($path.'/'.$shortname)) { + return $this->cache[$name] = $realpath; + } + + return $this->cache[$name] = $path.'/'.$shortname; + } + } + + $this->errorCache[$name] = sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace])); + + if (!$throw) { + return false; + } + + throw new LoaderError($this->errorCache[$name]); + } + + protected function parseName($name, $default = self::MAIN_NAMESPACE) + { + if (isset($name[0]) && '@' == $name[0]) { + if (false === $pos = strpos($name, '/')) { + throw new LoaderError(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); + } + + $namespace = substr($name, 1, $pos - 1); + $shortname = substr($name, $pos + 1); + + return [$namespace, $shortname]; + } + + return [$default, $name]; + } + + protected function normalizeName($name) + { + return preg_replace('#/{2,}#', '/', str_replace('\\', '/', (string) $name)); + } + + protected function validateName($name) + { + if (false !== strpos($name, "\0")) { + throw new LoaderError('A template name cannot contain NUL bytes.'); + } + + $name = ltrim($name, '/'); + $parts = explode('/', $name); + $level = 0; + foreach ($parts as $part) { + if ('..' === $part) { + --$level; + } elseif ('.' !== $part) { + ++$level; + } + + if ($level < 0) { + throw new LoaderError(sprintf('Looks like you try to load a template outside configured directories (%s).', $name)); + } + } + } + + private function isAbsolutePath($file) + { + return strspn($file, '/\\', 0, 1) + || (\strlen($file) > 3 && ctype_alpha($file[0]) + && ':' === substr($file, 1, 1) + && strspn($file, '/\\', 2, 1) + ) + || null !== parse_url($file, PHP_URL_SCHEME) + ; } } + +class_alias('Twig\Loader\FilesystemLoader', 'Twig_Loader_Filesystem'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Loader/LoaderInterface.php --- a/vendor/twig/twig/src/Loader/LoaderInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Loader/LoaderInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,61 @@ + */ +interface LoaderInterface +{ + /** + * Gets the source code of a template, given its name. + * + * @param string $name The name of the template to load + * + * @return string The template source code + * + * @throws LoaderError When $name is not found + * + * @deprecated since 1.27 (to be removed in 2.0), implement Twig\Loader\SourceContextLoaderInterface + */ + public function getSource($name); + + /** + * Gets the cache key to use for the cache for a given template name. + * + * @param string $name The name of the template to load + * + * @return string The cache key + * + * @throws LoaderError When $name is not found + */ + public function getCacheKey($name); + + /** + * Returns true if the template is still fresh. + * + * @param string $name The template name + * @param int $time Timestamp of the last modification time of the + * cached template + * + * @return bool true if the template is fresh, false otherwise + * + * @throws LoaderError When $name is not found + */ + public function isFresh($name, $time); } + +class_alias('Twig\Loader\LoaderInterface', 'Twig_LoaderInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php --- a/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,38 @@ + * + * @deprecated since 1.27 (to be removed in 3.0) + */ +interface SourceContextLoaderInterface +{ + /** + * Returns the source context for a given template logical name. + * + * @param string $name The template logical name + * + * @return Source + * + * @throws LoaderError When $name is not found + */ + public function getSourceContext($name); } + +class_alias('Twig\Loader\SourceContextLoaderInterface', 'Twig_SourceContextLoaderInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Markup.php --- a/vendor/twig/twig/src/Markup.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Markup.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,41 @@ + */ +class Markup implements \Countable +{ + protected $content; + protected $charset; -if (\false) { - class Markup extends \Twig_Markup + public function __construct($content, $charset) { + $this->content = (string) $content; + $this->charset = $charset; + } + + public function __toString() + { + return $this->content; + } + + public function count() + { + return \function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : \strlen($this->content); } } + +class_alias('Twig\Markup', 'Twig_Markup'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/AutoEscapeNode.php --- a/vendor/twig/twig/src/Node/AutoEscapeNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/AutoEscapeNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,40 @@ + */ +class AutoEscapeNode extends Node +{ + public function __construct($value, \Twig_NodeInterface $body, $lineno, $tag = 'autoescape') { + parent::__construct(['body' => $body], ['value' => $value], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->subcompile($this->getNode('body')); } } + +class_alias('Twig\Node\AutoEscapeNode', 'Twig_Node_AutoEscape'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/BlockNode.php --- a/vendor/twig/twig/src/Node/BlockNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/BlockNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,45 @@ + */ +class BlockNode extends Node +{ + public function __construct($name, \Twig_NodeInterface $body, $lineno, $tag = null) { + parent::__construct(['body' => $body], ['name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf("public function block_%s(\$context, array \$blocks = [])\n", $this->getAttribute('name')), "{\n") + ->indent() + ; + + $compiler + ->subcompile($this->getNode('body')) + ->outdent() + ->write("}\n\n") + ; } } + +class_alias('Twig\Node\BlockNode', 'Twig_Node_Block'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/BlockReferenceNode.php --- a/vendor/twig/twig/src/Node/BlockReferenceNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/BlockReferenceNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,38 @@ + */ +class BlockReferenceNode extends Node implements NodeOutputInterface +{ + public function __construct($name, $lineno, $tag = null) { + parent::__construct([], ['name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name'))) + ; } } + +class_alias('Twig\Node\BlockReferenceNode', 'Twig_Node_BlockReference'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/BodyNode.php --- a/vendor/twig/twig/src/Node/BodyNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/BodyNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,23 @@ + */ +class BodyNode extends Node +{ +} -if (\false) { - class BodyNode extends \Twig_Node_Body - { - } -} +class_alias('Twig\Node\BodyNode', 'Twig_Node_Body'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/CheckSecurityNode.php --- a/vendor/twig/twig/src/Node/CheckSecurityNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/CheckSecurityNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,85 @@ + */ +class CheckSecurityNode extends Node +{ + protected $usedFilters; + protected $usedTags; + protected $usedFunctions; + + public function __construct(array $usedFilters, array $usedTags, array $usedFunctions) { + $this->usedFilters = $usedFilters; + $this->usedTags = $usedTags; + $this->usedFunctions = $usedFunctions; + + parent::__construct(); + } + + public function compile(Compiler $compiler) + { + $tags = $filters = $functions = []; + foreach (['tags', 'filters', 'functions'] as $type) { + foreach ($this->{'used'.ucfirst($type)} as $name => $node) { + if ($node instanceof Node) { + ${$type}[$name] = $node->getTemplateLine(); + } else { + ${$type}[$node] = null; + } + } + } + + $compiler + ->write("\$this->sandbox = \$this->env->getExtension('\Twig\Extension\SandboxExtension');\n") + ->write('$tags = ')->repr(array_filter($tags))->raw(";\n") + ->write('$filters = ')->repr(array_filter($filters))->raw(";\n") + ->write('$functions = ')->repr(array_filter($functions))->raw(";\n\n") + ->write("try {\n") + ->indent() + ->write("\$this->sandbox->checkSecurity(\n") + ->indent() + ->write(!$tags ? "[],\n" : "['".implode("', '", array_keys($tags))."'],\n") + ->write(!$filters ? "[],\n" : "['".implode("', '", array_keys($filters))."'],\n") + ->write(!$functions ? "[]\n" : "['".implode("', '", array_keys($functions))."']\n") + ->outdent() + ->write(");\n") + ->outdent() + ->write("} catch (SecurityError \$e) {\n") + ->indent() + ->write("\$e->setSourceContext(\$this->getSourceContext());\n\n") + ->write("if (\$e instanceof SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$tags[\$e->getTagName()]);\n") + ->outdent() + ->write("} elseif (\$e instanceof SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$filters[\$e->getFilterName()]);\n") + ->outdent() + ->write("} elseif (\$e instanceof SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$functions[\$e->getFunctionName()]);\n") + ->outdent() + ->write("}\n\n") + ->write("throw \$e;\n") + ->outdent() + ->write("}\n\n") + ; } } + +class_alias('Twig\Node\CheckSecurityNode', 'Twig_Node_CheckSecurity'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/CheckToStringNode.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/twig/twig/src/Node/CheckToStringNode.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,42 @@ + + */ +class CheckToStringNode extends AbstractExpression +{ + public function __construct(AbstractExpression $expr) + { + parent::__construct(['expr' => $expr], [], $expr->getTemplateLine(), $expr->getNodeTag()); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('$this->sandbox->ensureToStringAllowed(') + ->subcompile($this->getNode('expr')) + ->raw(')') + ; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/DeprecatedNode.php --- a/vendor/twig/twig/src/Node/DeprecatedNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/DeprecatedNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,55 @@ + */ +class DeprecatedNode extends Node +{ + public function __construct(AbstractExpression $expr, $lineno, $tag = null) { + parent::__construct(['expr' => $expr], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $expr = $this->getNode('expr'); + + if ($expr instanceof ConstantExpression) { + $compiler->write('@trigger_error(') + ->subcompile($expr); + } else { + $varName = $compiler->getVarName(); + $compiler->write(sprintf('$%s = ', $varName)) + ->subcompile($expr) + ->raw(";\n") + ->write(sprintf('@trigger_error($%s', $varName)); + } + + $compiler + ->raw('.') + ->string(sprintf(' ("%s" at line %d).', $this->getTemplateName(), $this->getTemplateLine())) + ->raw(", E_USER_DEPRECATED);\n") + ; } } + +class_alias('Twig\Node\DeprecatedNode', 'Twig_Node_Deprecated'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/DoNode.php --- a/vendor/twig/twig/src/Node/DoNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/DoNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,40 @@ + */ +class DoNode extends Node +{ + public function __construct(AbstractExpression $expr, $lineno, $tag = null) { + parent::__construct(['expr' => $expr], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('') + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ; } } + +class_alias('Twig\Node\DoNode', 'Twig_Node_Do'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/EmbedNode.php --- a/vendor/twig/twig/src/Node/EmbedNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/EmbedNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,52 @@ + */ +class EmbedNode extends IncludeNode +{ + // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module) + public function __construct($name, $index, AbstractExpression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) { + parent::__construct(new ConstantExpression('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag); + + $this->setAttribute('name', $name); + // to be removed in 2.0, used name instead + $this->setAttribute('filename', $name); + $this->setAttribute('index', $index); + } + + protected function addGetTemplate(Compiler $compiler) + { + $compiler + ->write('$this->loadTemplate(') + ->string($this->getAttribute('name')) + ->raw(', ') + ->repr($this->getTemplateName()) + ->raw(', ') + ->repr($this->getTemplateLine()) + ->raw(', ') + ->string($this->getAttribute('index')) + ->raw(')') + ; } } + +class_alias('Twig\Node\EmbedNode', 'Twig_Node_Embed'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/AbstractExpression.php --- a/vendor/twig/twig/src/Node/Expression/AbstractExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/AbstractExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,26 @@ + */ +abstract class AbstractExpression extends Node +{ } + +class_alias('Twig\Node\Expression\AbstractExpression', 'Twig_Node_Expression'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/ArrayExpression.php --- a/vendor/twig/twig/src/Node/Expression/ArrayExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/ArrayExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,88 @@ index = -1; + foreach ($this->getKeyValuePairs() as $pair) { + if ($pair['key'] instanceof ConstantExpression && ctype_digit((string) $pair['key']->getAttribute('value')) && $pair['key']->getAttribute('value') > $this->index) { + $this->index = $pair['key']->getAttribute('value'); + } + } + } + + public function getKeyValuePairs() + { + $pairs = []; + + foreach (array_chunk($this->nodes, 2) as $pair) { + $pairs[] = [ + 'key' => $pair[0], + 'value' => $pair[1], + ]; + } + + return $pairs; + } + + public function hasElement(AbstractExpression $key) + { + foreach ($this->getKeyValuePairs() as $pair) { + // we compare the string representation of the keys + // to avoid comparing the line numbers which are not relevant here. + if ((string) $key === (string) $pair['key']) { + return true; + } + } + + return false; + } + + public function addElement(AbstractExpression $value, AbstractExpression $key = null) + { + if (null === $key) { + $key = new ConstantExpression(++$this->index, $value->getTemplateLine()); + } + + array_push($this->nodes, $key, $value); + } + + public function compile(Compiler $compiler) + { + $compiler->raw('['); + $first = true; + foreach ($this->getKeyValuePairs() as $pair) { + if (!$first) { + $compiler->raw(', '); + } + $first = false; + + $compiler + ->subcompile($pair['key']) + ->raw(' => ') + ->subcompile($pair['value']) + ; + } + $compiler->raw(']'); } } + +class_alias('Twig\Node\Expression\ArrayExpression', 'Twig_Node_Expression_Array'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/AssignNameExpression.php --- a/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,29 @@ raw('$context[') + ->string($this->getAttribute('name')) + ->raw(']') + ; } } + +class_alias('Twig\Node\Expression\AssignNameExpression', 'Twig_Node_Expression_AssignName'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,43 @@ $left, 'right' => $right], [], $lineno); } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('left')) + ->raw(' ') + ; + $this->operator($compiler); + $compiler + ->raw(' ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + abstract public function operator(Compiler $compiler); } + +class_alias('Twig\Node\Expression\Binary\AbstractBinary', 'Twig_Node_Expression_Binary'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('+'); } } + +class_alias('Twig\Node\Expression\Binary\AddBinary', 'Twig_Node_Expression_Binary_Add'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('&&'); } } + +class_alias('Twig\Node\Expression\Binary\AndBinary', 'Twig_Node_Expression_Binary_And'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('&'); } } + +class_alias('Twig\Node\Expression\Binary\BitwiseAndBinary', 'Twig_Node_Expression_Binary_BitwiseAnd'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('|'); } } + +class_alias('Twig\Node\Expression\Binary\BitwiseOrBinary', 'Twig_Node_Expression_Binary_BitwiseOr'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('^'); } } + +class_alias('Twig\Node\Expression\Binary\BitwiseXorBinary', 'Twig_Node_Expression_Binary_BitwiseXor'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('.'); } } + +class_alias('Twig\Node\Expression\Binary\ConcatBinary', 'Twig_Node_Expression_Binary_Concat'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('/'); } } + +class_alias('Twig\Node\Expression\Binary\DivBinary', 'Twig_Node_Expression_Binary_Div'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,37 @@ getVarName(); + $right = $compiler->getVarName(); + $compiler + ->raw(sprintf('(is_string($%s = ', $left)) + ->subcompile($this->getNode('left')) + ->raw(sprintf(') && is_string($%s = ', $right)) + ->subcompile($this->getNode('right')) + ->raw(sprintf(') && (\'\' === $%2$s || $%2$s === substr($%1$s, -strlen($%2$s))))', $left, $right)) + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw(''); } } + +class_alias('Twig\Node\Expression\Binary\EndsWithBinary', 'Twig_Node_Expression_Binary_EndsWith'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,24 @@ raw('=='); } } + +class_alias('Twig\Node\Expression\Binary\EqualBinary', 'Twig_Node_Expression_Binary_Equal'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,31 @@ raw('(int) floor('); + parent::compile($compiler); + $compiler->raw(')'); + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('/'); } } + +class_alias('Twig\Node\Expression\Binary\FloorDivBinary', 'Twig_Node_Expression_Binary_FloorDiv'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,24 @@ raw('>'); } } + +class_alias('Twig\Node\Expression\Binary\GreaterBinary', 'Twig_Node_Expression_Binary_Greater'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,24 @@ raw('>='); } } + +class_alias('Twig\Node\Expression\Binary\GreaterEqualBinary', 'Twig_Node_Expression_Binary_GreaterEqual'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/InBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,35 @@ raw('twig_in_filter(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('in'); } } + +class_alias('Twig\Node\Expression\Binary\InBinary', 'Twig_Node_Expression_Binary_In'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,24 @@ raw('<'); } } + +class_alias('Twig\Node\Expression\Binary\LessBinary', 'Twig_Node_Expression_Binary_Less'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,24 @@ raw('<='); } } + +class_alias('Twig\Node\Expression\Binary\LessEqualBinary', 'Twig_Node_Expression_Binary_LessEqual'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,35 @@ raw('preg_match(') + ->subcompile($this->getNode('right')) + ->raw(', ') + ->subcompile($this->getNode('left')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw(''); } } + +class_alias('Twig\Node\Expression\Binary\MatchesBinary', 'Twig_Node_Expression_Binary_Matches'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('%'); } } + +class_alias('Twig\Node\Expression\Binary\ModBinary', 'Twig_Node_Expression_Binary_Mod'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('*'); } } + +class_alias('Twig\Node\Expression\Binary\MulBinary', 'Twig_Node_Expression_Binary_Mul'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,24 @@ raw('!='); } } + +class_alias('Twig\Node\Expression\Binary\NotEqualBinary', 'Twig_Node_Expression_Binary_NotEqual'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,35 @@ raw('!twig_in_filter(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('not in'); } } + +class_alias('Twig\Node\Expression\Binary\NotInBinary', 'Twig_Node_Expression_Binary_NotIn'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('||'); } } + +class_alias('Twig\Node\Expression\Binary\OrBinary', 'Twig_Node_Expression_Binary_Or'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,39 @@ = 50600) { + return parent::compile($compiler); + } + + $compiler + ->raw('pow(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('**'); } } + +class_alias('Twig\Node\Expression\Binary\PowerBinary', 'Twig_Node_Expression_Binary_Power'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,35 @@ raw('range(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('..'); } } + +class_alias('Twig\Node\Expression\Binary\RangeBinary', 'Twig_Node_Expression_Binary_Range'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,37 @@ getVarName(); + $right = $compiler->getVarName(); + $compiler + ->raw(sprintf('(is_string($%s = ', $left)) + ->subcompile($this->getNode('left')) + ->raw(sprintf(') && is_string($%s = ', $right)) + ->subcompile($this->getNode('right')) + ->raw(sprintf(') && (\'\' === $%2$s || 0 === strpos($%1$s, $%2$s)))', $left, $right)) + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw(''); } } + +class_alias('Twig\Node\Expression\Binary\StartsWithBinary', 'Twig_Node_Expression_Binary_StartsWith'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php --- a/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('-'); } } + +class_alias('Twig\Node\Expression\Binary\SubBinary', 'Twig_Node_Expression_Binary_Sub'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php --- a/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,98 @@ + */ +class BlockReferenceExpression extends AbstractExpression +{ + /** + * @param Node|null $template + */ + public function __construct(\Twig_NodeInterface $name, $template = null, $lineno, $tag = null) { + if (\is_bool($template)) { + @trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); + + $template = null; + } + + $nodes = ['name' => $name]; + if (null !== $template) { + $nodes['template'] = $template; + } + + parent::__construct($nodes, ['is_defined_test' => false, 'output' => false], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + if ($this->getAttribute('is_defined_test')) { + $this->compileTemplateCall($compiler, 'hasBlock'); + } else { + if ($this->getAttribute('output')) { + $compiler->addDebugInfo($this); + + $this + ->compileTemplateCall($compiler, 'displayBlock') + ->raw(";\n"); + } else { + $this->compileTemplateCall($compiler, 'renderBlock'); + } + } + } + + private function compileTemplateCall(Compiler $compiler, $method) + { + if (!$this->hasNode('template')) { + $compiler->write('$this'); + } else { + $compiler + ->write('$this->loadTemplate(') + ->subcompile($this->getNode('template')) + ->raw(', ') + ->repr($this->getTemplateName()) + ->raw(', ') + ->repr($this->getTemplateLine()) + ->raw(')') + ; + } + + $compiler->raw(sprintf('->%s', $method)); + $this->compileBlockArguments($compiler); + + return $compiler; + } + + private function compileBlockArguments(Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('name')) + ->raw(', $context'); + + if (!$this->hasNode('template')) { + $compiler->raw(', $blocks'); + } + + return $compiler->raw(')'); } } + +class_alias('Twig\Node\Expression\BlockReferenceExpression', 'Twig_Node_Expression_BlockReference'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/CallExpression.php --- a/vendor/twig/twig/src/Node/Expression/CallExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/CallExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,305 @@ hasAttribute('callable') && $callable = $this->getAttribute('callable')) { + if (\is_string($callable) && false === strpos($callable, '::')) { + $compiler->raw($callable); + } else { + list($r, $callable) = $this->reflectCallable($callable); + if ($r instanceof \ReflectionMethod && \is_string($callable[0])) { + if ($r->isStatic()) { + $compiler->raw(sprintf('%s::%s', $callable[0], $callable[1])); + } else { + $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1])); + } + } elseif ($r instanceof \ReflectionMethod && $callable[0] instanceof ExtensionInterface) { + $compiler->raw(sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($callable[0]), $callable[1])); + } else { + $type = ucfirst($this->getAttribute('type')); + $compiler->raw(sprintf('call_user_func_array($this->env->get%s(\'%s\')->getCallable(), ', $type, $this->getAttribute('name'))); + $closingParenthesis = true; + $isArray = true; + } + } + } else { + $compiler->raw($this->getAttribute('thing')->compile()); + } + + $this->compileArguments($compiler, $isArray); + + if ($closingParenthesis) { + $compiler->raw(')'); + } + } + + protected function compileArguments(Compiler $compiler, $isArray = false) + { + $compiler->raw($isArray ? '[' : '('); + + $first = true; + + if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { + $compiler->raw('$this->env'); + $first = false; + } + + if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->raw('$context'); + $first = false; + } + + if ($this->hasAttribute('arguments')) { + foreach ($this->getAttribute('arguments') as $argument) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->string($argument); + $first = false; + } + } + + if ($this->hasNode('node')) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->subcompile($this->getNode('node')); + $first = false; + } + + if ($this->hasNode('arguments')) { + $callable = $this->hasAttribute('callable') ? $this->getAttribute('callable') : null; + + $arguments = $this->getArguments($callable, $this->getNode('arguments')); + + foreach ($arguments as $node) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->subcompile($node); + $first = false; + } + } + + $compiler->raw($isArray ? ']' : ')'); + } + + protected function getArguments($callable, $arguments) + { + $callType = $this->getAttribute('type'); + $callName = $this->getAttribute('name'); + + $parameters = []; + $named = false; + foreach ($arguments as $name => $node) { + if (!\is_int($name)) { + $named = true; + $name = $this->normalizeName($name); + } elseif ($named) { + throw new SyntaxError(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); + } + + $parameters[$name] = $node; + } + + $isVariadic = $this->hasAttribute('is_variadic') && $this->getAttribute('is_variadic'); + if (!$named && !$isVariadic) { + return $parameters; + } + + if (!$callable) { + if ($named) { + $message = sprintf('Named arguments are not supported for %s "%s".', $callType, $callName); + } else { + $message = sprintf('Arbitrary positional arguments are not supported for %s "%s".', $callType, $callName); + } + + throw new \LogicException($message); + } + + $callableParameters = $this->getCallableParameters($callable, $isVariadic); + $arguments = []; + $names = []; + $missingArguments = []; + $optionalArguments = []; + $pos = 0; + foreach ($callableParameters as $callableParameter) { + $names[] = $name = $this->normalizeName($callableParameter->name); + + if (\array_key_exists($name, $parameters)) { + if (\array_key_exists($pos, $parameters)) { + throw new SyntaxError(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); + } + + if (\count($missingArguments)) { + throw new SyntaxError(sprintf( + 'Argument "%s" could not be assigned for %s "%s(%s)" because it is mapped to an internal PHP function which cannot determine default value for optional argument%s "%s".', + $name, $callType, $callName, implode(', ', $names), \count($missingArguments) > 1 ? 's' : '', implode('", "', $missingArguments) + ), $this->getTemplateLine(), $this->getSourceContext()); + } + + $arguments = array_merge($arguments, $optionalArguments); + $arguments[] = $parameters[$name]; + unset($parameters[$name]); + $optionalArguments = []; + } elseif (\array_key_exists($pos, $parameters)) { + $arguments = array_merge($arguments, $optionalArguments); + $arguments[] = $parameters[$pos]; + unset($parameters[$pos]); + $optionalArguments = []; + ++$pos; + } elseif ($callableParameter->isDefaultValueAvailable()) { + $optionalArguments[] = new ConstantExpression($callableParameter->getDefaultValue(), -1); + } elseif ($callableParameter->isOptional()) { + if (empty($parameters)) { + break; + } else { + $missingArguments[] = $name; + } + } else { + throw new SyntaxError(sprintf('Value for argument "%s" is required for %s "%s".', $name, $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); + } + } + + if ($isVariadic) { + $arbitraryArguments = new ArrayExpression([], -1); + foreach ($parameters as $key => $value) { + if (\is_int($key)) { + $arbitraryArguments->addElement($value); + } else { + $arbitraryArguments->addElement($value, new ConstantExpression($key, -1)); + } + unset($parameters[$key]); + } + + if ($arbitraryArguments->count()) { + $arguments = array_merge($arguments, $optionalArguments); + $arguments[] = $arbitraryArguments; + } + } + + if (!empty($parameters)) { + $unknownParameter = null; + foreach ($parameters as $parameter) { + if ($parameter instanceof Node) { + $unknownParameter = $parameter; + break; + } + } + + throw new SyntaxError( + sprintf( + 'Unknown argument%s "%s" for %s "%s(%s)".', + \count($parameters) > 1 ? 's' : '', implode('", "', array_keys($parameters)), $callType, $callName, implode(', ', $names) + ), + $unknownParameter ? $unknownParameter->getTemplateLine() : $this->getTemplateLine(), + $unknownParameter ? $unknownParameter->getSourceContext() : $this->getSourceContext() + ); + } + + return $arguments; + } + + protected function normalizeName($name) + { + return strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], ['\\1_\\2', '\\1_\\2'], $name)); + } + + private function getCallableParameters($callable, $isVariadic) + { + list($r) = $this->reflectCallable($callable); + if (null === $r) { + return []; + } + + $parameters = $r->getParameters(); + if ($this->hasNode('node')) { + array_shift($parameters); + } + if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { + array_shift($parameters); + } + if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { + array_shift($parameters); + } + if ($this->hasAttribute('arguments') && null !== $this->getAttribute('arguments')) { + foreach ($this->getAttribute('arguments') as $argument) { + array_shift($parameters); + } + } + if ($isVariadic) { + $argument = end($parameters); + if ($argument && $argument->isArray() && $argument->isDefaultValueAvailable() && [] === $argument->getDefaultValue()) { + array_pop($parameters); + } else { + $callableName = $r->name; + if ($r instanceof \ReflectionMethod) { + $callableName = $r->getDeclaringClass()->name.'::'.$callableName; + } + + throw new \LogicException(sprintf('The last parameter of "%s" for %s "%s" must be an array with default value, eg. "array $arg = []".', $callableName, $this->getAttribute('type'), $this->getAttribute('name'))); + } + } + + return $parameters; + } + + private function reflectCallable($callable) + { + if (null !== $this->reflector) { + return $this->reflector; + } + + if (\is_array($callable)) { + if (!method_exists($callable[0], $callable[1])) { + // __call() + return [null, []]; + } + $r = new \ReflectionMethod($callable[0], $callable[1]); + } elseif (\is_object($callable) && !$callable instanceof \Closure) { + $r = new \ReflectionObject($callable); + $r = $r->getMethod('__invoke'); + $callable = [$callable, '__invoke']; + } elseif (\is_string($callable) && false !== $pos = strpos($callable, '::')) { + $class = substr($callable, 0, $pos); + $method = substr($callable, $pos + 2); + if (!method_exists($class, $method)) { + // __staticCall() + return [null, []]; + } + $r = new \ReflectionMethod($callable); + $callable = [$class, $method]; + } else { + $r = new \ReflectionFunction($callable); + } + + return $this->reflector = [$r, $callable]; } } + +class_alias('Twig\Node\Expression\CallExpression', 'Twig_Node_Expression_Call'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/ConditionalExpression.php --- a/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,38 @@ $expr1, 'expr2' => $expr2, 'expr3' => $expr3], [], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('((') + ->subcompile($this->getNode('expr1')) + ->raw(') ? (') + ->subcompile($this->getNode('expr2')) + ->raw(') : (') + ->subcompile($this->getNode('expr3')) + ->raw('))') + ; } } + +class_alias('Twig\Node\Expression\ConditionalExpression', 'Twig_Node_Expression_Conditional'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/ConstantExpression.php --- a/vendor/twig/twig/src/Node/Expression/ConstantExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/ConstantExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,30 @@ $value], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler->repr($this->getAttribute('value')); } } + +class_alias('Twig\Node\Expression\ConstantExpression', 'Twig_Node_Expression_Constant'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php --- a/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,54 @@ + */ +class DefaultFilter extends FilterExpression +{ + public function __construct(\Twig_NodeInterface $node, ConstantExpression $filterName, \Twig_NodeInterface $arguments, $lineno, $tag = null) { + $default = new FilterExpression($node, new ConstantExpression('default', $node->getTemplateLine()), $arguments, $node->getTemplateLine()); + + if ('default' === $filterName->getAttribute('value') && ($node instanceof NameExpression || $node instanceof GetAttrExpression)) { + $test = new DefinedTest(clone $node, 'defined', new Node(), $node->getTemplateLine()); + $false = \count($arguments) ? $arguments->getNode(0) : new ConstantExpression('', $node->getTemplateLine()); + + $node = new ConditionalExpression($test, $default, $false, $node->getTemplateLine()); + } else { + $node = $default; + } + + parent::__construct($node, $filterName, $arguments, $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->subcompile($this->getNode('node')); } } + +class_alias('Twig\Node\Expression\Filter\DefaultFilter', 'Twig_Node_Expression_Filter_Default'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/FilterExpression.php --- a/vendor/twig/twig/src/Node/Expression/FilterExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/FilterExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,47 @@ $node, 'filter' => $filterName, 'arguments' => $arguments], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $name = $this->getNode('filter')->getAttribute('value'); + $filter = $compiler->getEnvironment()->getFilter($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'filter'); + $this->setAttribute('thing', $filter); + $this->setAttribute('needs_environment', $filter->needsEnvironment()); + $this->setAttribute('needs_context', $filter->needsContext()); + $this->setAttribute('arguments', $filter->getArguments()); + if ($filter instanceof \Twig_FilterCallableInterface || $filter instanceof TwigFilter) { + $this->setAttribute('callable', $filter->getCallable()); + } + if ($filter instanceof TwigFilter) { + $this->setAttribute('is_variadic', $filter->isVariadic()); + } + + $this->compileCallable($compiler); } } + +class_alias('Twig\Node\Expression\FilterExpression', 'Twig_Node_Expression_Filter'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/FunctionExpression.php --- a/vendor/twig/twig/src/Node/Expression/FunctionExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/FunctionExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,51 @@ $arguments], ['name' => $name, 'is_defined_test' => false], $lineno); + } + + public function compile(Compiler $compiler) + { + $name = $this->getAttribute('name'); + $function = $compiler->getEnvironment()->getFunction($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'function'); + $this->setAttribute('thing', $function); + $this->setAttribute('needs_environment', $function->needsEnvironment()); + $this->setAttribute('needs_context', $function->needsContext()); + $this->setAttribute('arguments', $function->getArguments()); + if ($function instanceof \Twig_FunctionCallableInterface || $function instanceof TwigFunction) { + $callable = $function->getCallable(); + if ('constant' === $name && $this->getAttribute('is_defined_test')) { + $callable = 'twig_constant_is_defined'; + } + + $this->setAttribute('callable', $callable); + } + if ($function instanceof TwigFunction) { + $this->setAttribute('is_variadic', $function->isVariadic()); + } + + $this->compileCallable($compiler); } } + +class_alias('Twig\Node\Expression\FunctionExpression', 'Twig_Node_Expression_Function'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/GetAttrExpression.php --- a/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,80 @@ $node, 'attribute' => $attribute]; + if (null !== $arguments) { + $nodes['arguments'] = $arguments; + } + + parent::__construct($nodes, ['type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false], $lineno); + } + + public function compile(Compiler $compiler) + { + if ($this->getAttribute('disable_c_ext')) { + @trigger_error(sprintf('Using the "disable_c_ext" attribute on %s is deprecated since version 1.30 and will be removed in 2.0.', __CLASS__), E_USER_DEPRECATED); + } + + if (\function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) { + $compiler->raw('twig_template_get_attributes($this, '); + } else { + $compiler->raw('$this->getAttribute('); + } + + if ($this->getAttribute('ignore_strict_check')) { + $this->getNode('node')->setAttribute('ignore_strict_check', true); + } + + $compiler->subcompile($this->getNode('node')); + + $compiler->raw(', ')->subcompile($this->getNode('attribute')); + + // only generate optional arguments when needed (to make generated code more readable) + $needFourth = $this->getAttribute('ignore_strict_check'); + $needThird = $needFourth || $this->getAttribute('is_defined_test'); + $needSecond = $needThird || Template::ANY_CALL !== $this->getAttribute('type'); + $needFirst = $needSecond || $this->hasNode('arguments'); + + if ($needFirst) { + if ($this->hasNode('arguments')) { + $compiler->raw(', ')->subcompile($this->getNode('arguments')); + } else { + $compiler->raw(', []'); + } + } + + if ($needSecond) { + $compiler->raw(', ')->repr($this->getAttribute('type')); + } + + if ($needThird) { + $compiler->raw(', ')->repr($this->getAttribute('is_defined_test')); + } + + if ($needFourth) { + $compiler->raw(', ')->repr($this->getAttribute('ignore_strict_check')); + } + + $compiler->raw(')'); } } + +class_alias('Twig\Node\Expression\GetAttrExpression', 'Twig_Node_Expression_GetAttr'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/InlinePrint.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/twig/twig/src/Node/Expression/InlinePrint.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,35 @@ + $node], [], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('print (') + ->subcompile($this->getNode('node')) + ->raw(')') + ; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/MethodCallExpression.php --- a/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,48 @@ $node, 'arguments' => $arguments], ['method' => $method, 'safe' => false], $lineno); + + if ($node instanceof NameExpression) { + $node->setAttribute('always_defined', true); + } + } + + public function compile(Compiler $compiler) + { + $compiler + ->subcompile($this->getNode('node')) + ->raw('->') + ->raw($this->getAttribute('method')) + ->raw('(') + ; + $first = true; + foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { + if (!$first) { + $compiler->raw(', '); + } + $first = false; + + $compiler->subcompile($pair['value']); + } + $compiler->raw(')'); } } + +class_alias('Twig\Node\Expression\MethodCallExpression', 'Twig_Node_Expression_MethodCall'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/NameExpression.php --- a/vendor/twig/twig/src/Node/Expression/NameExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/NameExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,112 @@ '$this', + '_context' => '$context', + '_charset' => '$this->env->getCharset()', + ]; + + public function __construct($name, $lineno) { + parent::__construct([], ['name' => $name, 'is_defined_test' => false, 'ignore_strict_check' => false, 'always_defined' => false], $lineno); + } + + public function compile(Compiler $compiler) + { + $name = $this->getAttribute('name'); + + $compiler->addDebugInfo($this); + + if ($this->getAttribute('is_defined_test')) { + if ($this->isSpecial()) { + $compiler->repr(true); + } else { + $compiler + ->raw('(isset($context[') + ->string($name) + ->raw(']) || array_key_exists(') + ->string($name) + ->raw(', $context))'); + } + } elseif ($this->isSpecial()) { + $compiler->raw($this->specialVars[$name]); + } elseif ($this->getAttribute('always_defined')) { + $compiler + ->raw('$context[') + ->string($name) + ->raw(']') + ; + } else { + if (\PHP_VERSION_ID >= 70000) { + // use PHP 7 null coalescing operator + $compiler + ->raw('($context[') + ->string($name) + ->raw('] ?? ') + ; + + if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { + $compiler->raw('null)'); + } else { + $compiler->raw('$this->getContext($context, ')->string($name)->raw('))'); + } + } elseif (\PHP_VERSION_ID >= 50400) { + // PHP 5.4 ternary operator performance was optimized + $compiler + ->raw('(isset($context[') + ->string($name) + ->raw(']) ? $context[') + ->string($name) + ->raw('] : ') + ; + + if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { + $compiler->raw('null)'); + } else { + $compiler->raw('$this->getContext($context, ')->string($name)->raw('))'); + } + } else { + $compiler + ->raw('$this->getContext($context, ') + ->string($name) + ; + + if ($this->getAttribute('ignore_strict_check')) { + $compiler->raw(', true'); + } + + $compiler + ->raw(')') + ; + } + } + } + + public function isSpecial() + { + return isset($this->specialVars[$this->getAttribute('name')]); + } + + public function isSimple() + { + return !$this->isSpecial() && !$this->getAttribute('is_defined_test'); } } + +class_alias('Twig\Node\Expression\NameExpression', 'Twig_Node_Expression_Name'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php --- a/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,58 @@ getTemplateLine()), + new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), + $left->getTemplateLine() + ); + + parent::__construct($test, $left, $right, $lineno); + } + + public function compile(Compiler $compiler) + { + /* + * This optimizes only one case. PHP 7 also supports more complex expressions + * that can return null. So, for instance, if log is defined, log("foo") ?? "..." works, + * but log($a["foo"]) ?? "..." does not if $a["foo"] is not defined. More advanced + * cases might be implemented as an optimizer node visitor, but has not been done + * as benefits are probably not worth the added complexity. + */ + if (\PHP_VERSION_ID >= 70000 && $this->getNode('expr2') instanceof NameExpression) { + $this->getNode('expr2')->setAttribute('always_defined', true); + $compiler + ->raw('((') + ->subcompile($this->getNode('expr2')) + ->raw(') ?? (') + ->subcompile($this->getNode('expr3')) + ->raw('))') + ; + } else { + parent::compile($compiler); + } } } + +class_alias('Twig\Node\Expression\NullCoalesceExpression', 'Twig_Node_Expression_NullCoalesce'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/ParentExpression.php --- a/vendor/twig/twig/src/Node/Expression/ParentExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/ParentExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,48 @@ + */ +class ParentExpression extends AbstractExpression +{ + public function __construct($name, $lineno, $tag = null) { + parent::__construct([], ['output' => false, 'name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + if ($this->getAttribute('output')) { + $compiler + ->addDebugInfo($this) + ->write('$this->displayParentBlock(') + ->string($this->getAttribute('name')) + ->raw(", \$context, \$blocks);\n") + ; + } else { + $compiler + ->raw('$this->renderParentBlock(') + ->string($this->getAttribute('name')) + ->raw(', $context, $blocks)') + ; + } } } + +class_alias('Twig\Node\Expression\ParentExpression', 'Twig_Node_Expression_Parent'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/TempNameExpression.php --- a/vendor/twig/twig/src/Node/Expression/TempNameExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/TempNameExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,33 @@ $name], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('$_') + ->raw($this->getAttribute('name')) + ->raw('_') + ; } } + +class_alias('Twig\Node\Expression\TempNameExpression', 'Twig_Node_Expression_TempName'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php --- a/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,51 @@ + */ +class ConstantTest extends TestExpression +{ + public function compile(Compiler $compiler) { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' === constant(') + ; + + if ($this->getNode('arguments')->hasNode(1)) { + $compiler + ->raw('get_class(') + ->subcompile($this->getNode('arguments')->getNode(1)) + ->raw(')."::".') + ; + } + + $compiler + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw('))') + ; } } + +class_alias('Twig\Node\Expression\Test\ConstantTest', 'Twig_Node_Expression_Test_Constant'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php --- a/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,71 @@ + */ +class DefinedTest extends TestExpression +{ + public function __construct(\Twig_NodeInterface $node, $name, \Twig_NodeInterface $arguments = null, $lineno) { + if ($node instanceof NameExpression) { + $node->setAttribute('is_defined_test', true); + } elseif ($node instanceof GetAttrExpression) { + $node->setAttribute('is_defined_test', true); + $this->changeIgnoreStrictCheck($node); + } elseif ($node instanceof BlockReferenceExpression) { + $node->setAttribute('is_defined_test', true); + } elseif ($node instanceof FunctionExpression && 'constant' === $node->getAttribute('name')) { + $node->setAttribute('is_defined_test', true); + } elseif ($node instanceof ConstantExpression || $node instanceof ArrayExpression) { + $node = new ConstantExpression(true, $node->getTemplateLine()); + } else { + throw new SyntaxError('The "defined" test only works with simple variables.', $lineno); + } + + parent::__construct($node, $name, $arguments, $lineno); + } + + protected function changeIgnoreStrictCheck(GetAttrExpression $node) + { + $node->setAttribute('ignore_strict_check', true); + + if ($node->getNode('node') instanceof GetAttrExpression) { + $this->changeIgnoreStrictCheck($node->getNode('node')); + } + } + + public function compile(Compiler $compiler) + { + $compiler->subcompile($this->getNode('node')); } } + +class_alias('Twig\Node\Expression\Test\DefinedTest', 'Twig_Node_Expression_Test_Defined'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php --- a/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,38 @@ + */ +class DivisiblebyTest extends TestExpression +{ + public function compile(Compiler $compiler) { + $compiler + ->raw('(0 == ') + ->subcompile($this->getNode('node')) + ->raw(' % ') + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw(')') + ; } } + +class_alias('Twig\Node\Expression\Test\DivisiblebyTest', 'Twig_Node_Expression_Test_Divisibleby'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Test/EvenTest.php --- a/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,37 @@ + */ +class EvenTest extends TestExpression +{ + public function compile(Compiler $compiler) { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' % 2 == 0') + ->raw(')') + ; } } + +class_alias('Twig\Node\Expression\Test\EvenTest', 'Twig_Node_Expression_Test_Even'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Test/NullTest.php --- a/vendor/twig/twig/src/Node/Expression/Test/NullTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Test/NullTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,36 @@ + */ +class NullTest extends TestExpression +{ + public function compile(Compiler $compiler) { + $compiler + ->raw('(null === ') + ->subcompile($this->getNode('node')) + ->raw(')') + ; } } + +class_alias('Twig\Node\Expression\Test\NullTest', 'Twig_Node_Expression_Test_Null'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Test/OddTest.php --- a/vendor/twig/twig/src/Node/Expression/Test/OddTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Test/OddTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,37 @@ + */ +class OddTest extends TestExpression +{ + public function compile(Compiler $compiler) { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' % 2 == 1') + ->raw(')') + ; } } + +class_alias('Twig\Node\Expression\Test\OddTest', 'Twig_Node_Expression_Test_Odd'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Test/SameasTest.php --- a/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,36 @@ + */ +class SameasTest extends TestExpression +{ + public function compile(Compiler $compiler) { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' === ') + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw(')') + ; } } + +class_alias('Twig\Node\Expression\Test\SameasTest', 'Twig_Node_Expression_Test_Sameas'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/TestExpression.php --- a/vendor/twig/twig/src/Node/Expression/TestExpression.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/TestExpression.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,51 @@ $node]; + if (null !== $arguments) { + $nodes['arguments'] = $arguments; + } + + parent::__construct($nodes, ['name' => $name], $lineno); + } + + public function compile(Compiler $compiler) + { + $name = $this->getAttribute('name'); + $test = $compiler->getEnvironment()->getTest($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'test'); + $this->setAttribute('thing', $test); + if ($test instanceof TwigTest) { + $this->setAttribute('arguments', $test->getArguments()); + } + if ($test instanceof \Twig_TestCallableInterface || $test instanceof TwigTest) { + $this->setAttribute('callable', $test->getCallable()); + } + if ($test instanceof TwigTest) { + $this->setAttribute('is_variadic', $test->isVariadic()); + } + + $this->compileCallable($compiler); } } + +class_alias('Twig\Node\Expression\TestExpression', 'Twig_Node_Expression_Test'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php --- a/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,35 @@ $node], [], $lineno); } + + public function compile(Compiler $compiler) + { + $compiler->raw(' '); + $this->operator($compiler); + $compiler->subcompile($this->getNode('node')); + } + + abstract public function operator(Compiler $compiler); } + +class_alias('Twig\Node\Expression\Unary\AbstractUnary', 'Twig_Node_Expression_Unary'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php --- a/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('-'); } } + +class_alias('Twig\Node\Expression\Unary\NegUnary', 'Twig_Node_Expression_Unary_Neg'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php --- a/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('!'); } } + +class_alias('Twig\Node\Expression\Unary\NotUnary', 'Twig_Node_Expression_Unary_Not'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php --- a/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ raw('+'); } } + +class_alias('Twig\Node\Expression\Unary\PosUnary', 'Twig_Node_Expression_Unary_Pos'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/FlushNode.php --- a/vendor/twig/twig/src/Node/FlushNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/FlushNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,37 @@ + */ +class FlushNode extends Node +{ + public function __construct($lineno, $tag) { + parent::__construct([], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("flush();\n") + ; } } + +class_alias('Twig\Node\FlushNode', 'Twig_Node_Flush'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/ForLoopNode.php --- a/vendor/twig/twig/src/Node/ForLoopNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/ForLoopNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,56 @@ + */ +class ForLoopNode extends Node +{ + public function __construct($lineno, $tag = null) { + parent::__construct([], ['with_loop' => false, 'ifexpr' => false, 'else' => false], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + if ($this->getAttribute('else')) { + $compiler->write("\$context['_iterated'] = true;\n"); + } + + if ($this->getAttribute('with_loop')) { + $compiler + ->write("++\$context['loop']['index0'];\n") + ->write("++\$context['loop']['index'];\n") + ->write("\$context['loop']['first'] = false;\n") + ; + + if (!$this->getAttribute('ifexpr')) { + $compiler + ->write("if (isset(\$context['loop']['length'])) {\n") + ->indent() + ->write("--\$context['loop']['revindex0'];\n") + ->write("--\$context['loop']['revindex'];\n") + ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") + ->outdent() + ->write("}\n") + ; + } + } } } + +class_alias('Twig\Node\ForLoopNode', 'Twig_Node_ForLoop'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/ForNode.php --- a/vendor/twig/twig/src/Node/ForNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/ForNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,119 @@ + */ +class ForNode extends Node +{ + protected $loop; + + public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, AbstractExpression $ifexpr = null, \Twig_NodeInterface $body, \Twig_NodeInterface $else = null, $lineno, $tag = null) { + $body = new Node([$body, $this->loop = new ForLoopNode($lineno, $tag)]); + + if (null !== $ifexpr) { + $body = new IfNode(new Node([$ifexpr, $body]), null, $lineno, $tag); + } + + $nodes = ['key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body]; + if (null !== $else) { + $nodes['else'] = $else; + } + + parent::__construct($nodes, ['with_loop' => true, 'ifexpr' => null !== $ifexpr], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("\$context['_parent'] = \$context;\n") + ->write("\$context['_seq'] = twig_ensure_traversable(") + ->subcompile($this->getNode('seq')) + ->raw(");\n") + ; + + if ($this->hasNode('else')) { + $compiler->write("\$context['_iterated'] = false;\n"); + } + + if ($this->getAttribute('with_loop')) { + $compiler + ->write("\$context['loop'] = [\n") + ->write(" 'parent' => \$context['_parent'],\n") + ->write(" 'index0' => 0,\n") + ->write(" 'index' => 1,\n") + ->write(" 'first' => true,\n") + ->write("];\n") + ; + + if (!$this->getAttribute('ifexpr')) { + $compiler + ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) {\n") + ->indent() + ->write("\$length = count(\$context['_seq']);\n") + ->write("\$context['loop']['revindex0'] = \$length - 1;\n") + ->write("\$context['loop']['revindex'] = \$length;\n") + ->write("\$context['loop']['length'] = \$length;\n") + ->write("\$context['loop']['last'] = 1 === \$length;\n") + ->outdent() + ->write("}\n") + ; + } + } + + $this->loop->setAttribute('else', $this->hasNode('else')); + $this->loop->setAttribute('with_loop', $this->getAttribute('with_loop')); + $this->loop->setAttribute('ifexpr', $this->getAttribute('ifexpr')); + + $compiler + ->write("foreach (\$context['_seq'] as ") + ->subcompile($this->getNode('key_target')) + ->raw(' => ') + ->subcompile($this->getNode('value_target')) + ->raw(") {\n") + ->indent() + ->subcompile($this->getNode('body')) + ->outdent() + ->write("}\n") + ; + + if ($this->hasNode('else')) { + $compiler + ->write("if (!\$context['_iterated']) {\n") + ->indent() + ->subcompile($this->getNode('else')) + ->outdent() + ->write("}\n") + ; + } + + $compiler->write("\$_parent = \$context['_parent'];\n"); + + // remove some "private" loop variables (needed for nested loops) + $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n"); + + // keep the values set in the inner context for variables defined in the outer context + $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n"); } } + +class_alias('Twig\Node\ForNode', 'Twig_Node_For'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/IfNode.php --- a/vendor/twig/twig/src/Node/IfNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/IfNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,72 @@ + */ +class IfNode extends Node +{ + public function __construct(\Twig_NodeInterface $tests, \Twig_NodeInterface $else = null, $lineno, $tag = null) { + $nodes = ['tests' => $tests]; + if (null !== $else) { + $nodes['else'] = $else; + } + + parent::__construct($nodes, [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + for ($i = 0, $count = \count($this->getNode('tests')); $i < $count; $i += 2) { + if ($i > 0) { + $compiler + ->outdent() + ->write('} elseif (') + ; + } else { + $compiler + ->write('if (') + ; + } + + $compiler + ->subcompile($this->getNode('tests')->getNode($i)) + ->raw(") {\n") + ->indent() + ->subcompile($this->getNode('tests')->getNode($i + 1)) + ; + } + + if ($this->hasNode('else')) { + $compiler + ->outdent() + ->write("} else {\n") + ->indent() + ->subcompile($this->getNode('else')) + ; + } + + $compiler + ->outdent() + ->write("}\n"); } } + +class_alias('Twig\Node\IfNode', 'Twig_Node_If'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/ImportNode.php --- a/vendor/twig/twig/src/Node/ImportNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/ImportNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,57 @@ + */ +class ImportNode extends Node +{ + public function __construct(AbstractExpression $expr, AbstractExpression $var, $lineno, $tag = null) { + parent::__construct(['expr' => $expr, 'var' => $var], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('') + ->subcompile($this->getNode('var')) + ->raw(' = ') + ; + + if ($this->getNode('expr') instanceof NameExpression && '_self' === $this->getNode('expr')->getAttribute('name')) { + $compiler->raw('$this'); + } else { + $compiler + ->raw('$this->loadTemplate(') + ->subcompile($this->getNode('expr')) + ->raw(', ') + ->repr($this->getTemplateName()) + ->raw(', ') + ->repr($this->getTemplateLine()) + ->raw(')->unwrap()') + ; + } + + $compiler->raw(";\n"); } } + +class_alias('Twig\Node\ImportNode', 'Twig_Node_Import'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/IncludeNode.php --- a/vendor/twig/twig/src/Node/IncludeNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/IncludeNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,108 @@ + */ +class IncludeNode extends Node implements NodeOutputInterface +{ + public function __construct(AbstractExpression $expr, AbstractExpression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) { + $nodes = ['expr' => $expr]; + if (null !== $variables) { + $nodes['variables'] = $variables; + } + + parent::__construct($nodes, ['only' => (bool) $only, 'ignore_missing' => (bool) $ignoreMissing], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if ($this->getAttribute('ignore_missing')) { + $template = $compiler->getVarName(); + + $compiler + ->write(sprintf("$%s = null;\n", $template)) + ->write("try {\n") + ->indent() + ->write(sprintf('$%s = ', $template)) + ; + + $this->addGetTemplate($compiler); + + $compiler + ->raw(";\n") + ->outdent() + ->write("} catch (LoaderError \$e) {\n") + ->indent() + ->write("// ignore missing template\n") + ->outdent() + ->write("}\n") + ->write(sprintf("if ($%s) {\n", $template)) + ->indent() + ->write(sprintf('$%s->display(', $template)) + ; + $this->addTemplateArguments($compiler); + $compiler + ->raw(");\n") + ->outdent() + ->write("}\n") + ; + } else { + $this->addGetTemplate($compiler); + $compiler->raw('->display('); + $this->addTemplateArguments($compiler); + $compiler->raw(");\n"); + } + } + + protected function addGetTemplate(Compiler $compiler) + { + $compiler + ->write('$this->loadTemplate(') + ->subcompile($this->getNode('expr')) + ->raw(', ') + ->repr($this->getTemplateName()) + ->raw(', ') + ->repr($this->getTemplateLine()) + ->raw(')') + ; + } + + protected function addTemplateArguments(Compiler $compiler) + { + if (!$this->hasNode('variables')) { + $compiler->raw(false === $this->getAttribute('only') ? '$context' : '[]'); + } elseif (false === $this->getAttribute('only')) { + $compiler + ->raw('twig_array_merge($context, ') + ->subcompile($this->getNode('variables')) + ->raw(')') + ; + } else { + $compiler->raw('twig_to_array('); + $compiler->subcompile($this->getNode('variables')); + $compiler->raw(')'); + } } } + +class_alias('Twig\Node\IncludeNode', 'Twig_Node_Include'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/MacroNode.php --- a/vendor/twig/twig/src/Node/MacroNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/MacroNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,130 @@ + */ +class MacroNode extends Node +{ + const VARARGS_NAME = 'varargs'; + + public function __construct($name, \Twig_NodeInterface $body, \Twig_NodeInterface $arguments, $lineno, $tag = null) { + foreach ($arguments as $argumentName => $argument) { + if (self::VARARGS_NAME === $argumentName) { + throw new SyntaxError(sprintf('The argument "%s" in macro "%s" cannot be defined because the variable "%s" is reserved for arbitrary arguments.', self::VARARGS_NAME, $name, self::VARARGS_NAME), $argument->getTemplateLine(), $argument->getSourceContext()); + } + } + + parent::__construct(['body' => $body, 'arguments' => $arguments], ['name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf('public function get%s(', $this->getAttribute('name'))) + ; + + $count = \count($this->getNode('arguments')); + $pos = 0; + foreach ($this->getNode('arguments') as $name => $default) { + $compiler + ->raw('$__'.$name.'__ = ') + ->subcompile($default) + ; + + if (++$pos < $count) { + $compiler->raw(', '); + } + } + + if (\PHP_VERSION_ID >= 50600) { + if ($count) { + $compiler->raw(', '); + } + + $compiler->raw('...$__varargs__'); + } + + $compiler + ->raw(")\n") + ->write("{\n") + ->indent() + ; + + $compiler + ->write("\$context = \$this->env->mergeGlobals([\n") + ->indent() + ; + + foreach ($this->getNode('arguments') as $name => $default) { + $compiler + ->write('') + ->string($name) + ->raw(' => $__'.$name.'__') + ->raw(",\n") + ; + } + + $compiler + ->write('') + ->string(self::VARARGS_NAME) + ->raw(' => ') + ; + + if (\PHP_VERSION_ID >= 50600) { + $compiler->raw("\$__varargs__,\n"); + } else { + $compiler + ->raw('func_num_args() > ') + ->repr($count) + ->raw(' ? array_slice(func_get_args(), ') + ->repr($count) + ->raw(") : [],\n") + ; + } + + $compiler + ->outdent() + ->write("]);\n\n") + ->write("\$blocks = [];\n\n") + ->write("ob_start();\n") + ->write("try {\n") + ->indent() + ->subcompile($this->getNode('body')) + ->outdent() + ->write("} catch (\Exception \$e) {\n") + ->indent() + ->write("ob_end_clean();\n\n") + ->write("throw \$e;\n") + ->outdent() + ->write("} catch (\Throwable \$e) {\n") + ->indent() + ->write("ob_end_clean();\n\n") + ->write("throw \$e;\n") + ->outdent() + ->write("}\n\n") + ->write("return ('' === \$tmp = ob_get_clean()) ? '' : new Markup(\$tmp, \$this->env->getCharset());\n") + ->outdent() + ->write("}\n\n") + ; } } + +class_alias('Twig\Node\MacroNode', 'Twig_Node_Macro'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/ModuleNode.php --- a/vendor/twig/twig/src/Node/ModuleNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/ModuleNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,492 @@ + */ +class ModuleNode extends Node +{ + public function __construct(\Twig_NodeInterface $body, AbstractExpression $parent = null, \Twig_NodeInterface $blocks, \Twig_NodeInterface $macros, \Twig_NodeInterface $traits, $embeddedTemplates, $name, $source = '') { + if (!$name instanceof Source) { + @trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + $source = new Source($source, $name); + } else { + $source = $name; + } + + $nodes = [ + 'body' => $body, + 'blocks' => $blocks, + 'macros' => $macros, + 'traits' => $traits, + 'display_start' => new Node(), + 'display_end' => new Node(), + 'constructor_start' => new Node(), + 'constructor_end' => new Node(), + 'class_end' => new Node(), + ]; + if (null !== $parent) { + $nodes['parent'] = $parent; + } + + // embedded templates are set as attributes so that they are only visited once by the visitors + parent::__construct($nodes, [ + // source to be remove in 2.0 + 'source' => $source->getCode(), + // filename to be remove in 2.0 (use getTemplateName() instead) + 'filename' => $source->getName(), + 'index' => null, + 'embedded_templates' => $embeddedTemplates, + ], 1); + + // populate the template name of all node children + $this->setTemplateName($source->getName()); + $this->setSourceContext($source); + } + + public function setIndex($index) + { + $this->setAttribute('index', $index); + } + + public function compile(Compiler $compiler) + { + $this->compileTemplate($compiler); + + foreach ($this->getAttribute('embedded_templates') as $template) { + $compiler->subcompile($template); + } + } + + protected function compileTemplate(Compiler $compiler) + { + if (!$this->getAttribute('index')) { + $compiler->write('compileClassHeader($compiler); + + if ( + \count($this->getNode('blocks')) + || \count($this->getNode('traits')) + || !$this->hasNode('parent') + || $this->getNode('parent') instanceof ConstantExpression + || \count($this->getNode('constructor_start')) + || \count($this->getNode('constructor_end')) + ) { + $this->compileConstructor($compiler); + } + + $this->compileGetParent($compiler); + + $this->compileDisplay($compiler); + + $compiler->subcompile($this->getNode('blocks')); + + $this->compileMacros($compiler); + + $this->compileGetTemplateName($compiler); + + $this->compileIsTraitable($compiler); + + $this->compileDebugInfo($compiler); + + $this->compileGetSource($compiler); + + $this->compileGetSourceContext($compiler); + + $this->compileClassFooter($compiler); + } + + protected function compileGetParent(Compiler $compiler) + { + if (!$this->hasNode('parent')) { + return; + } + $parent = $this->getNode('parent'); + + $compiler + ->write("protected function doGetParent(array \$context)\n", "{\n") + ->indent() + ->addDebugInfo($parent) + ->write('return ') + ; + + if ($parent instanceof ConstantExpression) { + $compiler->subcompile($parent); + } else { + $compiler + ->raw('$this->loadTemplate(') + ->subcompile($parent) + ->raw(', ') + ->repr($this->getSourceContext()->getName()) + ->raw(', ') + ->repr($parent->getTemplateLine()) + ->raw(')') + ; + } + + $compiler + ->raw(";\n") + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileClassHeader(Compiler $compiler) + { + $compiler + ->write("\n\n") + ; + if (!$this->getAttribute('index')) { + $compiler + ->write("use Twig\Environment;\n") + ->write("use Twig\Error\LoaderError;\n") + ->write("use Twig\Error\RuntimeError;\n") + ->write("use Twig\Markup;\n") + ->write("use Twig\Sandbox\SecurityError;\n") + ->write("use Twig\Sandbox\SecurityNotAllowedTagError;\n") + ->write("use Twig\Sandbox\SecurityNotAllowedFilterError;\n") + ->write("use Twig\Sandbox\SecurityNotAllowedFunctionError;\n") + ->write("use Twig\Source;\n") + ->write("use Twig\Template;\n\n") + ; + } + $compiler + // if the template name contains */, add a blank to avoid a PHP parse error + ->write('/* '.str_replace('*/', '* /', $this->getSourceContext()->getName())." */\n") + ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getSourceContext()->getName(), $this->getAttribute('index'))) + ->raw(sprintf(" extends %s\n", $compiler->getEnvironment()->getBaseTemplateClass())) + ->write("{\n") + ->indent() + ; + } + + protected function compileConstructor(Compiler $compiler) + { + $compiler + ->write("public function __construct(Environment \$env)\n", "{\n") + ->indent() + ->subcompile($this->getNode('constructor_start')) + ->write("parent::__construct(\$env);\n\n") + ; + + // parent + if (!$this->hasNode('parent')) { + $compiler->write("\$this->parent = false;\n\n"); + } + + $countTraits = \count($this->getNode('traits')); + if ($countTraits) { + // traits + foreach ($this->getNode('traits') as $i => $trait) { + $this->compileLoadTemplate($compiler, $trait->getNode('template'), sprintf('$_trait_%s', $i)); + + $node = $trait->getNode('template'); + $compiler + ->addDebugInfo($node) + ->write(sprintf("if (!\$_trait_%s->isTraitable()) {\n", $i)) + ->indent() + ->write("throw new RuntimeError('Template \"'.") + ->subcompile($trait->getNode('template')) + ->raw(".'\" cannot be used as a trait.', ") + ->repr($node->getTemplateLine()) + ->raw(", \$this->getSourceContext());\n") + ->outdent() + ->write("}\n") + ->write(sprintf("\$_trait_%s_blocks = \$_trait_%s->getBlocks();\n\n", $i, $i)) + ; + + foreach ($trait->getNode('targets') as $key => $value) { + $compiler + ->write(sprintf('if (!isset($_trait_%s_blocks[', $i)) + ->string($key) + ->raw("])) {\n") + ->indent() + ->write("throw new RuntimeError(sprintf('Block ") + ->string($key) + ->raw(' is not defined in trait ') + ->subcompile($trait->getNode('template')) + ->raw(".'), ") + ->repr($node->getTemplateLine()) + ->raw(", \$this->getSourceContext());\n") + ->outdent() + ->write("}\n\n") + + ->write(sprintf('$_trait_%s_blocks[', $i)) + ->subcompile($value) + ->raw(sprintf('] = $_trait_%s_blocks[', $i)) + ->string($key) + ->raw(sprintf(']; unset($_trait_%s_blocks[', $i)) + ->string($key) + ->raw("]);\n\n") + ; + } + } + + if ($countTraits > 1) { + $compiler + ->write("\$this->traits = array_merge(\n") + ->indent() + ; + + for ($i = 0; $i < $countTraits; ++$i) { + $compiler + ->write(sprintf('$_trait_%s_blocks'.($i == $countTraits - 1 ? '' : ',')."\n", $i)) + ; + } + + $compiler + ->outdent() + ->write(");\n\n") + ; + } else { + $compiler + ->write("\$this->traits = \$_trait_0_blocks;\n\n") + ; + } + + $compiler + ->write("\$this->blocks = array_merge(\n") + ->indent() + ->write("\$this->traits,\n") + ->write("[\n") + ; + } else { + $compiler + ->write("\$this->blocks = [\n") + ; + } + + // blocks + $compiler + ->indent() + ; + + foreach ($this->getNode('blocks') as $name => $node) { + $compiler + ->write(sprintf("'%s' => [\$this, 'block_%s'],\n", $name, $name)) + ; + } + + if ($countTraits) { + $compiler + ->outdent() + ->write("]\n") + ->outdent() + ->write(");\n") + ; + } else { + $compiler + ->outdent() + ->write("];\n") + ; + } + + $compiler + ->subcompile($this->getNode('constructor_end')) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileDisplay(Compiler $compiler) + { + $compiler + ->write("protected function doDisplay(array \$context, array \$blocks = [])\n", "{\n") + ->indent() + ->subcompile($this->getNode('display_start')) + ->subcompile($this->getNode('body')) + ; + + if ($this->hasNode('parent')) { + $parent = $this->getNode('parent'); + + $compiler->addDebugInfo($parent); + if ($parent instanceof ConstantExpression) { + $compiler + ->write('$this->parent = $this->loadTemplate(') + ->subcompile($parent) + ->raw(', ') + ->repr($this->getSourceContext()->getName()) + ->raw(', ') + ->repr($parent->getTemplateLine()) + ->raw(");\n") + ; + $compiler->write('$this->parent'); + } else { + $compiler->write('$this->getParent($context)'); + } + $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); + } + + $compiler + ->subcompile($this->getNode('display_end')) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileClassFooter(Compiler $compiler) + { + $compiler + ->subcompile($this->getNode('class_end')) + ->outdent() + ->write("}\n") + ; + } + + protected function compileMacros(Compiler $compiler) + { + $compiler->subcompile($this->getNode('macros')); + } + + protected function compileGetTemplateName(Compiler $compiler) + { + $compiler + ->write("public function getTemplateName()\n", "{\n") + ->indent() + ->write('return ') + ->repr($this->getSourceContext()->getName()) + ->raw(";\n") + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileIsTraitable(Compiler $compiler) + { + // A template can be used as a trait if: + // * it has no parent + // * it has no macros + // * it has no body + // + // Put another way, a template can be used as a trait if it + // only contains blocks and use statements. + $traitable = !$this->hasNode('parent') && 0 === \count($this->getNode('macros')); + if ($traitable) { + if ($this->getNode('body') instanceof BodyNode) { + $nodes = $this->getNode('body')->getNode(0); + } else { + $nodes = $this->getNode('body'); + } + + if (!\count($nodes)) { + $nodes = new Node([$nodes]); + } + + foreach ($nodes as $node) { + if (!\count($node)) { + continue; + } + + if ($node instanceof TextNode && ctype_space($node->getAttribute('data'))) { + continue; + } + + if ($node instanceof BlockReferenceNode) { + continue; + } + + $traitable = false; + break; + } + } + + if ($traitable) { + return; + } + + $compiler + ->write("public function isTraitable()\n", "{\n") + ->indent() + ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false')) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileDebugInfo(Compiler $compiler) + { + $compiler + ->write("public function getDebugInfo()\n", "{\n") + ->indent() + ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true)))) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileGetSource(Compiler $compiler) + { + $compiler + ->write("/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */\n") + ->write("public function getSource()\n", "{\n") + ->indent() + ->write("@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);\n\n") + ->write('return $this->getSourceContext()->getCode();') + ->raw("\n") + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileGetSourceContext(Compiler $compiler) + { + $compiler + ->write("public function getSourceContext()\n", "{\n") + ->indent() + ->write('return new Source(') + ->string($compiler->getEnvironment()->isDebug() ? $this->getSourceContext()->getCode() : '') + ->raw(', ') + ->string($this->getSourceContext()->getName()) + ->raw(', ') + ->string($this->getSourceContext()->getPath()) + ->raw(");\n") + ->outdent() + ->write("}\n") + ; + } + + protected function compileLoadTemplate(Compiler $compiler, $node, $var) + { + if ($node instanceof ConstantExpression) { + $compiler + ->write(sprintf('%s = $this->loadTemplate(', $var)) + ->subcompile($node) + ->raw(', ') + ->repr($node->getTemplateName()) + ->raw(', ') + ->repr($node->getTemplateLine()) + ->raw(");\n") + ; + } else { + throw new \LogicException('Trait templates can only be constant nodes.'); + } } } + +class_alias('Twig\Node\ModuleNode', 'Twig_Node_Module'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/Node.php --- a/vendor/twig/twig/src/Node/Node.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/Node.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,274 @@ + */ +class Node implements \Twig_NodeInterface +{ + protected $nodes; + protected $attributes; + protected $lineno; + protected $tag; + + private $name; + private $sourceContext; + + /** + * @param array $nodes An array of named nodes + * @param array $attributes An array of attributes (should not be nodes) + * @param int $lineno The line number + * @param string $tag The tag name associated with the Node + */ + public function __construct(array $nodes = [], array $attributes = [], $lineno = 0, $tag = null) { + foreach ($nodes as $name => $node) { + if (!$node instanceof \Twig_NodeInterface) { + @trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : null === $node ? 'null' : \gettype($node), $name, \get_class($this)), E_USER_DEPRECATED); + } + } + $this->nodes = $nodes; + $this->attributes = $attributes; + $this->lineno = $lineno; + $this->tag = $tag; + } + + public function __toString() + { + $attributes = []; + foreach ($this->attributes as $name => $value) { + $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true))); + } + + $repr = [\get_class($this).'('.implode(', ', $attributes)]; + + if (\count($this->nodes)) { + foreach ($this->nodes as $name => $node) { + $len = \strlen($name) + 4; + $noderepr = []; + foreach (explode("\n", (string) $node) as $line) { + $noderepr[] = str_repeat(' ', $len).$line; + } + + $repr[] = sprintf(' %s: %s', $name, ltrim(implode("\n", $noderepr))); + } + + $repr[] = ')'; + } else { + $repr[0] .= ')'; + } + + return implode("\n", $repr); + } + + /** + * @deprecated since 1.16.1 (to be removed in 2.0) + */ + public function toXml($asDom = false) + { + @trigger_error(sprintf('%s is deprecated since version 1.16.1 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); + + $dom = new \DOMDocument('1.0', 'UTF-8'); + $dom->formatOutput = true; + $dom->appendChild($xml = $dom->createElement('twig')); + + $xml->appendChild($node = $dom->createElement('node')); + $node->setAttribute('class', \get_class($this)); + + foreach ($this->attributes as $name => $value) { + $node->appendChild($attribute = $dom->createElement('attribute')); + $attribute->setAttribute('name', $name); + $attribute->appendChild($dom->createTextNode($value)); + } + + foreach ($this->nodes as $name => $n) { + if (null === $n) { + continue; + } + + $child = $n->toXml(true)->getElementsByTagName('node')->item(0); + $child = $dom->importNode($child, true); + $child->setAttribute('name', $name); + + $node->appendChild($child); + } + + return $asDom ? $dom : $dom->saveXML(); + } + + public function compile(Compiler $compiler) + { + foreach ($this->nodes as $node) { + $node->compile($compiler); + } + } + + public function getTemplateLine() + { + return $this->lineno; + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getLine() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateLine() instead.', E_USER_DEPRECATED); + + return $this->lineno; + } + + public function getNodeTag() + { + return $this->tag; + } + + /** + * @return bool + */ + public function hasAttribute($name) + { + return \array_key_exists($name, $this->attributes); + } + + /** + * @return mixed + */ + public function getAttribute($name) + { + if (!\array_key_exists($name, $this->attributes)) { + throw new \LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, \get_class($this))); + } + + return $this->attributes[$name]; + } + + /** + * @param string $name + * @param mixed $value + */ + public function setAttribute($name, $value) + { + $this->attributes[$name] = $value; + } + + public function removeAttribute($name) + { + unset($this->attributes[$name]); + } + + /** + * @return bool + */ + public function hasNode($name) + { + return \array_key_exists($name, $this->nodes); + } + + /** + * @return Node + */ + public function getNode($name) + { + if (!\array_key_exists($name, $this->nodes)) { + throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, \get_class($this))); + } + + return $this->nodes[$name]; + } + + public function setNode($name, $node = null) + { + if (!$node instanceof \Twig_NodeInterface) { + @trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : null === $node ? 'null' : \gettype($node), $name, \get_class($this)), E_USER_DEPRECATED); + } + + $this->nodes[$name] = $node; + } + + public function removeNode($name) + { + unset($this->nodes[$name]); + } + + public function count() + { + return \count($this->nodes); + } + + public function getIterator() + { + return new \ArrayIterator($this->nodes); + } + + public function setTemplateName($name) + { + $this->name = $name; + foreach ($this->nodes as $node) { + if (null !== $node) { + $node->setTemplateName($name); + } + } + } + + public function getTemplateName() + { + return $this->name; + } + + public function setSourceContext(Source $source) + { + $this->sourceContext = $source; + foreach ($this->nodes as $node) { + if ($node instanceof Node) { + $node->setSourceContext($source); + } + } + } + + public function getSourceContext() + { + return $this->sourceContext; + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function setFilename($name) + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use setTemplateName() instead.', E_USER_DEPRECATED); + + $this->setTemplateName($name); + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getFilename() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateName() instead.', E_USER_DEPRECATED); + + return $this->name; } } + +class_alias('Twig\Node\Node', 'Twig_Node'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Compiler'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/NodeCaptureInterface.php --- a/vendor/twig/twig/src/Node/NodeCaptureInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/NodeCaptureInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,23 @@ + */ +interface NodeCaptureInterface +{ +} -if (\false) { - interface NodeCaptureInterface extends \Twig_NodeCaptureInterface - { - } -} +class_alias('Twig\Node\NodeCaptureInterface', 'Twig_NodeCaptureInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/NodeOutputInterface.php --- a/vendor/twig/twig/src/Node/NodeOutputInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/NodeOutputInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,23 @@ + */ +interface NodeOutputInterface +{ +} -if (\false) { - interface NodeOutputInterface extends \Twig_NodeOutputInterface - { - } -} +class_alias('Twig\Node\NodeOutputInterface', 'Twig_NodeOutputInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/PrintNode.php --- a/vendor/twig/twig/src/Node/PrintNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/PrintNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,41 @@ + */ +class PrintNode extends Node implements NodeOutputInterface +{ + public function __construct(AbstractExpression $expr, $lineno, $tag = null) { + parent::__construct(['expr' => $expr], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('echo ') + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ; } } + +class_alias('Twig\Node\PrintNode', 'Twig_Node_Print'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/SandboxNode.php --- a/vendor/twig/twig/src/Node/SandboxNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/SandboxNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,47 @@ + */ +class SandboxNode extends Node +{ + public function __construct(\Twig_NodeInterface $body, $lineno, $tag = null) { + parent::__construct(['body' => $body], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("if (!\$alreadySandboxed = \$this->sandbox->isSandboxed()) {\n") + ->indent() + ->write("\$this->sandbox->enableSandbox();\n") + ->outdent() + ->write("}\n") + ->subcompile($this->getNode('body')) + ->write("if (!\$alreadySandboxed) {\n") + ->indent() + ->write("\$this->sandbox->disableSandbox();\n") + ->outdent() + ->write("}\n") + ; } } + +class_alias('Twig\Node\SandboxNode', 'Twig_Node_Sandbox'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/SandboxedPrintNode.php --- a/vendor/twig/twig/src/Node/SandboxedPrintNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/SandboxedPrintNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,69 @@ + */ +class SandboxedPrintNode extends PrintNode +{ + public function compile(Compiler $compiler) { + $compiler + ->addDebugInfo($this) + ->write('echo ') + ; + $expr = $this->getNode('expr'); + if ($expr instanceof ConstantExpression) { + $compiler + ->subcompile($expr) + ->raw(";\n") + ; + } else { + $compiler + ->write('$this->env->getExtension(\'\Twig\Extension\SandboxExtension\')->ensureToStringAllowed(') + ->subcompile($expr) + ->raw(");\n") + ; + } + } + + /** + * Removes node filters. + * + * This is mostly needed when another visitor adds filters (like the escaper one). + * + * @return Node + */ + protected function removeNodeFilter(Node $node) + { + if ($node instanceof FilterExpression) { + return $this->removeNodeFilter($node->getNode('node')); + } + + return $node; } } + +class_alias('Twig\Node\SandboxedPrintNode', 'Twig_Node_SandboxedPrint'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/SetNode.php --- a/vendor/twig/twig/src/Node/SetNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/SetNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,103 @@ + */ +class SetNode extends Node implements NodeCaptureInterface +{ + public function __construct($capture, \Twig_NodeInterface $names, \Twig_NodeInterface $values, $lineno, $tag = null) { + parent::__construct(['names' => $names, 'values' => $values], ['capture' => $capture, 'safe' => false], $lineno, $tag); + + /* + * Optimizes the node when capture is used for a large block of text. + * + * {% set foo %}foo{% endset %} is compiled to $context['foo'] = new Twig\Markup("foo"); + */ + if ($this->getAttribute('capture')) { + $this->setAttribute('safe', true); + + $values = $this->getNode('values'); + if ($values instanceof TextNode) { + $this->setNode('values', new ConstantExpression($values->getAttribute('data'), $values->getTemplateLine())); + $this->setAttribute('capture', false); + } + } + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if (\count($this->getNode('names')) > 1) { + $compiler->write('list('); + foreach ($this->getNode('names') as $idx => $node) { + if ($idx) { + $compiler->raw(', '); + } + + $compiler->subcompile($node); + } + $compiler->raw(')'); + } else { + if ($this->getAttribute('capture')) { + $compiler + ->write("ob_start();\n") + ->subcompile($this->getNode('values')) + ; + } + + $compiler->subcompile($this->getNode('names'), false); + + if ($this->getAttribute('capture')) { + $compiler->raw(" = ('' === \$tmp = ob_get_clean()) ? '' : new Markup(\$tmp, \$this->env->getCharset())"); + } + } + + if (!$this->getAttribute('capture')) { + $compiler->raw(' = '); + + if (\count($this->getNode('names')) > 1) { + $compiler->write('['); + foreach ($this->getNode('values') as $idx => $value) { + if ($idx) { + $compiler->raw(', '); + } + + $compiler->subcompile($value); + } + $compiler->raw(']'); + } else { + if ($this->getAttribute('safe')) { + $compiler + ->raw("('' === \$tmp = ") + ->subcompile($this->getNode('values')) + ->raw(") ? '' : new Markup(\$tmp, \$this->env->getCharset())") + ; + } else { + $compiler->subcompile($this->getNode('values')); + } + } + } + + $compiler->raw(";\n"); } } + +class_alias('Twig\Node\SetNode', 'Twig_Node_Set'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/SetTempNode.php --- a/vendor/twig/twig/src/Node/SetTempNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/SetTempNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,44 @@ $name], $lineno); + } + + public function compile(Compiler $compiler) + { + $name = $this->getAttribute('name'); + $compiler + ->addDebugInfo($this) + ->write('if (isset($context[') + ->string($name) + ->raw('])) { $_') + ->raw($name) + ->raw('_ = $context[') + ->repr($name) + ->raw(']; } else { $_') + ->raw($name) + ->raw("_ = null; }\n") + ; } } + +class_alias('Twig\Node\SetTempNode', 'Twig_Node_SetTemp'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/SpacelessNode.php --- a/vendor/twig/twig/src/Node/SpacelessNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/SpacelessNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,41 @@ + */ +class SpacelessNode extends Node +{ + public function __construct(\Twig_NodeInterface $body, $lineno, $tag = 'spaceless') { + parent::__construct(['body' => $body], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("ob_start();\n") + ->subcompile($this->getNode('body')) + ->write("echo trim(preg_replace('/>\s+<', ob_get_clean()));\n") + ; } } + +class_alias('Twig\Node\SpacelessNode', 'Twig_Node_Spaceless'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/TextNode.php --- a/vendor/twig/twig/src/Node/TextNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/TextNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,40 @@ + */ +class TextNode extends Node implements NodeOutputInterface +{ + public function __construct($data, $lineno) { + parent::__construct([], ['data' => $data], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('echo ') + ->string($this->getAttribute('data')) + ->raw(";\n") + ; } } + +class_alias('Twig\Node\TextNode', 'Twig_Node_Text'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Node/WithNode.php --- a/vendor/twig/twig/src/Node/WithNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Node/WithNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,72 @@ + */ +class WithNode extends Node +{ + public function __construct(Node $body, Node $variables = null, $only = false, $lineno, $tag = null) { + $nodes = ['body' => $body]; + if (null !== $variables) { + $nodes['variables'] = $variables; + } + + parent::__construct($nodes, ['only' => (bool) $only], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if ($this->hasNode('variables')) { + $node = $this->getNode('variables'); + $varsName = $compiler->getVarName(); + $compiler + ->write(sprintf('$%s = ', $varsName)) + ->subcompile($node) + ->raw(";\n") + ->write(sprintf("if (!twig_test_iterable(\$%s)) {\n", $varsName)) + ->indent() + ->write("throw new RuntimeError('Variables passed to the \"with\" tag must be a hash.', ") + ->repr($node->getTemplateLine()) + ->raw(", \$this->getSourceContext());\n") + ->outdent() + ->write("}\n") + ->write(sprintf("\$%s = twig_to_array(\$%s);\n", $varsName, $varsName)) + ; + + if ($this->getAttribute('only')) { + $compiler->write("\$context = ['_parent' => \$context];\n"); + } else { + $compiler->write("\$context['_parent'] = \$context;\n"); + } + + $compiler->write(sprintf("\$context = \$this->env->mergeGlobals(array_merge(\$context, \$%s));\n", $varsName)); + } else { + $compiler->write("\$context['_parent'] = \$context;\n"); + } + + $compiler + ->subcompile($this->getNode('body')) + ->write("\$context = \$context['_parent'];\n") + ; } } + +class_alias('Twig\Node\WithNode', 'Twig_Node_With'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/NodeTraverser.php --- a/vendor/twig/twig/src/NodeTraverser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/NodeTraverser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,89 @@ + */ +class NodeTraverser +{ + protected $env; + protected $visitors = []; + + /** + * @param NodeVisitorInterface[] $visitors + */ + public function __construct(Environment $env, array $visitors = []) { + $this->env = $env; + foreach ($visitors as $visitor) { + $this->addVisitor($visitor); + } + } + + public function addVisitor(NodeVisitorInterface $visitor) + { + $this->visitors[$visitor->getPriority()][] = $visitor; + } + + /** + * Traverses a node and calls the registered visitors. + * + * @return \Twig_NodeInterface + */ + public function traverse(\Twig_NodeInterface $node) + { + ksort($this->visitors); + foreach ($this->visitors as $visitors) { + foreach ($visitors as $visitor) { + $node = $this->traverseForVisitor($visitor, $node); + } + } + + return $node; + } + + protected function traverseForVisitor(NodeVisitorInterface $visitor, \Twig_NodeInterface $node = null) + { + if (null === $node) { + return; + } + + $node = $visitor->enterNode($node, $this->env); + + foreach ($node as $k => $n) { + if (null === $n) { + continue; + } + + if (false !== ($m = $this->traverseForVisitor($visitor, $n)) && null !== $m) { + if ($m !== $n) { + $node->setNode($k, $m); + } + } else { + $node->removeNode($k); + } + } + + return $visitor->leaveNode($node, $this->env); } } + +class_alias('Twig\NodeTraverser', 'Twig_NodeTraverser'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php --- a/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,59 @@ + */ +abstract class AbstractNodeVisitor implements NodeVisitorInterface +{ + final public function enterNode(\Twig_NodeInterface $node, Environment $env) { + if (!$node instanceof Node) { + throw new \LogicException(sprintf('%s only supports \Twig\Node\Node instances.', __CLASS__)); + } + + return $this->doEnterNode($node, $env); } + + final public function leaveNode(\Twig_NodeInterface $node, Environment $env) + { + if (!$node instanceof Node) { + throw new \LogicException(sprintf('%s only supports \Twig\Node\Node instances.', __CLASS__)); + } + + return $this->doLeaveNode($node, $env); + } + + /** + * Called before child nodes are visited. + * + * @return Node The modified node + */ + abstract protected function doEnterNode(Node $node, Environment $env); + + /** + * Called after child nodes are visited. + * + * @return Node|false|null The modified node or null if the node must be removed + */ + abstract protected function doLeaveNode(Node $node, Environment $env); } + +class_alias('Twig\NodeVisitor\AbstractNodeVisitor', 'Twig_BaseNodeVisitor'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php --- a/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,209 @@ + */ +class EscaperNodeVisitor extends AbstractNodeVisitor +{ + protected $statusStack = []; + protected $blocks = []; + protected $safeAnalysis; + protected $traverser; + protected $defaultStrategy = false; + protected $safeVars = []; + + public function __construct() { + $this->safeAnalysis = new SafeAnalysisNodeVisitor(); + } + + protected function doEnterNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + if ($env->hasExtension('\Twig\Extension\EscaperExtension') && $defaultStrategy = $env->getExtension('\Twig\Extension\EscaperExtension')->getDefaultStrategy($node->getTemplateName())) { + $this->defaultStrategy = $defaultStrategy; + } + $this->safeVars = []; + $this->blocks = []; + } elseif ($node instanceof AutoEscapeNode) { + $this->statusStack[] = $node->getAttribute('value'); + } elseif ($node instanceof BlockNode) { + $this->statusStack[] = isset($this->blocks[$node->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env); + } elseif ($node instanceof ImportNode) { + $this->safeVars[] = $node->getNode('var')->getAttribute('name'); + } + + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + $this->defaultStrategy = false; + $this->safeVars = []; + $this->blocks = []; + } elseif ($node instanceof FilterExpression) { + return $this->preEscapeFilterNode($node, $env); + } elseif ($node instanceof PrintNode && false !== $type = $this->needEscaping($env)) { + $expression = $node->getNode('expr'); + if ($expression instanceof ConditionalExpression && $this->shouldUnwrapConditional($expression, $env, $type)) { + return new DoNode($this->unwrapConditional($expression, $env, $type), $expression->getTemplateLine()); + } + + return $this->escapePrintNode($node, $env, $type); + } + + if ($node instanceof AutoEscapeNode || $node instanceof BlockNode) { + array_pop($this->statusStack); + } elseif ($node instanceof BlockReferenceNode) { + $this->blocks[$node->getAttribute('name')] = $this->needEscaping($env); + } + + return $node; + } + + private function shouldUnwrapConditional(ConditionalExpression $expression, Environment $env, $type) + { + $expr2Safe = $this->isSafeFor($type, $expression->getNode('expr2'), $env); + $expr3Safe = $this->isSafeFor($type, $expression->getNode('expr3'), $env); + + return $expr2Safe !== $expr3Safe; + } + + private function unwrapConditional(ConditionalExpression $expression, Environment $env, $type) + { + // convert "echo a ? b : c" to "a ? echo b : echo c" recursively + $expr2 = $expression->getNode('expr2'); + if ($expr2 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr2, $env, $type)) { + $expr2 = $this->unwrapConditional($expr2, $env, $type); + } else { + $expr2 = $this->escapeInlinePrintNode(new InlinePrint($expr2, $expr2->getTemplateLine()), $env, $type); + } + $expr3 = $expression->getNode('expr3'); + if ($expr3 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr3, $env, $type)) { + $expr3 = $this->unwrapConditional($expr3, $env, $type); + } else { + $expr3 = $this->escapeInlinePrintNode(new InlinePrint($expr3, $expr3->getTemplateLine()), $env, $type); + } + + return new ConditionalExpression($expression->getNode('expr1'), $expr2, $expr3, $expression->getTemplateLine()); + } + + private function escapeInlinePrintNode(InlinePrint $node, Environment $env, $type) + { + $expression = $node->getNode('node'); + + if ($this->isSafeFor($type, $expression, $env)) { + return $node; + } + + return new InlinePrint($this->getEscaperFilter($type, $expression), $node->getTemplateLine()); + } + + protected function escapePrintNode(PrintNode $node, Environment $env, $type) + { + if (false === $type) { + return $node; + } + + $expression = $node->getNode('expr'); + + if ($this->isSafeFor($type, $expression, $env)) { + return $node; + } + + $class = \get_class($node); + + return new $class($this->getEscaperFilter($type, $expression), $node->getTemplateLine()); + } + + protected function preEscapeFilterNode(FilterExpression $filter, Environment $env) + { + $name = $filter->getNode('filter')->getAttribute('value'); + + $type = $env->getFilter($name)->getPreEscape(); + if (null === $type) { + return $filter; + } + + $node = $filter->getNode('node'); + if ($this->isSafeFor($type, $node, $env)) { + return $filter; + } + + $filter->setNode('node', $this->getEscaperFilter($type, $node)); + + return $filter; + } + + protected function isSafeFor($type, \Twig_NodeInterface $expression, $env) + { + $safe = $this->safeAnalysis->getSafe($expression); + + if (null === $safe) { + if (null === $this->traverser) { + $this->traverser = new NodeTraverser($env, [$this->safeAnalysis]); + } + + $this->safeAnalysis->setSafeVars($this->safeVars); + + $this->traverser->traverse($expression); + $safe = $this->safeAnalysis->getSafe($expression); + } + + return \in_array($type, $safe) || \in_array('all', $safe); + } + + protected function needEscaping(Environment $env) + { + if (\count($this->statusStack)) { + return $this->statusStack[\count($this->statusStack) - 1]; + } + + return $this->defaultStrategy ? $this->defaultStrategy : false; + } + + protected function getEscaperFilter($type, \Twig_NodeInterface $node) + { + $line = $node->getTemplateLine(); + $name = new ConstantExpression('escape', $line); + $args = new Node([new ConstantExpression((string) $type, $line), new ConstantExpression(null, $line), new ConstantExpression(true, $line)]); + + return new FilterExpression($node, $name, $args, $line); + } + + public function getPriority() + { + return 0; } } + +class_alias('Twig\NodeVisitor\EscaperNodeVisitor', 'Twig_NodeVisitor_Escaper'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php --- a/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,50 @@ + */ +interface NodeVisitorInterface +{ + /** + * Called before child nodes are visited. + * + * @return \Twig_NodeInterface The modified node + */ + public function enterNode(\Twig_NodeInterface $node, Environment $env); + + /** + * Called after child nodes are visited. + * + * @return \Twig_NodeInterface|false|null The modified node or null if the node must be removed + */ + public function leaveNode(\Twig_NodeInterface $node, Environment $env); + + /** + * Returns the priority for this visitor. + * + * Priority should be between -10 and 10 (0 is the default). + * + * @return int The priority level + */ + public function getPriority(); } + +class_alias('Twig\NodeVisitor\NodeVisitorInterface', 'Twig_NodeVisitorInterface'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Environment'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php --- a/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,273 @@ + */ +class OptimizerNodeVisitor extends AbstractNodeVisitor +{ + const OPTIMIZE_ALL = -1; + const OPTIMIZE_NONE = 0; + const OPTIMIZE_FOR = 2; + const OPTIMIZE_RAW_FILTER = 4; + const OPTIMIZE_VAR_ACCESS = 8; + + protected $loops = []; + protected $loopsTargets = []; + protected $optimizers; + protected $prependedNodes = []; + protected $inABody = false; + + /** + * @param int $optimizers The optimizer mode + */ + public function __construct($optimizers = -1) { + if (!\is_int($optimizers) || $optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER | self::OPTIMIZE_VAR_ACCESS)) { + throw new \InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers)); + } + + $this->optimizers = $optimizers; + } + + protected function doEnterNode(Node $node, Environment $env) + { + if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { + $this->enterOptimizeFor($node, $env); + } + + if (\PHP_VERSION_ID < 50400 && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('\Twig\Extension\SandboxExtension')) { + if ($this->inABody) { + if (!$node instanceof AbstractExpression) { + if ('Twig_Node' !== \get_class($node)) { + array_unshift($this->prependedNodes, []); + } + } else { + $node = $this->optimizeVariables($node, $env); + } + } elseif ($node instanceof BodyNode) { + $this->inABody = true; + } + } + + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + $expression = $node instanceof AbstractExpression; + + if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { + $this->leaveOptimizeFor($node, $env); + } + + if (self::OPTIMIZE_RAW_FILTER === (self::OPTIMIZE_RAW_FILTER & $this->optimizers)) { + $node = $this->optimizeRawFilter($node, $env); + } + + $node = $this->optimizePrintNode($node, $env); + + if (self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('\Twig\Extension\SandboxExtension')) { + if ($node instanceof BodyNode) { + $this->inABody = false; + } elseif ($this->inABody) { + if (!$expression && 'Twig_Node' !== \get_class($node) && $prependedNodes = array_shift($this->prependedNodes)) { + $nodes = []; + foreach (array_unique($prependedNodes) as $name) { + $nodes[] = new SetTempNode($name, $node->getTemplateLine()); + } + + $nodes[] = $node; + $node = new Node($nodes); + } + } + } + + return $node; + } + + protected function optimizeVariables(\Twig_NodeInterface $node, Environment $env) + { + if ('Twig_Node_Expression_Name' === \get_class($node) && $node->isSimple()) { + $this->prependedNodes[0][] = $node->getAttribute('name'); + + return new TempNameExpression($node->getAttribute('name'), $node->getTemplateLine()); + } + + return $node; + } + + /** + * Optimizes print nodes. + * + * It replaces: + * + * * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()" + * + * @return \Twig_NodeInterface + */ + protected function optimizePrintNode(\Twig_NodeInterface $node, Environment $env) + { + if (!$node instanceof PrintNode) { + return $node; + } + + $exprNode = $node->getNode('expr'); + if ( + $exprNode instanceof BlockReferenceExpression || + $exprNode instanceof ParentExpression + ) { + $exprNode->setAttribute('output', true); + + return $exprNode; + } + + return $node; + } + + /** + * Removes "raw" filters. + * + * @return \Twig_NodeInterface + */ + protected function optimizeRawFilter(\Twig_NodeInterface $node, Environment $env) + { + if ($node instanceof FilterExpression && 'raw' == $node->getNode('filter')->getAttribute('value')) { + return $node->getNode('node'); + } + + return $node; + } + + /** + * Optimizes "for" tag by removing the "loop" variable creation whenever possible. + */ + protected function enterOptimizeFor(\Twig_NodeInterface $node, Environment $env) + { + if ($node instanceof ForNode) { + // disable the loop variable by default + $node->setAttribute('with_loop', false); + array_unshift($this->loops, $node); + array_unshift($this->loopsTargets, $node->getNode('value_target')->getAttribute('name')); + array_unshift($this->loopsTargets, $node->getNode('key_target')->getAttribute('name')); + } elseif (!$this->loops) { + // we are outside a loop + return; + } + + // when do we need to add the loop variable back? + + // the loop variable is referenced for the current loop + elseif ($node instanceof NameExpression && 'loop' === $node->getAttribute('name')) { + $node->setAttribute('always_defined', true); + $this->addLoopToCurrent(); + } + + // optimize access to loop targets + elseif ($node instanceof NameExpression && \in_array($node->getAttribute('name'), $this->loopsTargets)) { + $node->setAttribute('always_defined', true); + } + + // block reference + elseif ($node instanceof BlockReferenceNode || $node instanceof BlockReferenceExpression) { + $this->addLoopToCurrent(); + } + + // include without the only attribute + elseif ($node instanceof IncludeNode && !$node->getAttribute('only')) { + $this->addLoopToAll(); + } + + // include function without the with_context=false parameter + elseif ($node instanceof FunctionExpression + && 'include' === $node->getAttribute('name') + && (!$node->getNode('arguments')->hasNode('with_context') + || false !== $node->getNode('arguments')->getNode('with_context')->getAttribute('value') + ) + ) { + $this->addLoopToAll(); + } + + // the loop variable is referenced via an attribute + elseif ($node instanceof GetAttrExpression + && (!$node->getNode('attribute') instanceof ConstantExpression + || 'parent' === $node->getNode('attribute')->getAttribute('value') + ) + && (true === $this->loops[0]->getAttribute('with_loop') + || ($node->getNode('node') instanceof NameExpression + && 'loop' === $node->getNode('node')->getAttribute('name') + ) + ) + ) { + $this->addLoopToAll(); + } + } + + /** + * Optimizes "for" tag by removing the "loop" variable creation whenever possible. + */ + protected function leaveOptimizeFor(\Twig_NodeInterface $node, Environment $env) + { + if ($node instanceof ForNode) { + array_shift($this->loops); + array_shift($this->loopsTargets); + array_shift($this->loopsTargets); + } + } + + protected function addLoopToCurrent() + { + $this->loops[0]->setAttribute('with_loop', true); + } + + protected function addLoopToAll() + { + foreach ($this->loops as $loop) { + $loop->setAttribute('with_loop', true); + } + } + + public function getPriority() + { + return 255; } } + +class_alias('Twig\NodeVisitor\OptimizerNodeVisitor', 'Twig_NodeVisitor_Optimizer'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php --- a/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,164 @@ safeVars = $safeVars; + } + + public function getSafe(\Twig_NodeInterface $node) + { + $hash = spl_object_hash($node); + if (!isset($this->data[$hash])) { + return; + } + + foreach ($this->data[$hash] as $bucket) { + if ($bucket['key'] !== $node) { + continue; + } + + if (\in_array('html_attr', $bucket['value'])) { + $bucket['value'][] = 'html'; + } + + return $bucket['value']; + } + } + + protected function setSafe(\Twig_NodeInterface $node, array $safe) + { + $hash = spl_object_hash($node); + if (isset($this->data[$hash])) { + foreach ($this->data[$hash] as &$bucket) { + if ($bucket['key'] === $node) { + $bucket['value'] = $safe; + + return; + } + } + } + $this->data[$hash][] = [ + 'key' => $node, + 'value' => $safe, + ]; + } + + protected function doEnterNode(Node $node, Environment $env) + { + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + if ($node instanceof ConstantExpression) { + // constants are marked safe for all + $this->setSafe($node, ['all']); + } elseif ($node instanceof BlockReferenceExpression) { + // blocks are safe by definition + $this->setSafe($node, ['all']); + } elseif ($node instanceof ParentExpression) { + // parent block is safe by definition + $this->setSafe($node, ['all']); + } elseif ($node instanceof ConditionalExpression) { + // intersect safeness of both operands + $safe = $this->intersectSafe($this->getSafe($node->getNode('expr2')), $this->getSafe($node->getNode('expr3'))); + $this->setSafe($node, $safe); + } elseif ($node instanceof FilterExpression) { + // filter expression is safe when the filter is safe + $name = $node->getNode('filter')->getAttribute('value'); + $args = $node->getNode('arguments'); + if (false !== $filter = $env->getFilter($name)) { + $safe = $filter->getSafe($args); + if (null === $safe) { + $safe = $this->intersectSafe($this->getSafe($node->getNode('node')), $filter->getPreservesSafety()); + } + $this->setSafe($node, $safe); + } else { + $this->setSafe($node, []); + } + } elseif ($node instanceof FunctionExpression) { + // function expression is safe when the function is safe + $name = $node->getAttribute('name'); + $args = $node->getNode('arguments'); + $function = $env->getFunction($name); + if (false !== $function) { + $this->setSafe($node, $function->getSafe($args)); + } else { + $this->setSafe($node, []); + } + } elseif ($node instanceof MethodCallExpression) { + if ($node->getAttribute('safe')) { + $this->setSafe($node, ['all']); + } else { + $this->setSafe($node, []); + } + } elseif ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression) { + $name = $node->getNode('node')->getAttribute('name'); + // attributes on template instances are safe + if ('_self' == $name || \in_array($name, $this->safeVars)) { + $this->setSafe($node, ['all']); + } else { + $this->setSafe($node, []); + } + } else { + $this->setSafe($node, []); + } + + return $node; + } + + protected function intersectSafe(array $a = null, array $b = null) + { + if (null === $a || null === $b) { + return []; + } + + if (\in_array('all', $a)) { + return $b; + } + + if (\in_array('all', $b)) { + return $a; + } + + return array_intersect($a, $b); + } + + public function getPriority() + { + return 0; } } + +class_alias('Twig\NodeVisitor\SafeAnalysisNodeVisitor', 'Twig_NodeVisitor_SafeAnalysis'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php --- a/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,137 @@ + */ +class SandboxNodeVisitor extends AbstractNodeVisitor +{ + protected $inAModule = false; + protected $tags; + protected $filters; + protected $functions; + + private $needsToStringWrap = false; + + protected function doEnterNode(Node $node, Environment $env) { + if ($node instanceof ModuleNode) { + $this->inAModule = true; + $this->tags = []; + $this->filters = []; + $this->functions = []; + + return $node; + } elseif ($this->inAModule) { + // look for tags + if ($node->getNodeTag() && !isset($this->tags[$node->getNodeTag()])) { + $this->tags[$node->getNodeTag()] = $node; + } + + // look for filters + if ($node instanceof FilterExpression && !isset($this->filters[$node->getNode('filter')->getAttribute('value')])) { + $this->filters[$node->getNode('filter')->getAttribute('value')] = $node; + } + + // look for functions + if ($node instanceof FunctionExpression && !isset($this->functions[$node->getAttribute('name')])) { + $this->functions[$node->getAttribute('name')] = $node; + } + + // the .. operator is equivalent to the range() function + if ($node instanceof RangeBinary && !isset($this->functions['range'])) { + $this->functions['range'] = $node; + } + + if ($node instanceof PrintNode) { + $this->needsToStringWrap = true; + $this->wrapNode($node, 'expr'); + } + + if ($node instanceof SetNode && !$node->getAttribute('capture')) { + $this->needsToStringWrap = true; + } + + // wrap outer nodes that can implicitly call __toString() + if ($this->needsToStringWrap) { + if ($node instanceof ConcatBinary) { + $this->wrapNode($node, 'left'); + $this->wrapNode($node, 'right'); + } + if ($node instanceof FilterExpression) { + $this->wrapNode($node, 'node'); + $this->wrapArrayNode($node, 'arguments'); + } + if ($node instanceof FunctionExpression) { + $this->wrapArrayNode($node, 'arguments'); + } + } + } + + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + $this->inAModule = false; + + $node->setNode('constructor_end', new Node([new CheckSecurityNode($this->filters, $this->tags, $this->functions), $node->getNode('display_start')])); + } elseif ($this->inAModule) { + if ($node instanceof PrintNode || $node instanceof SetNode) { + $this->needsToStringWrap = false; + } + } + + return $node; + } + + private function wrapNode(Node $node, $name) + { + $expr = $node->getNode($name); + if ($expr instanceof NameExpression || $expr instanceof GetAttrExpression) { + $node->setNode($name, new CheckToStringNode($expr)); + } + } + + private function wrapArrayNode(Node $node, $name) + { + $args = $node->getNode($name); + foreach ($args as $name => $_) { + $this->wrapNode($args, $name); + } + } + + public function getPriority() + { + return 0; } } + +class_alias('Twig\NodeVisitor\SandboxNodeVisitor', 'Twig_NodeVisitor_Sandbox'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Parser.php --- a/vendor/twig/twig/src/Parser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Parser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,431 @@ + */ +class Parser implements \Twig_ParserInterface +{ + protected $stack = []; + protected $stream; + protected $parent; + protected $handlers; + protected $visitors; + protected $expressionParser; + protected $blocks; + protected $blockStack; + protected $macros; + protected $env; + protected $reservedMacroNames; + protected $importedSymbols; + protected $traits; + protected $embeddedTemplates = []; + private $varNameSalt = 0; + + public function __construct(Environment $env) { + $this->env = $env; + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getEnvironment() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); + + return $this->env; + } + + public function getVarName() + { + return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->stream->getSourceContext()->getCode().$this->varNameSalt++)); + } + + /** + * @deprecated since 1.27 (to be removed in 2.0). Use $parser->getStream()->getSourceContext()->getPath() instead. + */ + public function getFilename() + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use $parser->getStream()->getSourceContext()->getPath() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->stream->getSourceContext()->getName(); + } + + public function parse(TokenStream $stream, $test = null, $dropNeedle = false) + { + // push all variables into the stack to keep the current state of the parser + // using get_object_vars() instead of foreach would lead to https://bugs.php.net/71336 + // This hack can be removed when min version if PHP 7.0 + $vars = []; + foreach ($this as $k => $v) { + $vars[$k] = $v; + } + + unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames']); + $this->stack[] = $vars; + + // tag handlers + if (null === $this->handlers) { + $this->handlers = $this->env->getTokenParsers(); + $this->handlers->setParser($this); + } + + // node visitors + if (null === $this->visitors) { + $this->visitors = $this->env->getNodeVisitors(); + } + + if (null === $this->expressionParser) { + $this->expressionParser = new ExpressionParser($this, $this->env); + } + + $this->stream = $stream; + $this->parent = null; + $this->blocks = []; + $this->macros = []; + $this->traits = []; + $this->blockStack = []; + $this->importedSymbols = [[]]; + $this->embeddedTemplates = []; + $this->varNameSalt = 0; + + try { + $body = $this->subparse($test, $dropNeedle); + + if (null !== $this->parent && null === $body = $this->filterBodyNodes($body)) { + $body = new Node(); + } + } catch (SyntaxError $e) { + if (!$e->getSourceContext()) { + $e->setSourceContext($this->stream->getSourceContext()); + } + + if (!$e->getTemplateLine()) { + $e->setTemplateLine($this->stream->getCurrent()->getLine()); + } + + throw $e; + } + + $node = new ModuleNode(new BodyNode([$body]), $this->parent, new Node($this->blocks), new Node($this->macros), new Node($this->traits), $this->embeddedTemplates, $stream->getSourceContext()); + + $traverser = new NodeTraverser($this->env, $this->visitors); + + $node = $traverser->traverse($node); + + // restore previous stack so previous parse() call can resume working + foreach (array_pop($this->stack) as $key => $val) { + $this->$key = $val; + } + + return $node; + } + + public function subparse($test, $dropNeedle = false) + { + $lineno = $this->getCurrentToken()->getLine(); + $rv = []; + while (!$this->stream->isEOF()) { + switch ($this->getCurrentToken()->getType()) { + case Token::TEXT_TYPE: + $token = $this->stream->next(); + $rv[] = new TextNode($token->getValue(), $token->getLine()); + break; + + case Token::VAR_START_TYPE: + $token = $this->stream->next(); + $expr = $this->expressionParser->parseExpression(); + $this->stream->expect(Token::VAR_END_TYPE); + $rv[] = new PrintNode($expr, $token->getLine()); + break; + + case Token::BLOCK_START_TYPE: + $this->stream->next(); + $token = $this->getCurrentToken(); + + if (Token::NAME_TYPE !== $token->getType()) { + throw new SyntaxError('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext()); + } + + if (null !== $test && \call_user_func($test, $token)) { + if ($dropNeedle) { + $this->stream->next(); + } + + if (1 === \count($rv)) { + return $rv[0]; + } + + return new Node($rv, [], $lineno); + } + + $subparser = $this->handlers->getTokenParser($token->getValue()); + if (null === $subparser) { + if (null !== $test) { + $e = new SyntaxError(sprintf('Unexpected "%s" tag', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); + + if (\is_array($test) && isset($test[0]) && $test[0] instanceof TokenParserInterface) { + $e->appendMessage(sprintf(' (expecting closing tag for the "%s" tag defined near line %s).', $test[0]->getTag(), $lineno)); + } + } else { + $e = new SyntaxError(sprintf('Unknown "%s" tag.', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); + $e->addSuggestions($token->getValue(), array_keys($this->env->getTags())); + } + + throw $e; + } + + $this->stream->next(); + + $node = $subparser->parse($token); + if (null !== $node) { + $rv[] = $node; + } + break; + + default: + throw new SyntaxError('Lexer or parser ended up in unsupported state.', $this->getCurrentToken()->getLine(), $this->stream->getSourceContext()); + } + } + + if (1 === \count($rv)) { + return $rv[0]; + } + + return new Node($rv, [], $lineno); + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function addHandler($name, $class) + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); + + $this->handlers[$name] = $class; + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function addNodeVisitor(NodeVisitorInterface $visitor) + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); + + $this->visitors[] = $visitor; + } + + public function getBlockStack() + { + return $this->blockStack; + } + + public function peekBlockStack() + { + return $this->blockStack[\count($this->blockStack) - 1]; + } + + public function popBlockStack() + { + array_pop($this->blockStack); + } + + public function pushBlockStack($name) + { + $this->blockStack[] = $name; + } + + public function hasBlock($name) + { + return isset($this->blocks[$name]); + } + + public function getBlock($name) + { + return $this->blocks[$name]; + } + + public function setBlock($name, BlockNode $value) + { + $this->blocks[$name] = new BodyNode([$value], [], $value->getTemplateLine()); + } + + public function hasMacro($name) + { + return isset($this->macros[$name]); + } + + public function setMacro($name, MacroNode $node) + { + if ($this->isReservedMacroName($name)) { + throw new SyntaxError(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node->getTemplateLine(), $this->stream->getSourceContext()); + } + + $this->macros[$name] = $node; + } + + public function isReservedMacroName($name) + { + if (null === $this->reservedMacroNames) { + $this->reservedMacroNames = []; + $r = new \ReflectionClass($this->env->getBaseTemplateClass()); + foreach ($r->getMethods() as $method) { + $methodName = strtolower($method->getName()); + + if ('get' === substr($methodName, 0, 3) && isset($methodName[3])) { + $this->reservedMacroNames[] = substr($methodName, 3); + } + } + } + + return \in_array(strtolower($name), $this->reservedMacroNames); + } + + public function addTrait($trait) + { + $this->traits[] = $trait; + } + + public function hasTraits() + { + return \count($this->traits) > 0; + } + + public function embedTemplate(ModuleNode $template) + { + $template->setIndex(mt_rand()); + + $this->embeddedTemplates[] = $template; + } + + public function addImportedSymbol($type, $alias, $name = null, AbstractExpression $node = null) + { + $this->importedSymbols[0][$type][$alias] = ['name' => $name, 'node' => $node]; + } + + public function getImportedSymbol($type, $alias) + { + foreach ($this->importedSymbols as $functions) { + if (isset($functions[$type][$alias])) { + return $functions[$type][$alias]; + } + } + } + + public function isMainScope() + { + return 1 === \count($this->importedSymbols); + } + + public function pushLocalScope() + { + array_unshift($this->importedSymbols, []); + } + + public function popLocalScope() + { + array_shift($this->importedSymbols); + } + + /** + * @return ExpressionParser + */ + public function getExpressionParser() + { + return $this->expressionParser; + } + + public function getParent() + { + return $this->parent; + } + + public function setParent($parent) + { + $this->parent = $parent; + } + + /** + * @return TokenStream + */ + public function getStream() + { + return $this->stream; + } + + /** + * @return Token + */ + public function getCurrentToken() + { + return $this->stream->getCurrent(); + } + + protected function filterBodyNodes(\Twig_NodeInterface $node) + { + // check that the body does not contain non-empty output nodes + if ( + ($node instanceof TextNode && !ctype_space($node->getAttribute('data'))) + || + (!$node instanceof TextNode && !$node instanceof BlockReferenceNode && $node instanceof NodeOutputInterface) + ) { + if (false !== strpos((string) $node, \chr(0xEF).\chr(0xBB).\chr(0xBF))) { + $t = substr($node->getAttribute('data'), 3); + if ('' === $t || ctype_space($t)) { + // bypass empty nodes starting with a BOM + return; + } + } + + throw new SyntaxError('A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag?', $node->getTemplateLine(), $this->stream->getSourceContext()); + } + + // bypass nodes that will "capture" the output + if ($node instanceof NodeCaptureInterface) { + return $node; + } + + if ($node instanceof NodeOutputInterface) { + return; + } + + foreach ($node as $k => $n) { + if (null !== $n && null === $this->filterBodyNodes($n)) { + $node->removeNode($k); + } + } + + return $node; } } + +class_alias('Twig\Parser', 'Twig_Parser'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php --- a/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,65 @@ + */ +abstract class BaseDumper +{ + private $root; + + public function dump(Profile $profile) { + return $this->dumpProfile($profile); + } + + abstract protected function formatTemplate(Profile $profile, $prefix); + + abstract protected function formatNonTemplate(Profile $profile, $prefix); + + abstract protected function formatTime(Profile $profile, $percent); + + private function dumpProfile(Profile $profile, $prefix = '', $sibling = false) + { + if ($profile->isRoot()) { + $this->root = $profile->getDuration(); + $start = $profile->getName(); + } else { + if ($profile->isTemplate()) { + $start = $this->formatTemplate($profile, $prefix); + } else { + $start = $this->formatNonTemplate($profile, $prefix); + } + $prefix .= $sibling ? '│ ' : ' '; + } + + $percent = $this->root ? $profile->getDuration() / $this->root * 100 : 0; + + if ($profile->getDuration() * 1000 < 1) { + $str = $start."\n"; + } else { + $str = sprintf("%s %s\n", $start, $this->formatTime($profile, $percent)); + } + + $nCount = \count($profile->getProfiles()); + foreach ($profile as $i => $p) { + $str .= $this->dumpProfile($p, $prefix, $i + 1 !== $nCount); + } + + return $str; } } + +class_alias('Twig\Profiler\Dumper\BaseDumper', 'Twig_Profiler_Dumper_Base'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php --- a/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,76 @@ + * + * @final + */ +class BlackfireDumper +{ + public function dump(Profile $profile) { + $data = []; + $this->dumpProfile('main()', $profile, $data); + $this->dumpChildren('main()', $profile, $data); + + $start = sprintf('%f', microtime(true)); + $str = << $values) { + $str .= "{$name}//{$values['ct']} {$values['wt']} {$values['mu']} {$values['pmu']}\n"; + } + + return $str; + } + + private function dumpChildren($parent, Profile $profile, &$data) + { + foreach ($profile as $p) { + if ($p->isTemplate()) { + $name = $p->getTemplate(); + } else { + $name = sprintf('%s::%s(%s)', $p->getTemplate(), $p->getType(), $p->getName()); + } + $this->dumpProfile(sprintf('%s==>%s', $parent, $name), $p, $data); + $this->dumpChildren($name, $p, $data); + } + } + + private function dumpProfile($edge, Profile $profile, &$data) + { + if (isset($data[$edge])) { + ++$data[$edge]['ct']; + $data[$edge]['wt'] += floor($profile->getDuration() * 1000000); + $data[$edge]['mu'] += $profile->getMemoryUsage(); + $data[$edge]['pmu'] += $profile->getPeakMemoryUsage(); + } else { + $data[$edge] = [ + 'ct' => 1, + 'wt' => floor($profile->getDuration() * 1000000), + 'mu' => $profile->getMemoryUsage(), + 'pmu' => $profile->getPeakMemoryUsage(), + ]; + } } } + +class_alias('Twig\Profiler\Dumper\BlackfireDumper', 'Twig_Profiler_Dumper_Blackfire'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php --- a/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,51 @@ + * + * @final + */ +class HtmlDumper extends BaseDumper +{ + private static $colors = [ + 'block' => '#dfd', + 'macro' => '#ddf', + 'template' => '#ffd', + 'big' => '#d44', + ]; + + public function dump(Profile $profile) { + return '
    '.parent::dump($profile).'
    '; + } + + protected function formatTemplate(Profile $profile, $prefix) + { + return sprintf('%s└ %s', $prefix, self::$colors['template'], $profile->getTemplate()); + } + + protected function formatNonTemplate(Profile $profile, $prefix) + { + return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), isset(self::$colors[$profile->getType()]) ? self::$colors[$profile->getType()] : 'auto', $profile->getName()); + } + + protected function formatTime(Profile $profile, $percent) + { + return sprintf('%.2fms/%.0f%%', $percent > 20 ? self::$colors['big'] : 'auto', $profile->getDuration() * 1000, $percent); } } + +class_alias('Twig\Profiler\Dumper\HtmlDumper', 'Twig_Profiler_Dumper_Html'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Profiler/Dumper/TextDumper.php --- a/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,39 @@ + * + * @final + */ +class TextDumper extends BaseDumper +{ + protected function formatTemplate(Profile $profile, $prefix) { + return sprintf('%s└ %s', $prefix, $profile->getTemplate()); + } + + protected function formatNonTemplate(Profile $profile, $prefix) + { + return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), $profile->getName()); + } + + protected function formatTime(Profile $profile, $percent) + { + return sprintf('%.2fms/%.0f%%', $profile->getDuration() * 1000, $percent); } } + +class_alias('Twig\Profiler\Dumper\TextDumper', 'Twig_Profiler_Dumper_Text'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php --- a/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,44 @@ + */ +class EnterProfileNode extends Node +{ + public function __construct($extensionName, $type, $name, $varName) { + parent::__construct([], ['extension_name' => $extensionName, 'name' => $name, 'type' => $type, 'var_name' => $varName]); + } + + public function compile(Compiler $compiler) + { + $compiler + ->write(sprintf('$%s = $this->env->getExtension(', $this->getAttribute('var_name'))) + ->repr($this->getAttribute('extension_name')) + ->raw(");\n") + ->write(sprintf('$%s->enter($%s = new \Twig\Profiler\Profile($this->getTemplateName(), ', $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof')) + ->repr($this->getAttribute('type')) + ->raw(', ') + ->repr($this->getAttribute('name')) + ->raw("));\n\n") + ; } } + +class_alias('Twig\Profiler\Node\EnterProfileNode', 'Twig_Profiler_Node_EnterProfile'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php --- a/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,38 @@ + */ +class LeaveProfileNode extends Node +{ + public function __construct($varName) { + parent::__construct([], ['var_name' => $varName]); + } + + public function compile(Compiler $compiler) + { + $compiler + ->write("\n") + ->write(sprintf("\$%s->leave(\$%s);\n\n", $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof')) + ; } } + +class_alias('Twig\Profiler\Node\LeaveProfileNode', 'Twig_Profiler_Node_LeaveProfile'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php --- a/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,80 @@ + * + * @final + */ +class ProfilerNodeVisitor extends AbstractNodeVisitor +{ + private $extensionName; + + public function __construct($extensionName) { + $this->extensionName = $extensionName; + } + + protected function doEnterNode(Node $node, Environment $env) + { + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + $varName = $this->getVarName(); + $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $varName), $node->getNode('display_start')])); + $node->setNode('display_end', new Node([new LeaveProfileNode($varName), $node->getNode('display_end')])); + } elseif ($node instanceof BlockNode) { + $varName = $this->getVarName(); + $node->setNode('body', new BodyNode([ + new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $varName), + $node->getNode('body'), + new LeaveProfileNode($varName), + ])); + } elseif ($node instanceof MacroNode) { + $varName = $this->getVarName(); + $node->setNode('body', new BodyNode([ + new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $varName), + $node->getNode('body'), + new LeaveProfileNode($varName), + ])); + } + + return $node; + } + + private function getVarName() + { + return sprintf('__internal_%s', hash('sha256', $this->extensionName)); + } + + public function getPriority() + { + return 0; } } + +class_alias('Twig\Profiler\NodeVisitor\ProfilerNodeVisitor', 'Twig_Profiler_NodeVisitor_Profiler'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Profiler/Profile.php --- a/vendor/twig/twig/src/Profiler/Profile.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Profiler/Profile.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,188 @@ + * + * @final + */ +class Profile implements \IteratorAggregate, \Serializable +{ + const ROOT = 'ROOT'; + const BLOCK = 'block'; + const TEMPLATE = 'template'; + const MACRO = 'macro'; -if (\false) { - class Profile extends \Twig_Profiler_Profile + private $template; + private $name; + private $type; + private $starts = []; + private $ends = []; + private $profiles = []; + + public function __construct($template = 'main', $type = self::ROOT, $name = 'main') { + $this->template = $template; + $this->type = $type; + $this->name = 0 === strpos($name, '__internal_') ? 'INTERNAL' : $name; + $this->enter(); + } + + public function getTemplate() + { + return $this->template; + } + + public function getType() + { + return $this->type; + } + + public function getName() + { + return $this->name; + } + + public function isRoot() + { + return self::ROOT === $this->type; + } + + public function isTemplate() + { + return self::TEMPLATE === $this->type; + } + + public function isBlock() + { + return self::BLOCK === $this->type; + } + + public function isMacro() + { + return self::MACRO === $this->type; + } + + public function getProfiles() + { + return $this->profiles; + } + + public function addProfile(self $profile) + { + $this->profiles[] = $profile; + } + + /** + * Returns the duration in microseconds. + * + * @return float + */ + public function getDuration() + { + if ($this->isRoot() && $this->profiles) { + // for the root node with children, duration is the sum of all child durations + $duration = 0; + foreach ($this->profiles as $profile) { + $duration += $profile->getDuration(); + } + + return $duration; + } + + return isset($this->ends['wt']) && isset($this->starts['wt']) ? $this->ends['wt'] - $this->starts['wt'] : 0; + } + + /** + * Returns the memory usage in bytes. + * + * @return int + */ + public function getMemoryUsage() + { + return isset($this->ends['mu']) && isset($this->starts['mu']) ? $this->ends['mu'] - $this->starts['mu'] : 0; + } + + /** + * Returns the peak memory usage in bytes. + * + * @return int + */ + public function getPeakMemoryUsage() + { + return isset($this->ends['pmu']) && isset($this->starts['pmu']) ? $this->ends['pmu'] - $this->starts['pmu'] : 0; + } + + /** + * Starts the profiling. + */ + public function enter() + { + $this->starts = [ + 'wt' => microtime(true), + 'mu' => memory_get_usage(), + 'pmu' => memory_get_peak_usage(), + ]; + } + + /** + * Stops the profiling. + */ + public function leave() + { + $this->ends = [ + 'wt' => microtime(true), + 'mu' => memory_get_usage(), + 'pmu' => memory_get_peak_usage(), + ]; + } + + public function reset() + { + $this->starts = $this->ends = $this->profiles = []; + $this->enter(); + } + + public function getIterator() + { + return new \ArrayIterator($this->profiles); + } + + public function serialize() + { + return serialize($this->__serialize()); + } + + public function unserialize($data) + { + $this->__unserialize(unserialize($data)); + } + + /** + * @internal + */ + public function __serialize() + { + return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]; + } + + /** + * @internal + */ + public function __unserialize(array $data) + { + list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; } } + +class_alias('Twig\Profiler\Profile', 'Twig_Profiler_Profile'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php --- a/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,41 @@ + * @author Robin Chalas + */ +class ContainerRuntimeLoader implements RuntimeLoaderInterface +{ + private $container; + + public function __construct(ContainerInterface $container) { + $this->container = $container; + } + + public function load($class) + { + if ($this->container->has($class)) { + return $this->container->get($class); + } } } + +class_alias('Twig\RuntimeLoader\ContainerRuntimeLoader', 'Twig_ContainerRuntimeLoader'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php --- a/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,41 @@ + */ +class FactoryRuntimeLoader implements RuntimeLoaderInterface +{ + private $map; -if (\false) { - class FactoryRuntimeLoader extends \Twig_FactoryRuntimeLoader + /** + * @param array $map An array where keys are class names and values factory callables + */ + public function __construct($map = []) { + $this->map = $map; + } + + public function load($class) + { + if (isset($this->map[$class])) { + $runtimeFactory = $this->map[$class]; + + return $runtimeFactory(); + } } } + +class_alias('Twig\RuntimeLoader\FactoryRuntimeLoader', 'Twig_FactoryRuntimeLoader'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php --- a/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,31 @@ + */ +interface RuntimeLoaderInterface +{ + /** + * Creates the runtime implementation of a Twig element (filter/function/test). + * + * @param string $class A runtime class + * + * @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class + */ + public function load($class); +} -if (\false) { - interface RuntimeLoaderInterface extends \Twig_RuntimeLoaderInterface - { - } -} +class_alias('Twig\RuntimeLoader\RuntimeLoaderInterface', 'Twig_RuntimeLoaderInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Sandbox/SecurityError.php --- a/vendor/twig/twig/src/Sandbox/SecurityError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Sandbox/SecurityError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,25 @@ + */ +class SecurityError extends Error +{ } + +class_alias('Twig\Sandbox\SecurityError', 'Twig_Sandbox_SecurityError'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php --- a/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,35 @@ + */ +class SecurityNotAllowedFilterError extends SecurityError +{ + private $filterName; -if (\false) { - class SecurityNotAllowedFilterError extends \Twig_Sandbox_SecurityNotAllowedFilterError + public function __construct($message, $functionName, $lineno = -1, $filename = null, \Exception $previous = null) { + parent::__construct($message, $lineno, $filename, $previous); + $this->filterName = $functionName; + } + + public function getFilterName() + { + return $this->filterName; } } + +class_alias('Twig\Sandbox\SecurityNotAllowedFilterError', 'Twig_Sandbox_SecurityNotAllowedFilterError'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php --- a/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,35 @@ + */ +class SecurityNotAllowedFunctionError extends SecurityError +{ + private $functionName; -if (\false) { - class SecurityNotAllowedFunctionError extends \Twig_Sandbox_SecurityNotAllowedFunctionError + public function __construct($message, $functionName, $lineno = -1, $filename = null, \Exception $previous = null) { + parent::__construct($message, $lineno, $filename, $previous); + $this->functionName = $functionName; + } + + public function getFunctionName() + { + return $this->functionName; } } + +class_alias('Twig\Sandbox\SecurityNotAllowedFunctionError', 'Twig_Sandbox_SecurityNotAllowedFunctionError'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php --- a/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,42 @@ + */ +class SecurityNotAllowedMethodError extends SecurityError +{ + private $className; + private $methodName; -if (\false) { - class SecurityNotAllowedMethodError extends \Twig_Sandbox_SecurityNotAllowedMethodError + public function __construct($message, $className, $methodName, $lineno = -1, $filename = null, \Exception $previous = null) { + parent::__construct($message, $lineno, $filename, $previous); + $this->className = $className; + $this->methodName = $methodName; + } + + public function getClassName() + { + return $this->className; + } + + public function getMethodName() + { + return $this->methodName; } } + +class_alias('Twig\Sandbox\SecurityNotAllowedMethodError', 'Twig_Sandbox_SecurityNotAllowedMethodError'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php --- a/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,42 @@ + */ +class SecurityNotAllowedPropertyError extends SecurityError +{ + private $className; + private $propertyName; -if (\false) { - class SecurityNotAllowedPropertyError extends \Twig_Sandbox_SecurityNotAllowedPropertyError + public function __construct($message, $className, $propertyName, $lineno = -1, $filename = null, \Exception $previous = null) { + parent::__construct($message, $lineno, $filename, $previous); + $this->className = $className; + $this->propertyName = $propertyName; + } + + public function getClassName() + { + return $this->className; + } + + public function getPropertyName() + { + return $this->propertyName; } } + +class_alias('Twig\Sandbox\SecurityNotAllowedPropertyError', 'Twig_Sandbox_SecurityNotAllowedPropertyError'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php --- a/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,35 @@ + */ +class SecurityNotAllowedTagError extends SecurityError +{ + private $tagName; -if (\false) { - class SecurityNotAllowedTagError extends \Twig_Sandbox_SecurityNotAllowedTagError + public function __construct($message, $tagName, $lineno = -1, $filename = null, \Exception $previous = null) { + parent::__construct($message, $lineno, $filename, $previous); + $this->tagName = $tagName; + } + + public function getTagName() + { + return $this->tagName; } } + +class_alias('Twig\Sandbox\SecurityNotAllowedTagError', 'Twig_Sandbox_SecurityNotAllowedTagError'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Sandbox/SecurityPolicy.php --- a/vendor/twig/twig/src/Sandbox/SecurityPolicy.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Sandbox/SecurityPolicy.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,129 @@ + */ +class SecurityPolicy implements SecurityPolicyInterface +{ + protected $allowedTags; + protected $allowedFilters; + protected $allowedMethods; + protected $allowedProperties; + protected $allowedFunctions; + + public function __construct(array $allowedTags = [], array $allowedFilters = [], array $allowedMethods = [], array $allowedProperties = [], array $allowedFunctions = []) { + $this->allowedTags = $allowedTags; + $this->allowedFilters = $allowedFilters; + $this->setAllowedMethods($allowedMethods); + $this->allowedProperties = $allowedProperties; + $this->allowedFunctions = $allowedFunctions; + } + + public function setAllowedTags(array $tags) + { + $this->allowedTags = $tags; + } + + public function setAllowedFilters(array $filters) + { + $this->allowedFilters = $filters; + } + + public function setAllowedMethods(array $methods) + { + $this->allowedMethods = []; + foreach ($methods as $class => $m) { + $this->allowedMethods[$class] = array_map('strtolower', \is_array($m) ? $m : [$m]); + } + } + + public function setAllowedProperties(array $properties) + { + $this->allowedProperties = $properties; + } + + public function setAllowedFunctions(array $functions) + { + $this->allowedFunctions = $functions; + } + + public function checkSecurity($tags, $filters, $functions) + { + foreach ($tags as $tag) { + if (!\in_array($tag, $this->allowedTags)) { + throw new SecurityNotAllowedTagError(sprintf('Tag "%s" is not allowed.', $tag), $tag); + } + } + + foreach ($filters as $filter) { + if (!\in_array($filter, $this->allowedFilters)) { + throw new SecurityNotAllowedFilterError(sprintf('Filter "%s" is not allowed.', $filter), $filter); + } + } + + foreach ($functions as $function) { + if (!\in_array($function, $this->allowedFunctions)) { + throw new SecurityNotAllowedFunctionError(sprintf('Function "%s" is not allowed.', $function), $function); + } + } + } + + public function checkMethodAllowed($obj, $method) + { + if ($obj instanceof \Twig_TemplateInterface || $obj instanceof Markup) { + return; + } + + $allowed = false; + $method = strtolower($method); + foreach ($this->allowedMethods as $class => $methods) { + if ($obj instanceof $class) { + $allowed = \in_array($method, $methods); + + break; + } + } + + if (!$allowed) { + $class = \get_class($obj); + throw new SecurityNotAllowedMethodError(sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, $class), $class, $method); + } + } + + public function checkPropertyAllowed($obj, $property) + { + $allowed = false; + foreach ($this->allowedProperties as $class => $properties) { + if ($obj instanceof $class) { + $allowed = \in_array($property, \is_array($properties) ? $properties : [$properties]); + + break; + } + } + + if (!$allowed) { + $class = \get_class($obj); + throw new SecurityNotAllowedPropertyError(sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, $class), $class, $property); + } } } + +class_alias('Twig\Sandbox\SecurityPolicy', 'Twig_Sandbox_SecurityPolicy'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php --- a/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,28 @@ + */ +interface SecurityPolicyInterface +{ + public function checkSecurity($tags, $filters, $functions); -if (\false) { - interface SecurityPolicyInterface extends \Twig_Sandbox_SecurityPolicyInterface - { - } + public function checkMethodAllowed($obj, $method); + + public function checkPropertyAllowed($obj, $method); } + +class_alias('Twig\Sandbox\SecurityPolicyInterface', 'Twig_Sandbox_SecurityPolicyInterface'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Source.php --- a/vendor/twig/twig/src/Source.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Source.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,55 @@ + */ +class Source +{ + private $code; + private $name; + private $path; -if (\false) { - class Source extends \Twig_Source + /** + * @param string $code The template source code + * @param string $name The template logical name + * @param string $path The filesystem path of the template if any + */ + public function __construct($code, $name, $path = '') { + $this->code = $code; + $this->name = $name; + $this->path = $path; + } + + public function getCode() + { + return $this->code; + } + + public function getName() + { + return $this->name; + } + + public function getPath() + { + return $this->path; } } + +class_alias('Twig\Source', 'Twig_Source'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Template.php --- a/vendor/twig/twig/src/Template.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Template.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,721 @@ load() + * instead, which returns an instance of \Twig\TemplateWrapper. + * + * @author Fabien Potencier + * + * @internal + */ +abstract class Template implements \Twig_TemplateInterface +{ + /** + * @internal + */ + protected static $cache = []; + + protected $parent; + protected $parents = []; + protected $env; + protected $blocks = []; + protected $traits = []; + protected $sandbox; + + public function __construct(Environment $env) { + $this->env = $env; + } + + /** + * @internal this method will be removed in 2.0 and is only used internally to provide an upgrade path from 1.x to 2.0 + */ + public function __toString() + { + return $this->getTemplateName(); + } + + /** + * Returns the template name. + * + * @return string The template name + */ + abstract public function getTemplateName(); + + /** + * Returns debug information about the template. + * + * @return array Debug information + */ + public function getDebugInfo() + { + return []; + } + + /** + * Returns the template source code. + * + * @return string The template source code + * + * @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead + */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return ''; + } + + /** + * Returns information about the original template source code. + * + * @return Source + */ + public function getSourceContext() + { + return new Source('', $this->getTemplateName()); + } + + /** + * @deprecated since 1.20 (to be removed in 2.0) + */ + public function getEnvironment() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.20 and will be removed in 2.0.', E_USER_DEPRECATED); + + return $this->env; + } + + /** + * Returns the parent template. + * + * This method is for internal use only and should never be called + * directly. + * + * @param array $context + * + * @return \Twig_TemplateInterface|TemplateWrapper|false The parent template or false if there is no parent + * + * @internal + */ + public function getParent(array $context) + { + if (null !== $this->parent) { + return $this->parent; + } + + try { + $parent = $this->doGetParent($context); + + if (false === $parent) { + return false; + } + + if ($parent instanceof self || $parent instanceof TemplateWrapper) { + return $this->parents[$parent->getSourceContext()->getName()] = $parent; + } + + if (!isset($this->parents[$parent])) { + $this->parents[$parent] = $this->loadTemplate($parent); + } + } catch (LoaderError $e) { + $e->setSourceContext(null); + $e->guess(); + + throw $e; + } + + return $this->parents[$parent]; + } + + protected function doGetParent(array $context) + { + return false; + } + + public function isTraitable() + { + return true; + } + + /** + * Displays a parent block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to display from the parent + * @param array $context The context + * @param array $blocks The current set of blocks + */ + public function displayParentBlock($name, array $context, array $blocks = []) + { + $name = (string) $name; + + if (isset($this->traits[$name])) { + $this->traits[$name][0]->displayBlock($name, $context, $blocks, false); + } elseif (false !== $parent = $this->getParent($context)) { + $parent->displayBlock($name, $context, $blocks, false); + } else { + throw new RuntimeError(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getSourceContext()); + } + } + + /** + * Displays a block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to display + * @param array $context The context + * @param array $blocks The current set of blocks + * @param bool $useBlocks Whether to use the current set of blocks + */ + public function displayBlock($name, array $context, array $blocks = [], $useBlocks = true) + { + $name = (string) $name; + + if ($useBlocks && isset($blocks[$name])) { + $template = $blocks[$name][0]; + $block = $blocks[$name][1]; + } elseif (isset($this->blocks[$name])) { + $template = $this->blocks[$name][0]; + $block = $this->blocks[$name][1]; + } else { + $template = null; + $block = null; + } + + // avoid RCEs when sandbox is enabled + if (null !== $template && !$template instanceof self) { + throw new \LogicException('A block must be a method on a \Twig\Template instance.'); + } + + if (null !== $template) { + try { + $template->$block($context, $blocks); + } catch (Error $e) { + if (!$e->getSourceContext()) { + $e->setSourceContext($template->getSourceContext()); + } + + // this is mostly useful for \Twig\Error\LoaderError exceptions + // see \Twig\Error\LoaderError + if (-1 === $e->getTemplateLine()) { + $e->guess(); + } + + throw $e; + } catch (\Exception $e) { + $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e); + $e->guess(); + + throw $e; + } + } elseif (false !== $parent = $this->getParent($context)) { + $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false); + } else { + @trigger_error(sprintf('Silent display of undefined block "%s" in template "%s" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block(\'%s\') is defined" expression to test for block existence.', $name, $this->getTemplateName(), $name), E_USER_DEPRECATED); + } + } + + /** + * Renders a parent block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to render from the parent + * @param array $context The context + * @param array $blocks The current set of blocks + * + * @return string The rendered block + */ + public function renderParentBlock($name, array $context, array $blocks = []) + { + ob_start(); + $this->displayParentBlock($name, $context, $blocks); + + return ob_get_clean(); + } + + /** + * Renders a block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to render + * @param array $context The context + * @param array $blocks The current set of blocks + * @param bool $useBlocks Whether to use the current set of blocks + * + * @return string The rendered block + */ + public function renderBlock($name, array $context, array $blocks = [], $useBlocks = true) + { + ob_start(); + $this->displayBlock($name, $context, $blocks, $useBlocks); + + return ob_get_clean(); + } + + /** + * Returns whether a block exists or not in the current context of the template. + * + * This method checks blocks defined in the current template + * or defined in "used" traits or defined in parent templates. + * + * @param string $name The block name + * @param array $context The context + * @param array $blocks The current set of blocks + * + * @return bool true if the block exists, false otherwise + */ + public function hasBlock($name, array $context = null, array $blocks = []) + { + if (null === $context) { + @trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED); + + return isset($this->blocks[(string) $name]); + } + + if (isset($blocks[$name])) { + return $blocks[$name][0] instanceof self; + } + + if (isset($this->blocks[$name])) { + return true; + } + + if (false !== $parent = $this->getParent($context)) { + return $parent->hasBlock($name, $context); + } + + return false; + } + + /** + * Returns all block names in the current context of the template. + * + * This method checks blocks defined in the current template + * or defined in "used" traits or defined in parent templates. + * + * @param array $context The context + * @param array $blocks The current set of blocks + * + * @return array An array of block names + */ + public function getBlockNames(array $context = null, array $blocks = []) + { + if (null === $context) { + @trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED); + + return array_keys($this->blocks); + } + + $names = array_merge(array_keys($blocks), array_keys($this->blocks)); + + if (false !== $parent = $this->getParent($context)) { + $names = array_merge($names, $parent->getBlockNames($context)); + } + + return array_unique($names); + } + + /** + * @return Template|TemplateWrapper + */ + protected function loadTemplate($template, $templateName = null, $line = null, $index = null) + { + try { + if (\is_array($template)) { + return $this->env->resolveTemplate($template); + } + + if ($template instanceof self || $template instanceof TemplateWrapper) { + return $template; + } + + if ($template === $this->getTemplateName()) { + $class = \get_class($this); + if (false !== $pos = strrpos($class, '___', -1)) { + $class = substr($class, 0, $pos); + } + + return $this->env->loadClass($class, $template, $index); + } + + return $this->env->loadTemplate($template, $index); + } catch (Error $e) { + if (!$e->getSourceContext()) { + $e->setSourceContext($templateName ? new Source('', $templateName) : $this->getSourceContext()); + } + + if ($e->getTemplateLine() > 0) { + throw $e; + } + + if (!$line) { + $e->guess(); + } else { + $e->setTemplateLine($line); + } + + throw $e; + } + } + + /** + * @internal + * + * @return Template + */ + protected function unwrap() + { + return $this; + } + + /** + * Returns all blocks. + * + * This method is for internal use only and should never be called + * directly. + * + * @return array An array of blocks + */ + public function getBlocks() + { + return $this->blocks; + } + + public function display(array $context, array $blocks = []) + { + $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks)); + } + + public function render(array $context) + { + $level = ob_get_level(); + ob_start(); + try { + $this->display($context); + } catch (\Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } catch (\Throwable $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } + + return ob_get_clean(); + } + + protected function displayWithErrorHandling(array $context, array $blocks = []) + { + try { + $this->doDisplay($context, $blocks); + } catch (Error $e) { + if (!$e->getSourceContext()) { + $e->setSourceContext($this->getSourceContext()); + } + + // this is mostly useful for \Twig\Error\LoaderError exceptions + // see \Twig\Error\LoaderError + if (-1 === $e->getTemplateLine()) { + $e->guess(); + } + + throw $e; + } catch (\Exception $e) { + $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e); + $e->guess(); + + throw $e; + } + } + + /** + * Auto-generated method to display the template with the given context. + * + * @param array $context An array of parameters to pass to the template + * @param array $blocks An array of blocks to pass to the template + */ + abstract protected function doDisplay(array $context, array $blocks = []); + + /** + * Returns a variable from the context. + * + * This method is for internal use only and should never be called + * directly. + * + * This method should not be overridden in a sub-class as this is an + * implementation detail that has been introduced to optimize variable + * access for versions of PHP before 5.4. This is not a way to override + * the way to get a variable value. + * + * @param array $context The context + * @param string $item The variable to return from the context + * @param bool $ignoreStrictCheck Whether to ignore the strict variable check or not + * + * @return mixed The content of the context variable + * + * @throws RuntimeError if the variable does not exist and Twig is running in strict mode + * + * @internal + */ + final protected function getContext($context, $item, $ignoreStrictCheck = false) + { + if (!\array_key_exists($item, $context)) { + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return; + } + + throw new RuntimeError(sprintf('Variable "%s" does not exist.', $item), -1, $this->getSourceContext()); + } + + return $context[$item]; + } + + /** + * Returns the attribute value for a given array/object. + * + * @param mixed $object The object or array from where to get the item + * @param mixed $item The item to get from the array or object + * @param array $arguments An array of arguments to pass if the item is an object method + * @param string $type The type of attribute (@see \Twig\Template constants) + * @param bool $isDefinedTest Whether this is only a defined check + * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not + * + * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true + * + * @throws RuntimeError if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false + * + * @internal + */ + protected function getAttribute($object, $item, array $arguments = [], $type = self::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) + { + // array + if (self::METHOD_CALL !== $type) { + $arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item; + + if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, $object))) + || ($object instanceof \ArrayAccess && isset($object[$arrayItem])) + ) { + if ($isDefinedTest) { + return true; + } + + return $object[$arrayItem]; + } + + if (self::ARRAY_CALL === $type || !\is_object($object)) { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return; + } + + if ($object instanceof \ArrayAccess) { + $message = sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist.', $arrayItem, \get_class($object)); + } elseif (\is_object($object)) { + $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface.', $item, \get_class($object)); + } elseif (\is_array($object)) { + if (empty($object)) { + $message = sprintf('Key "%s" does not exist as the array is empty.', $arrayItem); + } else { + $message = sprintf('Key "%s" for array with keys "%s" does not exist.', $arrayItem, implode(', ', array_keys($object))); + } + } elseif (self::ARRAY_CALL === $type) { + if (null === $object) { + $message = sprintf('Impossible to access a key ("%s") on a null variable.', $item); + } else { + $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); + } + } elseif (null === $object) { + $message = sprintf('Impossible to access an attribute ("%s") on a null variable.', $item); + } else { + $message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); + } + + throw new RuntimeError($message, -1, $this->getSourceContext()); + } + } + + if (!\is_object($object)) { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return; + } + + if (null === $object) { + $message = sprintf('Impossible to invoke a method ("%s") on a null variable.', $item); + } elseif (\is_array($object)) { + $message = sprintf('Impossible to invoke a method ("%s") on an array.', $item); + } else { + $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); + } + + throw new RuntimeError($message, -1, $this->getSourceContext()); + } + + // object property + if (self::METHOD_CALL !== $type && !$object instanceof self) { // \Twig\Template does not have public properties, and we don't want to allow access to internal ones + if (isset($object->$item) || \array_key_exists((string) $item, $object)) { + if ($isDefinedTest) { + return true; + } + + if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) { + $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkPropertyAllowed($object, $item); + } + + return $object->$item; + } + } + + $class = \get_class($object); + + // object method + if (!isset(self::$cache[$class])) { + // get_class_methods returns all methods accessible in the scope, but we only want public ones to be accessible in templates + if ($object instanceof self) { + $ref = new \ReflectionClass($class); + $methods = []; + + foreach ($ref->getMethods(\ReflectionMethod::IS_PUBLIC) as $refMethod) { + // Accessing the environment from templates is forbidden to prevent untrusted changes to the environment + if ('getenvironment' !== strtolower($refMethod->name)) { + $methods[] = $refMethod->name; + } + } + } else { + $methods = get_class_methods($object); + } + // sort values to have consistent behavior, so that "get" methods win precedence over "is" methods + sort($methods); + + $cache = []; + + foreach ($methods as $method) { + $cache[$method] = $method; + $cache[$lcName = strtolower($method)] = $method; + + if ('g' === $lcName[0] && 0 === strpos($lcName, 'get')) { + $name = substr($method, 3); + $lcName = substr($lcName, 3); + } elseif ('i' === $lcName[0] && 0 === strpos($lcName, 'is')) { + $name = substr($method, 2); + $lcName = substr($lcName, 2); + } else { + continue; + } + + // skip get() and is() methods (in which case, $name is empty) + if ($name) { + if (!isset($cache[$name])) { + $cache[$name] = $method; + } + if (!isset($cache[$lcName])) { + $cache[$lcName] = $method; + } + } + } + self::$cache[$class] = $cache; + } + + $call = false; + if (isset(self::$cache[$class][$item])) { + $method = self::$cache[$class][$item]; + } elseif (isset(self::$cache[$class][$lcItem = strtolower($item)])) { + $method = self::$cache[$class][$lcItem]; + } elseif (isset(self::$cache[$class]['__call'])) { + $method = $item; + $call = true; + } else { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return; + } + + throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext()); + } + + if ($isDefinedTest) { + return true; + } + + if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) { + $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method); + } + + // Some objects throw exceptions when they have __call, and the method we try + // to call is not supported. If ignoreStrictCheck is true, we should return null. + try { + if (!$arguments) { + $ret = $object->$method(); + } else { + $ret = \call_user_func_array([$object, $method], $arguments); + } + } catch (\BadMethodCallException $e) { + if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) { + return; + } + throw $e; + } + + // @deprecated in 1.28 + if ($object instanceof \Twig_TemplateInterface) { + $self = $object->getTemplateName() === $this->getTemplateName(); + $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName()); + if ('renderBlock' === $method || 'displayBlock' === $method) { + $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template'); + } elseif ('hasBlock' === $method) { + $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template'); + } elseif ('render' === $method || 'display' === $method) { + $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName()); + } + @trigger_error($message, E_USER_DEPRECATED); + + return '' === $ret ? '' : new Markup($ret, $this->env->getCharset()); + } + + return $ret; } } + +class_alias('Twig\Template', 'Twig_Template'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TemplateWrapper.php --- a/vendor/twig/twig/src/TemplateWrapper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TemplateWrapper.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,157 @@ + */ +final class TemplateWrapper +{ + private $env; + private $template; -if (\false) { - class TemplateWrapper extends \Twig_TemplateWrapper + /** + * This method is for internal use only and should never be called + * directly (use Twig\Environment::load() instead). + * + * @internal + */ + public function __construct(Environment $env, Template $template) { + $this->env = $env; + $this->template = $template; + } + + /** + * Renders the template. + * + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered template + */ + public function render($context = []) + { + // using func_get_args() allows to not expose the blocks argument + // as it should only be used by internal code + return $this->template->render($context, \func_num_args() > 1 ? func_get_arg(1) : []); + } + + /** + * Displays the template. + * + * @param array $context An array of parameters to pass to the template + */ + public function display($context = []) + { + // using func_get_args() allows to not expose the blocks argument + // as it should only be used by internal code + $this->template->display($context, \func_num_args() > 1 ? func_get_arg(1) : []); + } + + /** + * Checks if a block is defined. + * + * @param string $name The block name + * @param array $context An array of parameters to pass to the template + * + * @return bool + */ + public function hasBlock($name, $context = []) + { + return $this->template->hasBlock($name, $context); + } + + /** + * Returns defined block names in the template. + * + * @param array $context An array of parameters to pass to the template + * + * @return string[] An array of defined template block names + */ + public function getBlockNames($context = []) + { + return $this->template->getBlockNames($context); + } + + /** + * Renders a template block. + * + * @param string $name The block name to render + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered block + */ + public function renderBlock($name, $context = []) + { + $context = $this->env->mergeGlobals($context); + $level = ob_get_level(); + ob_start(); + try { + $this->template->displayBlock($name, $context); + } catch (\Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } catch (\Throwable $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } + + return ob_get_clean(); + } + + /** + * Displays a template block. + * + * @param string $name The block name to render + * @param array $context An array of parameters to pass to the template + */ + public function displayBlock($name, $context = []) + { + $this->template->displayBlock($name, $this->env->mergeGlobals($context)); + } + + /** + * @return Source + */ + public function getSourceContext() + { + return $this->template->getSourceContext(); + } + + /** + * @return string + */ + public function getTemplateName() + { + return $this->template->getTemplateName(); + } + + /** + * @internal + * + * @return Template + */ + public function unwrap() + { + return $this->template; } } + +class_alias('Twig\TemplateWrapper', 'Twig_TemplateWrapper'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Test/IntegrationTestCase.php --- a/vendor/twig/twig/src/Test/IntegrationTestCase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Test/IntegrationTestCase.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,257 @@ + * @author Karma Dordrak + */ +abstract class IntegrationTestCase extends TestCase +{ + /** + * @return string + */ + abstract protected function getFixturesDir(); + + /** + * @return RuntimeLoaderInterface[] + */ + protected function getRuntimeLoaders() { + return []; + } + + /** + * @return ExtensionInterface[] + */ + protected function getExtensions() + { + return []; + } + + /** + * @return TwigFilter[] + */ + protected function getTwigFilters() + { + return []; + } + + /** + * @return TwigFunction[] + */ + protected function getTwigFunctions() + { + return []; + } + + /** + * @return TwigTest[] + */ + protected function getTwigTests() + { + return []; + } + + /** + * @dataProvider getTests + */ + public function testIntegration($file, $message, $condition, $templates, $exception, $outputs) + { + $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs); + } + + /** + * @dataProvider getLegacyTests + * @group legacy + */ + public function testLegacyIntegration($file, $message, $condition, $templates, $exception, $outputs) + { + $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs); + } + + public function getTests($name, $legacyTests = false) + { + $fixturesDir = realpath($this->getFixturesDir()); + $tests = []; + + foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($fixturesDir), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if (!preg_match('/\.test$/', $file)) { + continue; + } + + if ($legacyTests xor false !== strpos($file->getRealpath(), '.legacy.test')) { + continue; + } + + $test = file_get_contents($file->getRealpath()); + + if (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = self::parseTemplates($match[3]); + $exception = $match[5]; + $outputs = [[null, $match[4], null, '']]; + } elseif (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = self::parseTemplates($match[3]); + $exception = false; + preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER); + } else { + throw new \InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); + } + + $tests[] = [str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs]; + } + + if ($legacyTests && empty($tests)) { + // add a dummy test to avoid a PHPUnit message + return [['not', '-', '', [], '', []]]; + } + + return $tests; + } + + public function getLegacyTests() + { + return $this->getTests('testLegacyIntegration', true); + } + + protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs) + { + if (!$outputs) { + $this->markTestSkipped('no tests to run'); + } + + if ($condition) { + eval('$ret = '.$condition.';'); + if (!$ret) { + $this->markTestSkipped($condition); + } + } + + $loader = new ArrayLoader($templates); + + foreach ($outputs as $i => $match) { + $config = array_merge([ + 'cache' => false, + 'strict_variables' => true, + ], $match[2] ? eval($match[2].';') : []); + $twig = new Environment($loader, $config); + $twig->addGlobal('global', 'global'); + foreach ($this->getRuntimeLoaders() as $runtimeLoader) { + $twig->addRuntimeLoader($runtimeLoader); + } + + foreach ($this->getExtensions() as $extension) { + $twig->addExtension($extension); + } + + foreach ($this->getTwigFilters() as $filter) { + $twig->addFilter($filter); + } + + foreach ($this->getTwigTests() as $test) { + $twig->addTest($test); + } + + foreach ($this->getTwigFunctions() as $function) { + $twig->addFunction($function); + } + + $p = new \ReflectionProperty($twig, 'templateClassPrefix'); + $p->setAccessible(true); + $p->setValue($twig, '__TwigTemplate_'.hash('sha256', uniqid(mt_rand(), true), false).'_'); + + try { + $template = $twig->load('index.twig'); + } catch (\Exception $e) { + if (false !== $exception) { + $message = $e->getMessage(); + $this->assertSame(trim($exception), trim(sprintf('%s: %s', \get_class($e), $message))); + $last = substr($message, \strlen($message) - 1); + $this->assertTrue('.' === $last || '?' === $last, 'Exception message must end with a dot or a question mark.'); + + return; + } + + throw new Error(sprintf('%s: %s', \get_class($e), $e->getMessage()), -1, null, $e); + } + + try { + $output = trim($template->render(eval($match[1].';')), "\n "); + } catch (\Exception $e) { + if (false !== $exception) { + $this->assertSame(trim($exception), trim(sprintf('%s: %s', \get_class($e), $e->getMessage()))); + + return; + } + + $e = new Error(sprintf('%s: %s', \get_class($e), $e->getMessage()), -1, null, $e); + + $output = trim(sprintf('%s: %s', \get_class($e), $e->getMessage())); + } + + if (false !== $exception) { + list($class) = explode(':', $exception); + $constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception'; + $this->assertThat(null, new $constraintClass($class)); + } + + $expected = trim($match[3], "\n "); + + if ($expected !== $output) { + printf("Compiled templates that failed on case %d:\n", $i + 1); + + foreach (array_keys($templates) as $name) { + echo "Template: $name\n"; + $loader = $twig->getLoader(); + if (!$loader instanceof SourceContextLoaderInterface) { + $source = new Source($loader->getSource($name), $name); + } else { + $source = $loader->getSourceContext($name); + } + echo $twig->compile($twig->parse($twig->tokenize($source))); + } + } + $this->assertEquals($expected, $output, $message.' (in '.$file.')'); + } + } + + protected static function parseTemplates($test) + { + $templates = []; + preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $templates[($match[1] ? $match[1] : 'index.twig')] = $match[2]; + } + + return $templates; } } + +class_alias('Twig\Test\IntegrationTestCase', 'Twig_Test_IntegrationTestCase'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Test/NodeTestCase.php --- a/vendor/twig/twig/src/Test/NodeTestCase.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Test/NodeTestCase.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,79 @@ assertNodeCompilation($source, $node, $environment, $isPattern); + } + + public function assertNodeCompilation($source, Node $node, Environment $environment = null, $isPattern = false) + { + $compiler = $this->getCompiler($environment); + $compiler->compile($node); + + if ($isPattern) { + $this->assertStringMatchesFormat($source, trim($compiler->getSource())); + } else { + $this->assertEquals($source, trim($compiler->getSource())); + } + } + + protected function getCompiler(Environment $environment = null) + { + return new Compiler(null === $environment ? $this->getEnvironment() : $environment); + } + + protected function getEnvironment() + { + return new Environment(new ArrayLoader([])); + } + + protected function getVariableGetter($name, $line = false) + { + $line = $line > 0 ? "// line {$line}\n" : ''; + + if (\PHP_VERSION_ID >= 70000) { + return sprintf('%s($context["%s"] ?? null)', $line, $name); + } + + if (\PHP_VERSION_ID >= 50400) { + return sprintf('%s(isset($context["%s"]) ? $context["%s"] : null)', $line, $name, $name); + } + + return sprintf('%s$this->getContext($context, "%s")', $line, $name); + } + + protected function getAttributeGetter() + { + if (\function_exists('twig_template_get_attributes')) { + return 'twig_template_get_attributes($this, '; + } + + return '$this->getAttribute('; } } + +class_alias('Twig\Test\NodeTestCase', 'Twig_Test_NodeTestCase'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Token.php --- a/vendor/twig/twig/src/Token.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Token.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,209 @@ + * + * @final + */ +class Token +{ + protected $value; + protected $type; + protected $lineno; -if (\false) { - class Token extends \Twig_Token + const EOF_TYPE = -1; + const TEXT_TYPE = 0; + const BLOCK_START_TYPE = 1; + const VAR_START_TYPE = 2; + const BLOCK_END_TYPE = 3; + const VAR_END_TYPE = 4; + const NAME_TYPE = 5; + const NUMBER_TYPE = 6; + const STRING_TYPE = 7; + const OPERATOR_TYPE = 8; + const PUNCTUATION_TYPE = 9; + const INTERPOLATION_START_TYPE = 10; + const INTERPOLATION_END_TYPE = 11; + + /** + * @param int $type The type of the token + * @param string $value The token value + * @param int $lineno The line position in the source + */ + public function __construct($type, $value, $lineno) { + $this->type = $type; + $this->value = $value; + $this->lineno = $lineno; + } + + public function __toString() + { + return sprintf('%s(%s)', self::typeToString($this->type, true), $this->value); + } + + /** + * Tests the current token for a type and/or a value. + * + * Parameters may be: + * * just type + * * type and value (or array of possible values) + * * just value (or array of possible values) (NAME_TYPE is used as type) + * + * @param array|string|int $type The type to test + * @param array|string|null $values The token value + * + * @return bool + */ + public function test($type, $values = null) + { + if (null === $values && !\is_int($type)) { + $values = $type; + $type = self::NAME_TYPE; + } + + return ($this->type === $type) && ( + null === $values || + (\is_array($values) && \in_array($this->value, $values)) || + $this->value == $values + ); + } + + /** + * @return int + */ + public function getLine() + { + return $this->lineno; + } + + /** + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Returns the constant representation (internal) of a given type. + * + * @param int $type The type as an integer + * @param bool $short Whether to return a short representation or not + * + * @return string The string representation + */ + public static function typeToString($type, $short = false) + { + switch ($type) { + case self::EOF_TYPE: + $name = 'EOF_TYPE'; + break; + case self::TEXT_TYPE: + $name = 'TEXT_TYPE'; + break; + case self::BLOCK_START_TYPE: + $name = 'BLOCK_START_TYPE'; + break; + case self::VAR_START_TYPE: + $name = 'VAR_START_TYPE'; + break; + case self::BLOCK_END_TYPE: + $name = 'BLOCK_END_TYPE'; + break; + case self::VAR_END_TYPE: + $name = 'VAR_END_TYPE'; + break; + case self::NAME_TYPE: + $name = 'NAME_TYPE'; + break; + case self::NUMBER_TYPE: + $name = 'NUMBER_TYPE'; + break; + case self::STRING_TYPE: + $name = 'STRING_TYPE'; + break; + case self::OPERATOR_TYPE: + $name = 'OPERATOR_TYPE'; + break; + case self::PUNCTUATION_TYPE: + $name = 'PUNCTUATION_TYPE'; + break; + case self::INTERPOLATION_START_TYPE: + $name = 'INTERPOLATION_START_TYPE'; + break; + case self::INTERPOLATION_END_TYPE: + $name = 'INTERPOLATION_END_TYPE'; + break; + default: + throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); + } + + return $short ? $name : 'Twig\Token::'.$name; + } + + /** + * Returns the English representation of a given type. + * + * @param int $type The type as an integer + * + * @return string The string representation + */ + public static function typeToEnglish($type) + { + switch ($type) { + case self::EOF_TYPE: + return 'end of template'; + case self::TEXT_TYPE: + return 'text'; + case self::BLOCK_START_TYPE: + return 'begin of statement block'; + case self::VAR_START_TYPE: + return 'begin of print statement'; + case self::BLOCK_END_TYPE: + return 'end of statement block'; + case self::VAR_END_TYPE: + return 'end of print statement'; + case self::NAME_TYPE: + return 'name'; + case self::NUMBER_TYPE: + return 'number'; + case self::STRING_TYPE: + return 'string'; + case self::OPERATOR_TYPE: + return 'operator'; + case self::PUNCTUATION_TYPE: + return 'punctuation'; + case self::INTERPOLATION_START_TYPE: + return 'begin of string interpolation'; + case self::INTERPOLATION_END_TYPE: + return 'end of string interpolation'; + default: + throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); + } } } + +class_alias('Twig\Token', 'Twig_Token'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/AbstractTokenParser.php --- a/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,34 @@ + */ +abstract class AbstractTokenParser implements TokenParserInterface +{ + /** + * @var Parser + */ + protected $parser; + + public function setParser(Parser $parser) { + $this->parser = $parser; } } + +class_alias('Twig\TokenParser\AbstractTokenParser', 'Twig_TokenParser'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/ApplyTokenParser.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,58 @@ +getLine(); + $name = $this->parser->getVarName(); + + $ref = new TempNameExpression($name, $lineno); + $ref->setAttribute('always_defined', true); + + $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); + + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideApplyEnd'], true); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new Node([ + new SetNode(true, $ref, $body, $lineno, $this->getTag()), + new PrintNode($filter, $lineno, $this->getTag()), + ]); + } + + public function decideApplyEnd(Token $token) + { + return $token->test('endapply'); + } + + public function getTag() + { + return 'apply'; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php --- a/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,88 @@ getLine(); + $stream = $this->parser->getStream(); + + if ($stream->test(Token::BLOCK_END_TYPE)) { + $value = 'html'; + } else { + $expr = $this->parser->getExpressionParser()->parseExpression(); + if (!$expr instanceof ConstantExpression) { + throw new SyntaxError('An escaping strategy must be a string or a bool.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + $value = $expr->getAttribute('value'); + + $compat = true === $value || false === $value; + + if (true === $value) { + $value = 'html'; + } + + if ($compat && $stream->test(Token::NAME_TYPE)) { + @trigger_error('Using the autoescape tag with "true" or "false" before the strategy name is deprecated since version 1.21.', E_USER_DEPRECATED); + + if (false === $value) { + throw new SyntaxError('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + + $value = $stream->next()->getValue(); + } + } + + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + $stream->expect(Token::BLOCK_END_TYPE); + + return new AutoEscapeNode($value, $body, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endautoescape'); + } + + public function getTag() + { + return 'autoescape'; } } + +class_alias('Twig\TokenParser\AutoEscapeTokenParser', 'Twig_TokenParser_AutoEscape'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/BlockTokenParser.php --- a/vendor/twig/twig/src/TokenParser/BlockTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/BlockTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,80 @@ + * {% block title %}{% endblock %} - My Webpage + * {% endblock %} + * + * @final + */ +class BlockTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + if ($this->parser->hasBlock($name)) { + throw new SyntaxError(sprintf("The block '%s' has already been defined line %d.", $name, $this->parser->getBlock($name)->getTemplateLine()), $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + $this->parser->setBlock($name, $block = new BlockNode($name, new Node([]), $lineno)); + $this->parser->pushLocalScope(); + $this->parser->pushBlockStack($name); + + if ($stream->nextIf(Token::BLOCK_END_TYPE)) { + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + if ($token = $stream->nextIf(Token::NAME_TYPE)) { + $value = $token->getValue(); + + if ($value != $name) { + throw new SyntaxError(sprintf('Expected endblock for block "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + } + } else { + $body = new Node([ + new PrintNode($this->parser->getExpressionParser()->parseExpression(), $lineno), + ]); + } + $stream->expect(Token::BLOCK_END_TYPE); + + $block->setNode('body', $body); + $this->parser->popBlockStack(); + $this->parser->popLocalScope(); + + return new BlockReferenceNode($name, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endblock'); + } + + public function getTag() + { + return 'block'; } } + +class_alias('Twig\TokenParser\BlockTokenParser', 'Twig_TokenParser_Block'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php --- a/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,44 @@ + * + * @final + */ +class DeprecatedTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new DeprecatedNode($expr, $token->getLine(), $this->getTag()); + } + + public function getTag() + { + return 'deprecated'; } } + +class_alias('Twig\TokenParser\DeprecatedTokenParser', 'Twig_TokenParser_Deprecated'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/DoTokenParser.php --- a/vendor/twig/twig/src/TokenParser/DoTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/DoTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,39 @@ parser->getExpressionParser()->parseExpression(); + + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new DoNode($expr, $token->getLine(), $this->getTag()); + } + + public function getTag() + { + return 'do'; } } + +class_alias('Twig\TokenParser\DoTokenParser', 'Twig_TokenParser_Do'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/EmbedTokenParser.php --- a/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,74 @@ parser->getStream(); + + $parent = $this->parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + $parentToken = $fakeParentToken = new Token(Token::STRING_TYPE, '__parent__', $token->getLine()); + if ($parent instanceof ConstantExpression) { + $parentToken = new Token(Token::STRING_TYPE, $parent->getAttribute('value'), $token->getLine()); + } elseif ($parent instanceof NameExpression) { + $parentToken = new Token(Token::NAME_TYPE, $parent->getAttribute('name'), $token->getLine()); + } + + // inject a fake parent to make the parent() function work + $stream->injectTokens([ + new Token(Token::BLOCK_START_TYPE, '', $token->getLine()), + new Token(Token::NAME_TYPE, 'extends', $token->getLine()), + $parentToken, + new Token(Token::BLOCK_END_TYPE, '', $token->getLine()), + ]); + + $module = $this->parser->parse($stream, [$this, 'decideBlockEnd'], true); + + // override the parent with the correct one + if ($fakeParentToken === $parentToken) { + $module->setNode('parent', $parent); + } + + $this->parser->embedTemplate($module); + + $stream->expect(Token::BLOCK_END_TYPE); + + return new EmbedNode($module->getTemplateName(), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endembed'); + } + + public function getTag() + { + return 'embed'; } } + +class_alias('Twig\TokenParser\EmbedTokenParser', 'Twig_TokenParser_Embed'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php --- a/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,52 @@ parser->getStream(); + + if (!$this->parser->isMainScope()) { + throw new SyntaxError('Cannot extend from a block.', $token->getLine(), $stream->getSourceContext()); + } + + if (null !== $this->parser->getParent()) { + throw new SyntaxError('Multiple extends tags are forbidden.', $token->getLine(), $stream->getSourceContext()); + } + $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); + + $stream->expect(Token::BLOCK_END_TYPE); + + return new Node(); + } + + public function getTag() + { + return 'extends'; } } + +class_alias('Twig\TokenParser\ExtendsTokenParser', 'Twig_TokenParser_Extends'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/FilterTokenParser.php --- a/vendor/twig/twig/src/TokenParser/FilterTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/FilterTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,59 @@ parser->getVarName(); + $ref = new BlockReferenceExpression(new ConstantExpression($name, $token->getLine()), null, $token->getLine(), $this->getTag()); + + $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + $block = new BlockNode($name, $body, $token->getLine()); + $this->parser->setBlock($name, $block); + + return new PrintNode($filter, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endfilter'); + } + + public function getTag() + { + return 'filter'; } } + +class_alias('Twig\TokenParser\FilterTokenParser', 'Twig_TokenParser_Filter'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/FlushTokenParser.php --- a/vendor/twig/twig/src/TokenParser/FlushTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/FlushTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,39 @@ parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new FlushNode($token->getLine(), $this->getTag()); + } + + public function getTag() + { + return 'flush'; } } + +class_alias('Twig\TokenParser\FlushTokenParser', 'Twig_TokenParser_Flush'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/ForTokenParser.php --- a/vendor/twig/twig/src/TokenParser/ForTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/ForTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,136 @@ + * {% for user in users %} + *
  • {{ user.username|e }}
  • + * {% endfor %} + * + * + * @final + */ +class ForTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $targets = $this->parser->getExpressionParser()->parseAssignmentExpression(); + $stream->expect(Token::OPERATOR_TYPE, 'in'); + $seq = $this->parser->getExpressionParser()->parseExpression(); + + $ifexpr = null; + if ($stream->nextIf(Token::NAME_TYPE, 'if')) { + $ifexpr = $this->parser->getExpressionParser()->parseExpression(); + } + + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideForFork']); + if ('else' == $stream->next()->getValue()) { + $stream->expect(Token::BLOCK_END_TYPE); + $else = $this->parser->subparse([$this, 'decideForEnd'], true); + } else { + $else = null; + } + $stream->expect(Token::BLOCK_END_TYPE); + + if (\count($targets) > 1) { + $keyTarget = $targets->getNode(0); + $keyTarget = new AssignNameExpression($keyTarget->getAttribute('name'), $keyTarget->getTemplateLine()); + $valueTarget = $targets->getNode(1); + $valueTarget = new AssignNameExpression($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); + } else { + $keyTarget = new AssignNameExpression('_key', $lineno); + $valueTarget = $targets->getNode(0); + $valueTarget = new AssignNameExpression($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); + } + + if ($ifexpr) { + $this->checkLoopUsageCondition($stream, $ifexpr); + $this->checkLoopUsageBody($stream, $body); + } + + return new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag()); + } + + public function decideForFork(Token $token) + { + return $token->test(['else', 'endfor']); + } + + public function decideForEnd(Token $token) + { + return $token->test('endfor'); + } + + // the loop variable cannot be used in the condition + protected function checkLoopUsageCondition(TokenStream $stream, \Twig_NodeInterface $node) + { + if ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression && 'loop' == $node->getNode('node')->getAttribute('name')) { + throw new SyntaxError('The "loop" variable cannot be used in a looping condition.', $node->getTemplateLine(), $stream->getSourceContext()); + } + + foreach ($node as $n) { + if (!$n) { + continue; + } + + $this->checkLoopUsageCondition($stream, $n); + } + } + + // check usage of non-defined loop-items + // it does not catch all problems (for instance when a for is included into another or when the variable is used in an include) + protected function checkLoopUsageBody(TokenStream $stream, \Twig_NodeInterface $node) + { + if ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression && 'loop' == $node->getNode('node')->getAttribute('name')) { + $attribute = $node->getNode('attribute'); + if ($attribute instanceof ConstantExpression && \in_array($attribute->getAttribute('value'), ['length', 'revindex0', 'revindex', 'last'])) { + throw new SyntaxError(sprintf('The "loop.%s" variable is not defined when looping with a condition.', $attribute->getAttribute('value')), $node->getTemplateLine(), $stream->getSourceContext()); + } + } + + // should check for parent.loop.XXX usage + if ($node instanceof ForNode) { + return; + } + + foreach ($node as $n) { + if (!$n) { + continue; + } + + $this->checkLoopUsageBody($stream, $n); + } + } + + public function getTag() + { + return 'for'; } } + +class_alias('Twig\TokenParser\ForTokenParser', 'Twig_TokenParser_For'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/FromTokenParser.php --- a/vendor/twig/twig/src/TokenParser/FromTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/FromTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,71 @@ parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + $stream->expect('import'); + + $targets = []; + do { + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + + $alias = $name; + if ($stream->nextIf('as')) { + $alias = $stream->expect(Token::NAME_TYPE)->getValue(); + } + + $targets[$name] = $alias; + + if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } while (true); + + $stream->expect(Token::BLOCK_END_TYPE); + + $node = new ImportNode($macro, new AssignNameExpression($this->parser->getVarName(), $token->getLine()), $token->getLine(), $this->getTag()); + + foreach ($targets as $name => $alias) { + if ($this->parser->isReservedMacroName($name)) { + throw new SyntaxError(sprintf('"%s" cannot be an imported macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext()); + } + + $this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var')); + } + + return $node; + } + + public function getTag() + { + return 'from'; } } + +class_alias('Twig\TokenParser\FromTokenParser', 'Twig_TokenParser_From'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/IfTokenParser.php --- a/vendor/twig/twig/src/TokenParser/IfTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/IfTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,91 @@ + * {% for user in users %} + *
  • {{ user.username|e }}
  • + * {% endfor %} + * + * {% endif %} + * + * @final + */ +class IfTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) { + $lineno = $token->getLine(); + $expr = $this->parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideIfFork']); + $tests = [$expr, $body]; + $else = null; + + $end = false; + while (!$end) { + switch ($stream->next()->getValue()) { + case 'else': + $stream->expect(Token::BLOCK_END_TYPE); + $else = $this->parser->subparse([$this, 'decideIfEnd']); + break; + + case 'elseif': + $expr = $this->parser->getExpressionParser()->parseExpression(); + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideIfFork']); + $tests[] = $expr; + $tests[] = $body; + break; + + case 'endif': + $end = true; + break; + + default: + throw new SyntaxError(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d).', $lineno), $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + } + + $stream->expect(Token::BLOCK_END_TYPE); + + return new IfNode(new Node($tests), $else, $lineno, $this->getTag()); + } + + public function decideIfFork(Token $token) + { + return $token->test(['elseif', 'else', 'endif']); + } + + public function decideIfEnd(Token $token) + { + return $token->test(['endif']); + } + + public function getTag() + { + return 'if'; } } + +class_alias('Twig\TokenParser\IfTokenParser', 'Twig_TokenParser_If'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/ImportTokenParser.php --- a/vendor/twig/twig/src/TokenParser/ImportTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/ImportTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,45 @@ parser->getExpressionParser()->parseExpression(); + $this->parser->getStream()->expect('as'); + $var = new AssignNameExpression($this->parser->getStream()->expect(Token::NAME_TYPE)->getValue(), $token->getLine()); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + $this->parser->addImportedSymbol('template', $var->getAttribute('name')); + + return new ImportNode($macro, $var, $token->getLine(), $this->getTag()); + } + + public function getTag() + { + return 'import'; } } + +class_alias('Twig\TokenParser\ImportTokenParser', 'Twig_TokenParser_Import'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/IncludeTokenParser.php --- a/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,68 @@ parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + return new IncludeNode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + protected function parseArguments() + { + $stream = $this->parser->getStream(); + + $ignoreMissing = false; + if ($stream->nextIf(Token::NAME_TYPE, 'ignore')) { + $stream->expect(Token::NAME_TYPE, 'missing'); + + $ignoreMissing = true; + } + + $variables = null; + if ($stream->nextIf(Token::NAME_TYPE, 'with')) { + $variables = $this->parser->getExpressionParser()->parseExpression(); + } + + $only = false; + if ($stream->nextIf(Token::NAME_TYPE, 'only')) { + $only = true; + } + + $stream->expect(Token::BLOCK_END_TYPE); + + return [$variables, $only, $ignoreMissing]; + } + + public function getTag() + { + return 'include'; } } + +class_alias('Twig\TokenParser\IncludeTokenParser', 'Twig_TokenParser_Include'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/MacroTokenParser.php --- a/vendor/twig/twig/src/TokenParser/MacroTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/MacroTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,68 @@ + * {% endmacro %} + * + * @final + */ +class MacroTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + + $arguments = $this->parser->getExpressionParser()->parseArguments(true, true); + + $stream->expect(Token::BLOCK_END_TYPE); + $this->parser->pushLocalScope(); + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + if ($token = $stream->nextIf(Token::NAME_TYPE)) { + $value = $token->getValue(); + + if ($value != $name) { + throw new SyntaxError(sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + } + $this->parser->popLocalScope(); + $stream->expect(Token::BLOCK_END_TYPE); + + $this->parser->setMacro($name, new MacroNode($name, new BodyNode([$body]), $arguments, $lineno, $this->getTag())); + + return new Node(); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endmacro'); + } + + public function getTag() + { + return 'macro'; } } + +class_alias('Twig\TokenParser\MacroTokenParser', 'Twig_TokenParser_Macro'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/SandboxTokenParser.php --- a/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,67 @@ parser->getStream(); + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + $stream->expect(Token::BLOCK_END_TYPE); + + // in a sandbox tag, only include tags are allowed + if (!$body instanceof IncludeNode) { + foreach ($body as $node) { + if ($node instanceof TextNode && ctype_space($node->getAttribute('data'))) { + continue; + } + + if (!$node instanceof IncludeNode) { + throw new SyntaxError('Only "include" tags are allowed within a "sandbox" section.', $node->getTemplateLine(), $stream->getSourceContext()); + } + } + } + + return new SandboxNode($body, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endsandbox'); + } + + public function getTag() + { + return 'sandbox'; } } + +class_alias('Twig\TokenParser\SandboxTokenParser', 'Twig_TokenParser_Sandbox'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/SetTokenParser.php --- a/vendor/twig/twig/src/TokenParser/SetTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/SetTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,74 @@ getLine(); + $stream = $this->parser->getStream(); + $names = $this->parser->getExpressionParser()->parseAssignmentExpression(); + + $capture = false; + if ($stream->nextIf(Token::OPERATOR_TYPE, '=')) { + $values = $this->parser->getExpressionParser()->parseMultitargetExpression(); + + $stream->expect(Token::BLOCK_END_TYPE); + + if (\count($names) !== \count($values)) { + throw new SyntaxError('When using set, you must have the same number of variables and assignments.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + } else { + $capture = true; + + if (\count($names) > 1) { + throw new SyntaxError('When using set with a block, you cannot have a multi-target.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + + $stream->expect(Token::BLOCK_END_TYPE); + + $values = $this->parser->subparse([$this, 'decideBlockEnd'], true); + $stream->expect(Token::BLOCK_END_TYPE); + } + + return new SetNode($capture, $names, $values, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endset'); + } + + public function getTag() + { + return 'set'; } } + +class_alias('Twig\TokenParser\SetTokenParser', 'Twig_TokenParser_Set'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php --- a/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,53 @@ + * foo + * + * {% endspaceless %} + * {# output will be
    foo
    #} + * + * @final + */ +class SpacelessTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) { + $lineno = $token->getLine(); + + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideSpacelessEnd'], true); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new SpacelessNode($body, $lineno, $this->getTag()); + } + + public function decideSpacelessEnd(Token $token) + { + return $token->test('endspaceless'); + } + + public function getTag() + { + return 'spaceless'; } } + +class_alias('Twig\TokenParser\SpacelessTokenParser', 'Twig_TokenParser_Spaceless'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/TokenParserInterface.php --- a/vendor/twig/twig/src/TokenParser/TokenParserInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/TokenParserInterface.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,51 @@ + */ +interface TokenParserInterface +{ + /** + * Sets the parser associated with this token parser. + */ + public function setParser(Parser $parser); + + /** + * Parses a token and returns a node. + * + * @return \Twig_NodeInterface + * + * @throws SyntaxError + */ + public function parse(Token $token); + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag(); } + +class_alias('Twig\TokenParser\TokenParserInterface', 'Twig_TokenParserInterface'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Token'); +class_exists('Twig\Parser'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/UseTokenParser.php --- a/vendor/twig/twig/src/TokenParser/UseTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/UseTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,75 @@ parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + + if (!$template instanceof ConstantExpression) { + throw new SyntaxError('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + + $targets = []; + if ($stream->nextIf('with')) { + do { + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + + $alias = $name; + if ($stream->nextIf('as')) { + $alias = $stream->expect(Token::NAME_TYPE)->getValue(); + } + + $targets[$name] = new ConstantExpression($alias, -1); + + if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } while (true); + } + + $stream->expect(Token::BLOCK_END_TYPE); + + $this->parser->addTrait(new Node(['template' => $template, 'targets' => new Node($targets)])); + + return new Node(); + } + + public function getTag() + { + return 'use'; } } + +class_alias('Twig\TokenParser\UseTokenParser', 'Twig_TokenParser_Use'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenParser/WithTokenParser.php --- a/vendor/twig/twig/src/TokenParser/WithTokenParser.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenParser/WithTokenParser.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,57 @@ + * + * @final + */ +class WithTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) { + $stream = $this->parser->getStream(); + + $variables = null; + $only = false; + if (!$stream->test(Token::BLOCK_END_TYPE)) { + $variables = $this->parser->getExpressionParser()->parseExpression(); + $only = $stream->nextIf(Token::NAME_TYPE, 'only'); + } + + $stream->expect(Token::BLOCK_END_TYPE); + + $body = $this->parser->subparse([$this, 'decideWithEnd'], true); + + $stream->expect(Token::BLOCK_END_TYPE); + + return new WithNode($body, $variables, $only, $token->getLine(), $this->getTag()); + } + + public function decideWithEnd(Token $token) + { + return $token->test('endwith'); + } + + public function getTag() + { + return 'with'; } } + +class_alias('Twig\TokenParser\WithTokenParser', 'Twig_TokenParser_With'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TokenStream.php --- a/vendor/twig/twig/src/TokenStream.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TokenStream.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,200 @@ + */ +class TokenStream +{ + protected $tokens; + protected $current = 0; + protected $filename; + + private $source; + + /** + * @param array $tokens An array of tokens + * @param string|null $name The name of the template which tokens are associated with + * @param string|null $source The source code associated with the tokens + */ + public function __construct(array $tokens, $name = null, $source = null) { + if (!$name instanceof Source) { + if (null !== $name || null !== $source) { + @trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + } + $this->source = new Source($source, $name); + } else { + $this->source = $name; + } + + $this->tokens = $tokens; + + // deprecated, not used anymore, to be removed in 2.0 + $this->filename = $this->source->getName(); + } + + public function __toString() + { + return implode("\n", $this->tokens); + } + + public function injectTokens(array $tokens) + { + $this->tokens = array_merge(\array_slice($this->tokens, 0, $this->current), $tokens, \array_slice($this->tokens, $this->current)); + } + + /** + * Sets the pointer to the next token and returns the old one. + * + * @return Token + */ + public function next() + { + if (!isset($this->tokens[++$this->current])) { + throw new SyntaxError('Unexpected end of template.', $this->tokens[$this->current - 1]->getLine(), $this->source); + } + + return $this->tokens[$this->current - 1]; + } + + /** + * Tests a token, sets the pointer to the next one and returns it or throws a syntax error. + * + * @return Token|null The next token if the condition is true, null otherwise + */ + public function nextIf($primary, $secondary = null) + { + if ($this->tokens[$this->current]->test($primary, $secondary)) { + return $this->next(); + } + } + + /** + * Tests a token and returns it or throws a syntax error. + * + * @return Token + */ + public function expect($type, $value = null, $message = null) + { + $token = $this->tokens[$this->current]; + if (!$token->test($type, $value)) { + $line = $token->getLine(); + throw new SyntaxError(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s).', + $message ? $message.'. ' : '', + Token::typeToEnglish($token->getType()), $token->getValue(), + Token::typeToEnglish($type), $value ? sprintf(' with value "%s"', $value) : ''), + $line, + $this->source + ); + } + $this->next(); + + return $token; + } + + /** + * Looks at the next token. + * + * @param int $number + * + * @return Token + */ + public function look($number = 1) + { + if (!isset($this->tokens[$this->current + $number])) { + throw new SyntaxError('Unexpected end of template.', $this->tokens[$this->current + $number - 1]->getLine(), $this->source); + } + + return $this->tokens[$this->current + $number]; + } + + /** + * Tests the current token. + * + * @return bool + */ + public function test($primary, $secondary = null) + { + return $this->tokens[$this->current]->test($primary, $secondary); + } + + /** + * Checks if end of stream was reached. + * + * @return bool + */ + public function isEOF() + { + return Token::EOF_TYPE === $this->tokens[$this->current]->getType(); + } + + /** + * @return Token + */ + public function getCurrent() + { + return $this->tokens[$this->current]; + } + + /** + * Gets the name associated with this stream (null if not defined). + * + * @return string|null + * + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getFilename() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->source->getName(); + } + + /** + * Gets the source code associated with this stream. + * + * @return string + * + * @internal Don't use this as it might be empty depending on the environment configuration + * + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getSource() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->source->getCode(); + } + + /** + * Gets the source associated with this stream. + * + * @return Source + * + * @internal + */ + public function getSourceContext() + { + return $this->source; } } + +class_alias('Twig\TokenStream', 'Twig_TokenStream'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TwigFilter.php --- a/vendor/twig/twig/src/TwigFilter.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TwigFilter.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,128 @@ + */ +class TwigFilter +{ + protected $name; + protected $callable; + protected $options; + protected $arguments = []; + + public function __construct($name, $callable, array $options = []) { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge([ + 'needs_environment' => false, + 'needs_context' => false, + 'is_variadic' => false, + 'is_safe' => null, + 'is_safe_callback' => null, + 'pre_escape' => null, + 'preserves_safety' => null, + 'node_class' => '\Twig\Node\Expression\FilterExpression', + 'deprecated' => false, + 'alternative' => null, + ], $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Node $filterArgs) + { + if (null !== $this->options['is_safe']) { + return $this->options['is_safe']; + } + + if (null !== $this->options['is_safe_callback']) { + return \call_user_func($this->options['is_safe_callback'], $filterArgs); + } + } + + public function getPreservesSafety() + { + return $this->options['preserves_safety']; + } + + public function getPreEscape() + { + return $this->options['pre_escape']; + } + + public function isVariadic() + { + return $this->options['is_variadic']; + } + + public function isDeprecated() + { + return (bool) $this->options['deprecated']; + } + + public function getDeprecatedVersion() + { + return $this->options['deprecated']; + } + + public function getAlternative() + { + return $this->options['alternative']; } } + +class_alias('Twig\TwigFilter', 'Twig_SimpleFilter'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Node\Node'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TwigFunction.php --- a/vendor/twig/twig/src/TwigFunction.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TwigFunction.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,118 @@ + */ +class TwigFunction +{ + protected $name; + protected $callable; + protected $options; + protected $arguments = []; + + public function __construct($name, $callable, array $options = []) { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge([ + 'needs_environment' => false, + 'needs_context' => false, + 'is_variadic' => false, + 'is_safe' => null, + 'is_safe_callback' => null, + 'node_class' => '\Twig\Node\Expression\FunctionExpression', + 'deprecated' => false, + 'alternative' => null, + ], $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Node $functionArgs) + { + if (null !== $this->options['is_safe']) { + return $this->options['is_safe']; + } + + if (null !== $this->options['is_safe_callback']) { + return \call_user_func($this->options['is_safe_callback'], $functionArgs); + } + + return []; + } + + public function isVariadic() + { + return $this->options['is_variadic']; + } + + public function isDeprecated() + { + return (bool) $this->options['deprecated']; + } + + public function getDeprecatedVersion() + { + return $this->options['deprecated']; + } + + public function getAlternative() + { + return $this->options['alternative']; } } + +class_alias('Twig\TwigFunction', 'Twig_SimpleFunction'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Node\Node'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/TwigTest.php --- a/vendor/twig/twig/src/TwigTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/TwigTest.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,87 @@ + */ +class TwigTest +{ + protected $name; + protected $callable; + protected $options; -if (\false) { - class TwigTest extends \Twig_SimpleTest + private $arguments = []; + + public function __construct($name, $callable, array $options = []) { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge([ + 'is_variadic' => false, + 'node_class' => '\Twig\Node\Expression\TestExpression', + 'deprecated' => false, + 'alternative' => null, + ], $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function isVariadic() + { + return $this->options['is_variadic']; + } + + public function isDeprecated() + { + return (bool) $this->options['deprecated']; + } + + public function getDeprecatedVersion() + { + return $this->options['deprecated']; + } + + public function getAlternative() + { + return $this->options['alternative']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; } } + +class_alias('Twig\TwigTest', 'Twig_SimpleTest'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Util/DeprecationCollector.php --- a/vendor/twig/twig/src/Util/DeprecationCollector.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Util/DeprecationCollector.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,92 @@ + * + * @final + */ +class DeprecationCollector +{ + private $twig; + private $deprecations; + + public function __construct(Environment $twig) { + $this->twig = $twig; + } + + /** + * Returns deprecations for templates contained in a directory. + * + * @param string $dir A directory where templates are stored + * @param string $ext Limit the loaded templates by extension + * + * @return array An array of deprecations + */ + public function collectDir($dir, $ext = '.twig') + { + $iterator = new \RegexIterator( + new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($dir), \RecursiveIteratorIterator::LEAVES_ONLY + ), '{'.preg_quote($ext).'$}' + ); + + return $this->collect(new TemplateDirIterator($iterator)); + } + + /** + * Returns deprecations for passed templates. + * + * @param \Traversable $iterator An iterator of templates (where keys are template names and values the contents of the template) + * + * @return array An array of deprecations + */ + public function collect(\Traversable $iterator) + { + $this->deprecations = []; + + set_error_handler([$this, 'errorHandler']); + + foreach ($iterator as $name => $contents) { + try { + $this->twig->parse($this->twig->tokenize(new Source($contents, $name))); + } catch (SyntaxError $e) { + // ignore templates containing syntax errors + } + } + + restore_error_handler(); + + $deprecations = $this->deprecations; + $this->deprecations = []; + + return $deprecations; + } + + /** + * @internal + */ + public function errorHandler($type, $msg) + { + if (E_USER_DEPRECATED === $type) { + $this->deprecations[] = $msg; + } } } + +class_alias('Twig\Util\DeprecationCollector', 'Twig_Util_DeprecationCollector'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/twig/twig/src/Util/TemplateDirIterator.php --- a/vendor/twig/twig/src/Util/TemplateDirIterator.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/twig/twig/src/Util/TemplateDirIterator.php Thu May 09 15:33:08 2019 +0100 @@ -1,11 +1,30 @@ + */ +class TemplateDirIterator extends \IteratorIterator +{ + public function current() + { + return file_get_contents(parent::current()); + } -if (\false) { - class TemplateDirIterator extends \Twig_Util_TemplateDirIterator + public function key() { + return (string) parent::key(); } } + +class_alias('Twig\Util\TemplateDirIterator', 'Twig_Util_TemplateDirIterator'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/README.md --- a/vendor/typo3/phar-stream-wrapper/README.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/typo3/phar-stream-wrapper/README.md Thu May 09 15:33:08 2019 +0100 @@ -63,7 +63,7 @@ ``` $behavior = new \TYPO3\PharStreamWrapper\Behavior(); -Manager::initialize( +\TYPO3\PharStreamWrapper\Manager::initialize( $behavior->withAssertion(new PharExtensionInterceptor()) ); @@ -90,7 +90,7 @@ + `COMMAND_UNLINK` + `COMMAND_URL_STAT` -## Interceptor +## Interceptors The following interceptor is shipped with the package and ready to use in order to block any Phar invocation of files not having a `.phar` suffix. Besides that @@ -137,9 +137,72 @@ } ``` +### ConjunctionInterceptor + +This interceptor combines multiple interceptors implementing `Assertable`. +It succeeds when all nested interceptors succeed as well (logical `AND`). + +``` +$behavior = new \TYPO3\PharStreamWrapper\Behavior(); +\TYPO3\PharStreamWrapper\Manager::initialize( + $behavior->withAssertion(new ConjunctionInterceptor(array( + new PharExtensionInterceptor(), + new PharMetaDataInterceptor() + ))) +); +``` + +### PharExtensionInterceptor + +This (basic) interceptor just checks whether the invoked Phar archive has +an according `.phar` file extension. Resolving symbolic links as well as +Phar internal alias resolving are considered as well. + +``` +$behavior = new \TYPO3\PharStreamWrapper\Behavior(); +\TYPO3\PharStreamWrapper\Manager::initialize( + $behavior->withAssertion(new PharExtensionInterceptor()) +); +``` + +### PharMetaDataInterceptor + +This interceptor is actually checking serialized Phar meta-data against +PHP objects and would consider a Phar archive malicious in case not only +scalar values are found. A custom low-level `Phar\Reader` is used in order to +avoid using PHP's `Phar` object which would trigger the initial vulnerability. + +``` +$behavior = new \TYPO3\PharStreamWrapper\Behavior(); +\TYPO3\PharStreamWrapper\Manager::initialize( + $behavior->withAssertion(new PharMetaDataInterceptor()) +); +``` + +## Reader + +* `Phar\Reader::__construct(string $fileName)`: Creates low-level reader for Phar archive +* `Phar\Reader::resolveContainer(): Phar\Container`: Resolves model representing Phar archive +* `Phar\Container::getStub(): Phar\Stub`: Resolves (plain PHP) stub section of Phar archive +* `Phar\Container::getManifest(): Phar\Manifest`: Resolves parsed Phar archive manifest as + documented at http://php.net/manual/en/phar.fileformat.manifestfile.php +* `Phar\Stub::getMappedAlias(): string`: Resolves internal Phar archive alias defined in stub + using `Phar::mapPhar('alias.phar')` - actually the plain PHP source is analyzed here +* `Phar\Manifest::getAlias(): string` - Resolves internal Phar archive alias defined in manifest + using `Phar::setAlias('alias.phar')` +* `Phar\Manifest::getMetaData(): string`: Resolves serialized Phar archive meta-data +* `Phar\Manifest::deserializeMetaData(): mixed`: Resolves deserialized Phar archive meta-data + containing only scalar values - in case an object is determined, an according + `Phar\DeserializationException` will be thrown + +``` +$reader = new Phar\Reader('example.phar'); +var_dump($reader->resolveContainer()->getManifest()->deserializeMetaData()); +``` + ## Helper -* `Helper::determineBaseFile(string $path)`: Determines base file that can be +* `Helper::determineBaseFile(string $path): string`: Determines base file that can be accessed using the regular file system. For instance the following path `phar:///home/user/bundle.phar/content.txt` would be resolved to `/home/user/bundle.phar`. diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/composer.json --- a/vendor/typo3/phar-stream-wrapper/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/typo3/phar-stream-wrapper/composer.json Thu May 09 15:33:08 2019 +0100 @@ -6,9 +6,13 @@ "homepage": "https://typo3.org/", "keywords": ["php", "phar", "stream-wrapper", "security"], "require": { - "php": "^5.3.3|^7.0" + "php": "^5.3.3|^7.0", + "ext-fileinfo": "*", + "ext-json": "*", + "brumann/polyfill-unserialize": "^1.0" }, "require-dev": { + "ext-xdebug": "*", "phpunit/phpunit": "^4.8.36" }, "autoload": { diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Collectable.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Collectable.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,37 @@ +assertAssertions($assertions); + $this->assertions = $assertions; + } + + /** + * Executes assertions based on all contained assertions. + * + * @param string $path + * @param string $command + * @return bool + * @throws Exception + */ + public function assert($path, $command) + { + if ($this->invokeAssertions($path, $command)) { + return true; + } + throw new Exception( + sprintf( + 'Assertion failed in "%s"', + $path + ), + 1539625084 + ); + } + + /** + * @param Assertable[] $assertions + */ + private function assertAssertions(array $assertions) + { + foreach ($assertions as $assertion) { + if (!$assertion instanceof Assertable) { + throw new \InvalidArgumentException( + sprintf( + 'Instance %s must implement Assertable', + get_class($assertion) + ), + 1539624719 + ); + } + } + } + + /** + * @param string $path + * @param string $command + * @return bool + */ + private function invokeAssertions($path, $command) + { + try { + foreach ($this->assertions as $assertion) { + if (!$assertion->assert($path, $command)) { + return false; + } + } + } catch (Exception $exception) { + return false; + } + return true; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Interceptor/PharExtensionInterceptor.php --- a/vendor/typo3/phar-stream-wrapper/src/Interceptor/PharExtensionInterceptor.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Interceptor/PharExtensionInterceptor.php Thu May 09 15:33:08 2019 +0100 @@ -12,8 +12,8 @@ */ use TYPO3\PharStreamWrapper\Assertable; -use TYPO3\PharStreamWrapper\Helper; use TYPO3\PharStreamWrapper\Exception; +use TYPO3\PharStreamWrapper\Manager; class PharExtensionInterceptor implements Assertable { @@ -45,11 +45,11 @@ */ private function baseFileContainsPharExtension($path) { - $baseFile = Helper::determineBaseFile($path); - if ($baseFile === null) { + $invocation = Manager::instance()->resolve($path); + if ($invocation === null) { return false; } - $fileExtension = pathinfo($baseFile, PATHINFO_EXTENSION); + $fileExtension = pathinfo($invocation->getBaseName(), PATHINFO_EXTENSION); return strtolower($fileExtension) === 'phar'; } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Interceptor/PharMetaDataInterceptor.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Interceptor/PharMetaDataInterceptor.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,73 @@ +baseFileDoesNotHaveMetaDataIssues($path)) { + return true; + } + throw new Exception( + sprintf( + 'Problematic meta-data in "%s"', + $path + ), + 1539632368 + ); + } + + /** + * @param string $path + * @return bool + */ + private function baseFileDoesNotHaveMetaDataIssues($path) + { + $invocation = Manager::instance()->resolve($path); + if ($invocation === null) { + return false; + } + // directly return in case invocation was checked before + if ($invocation->getVariable(__CLASS__) === true) { + return true; + } + // otherwise analyze meta-data + try { + $reader = new Reader($invocation->getBaseName()); + $reader->resolveContainer()->getManifest()->deserializeMetaData(); + $invocation->setVariable(__CLASS__, true); + } catch (DeserializationException $exception) { + return false; + } + return true; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Manager.php --- a/vendor/typo3/phar-stream-wrapper/src/Manager.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Manager.php Thu May 09 15:33:08 2019 +0100 @@ -11,7 +11,11 @@ * The TYPO3 project - inspiring people to share! */ -class Manager implements Assertable +use TYPO3\PharStreamWrapper\Resolver\PharInvocation; +use TYPO3\PharStreamWrapper\Resolver\PharInvocationCollection; +use TYPO3\PharStreamWrapper\Resolver\PharInvocationResolver; + +class Manager { /** * @var self @@ -24,13 +28,28 @@ private $behavior; /** + * @var Resolvable + */ + private $resolver; + + /** + * @var Collectable + */ + private $collection; + + /** * @param Behavior $behaviour + * @param Resolvable $resolver + * @param Collectable $collection * @return self */ - public static function initialize(Behavior $behaviour) - { + public static function initialize( + Behavior $behaviour, + Resolvable $resolver = null, + Collectable $collection = null + ) { if (self::$instance === null) { - self::$instance = new self($behaviour); + self::$instance = new self($behaviour, $resolver, $collection); return self::$instance; } throw new \LogicException( @@ -67,9 +86,22 @@ /** * @param Behavior $behaviour + * @param Resolvable $resolver + * @param Collectable $collection */ - private function __construct(Behavior $behaviour) - { + private function __construct( + Behavior $behaviour, + Resolvable $resolver = null, + Collectable $collection = null + ) { + if ($collection === null) { + $collection = new PharInvocationCollection(); + } + if ($resolver === null) { + $resolver = new PharInvocationResolver(); + } + $this->collection = $collection; + $this->resolver = $resolver; $this->behavior = $behaviour; } @@ -82,4 +114,22 @@ { return $this->behavior->assert($path, $command); } + + /** + * @param string $path + * @param null|int $flags + * @return null|PharInvocation + */ + public function resolve($path, $flags = null) + { + return $this->resolver->resolve($path, $flags); + } + + /** + * @return Collectable + */ + public function getCollection() + { + return $this->collection; + } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Phar/Container.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Phar/Container.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,59 @@ +stub = $stub; + $this->manifest = $manifest; + } + + /** + * @return Stub + */ + public function getStub() + { + return $this->stub; + } + + /** + * @return Manifest + */ + public function getManifest() + { + return $this->manifest; + } + + /** + * @return string + */ + public function getAlias() + { + return $this->manifest->getAlias() ?: $this->stub->getMappedAlias(); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Phar/DeserializationException.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Phar/DeserializationException.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,18 @@ +manifestLength = Reader::resolveFourByteLittleEndian($content, 0); + $target->amountOfFiles = Reader::resolveFourByteLittleEndian($content, 4); + $target->flags = Reader::resolveFourByteLittleEndian($content, 10); + $target->aliasLength = Reader::resolveFourByteLittleEndian($content, 14); + $target->alias = substr($content, 18, $target->aliasLength); + $target->metaDataLength = Reader::resolveFourByteLittleEndian($content, 18 + $target->aliasLength); + $target->metaData = substr($content, 22 + $target->aliasLength, $target->metaDataLength); + + $apiVersionNibbles = Reader::resolveTwoByteBigEndian($content, 8); + $target->apiVersion = implode('.', array( + ($apiVersionNibbles & 0xf000) >> 12, + ($apiVersionNibbles & 0x0f00) >> 8, + ($apiVersionNibbles & 0x00f0) >> 4, + )); + + return $target; + } + + /** + * @var int + */ + private $manifestLength; + + /** + * @var int + */ + private $amountOfFiles; + + /** + * @var string + */ + private $apiVersion; + + /** + * @var int + */ + private $flags; + + /** + * @var int + */ + private $aliasLength; + + /** + * @var string + */ + private $alias; + + /** + * @var int + */ + private $metaDataLength; + + /** + * @var string + */ + private $metaData; + + /** + * Avoid direct instantiation. + */ + private function __construct() + { + } + + /** + * @return int + */ + public function getManifestLength() + { + return $this->manifestLength; + } + + /** + * @return int + */ + public function getAmountOfFiles() + { + return $this->amountOfFiles; + } + + /** + * @return string + */ + public function getApiVersion() + { + return $this->apiVersion; + } + + /** + * @return int + */ + public function getFlags() + { + return $this->flags; + } + + /** + * @return int + */ + public function getAliasLength() + { + return $this->aliasLength; + } + + /** + * @return string + */ + public function getAlias() + { + return $this->alias; + } + + /** + * @return int + */ + public function getMetaDataLength() + { + return $this->metaDataLength; + } + + /** + * @return string + */ + public function getMetaData() + { + return $this->metaData; + } + + /** + * @return mixed|null + */ + public function deserializeMetaData() + { + if (empty($this->metaData)) { + return null; + } + + $result = Unserialize::unserialize($this->metaData, array('allowed_classes' => false)); + + $serialized = json_encode($result); + if (strpos($serialized, '__PHP_Incomplete_Class_Name') !== false) { + throw new DeserializationException( + 'Meta-data contains serialized object', + 1539623382 + ); + } + + return $result; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Phar/Reader.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Phar/Reader.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,220 @@ +fileName = $fileName; + $this->fileType = $this->determineFileType(); + } + + /** + * @return Container + */ + public function resolveContainer() + { + $data = $this->extractData($this->resolveStream() . $this->fileName); + + if ($data['stubContent'] === null) { + throw new ReaderException( + 'Cannot resolve stub', + 1547807881 + ); + } + if ($data['manifestContent'] === null || $data['manifestLength'] === null) { + throw new ReaderException( + 'Cannot resolve manifest', + 1547807882 + ); + } + if (strlen($data['manifestContent']) < $data['manifestLength']) { + throw new ReaderException( + sprintf( + 'Exected manifest length %d, got %d', + strlen($data['manifestContent']), + $data['manifestLength'] + ), + 1547807883 + ); + } + + return new Container( + Stub::fromContent($data['stubContent']), + Manifest::fromContent($data['manifestContent']) + ); + } + + /** + * @param string $fileName e.g. '/path/file.phar' or 'compress.zlib:///path/file.phar' + * @return array + */ + private function extractData($fileName) + { + $stubContent = null; + $manifestContent = null; + $manifestLength = null; + + $resource = fopen($fileName, 'r'); + if (!is_resource($resource)) { + throw new ReaderException( + sprintf('Resource %s could not be opened', $fileName), + 1547902055 + ); + } + + while (!feof($resource)) { + $line = fgets($resource); + // stop reading file when manifest can be extracted + if ($manifestLength !== null && $manifestContent !== null && strlen($manifestContent) >= $manifestLength) { + break; + } + + $manifestPosition = strpos($line, '__HALT_COMPILER();'); + + // first line contains start of manifest + if ($stubContent === null && $manifestContent === null && $manifestPosition !== false) { + $stubContent = substr($line, 0, $manifestPosition - 1); + $manifestContent = preg_replace('#^.*__HALT_COMPILER\(\);(?>[ \n]\?>(?>\r\n|\n)?)?#', '', $line); + $manifestLength = $this->resolveManifestLength($manifestContent); + // line contains start of stub + } elseif ($stubContent === null) { + $stubContent = $line; + // line contains start of manifest + } elseif ($manifestContent === null && $manifestPosition !== false) { + $manifestContent = preg_replace('#^.*__HALT_COMPILER\(\);(?>[ \n]\?>(?>\r\n|\n)?)?#', '', $line); + $manifestLength = $this->resolveManifestLength($manifestContent); + // manifest has been started (thus is cannot be stub anymore), add content + } elseif ($manifestContent !== null) { + $manifestContent .= $line; + $manifestLength = $this->resolveManifestLength($manifestContent); + // stub has been started (thus cannot be manifest here, yet), add content + } elseif ($stubContent !== null) { + $stubContent .= $line; + } + } + fclose($resource); + + return array( + 'stubContent' => $stubContent, + 'manifestContent' => $manifestContent, + 'manifestLength' => $manifestLength, + ); + } + + /** + * Resolves stream in order to handle compressed Phar archives. + * + * @return string + */ + private function resolveStream() + { + if ($this->fileType === 'application/x-gzip') { + return 'compress.zlib://'; + } elseif ($this->fileType === 'application/x-bzip2') { + return 'compress.bzip2://'; + } + return ''; + } + + /** + * @return string + */ + private function determineFileType() + { + $fileInfo = new \finfo(); + return $fileInfo->file($this->fileName, FILEINFO_MIME_TYPE); + } + + /** + * @param string $content + * @return int|null + */ + private function resolveManifestLength($content) + { + if (strlen($content) < 4) { + return null; + } + return static::resolveFourByteLittleEndian($content, 0); + } + + /** + * @param string $content + * @param int $start + * @return int + */ + public static function resolveFourByteLittleEndian($content, $start) + { + $payload = substr($content, $start, 4); + if (!is_string($payload)) { + throw new ReaderException( + sprintf('Cannot resolve value at offset %d', $start), + 1539614260 + ); + } + + $value = unpack('V', $payload); + if (!isset($value[1])) { + throw new ReaderException( + sprintf('Cannot resolve value at offset %d', $start), + 1539614261 + ); + } + return $value[1]; + } + + /** + * @param string $content + * @param int $start + * @return int + */ + public static function resolveTwoByteBigEndian($content, $start) + { + $payload = substr($content, $start, 2); + if (!is_string($payload)) { + throw new ReaderException( + sprintf('Cannot resolve value at offset %d', $start), + 1539614263 + ); + } + + $value = unpack('n', $payload); + if (!isset($value[1])) { + throw new ReaderException( + sprintf('Cannot resolve value at offset %d', $start), + 1539614264 + ); + } + return $value[1]; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Phar/ReaderException.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Phar/ReaderException.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,18 @@ +content = $content; + + if ( + stripos($content, 'Phar::mapPhar(') !== false + && preg_match('#Phar\:\:mapPhar\(([^)]+)\)#', $content, $matches) + ) { + // remove spaces, single & double quotes + // @todo `'my' . 'alias' . '.phar'` is not evaluated here + $target->mappedAlias = trim($matches[1], ' \'"'); + } + + return $target; + } + + /** + * @var string + */ + private $content; + + /** + * @var string + */ + private $mappedAlias = ''; + + /** + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * @return string + */ + public function getMappedAlias() + { + return $this->mappedAlias; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/PharStreamWrapper.php --- a/vendor/typo3/phar-stream-wrapper/src/PharStreamWrapper.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/PharStreamWrapper.php Thu May 09 15:33:08 2019 +0100 @@ -11,6 +11,8 @@ * The TYPO3 project - inspiring people to share! */ +use TYPO3\PharStreamWrapper\Resolver\PharInvocation; + class PharStreamWrapper { /** @@ -30,6 +32,11 @@ protected $internalResource; /** + * @var PharInvocation + */ + protected $invocation; + + /** * @return bool */ public function dir_closedir() @@ -409,7 +416,8 @@ */ protected function assert($path, $command) { - if ($this->resolveAssertable()->assert($path, $command) === true) { + if (Manager::instance()->assert($path, $command) === true) { + $this->collectInvocation($path); return; } @@ -424,7 +432,33 @@ } /** - * @return Assertable + * @param string $path + */ + protected function collectInvocation($path) + { + if (isset($this->invocation)) { + return; + } + + $manager = Manager::instance(); + $this->invocation = $manager->resolve($path); + if ($this->invocation === null) { + throw new Exception( + 'Expected invocation could not be resolved', + 1556389591 + ); + } + // confirm, previous interceptor(s) validated invocation + $this->invocation->confirm(); + $collection = $manager->getCollection(); + if (!$collection->has($this->invocation)) { + $collection->collect($this->invocation); + } + } + + /** + * @return Manager|Assertable + * @deprecated Use Manager::instance() directly */ protected function resolveAssertable() { diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Resolvable.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Resolvable.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,24 @@ +baseName = $baseName; + $this->alias = $alias; + } + + /** + * @return string + */ + public function __toString() + { + return $this->baseName; + } + + /** + * @return string + */ + public function getBaseName() + { + return $this->baseName; + } + + /** + * @return null|string + */ + public function getAlias() + { + return $this->alias; + } + + /** + * @return bool + */ + public function isConfirmed() + { + return $this->confirmed; + } + + public function confirm() + { + $this->confirmed = true; + } + + /** + * @param string $name + * @return mixed|null + */ + public function getVariable($name) + { + if (!isset($this->variables[$name])) { + return null; + } + return $this->variables[$name]; + } + + /** + * @param string $name + * @param mixed $value + */ + public function setVariable($name, $value) + { + $this->variables[$name] = $value; + } + + /** + * @param PharInvocation $other + * @return bool + */ + public function equals(PharInvocation $other) + { + return $other->baseName === $this->baseName + && $other->alias === $this->alias; + } +} \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Resolver/PharInvocationCollection.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Resolver/PharInvocationCollection.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,156 @@ +invocations, true); + } + + /** + * @param PharInvocation $invocation + * @param null|int $flags + * @return bool + */ + public function collect(PharInvocation $invocation, $flags = null) + { + if ($flags === null) { + $flags = static::UNIQUE_INVOCATION | static::DUPLICATE_ALIAS_WARNING; + } + if ($invocation->getBaseName() === '' + || $invocation->getAlias() === '' + || !$this->assertUniqueBaseName($invocation, $flags) + || !$this->assertUniqueInvocation($invocation, $flags) + ) { + return false; + } + if ($flags & static::DUPLICATE_ALIAS_WARNING) { + $this->triggerDuplicateAliasWarning($invocation); + } + + $this->invocations[] = $invocation; + return true; + } + + /** + * @param callable $callback + * @param bool $reverse + * @return null|PharInvocation + */ + public function findByCallback($callback, $reverse = false) + { + foreach ($this->getInvocations($reverse) as $invocation) { + if (call_user_func($callback, $invocation) === true) { + return $invocation; + } + } + return null; + } + + /** + * Asserts that base-name is unique. This disallows having multiple invocations for + * same base-name but having different alias names. + * + * @param PharInvocation $invocation + * @param int $flags + * @return bool + */ + private function assertUniqueBaseName(PharInvocation $invocation, $flags) + { + if (!($flags & static::UNIQUE_BASE_NAME)) { + return true; + } + return $this->findByCallback( + function (PharInvocation $candidate) use ($invocation) { + return $candidate->getBaseName() === $invocation->getBaseName(); + } + ) === null; + } + + /** + * Asserts that combination of base-name and alias is unique. This allows having multiple + * invocations for same base-name but having different alias names (for whatever reason). + * + * @param PharInvocation $invocation + * @param int $flags + * @return bool + */ + private function assertUniqueInvocation(PharInvocation $invocation, $flags) + { + if (!($flags & static::UNIQUE_INVOCATION)) { + return true; + } + return $this->findByCallback( + function (PharInvocation $candidate) use ($invocation) { + return $candidate->equals($invocation); + } + ) === null; + } + + /** + * Triggers warning for invocations with same alias and same confirmation state. + * + * @param PharInvocation $invocation + * @see \TYPO3\PharStreamWrapper\PharStreamWrapper::collectInvocation() + */ + private function triggerDuplicateAliasWarning(PharInvocation $invocation) + { + $sameAliasInvocation = $this->findByCallback( + function (PharInvocation $candidate) use ($invocation) { + return $candidate->isConfirmed() === $invocation->isConfirmed() + && $candidate->getAlias() === $invocation->getAlias(); + }, + true + ); + if ($sameAliasInvocation === null) { + return; + } + trigger_error( + sprintf( + 'Alias %s cannot be used by %s, already used by %s', + $invocation->getAlias(), + $invocation->getBaseName(), + $sameAliasInvocation->getBaseName() + ), + E_USER_WARNING + ); + } + + /** + * @param bool $reverse + * @return PharInvocation[] + */ + private function getInvocations($reverse = false) + { + if ($reverse) { + return array_reverse($this->invocations); + } + return $this->invocations; + } +} \ No newline at end of file diff -r 129ea1e6d783 -r af1871eacc83 vendor/typo3/phar-stream-wrapper/src/Resolver/PharInvocationResolver.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/typo3/phar-stream-wrapper/src/Resolver/PharInvocationResolver.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,241 @@ +findByAlias($path); + if ($invocation !== null) { + return $invocation; + } + } + + $baseName = $this->resolveBaseName($path, $flags); + if ($baseName === null) { + return null; + } + + if ($flags & static::RESOLVE_REALPATH) { + $baseName = $this->baseNames[$baseName]; + } + + return $this->retrieveInvocation($baseName, $flags); + } + + /** + * Retrieves PharInvocation, either existing in collection or created on demand + * with resolving a potential alias name used in the according Phar archive. + * + * @param string $baseName + * @param int $flags + * @return PharInvocation + */ + private function retrieveInvocation($baseName, $flags) + { + $invocation = $this->findByBaseName($baseName); + if ($invocation !== null) { + return $invocation; + } + + if ($flags & static::RESOLVE_ALIAS) { + $reader = new Reader($baseName); + $alias = $reader->resolveContainer()->getAlias(); + } else { + $alias = ''; + } + // add unconfirmed(!) new invocation to collection + $invocation = new PharInvocation($baseName, $alias); + Manager::instance()->getCollection()->collect($invocation); + return $invocation; + } + + /** + * @param string $path + * @param int $flags + * @return null|string + */ + private function resolveBaseName($path, $flags) + { + $baseName = $this->findInBaseNames($path); + if ($baseName !== null) { + return $baseName; + } + + $baseName = Helper::determineBaseFile($path); + if ($baseName !== null) { + $this->addBaseName($baseName); + return $baseName; + } + + $possibleAlias = $this->resolvePossibleAlias($path); + if (!($flags & static::RESOLVE_ALIAS) || $possibleAlias === null) { + return null; + } + + $trace = debug_backtrace(); + foreach ($trace as $item) { + if (!isset($item['function']) || !isset($item['args'][0]) + || !in_array($item['function'], $this->invocationFunctionNames, true)) { + continue; + } + $currentPath = $item['args'][0]; + if (Helper::hasPharPrefix($currentPath)) { + continue; + } + $currentBaseName = Helper::determineBaseFile($currentPath); + if ($currentBaseName === null) { + continue; + } + // ensure the possible alias name (how we have been called initially) matches + // the resolved alias name that was retrieved by the current possible base name + $reader = new Reader($currentBaseName); + $currentAlias = $reader->resolveContainer()->getAlias(); + if ($currentAlias !== $possibleAlias) { + continue; + } + $this->addBaseName($currentBaseName); + return $currentBaseName; + } + + return null; + } + + /** + * @param string $path + * @return null|string + */ + private function resolvePossibleAlias($path) + { + $normalizedPath = Helper::normalizePath($path); + return strstr($normalizedPath, '/', true) ?: null; + } + + /** + * @param string $baseName + * @return null|PharInvocation + */ + private function findByBaseName($baseName) + { + return Manager::instance()->getCollection()->findByCallback( + function (PharInvocation $candidate) use ($baseName) { + return $candidate->getBaseName() === $baseName; + }, + true + ); + } + + /** + * @param string $path + * @return null|string + */ + private function findInBaseNames($path) + { + // return directly if the resolved base name was submitted + if (in_array($path, $this->baseNames, true)) { + return $path; + } + + $parts = explode('/', Helper::normalizePath($path)); + + while (count($parts)) { + $currentPath = implode('/', $parts); + if (isset($this->baseNames[$currentPath])) { + return $currentPath; + } + array_pop($parts); + } + + return null; + } + + /** + * @param string $baseName + */ + private function addBaseName($baseName) + { + if (isset($this->baseNames[$baseName])) { + return; + } + $this->baseNames[$baseName] = realpath($baseName); + } + + /** + * Finds confirmed(!) invocations by alias. + * + * @param string $path + * @return null|PharInvocation + * @see \TYPO3\PharStreamWrapper\PharStreamWrapper::collectInvocation() + */ + private function findByAlias($path) + { + $possibleAlias = $this->resolvePossibleAlias($path); + if ($possibleAlias === null) { + return null; + } + return Manager::instance()->getCollection()->findByCallback( + function (PharInvocation $candidate) use ($possibleAlias) { + return $candidate->isConfirmed() && $candidate->getAlias() === $possibleAlias; + }, + true + ); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/.gitignore Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,2 @@ +/composer.lock +/vendor/ diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/.styleci.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/.styleci.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,1 @@ +preset: psr2 diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/.travis.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/.travis.yml Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,16 @@ +language: php +php: + - 5.5 + - 5.6 + - 7.0 + +sudo: false + +before_install: + - phpenv config-rm xdebug.ini + +install: + - composer --verbose install + +script: + - ./vendor/bin/phpunit diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/README.md Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,25 @@ +# Drupal Finder + +[![Travis](https://img.shields.io/travis/webflo/drupal-finder.svg)](https://travis-ci.org/webflo/drupal-finder) [![Packagist](https://img.shields.io/packagist/v/webflo/drupal-finder.svg)](https://packagist.org/packages/webflo/drupal-finder) + +Drupal Finder provides a class to locate a Drupal installation in a given path. + +## Usage + +```PHP +$drupalFinder = new \DrupalFinder\DrupalFinder(); +if ($drupalFinder->locateRoot(getcwd())) { + $drupalRoot = $drupalFinder->getDrupalRoot(); + $composerRoot = $drupalFinder->getComposerRoot(); + ... +} +``` + +## Examples + +- [Drupal Console Launcher](https://github.com/hechoendrupal/drupal-console-launcher) +- [Drush Launcher](https://github.com/drush-ops/drush-launcher) + +## License + +GPL-2.0+ diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/composer.json Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,27 @@ +{ + "name": "webflo/drupal-finder", + "description": "Helper class to locate a Drupal installation from a given path.", + "license": "GPL-2.0+", + "type": "library", + "authors": [ + { + "name": "Florian Weber", + "email": "florian@webflo.org" + } + ], + "require": {}, + "autoload": { + "classmap": [ + "src/DrupalFinder.php" + ] + }, + "autoload-dev": { + "psr-4": { + "DrupalFinder\\Tests\\": "tests/" + } + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "mikey179/vfsStream": "^1.6" + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/phpunit.xml.dist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/phpunit.xml.dist Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,8 @@ + + + + + ./tests + + + diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/src/DrupalFinder.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/src/DrupalFinder.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,169 @@ +drupalRoot = false; + $this->composerRoot = false; + $this->vendorDir = false; + + foreach (array(true, false) as $follow_symlinks) { + $path = $start_path; + if ($follow_symlinks && is_link($path)) { + $path = realpath($path); + } + // Check the start path. + if ($this->isValidRoot($path)) { + return true; + } else { + // Move up dir by dir and check each. + while ($path = $this->shiftPathUp($path)) { + if ($follow_symlinks && is_link($path)) { + $path = realpath($path); + } + if ($this->isValidRoot($path)) { + return true; + } + } + } + } + + return false; + } + + /** + * Returns parent directory. + * + * @param string + * Path to start from + * + * @return string|false + * Parent path of given path or false when $path is filesystem root + */ + private function shiftPathUp($path) + { + $parent = dirname($path); + + return in_array($parent, ['.', $path]) ? false : $parent; + } + + /** + * @param $path + * + * @return bool + */ + protected function isValidRoot($path) + { + if (!empty($path) && is_dir($path) && file_exists($path . '/autoload.php') && file_exists($path . '/' . $this->getComposerFileName())) { + // Additional check for the presence of core/composer.json to + // grant it is not a Drupal 7 site with a base folder named "core". + $candidate = 'core/includes/common.inc'; + if (file_exists($path . '/' . $candidate) && file_exists($path . '/core/core.services.yml')) { + if (file_exists($path . '/core/misc/drupal.js') || file_exists($path . '/core/assets/js/drupal.js')) { + $this->composerRoot = $path; + $this->drupalRoot = $path; + $this->vendorDir = $this->composerRoot . '/vendor'; + } + } + } + if (!empty($path) && is_dir($path) && file_exists($path . '/' . $this->getComposerFileName())) { + $json = json_decode( + file_get_contents($path . '/' . $this->getComposerFileName()), + true + ); + if (is_array($json)) { + if (isset($json['extra']['installer-paths']) && is_array($json['extra']['installer-paths'])) { + foreach ($json['extra']['installer-paths'] as $install_path => $items) { + if (in_array('type:drupal-core', $items) || + in_array('drupal/core', $items) || + in_array('drupal/drupal', $items)) { + $this->composerRoot = $path; + // @todo: Remove this magic and detect the major version instead. + if ($install_path == 'core') { + $install_path = null; + } elseif (substr($install_path, -5) == '/core') { + $install_path = substr($install_path, 0, -5); + } + $this->drupalRoot = rtrim($path . '/' . $install_path, '/'); + $this->vendorDir = $this->composerRoot . '/vendor'; + } + } + } + } + } + if ($this->composerRoot && file_exists($this->composerRoot . '/' . $this->getComposerFileName())) { + $json = json_decode( + file_get_contents($path . '/' . $this->getComposerFileName()), + true + ); + if (is_array($json) && isset($json['config']['vendor-dir'])) { + $this->vendorDir = $this->composerRoot . '/' . $json['config']['vendor-dir']; + } + } + + return $this->drupalRoot && $this->composerRoot && $this->vendorDir; + } + + /** + * @return string + */ + public function getDrupalRoot() + { + return $this->drupalRoot; + } + + /** + * @return string + */ + public function getComposerRoot() + { + return $this->composerRoot; + } + + /** + * @return string + */ + protected function getComposerFileName() + { + return trim(getenv('COMPOSER')) ?: 'composer.json'; + } + + /** + * @return string + */ + public function getVendorDir() + { + return $this->vendorDir; + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/tests/Drupal7FinderTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/tests/Drupal7FinderTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,168 @@ + [ + 'common.inc' => '', + ], + 'misc' => [ + 'drupal.js' => '', + ], + 'sites' => [ + 'all' => [ + 'modules' => [] + ] + ] + ]; + + /** + * @return array + */ + protected function getDrupalComposerStructure() + { + $fileStructure = [ + 'web' => static::$fileStructure, + 'composer.json' => [ + 'require' => [ + 'drupal/drupal' => '*', + ], + 'extra' => [ + 'installer-paths' => [ + 'web/' => [ + 'type:drupal-core', + ], + ], + ], + ], + 'vendor' => [], + ]; + return $fileStructure; + } + + public function testDrupalComposerStructure() + { + $fileStructure = $this->getDrupalComposerStructure(); + $this->assertComposerStructure($fileStructure); + } + + public function testDrupalComposerStructureWithoutRequire() + { + $fileStructure = [ + 'web' => static::$fileStructure, + 'composer.json' => [ + 'extra' => [ + 'installer-paths' => [ + 'web' => [ + 'drupal/drupal', + ], + ], + ], + ], + ]; + $this->assertComposerStructure($fileStructure); + } + + public function testNoDrupalRootWithRealFilesystem() + { + $root = $this->tempdir(sys_get_temp_dir()); + + $this->assertFalse($this->finder->locateRoot($root)); + $this->assertFalse($this->finder->getDrupalRoot()); + $this->assertFalse($this->finder->getComposerRoot()); + $this->assertFalse($this->finder->getVendorDir()); + } + + public function testDrupalComposerStructureWithRealFilesystem() + { + $root = $this->tempdir(sys_get_temp_dir()); + $this->dumpToFileSystem($this->getDrupalComposerStructure(), $root); + + $this->assertTrue($this->finder->locateRoot($root)); + $this->assertSame($root . '/web', $this->finder->getDrupalRoot()); + $this->assertSame($root, $this->finder->getComposerRoot()); + $this->assertSame($root . '/vendor', $this->finder->getVendorDir()); + + // Test symlink implementation + $symlink = $this->tempdir(sys_get_temp_dir()); + $this->symlink($root, $symlink . '/foo'); + + $this->assertTrue($this->finder->locateRoot($symlink . '/foo')); + $this->assertSame($root . '/web', $this->finder->getDrupalRoot()); + $this->assertSame($root, $this->finder->getComposerRoot()); + $this->assertSame($root . '/vendor', $this->finder->getVendorDir()); + } + + public function testDrupalWithLinkedModule() + { + $root = $this->tempdir(sys_get_temp_dir()); + $this->dumpToFileSystem($this->getDrupalComposerStructure(), $root); + + $module = $this->tempdir(sys_get_temp_dir()); + $module_link = $root . '/web/sites/all/modules/foo'; + $this->symlink($module, $module_link); + + $this->assertTrue($this->finder->locateRoot($module_link)); + $this->assertSame($root . '/web', realpath($this->finder->getDrupalRoot())); + $this->assertSame($root, realpath($this->finder->getComposerRoot())); + $this->assertSame($root . '/vendor', realpath($this->finder->getVendorDir())); + } + + public function testDrupalWithCustomVendor() + { + $root = $this->tempdir(sys_get_temp_dir()); + $fileStructure = $this->getDrupalComposerStructure(); + $composerJson = $fileStructure['composer.json']; + $composerJson['config']['vendor-dir'] = 'vendor-foo'; + $fileStructure['composer.json'] = $composerJson; + $fileStructure['vendor-foo'] = []; + $this->dumpToFileSystem($fileStructure, $root); + + $this->assertTrue($this->finder->locateRoot($root)); + $this->assertSame($root . '/web', realpath($this->finder->getDrupalRoot())); + $this->assertSame($root, realpath($this->finder->getComposerRoot())); + $this->assertSame($root . '/vendor-foo', realpath($this->finder->getVendorDir())); + } + + /** + * @param $fileStructure + */ + protected function assertComposerStructure($fileStructure) + { + $fileStructure = $this->prepareFileStructure($fileStructure); + $root = vfsStream::setup('root', null, $fileStructure); + $this->assertTrue($this->finder->locateRoot($root->url() . '/web')); + $this->assertSame('vfs://root/web', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $this->assertTrue($this->finder->locateRoot($root->url() . '/web/misc')); + $this->assertSame('vfs://root/web', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $this->assertTrue($this->finder->locateRoot($root->url())); + $this->assertSame('vfs://root/web', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $root = vfsStream::setup( + 'root', + null, + ['nested_folder' => $fileStructure] + ); + $this->assertFalse($this->finder->locateRoot($root->url())); + $this->assertFalse($this->finder->getDrupalRoot()); + $this->assertFalse($this->finder->getComposerRoot()); + $this->assertFalse($this->finder->getVendorDir()); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/tests/Drupal8FinderTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/tests/Drupal8FinderTest.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,282 @@ + '', + 'composer.json' => [ + 'extra' => [ + 'installer-paths' => [ + 'core' => [ + 'type:drupal-core' + ] + ] + ] + ], + 'core' => [ + 'includes' => [ + 'common.inc' => '', + ], + 'misc' => [ + 'drupal.js' => '', + ], + 'core.services.yml' => '', + ], + 'modules' => [], + 'vendor' => [], + ]; + + /** + * @return array + */ + protected function getDrupalComposerStructure() + { + $fileStructure = [ + 'web' => static::$fileStructure, + 'composer.json' => [ + 'require' => [ + 'drupal/core' => '*', + ], + 'extra' => [ + 'installer-paths' => [ + 'web/core' => [ + 'type:drupal-core', + ], + ], + ], + ], + 'vendor' => [], + ]; + unset($fileStructure['web']['composer.json']); + unset($fileStructure['web']['vendor']); + + return $fileStructure; + } + + protected function setUp() + { + parent::setUp(); + $this->finder = new \DrupalFinder\DrupalFinder(); + } + + public function testDrupalDefaultStructure() + { + $root = vfsStream::setup('root', null, $this->prepareFileStructure(static::$fileStructure)); + + $this->assertTrue($this->finder->locateRoot($root->url())); + $this->assertSame('vfs://root', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $this->assertTrue($this->finder->locateRoot($root->url() . '/misc')); + $this->assertSame('vfs://root', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $root = vfsStream::setup( + 'root', + null, + ['project' => $this->prepareFileStructure(static::$fileStructure)] + ); + $this->assertFalse( + $this->finder->locateRoot($root->url()), + 'Not in the scope of the project' + ); + $this->assertFalse($this->finder->getDrupalRoot()); + $this->assertFalse($this->finder->getComposerRoot()); + $this->assertFalse($this->finder->getVendorDir()); + } + + public function testDrupalComposerStructure() + { + $fileStructure = $this->getDrupalComposerStructure(); + $this->assertComposerStructure($fileStructure); + } + + public function testDrupalComposerStructureWithCustomRoot() + { + $fileStructure = [ + 'src' => static::$fileStructure, + 'composer.json' => [ + 'require' => [ + 'drupal/core' => '*', + ], + 'extra' => [ + 'installer-paths' => [ + 'src/core' => [ + 'type:drupal-core', + ], + ], + ], + ], + 'vendor' => [], + ]; + unset($fileStructure['src']['composer.json']); + unset($fileStructure['src']['vendor']); + + $fileStructure = $this->prepareFileStructure($fileStructure); + $root = vfsStream::setup('root', null, $fileStructure); + $this->assertTrue($this->finder->locateRoot($root->url() . '/src')); + $this->assertSame('vfs://root/src', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $this->assertTrue($this->finder->locateRoot($root->url() . '/src/misc')); + $this->assertSame('vfs://root/src', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $this->assertTrue($this->finder->locateRoot($root->url())); + $this->assertSame('vfs://root/src', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $root = vfsStream::setup( + 'root', + null, + ['nested_folder' => $fileStructure] + ); + $this->assertFalse($this->finder->locateRoot($root->url())); + $this->assertFalse($this->finder->getDrupalRoot()); + $this->assertFalse($this->finder->getComposerRoot()); + $this->assertFalse($this->finder->getVendorDir()); + } + + public function testDrupalComposerStructureWithoutRequire() + { + $fileStructure = [ + 'web' => static::$fileStructure, + 'composer.json' => [ + 'extra' => [ + 'installer-paths' => [ + 'web/core' => [ + 'drupal/core', + ], + ], + ], + ], + ]; + unset($fileStructure['web']['composer.json']); + $this->assertComposerStructure($fileStructure); + } + + public function testNoDrupalRootWithRealFilesystem() + { + $root = $this->tempdir(sys_get_temp_dir()); + + $this->assertFalse($this->finder->locateRoot($root)); + $this->assertFalse($this->finder->getDrupalRoot()); + $this->assertFalse($this->finder->getComposerRoot()); + $this->assertFalse($this->finder->getVendorDir()); + } + + public function testDrupalDefaultStructureWithRealFilesystem() + { + $root = $this->tempdir(sys_get_temp_dir()); + $this->dumpToFileSystem(static::$fileStructure, $root); + + $this->assertTrue($this->finder->locateRoot($root)); + $this->assertSame($root, $this->finder->getDrupalRoot()); + $this->assertSame($root, $this->finder->getComposerRoot()); + $this->assertSame($root . '/vendor', $this->finder->getVendorDir()); + + // Test symlink implementation + $symlink = $this->tempdir(sys_get_temp_dir()); + $this->symlink($root, $symlink . '/foo'); + + $this->assertTrue($this->finder->locateRoot($symlink . '/foo')); + $this->assertSame($root, $this->finder->getDrupalRoot()); + $this->assertSame($root, $this->finder->getComposerRoot()); + $this->assertSame($root . '/vendor', $this->finder->getVendorDir()); + } + + public function testDrupalComposerStructureWithRealFilesystem() + { + $root = $this->tempdir(sys_get_temp_dir()); + $this->dumpToFileSystem($this->getDrupalComposerStructure(), $root); + + $this->assertTrue($this->finder->locateRoot($root)); + $this->assertSame($root . '/web', $this->finder->getDrupalRoot()); + $this->assertSame($root, $this->finder->getComposerRoot()); + $this->assertSame($root . '/vendor', $this->finder->getVendorDir()); + + // Test symlink implementation + $symlink = $this->tempdir(sys_get_temp_dir()); + $this->symlink($root, $symlink . '/foo'); + + $this->assertTrue($this->finder->locateRoot($symlink . '/foo')); + $this->assertSame($root . '/web', $this->finder->getDrupalRoot()); + $this->assertSame($root, $this->finder->getComposerRoot()); + $this->assertSame($root . '/vendor', $this->finder->getVendorDir()); + } + + public function testDrupalWithLinkedModule() + { + $root = $this->tempdir(sys_get_temp_dir()); + $this->dumpToFileSystem(static::$fileStructure, $root); + + $module = $this->tempdir(sys_get_temp_dir()); + $module_link = $root . '/modules/foo'; + $this->symlink($module, $module_link); + + $this->assertTrue($this->finder->locateRoot($module_link)); + $this->assertSame($root, realpath($this->finder->getDrupalRoot())); + $this->assertSame($root, realpath($this->finder->getComposerRoot())); + $this->assertSame($root . '/vendor', realpath($this->finder->getVendorDir())); + } + + public function testDrupalWithCustomVendor() + { + $root = $this->tempdir(sys_get_temp_dir()); + $fileStructure = static::$fileStructure; + $fileStructure['composer.json'] = [ + 'config' => [ + 'vendor-dir' => 'vendor-foo' + ] + ]; + $fileStructure['vendor-foo'] = []; + $this->dumpToFileSystem($fileStructure, $root); + + $this->assertTrue($this->finder->locateRoot($root)); + $this->assertSame($root, realpath($this->finder->getDrupalRoot())); + $this->assertSame($root, realpath($this->finder->getComposerRoot())); + $this->assertSame($root . '/vendor-foo', realpath($this->finder->getVendorDir())); + } + + /** + * @param $fileStructure + */ + protected function assertComposerStructure($fileStructure) + { + $fileStructure = $this->prepareFileStructure($fileStructure); + $root = vfsStream::setup('root', null, $fileStructure); + $this->assertTrue($this->finder->locateRoot($root->url() . '/web')); + $this->assertSame('vfs://root/web', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $this->assertTrue($this->finder->locateRoot($root->url() . '/web/misc')); + $this->assertSame('vfs://root/web', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $this->assertTrue($this->finder->locateRoot($root->url())); + $this->assertSame('vfs://root/web', $this->finder->getDrupalRoot()); + $this->assertSame('vfs://root', $this->finder->getComposerRoot()); + $this->assertSame('vfs://root/vendor', $this->finder->getVendorDir()); + + $root = vfsStream::setup( + 'root', + null, + ['nested_folder' => $fileStructure] + ); + $this->assertFalse($this->finder->locateRoot($root->url())); + $this->assertFalse($this->finder->getDrupalRoot()); + $this->assertFalse($this->finder->getComposerRoot()); + $this->assertFalse($this->finder->getVendorDir()); + } +} diff -r 129ea1e6d783 -r af1871eacc83 vendor/webflo/drupal-finder/tests/DrupalFinderTestBase.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/webflo/drupal-finder/tests/DrupalFinderTestBase.php Thu May 09 15:33:08 2019 +0100 @@ -0,0 +1,109 @@ +finder = new DrupalFinder(); + } + + protected function dumpToFileSystem($fileStructure, $root) + { + $fileStructure = $this->prepareFileStructure($fileStructure); + foreach ($fileStructure as $name => $content) { + if (is_array($content)) { + mkdir($root . '/' . $name); + $this->dumpToFileSystem($content, $root . '/' . $name); + } else { + file_put_contents($root . '/' . $name, $content); + } + } + } + + protected function prepareFileStructure($fileStructure) + { + foreach ($fileStructure as $name => $content) { + if (($name === 'composer.json' || $name === 'composer.lock') && is_array($content)) { + $fileStructure[$name] = json_encode($content, JSON_UNESCAPED_SLASHES); + } elseif (is_array($content)) { + $fileStructure[$name] = $this->prepareFileStructure($content); + } + } + return $fileStructure; + } + + protected function tempdir($dir, $prefix = '', $mode = 0700) + { + if (substr($dir, -1) != '/') { + $dir .= '/'; + } + do { + $path = $dir . $prefix . mt_rand(0, 9999999); + } while (!mkdir($path, $mode)); + register_shutdown_function( + [get_called_class(), 'tempdir_remove'], + $path + ); + + return realpath($path); + } + + public static function tempdir_remove($path) + { + if (is_link($path)) { + if (defined('PHP_WINDOWS_VERSION_BUILD')) { + rmdir($path); + } else { + unlink($path); + } + + return; + } + + foreach (scandir($path) as $child) { + if (in_array($child, ['.', '..'])) { + continue; + } + $child = "$path/$child"; + is_dir($child) ? static::tempdir_remove($child) : unlink($child); + } + rmdir($path); + } + + /** + * @param $target + * @param $link + * + * @throws \PHPUnit_Framework_SkippedTestError + */ + protected function symlink($target, $link) + { + try { + return symlink($target, $link); + } catch (Exception $e) { + if (defined('PHP_WINDOWS_VERSION_BUILD') + && strstr($e->getMessage(), WIN_ERROR_PRIVILEGE_NOT_HELD) + ) { + $this->markTestSkipped(<<<'MESSAGE' +No privilege to create symlinks. Run test as Administrator (elevated process). +MESSAGE + ); + } + throw $e; + } + } +} + +define('WIN_ERROR_PRIVILEGE_NOT_HELD', '1314'); diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/CHANGELOG.md --- a/vendor/zendframework/zend-feed/CHANGELOG.md Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/CHANGELOG.md Thu May 09 15:33:08 2019 +0100 @@ -2,6 +2,62 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 2.12.0 - 2019-03-05 + +### Added + +- [#96](https://github.com/zendframework/zend-feed/pull/96) adds the methods `Zend\Feed\Reader\Extension\Podcast\Entry::getTitle() : string` + and `Zend\Feed\Writer\Extension\ITunes\Entry::setTitle(string $value)`; these + provide the ability to read and manipulate `` tags in feeds. + +### Changed + +- Nothing. + +### Deprecated + +- [#101](https://github.com/zendframework/zend-feed/pull/101) deprecates the method `Zend\Feed\Writer\Writer::lcfirst()`; use the PHP + built-in function instead. + +- [#97](https://github.com/zendframework/zend-feed/pull/97) deprecates the classes `Zend\Feed\Reader\AbstractEntry` (use + `Zend\Feed\Reader\Entry\AbstractEntry` instead), `Zend\Feed\Reader\AbstractFeed` (use `Zend\Feed\Reader\Feed\AbstractFeed` instead), and + `Zend\Feed\Reader\Collection` (use Zend\Feed\Reader\Collection\Author`, `Zend\Feed\Reader\Collection\Category`, or + `Zend\Feed\Reader\Collection\Collection` instead, based on context). + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + +## 2.11.1 - 2019-03-05 + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- [#99](https://github.com/zendframework/zend-feed/pull/99) provides a fix to `Zend\Feed\Writer\Renderer\Entry\Rss` to ensure that + relative URIs provided for the feed disable the `isPermalink` flag. + +- [#100](https://github.com/zendframework/zend-feed/pull/100) fixes parameter and return value annotations for a number of classes to + specify the correct types. + ## 2.11.0 - 2019-01-29 ### Added diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/composer.json --- a/vendor/zendframework/zend-feed/composer.json Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/composer.json Thu May 09 15:33:08 2019 +0100 @@ -55,8 +55,8 @@ }, "extra": { "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" + "dev-master": "2.12.x-dev", + "dev-develop": "2.13.x-dev" } }, "scripts": { diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Reader/AbstractEntry.php --- a/vendor/zendframework/zend-feed/src/Reader/AbstractEntry.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/AbstractEntry.php Thu May 09 15:33:08 2019 +0100 @@ -13,6 +13,9 @@ use DOMElement; use DOMXPath; +/** + * @deprecated This (abstract) class is deprecated. Use Zend\Feed\Reader\Entry\AbstractEntry instead. + */ abstract class AbstractEntry { /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Reader/AbstractFeed.php --- a/vendor/zendframework/zend-feed/src/Reader/AbstractFeed.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/AbstractFeed.php Thu May 09 15:33:08 2019 +0100 @@ -13,6 +13,9 @@ use DOMElement; use DOMXPath; +/** + * @deprecated This (abstract) class is deprecated. Use \Zend\Feed\Reader\Feed\AbstractFeed instead. + */ abstract class AbstractFeed implements Feed\FeedInterface { /** diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Reader/Collection.php --- a/vendor/zendframework/zend-feed/src/Reader/Collection.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Collection.php Thu May 09 15:33:08 2019 +0100 @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -11,6 +11,11 @@ use ArrayObject; +/** + * @deprecated This class is deprecated. Use the concrete collection classes + * \Zend\Feed\Reader\Collection\Author and \Zend\Feed\Reader\Collection\Category + * or the generic class \Zend\Feed\Reader\Collection\Collection instead. + */ class Collection extends ArrayObject { } diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php --- a/vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php Thu May 09 15:33:08 2019 +0100 @@ -49,10 +49,7 @@ } /** - * Get the specified author - * - * @param int $index - * @return string|null + * @inheritdoc */ public function getAuthor($index = 0) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Reader/Entry/EntryInterface.php --- a/vendor/zendframework/zend-feed/src/Reader/Entry/EntryInterface.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Entry/EntryInterface.php Thu May 09 15:33:08 2019 +0100 @@ -17,7 +17,7 @@ * Get the specified author * * @param int $index - * @return string|null + * @return array|null */ public function getAuthor($index = 0); diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php --- a/vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php Thu May 09 15:33:08 2019 +0100 @@ -63,10 +63,7 @@ } /** - * Get an author entry - * - * @param int $index - * @return string + * @inheritdoc */ public function getAuthor($index = 0) { diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Entry.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Entry.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Entry.php Thu May 09 15:33:08 2019 +0100 @@ -130,6 +130,28 @@ } /** + * Get the entry title + * + * @return string + */ + public function getTitle() + { + if (isset($this->data['title'])) { + return $this->data['title']; + } + + $title = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:title)'); + + if (! $title) { + $title = null; + } + + $this->data['title'] = $title; + + return $this->data['title']; + } + + /** * Get the entry subtitle * * @return string diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Entry.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Entry.php Thu May 09 15:33:08 2019 +0100 @@ -192,6 +192,23 @@ } /** + * Set title + * + * @param string $value + * @return Entry + * @throws Writer\Exception\InvalidArgumentException + */ + public function setItunesTitle($value) + { + if ($this->stringWrapper->strlen($value) > 255) { + throw new Writer\Exception\InvalidArgumentException('invalid parameter: "title" may only' + . ' contain a maximum of 255 characters'); + } + $this->data['title'] = $value; + return $this; + } + + /** * Set subtitle * * @param string $value diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Entry.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Entry.php Thu May 09 15:33:08 2019 +0100 @@ -39,6 +39,7 @@ $this->_setImage($this->dom, $this->base); $this->_setExplicit($this->dom, $this->base); $this->_setKeywords($this->dom, $this->base); + $this->_setTitle($this->dom, $this->base); $this->_setSubtitle($this->dom, $this->base); $this->_setSummary($this->dom, $this->base); $this->_setEpisode($this->dom, $this->base); @@ -199,6 +200,28 @@ } /** + * Set entry title + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + // @codingStandardsIgnoreStart + protected function _setTitle(DOMDocument $dom, DOMElement $root) + { + // @codingStandardsIgnoreEnd + $title = $this->getDataContainer()->getItunesTitle(); + if (! $title) { + return; + } + $el = $dom->createElement('itunes:title'); + $text = $dom->createTextNode($title); + $el->appendChild($text); + $root->appendChild($el); + $this->called = true; + } + + /** * Set entry subtitle * * @param DOMDocument $dom diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php Thu May 09 15:33:08 2019 +0100 @@ -296,7 +296,10 @@ } $text = $dom->createTextNode($this->getDataContainer()->getId()); $id->appendChild($text); - if (! Uri::factory($this->getDataContainer()->getId())->isValid()) { + + $uri = Uri::factory($this->getDataContainer()->getId()); + if (! $uri->isValid() || ! $uri->isAbsolute()) { + /** @see http://www.rssboard.org/rss-profile#element-channel-item-guid */ $id->setAttribute('isPermaLink', 'false'); } } diff -r 129ea1e6d783 -r af1871eacc83 vendor/zendframework/zend-feed/src/Writer/Writer.php --- a/vendor/zendframework/zend-feed/src/Writer/Writer.php Thu Feb 28 13:21:36 2019 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Writer.php Thu May 09 15:33:08 2019 +0100 @@ -205,10 +205,15 @@ ); } + /** + * @deprecated This method is deprecated and will be removed with version 3.0 + * Use PHP's lcfirst function instead. @see https://php.net/manual/function.lcfirst.php + * @param string $str + * @return string + */ public static function lcfirst($str) { - $str[0] = strtolower($str[0]); - return $str; + return lcfirst($str); } /**