SlideShare una empresa de Scribd logo
1 de 25
Drupal 7 routing
● based on path only (menu_get_item($path))
● tied up with menu links (tables menu_router,
menu_links)
menu_rebuild()
● This function will clear and populate the
{menu_router} table, add entries to {menu_links}
for new router items, and then remove stale
items from {menu_links}. If called from
update.php or install.php, it will also schedule a
call to itself on the first real page load from
menu_execute_active_handler(), because the
maintenance page environment is different and
leaves stale data in the menu tables.
Drupal 7 routing
● hook_menu()
Drupal 7 routing
● hook_menu_alter()
Drupal 8 routing
● mymodule.routing.yml
●
●
●
{router} database table, route_set =
<modulename>
Dynamic routes
● Subscriber reacting on
RoutingEvents::DYNAMIC event
●
●
●
●
●
●
{router} table, route_set = dynamic_routes
Drupal 8 meets Symfony routing
● RouterListener subscriber (core.services.yml)
● RouterListener::onKernelRequest() sets
attributes to request object using matcher
Routing
● RouterListener::onKernelRequest()
Routing ChainRouter
router.dynamic internals
● RouteProvider – fetch all records from {router}
table filtering by pattern_outline,
● NestedMatcher:
– MimeTypeMatcher
– UrlMatcher:
● prefix
● regex (example #^/node$#s)
● host regex
● http method
● http scheme (http or https)
legacy_router internals
● NullGenerator
● LegacyUrlMatcher
– menu_get_item($path)
– Convert it to Route
● _controller is callback function name
● hook_menu 'file' got included
REST in core
● New Entity API with field metadata
● REST API support can be enabled for any
entity known to the system
● Access control on the entity level
● Access control on the field level
Modules
● Serialization
● REST
● HAL
Retrieve a node (decoded)
Resource plugin
● DrupalmodulenamePluginrestresource
● Annotation with id and description
● Each http method as class method (get, post,
delete, patch ...)
Resource plugin
Serialization
Normalizers
● ImageItemNormalizer
● EntityReferenceNormalizer
● FieldItemNormalizer
● FieldNormalizer
● EntityNormalizer
Serialization
CSRF protection
● Each non-safe REST call (not GET, HEAD,
OPTIONS, TRACE methods) should be done
with 'X-CSRF-Token' header with token.
Services in Drupal 8
● Own plugin (extends Resource from REST)
● Each method as own route (not tied with http
method names)
● Use annotations to describe your routes
Services example
Authentication (in progress)
● https://drupal.org/node/1890878
● No more dependent on Cookie Session
● Authentication Providers
● Multiple authentication providers – 400 Bad
Request
● Access check if authenticaion provider allowed
Thanks
● Larry Garfield @Crell
● Lin Clark @linclark
● Klaus Purer @_klausi_
● WSCCI team
Links
● https://groups.drupal.org/wscci
● https://portland2013.drupal.org/session/rest-
and-serialization-drupal-8

Más contenido relacionado

La actualidad más candente

02 programmation mobile - android - (activity, view, fragment)
02 programmation mobile - android - (activity, view, fragment)02 programmation mobile - android - (activity, view, fragment)
02 programmation mobile - android - (activity, view, fragment)
TECOS
 
Database Connection With Mysql
Database Connection With MysqlDatabase Connection With Mysql
Database Connection With Mysql
Harit Kothari
 
Using php with my sql
Using php with my sqlUsing php with my sql
Using php with my sql
salissal
 

La actualidad más candente (20)

Cake PHP 3 Presentaion
Cake PHP 3 PresentaionCake PHP 3 Presentaion
Cake PHP 3 Presentaion
 
PHP - Getting good with MySQL part II
 PHP - Getting good with MySQL part II PHP - Getting good with MySQL part II
PHP - Getting good with MySQL part II
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Php classes in mumbai
Php classes in mumbaiPhp classes in mumbai
Php classes in mumbai
 
Dicoding Developer Coaching #20: Android | Apa itu Content Provider?
Dicoding Developer Coaching #20: Android | Apa itu Content Provider?Dicoding Developer Coaching #20: Android | Apa itu Content Provider?
Dicoding Developer Coaching #20: Android | Apa itu Content Provider?
 
System performance tuning
System performance tuningSystem performance tuning
System performance tuning
 
Ajax
AjaxAjax
Ajax
 
Java EE 6
Java EE 6Java EE 6
Java EE 6
 
XamarinとAWSをつないでみた話
XamarinとAWSをつないでみた話XamarinとAWSをつないでみた話
XamarinとAWSをつないでみた話
 
02 programmation mobile - android - (activity, view, fragment)
02 programmation mobile - android - (activity, view, fragment)02 programmation mobile - android - (activity, view, fragment)
02 programmation mobile - android - (activity, view, fragment)
 
lab56_db
lab56_dblab56_db
lab56_db
 
Introduction to php database connectivity
Introduction to php  database connectivityIntroduction to php  database connectivity
Introduction to php database connectivity
 
Database Connection With Mysql
Database Connection With MysqlDatabase Connection With Mysql
Database Connection With Mysql
 
Android Data Persistence
Android Data PersistenceAndroid Data Persistence
Android Data Persistence
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
 
Modularity and Layered Data Model
Modularity and Layered Data ModelModularity and Layered Data Model
Modularity and Layered Data Model
 
servlets and jsp
servlets and jspservlets and jsp
servlets and jsp
 
Spring 3.0
Spring 3.0Spring 3.0
Spring 3.0
 
PDO Basics - PHPMelb 2014
PDO Basics - PHPMelb 2014PDO Basics - PHPMelb 2014
PDO Basics - PHPMelb 2014
 
Using php with my sql
Using php with my sqlUsing php with my sql
Using php with my sql
 

Similar a что нового в мире Services

Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
camp_drupal_ua
 
External Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLExternal Language Stored Procedures for MySQL
External Language Stored Procedures for MySQL
Antony T Curtis
 
Serverless Apps - droidcon london 2012
Serverless Apps - droidcon london 2012Serverless Apps - droidcon london 2012
Serverless Apps - droidcon london 2012
Friedger Müffke
 

Similar a что нового в мире Services (20)

A deep dive into Drupal 8 routing
A deep dive into Drupal 8 routingA deep dive into Drupal 8 routing
A deep dive into Drupal 8 routing
 
13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS 13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS
 
Drupal 8 migrate!
Drupal 8 migrate!Drupal 8 migrate!
Drupal 8 migrate!
 
Session 2- day 3
Session 2- day 3Session 2- day 3
Session 2- day 3
 
Php
PhpPhp
Php
 
Php
PhpPhp
Php
 
Built-in query caching for all PHP MySQL extensions/APIs
Built-in query caching for all PHP MySQL extensions/APIsBuilt-in query caching for all PHP MySQL extensions/APIs
Built-in query caching for all PHP MySQL extensions/APIs
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
 
Services Drupalcamp Stockholm 2009
Services Drupalcamp Stockholm 2009Services Drupalcamp Stockholm 2009
Services Drupalcamp Stockholm 2009
 
How to Create and Load Model in Laravel
How to Create and Load Model in LaravelHow to Create and Load Model in Laravel
How to Create and Load Model in Laravel
 
Server Side Rendering with Nuxt.js
Server Side Rendering with Nuxt.jsServer Side Rendering with Nuxt.js
Server Side Rendering with Nuxt.js
 
Memphis php 01 22-13 - laravel basics
Memphis php 01 22-13 - laravel basicsMemphis php 01 22-13 - laravel basics
Memphis php 01 22-13 - laravel basics
 
External Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLExternal Language Stored Procedures for MySQL
External Language Stored Procedures for MySQL
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3
 
Drupal 8 Hooks
Drupal 8 HooksDrupal 8 Hooks
Drupal 8 Hooks
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes
 
Serverless Apps - droidcon london 2012
Serverless Apps - droidcon london 2012Serverless Apps - droidcon london 2012
Serverless Apps - droidcon london 2012
 
Zend Framework 2 - Basic Components
Zend Framework 2  - Basic ComponentsZend Framework 2  - Basic Components
Zend Framework 2 - Basic Components
 
REST API with CakePHP
REST API with CakePHPREST API with CakePHP
REST API with CakePHP
 
Clean code and refactoring
Clean code and refactoringClean code and refactoring
Clean code and refactoring
 

Más de DrupalCamp Kyiv Рысь

система управления конфигурацией в Drupal 8. анализ результатов изменений.
система управления конфигурацией в Drupal 8. анализ результатов изменений.система управления конфигурацией в Drupal 8. анализ результатов изменений.
система управления конфигурацией в Drupal 8. анализ результатов изменений.
DrupalCamp Kyiv Рысь
 
ознакомления с модулем Entity api
ознакомления с модулем Entity apiознакомления с модулем Entity api
ознакомления с модулем Entity api
DrupalCamp Kyiv Рысь
 
Drupal 7 и history.js или как ajax инфицировать сайт
Drupal 7 и history.js или как ajax инфицировать сайтDrupal 7 и history.js или как ajax инфицировать сайт
Drupal 7 и history.js или как ajax инфицировать сайт
DrupalCamp Kyiv Рысь
 
Cdn hosting решения для drupal (medium)
Cdn hosting   решения для drupal (medium)Cdn hosting   решения для drupal (medium)
Cdn hosting решения для drupal (medium)
DrupalCamp Kyiv Рысь
 
Aegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовAegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтов
DrupalCamp Kyiv Рысь
 

Más de DrupalCamp Kyiv Рысь (17)

Drupal association slides us 2013
Drupal association slides us 2013Drupal association slides us 2013
Drupal association slides us 2013
 
Drupal association slides ru
Drupal association slides ruDrupal association slides ru
Drupal association slides ru
 
#D8 cx: upgrade your modules to drupal 8
#D8 cx: upgrade your modules to drupal 8 #D8 cx: upgrade your modules to drupal 8
#D8 cx: upgrade your modules to drupal 8
 
Game of-sales-presentation
Game of-sales-presentationGame of-sales-presentation
Game of-sales-presentation
 
Backbone js-slides
Backbone js-slidesBackbone js-slides
Backbone js-slides
 
система управления конфигурацией в Drupal 8. анализ результатов изменений.
система управления конфигурацией в Drupal 8. анализ результатов изменений.система управления конфигурацией в Drupal 8. анализ результатов изменений.
система управления конфигурацией в Drupal 8. анализ результатов изменений.
 
симфони это не страшно
симфони   это не страшносимфони   это не страшно
симфони это не страшно
 
ознакомления с модулем Entity api
ознакомления с модулем Entity apiознакомления с модулем Entity api
ознакомления с модулем Entity api
 
Services в drupal 8
Services в drupal 8Services в drupal 8
Services в drupal 8
 
Facet api
Facet apiFacet api
Facet api
 
Facet api
Facet apiFacet api
Facet api
 
Erpal erp with drupal
Erpal   erp with drupalErpal   erp with drupal
Erpal erp with drupal
 
Drupal 8 theming principles
Drupal 8 theming principlesDrupal 8 theming principles
Drupal 8 theming principles
 
Drupal 7 и history.js или как ajax инфицировать сайт
Drupal 7 и history.js или как ajax инфицировать сайтDrupal 7 и history.js или как ajax инфицировать сайт
Drupal 7 и history.js или как ajax инфицировать сайт
 
Cdn hosting решения для drupal (medium)
Cdn hosting   решения для drupal (medium)Cdn hosting   решения для drupal (medium)
Cdn hosting решения для drupal (medium)
 
Aegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовAegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтов
 
Behat
BehatBehat
Behat
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

что нового в мире Services