From c6cff46234b463555e29472ada2042dafe0cc931 Mon Sep 17 00:00:00 2001
From: Bachir Soussi Chiadmi
Date: Tue, 6 Sep 2016 12:46:13 +0200
Subject: [PATCH] added features
---
.../contrib/admin/config_update/LICENSE.txt | 339 +++++
.../contrib/admin/config_update/README.txt | 13 +
.../config_update/config_update.info.yml | 12 +
.../admin/config_update/config_update.module | 21 +
.../config_update/config_update.services.yml | 20 +
.../config_update/config_update_ui/README.txt | 162 ++
.../config_update_ui.drush.inc | 232 +++
.../config_update_ui.info.yml | 14 +
.../config_update_ui.libraries.yml | 5 +
.../config_update_ui.links.task.yml | 5 +
.../config_update_ui/config_update_ui.module | 37 +
.../config_update_ui.permissions.yml | 8 +
.../config_update_ui.routing.yml | 45 +
.../css/config_update_ui.report.css | 13 +
.../src/Controller/ConfigUpdateController.php | 576 ++++++++
.../src/Form/ConfigDeleteConfirmForm.php | 143 ++
.../src/Form/ConfigRevertConfirmForm.php | 143 ++
.../src/Tests/ConfigUpdateTest.php | 283 ++++
.../src/ConfigDeleteInterface.php | 37 +
.../config_update/src/ConfigDiffInterface.php | 46 +
.../admin/config_update/src/ConfigDiffer.php | 180 +++
.../config_update/src/ConfigListInterface.php | 74 +
.../admin/config_update/src/ConfigLister.php | 221 +++
.../config_update/src/ConfigRevertEvent.php | 66 +
.../src/ConfigRevertInterface.php | 96 ++
.../config_update/src/ConfigReverter.php | 218 +++
.../contrib/admin/features/LICENSE.txt | 339 +++++
.../contrib/admin/features/composer.json | 8 +
.../install/features.bundle.default.yml | 92 ++
.../config/install/features.settings.yml | 3 +
.../config/schema/features.schema.yml | 207 +++
.../admin/features/drush/features.drush.inc | 936 ++++++++++++
.../contrib/admin/features/features.info.yml | 14 +
.../contrib/admin/features/features.module | 47 +
.../admin/features/features.routing.yml | 6 +
.../admin/features/features.services.yml | 32 +
.../features_ui/css/features_ui.admin.css | 271 ++++
.../modules/features_ui/features_ui.admin.inc | 175 +++
.../modules/features_ui/features_ui.info.yml | 14 +
.../features_ui/features_ui.libraries.yml | 11 +
.../features_ui/features_ui.links.action.yml | 5 +
.../features_ui/features_ui.links.menu.yml | 5 +
.../features_ui/features_ui.links.task.yml | 14 +
.../modules/features_ui/features_ui.module | 55 +
.../features_ui/features_ui.routing.yml | 95 ++
.../features_ui/js/features_ui.admin.js | 401 +++++
.../src/Controller/FeaturesUIController.php | 193 +++
.../src/Form/AssignmentBaseForm.php | 61 +
.../src/Form/AssignmentConfigureForm.php | 445 ++++++
.../src/Form/AssignmentCoreForm.php | 54 +
.../src/Form/AssignmentExcludeForm.php | 128 ++
.../src/Form/AssignmentFormBase.php | 160 ++
.../src/Form/AssignmentOptionalForm.php | 54 +
.../src/Form/AssignmentProfileForm.php | 88 ++
.../src/Form/AssignmentSiteForm.php | 54 +
.../features_ui/src/Form/FeaturesDiffForm.php | 270 ++++
.../features_ui/src/Form/FeaturesEditForm.php | 1085 ++++++++++++++
.../src/Form/FeaturesExportForm.php | 539 +++++++
.../src/Tests/FeaturesBundleUITest.php | 188 +++
.../src/Tests/FeaturesCreateUITest.php | 179 +++
.../features_ui/src/Tests/FeaturesUITest.php | 49 +
.../admin/features/src/ConfigurationItem.php | 351 +++++
.../src/Controller/FeaturesController.php | 77 +
.../features/src/Entity/FeaturesBundle.php | 305 ++++
.../admin/features/src/FeaturesAssigner.php | 446 ++++++
.../src/FeaturesAssignerInterface.php | 228 +++
.../src/FeaturesAssignmentMethodBase.php | 124 ++
.../src/FeaturesAssignmentMethodInterface.php | 56 +
.../src/FeaturesAssignmentMethodManager.php | 32 +
.../features/src/FeaturesBundleInterface.php | 240 +++
.../src/FeaturesConfigDependencyManager.php | 59 +
.../features/src/FeaturesConfigInstaller.php | 51 +
.../src/FeaturesExtensionStorages.php | 121 ++
.../FeaturesExtensionStoragesInterface.php | 87 ++
.../src/FeaturesGenerationMethodBase.php | 107 ++
.../src/FeaturesGenerationMethodInterface.php | 67 +
.../src/FeaturesGenerationMethodManager.php | 33 +
.../admin/features/src/FeaturesGenerator.php | 173 +++
.../src/FeaturesGeneratorInterface.php | 103 ++
.../features/src/FeaturesInstallStorage.php | 157 ++
.../admin/features/src/FeaturesManager.php | 1306 +++++++++++++++++
.../features/src/FeaturesManagerInterface.php | 601 ++++++++
.../features/src/FeaturesServiceProvider.php | 24 +
.../contrib/admin/features/src/Package.php | 549 +++++++
.../FeaturesAssignmentBaseType.php | 69 +
.../FeaturesAssignmentCoreType.php | 37 +
.../FeaturesAssignmentDependency.php | 26 +
.../FeaturesAssignmentExclude.php | 148 ++
.../FeaturesAssignmentExisting.php | 58 +
.../FeaturesAssignmentForwardDependency.php | 78 +
.../FeaturesAssignmentNamespace.php | 26 +
.../FeaturesAssignmentOptionalType.php | 33 +
.../FeaturesAssignmentPackages.php | 53 +
.../FeaturesAssignmentProfile.php | 177 +++
.../FeaturesAssignmentSiteType.php | 36 +
.../FeaturesGenerationArchive.php | 270 ++++
.../FeaturesGenerationWrite.php | 225 +++
.../ProxyClass/FeaturesConfigInstaller.php | 136 ++
.../config/install/system.cron.yml | 3 +
.../test_feature/test_feature.features.yml | 4 +
.../test_feature/test_feature.info.yml | 13 +
.../Entity/FeaturesBundleIntegrationTest.php | 82 ++
.../tests/src/Kernel/FeaturesAssignTest.php | 301 ++++
.../tests/src/Kernel/FeaturesAssignerTest.php | 58 +
.../tests/src/Kernel/FeaturesGenerateTest.php | 122 ++
.../tests/src/Unit/ConfigurationItemTest.php | 21 +
.../tests/src/Unit/FeaturesBundleTest.php | 165 +++
.../tests/src/Unit/FeaturesManagerTest.php | 769 ++++++++++
.../features/tests/src/Unit/PackageTest.php | 53 +
109 files changed, 17546 insertions(+)
create mode 100644 sites/all/modules/contrib/admin/config_update/LICENSE.txt
create mode 100644 sites/all/modules/contrib/admin/config_update/README.txt
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update.info.yml
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update.module
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update.services.yml
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.info.yml
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.libraries.yml
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.links.task.yml
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.module
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php
create mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/src/Tests/ConfigUpdateTest.php
create mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php
create mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigDiffInterface.php
create mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigDiffer.php
create mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigListInterface.php
create mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigLister.php
create mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php
create mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php
create mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigReverter.php
create mode 100644 sites/all/modules/contrib/admin/features/LICENSE.txt
create mode 100644 sites/all/modules/contrib/admin/features/composer.json
create mode 100644 sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml
create mode 100644 sites/all/modules/contrib/admin/features/config/install/features.settings.yml
create mode 100644 sites/all/modules/contrib/admin/features/config/schema/features.schema.yml
create mode 100644 sites/all/modules/contrib/admin/features/drush/features.drush.inc
create mode 100644 sites/all/modules/contrib/admin/features/features.info.yml
create mode 100644 sites/all/modules/contrib/admin/features/features.module
create mode 100644 sites/all/modules/contrib/admin/features/features.routing.yml
create mode 100644 sites/all/modules/contrib/admin/features/features.services.yml
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/css/features_ui.admin.css
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.admin.inc
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.info.yml
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.libraries.yml
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.action.yml
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.menu.yml
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.task.yml
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.module
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.routing.yml
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/js/features_ui.admin.js
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Controller/FeaturesUIController.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentBaseForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentConfigureForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentCoreForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentExcludeForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentFormBase.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentOptionalForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentProfileForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentSiteForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesDiffForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesEditForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesExportForm.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesBundleUITest.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesCreateUITest.php
create mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesUITest.php
create mode 100644 sites/all/modules/contrib/admin/features/src/ConfigurationItem.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Controller/FeaturesController.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Entity/FeaturesBundle.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssigner.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssignerInterface.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodBase.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodInterface.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodManager.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesBundleInterface.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesConfigDependencyManager.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesConfigInstaller.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesExtensionStorages.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesInterface.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodBase.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodInterface.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodManager.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGenerator.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGeneratorInterface.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesInstallStorage.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesManager.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesManagerInterface.php
create mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesServiceProvider.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Package.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentBaseType.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentCoreType.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentDependency.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExclude.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExisting.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentForwardDependency.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentNamespace.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentOptionalType.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentPackages.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentProfile.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentSiteType.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationArchive.php
create mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationWrite.php
create mode 100644 sites/all/modules/contrib/admin/features/src/ProxyClass/FeaturesConfigInstaller.php
create mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/system.cron.yml
create mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.features.yml
create mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.info.yml
create mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/Entity/FeaturesBundleIntegrationTest.php
create mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignTest.php
create mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignerTest.php
create mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesGenerateTest.php
create mode 100644 sites/all/modules/contrib/admin/features/tests/src/Unit/ConfigurationItemTest.php
create mode 100644 sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesBundleTest.php
create mode 100644 sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesManagerTest.php
create mode 100644 sites/all/modules/contrib/admin/features/tests/src/Unit/PackageTest.php
diff --git a/sites/all/modules/contrib/admin/config_update/LICENSE.txt b/sites/all/modules/contrib/admin/config_update/LICENSE.txt
new file mode 100644
index 000000000..d159169d1
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/config_update/README.txt b/sites/all/modules/contrib/admin/config_update/README.txt
new file mode 100644
index 000000000..8a6e2b111
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/README.txt
@@ -0,0 +1,13 @@
+Configuration Update Manager project
+------------------------------------
+
+The Configuration Update Manager project consists of two modules:
+
+Configuration Update Base: A base module providing functionality related to
+ updating and computing differences between configuration versions. No
+ user interface; used by other modules such as Features.
+
+Configuration Update Reports (in the config_ui sub-directory of this project):
+ Adds an updates report and revert functionality to configuration management.
+ Depends on Configuration Update Base. For more information, see the
+ README.txt file in the subdirectory.
diff --git a/sites/all/modules/contrib/admin/config_update/config_update.info.yml b/sites/all/modules/contrib/admin/config_update/config_update.info.yml
new file mode 100644
index 000000000..d71f2a6c4
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update.info.yml
@@ -0,0 +1,12 @@
+name: Configuration Update Base
+type: module
+description: 'Provides basic revert and update functionality for other modules'
+# core: 8.x
+dependencies:
+ - config
+
+# Information added by Drupal.org packaging script on 2016-03-08
+version: '8.x-1.1'
+core: '8.x'
+project: 'config_update'
+datestamp: 1457466840
diff --git a/sites/all/modules/contrib/admin/config_update/config_update.module b/sites/all/modules/contrib/admin/config_update/config_update.module
new file mode 100644
index 000000000..df775d320
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update.module
@@ -0,0 +1,21 @@
+' . t('About') . '';
+ $output .= '
' . t('The Configuration Update Base module provides functionality that other modules can use, related to updating and computing differences between configuration versions. This module does not provide any end-user functionality itself.') . '
';
+ return $output;
+ }
+}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update.services.yml b/sites/all/modules/contrib/admin/config_update/config_update.services.yml
new file mode 100644
index 000000000..0d322acb8
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update.services.yml
@@ -0,0 +1,20 @@
+services:
+ config_update.config_diff:
+ class: Drupal\config_update\ConfigDiffer
+ arguments: ['@string_translation']
+
+ config_update.config_list:
+ class: Drupal\config_update\ConfigLister
+ arguments: ['@entity.manager', '@config.storage', '@config_update.extension_storage', '@config_update.extension_optional_storage']
+
+ config_update.config_update:
+ class: Drupal\config_update\ConfigReverter
+ arguments: ['@entity.manager', '@config.storage', '@config_update.extension_storage', '@config_update.extension_optional_storage', '@config.factory', '@event_dispatcher']
+
+ config_update.extension_storage:
+ class: Drupal\Core\Config\ExtensionInstallStorage
+ arguments: ['@config.storage']
+
+ config_update.extension_optional_storage:
+ class: Drupal\Core\Config\ExtensionInstallStorage
+ arguments: ['@config.storage', 'config/optional']
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt b/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt
new file mode 100644
index 000000000..3412c5a98
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt
@@ -0,0 +1,162 @@
+Configuration Update Reports module
+-----------------------------------
+
+CONTENTS OF THIS README FILE
+- Introduction
+- Installation
+- Generating reports in the user interface
+- Generating reports using Drush commands
+- Important notes *** Be sure to read this section ***
+
+
+INTRODUCTION
+
+This module provides a report that allows you to see the differences between the
+default configuration items provided by the current versions of your installed
+modules, themes, and install profile, and the active configuration of your
+site. From this report, you can also import new configuration provided by
+updates, and revert your site configuration to the provided values.
+
+The main use case is: You update a module, and it has either changed default
+configuration that it provides, or added new default configuration items that
+you didn't get when you first installed the module. You want to be able to
+import the new items, view the differences between the active site configuration
+and the changed configuration, and possibly "revert" (or it may be an update) to
+the newly-provided default configuration.
+
+
+INSTALLATION
+
+Install the module in the normal way for Drupal modules. The only dependencies
+are the Configuration Manager module (Drupal core), and the Configuration Update
+Base module (part of this same project download).
+
+
+GENERATING REPORTS IN THE USER INTERFACE
+
+You can generate configuration reports at Administration >> Configuration >>
+Development >> Configuration management >> Update report (path:
+admin/config/development/configuration/report ).
+
+You can generate a report for a particular type of configuration object, such as
+Actions, Tours, Views, etc. Or, you can generate a report for an installed
+module, theme, or install profile. Finally, you can generate a report that
+contains all configuration in one report.
+
+The report has three sections, depending on what type you choose:
+
+1. Missing configuration items: Configuration items that are provided as
+ defaults by your currently-installed modules, themes, and install profile
+ that are missing from your active site configuration.
+
+ Any items listed here can be imported into your site.
+
+2. Added configuration items: Configuration items that you added to the site
+ (not provided by a currently-installed module, theme, or install
+ profile). This section is only shown when you are running the report based on
+ a configuration type.
+
+ Items listed here can be exported, which is useful for developers or if you
+ want to keep your site configuration in a version control system.
+
+3. Changed configuration items: Configuration items that are in your active site
+ configuration that differ from the same item currently being provided by an
+ installed module, theme, or install profile.
+
+ You can export these items, see the differences between what is on your site
+ and what the module/theme/profile is currently providing, or "revert" to the
+ version currently being provided by the module/theme/profile in its default
+ configuration.
+
+ Note that the differences may be a bit hard to read, but hopefully they'll
+ give you the general idea of what has changed.
+
+
+GENERATING REPORTS USING DRUSH COMMANDS
+
+The reports detailed in the previous section can also be generated, in pieces,
+using Drush commands (https://drupal.org/project/drush):
+
+drush config-list-types (clt)
+ Lists all the config types on your system. Reports can be run for
+ 'system.simple' (simple configuration), and 'system.all' (all types), in
+ addition to the types listed by this command.
+
+drush config-added-report (cra)
+drush config-missing-report (crm)
+drush config-different-report (crd)
+ Run config reports (see below).
+
+drush config-diff (cfd)
+ Show config differences for one item between active and imported (see below).
+
+The report commands run reports that tell what config has been added, is
+missing, or is different between your active site configuration and the imported
+default configuration from config/install directories of your installed profile,
+modules, and themes.
+
+For each report except "added", the first argument is one of:
+- type: Runs the report for a configuration type; use drush config-list-types to
+ list them.
+- module: Runs the report for an installed module.
+- theme: Runs the report for an installed theme.
+- profile: Runs the report for the install profile.
+
+The second argument for reports is the machine name of the configuration type,
+module, theme, or install profile you want to run the report for. For the
+"added" report, this is the only argument, as the added report is always by
+configuration type.
+
+These are the same as the reports you get in the UI, which is described above;
+the only difference is that in Drush the report is separated into pieces.
+
+Once you have found a configuration item with differences, you can view the
+differences using the config-diff command. This is a normalized/formatted diff
+like in the UI of this module, so see above for details.
+
+Drush examples:
+
+drush clt
+drush crm module node
+drush cra block
+drush crd theme bartik
+drush crd type system.all
+drush crd type system.simple
+drush crd profile standard
+drush cfd block.block.bartik_search
+
+Once you have figured out which configuration items are added, missing, or
+different, you can:
+
+- Export them - see drush config-export.
+
+- Import missing configuration or revert to provided default values. To do this:
+
+ (1) Locate the configuration file in the install profile, module, or theme
+ config/install directory.
+
+ (2) Copy this file to your configuration staging directory.
+
+ (3) Run drush config-import. You might want to use the --preview option to see
+ what differences you are about to import, before running the import, or
+ use the drush config-diff command to look at individual differences.
+
+
+IMPORTANT NOTES
+
+Here are some notes about how this module functions:
+
+* This module is always looking at the base configuration items, without
+ overrides (from settings.php, for example) or translations.
+
+* It is possible for an install profile on a site to provide configuration that
+ overrides configuration from a module or theme. The install profile version
+ always takes precedence. As an example, consider the case where module Foo
+ provides a configuration item called foo.settings, and install profile Bar
+ overrides this with its own file. Any reports that include foo.settings will
+ be based on the differences between your site's active configuration and the
+ version in the install profile. This is not usually a problem, but it can be
+ confusing if you're looking at the Foo module report. The foo.settings item
+ will be present, but the differences reported will be between the install
+ profile's version and your site's active configuration, not the differences
+ between the Foo module version and your site's active configuration.
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc
new file mode 100644
index 000000000..674e36f42
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc
@@ -0,0 +1,232 @@
+ 'List config types',
+ 'aliases' => ['clt'],
+ 'core' => ['8+'],
+ 'outputformat' => [
+ 'default' => 'list',
+ ],
+ ];
+
+ $items['config-added-report'] = [
+ 'description' => 'Display a list of config items that did not come from your installed modules, themes, or install profile',
+ 'arguments' => [
+ 'name' => 'The type of config to report on. See config-list-types to list them. You can also use system.all for all types, or system.simple for simple config.',
+ ],
+ 'required-arguments' => 1,
+ 'examples' => [
+ 'drush config-added-report action' => 'Displays the added config report for action config.',
+ ],
+ 'aliases' => ['cra'],
+ 'core' => ['8+'],
+ 'outputformat' => [
+ 'default' => 'list',
+ ],
+ ];
+
+ $items['config-missing-report'] = [
+ 'description' => 'Display a list of config items from your installed modules, themes, or install profile that are not currently in your active config',
+ 'arguments' => [
+ 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.',
+ 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.',
+ ],
+ 'required-arguments' => 2,
+ 'examples' => [
+ 'drush config-missing-report type action' => 'Displays the missing config report for action config.',
+ ],
+ 'aliases' => ['crm'],
+ 'core' => ['8+'],
+ 'outputformat' => [
+ 'default' => 'list',
+ ],
+ ];
+
+ $items['config-inactive-report'] = [
+ 'description' => 'Display a list of optional config items from your installed modules, themes, or install profile that are not currently in your active config',
+ 'arguments' => [
+ 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.',
+ 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.',
+ ],
+ 'required-arguments' => 2,
+ 'examples' => [
+ 'drush config-inactive-report type action' => 'Displays the inactive config report for action config.',
+ ],
+ 'aliases' => ['cri'],
+ 'core' => ['8+'],
+ 'outputformat' => [
+ 'default' => 'list',
+ ],
+ ];
+
+ $items['config-different-report'] = [
+ 'description' => 'Display a list of config items that differ from the versions imported from your installed modules, themes, or install profile. See config-diff to show what the differences are.',
+ 'arguments' => [
+ 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.',
+ 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.',
+ ],
+ 'required-arguments' => 2,
+ 'examples' => [
+ 'drush config-different-report type action' => 'Displays the differing config report for action config.',
+ ],
+ 'drupal dependencies' => ['config_update_ui'],
+ 'aliases' => ['crd'],
+ 'core' => ['8+'],
+ 'outputformat' => [
+ 'default' => 'list',
+ ],
+ ];
+
+ $items['config-diff'] = [
+ 'description' => 'Display line-by-line differences for one config item between your active config and the version currently being provided by an installed module, theme, or install profile',
+ 'arguments' => [
+ 'name' => 'The config item to diff. See config-different-report to list config items that are different.',
+ ],
+ 'required-arguments' => 1,
+ 'examples' => [
+ 'drush config-diff block.block.bartik_search' => 'Displays the config differences for the search block in the Bartik theme.',
+ ],
+ 'aliases' => ['cfd'],
+ 'core' => ['8+'],
+ ];
+
+ return $items;
+}
+
+/**
+ * Lists available config types.
+ */
+function drush_config_update_ui_config_list_types() {
+ $list = [];
+
+ $definitions = \Drupal::service('config_update.config_list')->listTypes();
+ return array_keys($definitions);
+}
+
+/**
+ * Runs the config added report.
+ *
+ * @param string $name
+ * Type of config to report on.
+ */
+function drush_config_update_ui_config_added_report($name) {
+ list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig('type', $name);
+
+ $added = array_diff($active_list, $install_list, $optional_list);
+
+ if (!count($added)) {
+ drush_print(dt('No added config'), 0, STDERR);
+ }
+
+ sort($added);
+ return $added;
+}
+
+/**
+ * Runs the config missing report.
+ *
+ * @param string $type
+ * Type of report to run: 'type', 'module', 'theme', or 'profile'.
+ * @param string $name
+ * Machine name of item to report on.
+ */
+function drush_config_update_ui_config_missing_report($type, $name) {
+ list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name);
+
+ $missing = array_diff($install_list, $active_list);
+ if (!count($missing)) {
+ drush_print(dt('No missing config'), 0, STDERR);
+ }
+
+ sort($missing);
+ return $missing;
+}
+
+/**
+ * Runs the config inactive report.
+ *
+ * @param string $type
+ * Type of report to run: 'type', 'module', 'theme', or 'profile'.
+ * @param string $name
+ * Machine name of item to report on.
+ */
+function drush_config_update_ui_config_inactive_report($type, $name) {
+ list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name);
+
+ $missing = array_diff($optional_list, $active_list);
+ if (!count($missing)) {
+ drush_print(dt('No inactive config'), 0, STDERR);
+ }
+
+ sort($missing);
+ return $missing;
+}
+
+/**
+ * Runs the config different report.
+ *
+ * @param string $type
+ * Type of report to run: 'type', 'module', 'theme', or 'profile'.
+ * @param string $name
+ * Machine name of item to report on.
+ */
+function drush_config_update_ui_config_different_report($type, $name) {
+ list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name);
+
+ $reverter = \Drupal::service('config_update.config_update');
+ $differ = \Drupal::service('config_update.config_diff');
+
+ $added = array_diff($active_list, $install_list, $optional_list);
+ $both = array_diff($active_list, $added);
+ $different = [];
+ foreach ($both as $name) {
+ $active = $reverter->getFromActive('', $name);
+ $extension = $reverter->getFromExtension('', $name);
+ if (!$differ->same($active, $extension)) {
+ $different[] = $name;
+ }
+ }
+
+ if (!count($different)) {
+ drush_print(dt('No different config'), 0, STDERR);
+ }
+
+ sort($different);
+ return $different;
+}
+
+/**
+ * Runs the drush config-diff command.
+ *
+ * @param string $name
+ * Config item to diff.
+ */
+function drush_config_update_ui_config_diff($name) {
+ $reverter = \Drupal::service('config_update.config_update');
+ $differ = \Drupal::service('config_update.config_diff');
+ $formatter = new DiffFormatter();
+
+ $extension = $reverter->getFromExtension('', $name);
+ $active = $reverter->getFromActive('', $name);
+ if ($extension && !$active) {
+ $diff = $differ->diff($extension, $active);
+ drush_print($formatter->format($diff));
+ }
+ else {
+ drush_print(dt('Config is missing, cannot diff'), 0, STDERR);
+ }
+}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.info.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.info.yml
new file mode 100644
index 000000000..0196969b6
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.info.yml
@@ -0,0 +1,14 @@
+name: Configuration Update Reports
+type: module
+description: 'Adds an updates report and revert functionality to configuration management'
+# core: 8.x
+configure: config_update.report
+dependencies:
+ - config_update
+ - config
+
+# Information added by Drupal.org packaging script on 2016-03-08
+version: '8.x-1.1'
+core: '8.x'
+project: 'config_update'
+datestamp: 1457466840
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.libraries.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.libraries.yml
new file mode 100644
index 000000000..33d6e9c48
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.libraries.yml
@@ -0,0 +1,5 @@
+report_css:
+ version: 1.x
+ css:
+ theme:
+ css/config_update_ui.report.css: {}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.links.task.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.links.task.yml
new file mode 100644
index 000000000..e37e7e70d
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.links.task.yml
@@ -0,0 +1,5 @@
+config_update_ui.report:
+ route_name: config_update_ui.report
+ title: 'Updates report'
+ base_route: config.sync
+ weight: 1000
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.module b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.module
new file mode 100644
index 000000000..57ce12c08
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.module
@@ -0,0 +1,37 @@
+' . t('About') . '';
+ $output .= '
' . t('The Configuration Update Reports module provides a report that allows you to see the differences between the default configuration provided by the current versions of your installed modules, themes, and install profile, and the active configuration of your site. From this report, you can also import new configuration provided by updates, and revert your active configuration to the provided default values.') . '
' . t('The Updates report shows you configuration that differs between your site\'s active configuration and the installed modules, themes, and install profile. Choose a particular configuration type (or All), or run the report for a particular module, theme, or your install profile.', [':report' => Url::fromRoute('config_update_ui.report')->toString()]) . '
' . t('This report shows which default configuration items provided by the current versions of your installed modules, themes, and install profile differ from the active configuration of your site. You can generate the report for all configuration of a certain type, or for a particular installed module, theme, or your install profile.') . '
';
+ $output .= '
' . t('Some configuration provided by modules has dependencies, and is only added to your system when all the dependencies are satisfied. This is known as optional configuration.') . '
';
+ $output .= '
' . t('Differences, including missing and added configuration, can be due to either an updated module or theme providing different configuration from when you installed it, or to changes made by site administrators. This report does not differentiate between these two sources for differences, and note that an install profile can also silently override module/theme configuration. Overrides (such as those in your settings.php file) and translations are not considered when looking at differences.') . '
' . t('Most configuration is organized into a hierarchy of settings; at a minimum, it is a one-level hierarchy where each setting has a name and a value, and the hierarchy comes in when some of the settings have multiple components.') . '
' . t('Configuration items are normalized and formatted before computing differences. The normalization step alphabetizes the components at each level of the hierarchy, and removes a few components whose differences should be ignored, such as the UUID. The formatting step shows the full hierarchy of each configuration value with :: separators for the hierarchy levels, and a : separator between the lowest-level setting name and the value, so that in a line-by-line diff you can always see which values are actually different. Green lines with + signs have been added, and yellow lines with - signs have been removed.') . '
' . t('Note that differences are considering the base configuration, without overrides from your settings.php file, or translations.') . '
';
+ }
+}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml
new file mode 100644
index 000000000..bedd4a938
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml
@@ -0,0 +1,8 @@
+view config updates report:
+ title: 'View configuration updates report'
+revert configuration:
+ title: 'Revert any configuration'
+ restrict access: true
+delete configuration:
+ title: 'Delete any configuration'
+ restrict access: true
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml
new file mode 100644
index 000000000..15ce16bb8
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml
@@ -0,0 +1,45 @@
+config_update_ui.report:
+ path: '/admin/config/development/configuration/report/{report_type}/{name}'
+ defaults:
+ _controller: '\Drupal\config_update_ui\Controller\ConfigUpdateController::report'
+ _title: 'Updates report'
+ report_type: NULL
+ name: NULL
+ requirements:
+ _permission: 'view config updates report'
+
+config_update_ui.import:
+ path: '/admin/config/development/configuration/report/import/{config_type}/{config_name}'
+ defaults:
+ _title: 'Import'
+ _controller: '\Drupal\config_update_ui\Controller\ConfigUpdateController::import'
+ config_type: NULL
+ config_name: NULL
+ requirements:
+ _permission: 'import configuration'
+
+config_update_ui.diff:
+ path: '/admin/config/development/configuration/report/diff/{config_type}/{config_name}'
+ defaults:
+ _title: 'Differences'
+ _controller: '\Drupal\config_update_ui\Controller\ConfigUpdateController::diff'
+ config_type: NULL
+ config_name: NULL
+ requirements:
+ _permission: 'view config updates report'
+
+config_update_ui.revert:
+ path: '/admin/config/development/configuration/report/revert/{config_type}/{config_name}'
+ defaults:
+ _title: 'Revert'
+ _form: '\Drupal\config_update_ui\Form\ConfigRevertConfirmForm'
+ requirements:
+ _permission: 'revert configuration'
+
+config_update_ui.delete:
+ path: '/admin/config/development/configuration/report/delete/{config_type}/{config_name}'
+ defaults:
+ _title: 'Delete'
+ _form: '\Drupal\config_update_ui\Form\ConfigDeleteConfirmForm'
+ requirements:
+ _permission: 'delete configuration'
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css b/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css
new file mode 100644
index 000000000..77b8d10b3
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css
@@ -0,0 +1,13 @@
+/**
+ * @file
+ * Styling for the Config Updates report.
+ */
+
+table.config-update-report {
+ margin-top: 2em;
+}
+
+table.config-update-report caption {
+ font-weight: bold;
+ font-size: 1.1em;
+}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php
new file mode 100644
index 000000000..3bf0d4879
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php
@@ -0,0 +1,576 @@
+configDiff = $config_diff;
+ $this->configList = $config_list;
+ $this->configRevert = $config_update;
+ $this->diffFormatter = $diff_formatter;
+ $this->diffFormatter->show_header = FALSE;
+ $this->moduleHandler = $module_handler;
+ $this->themeHandler = $theme_handler;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function create(ContainerInterface $container) {
+ return new static(
+ $container->get('config_update.config_diff'),
+ $container->get('config_update.config_list'),
+ $container->get('config_update.config_update'),
+ $container->get('diff.formatter'),
+ $container->get('module_handler'),
+ $container->get('theme_handler')
+ );
+ }
+
+ /**
+ * Imports configuration from a module, theme, or profile.
+ *
+ * Configuration is assumed not to currently exist.
+ *
+ * @param string $config_type
+ * The type of configuration.
+ * @param string $config_name
+ * The name of the config item, without the prefix.
+ *
+ * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * Redirects to the updates report.
+ */
+ public function import($config_type, $config_name) {
+ $this->configRevert->import($config_type, $config_name);
+
+ drupal_set_message($this->t('The configuration was imported.'));
+ return $this->redirect('config_update_ui.report');
+ }
+
+ /**
+ * Shows the diff between active and provided configuration.
+ *
+ * @param string $config_type
+ * The type of configuration.
+ * @param string $config_name
+ * The name of the config item, without the prefix.
+ *
+ * @return array
+ * Render array for page showing differences between them.
+ */
+ public function diff($config_type, $config_name) {
+ $diff = $this->configDiff->diff(
+ $this->configRevert->getFromExtension($config_type, $config_name),
+ $this->configRevert->getFromActive($config_type, $config_name)
+ );
+
+ $build = [];
+ $definition = $this->configList->getType($config_type);
+ $config_type_label = ($definition) ? $definition->getLabel() : $this->t('Simple configuration');
+ $build['#title'] = $this->t('Config difference for @type @name', ['@type' => $config_type_label, '@name' => $config_name]);
+ $build['#attached']['library'][] = 'system/diff';
+
+ $build['diff'] = [
+ '#type' => 'table',
+ '#header' => [
+ ['data' => $this->t('Source config'), 'colspan' => '2'],
+ ['data' => $this->t('Site config'), 'colspan' => '2'],
+ ],
+ '#rows' => $this->diffFormatter->format($diff),
+ '#attributes' => ['class' => ['diff']],
+ ];
+
+ $url = new Url('config_update_ui.report');
+
+ $build['back'] = [
+ '#type' => 'link',
+ '#attributes' => [
+ 'class' => [
+ 'dialog-cancel',
+ ],
+ ],
+ '#title' => $this->t("Back to 'Updates report' page."),
+ '#url' => $url,
+ ];
+
+ return $build;
+ }
+
+ /**
+ * Generates the config updates report.
+ *
+ * @param string $report_type
+ * (optional) Type of report to run:
+ * - type: Configuration entity type.
+ * - module: Module.
+ * - theme: Theme.
+ * - profile: Install profile.
+ * @param string $name
+ * (optional) Name of specific item to run report for (config entity type
+ * ID, module machine name, etc.). Ignored for profile.
+ *
+ * @return array
+ * Render array for report, with section at the top for selecting another
+ * report to run. If either $report_type or $name is missing, the report
+ * itself is not generated.
+ */
+ public function report($report_type = NULL, $name = NULL) {
+ $links = $this->generateReportLinks();
+
+ $report = $this->generateReport($report_type, $name);
+ if (!$report) {
+ return $links;
+ }
+
+ // If there is a report, extract the title, put table of links in a
+ // details element, and add report to build.
+ $build = [];
+ $build['#title'] = $report['#title'];
+ unset($report['#title']);
+
+ $build['links_wrapper'] = [
+ '#type' => 'details',
+ '#title' => $this->t('Generate new report'),
+ '#children' => $links,
+ ];
+
+ $build['report'] = $report;
+
+ $build['#attached']['library'][] = 'config_update/report_css';
+
+ return $build;
+ }
+
+ /**
+ * Generates the operations links for running individual reports.
+ *
+ * @return array
+ * Render array for the operations links for running reports.
+ */
+ protected function generateReportLinks() {
+
+ // These links are put into an 'operations' render array element. They do
+ // not look good outside of tables. Also note that the array index in
+ // operations links is used as a class on the LI element. Some classes are
+ // special in the Seven CSS, such as "contextual", so avoid hitting these
+ // accidentally by prefixing.
+ $build = [];
+
+ $build['links'] = [
+ '#type' => 'table',
+ '#header' => [
+ $this->t('Report type'),
+ $this->t('Report on'),
+ ],
+ '#rows' => [],
+ ];
+
+ $definitions = $this->configList->listTypes();
+ $links = [];
+ foreach ($definitions as $entity_type => $definition) {
+ $links['type_' . $entity_type] = [
+ 'title' => $definition->getLabel(),
+ 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => $entity_type]),
+ ];
+ }
+
+ uasort($links, [$this, 'sortLinks']);
+
+ $links = [
+ 'type_all' => [
+ 'title' => $this->t('All types'),
+ 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => 'system.all']),
+ ],
+ 'type_system.simple' => [
+ 'title' => $this->t('Simple configuration'),
+ 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => 'system.simple']),
+ ],
+ ] + $links;
+
+ $build['links']['#rows'][] = [
+ $this->t('Configuration type'),
+ [
+ 'data' => [
+ '#type' => 'operations',
+ '#links' => $links,
+ ],
+ ],
+ ];
+
+ // Make a list of installed modules.
+ $profile = Settings::get('install_profile');
+ $modules = $this->moduleHandler->getModuleList();
+ $links = [];
+ foreach ($modules as $machine_name => $module) {
+ if ($machine_name != $profile) {
+ $links['module_' . $machine_name] = [
+ 'title' => $this->moduleHandler->getName($machine_name),
+ 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'module', 'name' => $machine_name]),
+ ];
+ }
+ }
+ uasort($links, [$this, 'sortLinks']);
+
+ $build['links']['#rows'][] = [
+ $this->t('Module'),
+ [
+ 'data' => [
+ '#type' => 'operations',
+ '#links' => $links,
+ ],
+ ],
+ ];
+
+ // Make a list of installed themes.
+ $themes = $this->themeHandler->listInfo();
+ $links = [];
+ foreach ($themes as $machine_name => $theme) {
+ $links['theme_' . $machine_name] = [
+ 'title' => $this->themeHandler->getName($machine_name),
+ 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'theme', 'name' => $machine_name]),
+ ];
+ }
+ uasort($links, [$this, 'sortLinks']);
+
+ $build['links']['#rows'][] = [
+ $this->t('Theme'),
+ [
+ 'data' => [
+ '#type' => 'operations',
+ '#links' => $links,
+ ],
+ ],
+ ];
+
+ // Profile is just one option.
+ $links = [];
+ $links['profile_' . $profile] = [
+ 'title' => $this->moduleHandler->getName($profile),
+ 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'profile']),
+ ];
+ $build['links']['#rows'][] = [
+ $this->t('Installation profile'),
+ [
+ 'data' => [
+ '#type' => 'operations',
+ '#links' => $links,
+ ],
+ ],
+ ];
+
+ return $build;
+ }
+
+ /**
+ * Generates a report about config updates.
+ *
+ * @param string $report_type
+ * Type of report to generate: 'type', 'module', 'theme', or 'profile'.
+ * @param string $value
+ * Machine name of a configuration type, module, or theme to generate the
+ * report for. Ignored for profile, since that uses the active profile.
+ *
+ * @return array
+ * Render array for the updates report. Empty if invalid or missing
+ * report type or value.
+ */
+ protected function generateReport($report_type, $value) {
+ // Figure out what to name the report, and incidentally, validate that
+ // $value exists for this type of report.
+ switch ($report_type) {
+ case 'type':
+ if ($value == 'system.all') {
+ $label = $this->t('All configuration');
+ }
+ elseif ($value == 'system.simple') {
+ $label = $this->t('Simple configuration');
+ }
+ else {
+ $definition = $this->configList->getType($value);
+ if (!$definition) {
+ return NULL;
+ }
+
+ $label = $this->t('@name configuration', ['@name' => $definition->getLabel()]);
+ }
+
+ break;
+
+ case 'module':
+ $list = $this->moduleHandler->getModuleList();
+ if (!isset($list[$value])) {
+ return NULL;
+ }
+
+ $label = $this->t('@name module', ['@name' => $this->moduleHandler->getName($value)]);
+ break;
+
+ case 'theme':
+ $list = $this->themeHandler->listInfo();
+ if (!isset($list[$value])) {
+ return NULL;
+ }
+
+ $label = $this->t('@name theme', ['@name' => $this->themeHandler->getName($value)]);
+ break;
+
+ case 'profile':
+ $profile = Settings::get('install_profile');
+ $label = $this->t('@name profile', ['@name' => $this->moduleHandler->getName($profile)]);
+ break;
+
+ default:
+ return NULL;
+ }
+
+ // List the active and extension-provided config.
+ list($active_list, $install_list, $optional_list) = $this->configList->listConfig($report_type, $value);
+
+ // Build the report.
+ $build = [];
+
+ $build['#title'] = $this->t('Configuration updates report for @label', ['@label' => $label]);
+ $build['report_header'] = ['#markup' => '
' . $this->t('Updates report') . '
'];
+
+ // List items missing from site.
+ $removed = array_diff($install_list, $active_list);
+ $build['removed'] = [
+ '#caption' => $this->t('Missing configuration items'),
+ '#empty' => $this->t('None: all provided configuration items are in your active configuration.'),
+ ] + $this->makeReportTable($removed, 'extension', ['import']);
+
+ // List optional items that are not installed.
+ $inactive = array_diff($optional_list, $active_list);
+ $build['inactive'] = [
+ '#caption' => $this->t('Inactive optional items'),
+ '#empty' => $this->t('None: all optional configuration items are in your active configuration.'),
+ ] + $this->makeReportTable($inactive, 'extension', ['import']);
+
+ // List items added to site, which only makes sense in the report for a
+ // config type.
+ $added = array_diff($active_list, $install_list, $optional_list);
+ if ($report_type == 'type') {
+ $build['added'] = [
+ '#caption' => $this->t('Added configuration items'),
+ '#empty' => $this->t('None: all active configuration items of this type were provided by modules, themes, or install profile.'),
+ ] + $this->makeReportTable($added, 'active', ['export', 'delete']);
+ }
+
+ // For differences, we need to go through the array of config in both
+ // and see if each config item is the same or not.
+ $both = array_diff($active_list, $added);
+ $different = [];
+ foreach ($both as $name) {
+ if (!$this->configDiff->same(
+ $this->configRevert->getFromExtension('', $name),
+ $this->configRevert->getFromActive('', $name)
+ )) {
+ $different[] = $name;
+ }
+ }
+ $build['different'] = [
+ '#caption' => $this->t('Changed configuration items'),
+ '#empty' => $this->t('None: no active configuration items differ from their current provided versions.'),
+ ] + $this->makeReportTable($different, 'active', ['diff', 'export', 'revert']);
+
+ return $build;
+ }
+
+ /**
+ * Builds a table for the report.
+ *
+ * @param string[] $names
+ * List of machine names of config items for the table.
+ * @param string $storage
+ * Config storage the items can be loaded from, either 'active' or
+ * 'extension'.
+ * @param string[] $actions
+ * Action links to include, one or more of:
+ * - diff
+ * - revert
+ * - export
+ * - import
+ * - delete
+ *
+ * @return array
+ * Render array for the table, not including the #empty and #prefix
+ * properties.
+ */
+ protected function makeReportTable($names, $storage, $actions) {
+ $build = [];
+
+ $build['#type'] = 'table';
+
+ $build['#attributes'] = ['class' => ['config-update-report']];
+
+ $build['#header'] = [
+ 'name' => [
+ 'data' => $this->t('Machine name'),
+ ],
+ 'label' => [
+ 'data' => $this->t('Label (if any)'),
+ 'class' => [RESPONSIVE_PRIORITY_LOW],
+ ],
+ 'type' => [
+ 'data' => $this->t('Type'),
+ 'class' => [RESPONSIVE_PRIORITY_MEDIUM],
+ ],
+ 'operations' => [
+ 'data' => $this->t('Operations'),
+ ],
+ ];
+
+ $build['#rows'] = [];
+
+ foreach ($names as $name) {
+ $row = [];
+ if ($storage == 'active') {
+ $config = $this->configRevert->getFromActive('', $name);
+ }
+ else {
+ $config = $this->configRevert->getFromExtension('', $name);
+ }
+
+ // Figure out what type of config it is, and get the ID.
+ $entity_type = $this->configList->getTypeNameByConfigName($name);
+
+ if (!$entity_type) {
+ // This is simple config.
+ $id = $name;
+ $type_label = $this->t('Simple configuration');
+ $entity_type = 'system.simple';
+ }
+ else {
+ $definition = $this->configList->getType($entity_type);
+ $id_key = $definition->getKey('id');
+ $id = $config[$id_key];
+ $type_label = $definition->getLabel();
+ }
+
+ $label = (isset($config['label'])) ? $config['label'] : '';
+ $row[] = $name;
+ $row[] = $label;
+ $row[] = $type_label;
+
+ $links = [];
+ $routes = [
+ 'export' => 'config.export_single',
+ 'import' => 'config_update_ui.import',
+ 'diff' => 'config_update_ui.diff',
+ 'revert' => 'config_update_ui.revert',
+ 'delete' => 'config_update_ui.delete',
+ ];
+ $titles = [
+ 'export' => $this->t('Export'),
+ 'import' => $this->t('Import from source'),
+ 'diff' => $this->t('Show differences'),
+ 'revert' => $this->t('Revert to source'),
+ 'delete' => $this->t('Delete'),
+ ];
+
+ foreach ($actions as $action) {
+ $links[$action] = [
+ 'url' => Url::fromRoute($routes[$action], ['config_type' => $entity_type, 'config_name' => $id]),
+ 'title' => $titles[$action],
+ ];
+ }
+
+ $row[] = [
+ 'data' => [
+ '#type' => 'operations',
+ '#links' => $links,
+ ],
+ ];
+
+ $build['#rows'][] = $row;
+ }
+
+ return $build;
+ }
+
+ /**
+ * Compares links for uasort(), to sort by displayed link title.
+ */
+ protected static function sortLinks($link1, $link2) {
+ $title1 = $link1['title'];
+ $title2 = $link2['title'];
+ if ($title1 == $title2) {
+ return 0;
+ }
+ return ($title1 < $title2) ? -1 : 1;
+ }
+
+}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php
new file mode 100644
index 000000000..0c272388f
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php
@@ -0,0 +1,143 @@
+configList = $config_list;
+ $this->configRevert = $config_update;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function create(ContainerInterface $container) {
+ return new static(
+ $container->get('config_update.config_list'),
+ $container->get('config_update.config_update')
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getFormId() {
+ return 'config_delete_confirm';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getQuestion() {
+ if ($this->type == 'system.simple') {
+ $type_label = $this->t('Simple configuration');
+ }
+ else {
+ $definition = $this->configList->getType($this->type);
+ $type_label = $definition->get('label');
+ }
+
+ return $this->t('Are you sure you want to delete the %type config %item?', ['%type' => $type_label, '%item' => $this->name]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getCancelUrl() {
+ return new Url('config_update_ui.report');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getDescription() {
+ return $this->t('This action cannot be undone. Manually deleting configuration from this page can cause problems on your site due to missing dependencies, and should only be done if there is no other way to delete a problematic piece of configuration.');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getConfirmText() {
+ return $this->t('Delete');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) {
+ $this->type = $config_type;
+ $this->name = $config_name;
+
+ $form = parent::buildForm($form, $form_state);
+ return $form;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function validateForm(array &$form, FormStateInterface $form_state) {
+ $value = $this->configRevert->getFromActive($this->type, $this->name);
+ if (!$value) {
+ $form_state->setErrorByName('', $this->t('There is no configuration @type named @name to delete', ['@type' => $this->type, '@name' => $this->name]));
+ return;
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function submitForm(array &$form, FormStateInterface $form_state) {
+ $this->configRevert->delete($this->type, $this->name);
+
+ drupal_set_message($this->t('The configuration was deleted.'));
+ $form_state->setRedirectUrl($this->getCancelUrl());
+ }
+
+}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php
new file mode 100644
index 000000000..efb6b3a9a
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php
@@ -0,0 +1,143 @@
+configList = $config_list;
+ $this->configRevert = $config_update;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function create(ContainerInterface $container) {
+ return new static(
+ $container->get('config_update.config_list'),
+ $container->get('config_update.config_update')
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getFormId() {
+ return 'config_update_confirm';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getQuestion() {
+ if ($this->type == 'system.simple') {
+ $type_label = $this->t('Simple configuration');
+ }
+ else {
+ $definition = $this->configList->getType($this->type);
+ $type_label = $definition->get('label');
+ }
+
+ return $this->t('Are you sure you want to revert the %type config %item to its source configuration?', ['%type' => $type_label, '%item' => $this->name]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getCancelUrl() {
+ return new Url('config_update_ui.report');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getDescription() {
+ return $this->t('Customizations will be lost. This action cannot be undone.');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getConfirmText() {
+ return $this->t('Revert');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) {
+ $this->type = $config_type;
+ $this->name = $config_name;
+
+ $form = parent::buildForm($form, $form_state);
+ return $form;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function validateForm(array &$form, FormStateInterface $form_state) {
+ $value = $this->configRevert->getFromExtension($this->type, $this->name);
+ if (!$value) {
+ $form_state->setErrorByName('', $this->t('There is no configuration @type named @name to import', ['@type' => $this->type, '@name' => $this->name]));
+ return;
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function submitForm(array &$form, FormStateInterface $form_state) {
+ $this->configRevert->revert($this->type, $this->name);
+
+ drupal_set_message($this->t('The configuration was reverted to its source.'));
+ $form_state->setRedirectUrl($this->getCancelUrl());
+ }
+
+}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Tests/ConfigUpdateTest.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Tests/ConfigUpdateTest.php
new file mode 100644
index 000000000..0a1b0bba3
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Tests/ConfigUpdateTest.php
@@ -0,0 +1,283 @@
+adminUser = $this->drupalCreateUser(['access administration pages', 'administer search', 'view config updates report', 'synchronize configuration', 'export configuration', 'import configuration', 'revert configuration', 'delete configuration']);
+ $this->drupalLogin($this->adminUser);
+
+ // Make sure local tasks and page title are showing.
+ $this->drupalPlaceBlock('local_tasks_block');
+ $this->drupalPlaceBlock('page_title_block');
+ }
+
+ /**
+ * Tests the config report and its linked pages.
+ */
+ public function testConfigReport() {
+ // Test links to report page.
+ $this->drupalGet('admin/config/development/configuration');
+ $this->clickLink('Updates report');
+ $this->assertNoReport();
+
+ // Verify some empty reports.
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->assertReport('Search page', [], [], [], []);
+ // Module, theme, and profile reports have no 'added' section.
+ $this->drupalGet('admin/config/development/configuration/report/module/search');
+ $this->assertReport('Search module', [], [], [], [], ['added']);
+ $this->drupalGet('admin/config/development/configuration/report/theme/classy');
+ $this->assertReport('Classy theme', [], [], [], [], ['added']);
+
+ $inactive = ['locale.settings' => 'Simple configuration'];
+ $this->drupalGet('admin/config/development/configuration/report/profile');
+ $this->assertReport('Testing profile', [], [], [], $inactive, ['added']);
+
+ // Delete the user search page from the search UI and verify report for
+ // both the search page config type and user module.
+ $this->drupalGet('admin/config/search/pages');
+ $this->clickLink('Delete');
+ $this->drupalPostForm(NULL, [], 'Delete');
+ $inactive = ['search.page.user_search' => 'Users'];
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->assertReport('Search page', [], [], [], $inactive);
+ $this->drupalGet('admin/config/development/configuration/report/module/user');
+ $this->assertReport('User module', [], [], [], $inactive, ['added', 'changed']);
+
+ // Use the import link to get it back. Do this from the search page
+ // report to make sure we are importing the right config.
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->clickLink('Import from source');
+ $this->assertText('The configuration was imported');
+ $this->assertNoReport();
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->assertReport('Search page', [], [], [], []);
+
+ // Edit the node search page from the search UI and verify report.
+ $this->drupalGet('admin/config/search/pages');
+ $this->clickLink('Edit');
+ $this->drupalPostForm(NULL, [
+ 'label' => 'New label',
+ 'path' => 'new_path',
+ ], 'Save search page');
+ $changed = ['search.page.node_search' => 'New label'];
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->assertReport('Search page', [], [], $changed, []);
+
+ // Test the show differences link.
+ $this->clickLink('Show differences');
+ $this->assertText('Content');
+ $this->assertText('New label');
+ $this->assertText('node');
+ $this->assertText('new_path');
+
+ // Test the Back link.
+ $this->clickLink("Back to 'Updates report' page.");
+ $this->assertNoReport();
+
+ // Test the export link.
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->clickLink('Export');
+ $this->assertText('Here is your configuration:');
+ $this->assertText('id: node_search');
+ $this->assertText('New label');
+ $this->assertText('path: new_path');
+ $this->assertText('search.page.node_search.yml');
+
+ // Test reverting.
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->clickLink('Revert to source');
+ $this->assertText('Are you sure you want to revert');
+ $this->assertText('Search page');
+ $this->assertText('node_search');
+ $this->assertText('Customizations will be lost. This action cannot be undone');
+ $this->drupalPostForm(NULL, [], 'Revert');
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->assertReport('Search page', [], [], [], []);
+
+ // Add a new search page from the search UI and verify report.
+ $this->drupalPostForm('admin/config/search/pages', [
+ 'search_type' => 'node_search',
+ ], 'Add new page');
+ $this->drupalPostForm(NULL, [
+ 'label' => 'test',
+ 'id' => 'test',
+ 'path' => 'test',
+ ], 'Add search page');
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $added = ['search.page.test' => 'test'];
+ $this->assertReport('Search page', [], $added, [], []);
+
+ // Test the export link.
+ $this->clickLink('Export');
+ $this->assertText('Here is your configuration:');
+ $this->assertText('id: test');
+ $this->assertText('label: test');
+ $this->assertText('path: test');
+ $this->assertText('search.page.test.yml');
+
+ // Test the delete link.
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->clickLink('Delete');
+ $this->assertText('Are you sure');
+ $this->assertText('cannot be undone');
+ $this->drupalPostForm(NULL, [], 'Delete');
+ $this->assertText('The configuration was deleted');
+ // And verify the report again.
+ $this->drupalGet('admin/config/development/configuration/report/type/search_page');
+ $this->assertReport('Search page', [], [], [], []);
+
+ // Change the search module config and verify the actions work for
+ // simple config.
+ $this->drupalPostForm('admin/config/search/pages', [
+ 'minimum_word_size' => 4,
+ ], 'Save configuration');
+ $changed = ['search.settings' => 'search.settings'];
+ $this->drupalGet('admin/config/development/configuration/report/module/search');
+ $this->assertReport('Search module', [], [], $changed, [], ['added']);
+
+ $this->clickLink('Show differences');
+ $this->assertText('Config difference for Simple configuration search.settings');
+ $this->assertText('index::minimum_word_size');
+ $this->assertText('4');
+
+ $this->drupalGet('admin/config/development/configuration/report/module/search');
+ $this->clickLink('Export');
+ $this->assertText('minimum_word_size: 4');
+
+ $this->drupalGet('admin/config/development/configuration/report/module/search');
+ $this->clickLink('Revert to source');
+ $this->drupalPostForm(NULL, [], 'Revert');
+
+ $this->drupalGet('admin/config/development/configuration/report/module/search');
+ $this->assertReport('Search module', [], [], [], [], ['added']);
+ }
+
+ /**
+ * Asserts that the report page has the correct content.
+ *
+ * Assumes you are already on the report page.
+ *
+ * @param string $title
+ * Report title to check for.
+ * @param string[] $missing
+ * Array of items that should be listed as missing, name => label.
+ * @param string[] $added
+ * Array of items that should be listed as missing, name => label.
+ * @param string[] $changed
+ * Array of items that should be listed as changed, name => label.
+ * @param string[] $inactive
+ * Array of items that should be listed as inactive, name => label.
+ * @param string[] $skip
+ * Array of report sections to skip checking.
+ */
+ protected function assertReport($title, $missing, $added, $changed, $inactive, $skip = []) {
+ $this->assertText('Configuration updates report for ' . $title);
+ $this->assertText('Generate new report');
+
+ if (!in_array('missing', $skip)) {
+ $this->assertText('Missing configuration items');
+ if (count($missing)) {
+ foreach ($missing as $name => $label) {
+ $this->assertText($name);
+ $this->assertText($label);
+ }
+ $this->assertNoText('None: all provided configuration items are in your active configuration.');
+ }
+ else {
+ $this->assertText('None: all provided configuration items are in your active configuration.');
+ }
+ }
+
+ if (!in_array('inactive', $skip)) {
+ $this->assertText('Inactive optional items');
+ if (count($inactive)) {
+ foreach ($inactive as $name => $label) {
+ $this->assertText($name);
+ $this->assertText($label);
+ }
+ $this->assertNoText('None: all optional configuration items are in your active configuration.');
+ }
+ else {
+ $this->assertText('None: all optional configuration items are in your active configuration.');
+ }
+ }
+
+ if (!in_array('added', $skip)) {
+ $this->assertText('Added configuration items');
+ if (count($added)) {
+ foreach ($added as $name => $label) {
+ $this->assertText($name);
+ $this->assertText($label);
+ }
+ $this->assertNoText('None: all active configuration items of this type were provided by modules, themes, or install profile.');
+ }
+ else {
+ $this->assertText('None: all active configuration items of this type were provided by modules, themes, or install profile.');
+ }
+ }
+
+ if (!in_array('changed', $skip)) {
+ $this->assertText('Changed configuration items');
+ if (count($changed)) {
+ foreach ($changed as $name => $label) {
+ $this->assertText($name);
+ $this->assertText($label);
+ }
+ $this->assertNoText('None: no active configuration items differ from their current provided versions.');
+ }
+ else {
+ $this->assertText('None: no active configuration items differ from their current provided versions.');
+ }
+ }
+ }
+
+ /**
+ * Asserts that the report is not shown.
+ *
+ * Assumes you are already on the report form page.
+ */
+ protected function assertNoReport() {
+ $this->assertText('Report type');
+ $this->assertText('Configuration type');
+ $this->assertText('Module');
+ $this->assertText('Theme');
+ $this->assertText('Installation profile');
+ $this->assertText('Updates report');
+ $this->assertNoText('Missing configuration items');
+ $this->assertNoText('Added configuration items');
+ $this->assertNoText('Changed configuration items');
+ $this->assertNoText('Unchanged configuration items');
+ }
+
+}
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php
new file mode 100644
index 000000000..670885097
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php
@@ -0,0 +1,37 @@
+stringTranslation = $translation;
+ $this->hierarchyPrefix = $hierarchy_prefix;
+ $this->valuePrefix = $value_prefix;
+ $this->ignore = $ignore;
+ }
+
+ /**
+ * Normalizes config for comparison.
+ *
+ * Recursively removes elements in the ignore list from configuration,
+ * as well as empty array values, and sorts at each level by array key, so
+ * that config from different storage can be compared meaningfully.
+ *
+ * @param array $config
+ * Configuration array to normalize.
+ *
+ * @return array
+ * Normalized configuration array.
+ *
+ * @see ConfigDiffer::format()
+ * @see ConfigDiffer::$ignore
+ */
+ protected function normalize($config) {
+ // Remove "ignore" elements.
+ foreach ($this->ignore as $element) {
+ unset($config[$element]);
+ }
+
+ // Recursively normalize remaining elements, if they are arrays.
+ foreach ($config as $key => $value) {
+ if (is_array($value)) {
+ $new = $this->normalize($value);
+ if (count($new)) {
+ $config[$key] = $new;
+ }
+ else {
+ unset($config[$key]);
+ }
+ }
+ }
+
+ // Sort and return.
+ ksort($config);
+ return $config;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function same($source, $target) {
+ $source = $this->normalize($source);
+ $target = $this->normalize($target);
+ return $source == $target;
+ }
+
+ /**
+ * Formats config for showing differences.
+ *
+ * To compute differences, we need to separate the config into lines and use
+ * line-by-line differencer. The obvious way to split into lines is:
+ * @code
+ * explode("\n", Yaml::encode($config))
+ * @endcode
+ * But this would highlight meaningless differences due to the often different
+ * order of config files, and also loses the indentation and context of the
+ * config hierarchy when differences are computed, making the difference
+ * difficult to interpret.
+ *
+ * So, what we do instead is to take the YAML hierarchy and format it so that
+ * the hierarchy is shown on each line. So, if you're in element
+ * $config['foo']['bar'] and the value is 'value', you will see
+ * 'foo::bar : value'.
+ *
+ * @param array $config
+ * Config array to format. Normalize it first if you want to do diffs.
+ * @param string $prefix
+ * (optional) When called recursively, the prefix to put on each line. Omit
+ * when initially calling this function.
+ *
+ * @return string[] Array of config lines formatted so that a line-by-line
+ * diff will show the context in each line, and meaningful differences will
+ * be computed.
+ *
+ * @see ConfigDiffer::normalize()
+ * @see ConfigDiffer::$hierarchyPrefix
+ * @see ConfigDiffer::$valuePrefix
+ */
+ protected function format($config, $prefix = '') {
+ $lines = [];
+
+ foreach ($config as $key => $value) {
+ $section_prefix = ($prefix) ? $prefix . $this->hierarchyPrefix . $key : $key;
+
+ if (is_array($value)) {
+ $lines[] = $section_prefix;
+ $newlines = $this->format($value, $section_prefix);
+ foreach ($newlines as $line) {
+ $lines[] = $line;
+ }
+ }
+ elseif (is_null($value)) {
+ $lines[] = $section_prefix . $this->valuePrefix . $this->t('(NULL)');
+ }
+ else {
+ $lines[] = $section_prefix . $this->valuePrefix . $value;
+ }
+ }
+
+ return $lines;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function diff($source, $target) {
+ $source = $this->normalize($source);
+ $target = $this->normalize($target);
+
+ $source_lines = $this->format($source);
+ $target_lines = $this->format($target);
+
+ return new Diff($source_lines, $target_lines);
+ }
+
+}
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigListInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigListInterface.php
new file mode 100644
index 000000000..ab1dba99e
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/src/ConfigListInterface.php
@@ -0,0 +1,74 @@
+entityManager = $entity_manager;
+ $this->activeConfigStorage = $active_config_storage;
+ $this->extensionConfigStorage = $extension_config_storage;
+ $this->extensionOptionalConfigStorage = $extension_optional_config_storage;
+ }
+
+ /**
+ * Sets up and returns the entity definitions list.
+ */
+ public function listTypes() {
+ if (count($this->definitions)) {
+ return $this->definitions;
+ }
+
+ foreach ($this->entityManager->getDefinitions() as $entity_type => $definition) {
+ if ($definition->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface')) {
+ $this->definitions[$entity_type] = $definition;
+ $prefix = $definition->getConfigPrefix();
+ $this->typesByPrefix[$prefix] = $entity_type;
+ }
+ }
+
+ ksort($this->definitions);
+
+ return $this->definitions;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getType($name) {
+ $definitions = $this->listTypes();
+ return isset($definitions[$name]) ? $definitions[$name] : NULL;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getTypeByPrefix($prefix) {
+ $definitions = $this->listTypes();
+ return isset($this->typesByPrefix[$prefix]) ? $definitions[$this->typesByPrefix[$prefix]] : NULL;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getTypeNameByConfigName($name) {
+ $definitions = $this->listTypes();
+ foreach ($this->typesByPrefix as $prefix => $entity_type) {
+ if (strpos($name, $prefix) === 0) {
+ return $entity_type;
+ }
+ }
+
+ return NULL;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function listConfig($list_type, $name) {
+ $active_list = [];
+ $install_list = [];
+ $optional_list = [];
+ $definitions = $this->listTypes();
+
+ switch ($list_type) {
+ case 'type':
+ if ($name == 'system.all') {
+ $active_list = $this->activeConfigStorage->listAll();
+ $install_list = $this->extensionConfigStorage->listAll();
+ $optional_list = $this->extensionOptionalConfigStorage->listAll();
+ }
+ elseif ($name == 'system.simple') {
+ // Listing is done by prefixes, and simple config doesn't have one.
+ // So list all and filter out all known prefixes.
+ $active_list = $this->omitKnownPrefixes($this->activeConfigStorage->listAll());
+ $install_list = $this->omitKnownPrefixes($this->extensionConfigStorage->listAll());
+ $optional_list = $this->omitKnownPrefixes($this->extensionOptionalConfigStorage->listAll());
+ }
+ elseif (isset($this->definitions[$name])) {
+ $definition = $this->definitions[$name];
+ $prefix = $definition->getConfigPrefix();
+ $active_list = $this->activeConfigStorage->listAll($prefix);
+ $install_list = $this->extensionConfigStorage->listAll($prefix);
+ $optional_list = $this->extensionOptionalConfigStorage->listAll($prefix);
+ }
+ break;
+
+ case 'profile':
+ $name = Settings::get('install_profile');
+ // Intentional fall-through here to the 'module' or 'theme' case.
+ case 'module':
+ case 'theme':
+ $active_list = $this->activeConfigStorage->listAll();
+ $install_list = $this->listProvidedItems($list_type, $name);
+ $optional_list = $this->listProvidedItems($list_type, $name, TRUE);
+ break;
+ }
+
+ return [$active_list, $install_list, $optional_list];
+ }
+
+ /**
+ * Returns a list of the install storage items for an extension.
+ *
+ * @param string $type
+ * Type of extension ('module', etc.).
+ * @param string $name
+ * Machine name of extension.
+ * @param bool $do_optional
+ * FALSE (default) to list config/install items, TRUE to list
+ * config/optional items.
+ *
+ * @return string[]
+ * List of config items provided by this extension.
+ */
+ protected function listProvidedItems($type, $name, $do_optional = FALSE) {
+ $pathname = drupal_get_filename($type, $name);
+ $component = new Extension(\Drupal::root(), $type, $pathname);
+ if ($do_optional) {
+ $names = $this->extensionOptionalConfigStorage->getComponentNames([$component]);
+ }
+ else {
+ $names = $this->extensionConfigStorage->getComponentNames([$component]);
+ }
+ return array_keys($names);
+ }
+
+ /**
+ * Omits config with known prefixes from a list of config names.
+ */
+ protected function omitKnownPrefixes($list) {
+ $prefixes = array_keys($this->typesByPrefix);
+ $list = array_combine($list, $list);
+ foreach ($list as $name) {
+ foreach ($prefixes as $prefix) {
+ if (strpos($name, $prefix) === 0) {
+ unset($list[$name]);
+ }
+ }
+ }
+
+ return array_values($list);
+ }
+
+}
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php b/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php
new file mode 100644
index 000000000..90944a15f
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php
@@ -0,0 +1,66 @@
+type = $type;
+ $this->name = $name;
+ }
+
+ /**
+ * Returns the type of configuration being imported or reverted.
+ *
+ * @return string
+ * The type of configuration, either 'system.simple' or a config entity
+ * type machine name.
+ */
+ public function getType() {
+ return $this->type;
+ }
+
+ /**
+ * Returns the name of the config item, without prefix.
+ *
+ * @return string
+ * The name of the config item being imported/reverted/deleted, with the
+ * prefix.
+ */
+ public function getName() {
+ return $this->name;
+ }
+
+}
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php
new file mode 100644
index 000000000..18e03fa40
--- /dev/null
+++ b/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php
@@ -0,0 +1,96 @@
+entityManager = $entity_manager;
+ $this->activeConfigStorage = $active_config_storage;
+ $this->extensionConfigStorage = $extension_config_storage;
+ $this->extensionOptionalConfigStorage = $extension_optional_config_storage;
+ $this->configFactory = $config_factory;
+ $this->dispatcher = $dispatcher;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function import($type, $name) {
+ // Read the config from the file.
+ $full_name = $this->getFullName($type, $name);
+ $value = $this->extensionConfigStorage->read($full_name);
+ if (!$value) {
+ $value = $this->extensionOptionalConfigStorage->read($full_name);
+ }
+ if (!$value) {
+ return FALSE;
+ }
+
+ // Save it as a new config entity or simple config.
+ if ($type == 'system.simple') {
+ $this->configFactory->getEditable($full_name)->setData($value)->save();
+ }
+ else {
+ $entity_storage = $this->entityManager->getStorage($type);
+ $entity = $entity_storage->createFromStorageRecord($value);
+ $entity->save();
+ }
+
+ // Trigger an event notifying of this change.
+ $event = new ConfigRevertEvent($type, $name);
+ $this->dispatcher->dispatch(ConfigRevertInterface::IMPORT, $event);
+
+ return TRUE;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function revert($type, $name) {
+ // Read the config from the file.
+ $full_name = $this->getFullName($type, $name);
+ $value = $this->extensionConfigStorage->read($full_name);
+ if (!$value) {
+ $value = $this->extensionOptionalConfigStorage->read($full_name);
+ }
+ if (!$value) {
+ return FALSE;
+ }
+
+ if ($type == 'system.simple') {
+ // Load the current config and replace the value.
+ $this->configFactory->getEditable($full_name)->setData($value)->save();
+ }
+ else {
+ // Load the current config entity and replace the value, with the
+ // old UUID.
+ $definition = $this->entityManager->getDefinition($type);
+ $id_key = $definition->getKey('id');
+
+ $id = $value[$id_key];
+ $entity_storage = $this->entityManager->getStorage($type);
+ $entity = $entity_storage->load($id);
+ $uuid = $entity->get('uuid');
+ $entity = $entity_storage->updateFromStorageRecord($entity, $value);
+ $entity->set('uuid', $uuid);
+ $entity->save();
+ }
+
+ // Trigger an event notifying of this change.
+ $event = new ConfigRevertEvent($type, $name);
+ $this->dispatcher->dispatch(ConfigRevertInterface::REVERT, $event);
+
+ return TRUE;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete($type, $name) {
+ $full_name = $this->getFullName($type, $name);
+ if (!$full_name) {
+ return FALSE;
+ }
+ $config = $this->configFactory->getEditable($full_name);
+ if (!$config) {
+ return FALSE;
+ }
+ $config->delete();
+
+ // Trigger an event notifying of this change.
+ $event = new ConfigRevertEvent($type, $name);
+ $this->dispatcher->dispatch(ConfigDeleteInterface::DELETE, $event);
+ return TRUE;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getFromActive($type, $name) {
+ $full_name = $this->getFullName($type, $name);
+ return $this->activeConfigStorage->read($full_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getFromExtension($type, $name) {
+ $full_name = $this->getFullName($type, $name);
+ $value = $this->extensionConfigStorage->read($full_name);
+ if (!$value) {
+ $value = $this->extensionOptionalConfigStorage->read($full_name);
+ }
+ return $value;
+ }
+
+ /**
+ * Returns the full name of a config item.
+ *
+ * @param string $type
+ * The config type, or '' to indicate $name is already prefixed.
+ * @param string $name
+ * The config name, without prefix.
+ *
+ * @return string
+ * The config item's full name.
+ */
+ protected function getFullName($type, $name) {
+ if ($type == 'system.simple' || !$type) {
+ return $name;
+ }
+
+ $definition = $this->entityManager->getDefinition($type);
+ $prefix = $definition->getConfigPrefix() . '.';
+ return $prefix . $name;
+ }
+
+}
diff --git a/sites/all/modules/contrib/admin/features/LICENSE.txt b/sites/all/modules/contrib/admin/features/LICENSE.txt
new file mode 100644
index 000000000..d159169d1
--- /dev/null
+++ b/sites/all/modules/contrib/admin/features/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/features/composer.json b/sites/all/modules/contrib/admin/features/composer.json
new file mode 100644
index 000000000..9de2a5c6b
--- /dev/null
+++ b/sites/all/modules/contrib/admin/features/composer.json
@@ -0,0 +1,8 @@
+{
+ "name": "drupal/features",
+ "description": "Enables administrators to package configuration into modules.",
+ "type": "drupal-module",
+ "license": "GPL-2.0+",
+ "minimum-stability": "dev",
+ "require": { }
+}
diff --git a/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml b/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml
new file mode 100644
index 000000000..56208094d
--- /dev/null
+++ b/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml
@@ -0,0 +1,92 @@
+langcode: en
+status: true
+dependencies: { }
+name: Default
+machine_name: default
+description: ''
+assignments:
+ base:
+ types:
+ config:
+ comment_type: comment_type
+ node_type: node_type
+ content:
+ user: user
+ enabled: true
+ weight: -2
+ core:
+ types:
+ config:
+ date_format: date_format
+ field_storage_config: field_storage_config
+ entity_form_mode: entity_form_mode
+ image_style: image_style
+ menu: menu
+ responsive_image_style: responsive_image_style
+ user_role: user_role
+ entity_view_mode: entity_view_mode
+ enabled: true
+ weight: 5
+ dependency:
+ enabled: true
+ weight: 15
+ exclude:
+ types:
+ config:
+ features_bundle: features_bundle
+ curated: true
+ module:
+ installed: true
+ profile: true
+ namespace: true
+ namespace_any: false
+ enabled: true
+ weight: -5
+ existing:
+ enabled: true
+ weight: 12
+ forward_dependency:
+ enabled: true
+ weight: 4
+ namespace:
+ enabled: true
+ weight: 0
+ optional:
+ types:
+ config: {}
+ enabled: true
+ weight: 0
+ packages:
+ enabled: true
+ weight: -20
+ profile:
+ curated: true
+ standard:
+ files: true
+ dependencies: true
+ types:
+ config:
+ block: block
+ language_content_settings: language_content_settings
+ configurable_language: configurable_language
+ migration: migration
+ shortcut_set: shortcut_set
+ tour: tour
+ enabled: true
+ weight: 10
+ site:
+ types:
+ config:
+ action: action
+ contact_form: contact_form
+ block_content_type: block_content_type
+ rdf_mapping: rdf_mapping
+ search_page: search_page
+ taxonomy_vocabulary: taxonomy_vocabulary
+ editor: editor
+ filter_format: filter_format
+ enabled: true
+ weight: 7
+profile_name: ''
+is_profile: false
+
diff --git a/sites/all/modules/contrib/admin/features/config/install/features.settings.yml b/sites/all/modules/contrib/admin/features/config/install/features.settings.yml
new file mode 100644
index 000000000..ed8b37a57
--- /dev/null
+++ b/sites/all/modules/contrib/admin/features/config/install/features.settings.yml
@@ -0,0 +1,3 @@
+export:
+ folder: 'custom'
+langcode: en
diff --git a/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml b/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml
new file mode 100644
index 000000000..7d515d18d
--- /dev/null
+++ b/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml
@@ -0,0 +1,207 @@
+features.settings:
+ type: config_entity
+ label: 'Features settings'
+ mapping:
+ export:
+ type: mapping
+ label: "Export settings"
+ mapping:
+ folder:
+ type: string
+ label: "Folder"
+ langcode:
+ type: string
+ label: "Language Code"
+
+features.bundle.*:
+ type: config_entity
+ label: 'Features bundle'
+ mapping:
+ machine_name:
+ type: string
+ label: "Machine name"
+ name:
+ type: string
+ label: "Name"
+ description:
+ type: string
+ label: "Description"
+ assignments:
+ type: sequence
+ label: "Assignment"
+ sequence:
+ type: features.assignment.[%key]
+ profile_name:
+ type: string
+ label: "Profile name"
+ is_profile:
+ type: boolean
+ label: "Is install profile"
+
+features.assignment.*:
+ type: mapping
+ label: "Assignment settings"
+ mapping:
+ enabled:
+ type: boolean
+ label: "Enabled"
+ weight:
+ type: integer
+ label: "Weight"
+
+features.assignment.base:
+ type: mapping
+ label: "Base type"
+ mapping:
+ enabled:
+ type: boolean
+ label: "Enabled"
+ weight:
+ type: integer
+ label: "Weight"
+ types:
+ type: mapping
+ label: "Types"
+ mapping:
+ config:
+ type: sequence
+ label: "Configuration Types"
+ sequence:
+ type: string
+ content:
+ type: sequence
+ label: "Content entity types"
+ sequence:
+ type: string
+
+features.assignment.core:
+ type: mapping
+ label: "Core type"
+ mapping:
+ enabled:
+ type: boolean
+ label: "Enabled"
+ weight:
+ type: integer
+ label: "Weight"
+ types:
+ type: mapping
+ label: "Types"
+ mapping:
+ config:
+ type: sequence
+ label: "Configuration Types"
+ sequence:
+ type: string
+
+features.assignment.exclude:
+ type: mapping
+ label: "Exclude"
+ mapping:
+ enabled:
+ type: boolean
+ label: "Enabled"
+ weight:
+ type: integer
+ label: "Weight"
+ types:
+ type: mapping
+ label: "Types"
+ mapping:
+ config:
+ type: sequence
+ label: "Configuration Types"
+ sequence:
+ type: string
+ curated:
+ type: boolean
+ label: "Exclude designated site-specific configuration"
+ module:
+ type: mapping
+ label: "Module"
+ mapping:
+ installed:
+ type: boolean
+ label: "Exclude installed module-provided entity configuration"
+ profile:
+ type: boolean
+ label: "Don't exclude install profile's configuration"
+ namespace:
+ type: boolean
+ label: "Don't exclude non-installed configuration by namespace"
+ namespace_any:
+ type: boolean
+ label: "Don't exclude ANY configuration by namespace"
+
+features.assignment.optional:
+ type: mapping
+ label: "Optional"
+ mapping:
+ enabled:
+ type: boolean
+ label: "Enabled"
+ weight:
+ type: integer
+ label: "Weight"
+ types:
+ type: mapping
+ label: "Types"
+ mapping:
+ config:
+ type: sequence
+ label: "Configuration Types"
+ sequence:
+ type: string
+
+features.assignment.profile:
+ type: mapping
+ label: "Profile"
+ mapping:
+ enabled:
+ type: boolean
+ label: "Enabled"
+ weight:
+ type: integer
+ label: "Weight"
+ curated:
+ type: boolean
+ label: "Add commonly-needed configuration"
+ standard:
+ type: mapping
+ label: "Standard"
+ mapping:
+ files:
+ type: boolean
+ label: "Add configuration and files from Standard profile"
+ dependencies:
+ type: boolean
+ label: "Add module and theme dependencies from Standard profile"
+ types:
+ type: mapping
+ label: "Types"
+ mapping:
+ config:
+ type: sequence
+ label: "Configuration Types"
+ sequence:
+ type: string
+
+features.assignment.site:
+ type: mapping
+ label: "Site"
+ mapping:
+ enabled:
+ type: boolean
+ label: "Enabled"
+ weight:
+ type: integer
+ label: "Weight"
+ types:
+ type: mapping
+ label: "Types"
+ mapping:
+ config:
+ type: sequence
+ label: "Configuration Types"
+ sequence:
+ type: string
diff --git a/sites/all/modules/contrib/admin/features/drush/features.drush.inc b/sites/all/modules/contrib/admin/features/drush/features.drush.inc
new file mode 100644
index 000000000..71ea58037
--- /dev/null
+++ b/sites/all/modules/contrib/admin/features/drush/features.drush.inc
@@ -0,0 +1,936 @@
+ 'Display current Features settings.',
+ 'aliases' => array('fs'),
+ );
+
+ $items['features-list-packages'] = array(
+ 'description' => 'Display a list of all existing features and packages available to be generated. If a package name is provided as an argument, then all of the configuration objects assigned to that package will be listed.',
+ 'examples' => array(
+ "drush features-list-packages" => 'Display a list of all existing featurea and packages available to be generated.',
+ "drush features-list-packages 'example_article'" => "Display a list of all configuration objects assigned to the 'example_article' package.",
+ ),
+ 'arguments' => array(
+ 'package' => 'The package to list. Optional; if specified, lists all configuration objects assigned to that package. If no package is specified, lists all of the features.',
+ ),
+ 'outputformat' => array(
+ 'default' => 'table',
+ 'pipe-format' => 'list',
+ 'field-labels' => array(
+ 'name' => 'Name',
+ 'machine_name' => 'Machine name',
+ 'status' => 'Status',
+ 'version' => 'Version',
+ 'state' => 'State',
+ 'object' => 'Configuration object',
+ ),
+ 'output-data-type' => 'format-table',
+ ),
+ 'aliases' => array('fl'),
+ );
+
+ $items['features-import-all'] = array(
+ 'description' => 'Import module config from all installed features.',
+ 'examples' => array(
+ "drush features-import-all" => 'Import module config from all installed features.',
+ ),
+ 'aliases' => array('fra', 'fia', 'fim-all'),
+ );
+
+ $items['features-export'] = array(
+ 'description' => "Export the configuration on your site into a custom module.",
+ 'arguments' => array(
+ 'package' => 'A space delimited list of features to export.',
+ ),
+ 'options' => array(
+ 'add-profile' => 'Package features into an install profile.',
+ ),
+ 'examples' => array(
+ "drush features-export" => 'Export all available packages.',
+ "drush features-export example_article example_page" => "Export the example_article and example_page packages.",
+ "drush features-export --add-profile" => "Export all available packages and add them to an install profile.",
+ ),
+ // Add previous "fu" alias for compatibility.
+ 'aliases' => array('fex', 'fu', 'fua', 'fu-all'),
+ );
+
+ $items['features-add'] = array(
+ 'description' => "Add a config item to a feature package.",
+ 'arguments' => array(
+ 'feature' => 'Feature package to export and add config to.',
+ 'components' => 'Patterns of config to add, see features-components for the format of patterns.',
+ ),
+ 'aliases' => array('fa', 'fe'),
+ );
+
+ $items['features-components'] = array(
+ 'description' => 'List features components.',
+ 'arguments' => array(
+ 'patterns' => 'The features components type to list. Omit this argument to list all components.',
+ ),
+ 'options' => array(
+ 'exported' => array(
+ 'description' => 'Show only components that have been exported.',
+ ),
+ 'not-exported' => array(
+ 'description' => 'Show only components that have not been exported.',
+ ),
+ ),
+ 'aliases' => array('fc'),
+ );
+
+ $items['features-diff'] = array(
+ 'description' => "Show the difference between the active config and the default config stored in a feature package.",
+ 'arguments' => array(
+ 'feature' => 'The feature in question.',
+ ),
+ 'options' => array(
+ 'ctypes' => 'Comma separated list of component types to limit the output to. Defaults to all types.',
+ 'lines' => 'Generate diffs with lines of context instead of the usual two.',
+ ),
+ 'aliases' => array('fd'),
+ );
+
+ $items['features-import'] = array(
+ 'description' => "Import a module config into your site.",
+ 'arguments' => array(
+ 'feature' => 'A space delimited list of features or feature:component pairs to import.',
+ ),
+ 'options' => array(
+ 'force' => "Force import even if config is not overridden.",
+ ),
+ 'examples' => array(
+ 'drush features-import foo:node.type.page foo:taxonomy.vocabulary.tags bar' => 'Import node and taxonomy config of feature "foo". Import all config of feature "bar".',
+ ),
+ 'aliases' => array('fim', 'fr'),
+ );
+
+ foreach ($items as $name => &$item) {
+ $item['options']['bundle'] = array(
+ 'description' => 'Use a specific bundle namespace.',
+ );
+ }
+
+ return $items;
+}
+
+/**
+ * Applies global options for Features drush commands.
+ *
+ * The option --name="bundle_name" sets the bundle namespace.
+ *
+ * @return \Drupal\features\FeaturesAssignerInterface
+*/
+function _drush_features_options() {
+ /** @var \Drupal\features\FeaturesAssignerInterface $assigner */
+ $assigner = \Drupal::service('features_assigner');
+ $bundle_name = drush_get_option('bundle');
+ if (!empty($bundle_name)) {
+ $bundle = $assigner->applyBundle($bundle_name);
+ if ($bundle->getMachineName() != $bundle_name) {
+ drush_log(dt('Bundle @name not found. Using default.', array('@name' => $bundle_name)), 'warning');
+ }
+ }
+ else {
+ $assigner->assignConfigPackages();
+ }
+ return $assigner;
+}
+
+/**
+ * Provides Drush command callback for features-status.
+ */
+function drush_features_status() {
+ $args = func_get_args();
+ $assigner = _drush_features_options();
+
+
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ $current_bundle = $assigner->getBundle();
+ $export_settings = $manager->getExportSettings();
+ $methods = $assigner->getEnabledAssigners();
+ if ($current_bundle->isDefault()) {
+ drush_print(dt('Current bundle: none'));
+ }
+ else {
+ drush_print(dt('Current bundle: @name (@machine_name)',
+ array(
+ '@name' => $current_bundle->getName(),
+ '@machine_name' => $current_bundle->getMachineName(),
+ )));
+ }
+ drush_print(dt('Export folder: @folder', array('@folder' => $export_settings['folder'])));
+ $dt_args = array('@methods' => implode(', ', array_keys($methods)));
+ drush_print(dt('The following assignment methods are enabled:'));
+ drush_print(dt(' @methods', $dt_args));
+
+ if (!empty($args)) {
+ $config = $manager->getConfigCollection();
+ if (count($args) > 1) {
+ print_r(array_keys($config));
+ }
+ else {
+ print_r($config[$args[0]]);
+ }
+ }
+}
+
+/**
+ * Drush command callback for features-list-packages.
+ *
+ * @param string $package_name
+ * (optional) The package name.
+ *
+ * @return array|bool
+ */
+function drush_features_list_packages($package_name = '') {
+ $assigner = _drush_features_options();
+ $current_bundle = $assigner->getBundle();
+ $namespace = $current_bundle->isDefault() ? '' : $current_bundle->getMachineName();
+
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ $packages = $manager->getPackages();
+
+ $packages = $manager->filterPackages($packages, $namespace);
+ $result = array();
+
+ // If no package was specified, list all packages.
+ if (empty($package_name)) {
+ drush_hide_output_fields(array('object'));
+ foreach ($packages as $package) {
+ $overrides = $manager->detectOverrides($package);
+ $state = $package->getState();
+ if (!empty($overrides) && ($package->getStatus() != FeaturesManagerInterface::STATUS_NO_EXPORT)) {
+ $state = FeaturesManagerInterface::STATE_OVERRIDDEN;
+ }
+
+ $result[$package->getMachineName()] = array(
+ 'name' => $package->getName(),
+ 'machine_name' => $package->getMachineName(),
+ 'status' => $manager->statusLabel($package->getStatus()),
+ 'version' => $package->getVersion(),
+ 'state' => ($state != FeaturesManagerInterface::STATE_DEFAULT)
+ ? $manager->stateLabel($state)
+ : '',
+ );
+ }
+ return $result;
+ }
+ // If a valid package was listed, list its configuration.
+ else {
+ foreach ($packages as $package) {
+ if ($package->getMachineName() == $package_name) {
+ drush_hide_output_fields(array(
+ 'machine_name',
+ 'name',
+ 'status',
+ 'version',
+ 'state',
+ ));
+ foreach ($package->getConfig() as $item_name) {
+ $result[$item_name] = array(
+ 'object' => $item_name,
+ );
+ }
+ return $result;
+ }
+ }
+
+ }
+
+ // If no matching package found, return an error.
+ drush_log(dt('Package "@package" not found.', array('@package' => $package_name)), 'warning');
+ return FALSE;
+}
+
+/**
+ * Drush command callback for features-import-all.
+ *
+ */
+function drush_features_import_all() {
+ _drush_features_options();
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ $packages = $manager->getPackages();
+ $packages = $manager->filterPackages($packages);
+ $overridden = array();
+
+ foreach ($packages as $package) {
+ $overrides = $manager->detectOverrides($package);
+ $missing = $manager->detectMissing($package);
+ if ((!empty($missing) || !empty($overrides)) && ($package->getStatus() == FeaturesManagerInterface::STATUS_INSTALLED)) {
+ $overridden[] = $package->getMachineName();
+ }
+ }
+
+ if (!empty($overridden)) {
+ call_user_func_array('drush_features_import', $overridden);
+ }
+ else {
+ drush_log(dt('Current state already matches active config, aborting.'), 'ok');
+ }
+}
+
+/**
+ * Provides Drush command callback for features-export.
+ */
+function drush_features_export($packages = NULL) {
+ $packages = func_get_args();
+ $assigner = _drush_features_options();
+
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ /** @var \Drupal\features\FeaturesGeneratorInterface $generator */
+ $generator = \Drupal::service('features_generator');
+
+ $current_bundle = $assigner->getBundle();
+
+ if (drush_get_option('add-profile')) {
+ if ($current_bundle->isDefault) {
+ return drush_set_error('', dt("Must specify a profile name with --name"));
+ }
+ $current_bundle->setIsProfile(TRUE);
+ }
+
+ $all_packages = $manager->getPackages();
+ foreach ($packages as $name) {
+ if (!isset($all_packages[$name])) {
+ return drush_set_error('', dt("The package @name does not exist.", array('@name' => $name)));
+ }
+ }
+
+ if (empty($packages)) {
+ $packages = $all_packages;
+ $dt_args = array('@modules' => implode(', ', array_keys($packages)));
+ drush_print(dt('The following extensions will be exported: @modules', $dt_args));
+ if (!drush_confirm(dt('Do you really want to continue?'))) {
+ return drush_user_abort('Aborting.');
+ }
+ }
+
+ // If any packages exist, confirm before overwriting.
+ if ($existing_packages = $manager->listPackageDirectories($packages, $current_bundle)) {
+ foreach ($existing_packages as $name => $directory) {
+ drush_print(dt("The extension @name already exists at @directory.", array('@name' => $name, '@directory' => $directory)));
+ }
+ // Apparently, format_plural is not always available.
+ if (count($existing_packages) == 1) {
+ $message = dt('Would you like to overwrite it?');
+ }
+ else {
+ $message = dt('Would you like to overwrite them?');
+ }
+ if (!drush_confirm($message)) {
+ return drush_user_abort();
+ }
+ }
+
+ // Use the write generation method.
+ $method_id = FeaturesGenerationWrite::METHOD_ID;
+ $result = $generator->generatePackages($method_id, $current_bundle, $packages);
+
+ foreach ($result as $message) {
+ $type = $message['success'] ? 'success' : 'error';
+ drush_log($message['message'], $message['variables'], $type);
+ }
+}
+
+/**
+ * Adds a component to a features module.
+ *
+ * @param
+ * The selected components.
+ */
+function drush_features_add() {
+ if ($args = func_get_args()) {
+ $assigner = _drush_features_options();
+
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ /** @var \Drupal\features\FeaturesGeneratorInterface $generator */
+ $generator = \Drupal::service('features_generator');
+
+ $current_bundle = $assigner->getBundle();
+
+ $module = array_shift($args);
+ if (empty($args)) {
+ return drush_set_error('', 'No components supplied.');
+ }
+ $components = _drush_features_component_list();
+ $options = array(
+ 'exported' => FALSE,
+ );
+
+ $filtered_components = _drush_features_component_filter($components, $args, $options);
+ $items = $filtered_components['components'];
+
+ if (empty($items)) {
+ return drush_set_error('', 'No components to add.');
+ }
+
+ $packages = array($module);
+ // If any packages exist, confirm before overwriting.
+ if ($existing_packages = $manager->listPackageDirectories($packages)) {
+ foreach ($existing_packages as $name => $directory) {
+ drush_print(dt("The extension @name already exists at @directory.", array('@name' => $name, '@directory' => $directory)));
+ }
+ // Apparently, format_plural is not always available.
+ if (count($existing_packages) == 1) {
+ $message = dt('Would you like to overwrite it?');
+ }
+ else {
+ $message = dt('Would you like to overwrite them?');
+ }
+ if (!drush_confirm($message)) {
+ return drush_user_abort();
+ }
+ }
+ else {
+ $package = $manager->initPackage($module, NULL, '', 'module', $current_bundle);
+ list($full_name, $path) = $manager->getExportInfo($package, $current_bundle);
+ drush_print(dt('Will create a new extension @name in @directory', array('@name' => $full_name, '@directory' => $path)));
+ if (!drush_confirm(dt('Do you really want to continue?'))) {
+ drush_die('Aborting.');
+ }
+ }
+
+ $config = _drush_features_build_config($items);
+
+ $manager->assignConfigPackage($module, $config);
+
+ // Use the write generation method.
+ $method_id = FeaturesGenerationWrite::METHOD_ID;
+ $result = $generator->generatePackages($method_id, $current_bundle, $packages);
+
+ foreach ($result as $message) {
+ $type = $message['success'] ? 'success' : 'error';
+ drush_log($message['message'], $message['variables'], $type);
+ }
+ }
+ else {
+ return drush_set_error('', 'No feature name given.');
+ }
+}
+
+/**
+ * Lists components, with pattern matching.
+ */
+function drush_features_components() {
+ $args = func_get_args();
+ _drush_features_options();
+
+ $components = _drush_features_component_list();
+ ksort($components);
+ // If no args supplied, prompt with a list.
+ if (empty($args)) {
+ $types = array_keys($components);
+ array_unshift($types, 'all');
+ $choice = drush_choice($types, 'Enter a number to choose which component type to list.');
+ if ($choice === FALSE) {
+ return;
+ }
+
+ $args = ($choice == 0) ? array('*') : array($types[$choice]);
+ }
+ $options = array(
+ 'provided by' => TRUE,
+ );
+ if (drush_get_option(array('exported', 'e'), NULL)) {
+ $options['not exported'] = FALSE;
+ }
+ elseif (drush_get_option(array('not-exported', 'o'), NULL)) {
+ $options['exported'] = FALSE;
+ }
+
+ $filtered_components = _drush_features_component_filter($components, $args, $options);
+ if ($filtered_components) {
+ _drush_features_component_print($filtered_components);
+ }
+}
+
+/**
+ * Lists the differences in the package config vs the active store.
+ *
+ * @param string $package
+ * The machine name of a package.
+ */
+function drush_features_diff() {
+ if (!$args = func_get_args()) {
+ drush_print_table(drush_features_list_packages());
+ return;
+ }
+
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ /** @var \Drupal\features\FeaturesAssignerInterface $assigner */
+ $assigner = \Drupal::service('features_assigner');
+ $assigner->assignConfigPackages();
+
+ $module = $args[0];
+ $filter_ctypes = drush_get_option("ctypes");
+ if ($filter_ctypes) {
+ $filter_ctypes = explode(',', $filter_ctypes);
+ }
+
+ $feature = _drush_features_load_feature($module, TRUE);
+ if (empty($feature)) {
+ drush_log(dt('No such feature is available: @module', array('@module' => $module)), 'error');
+ return;
+ }
+
+ $lines = drush_get_option('lines');
+ $lines = isset($lines) ? $lines : 2;
+
+ $formatter = new DiffFormatter();
+ $formatter->leading_context_lines = $lines;
+ $formatter->trailing_context_lines = $lines;
+ $formatter->show_header = FALSE;
+
+ if (drush_get_context('DRUSH_NOCOLOR')) {
+ $red = $green = "%s";
+ }
+ else {
+ $red = "\033[31;40m\033[1m%s\033[0m";
+ $green = "\033[0;32;40m\033[1m%s\033[0m";
+ }
+
+ $overrides = $manager->detectOverrides($feature);
+ $missing = $manager->reorderMissing($manager->detectMissing($feature));
+ $overrides = array_merge($overrides, $missing);
+
+ if (empty($overrides)) {
+ drush_print(dt('Active config matches stored config for @module.', array('@module' => $module)));
+ }
+ else {
+ /** @var \Drupal\config_update\ConfigDiffInterface $config_diff */
+ $config_diff = \Drupal::service('config_update.config_diff');
+ /** @var \Drupal\Core\Config\StorageInterface $active_storage */
+ $active_storage = \Drupal::service('config.storage');
+
+ // Print key for colors.
+ drush_print(dt('Legend: '));
+ drush_print(sprintf($red, dt('Code: drush features-import will replace the active config with the displayed code.')));
+ drush_print(sprintf($green, dt('Active: drush features-export will update the exported feature with the displayed active config')));
+
+ foreach ($overrides as $name) {
+ $message = '';
+ if (in_array($name, $missing)) {
+ $message = sprintf($red, t('(missing from active)'));
+ $extension = array();
+ }
+ else {
+ $active = $manager->getActiveStorage()->read($name);
+ $extension = $manager->getExtensionStorages()->read($name);
+ if (empty($extension)) {
+ $extension = array();
+ $message = sprintf($green, t('(not exported)'));
+ }
+ $diff = $config_diff->diff($extension, $active);
+ $rows = explode("\n", $formatter->format($diff));
+ }
+ drush_print();
+ drush_print(dt("Config @name @message", array('@name' => $name, '@message' => $message)));
+ if (!empty($extension)) {
+ foreach ($rows as $row) {
+ if (strpos($row, '>') === 0) {
+ drush_print(sprintf($green, $row));
+ }
+ elseif (strpos($row, '<') === 0) {
+ drush_print(sprintf($red, $row));
+ }
+ else {
+ drush_print($row);
+ }
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Imports module config into the active store.
+ *
+ * Same as the old "revert" functionality.
+ */
+function drush_features_import() {
+ if ($args = func_get_args()) {
+ _drush_features_options();
+
+ // Determine if revert should be forced.
+ $force = drush_get_option('force');
+ // Determine if -y was supplied. If so, we can filter out needless output
+ // from this command.
+ $skip_confirmation = drush_get_context('DRUSH_AFFIRMATIVE');
+
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ /** @var \Drupal\config_update\ConfigRevertInterface $config_revert */
+ $config_revert = \Drupal::service('features.config_update');
+
+ // Parse list of arguments.
+ $modules = array();
+ foreach ($args as $arg) {
+ $arg = explode(':', $arg);
+ $module = array_shift($arg);
+ $component = array_shift($arg);
+
+ if (isset($module)) {
+ if (empty($component)) {
+ // If we received just a feature name, this means that we need all of
+ // its components.
+ $modules[$module] = TRUE;
+ }
+ elseif ($modules[$module] !== TRUE) {
+ if (!isset($modules[$module])) {
+ $modules[$module] = array();
+ }
+ $modules[$module][] = $component;
+ }
+ }
+ }
+
+ // Process modules.
+ foreach ($modules as $module => $components_needed) {
+
+ $dt_args['@module'] = $module;
+ /** @var \Drupal\features\Package $feature */
+ $feature = _drush_features_load_feature($module, TRUE);
+ if (empty($feature)) {
+ drush_log(dt('No such feature is available: @module', $dt_args), 'error');
+ return;
+ }
+
+ if ($feature->getStatus() != FeaturesManagerInterface::STATUS_INSTALLED) {
+ drush_log(dt('No such feature is installed: @module', $dt_args), 'error');
+ return;
+ }
+
+ // Forcefully revert all components of a feature.
+ if ($force) {
+ $components = $feature->getConfigOrig();
+ }
+ // Only revert components that are detected to be Overridden.
+ else {
+ $components = $manager->detectOverrides($feature);
+ $missing = $manager->reorderMissing($manager->detectMissing($feature));
+ // Be sure to import missing components first.
+ $components = array_merge($missing, $components);
+ }
+
+ if (!empty($components_needed) && is_array($components_needed)) {
+ $components = array_intersect($components, $components_needed);
+ }
+
+ if (empty($components)) {
+ drush_log(dt('Current state already matches active config, aborting.'), 'ok');
+ }
+ else {
+ $config = $manager->getConfigCollection();
+ foreach ($components as $component) {
+ $dt_args['@component'] = $component;
+ $confirmation_message = 'Do you really want to import @module : @component?';
+ if ($skip_confirmation || drush_confirm(dt($confirmation_message, $dt_args))) {
+ if (!isset($config[$component])) {
+ // Import missing component.
+ /** @var array $item */
+ $item = $manager->getConfigType($component);
+ $type = ConfigurationItem::fromConfigStringToConfigType($item['type']);
+ $config_revert->import($type, $item['name_short']);
+ drush_log(dt('Import @module : @component.', $dt_args), 'ok');
+ }
+ else {
+ // Revert existing component.
+ /** @var \Drupal\features\ConfigurationItem $item */
+ $item = $config[$component];
+ $type = ConfigurationItem::fromConfigStringToConfigType($item->getType());
+ $config_revert->revert($type, $item->getShortName());
+ drush_log(dt('Reverted @module : @component.', $dt_args), 'ok');
+ }
+ }
+ else {
+ drush_log(dt('Skipping @module : @component.', $dt_args), 'ok');
+ }
+ }
+ }
+ }
+ }
+ else {
+ drush_print_table(drush_features_list_packages());
+ return;
+ }
+}
+
+/**
+ * Loads a Features package.
+ *
+ * @param string $module
+ * The machine name of a module.
+ * @param bool $any
+ * If TRUE then check for any module, not just a Features module.
+ *
+ * @return array
+ */
+function _drush_features_load_feature($module, $any = FALSE) {
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ $feature = $manager->getPackage($module);
+ if ($any && !isset($feature)) {
+ // See if this is a non-features module.
+ $module_handler = \Drupal::moduleHandler();
+ $modules = $module_handler->getModuleList();
+ if (!empty($modules[$module])) {
+ $extension = $modules[$module];
+ $feature = $manager->initPackageFromExtension($extension);
+ $config = $manager->listExtensionConfig($extension);
+ $feature->setConfig($config);
+ $feature->setStatus(FeaturesManagerInterface::STATUS_INSTALLED);
+ }
+ }
+ return $feature;
+}
+
+/**
+ * Returns an array of full config names given a array[$type][$component].
+ *
+ * @param array $items
+ * The items to return data for.
+ */
+function _drush_features_build_config(array $items) {
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ $result = array();
+ foreach ($items as $config_type => $item) {
+ foreach ($item as $item_name => $title) {
+ $result[] = $manager->getFullName($config_type, $item_name);
+ }
+ }
+ return $result;
+}
+
+/**
+ * Returns a listing of all known components, indexed by source.
+ */
+function _drush_features_component_list() {
+ $result = array();
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ $config = $manager->getConfigCollection();
+ foreach ($config as $item_name => $item) {
+ $result[$item->getType()][$item->getShortName()] = $item->getLabel();
+ }
+ return $result;
+}
+
+/**
+ * Filters components by patterns.
+ */
+function _drush_features_component_filter($all_components, $patterns = array(), $options = array()) {
+ $options += array(
+ 'exported' => TRUE,
+ 'not exported' => TRUE,
+ 'provided by' => FALSE,
+ );
+ $pool = array();
+ // Maps exported components to feature modules.
+ $components_map = _drush_features_get_component_map();
+ // First filter on exported state.
+ foreach ($all_components as $source => $components) {
+ foreach ($components as $name => $title) {
+ $exported = count($components_map[$source][$name]) > 0;
+ if ($exported) {
+ if ($options['exported']) {
+ $pool[$source][$name] = $title;
+ }
+ }
+ else {
+ if ($options['not exported']) {
+ $pool[$source][$name] = $title;
+ }
+ }
+ }
+ }
+
+ $state_string = '';
+
+ if (!$options['exported']) {
+ $state_string = 'unexported';
+ }
+ elseif (!$options['not exported']) {
+ $state_string = 'exported';
+ }
+
+ $selected = array();
+ foreach ($patterns as $pattern) {
+ // Rewrite * to %. Let users use both as wildcard.
+ $pattern = strtr($pattern, array('*' => '%'));
+ $sources = array();
+ list($source_pattern, $component_pattern) = explode(':', $pattern, 2);
+ // If source is empty, use a pattern.
+ if ($source_pattern == '') {
+ $source_pattern = '%';
+ }
+ if ($component_pattern == '') {
+ $component_pattern = '%';
+ }
+
+ $preg_source_pattern = strtr(preg_quote($source_pattern, '/'), array('%' => '.*'));
+ $preg_component_pattern = strtr(preg_quote($component_pattern, '/'), array('%' => '.*'));
+ // If it isn't a pattern, but a simple string, we don't anchor the
+ // pattern. This allows for abbreviating. Otherwise, we do, as this seems
+ // more natural for patterns.
+ if (strpos($source_pattern, '%') !== FALSE) {
+ $preg_source_pattern = '^' . $preg_source_pattern . '$';
+ }
+ if (strpos($component_pattern, '%') !== FALSE) {
+ $preg_component_pattern = '^' . $preg_component_pattern . '$';
+ }
+ $matches = array();
+
+ // Find the sources.
+ $all_sources = array_keys($pool);
+ $matches = preg_grep('/' . $preg_source_pattern . '/', $all_sources);
+ if (count($matches) > 0) {
+ // If we have multiple matches and the source string wasn't a
+ // pattern, check if one of the matches is equal to the pattern, and
+ // use that, or error out.
+ if (count($matches) > 1 and $preg_source_pattern[0] != '^') {
+ if (in_array($source_pattern, $matches)) {
+ $matches = array($source_pattern);
+ }
+ else {
+ return drush_set_error('', dt('Ambiguous source "@source", matches @matches', array(
+ '@source' => $source_pattern,
+ '@matches' => implode(', ', $matches),
+ )));
+ }
+ }
+ // Loose the indexes preg_grep preserved.
+ $sources = array_values($matches);
+ }
+ else {
+ return drush_set_error('', dt('No @state sources match "@source"', array('@state' => $state_string, '@source' => $source_pattern)));
+ }
+
+ // Now find the components.
+ foreach ($sources as $source) {
+ // Find the components.
+ $all_components = array_keys($pool[$source]);
+ // See if there's any matches.
+ $matches = preg_grep('/' . $preg_component_pattern . '/', $all_components);
+ if (count($matches) > 0) {
+ // If we have multiple matches and the components string wasn't a
+ // pattern, check if one of the matches is equal to the pattern, and
+ // use that, or error out.
+ if (count($matches) > 1 and $preg_component_pattern[0] != '^') {
+ if (in_array($component_pattern, $matches)) {
+ $matches = array($component_pattern);
+ }
+ else {
+ return drush_set_error('', dt('Ambiguous component "@component", matches @matches', array(
+ '@component' => $component_pattern,
+ '@matches' => implode(', ', $matches),
+ )));
+ }
+ }
+ if (!is_array($selected[$source])) {
+ $selected[$source] = array();
+ }
+ $selected[$source] += array_intersect_key($pool[$source], array_flip($matches));
+ }
+ else {
+ // No matches. If the source was a pattern, just carry on, else
+ // error out. Allows for patterns like :*field*
+ if ($preg_source_pattern[0] != '^') {
+ return drush_set_error('', dt('No @state @source components match "@component"', array(
+ '@state' => $state_string,
+ '@component' => $component_pattern,
+ '@source' => $source,
+ )));
+ }
+ }
+ }
+ }
+
+ // Lastly, provide feature module information on the selected components, if
+ // requested.
+ $provided_by = array();
+ if ($options['provided by'] && $options['exported']) {
+ foreach ($selected as $source => $components) {
+ foreach ($components as $name => $title) {
+ $exported = count($components_map[$source][$name]) > 0;
+ if ($exported) {
+ $provided_by[$source . ':' . $name] = implode(', ', $components_map[$source][$name]);
+ }
+ }
+ }
+ }
+
+ return array(
+ 'components' => $selected,
+ 'sources' => $provided_by,
+ );
+}
+
+/**
+ * Provides a component to feature map (port of features_get_component_map).
+ */
+function _drush_features_get_component_map() {
+ $result = array();
+ /** @var \Drupal\features\FeaturesManagerInterface $manager */
+ $manager = \Drupal::service('features.manager');
+ // Recalc full config list without running assignments.
+ $config = $manager->getConfigCollection();
+ $packages = $manager->getPackages();
+
+ foreach ($config as $item_name => $item) {
+ $type = $item->getType();
+ $short_name = $item->getShortName();
+ $name = $item->getName();
+ if (!isset($result[$type][$short_name])) {
+ $result[$type][$short_name] = array();
+ }
+ if (!empty($item->getPackage())) {
+ $package = $packages[$item->getPackage()];
+ $result[$type][$short_name][] = $package->getMachineName();
+ }
+ }
+
+ return $result;
+}
+
+/**
+ * Prints a list of filtered components.
+ */
+function _drush_features_component_print($filtered_components) {
+ $rows = array(array(dt('Available sources')));
+ foreach ($filtered_components['components'] as $source => $components) {
+ foreach ($components as $name => $value) {
+ $row = array($source . ':' . $name);
+ if (isset($filtered_components['sources'][$source . ':' . $name])) {
+ $row[] = dt('Provided by') . ': ' . $filtered_components['sources'][$source . ':' . $name];
+ }
+ $rows[] = $row;
+ }
+ }
+
+ drush_print_table($rows, TRUE);
+}
diff --git a/sites/all/modules/contrib/admin/features/features.info.yml b/sites/all/modules/contrib/admin/features/features.info.yml
new file mode 100644
index 000000000..247a6f88e
--- /dev/null
+++ b/sites/all/modules/contrib/admin/features/features.info.yml
@@ -0,0 +1,14 @@
+name: 'Features'
+type: module
+description: 'Enables administrators to package configuration into modules.'
+package: Development
+# core: 8.x
+dependencies:
+ - config
+ - config_update
+
+# Information added by Drupal.org packaging script on 2016-09-02
+version: '8.x-3.0-beta8'
+core: '8.x'
+project: 'features'
+datestamp: 1472847281
diff --git a/sites/all/modules/contrib/admin/features/features.module b/sites/all/modules/contrib/admin/features/features.module
new file mode 100644
index 000000000..55b8a96f0
--- /dev/null
+++ b/sites/all/modules/contrib/admin/features/features.module
@@ -0,0 +1,47 @@
+' . t('About') . '';
+ $output .= '
' . t('The Features module provides a user interface for exporting bundles of configuration into modules. For more information, see the online documentation for Features module', array(
+ ':url' => 'http://drupal.org/node/2404427',
+ )) . '
' . t('Custom features for use on a particular site.') . '
';
+ $output .= '
' . t('The features of a given distribution.', array(':distributions' => 'https://www.drupal.org/documentation/build/distributions')) . '
';
+ $output .= '
';
+ $output .= '
' . t('Use the form below to manage bundles. Each bundle comes with a set of assignment methods. By configuring and ordering the assignment methods, you can set the defaults for what does and doesn\'t get packaged into features for your bundle. Use the Bundle select to choose which bundle to edit, or chose --New-- to create a new bundle. The Default bundle does not include a namespace and cannot be deleted.') . '