Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

7.3. Անջատել Drupal-ի քեշը։ Արտածել վրիպազերծման տեղեկատվությունը ձևանմուշում։

19/04/2025, by Ivan

Menu

Նախքան սկսելը Drupal 8-ի վրա աշխատել, անհրաժեշտ է անջատել քեշը։ Ի տարբերություն Drupal 7-ի՝ ութերորդ տարբերակում քեշավորվում են ոչ միայն էակները (entities), դիտումները (views), և դաշտերը (fields), այլ նաև Twig-ով կազմված և render եղած բոլոր կաղապարները։ Այս ամենը անջատելու համար անհրաժեշտ է կատարել հետևյալ քայլերը։

1. Պատճենեք /sites/example.settings.local.php ֆայլը որպես /sites/default/settings.local.php

Այս ֆայլում արդեն պարունակվում են անհրաժեշտ պարամետրեր՝ քեշը անջատելու համար։

settings

2. settings.php ֆայլում մեկնաբանություններից հանեք հետևյալ տողերը՝ settings.local.php-ը միացնելու համար՝

if (file_exists(__DIR__ . '/settings.local.php')) {
  include __DIR__ . '/settings.local.php';
}

Սա կակտիվացնի settings.local.php-ը։

3. Ստուգեք, որ settings.local.php-ում մեկնաբանված չլինի հետևյալ տողը՝

$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';

development.services.yml ֆայլը արդեն առկա է, պարզապես անհրաժեշտ է ներառել այն։

4. Ստուգեք նաև, որ settings.local.php-ում անջատված լինի CSS և Javascript-ի ագրեգացիան՝

$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;

5. Անհրաժեշտ է նաև անջատել HTML-ի վիզուալ քեշը և Dynamic Page Cache մոդուլի քեշը՝

$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';

Գտեք այս տողերը settings.local.php-ում և մեկնաբանություններից հանեք։

6. Որպեսզի Drupal-ը չփորձի ներմուծել թեստեր մոդուլներից, այս պարամետրի արժեքը դարձրեք FALSE՝

$settings['extension_discovery_scan_tests'] = FALSE;

7. Այժմ /sites/development.services.yml ֆայլում անհրաժեշտ է ավելացնել հետևյալ բաժինը՝

parameters:
  twig.config:
    debug: true
    auto_reload: true
    cache: false

Արդյունքում, development.services.yml-ը կդիտվի այսպես՝

# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory
   
parameters:
  http.response.debug_cacheability_headers: true
  twig.config:
    debug: true
    auto_reload: true
    cache: false

Շատ կարևոր է պահպանել տողաբաժանումները և քաշումները yml ֆայլերում։ Օգտագործեք միայն 2 բացատ՝ առանց tab-ի։

debug: true

Այս տողը պատասխանատու է էջում օգտագործված template-ների վերագրանցման հնարավոր անունները ցուցադրելու համար։ Երբեմն դա կարող է խախտել դասավորությունը կամ սխալ առաջացնել որոշ մոդուլներում, սակայն շատ հազվադեպ։ Core-ում սա շատ հարմար գործիք է՝ Drupal 8-ում template-ների կառուցվածքը ուսումնասիրելու համար։

8. Դրանից հետո անհրաժեշտ է մաքրել քեշը՝ օգտագործելով drush՝

drush cr

Կամ այցելեք հետևյալ հասցեն՝

http://yoursite/core/rebuild.php