CATEGORY: Uncategorized

Story of yarn.lock

Should you be committing yarn.lock file?

Ans: Yes

In order to understand Yes, let’s dig down a bit on story of yarn.lock file

How Yarn maintains package consistency across machines?

It’s done in 2 ways

    1. Yarn created entire dependency tree using a deterministic algorithm before downloading packages from everchanging third party packages
    2. All the info related to dependency tree is maintained in yarn.lock file so that it can be shared between every system installing the dependencies.

… To be continued

PPH Coding convention

Are you the person who has moved from JAVA to PHP and you are confused about PHP coding convention? Then this is place for you.

Following are the cases in which you define everything
1. PascalCase = ThisIsMyClass
2. camelCase = thisIsMyClass
3. lower_case = this_is_my_variable

NOTE: Difference between Pascal case and camelCase is first character of the word.

Drupal with composer – What to do and what not to do

Composer Manager allows custom/contributed modules to depend on PHP libraries managed via Composer.

Composer is a command line tool for installing PHP libraries and their dependencies on a per-project basis. These day, all libraries are registered on Packagist(You can define package dependencies here) and expect to be installed via Composer.

Use module to start using composer in your drupal 7 project.

How to install drush on ubuntu

Install drush through php pear

Upload images using $_FILES in drupal 7

MongoDB Basic Commands