Commit c427f2c6c446154d786a9ce7f300a7609bc69405

Authored by Terry
1 parent bea6cc2a

fixed ignore

@@ -38,7 +38,7 @@ drush-backups @@ -38,7 +38,7 @@ drush-backups
38 /.gitattributes 38 /.gitattributes
39 39
40 # Comment these lines if you don't use Composer. 40 # Comment these lines if you don't use Composer.
41 -/web/.*  
42 -/web/*.php 41 +#/web/.*
  42 +#/web/*.php
43 /web/web.config 43 /web/web.config
44 -/web/robots.txt 44 +#/web/robots.txt
  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
  1 +core/**/*
  2 +vendor/**/*
  3 +sites/**/files/**/*
  4 +libraries/**/*
  5 +sites/**/libraries/**/*
  6 +profiles/**/libraries/**/*
  7 +**/js_test_files/**/*
  8 +**/node_modules/**/*
  1 +{
  2 + "extends": "./core/.eslintrc.json"
  3 +}
  1 +<?php
  2 +
  3 +/**
  4 + * @file
  5 + * Router script for the built-in PHP web server.
  6 + *
  7 + * The built-in web server should only be used for development and testing as it
  8 + * has a number of limitations that makes running Drupal on it highly insecure
  9 + * and somewhat limited.
  10 + *
  11 + * Note that:
  12 + * - The server is single-threaded, any requests made during the execution of
  13 + * the main request will hang until the main request has been completed.
  14 + * - The web server does not enforce any of the settings in .htaccess in
  15 + * particular a remote user will be able to download files that normally would
  16 + * be protected from direct access such as .module files.
  17 + *
  18 + * The router script is needed to work around a bug in PHP, see
  19 + * https://bugs.php.net/bug.php?id=61286.
  20 + *
  21 + * Usage:
  22 + * php -S localhost:8888 .ht.router.php
  23 + *
  24 + * @see http://php.net/manual/en/features.commandline.webserver.php
  25 + */
  26 +
  27 +if (PHP_SAPI !== 'cli-server') {
  28 + // Bail out if this is not PHP's Development Server.
  29 + header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
  30 + exit;
  31 +}
  32 +
  33 +$url = parse_url($_SERVER['REQUEST_URI']);
  34 +if (file_exists(__DIR__ . $url['path'])) {
  35 + // Serve the requested resource as-is.
  36 + return FALSE;
  37 +}
  38 +
  39 +// Work around the PHP bug.
  40 +$path = $url['path'];
  41 +$script = 'index.php';
  42 +if (str_contains($path, '.php')) {
  43 + // Work backwards through the path to check if a script exists. Otherwise
  44 + // fallback to index.php.
  45 + do {
  46 + $path = dirname($path);
  47 + if (preg_match('/\.php$/', $path) && is_file(__DIR__ . $path)) {
  48 + // Discovered that the path contains an existing PHP file. Use that as the
  49 + // script to include.
  50 + $script = ltrim($path, '/');
  51 + break;
  52 + }
  53 + } while ($path !== '/' && $path !== '.');
  54 +}
  55 +
  56 +// Update $_SERVER variables to point to the correct index-file.
  57 +$index_file_absolute = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $script;
  58 +$index_file_relative = DIRECTORY_SEPARATOR . $script;
  59 +
  60 +// SCRIPT_FILENAME will point to the router script itself, it should point to
  61 +// the full path of index.php.
  62 +$_SERVER['SCRIPT_FILENAME'] = $index_file_absolute;
  63 +
  64 +// SCRIPT_NAME and PHP_SELF will either point to index.php or contain the full
  65 +// virtual path being requested depending on the URL being requested. They
  66 +// should always point to index.php relative to document root.
  67 +$_SERVER['SCRIPT_NAME'] = $index_file_relative;
  68 +$_SERVER['PHP_SELF'] = $index_file_relative;
  69 +
  70 +// Require the script and let core take over.
  71 +require $_SERVER['SCRIPT_FILENAME'];
  1 +#
  2 +# Apache/PHP/Drupal settings:
  3 +#
  4 +
  5 +# Protect files and directories from prying eyes.
  6 +<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config|yarn\.lock|package\.json)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
  7 + <IfModule mod_authz_core.c>
  8 + Require all denied
  9 + </IfModule>
  10 + <IfModule !mod_authz_core.c>
  11 + Order allow,deny
  12 + </IfModule>
  13 +</FilesMatch>
  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 +<IfModule mod_php.c>
  30 + assert.active 0
  31 +</IfModule>
  32 +
  33 +# Requires mod_expires to be enabled.
  34 +<IfModule mod_expires.c>
  35 + # Enable expirations.
  36 + ExpiresActive On
  37 +
  38 + # Cache all files for 1 year after access.
  39 + ExpiresDefault "access plus 1 year"
  40 +
  41 + <FilesMatch \.php$>
  42 + # Do not allow PHP scripts to be cached unless they explicitly send cache
  43 + # headers themselves. Otherwise all scripts would have to overwrite the
  44 + # headers set by mod_expires if they want another caching behavior. This may
  45 + # fail if an error occurs early in the bootstrap process, and it may cause
  46 + # problems if a non-Drupal PHP file is installed in a subdirectory.
  47 + ExpiresActive Off
  48 + </FilesMatch>
  49 +</IfModule>
  50 +
  51 +# Set a fallback resource if mod_rewrite is not enabled. This allows Drupal to
  52 +# work without clean URLs. This requires Apache version >= 2.2.16. If Drupal is
  53 +# not accessed by the top level URL (i.e.: http://example.com/drupal/ instead of
  54 +# http://example.com/), the path to index.php will need to be adjusted.
  55 +<IfModule !mod_rewrite.c>
  56 + /index.php
  57 +</IfModule>
  58 +
  59 +# Various rewrite rules.
  60 +<IfModule mod_rewrite.c>
  61 + RewriteEngine on
  62 +
  63 + # Set "protossl" to "s" if we were accessed via https://. This is used later
  64 + # if you enable "www." stripping or enforcement, in order to ensure that
  65 + # you don't bounce between http and https.
  66 + RewriteRule ^ - [E=protossl]
  67 + RewriteCond %{HTTPS} on
  68 + RewriteRule ^ - [E=protossl:s]
  69 +
  70 + # Make sure Authorization HTTP header is available to PHP
  71 + # even when running as CGI or FastCGI.
  72 + RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  73 +
  74 + # Block access to "hidden" directories whose names begin with a period. This
  75 + # includes directories used by version control systems such as Subversion or
  76 + # Git to store control files. Files whose names begin with a period, as well
  77 + # as the control files used by CVS, are protected by the FilesMatch directive
  78 + # above.
  79 + #
  80 + # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
  81 + # not possible to block access to entire directories from .htaccess because
  82 + # <DirectoryMatch> is not allowed here.
  83 + #
  84 + # If you do not have mod_rewrite installed, you should remove these
  85 + # directories from your webroot or otherwise protect them from being
  86 + # downloaded.
  87 + RewriteRule "/\.|^\.(?!well-known/)" - [F]
  88 +
  89 + # If your site can be accessed both with and without the 'www.' prefix, you
  90 + # can use one of the following settings to redirect users to your preferred
  91 + # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  92 + #
  93 + # To redirect all users to access the site WITH the 'www.' prefix,
  94 + # (http://example.com/foo will be redirected to http://www.example.com/foo)
  95 + # uncomment the following:
  96 + # RewriteCond %{HTTP_HOST} .
  97 + # RewriteCond %{HTTP_HOST} !^www\. [NC]
  98 + # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  99 + #
  100 + # To redirect all users to access the site WITHOUT the 'www.' prefix,
  101 + # (http://www.example.com/foo will be redirected to http://example.com/foo)
  102 + # uncomment the following:
  103 + # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  104 + # RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
  105 +
  106 + # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  107 + # VirtualDocumentRoot and the rewrite rules are not working properly.
  108 + # For example if your site is at http://example.com/drupal uncomment and
  109 + # modify the following line:
  110 + # RewriteBase /drupal
  111 + #
  112 + # If your site is running in a VirtualDocumentRoot at http://example.com/,
  113 + # uncomment the following line:
  114 + # RewriteBase /
  115 +
  116 + # Redirect common PHP files to their new locations.
  117 + RewriteCond %{REQUEST_URI} ^(.*)?/(install\.php) [OR]
  118 + RewriteCond %{REQUEST_URI} ^(.*)?/(rebuild\.php)
  119 + RewriteCond %{REQUEST_URI} !core
  120 + RewriteRule ^ %1/core/%2 [L,QSA,R=301]
  121 +
  122 + # Rewrite install.php during installation to see if mod_rewrite is working
  123 + RewriteRule ^core/install\.php core/install.php?rewrite=ok [QSA,L]
  124 +
  125 + # Pass all requests not referring directly to files in the filesystem to
  126 + # index.php.
  127 + RewriteCond %{REQUEST_FILENAME} !-f
  128 + RewriteCond %{REQUEST_FILENAME} !-d
  129 + RewriteCond %{REQUEST_URI} !=/favicon.ico
  130 + RewriteRule ^ index.php [L]
  131 +
  132 + # For security reasons, deny access to other PHP files on public sites.
  133 + # Note: The following URI conditions are not anchored at the start (^),
  134 + # because Drupal may be located in a subdirectory. To further improve
  135 + # security, you can replace '!/' with '!^/'.
  136 + # Allow access to PHP files in /core (like authorize.php or install.php):
  137 + RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
  138 + # Allow access to test-specific PHP files:
  139 + RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?\.php
  140 + # Allow access to Statistics module's custom front controller.
  141 + # Copy and adapt this rule to directly execute PHP files in contributed or
  142 + # custom modules or to run another PHP application in the same directory.
  143 + RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics\.php$
  144 + # Deny access to any other PHP files that do not match the rules above.
  145 + # Specifically, disallow autoload.php from being served directly.
  146 + RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
  147 +
  148 + # Rules to correctly serve gzip compressed CSS and JS files.
  149 + # Requires both mod_rewrite and mod_headers to be enabled.
  150 + <IfModule mod_headers.c>
  151 + # Serve gzip compressed CSS files if they exist and the client accepts gzip.
  152 + RewriteCond %{HTTP:Accept-encoding} gzip
  153 + RewriteCond %{REQUEST_FILENAME}\.gz -s
  154 + RewriteRule ^(.*css_[a-zA-Z0-9-_]+)\.css$ $1\.css\.gz [QSA]
  155 +
  156 + # Serve gzip compressed JS files if they exist and the client accepts gzip.
  157 + RewriteCond %{HTTP:Accept-encoding} gzip
  158 + RewriteCond %{REQUEST_FILENAME}\.gz -s
  159 + RewriteRule ^(.*js_[a-zA-Z0-9-_]+)\.js$ $1\.js\.gz [QSA]
  160 +
  161 + # Serve correct content types, and prevent double compression.
  162 + RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
  163 + RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
  164 +
  165 + <FilesMatch "(\.js\.gz|\.css\.gz)$">
  166 + # Serve correct encoding type.
  167 + Header set Content-Encoding gzip
  168 + # Force proxies to cache gzipped & non-gzipped css/js files separately.
  169 + Header append Vary Accept-Encoding
  170 + </FilesMatch>
  171 + </IfModule>
  172 +</IfModule>
  173 +
  174 +# Various header fixes.
  175 +<IfModule mod_headers.c>
  176 + # Disable content sniffing for all responses, since it's an attack vector.
  177 + # This header is also set in FinishResponseSubscriber, which depending on
  178 + # Apache configuration might get placed in the 'onsuccess' table. To prevent
  179 + # header duplication, unset that one prior to setting in the 'always' table.
  180 + # See "To circumvent this limitation..." in
  181 + # https://httpd.apache.org/docs/current/mod/mod_headers.html.
  182 + Header onsuccess unset X-Content-Type-Options
  183 + Header always set X-Content-Type-Options nosniff
  184 + # Disable Proxy header, since it's an attack vector.
  185 + RequestHeader unset Proxy
  186 +</IfModule>
  1 +<?php
  2 +
  3 +/**
  4 + * @file
  5 + * Includes the autoloader created by Composer.
  6 + *
  7 + * This file was generated by drupal-scaffold.
  8 + *
  9 + * @see composer.json
  10 + * @see index.php
  11 + * @see core/install.php
  12 + * @see core/rebuild.php
  13 + */
  14 +
  15 +return require __DIR__ . '/../vendor/autoload.php';
  1 +<?php
  2 +
  3 +/**
  4 + * @file
  5 + * The PHP page that serves all page requests on a Drupal installation.
  6 + *
  7 + * All Drupal code is released under the GNU General Public License.
  8 + * See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
  9 + */
  10 +
  11 +use Drupal\Core\DrupalKernel;
  12 +use Symfony\Component\HttpFoundation\Request;
  13 +
  14 +$autoloader = require_once 'autoload.php';
  15 +
  16 +$kernel = new DrupalKernel('prod', $autoloader);
  17 +
  18 +$request = Request::createFromGlobals();
  19 +$response = $kernel->handle($request);
  20 +$response->send();
  21 +
  22 +$kernel->terminate($request, $response);
  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.md
  41 +Disallow: /composer/Metapackage/README.txt
  42 +Disallow: /composer/Plugin/ProjectMessage/README.md
  43 +Disallow: /composer/Plugin/Scaffold/README.md
  44 +Disallow: /composer/Plugin/VendorHardening/README.txt
  45 +Disallow: /composer/Template/README.txt
  46 +Disallow: /modules/README.txt
  47 +Disallow: /sites/README.txt
  48 +Disallow: /themes/README.txt
  49 +Disallow: /web.config
  50 +# Paths (clean URLs)
  51 +Disallow: /admin/
  52 +Disallow: /comment/reply/
  53 +Disallow: /filter/tips
  54 +Disallow: /node/add/
  55 +Disallow: /search/
  56 +Disallow: /user/register
  57 +Disallow: /user/password
  58 +Disallow: /user/login
  59 +Disallow: /user/logout
  60 +Disallow: /media/oembed
  61 +Disallow: /*/media/oembed
  62 +# Paths (no clean URLs)
  63 +Disallow: /index.php/admin/
  64 +Disallow: /index.php/comment/reply/
  65 +Disallow: /index.php/filter/tips
  66 +Disallow: /index.php/node/add/
  67 +Disallow: /index.php/search/
  68 +Disallow: /index.php/user/password
  69 +Disallow: /index.php/user/register
  70 +Disallow: /index.php/user/login
  71 +Disallow: /index.php/user/logout
  72 +Disallow: /index.php/media/oembed
  73 +Disallow: /index.php/*/media/oembed
  1 +<?php
  2 +
  3 +/**
  4 + * @file
  5 + * The PHP page that handles updating the Drupal installation.
  6 + *
  7 + * All Drupal code is released under the GNU General Public License.
  8 + * See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
  9 + */
  10 +
  11 +use Drupal\Core\Update\UpdateKernel;
  12 +use Symfony\Component\HttpFoundation\Request;
  13 +
  14 +$autoloader = require_once 'autoload.php';
  15 +
  16 +// Disable garbage collection during test runs. Under certain circumstances the
  17 +// update path will create so many objects that garbage collection causes
  18 +// segmentation faults.
  19 +if (drupal_valid_test_ua()) {
  20 + gc_collect_cycles();
  21 + gc_disable();
  22 +}
  23 +
  24 +$kernel = new UpdateKernel('prod', $autoloader, FALSE);
  25 +$request = Request::createFromGlobals();
  26 +
  27 +$response = $kernel->handle($request);
  28 +$response->send();
  29 +
  30 +$kernel->terminate($request, $response);
Please register or login to post a comment