- From within the vagrant box run
sudo apt-get install nfs-kernel-server
- Then we need to make the entries for the files to host via NFS for which we need to do the following
sudo vi /etc/exports
The above step will open this file in write mode then add the following lines at the end of this file and save it.
/home/vagrant/web/curemint *(rw,async,insecure,all_squash,anonuid=1000,anongid=1000)
/tmp *(rw,async,insecure,all_squash,anonuid=1000,anongid=1000)
- The we need to restart the nfs kerner server service.
sudo service nfs-kernel-service reload
- From within the vagrant box run
sudo apt-get install samba
- Then we need to make the entries for the files to host via NFS for which we need to do the following
sudo vi /etc/samba/smb.conf
The above step will open this file in write mode then add the following lines at the end of this file and save it.
; ###start-curemint-share###
[curemint]
comment = /home/vagrant/web/curemint
path = /home/vagrant/web/curemint
public = yes
browsable = yes
writable = yes
guest ok = yes
force user = vagrant
force group = vagrant
force create mode = 0644
force directory mode = 0755
map to guest = Bad Password
guest account = nobody
[tmp]
comment = /tmp
path = /tmp
public = yes
browsable = yes
writable = yes
guest ok = yes
force user = vagrant
force group = vagrant
force create mode = 0644
force directory mode = 0755
map to guest = Bad Password
guest account = nobody
; ###end-curemint-share###
- Then restart the Samba service by
sudo service smbd restart
- Installing the bcmath library
sudo apt-get install php7.1-bcmath
- Installing curl library
sudo apt-get install curl
- Firstly we need to install rvm which stands for ruby version manager. For which we need to run the following commands in the defined sequence
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io -o rvm.sh
cat rvm.sh | bash -s stable
source ~/.rvm/scripts/rvm
- To confirm rvm is installed run
rvm --version
- When we have successfully installed rvm then we go ahead and install ruby
rvm install ruby --default
- To check whether ruby is installed run
ruby -v
- When we have successfully installed ruby then lets go ahead and install compass by running the following commands in sequence.
gem update --system
gem install compass
- Installing SASS linter
gem install scss_lint
For more info on how to use it and integrate with your code editor visit https://github.com/brigade/scss-lint
- We will be setting up code sniffer gloabally. So from within the vagrant box run
composer global require drupal/coder
- To confirm we have the drupal/coder package in the global interface run
composer global show -P
- To make the phpcs and phpcbf commands globally available we need to add the path variable to out .bashrc file. For this perform the following steps:
sudo vi ~/.bashrc
This will open the .bashrc file in write mode. Then at the end of the file add the following line
export PATH="$PATH:$HOME/.composer/vendor/bin"
Then we need to reload the newly added configurations to the ~/.bashrc file. For this we need to run this
source ~/.bashrc
- To make sure we have php code sniffer installed run
phpcs -i
this will tell us what all predefined standard it is installed with, but among those standard we do not find Drupal and DrupalPractice. To install these standards follow the next step.
- To install the Drupal and DrupalPractice standard run
composer global require dealerdirect/phpcodesniffer-composer-installer
-
Now when we run
phpcs -i
then we will be able to see the Drupal and Drupal Practice standards in place. -
Now we need to add the aliases for the drupal code standard specific sniffer. For this again we need to go to the ~/.bashrc file. So open this file in write mode by runninh
sudo vi ~/.bashrc
. After this at the end of the file add the following lines and save this file.
alias drupalcs="phpcs --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md' --ignore='node_modules,bower_components,vendor'"
alias drupalcsp="phpcs --standard=DrupalPractice --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md'"
alias drupalcbf="phpcbf --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md'"