The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class REST server with a first-class CMS on top of it. To do that, we must give Drupal a unified, powerful context system that will support smarter, context- sensitive, easily cacheable block-centric layouts and non-page responses using a robust unified plugin mechanism.
01 | function drupal_container(ContainerBuilder $reset = NULL) { |
02 | static $container = NULL; |
03 | if (isset( $reset )) { |
04 | $container = $reset ; |
05 | } |
06 | elseif (!isset( $container )) { |
07 | $container = new ContainerBuilder(); |
08 | } |
09 | return $container ; |
10 | } |
1 | $langcode = drupal_container()->get( 'language_interface' )->langcode; |
Now we can inject the language as we move other things into the container.
Eventually remove the wrapper function and inject all the things!
Benefits
Limitations
1 | function mymodule_node_access( $node , $op , $account ) { |
2 | if ( $op == 'edit' |
3 | && $node ->uid == $account ->uid |
4 | && $node ->created > (REQUEST_TIME - 3600)) { |
5 | return NODE_ACCESS_ALLOW; |
6 | } |
7 | return NODE_ACCESS_IGNORE; |
8 | } |
1 | $return = module_invoke_all( 'node_access' , $node , 'update' , $account ); |
Prediction (warning, I know better than to gamble):
Benefits
Drawbacks
We must get rid of these Arrays of Doom.
Maybe!
Benefits
Drawbacks
We could use a hand!
![]() |
Larry "Crell" Garfield | Kernel, Routing, Web services |
![]() |
Kris "EclipseGc" Vanderwater | ESI-based page layout |
![]() |
Rob Loach | Dependency Injection |
![]() |
Jen Lampton | Twig |
![]() |
Greg "heyrocker" Dunlap | YAML, Configuration |
drupal_set_message()
Response::prepare()
chaining