Skip to main content

Posts

Drupal Caching Part 2

 Redis :  Redis is an open source, advanced key-value store and an apt solution for building highperformance, scalable web applications. Redis holds its database entirely in the memory, using the disk only for persistence. Command to connect to remote server :  $ redis-cli -h host -p port -a password get,set,del are the command commands of redis, redis 127.0.0.1:6379> ping Where 6379 is the default port of the redis

Logical Interview Question

 1. How to Swap two variables, With or without the third variable & inbuild function. This method will work for any variable type: $a = 5 ; $b = 6 ; list ($a, $b) = array ($b, $a); print $a . ',' . $b; // 6,5 Another simple way (which only works for numbers, not strings/arrays/etc) is $a = $a + $b; // 5 + 6 = 11 $b = $a - $b; // 11 - 6 = 5 $a = $a - $b; // 11 - 5 = 6 print $a . ',' . $b; // 6,5

How to Enable/Disable module Manually

Execute this code Anyhow on the server to uninstall module  // Read the configuration. $module_data = \Drupal::config('core.extension')->get('module'); // Unset the modules you do not need. unset($module_data['MODULE_NAME']); // Write the configuration. \Drupal::configFactory()->getEditable('core.extension')->set('module', $module_data)->save(); Another Way: <?php   \Drupal::service('module_installer')->install(['admin_toolbar']); ?> <?php   \Drupal::service('module_installer')->uninstall(['admin_toolbar']); ?> Delete config: \Drupal::configFactory()->getEditable('contact.form.personal')->delete();

Deign Pattern in Drupal

 What are Design Patterns in General: Description of communicating objects and classes that are customized to solve a general problem in a particular way. Why design pattern required: 1 - Design pattern help to speed up the development, 2 - The templates are proven and from the developer's position, the Only implementation is required 3- Encapsulate big ideas in a simpler way 4 -  Each pattern describes a problem which occurs over & over again, Design Pattern Inforces SOLID Principles: SOLID is an acronym that stands for the following: S ingle responsibility principle O pen/closed principle L iskov substitution principle I nterface segregation principle D ependency inversion principle Categorization of GOF(Gang of Four Design Patterns) - Creation - Used to construct objects such that they can be decoupled from their implementation system. i.e in one class, we put business logic & in another class create the instance of it. - Structural - Used to form large object str...

Acquia BLT setup With Lando

 Install the latest version of Lando. navigate to directory & create a project directory. 1 - mkdir lando-d8 & cd lando-d8 2 - lando init (choose anything later we will change the config) One lando.yml file will be create in the directory change the config as below, name : lando - lightning recipe : drupal8 config : webroot : lightning/docroot tooling : blt : service : appserver cmd : /usr/bin/blt Can change the name, lando start lando composer create-project --no-interaction acquia/blt-project lightning cd lightning Follow the Document :  https://thinktandem.io/blog/2017/12/09/lando-blt-acquia/ After the drupal install & can login in drupal: Now the Basic Processudre is to deployment in git & acquia, Before you can either connect to your Git code repository or use SSH to sign in to your web server, you must have an SSH private/public key pairGenerate keys in system by following URL: https://docs.acquia.com/cloud-platform/manage/ssh/genera...

Acquia BLT (Build and Launch Tool)

  To improve efficiency and collaboration across Drupal projects, Acquia BLT provides both a common suite of tools and standardized structure. The tools and structure will help developers reduce incidents of duplicated work, speed up project configuration, and onboard new developers faster. Using Acquia BLT for your Drupal projects will help you meet the following goals during your development cycles: Provide a standard project template for Drupal based projects Provide tools automating the configuration and maintenance work for projects Document and enforce Drupal standards and best practices through default configuration, automated testing, and continuous integration Features Acquia BLT offers the following features for your organization’s use: Local Git hooks : Evaluate formatting, syntax, and compliance with Drupal coding standards. Testing frameworks : Provides default configurations for Behat and PHPUnit. Project automation tasks : Includes commands for syncing environments, ...