`.
17 | relationships:
18 | database: 'mysqldb:mysql'
19 | # solr: 'solrsearch:solr'
20 | # redis: 'rediscache:redis'
21 |
22 | runtime:
23 | extensions:
24 | - xdebug
25 |
26 | # The size of the persistent disk of the application (in MB).
27 | disk: 2048
28 |
29 | # The 'mounts' describe writable, persistent filesystem mounts in the application. The keys are
30 | # directory paths, relative to the application root. The values are strings such as
31 | # 'shared:files/PATH', where PATH is a relative path under the mount's source directory.
32 | mounts:
33 | '/web/sites/default/files': 'shared:files/files'
34 | '/tmp': 'shared:files/tmp'
35 | '/private': 'shared:files/private'
36 | '/.drush': 'shared:files/.drush'
37 | '/drush-backups': 'shared:files/drush-backups'
38 | '/.console': 'shared:files/console'
39 |
40 | # Configuration of the build of this application.
41 | build:
42 | flavor: composer
43 |
44 | # The hooks executed at various points in the lifecycle of the application.
45 | hooks:
46 | # The deploy hook runs after your application has been deployed and started.
47 | deploy: |
48 | set -e
49 | php ./drush/platformsh_generate_drush_yml.php
50 | cd web
51 | drush -y cache-rebuild
52 | drush -y updatedb
53 | drush -y config-import
54 |
55 | # The configuration of app when it is exposed to the web.
56 | web:
57 | # Specific parameters for different URL prefixes.
58 | locations:
59 | '/':
60 | # The folder from which to serve static assets, for this location.
61 | #
62 | # This is a filesystem path, relative to the application root.
63 | root: 'web'
64 |
65 | # How long to allow static assets from this location to be cached.
66 | #
67 | # Can be a time in seconds, or -1 for no caching. Times can be
68 | # suffixed with "s" (seconds), "m" (minutes), "h" (hours), "d"
69 | # (days), "w" (weeks), "M" (months, as 30 days) or "y" (years, as
70 | # 365 days).
71 | expires: 5m
72 |
73 | # Whether to forward disallowed and missing resources from this
74 | # location to the application.
75 | #
76 | # Can be true, false or a URI path string.
77 | passthru: '/index.php'
78 |
79 | # Deny access to static files in this location.
80 | allow: false
81 |
82 | # Rules for specific URI patterns.
83 | rules:
84 | # Allow access to common static files.
85 | '\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$':
86 | allow: true
87 | '^/robots\.txt$':
88 | allow: true
89 | '^/sitemap\.xml$':
90 | allow: true
91 |
92 | # Deny direct access to configuration files.
93 | '^/sites/sites\.php$':
94 | scripts: false
95 | '^/sites/[^/]+/settings.*?\.php$':
96 | scripts: false
97 |
98 | '/sites/default/files':
99 | # Allow access to all files in the public files directory.
100 | allow: true
101 | expires: 5m
102 | passthru: '/index.php'
103 | root: 'web/sites/default/files'
104 |
105 | # Do not execute PHP scripts.
106 | scripts: false
107 |
108 | rules:
109 | # Provide a longer TTL (2 weeks) for aggregated CSS and JS files.
110 | '^/sites/default/files/(css|js)':
111 | expires: 2w
112 |
113 | # The configuration of scheduled execution.
114 | crons:
115 | drupal:
116 | spec: '*/20 * * * *'
117 | cmd: 'cd web ; drush core-cron'
118 |
--------------------------------------------------------------------------------
/.platform.template.yaml:
--------------------------------------------------------------------------------
1 | # Platform.sh Project Initialization Template
2 | #
3 | # This files defines settings and workflow modifications that allow a git
4 | # repository to be deployed to Platform.sh and its white-label partners. A
5 | # project template can be a fully functioning ready-made application or a
6 | # quick-start point for custom development work.
7 | #
8 | # It contains elements that affect the behaviour upon the initialisation of
9 | # a new project (for example minimal plan sizes) as well as elements that
10 | # allow Platform.sh to present it in a user interface (such as the description
11 | # of the project, tags, an icon etc.).
12 | #
13 | # Once provisioned this file has no effects on the running project. You
14 | # are free to remove it.
15 |
16 | # The schema is versioned so that we can establish code paths differently in the future if we need to change this.
17 | version: 1
18 |
19 | # Templates are a small amount of information supporting a template URL. Each template is selectable at the project-creation step.
20 | info:
21 | # Unique machine name, prefaced by a vendor or organization identifier
22 | id: platformsh/drupal8
23 | # The human-readable name of the template.
24 | name: Drupal 8
25 | # Human-readable descriptive text for the template. Supports limited HTML.
26 | description: Drupal is a highly-customizable free software PHP CMS that allows you to easily organize, manage and publish your content.
27 | # A list of tags associated with the template.
28 | tags:
29 | - PHP
30 | - Drupal
31 | - CMS
32 | # An image URI (either base64-encoded or a URL) representing the template.
33 | image: data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzNSA0MCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzUgNDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojMDA4RUNFO30KPC9zdHlsZT4KPGc+CjwvZz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI0LDYuNmMwLDAtMi4zLTEtMy42LTEuOGMwLDAtMS43LTEtNC41LTQuN2MwLDAsMC4xLDQuMi00LjQsNi40QzQuNCw5LjMsMCwxNS4yLDAsMjIuN0MwLDMyLjIsNy44LDQwLDE3LjMsNDAKCWM5LjYsMCwxNy4zLTcuOCwxNy4zLTE3LjNDMzQuNywxMS4xLDI0LDYuNiwyNCw2LjZ6IE00LjgsMTYuMWMtMi43LDAuNi0yLjUtMC44LTItMmMwLjItMC43LDAuOS0xLjUsMC45LTEuNWMxLjgtMi45LDUuOC01LDUuOC01CglsMCwwYzAuNS0wLjIsMS40LTAuNywyLjItMS4xYzEuNi0wLjksMi0xLjQsMi0xLjRjMi4zLTIuMiwyLjEtNC45LDIuMS01YzAsMCwwLDAsMCwwYzAsMCwwLDAsMCwwdjBjMCwwLDAsMCwwLDAKCWMyLDQtMC40LDUuOC0wLjQsNS44YzAuNiwwLjYsMC40LDEuMiwwLjQsMS4yQzEyLjcsMTMuOCw0LjgsMTYuMSw0LjgsMTYuMXogTTI1LjcsMzcuMWMtMC4yLDAuMS0yLjcsMS4zLTUuNiwxLjMKCWMtMS42LDAtMy4zLTAuNC00LjgtMS40Yy0wLjUtMC40LTAuNy0xLjEtMC40LTEuNmMwLjEtMC4yLDAuNy0wLjksMi4xLDBsMCwwYzAuMSwwLjEsMy40LDIuMyw4LjUtMC41YzAuNC0wLjIsMC45LTAuMSwxLjEsMC4zCglDMjYuOSwzNS42LDI3LDM2LjQsMjUuNywzNy4xeiBNMTguNywzMi45bDAuMS0wLjFjMC4xLTAuMSwxLjgtMi4zLDQuMy0yYzAuNCwwLDEuOCwwLjEsMi43LDEuOGMwLjEsMC4yLDAuMywwLjktMC4xLDEuNAoJYy0wLjIsMC4yLTAuNSwwLjQtMS4xLDAuMmMtMC40LTAuMS0wLjYtMC41LTAuNi0wLjdsMCwwYy0wLjEtMC4zLTAuMi0wLjUtMS4yLTAuNmMtMC44LTAuMS0xLjMsMC4zLTEuOSwwLjgKCWMtMC4zLDAuMy0wLjcsMC42LTEuMSwwLjdjLTAuMSwwLjEtMC4yLDAuMS0wLjQsMC4xYy0wLjIsMC0wLjQtMC4xLTAuNi0wLjJDMTguNSwzNCwxOC40LDMzLjYsMTguNywzMi45eiBNMzAuMSwzMy4xCgljMCwwLTAuOSwwLjMtMS44LTAuN2MwLDAtMi43LTMuMS00LTMuNmMwLDAtMC44LTAuMy0xLjgsMC4xYzAsMC0wLjcsMC4xLTMuNCwxLjljMCwwLTQuNiwyLjktNi45LDIuNWMwLDAtNS4yLDAuMS00LjUtNS40CgljMCwwLDEuMS02LjIsOC4zLTQuOGMwLDAsMS42LDAuMyw0LjUsMi42YzAsMCwyLDEuNSwzLDEuNWMwLDAsMC44LDAuMSwyLjYtMWMwLDAsMy41LTIuNyw0LjgtMi42YzAsMCwwLDAsMCwwCgljMC4yLDAsMi41LTAuMSwyLjUsMy43QzMzLjMsMjcuMiwzMy40LDMxLjYsMzAuMSwzMy4xeiIvPgo8L3N2Zz4K
34 |
35 | # Additional notes displayed in the template's detail view.
36 | # Each note object is displayed as a small section heading with content below. Supports limited HTML.
37 | notes:
38 | - heading: "Apps & Services"
39 | content: "PHP 7.2
MySQL 10.2"
40 | - heading: "Requirements"
41 |
42 |
43 | # This key describes the initialization call made to the master environment at
44 | # project creation time. This is part of the full v2 UI operation mode, which
45 | # places project schema/options selection early in the creation process, rather
46 | # than later as it exitss now. To allow this schema to be backwards-compatible,
47 | # this key also gets mapped to the appropriate location in project.settings so
48 | # that the current UI can have its own workflow overridden as well.
49 | initialize:
50 | repository: git://github.com/platformsh/template-drupal8.git@master
51 | config: null
52 | files: []
53 | profile: Drupal 8
54 |
--------------------------------------------------------------------------------
/.platform/routes.yaml:
--------------------------------------------------------------------------------
1 | # The routes of the project.
2 | #
3 | # Each route describes how an incoming URL is going
4 | # to be processed by Platform.sh.
5 |
6 | "https://{default}/":
7 | type: upstream
8 | upstream: "app:http"
9 | cache:
10 | enabled: true
11 |
12 | # Base the cache on the session cookie and custom Drupal cookies. Ignore all other cookies.
13 | cookies: ['/^SS?ESS/', '/^Drupal.visitor/']
14 |
15 | "https://www.{default}/":
16 | type: redirect
17 | to: "https://{default}/"
18 |
--------------------------------------------------------------------------------
/.platform/services.yaml:
--------------------------------------------------------------------------------
1 | # The services of the project.
2 | #
3 | # Each service listed will be deployed
4 | # to power your Platform.sh project.
5 |
6 | mysqldb:
7 | type: mysql:10.2
8 | disk: 2048
9 | #
10 | #rediscache:
11 | # type: redis:3.2
12 | #
13 | #solrsearch:
14 | # type: solr:6.6
15 | # disk: 1024
16 |
--------------------------------------------------------------------------------
/.travis.platform.sh:
--------------------------------------------------------------------------------
1 | language: php
2 | dist: trusty
3 | sudo: false
4 |
5 | php:
6 | - 5.6
7 | - 7.0
8 | - 7.1
9 | - 7.2
10 |
11 | env:
12 | global:
13 | - SIMPLETEST_DB=sqlite://tmp/site.sqlite
14 | - SIMPLETEST_BASE_URL="http://127.0.0.1:8080"
15 | matrix:
16 | - RELEASE=stable COMPOSER_CHANNEL=stable
17 | - RELEASE=dev COMPOSER_CHANNEL=stable
18 | - RELEASE=stable COMPOSER_CHANNEL=snapshot
19 |
20 | matrix:
21 | exclude:
22 | - php: 5.6
23 | env: RELEASE=dev COMPOSER_CHANNEL=stable
24 | - php: 5.6
25 | env: RELEASE=stable COMPOSER_CHANNEL=snapshot
26 |
27 | before_install:
28 | - if [[ $TRAVIS_PHP_VERSION = 5.6 ]]; then export COMPOSER_MEMORY_LIMIT=-1; fi;
29 | - echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
30 | - phpenv config-rm xdebug.ini
31 | - composer --verbose self-update --$COMPOSER_CHANNEL
32 | - composer --version
33 |
34 | install:
35 | - composer --verbose validate
36 | - composer --verbose install
37 |
38 | script:
39 | - if [[ $RELEASE = dev ]]; then composer --verbose remove --no-update drupal/console; fi;
40 | - if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core:8.7.x-dev webflo/drupal-core-require-dev:8.7.x-dev; fi;
41 | - if [[ $RELEASE = dev ]]; then composer --verbose update; fi;
42 | - cd $TRAVIS_BUILD_DIR/web
43 | - ./../vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
44 | - ./../vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
45 | - until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null
46 | # Skip core/tests/Drupal/Tests/ComposerIntegrationTest.php because web/ has no composer.json
47 | # Ignore PageCache group temporarily, @see https://www.drupal.org/node/2770673
48 | # Ignore Setup group temporarily, @see https://www.drupal.org/node/2962157
49 | - ./../vendor/bin/phpunit -c core --testsuite unit --exclude-group Composer,DependencyInjection,PageCache,Setup
50 | - ./../vendor/bin/drush
51 | - if [[ $RELEASE = stable ]]; then ./../vendor/bin/drupal; fi;
52 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | # This can be set to whatever you want since Lando is taking care of your deps
4 | php:
5 | - 7.3
6 |
7 | cache:
8 | directories:
9 | - $HOME/.composer/cache/files
10 | - $HOME/.composer/cache/repo
11 | - $TMPDIR/phpstan/cache
12 |
13 | services:
14 | - docker
15 |
16 | before_install:
17 |
18 | # Install Hyperdrive
19 | - sudo apt-get -y update
20 | - sudo apt-get -y install cgroup-bin curl
21 | - sudo bash -c "curl -Ls https://github.com/lando/hyperdrive/releases/download/v0.6.1/hyperdrive > /usr/local/bin/hyperdrive"
22 | - sudo chmod +x /usr/local/bin/hyperdrive
23 |
24 | script:
25 | # Add Repo key to prevent hyperdrive install errors.
26 | - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157
27 |
28 | # Setup hyperdrive
29 | - hyperdrive -y --name "James T. Kirk" --email kirk@enterprise.mil
30 |
31 | # Start Lando
32 | - lando start -v
33 |
34 | # Run non-db required tests eg linting/code standards/unit tests
35 | # Lint the codez
36 | - lando phplint
37 |
38 | # Check code standards
39 | - lando phpcs --config-set installed_paths /app/vendor/drupal/coder/coder_sniffer
40 | - lando phpcs -n --report=full --standard=Drupal --ignore=*.tpl.php --extensions=install,module,php,inc,theme web/modules/custom web/themes/custom web/profiles
41 |
42 | # Unit tests
43 | - lando phpunit -c web/core --testsuite unit --exclude-group Composer web/modules/custom
44 | - lando phpunit -c web/core --testsuite unit --exclude-group Composer web/themes/custom
45 |
46 | # Check for Drupal 9 Deprecations
47 | - lando phpstan analyse web/modules/custom web/themes/custom
48 |
49 | # Sleep for 10 seconds so certs can load
50 | - sleep 10
51 |
52 | # Do platform stuff
53 | # Verify we are logged in
54 | - lando platform auth:info
55 |
56 | # Generate and post an ssh key and then wait because Platform seems to
57 | # refresh keys every 90 seconds
58 | # NOTE: If you are getting consistent DB pull failures then you might want to increase the sleep
59 | - lando platform ssh-key:add -y
60 | - sleep 200
61 |
62 | # Dump and import the database
63 | - lando platform db:dump --gzip --file=dump.sql.gz --project=$PLATFORMSH_PROJECT_ID --environment=master --identity-file=/var/www/.ssh/id_rsa
64 | - lando db-import dump.sql.gz
65 | - rm -f dump.sql.gz
66 |
67 | # This could be potentially problematic if someone adds their own ssh key after we generate one above
68 | # and before we run the below
69 | - lando ssh -c "/var/www/.platformsh/bin/platform ssh-key:delete \$(/var/www/.platformsh/bin/platform ssh-keys --format=csv | tail -1 | cut -d ',' -f 1)"
70 |
71 | # Check to see if we succeeded
72 | - cd web
73 | - lando drush status && lando drush cr
74 | - cd ..
75 |
76 | # Run db required tests eg behat
77 | #- lando behat --config=/app/tests/behat-lando.yml
78 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Drupal project template for Platform.sh
2 |
3 | This project provides a starter kit for Drupal 8 projects hosted on [Platform.sh](http://platform.sh). It
4 | is very closely based on the [Drupal Composer project](https://github.com/drupal-composer/drupal-project).
5 |
6 | ## Starting a new project
7 |
8 | To start a new Drupal 8 project on Platform.sh, you have 2 options:
9 |
10 | 1. Create a new project through the Platform.sh user interface and select "start
11 | new project from a template". Then select Drupal 8 as the template. That will
12 | create a new project using this repository as a starting point.
13 |
14 | 2. Take an existing project, add the necessary Platform.sh files, and push it
15 | to a Platform.sh Git repository. This template includes examples of how to
16 | set up a Drupal 8 site. (See the "differences" section below.)
17 |
18 | ## Using as a reference
19 |
20 | You can also use this repository as a reference for your own Drupal projects, and borrow whatever code is needed. The most important parts are the [`.platform.app.yaml`](/.platform.app.yaml) file and the [`.platform`](/.platform) directory.
21 |
22 | Also see:
23 |
24 | * [`settings.php`](/web/sites/default/settings.php) - The customized `settings.php` file works for both Platform.sh and local development, setting only those values that are needed in both. You can add additional values as documented in `default.settings.php` as desired.
25 | * [`settings.platformsh.php`](/web/sites/default/settings.platformsh.php) - This file contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See [the documentation](https://docs.platform.sh/frameworks/drupal8.html) for more examples of common snippets to include here.
26 | * [`scripts/platformsh`](/scripts/platformsh) - This directory contains our update script to keep this repository in sync with the Drupal Composer project. It may be safely ignored or removed.
27 |
28 | ## Managing a Drupal site built with Composer
29 |
30 | Once the site is installed, there is no difference between a site hosted on Platform.sh
31 | and a site hosted anywhere else. It's just Composer. See the [Drupal documentation](https://www.drupal.org/node/2404989) for tips on how best to leverage Composer with Drupal 8.
32 |
33 | ## How does this starter kit differ from vanilla Drupal from Drupal.org?
34 |
35 | 1. The `vendor` directory (where non-Drupal code lives) and the `config` directory
36 | (used for syncing configuration from development to production) are outside
37 | the web root. This is a bit more secure as those files are now not web-accessible.
38 |
39 | 2. The `settings.php` and `settings.platformsh.php` files are provided by
40 | default. The `settings.platformsh.php` file automatically sets up the database connection on Platform.sh, and allows controlling Drupal configuration from environment variables.
41 |
42 | 3. We include recommended `.platform.app.yaml` and `.platform` files that should suffice
43 | for most use cases. You are free to tweak them as needed for your particular site.
44 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "drupal-composer/drupal-project",
3 | "description": "Project template for Drupal 8 projects with composer",
4 | "type": "project",
5 | "license": "GPL-2.0-or-later",
6 | "authors": [
7 | {
8 | "name": "",
9 | "role": ""
10 | }
11 | ],
12 | "repositories": [
13 | {
14 | "type": "composer",
15 | "url": "https://packages.drupal.org/8"
16 | }
17 | ],
18 | "require": {
19 | "php": ">=7.0",
20 | "composer/installers": "^1.2",
21 | "cweagans/composer-patches": "^1.6.5",
22 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
23 | "drupal/console": "^1.0.2",
24 | "drupal/core-recommended": "~8.9",
25 | "drupal/core-composer-scaffold": "~8.9",
26 | "drupal/core-vendor-hardening": "~8.9",
27 | "drush/drush": "^9.0.0",
28 | "vlucas/phpdotenv": "^4.0",
29 | "webflo/drupal-finder": "^1.0.0",
30 | "webmozart/path-util": "^2.3",
31 | "zaporylie/composer-drupal-optimizations": "^1.0"
32 | },
33 | "require-dev": {
34 | "behat/behat": "3.*",
35 | "behat/mink": "1.8.0 | 1.7.1.1 | 1.7.x-dev",
36 | "behat/mink-extension": "^2.2",
37 | "behat/mink-goutte-driver": "~1.2",
38 | "drupal/coder": "^8.3",
39 | "drupal/drupal-extension": "^4.0",
40 | "drush-ops/behat-drush-endpoint": "^1.2.0",
41 | "jcalderonzumba/gastonjs": "~1.2.0",
42 | "jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
43 | "mglaman/phpstan-drupal": "^0.11.2",
44 | "mikey179/vfsstream": "~1.2",
45 | "overtrue/phplint": "^1.2.0",
46 | "phpstan/phpstan-deprecation-rules": "^0.11.0",
47 | "phpunit/phpunit": "^7.5",
48 | "squizlabs/php_codesniffer": "3.*",
49 | "symfony/css-selector": "^3.4.0",
50 | "drupal/core-dev": "~8.9.0"
51 | },
52 | "conflict": {
53 | "drupal/drupal": "*"
54 | },
55 | "minimum-stability": "dev",
56 | "prefer-stable": true,
57 | "config": {
58 | "sort-packages": true
59 | },
60 | "autoload": {
61 | "classmap": [
62 | "scripts/composer/ScriptHandler.php"
63 | ],
64 | "files": ["load.environment.php"]
65 | },
66 | "scripts": {
67 | "fix": "phpcbf --standard=Drupal --ignore=*/node_modules/*,/vendor/*,*.md,*.tpl.php,*.css,*.scss --extensions=install,module,php,inc web/modules/custom web/themes/custom web/profiles/custom .mannequin.php",
68 | "lint": [
69 | "phplint",
70 | "phpcs -n --report=full --standard=Drupal --ignore=*/node_modules/*,/vendor/*,*.md,*.tpl.php,*.css,*.scss --extensions=install,module,php,inc web/modules/custom web/themes/custom web/profiles/custom .mannequin.php"
71 | ],
72 | "pre-install-cmd": [
73 | "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
74 | ],
75 | "pre-update-cmd": [
76 | "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
77 | ],
78 | "post-install-cmd": [
79 | "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
80 | ],
81 | "post-update-cmd": [
82 | "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
83 | ]
84 | },
85 | "extra": {
86 | "composer-exit-on-patch-failure": true,
87 | "patchLevel": {
88 | "drupal/core": "-p2"
89 | },
90 | "installer-paths": {
91 | "web/core": ["type:drupal-core"],
92 | "web/libraries/{$name}": ["type:drupal-library"],
93 | "web/modules/contrib/{$name}": ["type:drupal-module"],
94 | "web/profiles/contrib/{$name}": ["type:drupal-profile"],
95 | "web/themes/contrib/{$name}": ["type:drupal-theme"],
96 | "drush/Commands/{$name}": ["type:drupal-drush"]
97 | },
98 | "drupal-scaffold": {
99 | "locations": {
100 | "web-root": "web/"
101 | }
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/config/sync/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thinktandem/template-drupal8/e285317c85137f2c047cc14f4331771f990b5219/config/sync/.gitkeep
--------------------------------------------------------------------------------
/config/sync/.htaccess:
--------------------------------------------------------------------------------
1 | # Deny all requests from Apache 2.4+.
2 |
3 | Require all denied
4 |
5 |
6 | # Deny all requests from Apache 2.0-2.2.
7 |
8 | Deny from all
9 |
10 |
11 | # Turn off all options we don't need.
12 | Options -Indexes -ExecCGI -Includes -MultiViews
13 |
14 | # Set the catch-all handler to prevent scripts from being executed.
15 | SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
16 |
17 | # Override the handler again if we're run later in the evaluation list.
18 | SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
19 |
20 |
21 | # If we know how to do it safely, disable the PHP engine entirely.
22 |
23 | php_flag engine off
24 |
--------------------------------------------------------------------------------
/drush/Commands/PolicyCommands.php:
--------------------------------------------------------------------------------
1 | input()->getArgument('target') == '@prod') {
22 | throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__]));
23 | }
24 | }
25 |
26 | /**
27 | * Limit rsync operations to production site.
28 | *
29 | * @hook validate core:rsync
30 | *
31 | * @throws \Exception
32 | */
33 | public function rsyncValidate(CommandData $commandData) {
34 | if (preg_match("/^@prod/", $commandData->input()->getArgument('target'))) {
35 | throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/drush/Commands/behat-drush-endpoint/.gitignore:
--------------------------------------------------------------------------------
1 | vendor
2 |
--------------------------------------------------------------------------------
/drush/Commands/behat-drush-endpoint/README.md:
--------------------------------------------------------------------------------
1 | The Behat Drush Endpoint is the remote component needed to work with the [Behat Drupal Driver](https://github.com/jhedstrom/DrupalDriver).
2 |
3 | The Behat Drupal Driver contains three drivers: *Blackbox*, *Direct Drupal API*, and *Drush*. The Behat Drush Endpoint is only necessary when using the *Drush* driver.
4 |
5 | ## Installation Instructions
6 |
7 | If you are managing your Drupal site with Composer, then add the Behat Drush Endpoint to your project as follows:
8 | ```bash
9 | composer require drush-ops/behat-drush-endpoint:^1
10 | ```
11 | If you are not using composer.json on the remote Drupal site, then copy the entire contents of this project to either **__ROOT__**/drush or **__ROOT__**/sites/all/drush, then `cd behat-drush-endpoint` and run `composer install`.
12 |
--------------------------------------------------------------------------------
/drush/Commands/behat-drush-endpoint/behat-drush-common.inc:
--------------------------------------------------------------------------------
1 | $type) {
15 | if (isset($entity->$field_name)) {
16 | $entity->$field_name = _drush_behat_get_field_handler($entity, $entity_type, $field_name)
17 | ->expand($entity->$field_name);
18 | }
19 | }
20 | }
21 |
22 | /**
23 | * Get the field handler for the specified field of the specified entity.
24 | *
25 | * Note that this function instantiates a field handler class that is
26 | * provided by the Behat Drush Driver. In order for this to work, an
27 | * appropriate autoload.inc file must be included. This will be done
28 | * automatically if the Drupal site is managed by Composer, and requires
29 | * the Behat Drush Driver in its composer.json file.
30 | *
31 | * @see Drupal\Driver\Cores\AbstractCore\getFieldHandler
32 | */
33 | function _drush_behat_get_field_handler_common($entity, $entity_type, $field_name, $core_namespace) {
34 | $field_types = _drush_behat_get_entity_field_types($entity_type);
35 | $camelized_type = _drush_behat_camelize($field_types[$field_name]);
36 | $default_class = sprintf('\Drupal\Driver\Fields\%s\DefaultHandler', $core_namespace);
37 | $class_name = sprintf('\Drupal\Driver\Fields\%s\%sHandler', $core_namespace, $camelized_type);
38 | if (class_exists($class_name)) {
39 | return new $class_name($entity, $entity_type, $field_name);
40 | }
41 | return new $default_class($entity, $entity_type, $field_name);
42 | }
43 |
44 | /**
45 | * Converts a seried of words into camel case.
46 | *
47 | * @see Symfony\Component\DependencyInjection\Container\camelize
48 | */
49 | function _drush_behat_camelize($id) {
50 | return strtr(ucwords(strtr($id, array('_' => ' ', '.' => '_ ', '\\' => '_ '))), array(' ' => ''));
51 | }
52 |
--------------------------------------------------------------------------------
/drush/Commands/behat-drush-endpoint/behat.d7.drush.inc:
--------------------------------------------------------------------------------
1 | "Behat Drush endpoint. Serves as an entrypoint for Behat to make remote calls into the Drupal site being tested.",
25 | // Describe the arguments for this command. Delete
26 | // this seciton if command takes no arguments.
27 | 'arguments' => array(
28 | 'operation' => 'Behat operation, e.g. create-node.',
29 | 'data' => 'Operation data in json format.',
30 | ),
31 | // Command options.
32 | 'options' => array(),
33 |
34 | // Give one or more example commandline usages for this command.
35 | 'examples' => array(
36 | "drush behat create-node '{\"title\":\"Example page\",\"type\":\"page\"}'" => 'Create a page with the title "Example page".',
37 | ),
38 | // Default output is json, --pipe produces yml.
39 | 'outputformat' => array(
40 | 'default' => 'json',
41 | 'pipe-format' => 'yaml',
42 | ),
43 | );
44 |
45 | return $items;
46 | }
47 |
48 | /**
49 | * Implements hook_drush_help().
50 | */
51 | function behat_drush_help($section) {
52 | switch ($section) {
53 | case 'drush:behat':
54 | return dt("The Behat Drush endpoint command file must be installed in the target Drupal site in order to use more advanced features such as creating nodes and taxonomy terms.");
55 | }
56 | }
57 |
58 | /**
59 | * Implements drush_hook_COMMAND().
60 | */
61 | function drush_behat($operation, $json_data) {
62 | $data = json_decode($json_data);
63 |
64 | // Dispatch if the operation exists.
65 | $fn = 'drush_behat_op_' . strtr($operation, '-', '_');
66 | if (function_exists($fn)) {
67 | return $fn($data);
68 | }
69 | else {
70 | return drush_set_error('DRUSH_BEHAT_NO_OPERATION', dt("Operation '!op' unknown", array('!op' => $operation)));
71 | }
72 | }
73 |
74 | /**
75 | * Create a node.
76 | */
77 | function drush_behat_op_create_node($node) {
78 | // Set original if not set.
79 | if (!isset($node->original)) {
80 | $node->original = clone $node;
81 | }
82 |
83 | // Assign authorship if none exists and `author` is passed.
84 | if (!isset($node->uid) && !empty($node->author) && ($user = user_load_by_name($node->author))) {
85 | $node->uid = $user->uid;
86 | }
87 |
88 | // Convert properties to expected structure.
89 | _drush_behat_expand_entity_properties($node);
90 |
91 | // Attempt to decipher any fields that may be specified.
92 | _drush_behat_expand_entity_fields('node', $node);
93 |
94 | // Set defaults that haven't already been set.
95 | $defaults = clone $node;
96 | node_object_prepare($defaults);
97 | $node = (object) array_merge((array) $defaults, (array) $node);
98 |
99 | node_save($node);
100 | return (array) $node;
101 | }
102 |
103 | /**
104 | * Delete a node.
105 | */
106 | function drush_behat_op_delete_node($node) {
107 | node_delete($node->nid);
108 | }
109 |
110 | /**
111 | * Create a taxonomy term.
112 | */
113 | function drush_behat_op_create_term($term) {
114 | // Map vocabulary names to vid, these take precedence over machine names.
115 | if (!isset($term->vid)) {
116 | $vocabularies = \taxonomy_get_vocabularies();
117 | foreach ($vocabularies as $vid => $vocabulary) {
118 | if ($vocabulary->name == $term->vocabulary_machine_name) {
119 | $term->vid = $vocabulary->vid;
120 | }
121 | }
122 | }
123 |
124 | if (!isset($term->vid)) {
125 | // Try to load vocabulary by machine name.
126 | $vocabularies = \taxonomy_vocabulary_load_multiple(FALSE, array(
127 | 'machine_name' => $term->vocabulary_machine_name,
128 | ));
129 | if (!empty($vocabularies)) {
130 | $vids = array_keys($vocabularies);
131 | $term->vid = reset($vids);
132 | }
133 | }
134 |
135 | // If `parent` is set, look up a term in this vocab with that name.
136 | if (isset($term->parent)) {
137 | $parent = \taxonomy_get_term_by_name($term->parent, $term->vocabulary_machine_name);
138 | if (!empty($parent)) {
139 | $parent = reset($parent);
140 | $term->parent = $parent->tid;
141 | }
142 | }
143 |
144 | if (empty($term->vid)) {
145 | throw new \Exception(sprintf('No "%s" vocabulary found.'));
146 | }
147 |
148 | // Attempt to decipher any fields that may be specified.
149 | _drush_behat_expand_entity_fields('taxonomy_term', $term);
150 |
151 | \taxonomy_term_save($term);
152 |
153 | return $term;
154 | }
155 |
156 | /**
157 | * Delete a taxonomy term.
158 | */
159 | function drush_behat_op_delete_term(\stdClass $term) {
160 | $status = 0;
161 | if (isset($term->tid)) {
162 | $status = \taxonomy_term_delete($term->tid);
163 | }
164 | return $status;
165 | }
166 |
167 | /**
168 | * Check if this is a field.
169 | */
170 | function drush_behat_op_is_field($is_field_info) {
171 | list($entity_type, $field_name) = $is_field_info;
172 | $map = field_info_field_map();
173 | return !empty($map[$field_name]) && array_key_exists($entity_type, $map[$field_name]['bundles']);
174 | }
175 |
176 | /**
177 | * Expands properties on the given entity object to the expected structure.
178 | *
179 | * @param \stdClass $entity
180 | * The entity object.
181 | *
182 | * @see Drupal\Driver\Cores\Drupal7\expandEntityProperties
183 | */
184 | function _drush_behat_expand_entity_properties(\stdClass $entity) {
185 | // The created field may come in as a readable date, rather than a
186 | // timestamp.
187 | if (isset($entity->created) && !is_numeric($entity->created)) {
188 | $entity->created = strtotime($entity->created);
189 | }
190 |
191 | // Map human-readable node types to machine node types.
192 | $types = \node_type_get_types();
193 | foreach ($types as $type) {
194 | if ($entity->type == $type->name) {
195 | $entity->type = $type->type;
196 | continue;
197 | }
198 | }
199 | }
200 |
201 | /**
202 | * Get all of the field attached to the specified entity type.
203 | *
204 | * @see Drupal\Driver\Cores\Drupal7\getEntityFieldTypes in Behat
205 | */
206 | function _drush_behat_get_entity_field_types($entity_type) {
207 | $return = array();
208 | $fields = field_info_field_map();
209 | foreach ($fields as $field_name => $field) {
210 | if (array_key_exists($entity_type, $field['bundles'])) {
211 | $return[$field_name] = $field['type'];
212 | }
213 | }
214 | return $return;
215 | }
216 |
217 | function _drush_behat_get_field_handler($entity, $entity_type, $field_name) {
218 | $core_namespace = "Drupal7";
219 | return _drush_behat_get_field_handler_common($entity, $entity_type, $field_name, $core_namespace);
220 | }
221 |
--------------------------------------------------------------------------------
/drush/Commands/behat-drush-endpoint/behat.d8.drush.inc:
--------------------------------------------------------------------------------
1 | "Behat Drush endpoint. Serves as an entrypoint for Behat to make remote calls into the Drupal site being tested.",
24 | // Describe the arguments for this command. Delete
25 | // this seciton if command takes no arguments.
26 | 'arguments' => array(
27 | 'operation' => 'Behat operation, e.g. create-node.',
28 | 'data' => 'Operation data in json format.',
29 | ),
30 | // Command options.
31 | 'options' => array(),
32 |
33 | // Give one or more example commandline usages for this command.
34 | 'examples' => array(
35 | "drush behat create-node '{\"title\":\"Example page\",\"type\":\"page\"}'" => 'Create a page with the title "Example page".',
36 | ),
37 | // Default output is json, --pipe produces yml.
38 | 'outputformat' => array(
39 | 'default' => 'json',
40 | 'pipe-format' => 'yaml',
41 | ),
42 | );
43 |
44 | return $items;
45 | }
46 |
47 | /**
48 | * Implements hook_drush_help().
49 | */
50 | function behat_drush_help($section) {
51 | switch ($section) {
52 | case 'drush:behat':
53 | return dt("The Behat Drush endpoint command file must be installed in the target Drupal site in order to use more advanced features such as creating nodes and taxonomy terms.");
54 | }
55 | }
56 |
57 | /**
58 | * Implements drush_hook_COMMAND().
59 | */
60 | function drush_behat($operation, $json_data) {
61 | $data = json_decode($json_data);
62 |
63 | // Dispatch if the operation exists.
64 | $fn = 'drush_behat_op_' . strtr($operation, '-', '_');
65 | if (function_exists($fn)) {
66 | return $fn($data);
67 | }
68 | else {
69 | return drush_set_error('DRUSH_BEHAT_NO_OPERATION', dt("Operation '!op' unknown", array('!op' => $operation)));
70 | }
71 | }
72 |
73 | /**
74 | * Create a node.
75 | */
76 | function drush_behat_op_create_node($node) {
77 | // Default status to 1 if not set.
78 | if (!isset($node->status)) {
79 | $node->status = 1;
80 | }
81 | // If 'author' is set, remap it to 'uid'.
82 | if (isset($node->author)) {
83 | $user = user_load_by_name($node->author);
84 | if ($user) {
85 | $node->uid = $user->id();
86 | }
87 | }
88 |
89 | // Attempt to decipher any fields that may be specified.
90 | _drush_behat_expand_entity_fields('node', $node);
91 |
92 | $entity = entity_create('node', (array) $node);
93 | $entity->save();
94 |
95 | $node->nid = $entity->id();
96 |
97 | return (array) $node;
98 | }
99 |
100 | /**
101 | * Delete a node.
102 | */
103 | function drush_behat_op_delete_node($node) {
104 | $node = $node instanceof NodeInterface ? $node : Node::load($node->nid);
105 | if ($node instanceof NodeInterface) {
106 | $node->delete();
107 | }
108 | }
109 |
110 | /**
111 | * Create a taxonomy term.
112 | */
113 | function drush_behat_op_create_term($term) {
114 | $term->vid = $term->vocabulary_machine_name;
115 |
116 | // Attempt to decipher any fields that may be specified.
117 | _drush_behat_expand_entity_fields('taxonomy_term', $term);
118 |
119 | $entity = entity_create('taxonomy_term', (array)$term);
120 | $entity->save();
121 |
122 | $term->tid = $entity->id();
123 | return (array) $term;
124 | }
125 |
126 | /**
127 | * Delete a taxonomy term.
128 | */
129 | function drush_behat_op_delete_term(\stdClass $term) {
130 | $term = $term instanceof TermInterface ? $term : Term::load($term->tid);
131 | if ($term instanceof TermInterface) {
132 | $term->delete();
133 | }
134 | }
135 |
136 | /**
137 | * Check if this is a field.
138 | */
139 | function drush_behat_op_is_field($is_field_info) {
140 | list($entity_type, $field_name) = $is_field_info;
141 | return _drush_behat_is_field($entity_type, $field_name);
142 | }
143 |
144 | /**
145 | * Get all of the field attached to the specified entity type.
146 | *
147 | * @see Drupal\Driver\Cores\Drupal8\getEntityFieldTypes in Behat
148 | */
149 | function _drush_behat_get_entity_field_types($entity_type) {
150 | $return = array();
151 | $fields = \Drupal::entityManager()->getFieldStorageDefinitions($entity_type);
152 | foreach ($fields as $field_name => $field) {
153 | if (_drush_behat_is_field($entity_type, $field_name)) {
154 | $return[$field_name] = $field->getType();
155 | }
156 | }
157 | return $return;
158 | }
159 |
160 | function _drush_behat_is_field($entity_type, $field_name) {
161 | $fields = \Drupal::entityManager()->getFieldStorageDefinitions($entity_type);
162 | return (isset($fields[$field_name]) && $fields[$field_name] instanceof FieldStorageConfig);
163 | }
164 |
165 | function _drush_behat_get_field_handler($entity, $entity_type, $field_name) {
166 | $core_namespace = "Drupal8";
167 | return _drush_behat_get_field_handler_common($entity, $entity_type, $field_name, $core_namespace);
168 | }
169 |
--------------------------------------------------------------------------------
/drush/Commands/behat-drush-endpoint/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "drush-ops/behat-drush-endpoint",
3 | "description": "Drush commandfile for use with drupal/drupal-driver.",
4 | "type": "drupal-drush",
5 | "keywords": ["drush","behat","testing"],
6 | "homepage": "https://github.com/drush-ops/behat-drush-endpoint",
7 | "license": "GPL-2.0-or-later",
8 | "require": {
9 | "php": ">=5.3.0",
10 | "drupal/drupal-driver": "^1"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/drush/Commands/behat-drush-endpoint/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 | "This file is @generated automatically"
6 | ],
7 | "content-hash": "ec751c3173d6925c4ec31faf490695ae",
8 | "packages": [
9 | {
10 | "name": "drupal/core-render",
11 | "version": "8.6.1",
12 | "source": {
13 | "type": "git",
14 | "url": "https://github.com/drupal/core-render.git",
15 | "reference": "088f75280b4357930dc5136c5323cc1641772514"
16 | },
17 | "dist": {
18 | "type": "zip",
19 | "url": "https://api.github.com/repos/drupal/core-render/zipball/088f75280b4357930dc5136c5323cc1641772514",
20 | "reference": "088f75280b4357930dc5136c5323cc1641772514",
21 | "shasum": ""
22 | },
23 | "require": {
24 | "drupal/core-utility": "^8.2",
25 | "php": ">=5.5.9"
26 | },
27 | "type": "library",
28 | "autoload": {
29 | "psr-4": {
30 | "Drupal\\Component\\Render\\": ""
31 | }
32 | },
33 | "notification-url": "https://packagist.org/downloads/",
34 | "license": [
35 | "GPL-2.0-or-later"
36 | ],
37 | "description": "Renders placeholder variables for HTML and plain-text display.",
38 | "homepage": "https://www.drupal.org/project/drupal",
39 | "keywords": [
40 | "drupal"
41 | ],
42 | "time": "2018-05-08T20:55:21+00:00"
43 | },
44 | {
45 | "name": "drupal/core-utility",
46 | "version": "8.6.1",
47 | "source": {
48 | "type": "git",
49 | "url": "https://github.com/drupal/core-utility.git",
50 | "reference": "490bbe8248aa88468674aa8a9ef216a1a388ea3a"
51 | },
52 | "dist": {
53 | "type": "zip",
54 | "url": "https://api.github.com/repos/drupal/core-utility/zipball/490bbe8248aa88468674aa8a9ef216a1a388ea3a",
55 | "reference": "490bbe8248aa88468674aa8a9ef216a1a388ea3a",
56 | "shasum": ""
57 | },
58 | "require": {
59 | "drupal/core-render": "^8.2",
60 | "paragonie/random_compat": "^1.0|^2.0",
61 | "php": ">=5.5.9",
62 | "symfony/polyfill-iconv": "~1.0",
63 | "symfony/polyfill-mbstring": "~1.0"
64 | },
65 | "type": "library",
66 | "autoload": {
67 | "psr-4": {
68 | "Drupal\\Component\\Utility\\": ""
69 | }
70 | },
71 | "notification-url": "https://packagist.org/downloads/",
72 | "license": [
73 | "GPL-2.0-or-later"
74 | ],
75 | "description": "Mostly static utility classes for string, xss, array, image, and other commonly needed manipulations.",
76 | "homepage": "https://www.drupal.org/project/drupal",
77 | "keywords": [
78 | "drupal"
79 | ],
80 | "time": "2018-05-11T09:46:46+00:00"
81 | },
82 | {
83 | "name": "drupal/drupal-driver",
84 | "version": "v1.4.0",
85 | "source": {
86 | "type": "git",
87 | "url": "https://github.com/jhedstrom/DrupalDriver.git",
88 | "reference": "919c6a39ef6a17bdcaf81dcff97b117ecfb6061c"
89 | },
90 | "dist": {
91 | "type": "zip",
92 | "url": "https://api.github.com/repos/jhedstrom/DrupalDriver/zipball/919c6a39ef6a17bdcaf81dcff97b117ecfb6061c",
93 | "reference": "919c6a39ef6a17bdcaf81dcff97b117ecfb6061c",
94 | "shasum": ""
95 | },
96 | "require": {
97 | "drupal/core-utility": "^8.4",
98 | "php": ">=5.5.9",
99 | "symfony/dependency-injection": "~2.6|~3.0",
100 | "symfony/process": "~2.5|~3.0"
101 | },
102 | "require-dev": {
103 | "drupal/coder": "~8.2.0",
104 | "drush-ops/behat-drush-endpoint": "*",
105 | "jakub-onderka/php-parallel-lint": "^0.9.2",
106 | "mockery/mockery": "0.9.4",
107 | "phpspec/phpspec": "~2.0",
108 | "phpunit/phpunit": "~4.0"
109 | },
110 | "type": "library",
111 | "extra": {
112 | "branch-alias": {
113 | "dev-master": "1.2.x-dev"
114 | }
115 | },
116 | "autoload": {
117 | "psr-0": {
118 | "Drupal\\Driver": "src/",
119 | "Drupal\\Tests\\Driver": "tests/"
120 | }
121 | },
122 | "notification-url": "https://packagist.org/downloads/",
123 | "license": [
124 | "GPL-2.0-or-later"
125 | ],
126 | "authors": [
127 | {
128 | "name": "Jonathan Hedstrom",
129 | "email": "jhedstrom@gmail.com"
130 | }
131 | ],
132 | "description": "A collection of reusable Drupal drivers",
133 | "homepage": "http://github.com/jhedstrom/DrupalDriver",
134 | "keywords": [
135 | "drupal",
136 | "test",
137 | "web"
138 | ],
139 | "time": "2018-02-09T18:02:28+00:00"
140 | },
141 | {
142 | "name": "paragonie/random_compat",
143 | "version": "v2.0.17",
144 | "source": {
145 | "type": "git",
146 | "url": "https://github.com/paragonie/random_compat.git",
147 | "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d"
148 | },
149 | "dist": {
150 | "type": "zip",
151 | "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d",
152 | "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d",
153 | "shasum": ""
154 | },
155 | "require": {
156 | "php": ">=5.2.0"
157 | },
158 | "require-dev": {
159 | "phpunit/phpunit": "4.*|5.*"
160 | },
161 | "suggest": {
162 | "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
163 | },
164 | "type": "library",
165 | "autoload": {
166 | "files": [
167 | "lib/random.php"
168 | ]
169 | },
170 | "notification-url": "https://packagist.org/downloads/",
171 | "license": [
172 | "MIT"
173 | ],
174 | "authors": [
175 | {
176 | "name": "Paragon Initiative Enterprises",
177 | "email": "security@paragonie.com",
178 | "homepage": "https://paragonie.com"
179 | }
180 | ],
181 | "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
182 | "keywords": [
183 | "csprng",
184 | "polyfill",
185 | "pseudorandom",
186 | "random"
187 | ],
188 | "time": "2018-07-04T16:31:37+00:00"
189 | },
190 | {
191 | "name": "psr/container",
192 | "version": "1.0.0",
193 | "source": {
194 | "type": "git",
195 | "url": "https://github.com/php-fig/container.git",
196 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
197 | },
198 | "dist": {
199 | "type": "zip",
200 | "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
201 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
202 | "shasum": ""
203 | },
204 | "require": {
205 | "php": ">=5.3.0"
206 | },
207 | "type": "library",
208 | "extra": {
209 | "branch-alias": {
210 | "dev-master": "1.0.x-dev"
211 | }
212 | },
213 | "autoload": {
214 | "psr-4": {
215 | "Psr\\Container\\": "src/"
216 | }
217 | },
218 | "notification-url": "https://packagist.org/downloads/",
219 | "license": [
220 | "MIT"
221 | ],
222 | "authors": [
223 | {
224 | "name": "PHP-FIG",
225 | "homepage": "http://www.php-fig.org/"
226 | }
227 | ],
228 | "description": "Common Container Interface (PHP FIG PSR-11)",
229 | "homepage": "https://github.com/php-fig/container",
230 | "keywords": [
231 | "PSR-11",
232 | "container",
233 | "container-interface",
234 | "container-interop",
235 | "psr"
236 | ],
237 | "time": "2017-02-14T16:28:37+00:00"
238 | },
239 | {
240 | "name": "symfony/dependency-injection",
241 | "version": "v3.4.15",
242 | "source": {
243 | "type": "git",
244 | "url": "https://github.com/symfony/dependency-injection.git",
245 | "reference": "09d7df7bf06c1393b6afc85875993cbdbdf897a0"
246 | },
247 | "dist": {
248 | "type": "zip",
249 | "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/09d7df7bf06c1393b6afc85875993cbdbdf897a0",
250 | "reference": "09d7df7bf06c1393b6afc85875993cbdbdf897a0",
251 | "shasum": ""
252 | },
253 | "require": {
254 | "php": "^5.5.9|>=7.0.8",
255 | "psr/container": "^1.0"
256 | },
257 | "conflict": {
258 | "symfony/config": "<3.3.7",
259 | "symfony/finder": "<3.3",
260 | "symfony/proxy-manager-bridge": "<3.4",
261 | "symfony/yaml": "<3.4"
262 | },
263 | "provide": {
264 | "psr/container-implementation": "1.0"
265 | },
266 | "require-dev": {
267 | "symfony/config": "~3.3|~4.0",
268 | "symfony/expression-language": "~2.8|~3.0|~4.0",
269 | "symfony/yaml": "~3.4|~4.0"
270 | },
271 | "suggest": {
272 | "symfony/config": "",
273 | "symfony/expression-language": "For using expressions in service container configuration",
274 | "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
275 | "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
276 | "symfony/yaml": ""
277 | },
278 | "type": "library",
279 | "extra": {
280 | "branch-alias": {
281 | "dev-master": "3.4-dev"
282 | }
283 | },
284 | "autoload": {
285 | "psr-4": {
286 | "Symfony\\Component\\DependencyInjection\\": ""
287 | },
288 | "exclude-from-classmap": [
289 | "/Tests/"
290 | ]
291 | },
292 | "notification-url": "https://packagist.org/downloads/",
293 | "license": [
294 | "MIT"
295 | ],
296 | "authors": [
297 | {
298 | "name": "Fabien Potencier",
299 | "email": "fabien@symfony.com"
300 | },
301 | {
302 | "name": "Symfony Community",
303 | "homepage": "https://symfony.com/contributors"
304 | }
305 | ],
306 | "description": "Symfony DependencyInjection Component",
307 | "homepage": "https://symfony.com",
308 | "time": "2018-08-08T11:42:34+00:00"
309 | },
310 | {
311 | "name": "symfony/polyfill-iconv",
312 | "version": "v1.9.0",
313 | "source": {
314 | "type": "git",
315 | "url": "https://github.com/symfony/polyfill-iconv.git",
316 | "reference": "bcc0cd69185b8a5d8b4a5400c489ed3333bf9bb2"
317 | },
318 | "dist": {
319 | "type": "zip",
320 | "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/bcc0cd69185b8a5d8b4a5400c489ed3333bf9bb2",
321 | "reference": "bcc0cd69185b8a5d8b4a5400c489ed3333bf9bb2",
322 | "shasum": ""
323 | },
324 | "require": {
325 | "php": ">=5.3.3"
326 | },
327 | "suggest": {
328 | "ext-iconv": "For best performance"
329 | },
330 | "type": "library",
331 | "extra": {
332 | "branch-alias": {
333 | "dev-master": "1.9-dev"
334 | }
335 | },
336 | "autoload": {
337 | "psr-4": {
338 | "Symfony\\Polyfill\\Iconv\\": ""
339 | },
340 | "files": [
341 | "bootstrap.php"
342 | ]
343 | },
344 | "notification-url": "https://packagist.org/downloads/",
345 | "license": [
346 | "MIT"
347 | ],
348 | "authors": [
349 | {
350 | "name": "Nicolas Grekas",
351 | "email": "p@tchwork.com"
352 | },
353 | {
354 | "name": "Symfony Community",
355 | "homepage": "https://symfony.com/contributors"
356 | }
357 | ],
358 | "description": "Symfony polyfill for the Iconv extension",
359 | "homepage": "https://symfony.com",
360 | "keywords": [
361 | "compatibility",
362 | "iconv",
363 | "polyfill",
364 | "portable",
365 | "shim"
366 | ],
367 | "time": "2018-08-06T14:22:27+00:00"
368 | },
369 | {
370 | "name": "symfony/polyfill-mbstring",
371 | "version": "v1.9.0",
372 | "source": {
373 | "type": "git",
374 | "url": "https://github.com/symfony/polyfill-mbstring.git",
375 | "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8"
376 | },
377 | "dist": {
378 | "type": "zip",
379 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8",
380 | "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8",
381 | "shasum": ""
382 | },
383 | "require": {
384 | "php": ">=5.3.3"
385 | },
386 | "suggest": {
387 | "ext-mbstring": "For best performance"
388 | },
389 | "type": "library",
390 | "extra": {
391 | "branch-alias": {
392 | "dev-master": "1.9-dev"
393 | }
394 | },
395 | "autoload": {
396 | "psr-4": {
397 | "Symfony\\Polyfill\\Mbstring\\": ""
398 | },
399 | "files": [
400 | "bootstrap.php"
401 | ]
402 | },
403 | "notification-url": "https://packagist.org/downloads/",
404 | "license": [
405 | "MIT"
406 | ],
407 | "authors": [
408 | {
409 | "name": "Nicolas Grekas",
410 | "email": "p@tchwork.com"
411 | },
412 | {
413 | "name": "Symfony Community",
414 | "homepage": "https://symfony.com/contributors"
415 | }
416 | ],
417 | "description": "Symfony polyfill for the Mbstring extension",
418 | "homepage": "https://symfony.com",
419 | "keywords": [
420 | "compatibility",
421 | "mbstring",
422 | "polyfill",
423 | "portable",
424 | "shim"
425 | ],
426 | "time": "2018-08-06T14:22:27+00:00"
427 | },
428 | {
429 | "name": "symfony/process",
430 | "version": "v3.4.15",
431 | "source": {
432 | "type": "git",
433 | "url": "https://github.com/symfony/process.git",
434 | "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7"
435 | },
436 | "dist": {
437 | "type": "zip",
438 | "url": "https://api.github.com/repos/symfony/process/zipball/4d6b125d5293cbceedc2aa10f2c71617e76262e7",
439 | "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7",
440 | "shasum": ""
441 | },
442 | "require": {
443 | "php": "^5.5.9|>=7.0.8"
444 | },
445 | "type": "library",
446 | "extra": {
447 | "branch-alias": {
448 | "dev-master": "3.4-dev"
449 | }
450 | },
451 | "autoload": {
452 | "psr-4": {
453 | "Symfony\\Component\\Process\\": ""
454 | },
455 | "exclude-from-classmap": [
456 | "/Tests/"
457 | ]
458 | },
459 | "notification-url": "https://packagist.org/downloads/",
460 | "license": [
461 | "MIT"
462 | ],
463 | "authors": [
464 | {
465 | "name": "Fabien Potencier",
466 | "email": "fabien@symfony.com"
467 | },
468 | {
469 | "name": "Symfony Community",
470 | "homepage": "https://symfony.com/contributors"
471 | }
472 | ],
473 | "description": "Symfony Process Component",
474 | "homepage": "https://symfony.com",
475 | "time": "2018-08-03T10:42:44+00:00"
476 | }
477 | ],
478 | "packages-dev": [],
479 | "aliases": [],
480 | "minimum-stability": "stable",
481 | "stability-flags": [],
482 | "prefer-stable": false,
483 | "prefer-lowest": false,
484 | "platform": {
485 | "php": ">=5.3.0"
486 | },
487 | "platform-dev": []
488 | }
489 |
--------------------------------------------------------------------------------
/drush/README.md:
--------------------------------------------------------------------------------
1 | This directory contains commands, configuration and site aliases for Drush. See https://packagist.org/search/?type=drupal-drush for a directory of Drush commands installable via Composer.
2 |
--------------------------------------------------------------------------------
/drush/drush.yml:
--------------------------------------------------------------------------------
1 | #
2 | # A Drush configuration file
3 | #
4 | # Docs at https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml
5 | #
6 | # Edit or remove this file as needed.
7 |
--------------------------------------------------------------------------------
/drush/platformsh_drush.inc:
--------------------------------------------------------------------------------
1 | $route) {
23 | if ($route['type'] === 'upstream' && $route['upstream'] === $appName) {
24 | $appUrls[$route['original_url']] = $url;
25 | }
26 | }
27 |
28 | // Select the first preferred route, if it exists in the app URLs.
29 | $preferred_routes = [
30 | 'https://{default}/',
31 | 'https://{default}',
32 | 'https://www.{default}/',
33 | 'https://www.{default}',
34 | 'https://{all}/',
35 | 'https://{all}',
36 | 'https://www.{all}/',
37 | 'https://www.{all}',
38 | ];
39 | foreach ($preferred_routes as $preferred_route) {
40 | if (isset($appUrls[$preferred_route])) {
41 | return $appUrls[$preferred_route];
42 | }
43 | }
44 |
45 | // Otherwise, return the first URL that matched the app.
46 | return reset($appUrls) ?: NULL;
47 | }
48 |
--------------------------------------------------------------------------------
/drush/platformsh_generate_drush_yml.php:
--------------------------------------------------------------------------------
1 | safeLoad();
16 |
--------------------------------------------------------------------------------
/phpstan.neon:
--------------------------------------------------------------------------------
1 | parameters:
2 | customRulesetUsed: true
3 | reportUnmatchedIgnoredErrors: false
4 | # Ignore phpstan-drupal extension's rules.
5 | ignoreErrors:
6 | - '#\Drupal calls should be avoided in classes, use dependency injection instead#'
7 | - '#Plugin definitions cannot be altered.#'
8 | - '#Missing cache backend declaration for performance.#'
9 | - '#Plugin manager has cache backend specified but does not declare cache tags.#'
10 | includes:
11 | - vendor/mglaman/phpstan-drupal/extension.neon
12 | - vendor/phpstan/phpstan-deprecation-rules/rules.neon
--------------------------------------------------------------------------------
/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 | ./test/
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/scripts/composer/ScriptHandler.php:
--------------------------------------------------------------------------------
1 | locateRoot(getcwd());
22 | $drupalRoot = $drupalFinder->getDrupalRoot();
23 |
24 | $dirs = [
25 | 'modules',
26 | 'profiles',
27 | 'themes',
28 | ];
29 |
30 | // Required for unit testing
31 | foreach ($dirs as $dir) {
32 | if (!$fs->exists($drupalRoot . '/'. $dir)) {
33 | $fs->mkdir($drupalRoot . '/'. $dir);
34 | $fs->touch($drupalRoot . '/'. $dir . '/.gitkeep');
35 | }
36 | }
37 |
38 | // Prepare the settings file for installation
39 | if (!$fs->exists($drupalRoot . '/sites/default/settings.php') and $fs->exists($drupalRoot . '/sites/default/default.settings.php')) {
40 | $fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php');
41 | require_once $drupalRoot . '/core/includes/bootstrap.inc';
42 | require_once $drupalRoot . '/core/includes/install.inc';
43 | $settings['config_directories'] = [
44 | CONFIG_SYNC_DIRECTORY => (object) [
45 | 'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
46 | 'required' => TRUE,
47 | ],
48 | ];
49 | drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php');
50 | $fs->chmod($drupalRoot . '/sites/default/settings.php', 0666);
51 | $event->getIO()->write("Create a sites/default/settings.php file with chmod 0666");
52 | }
53 |
54 | // Create the files directory with chmod 0777
55 | if (!$fs->exists($drupalRoot . '/sites/default/files')) {
56 | $oldmask = umask(0);
57 | $fs->mkdir($drupalRoot . '/sites/default/files', 0777);
58 | umask($oldmask);
59 | $event->getIO()->write("Create a sites/default/files directory with chmod 0777");
60 | }
61 | }
62 |
63 | /**
64 | * Checks if the installed version of Composer is compatible.
65 | *
66 | * Composer 1.0.0 and higher consider a `composer install` without having a
67 | * lock file present as equal to `composer update`. We do not ship with a lock
68 | * file to avoid merge conflicts downstream, meaning that if a project is
69 | * installed with an older version of Composer the scaffolding of Drupal will
70 | * not be triggered. We check this here instead of in drupal-scaffold to be
71 | * able to give immediate feedback to the end user, rather than failing the
72 | * installation after going through the lengthy process of compiling and
73 | * downloading the Composer dependencies.
74 | *
75 | * @see https://github.com/composer/composer/pull/5035
76 | */
77 | public static function checkComposerVersion(Event $event) {
78 | $composer = $event->getComposer();
79 | $io = $event->getIO();
80 |
81 | $version = $composer::VERSION;
82 |
83 | // The dev-channel of composer uses the git revision as version number,
84 | // try to the branch alias instead.
85 | if (preg_match('/^[0-9a-f]{40}$/i', $version)) {
86 | $version = $composer::BRANCH_ALIAS_VERSION;
87 | }
88 |
89 | // If Composer is installed through git we have no easy way to determine if
90 | // it is new enough, just display a warning.
91 | if ($version === '@package_version@' || $version === '@package_branch_alias_version@') {
92 | $io->writeError('You are running a development version of Composer. If you experience problems, please update Composer to the latest stable version.');
93 | }
94 | elseif (Comparator::lessThan($version, '1.0.0')) {
95 | $io->writeError('Drupal-project requires Composer version 1.0.0 or higher. Please update your Composer before continuing.');
96 | exit(1);
97 | }
98 | }
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/tmp/.htaccess:
--------------------------------------------------------------------------------
1 | # Turn off all options we don't need.
2 | Options -Indexes -ExecCGI -Includes -MultiViews
3 |
4 | # Set the catch-all handler to prevent scripts from being executed.
5 | SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
6 |
7 | # Override the handler again if we're run later in the evaluation list.
8 | SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
9 |
10 |
11 | # If we know how to do it safely, disable the PHP engine entirely.
12 |
13 | php_flag engine off
14 |
--------------------------------------------------------------------------------
/web/.csslintrc:
--------------------------------------------------------------------------------
1 | --errors=box-model,
2 | display-property-grouping,
3 | duplicate-background-images,
4 | duplicate-properties,
5 | empty-rules,
6 | ids,
7 | import,
8 | important,
9 | known-properties,
10 | outline-none,
11 | overqualified-elements,
12 | qualified-headings,
13 | shorthand,
14 | star-property-hack,
15 | text-indent,
16 | underscore-property-hack,
17 | unique-headings,
18 | unqualified-attributes,
19 | vendor-prefix,
20 | zero-units
21 | --ignore=adjoining-classes,
22 | box-sizing,
23 | bulletproof-font-face,
24 | compatible-vendor-prefixes,
25 | errors,
26 | fallback-colors,
27 | floats,
28 | font-faces,
29 | font-sizes,
30 | gradients,
31 | import-ie-limit,
32 | order-alphabetical,
33 | regex-selectors,
34 | rules-count,
35 | selector-max,
36 | selector-max-approaching,
37 | selector-newline,
38 | universal-selector
39 | --exclude-list=core/assets,
40 | vendor
41 |
--------------------------------------------------------------------------------
/web/.editorconfig:
--------------------------------------------------------------------------------
1 | # Drupal editor configuration normalization
2 | # @see http://editorconfig.org/
3 |
4 | # This is the top-most .editorconfig file; do not search in parent directories.
5 | root = true
6 |
7 | # All files.
8 | [*]
9 | end_of_line = LF
10 | indent_style = space
11 | indent_size = 2
12 | charset = utf-8
13 | trim_trailing_whitespace = true
14 | insert_final_newline = true
15 |
16 | [composer.{json,lock}]
17 | indent_size = 4
18 |
--------------------------------------------------------------------------------
/web/.eslintignore:
--------------------------------------------------------------------------------
1 | core/**/*
2 | vendor/**/*
3 | sites/**/files/**/*
4 | libraries/**/*
5 | sites/**/libraries/**/*
6 | profiles/**/libraries/**/*
7 | **/js_test_files/**/*
8 | **/node_modules/**/*
9 |
--------------------------------------------------------------------------------
/web/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./core/.eslintrc.json"
3 | }
4 |
--------------------------------------------------------------------------------
/web/.gitattributes:
--------------------------------------------------------------------------------
1 | # Drupal git normalization
2 | # @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3 | # @see https://www.drupal.org/node/1542048
4 |
5 | # Normally these settings would be done with macro attributes for improved
6 | # readability and easier maintenance. However macros can only be defined at the
7 | # repository root directory. Drupal avoids making any assumptions about where it
8 | # is installed.
9 |
10 | # Define text file attributes.
11 | # - Treat them as text.
12 | # - Ensure no CRLF line-endings, neither on checkout nor on checkin.
13 | # - Detect whitespace errors.
14 | # - Exposed by default in `git diff --color` on the CLI.
15 | # - Validate with `git diff --check`.
16 | # - Deny applying with `git apply --whitespace=error-all`.
17 | # - Fix automatically with `git apply --whitespace=fix`.
18 |
19 | *.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
20 | *.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
21 | *.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
22 | *.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
23 | *.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html
24 | *.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
25 | *.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
26 | *.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
27 | *.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
28 | *.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
29 | *.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
30 | *.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
31 | *.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
32 | *.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
33 | *.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
34 | *.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
35 | *.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
36 | *.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
37 | *.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
38 | *.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
39 | *.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
40 | *.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
41 | *.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
42 | *.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
43 | *.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
44 |
45 | # Define binary file attributes.
46 | # - Do not treat them as text.
47 | # - Include binary diff in patches instead of "binary files differ."
48 | *.eot -text diff
49 | *.exe -text diff
50 | *.gif -text diff
51 | *.gz -text diff
52 | *.ico -text diff
53 | *.jpeg -text diff
54 | *.jpg -text diff
55 | *.otf -text diff
56 | *.phar -text diff
57 | *.png -text diff
58 | *.svgz -text diff
59 | *.ttf -text diff
60 | *.woff -text diff
61 | *.woff2 -text diff
62 |
--------------------------------------------------------------------------------
/web/.gitignore:
--------------------------------------------------------------------------------
1 | INSTALL.txt
2 | README.txt
3 | example.gitignore
--------------------------------------------------------------------------------
/web/.ht.router.php:
--------------------------------------------------------------------------------
1 |
7 |
8 | Require all denied
9 |
10 |
11 | Order allow,deny
12 |
13 |
14 |
15 | # Don't show directory listings for URLs which map to a directory.
16 | Options -Indexes
17 |
18 | # Set the default handler.
19 | DirectoryIndex index.php index.html index.htm
20 |
21 | # Add correct encoding for SVGZ.
22 | AddType image/svg+xml svg svgz
23 | AddEncoding gzip svgz
24 |
25 | # Most of the following PHP settings cannot be changed at runtime. See
26 | # sites/default/default.settings.php and
27 | # Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
28 | # changed at runtime.
29 |
30 | # PHP 7, Apache 1 and 2.
31 |
32 | php_value assert.active 0
33 |
34 |
35 | # Requires mod_expires to be enabled.
36 |
37 | # Enable expirations.
38 | ExpiresActive On
39 |
40 | # Cache all files for 2 weeks after access (A).
41 | ExpiresDefault A1209600
42 |
43 |
44 | # Do not allow PHP scripts to be cached unless they explicitly send cache
45 | # headers themselves. Otherwise all scripts would have to overwrite the
46 | # headers set by mod_expires if they want another caching behavior. This may
47 | # fail if an error occurs early in the bootstrap process, and it may cause
48 | # problems if a non-Drupal PHP file is installed in a subdirectory.
49 | ExpiresActive Off
50 |
51 |
52 |
53 | # Set a fallback resource if mod_rewrite is not enabled. This allows Drupal to
54 | # work without clean URLs. This requires Apache version >= 2.2.16. If Drupal is
55 | # not accessed by the top level URL (i.e.: http://example.com/drupal/ instead of
56 | # http://example.com/), the path to index.php will need to be adjusted.
57 |
58 | FallbackResource /index.php
59 |
60 |
61 | # Various rewrite rules.
62 |
63 | RewriteEngine on
64 |
65 | # Set "protossl" to "s" if we were accessed via https://. This is used later
66 | # if you enable "www." stripping or enforcement, in order to ensure that
67 | # you don't bounce between http and https.
68 | RewriteRule ^ - [E=protossl]
69 | RewriteCond %{HTTPS} on
70 | RewriteRule ^ - [E=protossl:s]
71 |
72 | # Make sure Authorization HTTP header is available to PHP
73 | # even when running as CGI or FastCGI.
74 | RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
75 |
76 | # Block access to "hidden" directories whose names begin with a period. This
77 | # includes directories used by version control systems such as Subversion or
78 | # Git to store control files. Files whose names begin with a period, as well
79 | # as the control files used by CVS, are protected by the FilesMatch directive
80 | # above.
81 | #
82 | # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
83 | # not possible to block access to entire directories from .htaccess because
84 | # is not allowed here.
85 | #
86 | # If you do not have mod_rewrite installed, you should remove these
87 | # directories from your webroot or otherwise protect them from being
88 | # downloaded.
89 | RewriteRule "/\.|^\.(?!well-known/)" - [F]
90 |
91 | # If your site can be accessed both with and without the 'www.' prefix, you
92 | # can use one of the following settings to redirect users to your preferred
93 | # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
94 | #
95 | # To redirect all users to access the site WITH the 'www.' prefix,
96 | # (http://example.com/foo will be redirected to http://www.example.com/foo)
97 | # uncomment the following:
98 | # RewriteCond %{HTTP_HOST} .
99 | # RewriteCond %{HTTP_HOST} !^www\. [NC]
100 | # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
101 | #
102 | # To redirect all users to access the site WITHOUT the 'www.' prefix,
103 | # (http://www.example.com/foo will be redirected to http://example.com/foo)
104 | # uncomment the following:
105 | # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
106 | # RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
107 |
108 | # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
109 | # VirtualDocumentRoot and the rewrite rules are not working properly.
110 | # For example if your site is at http://example.com/drupal uncomment and
111 | # modify the following line:
112 | # RewriteBase /drupal
113 | #
114 | # If your site is running in a VirtualDocumentRoot at http://example.com/,
115 | # uncomment the following line:
116 | # RewriteBase /
117 |
118 | # Redirect common PHP files to their new locations.
119 | RewriteCond %{REQUEST_URI} ^(.*)?/(install.php) [OR]
120 | RewriteCond %{REQUEST_URI} ^(.*)?/(rebuild.php)
121 | RewriteCond %{REQUEST_URI} !core
122 | RewriteRule ^ %1/core/%2 [L,QSA,R=301]
123 |
124 | # Rewrite install.php during installation to see if mod_rewrite is working
125 | RewriteRule ^core/install.php core/install.php?rewrite=ok [QSA,L]
126 |
127 | # Pass all requests not referring directly to files in the filesystem to
128 | # index.php.
129 | RewriteCond %{REQUEST_FILENAME} !-f
130 | RewriteCond %{REQUEST_FILENAME} !-d
131 | RewriteCond %{REQUEST_URI} !=/favicon.ico
132 | RewriteRule ^ index.php [L]
133 |
134 | # For security reasons, deny access to other PHP files on public sites.
135 | # Note: The following URI conditions are not anchored at the start (^),
136 | # because Drupal may be located in a subdirectory. To further improve
137 | # security, you can replace '!/' with '!^/'.
138 | # Allow access to PHP files in /core (like authorize.php or install.php):
139 | RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
140 | # Allow access to test-specific PHP files:
141 | RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?.php
142 | # Allow access to Statistics module's custom front controller.
143 | # Copy and adapt this rule to directly execute PHP files in contributed or
144 | # custom modules or to run another PHP application in the same directory.
145 | RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$
146 | # Deny access to any other PHP files that do not match the rules above.
147 | # Specifically, disallow autoload.php from being served directly.
148 | RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
149 |
150 | # Rules to correctly serve gzip compressed CSS and JS files.
151 | # Requires both mod_rewrite and mod_headers to be enabled.
152 |
153 | # Serve gzip compressed CSS files if they exist and the client accepts gzip.
154 | RewriteCond %{HTTP:Accept-encoding} gzip
155 | RewriteCond %{REQUEST_FILENAME}\.gz -s
156 | RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
157 |
158 | # Serve gzip compressed JS files if they exist and the client accepts gzip.
159 | RewriteCond %{HTTP:Accept-encoding} gzip
160 | RewriteCond %{REQUEST_FILENAME}\.gz -s
161 | RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
162 |
163 | # Serve correct content types, and prevent double compression.
164 | RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
165 | RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
166 |
167 |
168 | # Serve correct encoding type.
169 | Header set Content-Encoding gzip
170 | # Force proxies to cache gzipped & non-gzipped css/js files separately.
171 | Header append Vary Accept-Encoding
172 |
173 |
174 |
175 |
176 | # Various header fixes.
177 |
178 | # Disable content sniffing, since it's an attack vector.
179 | Header always set X-Content-Type-Options nosniff
180 | # Disable Proxy header, since it's an attack vector.
181 | RequestHeader unset Proxy
182 |
183 |
--------------------------------------------------------------------------------
/web/autoload.php:
--------------------------------------------------------------------------------
1 | handle($request);
20 | $response->send();
21 |
22 | $kernel->terminate($request, $response);
23 |
--------------------------------------------------------------------------------
/web/modules/.gitignore:
--------------------------------------------------------------------------------
1 | README.txt
--------------------------------------------------------------------------------
/web/modules/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thinktandem/template-drupal8/e285317c85137f2c047cc14f4331771f990b5219/web/modules/.gitkeep
--------------------------------------------------------------------------------
/web/modules/custom/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thinktandem/template-drupal8/e285317c85137f2c047cc14f4331771f990b5219/web/modules/custom/.gitkeep
--------------------------------------------------------------------------------
/web/profiles/.gitignore:
--------------------------------------------------------------------------------
1 | README.txt
--------------------------------------------------------------------------------
/web/profiles/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thinktandem/template-drupal8/e285317c85137f2c047cc14f4331771f990b5219/web/profiles/.gitkeep
--------------------------------------------------------------------------------
/web/robots.txt:
--------------------------------------------------------------------------------
1 | #
2 | # robots.txt
3 | #
4 | # This file is to prevent the crawling and indexing of certain parts
5 | # of your site by web crawlers and spiders run by sites like Yahoo!
6 | # and Google. By telling these "robots" where not to go on your site,
7 | # you save bandwidth and server resources.
8 | #
9 | # This file will be ignored unless it is at the root of your host:
10 | # Used: http://example.com/robots.txt
11 | # Ignored: http://example.com/site/robots.txt
12 | #
13 | # For more information about the robots.txt standard, see:
14 | # http://www.robotstxt.org/robotstxt.html
15 |
16 | User-agent: *
17 | # CSS, JS, Images
18 | Allow: /core/*.css$
19 | Allow: /core/*.css?
20 | Allow: /core/*.js$
21 | Allow: /core/*.js?
22 | Allow: /core/*.gif
23 | Allow: /core/*.jpg
24 | Allow: /core/*.jpeg
25 | Allow: /core/*.png
26 | Allow: /core/*.svg
27 | Allow: /profiles/*.css$
28 | Allow: /profiles/*.css?
29 | Allow: /profiles/*.js$
30 | Allow: /profiles/*.js?
31 | Allow: /profiles/*.gif
32 | Allow: /profiles/*.jpg
33 | Allow: /profiles/*.jpeg
34 | Allow: /profiles/*.png
35 | Allow: /profiles/*.svg
36 | # Directories
37 | Disallow: /core/
38 | Disallow: /profiles/
39 | # Files
40 | Disallow: /README.txt
41 | Disallow: /web.config
42 | # Paths (clean URLs)
43 | Disallow: /admin/
44 | Disallow: /comment/reply/
45 | Disallow: /filter/tips
46 | Disallow: /node/add/
47 | Disallow: /search/
48 | Disallow: /user/register/
49 | Disallow: /user/password/
50 | Disallow: /user/login/
51 | Disallow: /user/logout/
52 | # Paths (no clean URLs)
53 | Disallow: /index.php/admin/
54 | Disallow: /index.php/comment/reply/
55 | Disallow: /index.php/filter/tips
56 | Disallow: /index.php/node/add/
57 | Disallow: /index.php/search/
58 | Disallow: /index.php/user/password/
59 | Disallow: /index.php/user/register/
60 | Disallow: /index.php/user/login/
61 | Disallow: /index.php/user/logout/
62 |
--------------------------------------------------------------------------------
/web/sites/.gitignore:
--------------------------------------------------------------------------------
1 | README.txt
--------------------------------------------------------------------------------
/web/sites/default/default.services.yml:
--------------------------------------------------------------------------------
1 | parameters:
2 | session.storage.options:
3 | # Default ini options for sessions.
4 | #
5 | # Some distributions of Linux (most notably Debian) ship their PHP
6 | # installations with garbage collection (gc) disabled. Since Drupal depends
7 | # on PHP's garbage collection for clearing sessions, ensure that garbage
8 | # collection occurs by using the most common settings.
9 | # @default 1
10 | gc_probability: 1
11 | # @default 100
12 | gc_divisor: 100
13 | #
14 | # Set session lifetime (in seconds), i.e. the time from the user's last
15 | # visit to the active session may be deleted by the session garbage
16 | # collector. When a session is deleted, authenticated users are logged out,
17 | # and the contents of the user's $_SESSION variable is discarded.
18 | # @default 200000
19 | gc_maxlifetime: 200000
20 | #
21 | # Set session cookie lifetime (in seconds), i.e. the time from the session
22 | # is created to the cookie expires, i.e. when the browser is expected to
23 | # discard the cookie. The value 0 means "until the browser is closed".
24 | # @default 2000000
25 | cookie_lifetime: 2000000
26 | #
27 | # Drupal automatically generates a unique session cookie name based on the
28 | # full domain name used to access the site. This mechanism is sufficient
29 | # for most use-cases, including multi-site deployments. However, if it is
30 | # desired that a session can be reused across different subdomains, the
31 | # cookie domain needs to be set to the shared base domain. Doing so assures
32 | # that users remain logged in as they cross between various subdomains.
33 | # To maximize compatibility and normalize the behavior across user agents,
34 | # the cookie domain should start with a dot.
35 | #
36 | # @default none
37 | # cookie_domain: '.example.com'
38 | #
39 | twig.config:
40 | # Twig debugging:
41 | #
42 | # When debugging is enabled:
43 | # - The markup of each Twig template is surrounded by HTML comments that
44 | # contain theming information, such as template file name suggestions.
45 | # - Note that this debugging markup will cause automated tests that directly
46 | # check rendered HTML to fail. When running automated tests, 'debug'
47 | # should be set to FALSE.
48 | # - The dump() function can be used in Twig templates to output information
49 | # about template variables.
50 | # - Twig templates are automatically recompiled whenever the source code
51 | # changes (see auto_reload below).
52 | #
53 | # For more information about debugging Twig templates, see
54 | # https://www.drupal.org/node/1906392.
55 | #
56 | # Not recommended in production environments
57 | # @default false
58 | debug: false
59 | # Twig auto-reload:
60 | #
61 | # Automatically recompile Twig templates whenever the source code changes.
62 | # If you don't provide a value for auto_reload, it will be determined
63 | # based on the value of debug.
64 | #
65 | # Not recommended in production environments
66 | # @default null
67 | auto_reload: null
68 | # Twig cache:
69 | #
70 | # By default, Twig templates will be compiled and stored in the filesystem
71 | # to increase performance. Disabling the Twig cache will recompile the
72 | # templates from source each time they are used. In most cases the
73 | # auto_reload setting above should be enabled rather than disabling the
74 | # Twig cache.
75 | #
76 | # Not recommended in production environments
77 | # @default true
78 | cache: true
79 | renderer.config:
80 | # Renderer required cache contexts:
81 | #
82 | # The Renderer will automatically associate these cache contexts with every
83 | # render array, hence varying every render array by these cache contexts.
84 | #
85 | # @default ['languages:language_interface', 'theme', 'user.permissions']
86 | required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions']
87 | # Renderer automatic placeholdering conditions:
88 | #
89 | # Drupal allows portions of the page to be automatically deferred when
90 | # rendering to improve cache performance. That is especially helpful for
91 | # cache contexts that vary widely, such as the active user. On some sites
92 | # those may be different, however, such as sites with only a handful of
93 | # users. If you know what the high-cardinality cache contexts are for your
94 | # site, specify those here. If you're not sure, the defaults are fairly safe
95 | # in general.
96 | #
97 | # For more information about rendering optimizations see
98 | # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing
99 | auto_placeholder_conditions:
100 | # Max-age at or below which caching is not considered worthwhile.
101 | #
102 | # Disable by setting to -1.
103 | #
104 | # @default 0
105 | max-age: 0
106 | # Cache contexts with a high cardinality.
107 | #
108 | # Disable by setting to [].
109 | #
110 | # @default ['session', 'user']
111 | contexts: ['session', 'user']
112 | # Tags with a high invalidation frequency.
113 | #
114 | # Disable by setting to [].
115 | #
116 | # @default []
117 | tags: []
118 | # Cacheability debugging:
119 | #
120 | # Responses with cacheability metadata (CacheableResponseInterface instances)
121 | # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers.
122 | #
123 | # For more information about debugging cacheable responses, see
124 | # https://www.drupal.org/developing/api/8/response/cacheable-response-interface
125 | #
126 | # Not recommended in production environments
127 | # @default false
128 | http.response.debug_cacheability_headers: false
129 | factory.keyvalue:
130 | {}
131 | # Default key/value storage service to use.
132 | # @default keyvalue.database
133 | # default: keyvalue.database
134 | # Collection-specific overrides.
135 | # state: keyvalue.database
136 | factory.keyvalue.expirable:
137 | {}
138 | # Default key/value expirable storage service to use.
139 | # @default keyvalue.database.expirable
140 | # default: keyvalue.database.expirable
141 | # Allowed protocols for URL generation.
142 | filter_protocols:
143 | - http
144 | - https
145 | - ftp
146 | - news
147 | - nntp
148 | - tel
149 | - telnet
150 | - mailto
151 | - irc
152 | - ssh
153 | - sftp
154 | - webcal
155 | - rtsp
156 |
157 | # Configure Cross-Site HTTP requests (CORS).
158 | # Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
159 | # for more information about the topic in general.
160 | # Note: By default the configuration is disabled.
161 | cors.config:
162 | enabled: false
163 | # Specify allowed headers, like 'x-allowed-header'.
164 | allowedHeaders: []
165 | # Specify allowed request methods, specify ['*'] to allow all possible ones.
166 | allowedMethods: []
167 | # Configure requests allowed from specific origins.
168 | allowedOrigins: ['*']
169 | # Sets the Access-Control-Expose-Headers header.
170 | exposedHeaders: false
171 | # Sets the Access-Control-Max-Age header.
172 | maxAge: false
173 | # Sets the Access-Control-Allow-Credentials header.
174 | supportsCredentials: false
175 |
--------------------------------------------------------------------------------
/web/sites/default/default.settings.php:
--------------------------------------------------------------------------------
1 | 'databasename',
81 | * 'username' => 'sqlusername',
82 | * 'password' => 'sqlpassword',
83 | * 'host' => 'localhost',
84 | * 'port' => '3306',
85 | * 'driver' => 'mysql',
86 | * 'prefix' => '',
87 | * 'collation' => 'utf8mb4_general_ci',
88 | * ];
89 | * @endcode
90 | */
91 | $databases = [];
92 |
93 | /**
94 | * Customizing database settings.
95 | *
96 | * Many of the values of the $databases array can be customized for your
97 | * particular database system. Refer to the sample in the section above as a
98 | * starting point.
99 | *
100 | * The "driver" property indicates what Drupal database driver the
101 | * connection should use. This is usually the same as the name of the
102 | * database type, such as mysql or sqlite, but not always. The other
103 | * properties will vary depending on the driver. For SQLite, you must
104 | * specify a database file name in a directory that is writable by the
105 | * webserver. For most other drivers, you must specify a
106 | * username, password, host, and database name.
107 | *
108 | * Drupal core implements drivers for mysql, pgsql, and sqlite. Other drivers
109 | * can be provided by contributed or custom modules. To use a contributed or
110 | * custom driver, the "namespace" property must be set to the namespace of the
111 | * driver. The code in this namespace must be autoloadable prior to connecting
112 | * to the database, and therefore, prior to when module root namespaces are
113 | * added to the autoloader. To add the driver's namespace to the autoloader,
114 | * set the "autoload" property to the PSR-4 base directory of the driver's
115 | * namespace. This is optional for projects managed with Composer if the
116 | * driver's namespace is in Composer's autoloader.
117 | *
118 | * Transaction support is enabled by default for all drivers that support it,
119 | * including MySQL. To explicitly disable it, set the 'transactions' key to
120 | * FALSE.
121 | * Note that some configurations of MySQL, such as the MyISAM engine, don't
122 | * support it and will proceed silently even if enabled. If you experience
123 | * transaction related crashes with such configuration, set the 'transactions'
124 | * key to FALSE.
125 | *
126 | * For each database, you may optionally specify multiple "target" databases.
127 | * A target database allows Drupal to try to send certain queries to a
128 | * different database if it can but fall back to the default connection if not.
129 | * That is useful for primary/replica replication, as Drupal may try to connect
130 | * to a replica server when appropriate and if one is not available will simply
131 | * fall back to the single primary server (The terms primary/replica are
132 | * traditionally referred to as master/slave in database server documentation).
133 | *
134 | * The general format for the $databases array is as follows:
135 | * @code
136 | * $databases['default']['default'] = $info_array;
137 | * $databases['default']['replica'][] = $info_array;
138 | * $databases['default']['replica'][] = $info_array;
139 | * $databases['extra']['default'] = $info_array;
140 | * @endcode
141 | *
142 | * In the above example, $info_array is an array of settings described above.
143 | * The first line sets a "default" database that has one primary database
144 | * (the second level default). The second and third lines create an array
145 | * of potential replica databases. Drupal will select one at random for a given
146 | * request as needed. The fourth line creates a new database with a name of
147 | * "extra".
148 | *
149 | * You can optionally set prefixes for some or all database table names
150 | * by using the 'prefix' setting. If a prefix is specified, the table
151 | * name will be prepended with its value. Be sure to use valid database
152 | * characters only, usually alphanumeric and underscore. If no prefixes
153 | * are desired, leave it as an empty string ''.
154 | *
155 | * To have all database names prefixed, set 'prefix' as a string:
156 | * @code
157 | * 'prefix' => 'main_',
158 | * @endcode
159 | *
160 | * Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in
161 | * Drupal 9.0. After that, only a single prefix for all tables will be
162 | * supported.
163 | *
164 | * To provide prefixes for specific tables, set 'prefix' as an array.
165 | * The array's keys are the table names and the values are the prefixes.
166 | * The 'default' element is mandatory and holds the prefix for any tables
167 | * not specified elsewhere in the array. Example:
168 | * @code
169 | * 'prefix' => [
170 | * 'default' => 'main_',
171 | * 'users' => 'shared_',
172 | * 'sessions' => 'shared_',
173 | * 'role' => 'shared_',
174 | * 'authmap' => 'shared_',
175 | * ],
176 | * @endcode
177 | * You can also use a reference to a schema/database as a prefix. This may be
178 | * useful if your Drupal installation exists in a schema that is not the default
179 | * or you want to access several databases from the same code base at the same
180 | * time.
181 | * Example:
182 | * @code
183 | * 'prefix' => [
184 | * 'default' => 'main.',
185 | * 'users' => 'shared.',
186 | * 'sessions' => 'shared.',
187 | * 'role' => 'shared.',
188 | * 'authmap' => 'shared.',
189 | * ];
190 | * @endcode
191 | * NOTE: MySQL and SQLite's definition of a schema is a database.
192 | *
193 | * Advanced users can add or override initial commands to execute when
194 | * connecting to the database server, as well as PDO connection settings. For
195 | * example, to enable MySQL SELECT queries to exceed the max_join_size system
196 | * variable, and to reduce the database connection timeout to 5 seconds:
197 | * @code
198 | * $databases['default']['default'] = [
199 | * 'init_commands' => [
200 | * 'big_selects' => 'SET SQL_BIG_SELECTS=1',
201 | * ],
202 | * 'pdo' => [
203 | * PDO::ATTR_TIMEOUT => 5,
204 | * ],
205 | * ];
206 | * @endcode
207 | *
208 | * WARNING: The above defaults are designed for database portability. Changing
209 | * them may cause unexpected behavior, including potential data loss. See
210 | * https://www.drupal.org/developing/api/database/configuration for more
211 | * information on these defaults and the potential issues.
212 | *
213 | * More details can be found in the constructor methods for each driver:
214 | * - \Drupal\Core\Database\Driver\mysql\Connection::__construct()
215 | * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct()
216 | * - \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
217 | *
218 | * Sample Database configuration format for PostgreSQL (pgsql):
219 | * @code
220 | * $databases['default']['default'] = [
221 | * 'driver' => 'pgsql',
222 | * 'database' => 'databasename',
223 | * 'username' => 'sqlusername',
224 | * 'password' => 'sqlpassword',
225 | * 'host' => 'localhost',
226 | * 'prefix' => '',
227 | * ];
228 | * @endcode
229 | *
230 | * Sample Database configuration format for SQLite (sqlite):
231 | * @code
232 | * $databases['default']['default'] = [
233 | * 'driver' => 'sqlite',
234 | * 'database' => '/path/to/databasefilename',
235 | * ];
236 | * @endcode
237 | *
238 | * Sample Database configuration format for a driver in a contributed module:
239 | * @code
240 | * $databases['default']['default'] = [
241 | * 'driver' => 'mydriver',
242 | * 'namespace' => 'Drupal\mymodule\Driver\Database\mydriver',
243 | * 'autoload' => 'modules/mymodule/src/Driver/Database/mydriver/',
244 | * 'database' => 'databasename',
245 | * 'username' => 'sqlusername',
246 | * 'password' => 'sqlpassword',
247 | * 'host' => 'localhost',
248 | * 'prefix' => '',
249 | * ];
250 | * @endcode
251 | */
252 |
253 | /**
254 | * Location of the site configuration files.
255 | *
256 | * The $settings['config_sync_directory'] specifies the location of file system
257 | * directory used for syncing configuration data. On install, the directory is
258 | * created. This is used for configuration imports.
259 | *
260 | * The default location for this directory is inside a randomly-named
261 | * directory in the public files path. The setting below allows you to set
262 | * its location.
263 | */
264 | # $settings['config_sync_directory'] = '/directory/outside/webroot';
265 |
266 | /**
267 | * Settings:
268 | *
269 | * $settings contains environment-specific configuration, such as the files
270 | * directory and reverse proxy address, and temporary configuration, such as
271 | * security overrides.
272 | *
273 | * @see \Drupal\Core\Site\Settings::get()
274 | */
275 |
276 | /**
277 | * Salt for one-time login links, cancel links, form tokens, etc.
278 | *
279 | * This variable will be set to a random value by the installer. All one-time
280 | * login links will be invalidated if the value is changed. Note that if your
281 | * site is deployed on a cluster of web servers, you must ensure that this
282 | * variable has the same value on each server.
283 | *
284 | * For enhanced security, you may set this variable to the contents of a file
285 | * outside your document root; you should also ensure that this file is not
286 | * stored with backups of your database.
287 | *
288 | * Example:
289 | * @code
290 | * $settings['hash_salt'] = file_get_contents('/home/example/salt.txt');
291 | * @endcode
292 | */
293 | $settings['hash_salt'] = '';
294 |
295 | /**
296 | * Deployment identifier.
297 | *
298 | * Drupal's dependency injection container will be automatically invalidated and
299 | * rebuilt when the Drupal core version changes. When updating contributed or
300 | * custom code that changes the container, changing this identifier will also
301 | * allow the container to be invalidated as soon as code is deployed.
302 | */
303 | # $settings['deployment_identifier'] = \Drupal::VERSION;
304 |
305 | /**
306 | * Access control for update.php script.
307 | *
308 | * If you are updating your Drupal installation using the update.php script but
309 | * are not logged in using either an account with the "Administer software
310 | * updates" permission or the site maintenance account (the account that was
311 | * created during installation), you will need to modify the access check
312 | * statement below. Change the FALSE to a TRUE to disable the access check.
313 | * After finishing the upgrade, be sure to open this file again and change the
314 | * TRUE back to a FALSE!
315 | */
316 | $settings['update_free_access'] = FALSE;
317 |
318 | /**
319 | * External access proxy settings:
320 | *
321 | * If your site must access the Internet via a web proxy then you can enter the
322 | * proxy settings here. Set the full URL of the proxy, including the port, in
323 | * variables:
324 | * - $settings['http_client_config']['proxy']['http']: The proxy URL for HTTP
325 | * requests.
326 | * - $settings['http_client_config']['proxy']['https']: The proxy URL for HTTPS
327 | * requests.
328 | * You can pass in the user name and password for basic authentication in the
329 | * URLs in these settings.
330 | *
331 | * You can also define an array of host names that can be accessed directly,
332 | * bypassing the proxy, in $settings['http_client_config']['proxy']['no'].
333 | */
334 | # $settings['http_client_config']['proxy']['http'] = 'http://proxy_user:proxy_pass@example.com:8080';
335 | # $settings['http_client_config']['proxy']['https'] = 'http://proxy_user:proxy_pass@example.com:8080';
336 | # $settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost'];
337 |
338 | /**
339 | * Reverse Proxy Configuration:
340 | *
341 | * Reverse proxy servers are often used to enhance the performance
342 | * of heavily visited sites and may also provide other site caching,
343 | * security, or encryption benefits. In an environment where Drupal
344 | * is behind a reverse proxy, the real IP address of the client should
345 | * be determined such that the correct client IP address is available
346 | * to Drupal's logging, statistics, and access management systems. In
347 | * the most simple scenario, the proxy server will add an
348 | * X-Forwarded-For header to the request that contains the client IP
349 | * address. However, HTTP headers are vulnerable to spoofing, where a
350 | * malicious client could bypass restrictions by setting the
351 | * X-Forwarded-For header directly. Therefore, Drupal's proxy
352 | * configuration requires the IP addresses of all remote proxies to be
353 | * specified in $settings['reverse_proxy_addresses'] to work correctly.
354 | *
355 | * Enable this setting to get Drupal to determine the client IP from the
356 | * X-Forwarded-For header. If you are unsure about this setting, do not have a
357 | * reverse proxy, or Drupal operates in a shared hosting environment, this
358 | * setting should remain commented out.
359 | *
360 | * In order for this setting to be used you must specify every possible
361 | * reverse proxy IP address in $settings['reverse_proxy_addresses'].
362 | * If a complete list of reverse proxies is not available in your
363 | * environment (for example, if you use a CDN) you may set the
364 | * $_SERVER['REMOTE_ADDR'] variable directly in settings.php.
365 | * Be aware, however, that it is likely that this would allow IP
366 | * address spoofing unless more advanced precautions are taken.
367 | */
368 | # $settings['reverse_proxy'] = TRUE;
369 |
370 | /**
371 | * Specify every reverse proxy IP address in your environment.
372 | * This setting is required if $settings['reverse_proxy'] is TRUE.
373 | */
374 | # $settings['reverse_proxy_addresses'] = ['a.b.c.d', ...];
375 |
376 | /**
377 | * Reverse proxy trusted headers.
378 | *
379 | * Sets which headers to trust from your reverse proxy.
380 | *
381 | * Common values are:
382 | * - \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL
383 | * - \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED
384 | *
385 | * Note the default value of
386 | * @code
387 | * \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED
388 | * @endcode
389 | * is not secure by default. The value should be set to only the specific
390 | * headers the reverse proxy uses. For example:
391 | * @code
392 | * \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL
393 | * @endcode
394 | * This would trust the following headers:
395 | * - X_FORWARDED_FOR
396 | * - X_FORWARDED_HOST
397 | * - X_FORWARDED_PROTO
398 | * - X_FORWARDED_PORT
399 | *
400 | * @see \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL
401 | * @see \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED
402 | * @see \Symfony\Component\HttpFoundation\Request::setTrustedProxies
403 | */
404 | # $settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED;
405 |
406 |
407 | /**
408 | * Page caching:
409 | *
410 | * By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page
411 | * views. This tells a HTTP proxy that it may return a page from its local
412 | * cache without contacting the web server, if the user sends the same Cookie
413 | * header as the user who originally requested the cached page. Without "Vary:
414 | * Cookie", authenticated users would also be served the anonymous page from
415 | * the cache. If the site has mostly anonymous users except a few known
416 | * editors/administrators, the Vary header can be omitted. This allows for
417 | * better caching in HTTP proxies (including reverse proxies), i.e. even if
418 | * clients send different cookies, they still get content served from the cache.
419 | * However, authenticated users should access the site directly (i.e. not use an
420 | * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid
421 | * getting cached pages from the proxy.
422 | */
423 | # $settings['omit_vary_cookie'] = TRUE;
424 |
425 |
426 | /**
427 | * Cache TTL for client error (4xx) responses.
428 | *
429 | * Items cached per-URL tend to result in a large number of cache items, and
430 | * this can be problematic on 404 pages which by their nature are unbounded. A
431 | * fixed TTL can be set for these items, defaulting to one hour, so that cache
432 | * backends which do not support LRU can purge older entries. To disable caching
433 | * of client error responses set the value to 0. Currently applies only to
434 | * page_cache module.
435 | */
436 | # $settings['cache_ttl_4xx'] = 3600;
437 |
438 | /**
439 | * Expiration of cached forms.
440 | *
441 | * Drupal's Form API stores details of forms in a cache and these entries are
442 | * kept for at least 6 hours by default. Expired entries are cleared by cron.
443 | *
444 | * @see \Drupal\Core\Form\FormCache::setCache()
445 | */
446 | # $settings['form_cache_expiration'] = 21600;
447 |
448 | /**
449 | * Class Loader.
450 | *
451 | * If the APC extension is detected, the Symfony APC class loader is used for
452 | * performance reasons. Detection can be prevented by setting
453 | * class_loader_auto_detect to false, as in the example below.
454 | */
455 | # $settings['class_loader_auto_detect'] = FALSE;
456 |
457 | /*
458 | * If the APC extension is not detected, either because APC is missing or
459 | * because auto-detection has been disabled, auto-loading falls back to
460 | * Composer's ClassLoader, which is good for development as it does not break
461 | * when code is moved in the file system. You can also decorate the base class
462 | * loader with another cached solution than the Symfony APC class loader, as
463 | * all production sites should have a cached class loader of some sort enabled.
464 | *
465 | * To do so, you may decorate and replace the local $class_loader variable. For
466 | * example, to use Symfony's APC class loader without automatic detection,
467 | * uncomment the code below.
468 | */
469 | /*
470 | if ($settings['hash_salt']) {
471 | $prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']);
472 | $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader);
473 | unset($prefix);
474 | $class_loader->unregister();
475 | $apc_loader->register();
476 | $class_loader = $apc_loader;
477 | }
478 | */
479 |
480 | /**
481 | * Authorized file system operations:
482 | *
483 | * The Update Manager module included with Drupal provides a mechanism for
484 | * site administrators to securely install missing updates for the site
485 | * directly through the web user interface. On securely-configured servers,
486 | * the Update manager will require the administrator to provide SSH or FTP
487 | * credentials before allowing the installation to proceed; this allows the
488 | * site to update the new files as the user who owns all the Drupal files,
489 | * instead of as the user the webserver is running as. On servers where the
490 | * webserver user is itself the owner of the Drupal files, the administrator
491 | * will not be prompted for SSH or FTP credentials (note that these server
492 | * setups are common on shared hosting, but are inherently insecure).
493 | *
494 | * Some sites might wish to disable the above functionality, and only update
495 | * the code directly via SSH or FTP themselves. This setting completely
496 | * disables all functionality related to these authorized file operations.
497 | *
498 | * @see https://www.drupal.org/node/244924
499 | *
500 | * Remove the leading hash signs to disable.
501 | */
502 | # $settings['allow_authorize_operations'] = FALSE;
503 |
504 | /**
505 | * Default mode for directories and files written by Drupal.
506 | *
507 | * Value should be in PHP Octal Notation, with leading zero.
508 | */
509 | # $settings['file_chmod_directory'] = 0775;
510 | # $settings['file_chmod_file'] = 0664;
511 |
512 | /**
513 | * Public file base URL:
514 | *
515 | * An alternative base URL to be used for serving public files. This must
516 | * include any leading directory path.
517 | *
518 | * A different value from the domain used by Drupal to be used for accessing
519 | * public files. This can be used for a simple CDN integration, or to improve
520 | * security by serving user-uploaded files from a different domain or subdomain
521 | * pointing to the same server. Do not include a trailing slash.
522 | */
523 | # $settings['file_public_base_url'] = 'http://downloads.example.com/files';
524 |
525 | /**
526 | * Public file path:
527 | *
528 | * A local file system path where public files will be stored. This directory
529 | * must exist and be writable by Drupal. This directory must be relative to
530 | * the Drupal installation directory and be accessible over the web.
531 | */
532 | # $settings['file_public_path'] = 'sites/default/files';
533 |
534 | /**
535 | * Private file path:
536 | *
537 | * A local file system path where private files will be stored. This directory
538 | * must be absolute, outside of the Drupal installation directory and not
539 | * accessible over the web.
540 | *
541 | * Note: Caches need to be cleared when this value is changed to make the
542 | * private:// stream wrapper available to the system.
543 | *
544 | * See https://www.drupal.org/documentation/modules/file for more information
545 | * about securing private files.
546 | */
547 | # $settings['file_private_path'] = '';
548 |
549 | /**
550 | * Temporary file path:
551 | *
552 | * A local file system path where temporary files will be stored. This directory
553 | * must be absolute, outside of the Drupal installation directory and not
554 | * accessible over the web.
555 | *
556 | * If this is not set, the default for the operating system will be used.
557 | *
558 | * @see \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory()
559 | */
560 | # $settings['file_temp_path'] = '/tmp';
561 |
562 | /**
563 | * Session write interval:
564 | *
565 | * Set the minimum interval between each session write to database.
566 | * For performance reasons it defaults to 180.
567 | */
568 | # $settings['session_write_interval'] = 180;
569 |
570 | /**
571 | * String overrides:
572 | *
573 | * To override specific strings on your site with or without enabling the Locale
574 | * module, add an entry to this list. This functionality allows you to change
575 | * a small number of your site's default English language interface strings.
576 | *
577 | * Remove the leading hash signs to enable.
578 | *
579 | * The "en" part of the variable name, is dynamic and can be any langcode of
580 | * any added language. (eg locale_custom_strings_de for german).
581 | */
582 | # $settings['locale_custom_strings_en'][''] = [
583 | # 'forum' => 'Discussion board',
584 | # '@count min' => '@count minutes',
585 | # ];
586 |
587 | /**
588 | * A custom theme for the offline page:
589 | *
590 | * This applies when the site is explicitly set to maintenance mode through the
591 | * administration page or when the database is inactive due to an error.
592 | * The template file should also be copied into the theme. It is located inside
593 | * 'core/modules/system/templates/maintenance-page.html.twig'.
594 | *
595 | * Note: This setting does not apply to installation and update pages.
596 | */
597 | # $settings['maintenance_theme'] = 'bartik';
598 |
599 | /**
600 | * PHP settings:
601 | *
602 | * To see what PHP settings are possible, including whether they can be set at
603 | * runtime (by using ini_set()), read the PHP documentation:
604 | * http://php.net/manual/ini.list.php
605 | * See \Drupal\Core\DrupalKernel::bootEnvironment() for required runtime
606 | * settings and the .htaccess file for non-runtime settings.
607 | * Settings defined there should not be duplicated here so as to avoid conflict
608 | * issues.
609 | */
610 |
611 | /**
612 | * If you encounter a situation where users post a large amount of text, and
613 | * the result is stripped out upon viewing but can still be edited, Drupal's
614 | * output filter may not have sufficient memory to process it. If you
615 | * experience this issue, you may wish to uncomment the following two lines
616 | * and increase the limits of these variables. For more information, see
617 | * http://php.net/manual/pcre.configuration.php.
618 | */
619 | # ini_set('pcre.backtrack_limit', 200000);
620 | # ini_set('pcre.recursion_limit', 200000);
621 |
622 | /**
623 | * Configuration overrides.
624 | *
625 | * To globally override specific configuration values for this site,
626 | * set them here. You usually don't need to use this feature. This is
627 | * useful in a configuration file for a vhost or directory, rather than
628 | * the default settings.php.
629 | *
630 | * Note that any values you provide in these variable overrides will not be
631 | * viewable from the Drupal administration interface. The administration
632 | * interface displays the values stored in configuration so that you can stage
633 | * changes to other environments that don't have the overrides.
634 | *
635 | * There are particular configuration values that are risky to override. For
636 | * example, overriding the list of installed modules in 'core.extension' is not
637 | * supported as module install or uninstall has not occurred. Other examples
638 | * include field storage configuration, because it has effects on database
639 | * structure, and 'core.menu.static_menu_link_overrides' since this is cached in
640 | * a way that is not config override aware. Also, note that changing
641 | * configuration values in settings.php will not fire any of the configuration
642 | * change events.
643 | */
644 | # $config['system.site']['name'] = 'My Drupal site';
645 | # $config['user.settings']['anonymous'] = 'Visitor';
646 |
647 | /**
648 | * Fast 404 pages:
649 | *
650 | * Drupal can generate fully themed 404 pages. However, some of these responses
651 | * are for images or other resource files that are not displayed to the user.
652 | * This can waste bandwidth, and also generate server load.
653 | *
654 | * The options below return a simple, fast 404 page for URLs matching a
655 | * specific pattern:
656 | * - $config['system.performance']['fast_404']['exclude_paths']: A regular
657 | * expression to match paths to exclude, such as images generated by image
658 | * styles, or dynamically-resized images. The default pattern provided below
659 | * also excludes the private file system. If you need to add more paths, you
660 | * can add '|path' to the expression.
661 | * - $config['system.performance']['fast_404']['paths']: A regular expression to
662 | * match paths that should return a simple 404 page, rather than the fully
663 | * themed 404 page. If you don't have any aliases ending in htm or html you
664 | * can add '|s?html?' to the expression.
665 | * - $config['system.performance']['fast_404']['html']: The html to return for
666 | * simple 404 pages.
667 | *
668 | * Remove the leading hash signs if you would like to alter this functionality.
669 | */
670 | # $config['system.performance']['fast_404']['exclude_paths'] = '/\/(?:styles)|(?:system\/files)\//';
671 | # $config['system.performance']['fast_404']['paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
672 | # $config['system.performance']['fast_404']['html'] = '404 Not FoundNot Found
The requested URL "@path" was not found on this server.
';
673 |
674 | /**
675 | * Load services definition file.
676 | */
677 | $settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml';
678 |
679 | /**
680 | * Override the default service container class.
681 | *
682 | * This is useful for example to trace the service container for performance
683 | * tracking purposes, for testing a service container with an error condition or
684 | * to test a service container that throws an exception.
685 | */
686 | # $settings['container_base_class'] = '\Drupal\Core\DependencyInjection\Container';
687 |
688 | /**
689 | * Override the default yaml parser class.
690 | *
691 | * Provide a fully qualified class name here if you would like to provide an
692 | * alternate implementation YAML parser. The class must implement the
693 | * \Drupal\Component\Serialization\SerializationInterface interface.
694 | */
695 | # $settings['yaml_parser_class'] = NULL;
696 |
697 | /**
698 | * Trusted host configuration.
699 | *
700 | * Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host
701 | * header spoofing.
702 | *
703 | * To enable the trusted host mechanism, you enable your allowable hosts
704 | * in $settings['trusted_host_patterns']. This should be an array of regular
705 | * expression patterns, without delimiters, representing the hosts you would
706 | * like to allow.
707 | *
708 | * For example:
709 | * @code
710 | * $settings['trusted_host_patterns'] = [
711 | * '^www\.example\.com$',
712 | * ];
713 | * @endcode
714 | * will allow the site to only run from www.example.com.
715 | *
716 | * If you are running multisite, or if you are running your site from
717 | * different domain names (eg, you don't redirect http://www.example.com to
718 | * http://example.com), you should specify all of the host patterns that are
719 | * allowed by your site.
720 | *
721 | * For example:
722 | * @code
723 | * $settings['trusted_host_patterns'] = [
724 | * '^example\.com$',
725 | * '^.+\.example\.com$',
726 | * '^example\.org$',
727 | * '^.+\.example\.org$',
728 | * ];
729 | * @endcode
730 | * will allow the site to run off of all variants of example.com and
731 | * example.org, with all subdomains included.
732 | */
733 |
734 | /**
735 | * The default list of directories that will be ignored by Drupal's file API.
736 | *
737 | * By default ignore node_modules and bower_components folders to avoid issues
738 | * with common frontend tools and recursive scanning of directories looking for
739 | * extensions.
740 | *
741 | * @see \Drupal\Core\File\FileSystemInterface::scanDirectory()
742 | * @see \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory()
743 | */
744 | $settings['file_scan_ignore_directories'] = [
745 | 'node_modules',
746 | 'bower_components',
747 | ];
748 |
749 | /**
750 | * The default number of entities to update in a batch process.
751 | *
752 | * This is used by update and post-update functions that need to go through and
753 | * change all the entities on a site, so it is useful to increase this number
754 | * if your hosting configuration (i.e. RAM allocation, CPU speed) allows for a
755 | * larger number of entities to be processed in a single batch run.
756 | */
757 | $settings['entity_update_batch_size'] = 50;
758 |
759 | /**
760 | * Entity update backup.
761 | *
762 | * This is used to inform the entity storage handler that the backup tables as
763 | * well as the original entity type and field storage definitions should be
764 | * retained after a successful entity update process.
765 | */
766 | $settings['entity_update_backup'] = TRUE;
767 |
768 | /**
769 | * Node migration type.
770 | *
771 | * This is used to force the migration system to use the classic node migrations
772 | * instead of the default complete node migrations. The migration system will
773 | * use the classic node migration only if there are existing migrate_map tables
774 | * for the classic node migrations and they contain data. These tables may not
775 | * exist if you are developing custom migrations and do not want to use the
776 | * complete node migrations. Set this to TRUE to force the use of the classic
777 | * node migrations.
778 | */
779 | $settings['migrate_node_migrate_type_classic'] = FALSE;
780 |
781 | /**
782 | * Load local development override configuration, if available.
783 | *
784 | * Create a settings.local.php file to override variables on secondary (staging,
785 | * development, etc.) installations of this site.
786 | *
787 | * Typical uses of settings.local.php include:
788 | * - Disabling caching.
789 | * - Disabling JavaScript/CSS compression.
790 | * - Rerouting outgoing emails.
791 | *
792 | * Keep this code block at the end of this file to take full effect.
793 | */
794 | #
795 | # if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
796 | # include $app_root . '/' . $site_path . '/settings.local.php';
797 | # }
798 |
--------------------------------------------------------------------------------
/web/sites/default/settings.lando.php:
--------------------------------------------------------------------------------
1 | $relationship) {
12 | $drupal_key = ($key === 'database') ? 'default' : $key;
13 | foreach ($relationship as $instance) {
14 | if (empty($instance['scheme']) || ($instance['scheme'] !== 'mysql' && $instance['scheme'] !== 'pgsql')) {
15 | continue;
16 | }
17 | $database = [
18 | 'driver' => $instance['scheme'],
19 | 'database' => $instance['path'],
20 | 'username' => $instance['username'],
21 | 'password' => $instance['password'],
22 | 'host' => $instance['host'],
23 | 'port' => $instance['port'],
24 | ];
25 |
26 | if (!empty($instance['query']['compression'])) {
27 | $database['pdo'][PDO::MYSQL_ATTR_COMPRESS] = TRUE;
28 | }
29 |
30 | if (!empty($instance['query']['is_master'])) {
31 | $databases[$drupal_key]['default'] = $database;
32 | }
33 | else {
34 | $databases[$drupal_key]['replica'][] = $database;
35 | }
36 | }
37 | }
38 | }
39 | }
40 |
41 | if (getenv('PLATFORM_APP_DIR')) {
42 |
43 | // Configure private and temporary file paths.
44 | if (!isset($settings['file_private_path'])) {
45 | $settings['file_private_path'] = getenv('PLATFORM_APP_DIR') . '/private';
46 | }
47 | if (!isset($settings["file_temp_path"])) {
48 | $settings["file_temp_path"] = getenv('PLATFORM_APP_DIR') . '/tmp';
49 | }
50 |
51 | // Configure the default PhpStorage and Twig template cache directories.
52 | if (!isset($settings['php_storage']['default'])) {
53 | $settings['php_storage']['default']['directory'] = $settings['file_private_path'];
54 | }
55 | if (!isset($settings['php_storage']['twig'])) {
56 | $settings['php_storage']['twig']['directory'] = $settings['file_private_path'];
57 | }
58 |
59 | }
60 |
61 | // Set trusted hosts based on Platform.sh routes.
62 | if (getenv('PLATFORM_ROUTES') && !isset($settings['trusted_host_patterns'])) {
63 | $routes = json_decode(base64_decode(getenv('PLATFORM_ROUTES')), TRUE);
64 | $settings['trusted_host_patterns'] = [];
65 | foreach ($routes as $url => $route) {
66 | $host = parse_url($url, PHP_URL_HOST);
67 | if ($host !== FALSE && $route['type'] == 'upstream' && $route['upstream'] == getenv('PLATFORM_APPLICATION_NAME')) {
68 | // Replace asterisk wildcards with a regular expression.
69 | $host_pattern = str_replace('\*', '[^\.]+', preg_quote($host));
70 | $settings['trusted_host_patterns'][] = '^' . $host_pattern . '$';
71 | }
72 | }
73 | $settings['trusted_host_patterns'] = array_unique($settings['trusted_host_patterns']);
74 | }
75 |
76 | // Import variables prefixed with 'd8settings:' into $settings and 'd8config:'
77 | // into $config.
78 | if (getenv('PLATFORM_VARIABLES')) {
79 | $variables = json_decode(base64_decode(getenv('PLATFORM_VARIABLES')), TRUE);
80 | foreach ($variables as $name => $value) {
81 | $parts = explode(':', $name);
82 | list($prefix, $key) = array_pad($parts, 3, null);
83 | switch ($prefix) {
84 | // Variables that begin with `d8settings` or `drupal` get mapped
85 | // to the $settings array verbatim, even if the value is an array.
86 | // For example, a variable named d8settings:example-setting' with
87 | // value 'foo' becomes $settings['example-setting'] = 'foo';
88 | case 'd8settings':
89 | case 'drupal':
90 | $settings[$key] = $value;
91 | break;
92 | // Variables that begin with `d8config` get mapped to the $config
93 | // array. Deeply nested variable names, with colon delimiters,
94 | // get mapped to deeply nested array elements. Array values
95 | // get added to the end just like a scalar. Variables without
96 | // both a config object name and property are skipped.
97 | // Example: Variable `d8config:conf_file:prop` with value `foo` becomes
98 | // $config['conf_file']['prop'] = 'foo';
99 | // Example: Variable `d8config:conf_file:prop:subprop` with value `foo` becomes
100 | // $config['conf_file']['prop']['subprop'] = 'foo';
101 | // Example: Variable `d8config:conf_file:prop:subprop` with value ['foo' => 'bar'] becomes
102 | // $config['conf_file']['prop']['subprop']['foo'] = 'bar';
103 | // Example: Variable `d8config:prop` is ignored.
104 | case 'd8config':
105 | if (count($parts) > 2) {
106 | $temp = &$config[$key];
107 | foreach (array_slice($parts, 2) as $n) {
108 | $prev = &$temp;
109 | $temp = &$temp[$n];
110 | }
111 | $prev[$n] = $value;
112 | }
113 | break;
114 | }
115 | }
116 | }
117 |
118 | // Set the project-specific entropy value, used for generating one-time
119 | // keys and such.
120 | if (getenv('PLATFORM_PROJECT_ENTROPY') && empty($settings['hash_salt'])) {
121 | $settings['hash_salt'] = getenv('PLATFORM_PROJECT_ENTROPY');
122 | }
123 |
124 | // Set the deployment identifier, which is used by some Drupal cache systems.
125 | if (getenv('PLATFORM_TREE_ID') && empty($settings['deployment_identifier'])) {
126 | $settings['deployment_identifier'] = getenv('PLATFORM_TREE_ID');
127 | }
128 |
--------------------------------------------------------------------------------
/web/sites/development.services.yml:
--------------------------------------------------------------------------------
1 | # Local development services.
2 | #
3 | # To activate this feature, follow the instructions at the top of the
4 | # 'example.settings.local.php' file, which sits next to this file.
5 | parameters:
6 | http.response.debug_cacheability_headers: true
7 | services:
8 | cache.backend.null:
9 | class: Drupal\Core\Cache\NullBackendFactory
10 |
--------------------------------------------------------------------------------
/web/sites/example.settings.local.php:
--------------------------------------------------------------------------------
1 | ..' => 'directory'. As an
26 | * example, to map https://www.drupal.org:8080/mysite/test to the configuration
27 | * directory sites/example.com, the array should be defined as:
28 | * @code
29 | * $sites = [
30 | * '8080.www.drupal.org.mysite.test' => 'example.com',
31 | * ];
32 | * @endcode
33 | * The URL, https://www.drupal.org:8080/mysite/test/, could be a symbolic link
34 | * or an Apache Alias directive that points to the Drupal root containing
35 | * index.php. An alias could also be created for a subdomain. See the
36 | * @link https://www.drupal.org/documentation/install online Drupal installation guide @endlink
37 | * for more information on setting up domains, subdomains, and subdirectories.
38 | *
39 | * The following examples look for a site configuration in sites/example.com:
40 | * @code
41 | * URL: http://dev.drupal.org
42 | * $sites['dev.drupal.org'] = 'example.com';
43 | *
44 | * URL: http://localhost/example
45 | * $sites['localhost.example'] = 'example.com';
46 | *
47 | * URL: http://localhost:8080/example
48 | * $sites['8080.localhost.example'] = 'example.com';
49 | *
50 | * URL: https://www.drupal.org:8080/mysite/test/
51 | * $sites['8080.www.drupal.org.mysite.test'] = 'example.com';
52 | * @endcode
53 | *
54 | * @see default.settings.php
55 | * @see \Drupal\Core\DrupalKernel::getSitePath()
56 | * @see https://www.drupal.org/documentation/install/multi-site
57 | */
58 |
--------------------------------------------------------------------------------
/web/themes/.gitignore:
--------------------------------------------------------------------------------
1 | README.txt
--------------------------------------------------------------------------------
/web/themes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thinktandem/template-drupal8/e285317c85137f2c047cc14f4331771f990b5219/web/themes/.gitkeep
--------------------------------------------------------------------------------
/web/themes/custom/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thinktandem/template-drupal8/e285317c85137f2c047cc14f4331771f990b5219/web/themes/custom/.gitkeep
--------------------------------------------------------------------------------
/web/update.php:
--------------------------------------------------------------------------------
1 | handle($request);
29 | $response->send();
30 |
31 | $kernel->terminate($request, $response);
32 |
--------------------------------------------------------------------------------
/web/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
13 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
48 |
51 |
60 |
61 |
64 |
73 |
74 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------