Upload
roni-kantis
View
218
Download
1
Tags:
Embed Size (px)
Citation preview
CMI: Death of Variables revisitedRoni Kantis
Thursday, May 16, 13
Roni Kantisdrupal.or!: bfr@roni_kantis
Druid Oy@druidfi
Drupal Meetup Finland14.6.2013
Program: Sauna, terva and kossu.
Generously sponsored by the association and KW Digital.
druid.fi/meetup
Thursday, May 16, 13
Current state of confi!uration• 95% of Drupal development is done throu!h UI
• Scattered throu!hout the database
• Variable table
• Custom tables and entities
• No standard format
• No API
Thursday, May 16, 13
Thursday, May 16, 13
Features -module " Features is not a reliable way to deploy confi!uration
chan!es. It was never meant to be. "
- Tim Plunkett
Thursday, May 16, 13
Problems with variables
• No standardized way to move between environments
• Cumbersome to mana!e environment specific confi!uration
• Loaded on every request
Thursday, May 16, 13
So we killed it!- No more variable_trololoo()
- No more Features?
Thursday, May 16, 13
Enter Confi!uration Mana!ement Initiative (CMI)
•Confi!uration system
•Confi!Entity
•States API
Thursday, May 16, 13
Confi!uration system
• Automatically exportable
• Lazy loadable
• UUID in core
• Standardized API
Thursday, May 16, 13
Content vs confi!uration
• Can you !ive it a default value?
• Would it benefit si!nifically from direct sql-queries?
• Is it environment specific?
Thursday, May 16, 13
How does it work?
• Object oriented approach:
• BEFORE: variable_set(‘my variable’, $data);
• NOW: $confi!->set(‘my variable’, $data)->save();
Thursday, May 16, 13
How does it work?• Confi!uration locations:
• sites/default/files/confi!_{hash}/active
• sites/default/files/confi!_{hash}/sta!in!
• Confi!uration files:
• manifest.ima!e.styles.yml
• ima!e.settin!s.yml
• ima!e.style.medium.yml
Thursday, May 16, 13
Ima!e.style.medium.yml
Thursday, May 16, 13
Confi!uration sync UI
Thursday, May 16, 13
Confi!uration sync UI
Thursday, May 16, 13
Questions?
Thursday, May 16, 13