Posts

Showing posts from November, 2017

Drupal general concepts that you should know

Image
namespace: In simple terms,  think of a namespace as a person's surname . If there are two people named "John" you can use their surnames to tell them apart. https://stackoverflow.com/questions/3384204/what-are-namespaces Solve the issues of resuable code such as classes or functions. namespace example: the file  foo.txt  can exist in both directory  /home/greg  and in  /home/other , but two copies of  foo.txt  cannot co-exist in the same directory. In addition, to access the  foo.txt  file outside of the  /home/greg  directory, we must prepend the directory name to the file name using the directory separator to get  /home/greg/foo.txt . This same principle extends to namespaces in the programming world. Avoids namespace collisions Name collisions example:  you create a function named db_connect, and somebody elses code that you use in your file (i.e. an include) has the same functio...

Install Drush 8.x on Ubuntu 16.04

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"  mv composer.phar /usr/local/bin/composer composer vim ~/.bashrc Add this => export PATH="$HOME/.composer/vendor/bin:$PATH" and ~/.bashrc source  ~/.bashrc composer global require drush/drush:8.x drush --version drush 7 version install ================ composer global require  drush / drush :7.1.0  export PATH="/root/.composer/vendor/b in:$PATH"