presentations/abstracts/having-fun-with-drupal-8-php-libraries-drupalorg-api.md

25 lines
1.2 KiB
Markdown
Raw Normal View History

2019-06-02 12:12:53 +01:00
---
title: Having Fun with Drupal 8, PHP libraries and the Drupal.org API
url: https://www.oliverdavies.uk/talks/drupal-8-php-libraries-drupalorg-api
tags: [drupal, drupal-8, php, composer]
---
2020-03-14 21:58:20 +00:00
Recently whilst I was involved in rebuilding an agency website, I started
looking for a way to list our supported contrib projects from Drupal.org
including information such as each projects download and star count - similar
to how Id seen on other websites for their PHP projects on GitHub.
2020-03-14 21:58:20 +00:00
This led me down a path of modern PHP development practices - firstly developing
a separate PHP library for interacting with Drupal.org, and then writing a
custom Drupal module that allowed the library to be configurable, as well as
making use of Drupals user roles and permissions, routing and caching.
2020-03-14 21:58:20 +00:00
I then also found another use-case for this library, to display the
Drupalversary date for a user - i.e. when they created their account on
Drupal.org - and to display a message if the current day was a user's
Drupalversary.
In this talk, I explain the approach that I took and some and the benefits of
splitting code into separate packages, I'll demo the library itself before
moving on to look at the code for and demo the Drupal modules that leverage it.