Block diagram reduction techniques in control systems.ppt
Exploring composer in drupal 8 with drupal project - salva molina
1. EXPLORING COMPOSER IN DRUPAL 8
WITH DRUPAL-PROJECT
Salvador Molina
#DrupalCampEs
www.adevfromtheplains.com
Original talk by @isholgueras
2. Greetings!
I am Salva Molina
● Drupal Developer @ Bluespark.
● Slv_ /”self”/ in drupal.org.
● @Salva_bg on Twitter.
● https://github.com/salvamomo/.
● Rants, cries and nonsense at http://adevfromtheplains.com.
13. Vendor and autoload.php
Autoload.php
Has all registered classes and namespaces.
/vendor
Directory where libraries are stored.
<?php
// File: ./app.php
require_once “./vendor/autoload.php”
17. Drupal Composer
Working group for making Drupal work with Composer:
http://drupal-composer.org
Composer template for Drupal Projects:
https://github.com/drupal-composer/drupal-project
Drupal Project
18. What does the template do?
● Installs Drupal in the web directory.
● Alters Drupal’s default autoloader to point at the one
generated by composer, in the project root.
19. What does the template do?
Modules (packages of type drupal-module) will be placed in
web/modules/contrib/
Themes (packages of type drupal-theme) will be placed in
web/themes/contrib/
Profiles (packages of type drupal-profile) will be placed in
web/profiles/contrib/
20. What does the template do?
Creates default writable versions of settings.php and
services.yml.
Creates sites/default/files-directory.
Latest version of drush is installed locally for use at
vendor/bin/drush.
Latest version of DrupalConsole is installed locally for use at
vendor/bin/drupal.
21. In one command
composer create-project
drupal-composer/drupal-project:8.x-dev
my-project-dir
--stability dev
--no-interaction
my-project-dir
├── .gitignore
├── composer.json
├── composer.lock
├── config
├── drush
├── LICENSE
├── phpunit.xml.dist
├── README.md
├── scripts
├── vendor
└── web
30. Drupal-scaffold
Part of the “scripts” attribute in composer.json
Downloads files (index.php, update.php, etc...)
Create new ones from templates
default.settings.php -> settings.php
31. Drush policy
Avoid execution of drush pm-update
Alter drush-aliases
Avoid writing in @prod *
*Needs to be added: https://github.com/drush-ops/drush/blob/8.x/examples/policy.drush.inc
36. Cons
Much more strict than the “classical way”
Another point of failure, composer.
If github is down…
If packagist is down…
If your internet is slow...
37. Do we commit “vendor/”?
Software distribution VS software deployment.
Robustness of deployments.
Git history.
Git size.
Best practices.
Code auditing.
Does one size fit all?
38. To git...
Robustness in deployments.
Easier and more straightforward
deployments.
Proper auditing of all production code.
Clear, accessible history of code
changes.
Small amount of extra work (once) to
ensure right process for every possible
library.
Unneeded complexity increase in
deployments, with more chance for
builds to break due to external
systems.
No auditing of code changes.
A bit smaller code repository.
Or not to git?
41. SPAM
#OPHPEN_READS
A #PHP reading club in Spanish.
http://www.isholgueras.com/blog/ophpenreads-iniciamos-el-club-de-lectura-de-libros-tecnicos
https://www.youtube.com/playlist?list=PL3NN5-oQnuvrkvOrdn1hzOHIlQOe7Gk5k