7. Configuration Management
When to save configuration data?
√UI changes (automatic): When the save button is
clicked on an admin page, data gets written to the
active store as well as db.
√Code changes (manual): use
admin/config/development/sync to sync the config in
code with db and active store.
8. Configuration Management
√ Advantages:
√ No need to load the complete data from variables
table now. Use the config api to fetch only the
required configs.
√ Easier to move configurations b/w dev and
production instances.
9. Example
// Load a set of configuration out of the active store.
// 'prefix.name' refers to the filename of the .yml file, without the
extension.(prefix = module name and name = settings name)
$config = config('prefix.name');
// Access a single value out of the store.
echo $config->get('my.value');
// Change a value and save it back to both the active store and
the filesystem.
$config->set('my.value’, 'my new value');
$config->save();
10. Web Services
√ Exposes drupal content, making drupal a resful
service provider.
√ Service module in core, even better…
√ Example:
curl -i -H "Accept: application/json" --cookie SESSxxx
http://d8.dev.local/node/1
16. Mobile Initiative
√ Responsiveness for all the drupal 8 themes.
√ Decoupling of layouts and themes.
√ Drupal being resful allows creating native
apps also easier.
√ Everything is a block now.
21. Symfony Components
√ ClassLoader: Component loads your project classes
automatically if they follow some standard PHP
conventions.
√ Dependency Injection: component allows you to
standardize and centralize the way objects are
constructed in your application.
√ Event Dispatcher: component implements the
Observer pattern in a simple and effective way to
make all these things possible and to make your
projects truly extensible.
22. Symfony Components
√ HttpFoundation: Component defines an object-
oriented layer for the HTTP specification.
√ HttpKernel: notifies events to convert a Request
object to a Response one.
√ Routing: allows mapping from a URL pattern to a
controller.
√ Yaml: loads and dumps yml files used for config
management.
√ Serializer: Component is meant to be used to
turn objects into a specific format (XML, JSON,
Yaml, ...) and the other way around.
23. Symfony components
√ This component is based on the JSR-303 Bean
Validation specification and enables specifying
validation rules for classes using XML, YAML, PHP
or annotations, which can then be checked against
instances of these classes.
√ Translation provides for internationalization. Helps in
abstracting strings and other locale-specific pieces
out of your application and into a layer where they
can be translated and converted based on the
user's locale
√ The Process Component executes commands in
sub-processes.