Posts

Showing posts from September, 2018

Composer commands

Installing composer packages behind proxy Dont try to install composer packages with sudo. export HTTPS_PROXY_REQUEST_FULLURI=false Other commands: 1. use  composer prohibits package-name to find out the dependency issue with installing that package 2. use composer info package-name to find out what other libraries that package requires If http request failing then force using https. > composer config -g repo.packagist composer https://packagist.org https://github.com/composer/composer/issues/5656#issuecomment-246103054 Install dev modules. Example: local: composer require --dev 'drupal/devel:^4.0' prod:  composer install --no-dev Install new modules: https://stackoverflow.com/questions/15212381/composer-how-can-i-install-another-dependency-without-updating-old-ones Composer cheatsheet https://devhints.io/composer In docker composer If you cant run composer https://stackoverflow.com/questions/28721699/root-password-inside-a-docker-container

PHP Compatability checker

PHPcompatability checker: https://www.drupal.org/node/2924272   https://github.com/PHPCompatibility/PHPCompatibility phpcs - p . -- standard = PHPCompatibility -- extensions = module / php , inc / php , install / php , php / php -- runtime - set testVersion 7.1

Revert a particular git commit

Assume that you commit a change, pushed and there is also a merge commit. Now you want to revert that particular commit. Do the following > git revert <that_particular_merge_hash> -m 1 This automatically creates a commit with the reverted changes. Now push again.

Configuration management in Drupal8

Better source: https://www.slideshare.net/nuvoleweb/advanced-configuration-management-with-config-split-et-al How to (in short): Create one split in local Keep it disabled Enable via config override Enable all the dev modules that you want drush cex => it will  update sync folder and respective split folder(the one which is active) Note: Next export all the configuration (with `drush cex` for drush >= 8.1.10 and `drush csex` for older versions of drush).

Set up Drupal8 development site locally from production clone

1. Dump the production db and import locally prodsite > drush sql-dump > /nonwebrootpath/prod.sql 2. Clone the code and files of production locally Assume you are making production clone site in local folder "devsite" 3. Change the sites/default/setttings.php a) change db name in  databases [ 'default' ][ 'default' ] b) 4. Create database  devsite> drush sql-create --db-url=mysql://root:mysqlpassword@localhost/test860 5. Import database devsite> drush sql-query --file=/nonwebrootpath/prod.sql 6. Clear cache devsite> drush cache-rebuild