-
Intro
- Rules D7
- Success story
- History
- Use cases
-
d8rules initiative
- goals
- funding
- sprints
- status
-
Rules D8
- * Applying new architectural patterns in Drupal 8
- * Understanding the Core Plug-in & Context systems
- * CMI: Configuration entities and YAML files
- * Rules API Changes
- * Typed data & Entity API changes
- * Using Rules Action, Condition & Event APIs
- * Embedding reusable components: Use rules conditions in the Blocks UI
- * Contributing to Rules in Drupal 8
-
Architecture
- https://www.drupal.org/node/1211396#comment-8636745
- https://www.drupal.org/node/2245611
-
From 7 to 8
- https://docs.google.com/document/d/1gTDGja1KU68QT2m_aB0c8G2nlNEAyWeJqG1a0nBJHwA/edit
-
Practice
-
Setting up the environment
- http://thefubhy.gitbooks.io/rules/content/contributing/environment.html
- LAMP, Drupal 8
-
Drush
-
Mamp + drush
- https://www.drupal.org/node/1651282
- GitHub, fork, pull requests
- Enable Rules
-
Code
-
Plugin
- pieces of functionality that are swappable
- Plugins that perform similar functionality are of the same plugin type
- d7: ctools plug-ins, rules plug-ins, ...
- d8: all fancy
- http://www.palantir.net/presentations/dcamsterdam2014-d8-crash-course/#/11/2
-
Annotation
-
res
- http://www.slideshare.net/rdohms/annotations-in-php-they-exist
- Add metadata to classes, methods, properties
-
Examples
- Marking classes/methods as accessible via webservice
- Marking methods as unit test methods
- Automate dependency injection
-
no php support
- docblocks != comments
-
why
- Annotations allow for complex structured data
- you can indicate that certain strings are to be translated
- performance bonus
- files don't have to be php-included / classes don't have to be loaded
- syntax taken from doctrine
-
Auto-loading
-
PSR-4
- https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
- \<NamespaceName>(\<SubNamespaceNames>)*\<ClassName>
- To register your plugin, put a file in a folder relative to your Drupal module root: src/Plugin/$plugin_type/Example.php
-
Drupaldocs Annotations-based plugins
- https://www.drupal.org/node/1882526
-
Context
-
Use Context system for actions (core -> d8rules)
- https://www.drupal.org/node/2011038
- Engine
- Entity
- Tests
-
More
-
Plug-ins
-
derivative
- Create or delete any URL alias
- Create or delete a content's URL alias (node_path_alias) -> derivative
-
discovery
- StaticDiscovery
- StaticDiscovery allows for direct registration of plugins within the discovery class itself. A protected variable ($definitions) in the class holds all plugin definitions that are registered with it through the public method setDefinition(). Any plugin defined through this method can then be invoked as outlined in the plugin manager documentation.
- HookDiscovery
- The HookDiscovery class allows Drupal's hook_component_info()/hook_component_info_alter() pattern to be used for plugin discovery. With this discovery, the plugin manager will invoke info hooks to retrieve a list of available plugins.
- AnnotatedClassDiscovery
- The AnnotatedClassDiscovery class uses name of the annotations that contains the plugin definition, e.g., @Plugin, @EntityType, in plugin docblocks to discover plugins, minimizing memory usage during the discovery phase. The AnnotatedClassDiscovery class takes an argument in its constructor, $subdir, which specifies the sub-directory/sub-namespace for this plugin type. The AnnotatedClassDiscovery class scans PSR-0 classes inside those sub-directories of Plugin folders to find plugins.
- YamlDiscovery
- YamlDiscovery allows plugins to de be defined in yaml files. Drupal core uses this for local tasks and local actions.
- https://www.drupal.org/node/1638040
-
Traits
-
example
- https://www.drupal.org/node/2079611
- "Traits are simply compiler-assistet copy/paste (Rasmus Lerdorf)
- Controllers
- routing
- CMI, schema
-
services, services.yml
- manager
-
Guidelines
- http://www.palantir.net/presentations/dcamsterdam2014-d8-crash-course/#/14/1
-
Interfaces
- TypeHinting
- Exceptions
- Namespaces
-
OOP
- https://amsterdam2014.drupal.org/session/oop-drupal-developers