16
CMI: Death of Variables revisited Roni Kantis Thursday, May 16, 13

Death of variables revisited

Embed Size (px)

Citation preview

Page 1: Death of variables revisited

CMI: Death of Variables revisitedRoni Kantis

Thursday, May 16, 13

Page 2: Death of variables revisited

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

Page 3: Death of variables revisited

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

Page 4: Death of variables revisited

Thursday, May 16, 13

Page 5: Death of variables revisited

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

Page 6: Death of variables revisited

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

Page 7: Death of variables revisited

So we killed it!- No more variable_trololoo()

- No more Features?

Thursday, May 16, 13

Page 8: Death of variables revisited

Enter Confi!uration Mana!ement Initiative (CMI)

•Confi!uration system

•Confi!Entity

•States API

Thursday, May 16, 13

Page 9: Death of variables revisited

Confi!uration system

• Automatically exportable

• Lazy loadable

• UUID in core

• Standardized API

Thursday, May 16, 13

Page 10: Death of variables revisited

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

Page 11: Death of variables revisited

How does it work?

• Object oriented approach:

• BEFORE: variable_set(‘my variable’, $data);

• NOW: $confi!->set(‘my variable’, $data)->save();

Thursday, May 16, 13

Page 12: Death of variables revisited

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

Page 13: Death of variables revisited

Ima!e.style.medium.yml

Thursday, May 16, 13

Page 14: Death of variables revisited

Confi!uration sync UI

Thursday, May 16, 13

Page 15: Death of variables revisited

Confi!uration sync UI

Thursday, May 16, 13

Page 16: Death of variables revisited

Questions?

Thursday, May 16, 13