$30 off During Our Annual Pro Sale. View Details »

Having Fun with Drupal 8, PHP libraries and the Drupal.org API

Having Fun with Drupal 8, PHP libraries and the Drupal.org API

Oliver Davies

March 03, 2019
Tweet

More Decks by Oliver Davies

Other Decks in Technology

Transcript

  1. HAVING FUN WITH
    DRUPAL 8, PHP LIBRARIES
    AND THE DRUPAL.ORG API
    @opdavies | opdavi.es

    View Slide

  2. ▸ Full stack Web Developer & System
    Administrator
    ▸ Senior Developer at Microserve
    ▸ Part-time freelancer
    ▸ Acquia certified Drupal 8 Grand Master
    ▸ Drupal core contributor
    ▸ Open source project maintainer
    ▸ opdavies (Drupal.org, GitHub, Twitter)
    ▸ www.oliverdavies.uk
    @opdavies | opdavi.es

    View Slide

  3. DRUPAL 8 CRASH COURSE
    PHP LIBRARIES, UNIT TESTING,
    COMPOSER, ROUTING, SERVICES,
    DEPENDENCY INJECTION, CACHING
    @opdavies | opdavi.es

    View Slide

  4. LIVE DEMO ALERT!
    @opdavies | opdavi.es

    View Slide

  5. View Slide

  6. View Slide

  7. DID YOU KNOW THAT
    DRUPAL.ORG HAS AN API?
    @opdavies | opdavi.es

    View Slide

  8. View Slide

  9. View Slide

  10. A PHP LIBRARY FOR THE
    DRUPAL.ORG API
    @opdavies | opdavi.es

    View Slide

  11. ▸ Retrieve node and user data
    ▸ Filter by properties
    ▸ Provides own entity classes
    ▸ Methods for retrieving common properties
    ▸ Reusable
    ▸ Unit tested
    @opdavies | opdavi.es

    View Slide

  12. View Slide

  13. View Slide

  14. View Slide

  15. $ composer require opdavies/drupalorg-api-php
    @opdavies | opdavi.es

    View Slide

  16. DISPLAYING DRUPAL.ORG
    PROJECT STATISTICS
    @opdavies | opdavi.es

    View Slide

  17. ▸ Inspired by spatie.be/en/opensource
    ▸ Displays downloads and stars
    ▸ Drupal 8 module
    ▸ Configuration form to enter project IDs
    ▸ Queries the API
    ▸ Displays project information
    ▸ Retrieved data cached locally
    @opdavies | opdavi.es

    View Slide

  18. View Slide

  19. View Slide

  20. WHEN IS YOUR
    DRUPALVERSARY?
    @opdavies | opdavi.es

    View Slide

  21. ▸ When did you register on Drupal.org?
    ▸ Drupal 8 module
    ▸ Enter a username
    ▸ Queries the API
    ▸ Displays information - next Drupalversary date and number of
    days until, number of years on Drupal.org
    ▸ Retrieved data cached locally
    @opdavies | opdavi.es

    View Slide

  22. View Slide

  23. ▸ opdavi.es/talks
    ▸ opdavi.es/do-library
    ▸ opdavi.es/drupalversary
    ▸ opdavi.es/do-projects
    @opdavies | opdavi.es

    View Slide

  24. QUESTIONS?
    @opdavies | opdavi.es

    View Slide

  25. THANKS
    @opdavies | opdavi.es

    View Slide