diff --git a/having-fun-drupal-8-drupalorg-api/2018-04-18-drupal-bristol/slides.pdf b/having-fun-drupal-8-drupalorg-api/2018-04-18-drupal-bristol/slides.pdf new file mode 100644 index 0000000..b8ffe0e Binary files /dev/null and b/having-fun-drupal-8-drupalorg-api/2018-04-18-drupal-bristol/slides.pdf differ diff --git a/having-fun-drupal-8-drupalorg-api/notes.md b/having-fun-drupal-8-drupalorg-api/notes.md new file mode 100644 index 0000000..19a5e2d --- /dev/null +++ b/having-fun-drupal-8-drupalorg-api/notes.md @@ -0,0 +1,62 @@ +# Having fun with Drupal 8, PHP libraries Drupal.org API + +- Open slides +- Open Chrome tabs +- Open PhpStorm for all projects +- Open Sequel Pro for both DBs + + Clear cache tables +- Start PHP server for each site +- Start recording + +## PHP library + +- Show in PhpStorm +- Show readme with examples + + Run test.php +- Show query classes + + Not drupal coding standards (PSR-2) + + Explain laravel collections +- Show entity classes +- Show tests + + Show fake query classes +- Run tests + +## Project statistics + +- Show /projects page +- Show routing +- Show ProjectController + + Using PHP 7 return types + + Explain dependency injection + + Explain about collection + + Explain render array + + Show how to change ordering +- Show ProjectRetriever + + More dependency injection + + Show services file +- Show settings form +- Add another module (Sophie's simple integrations?) + + See it loading on projects page + + See it cached + +## Drupalversary + +- Show front page +- Show block +- Show block form +- Show accountretriever + + Highlight caching + + Services file + + Show cached items in the DB +- Show routing +- Show UserController + + More dependency injection + + Services file +- Show date parser + + Show drupalversary model +- Show adding own username via form + + See it cached + + Show adding uid via form + + See it cached +- Show Dries' because this year drupalversary has passed +- Try with attendee ID \ No newline at end of file diff --git a/having-fun-drupal-8-drupalorg-api/slides.txt b/having-fun-drupal-8-drupalorg-api/slides.txt new file mode 100644 index 0000000..7d6bbab --- /dev/null +++ b/having-fun-drupal-8-drupalorg-api/slides.txt @@ -0,0 +1,149 @@ +autoscale: true +build-lists: true +footer-style: alignment(left) +footer: @opdavies | oliverdavi.es +header-emphasis: #53B0EB +header: alignment(left) +text: alignment(left) +text-emphasis: #53B0EB +theme: poster, 8 + +[.header: alignment(center)] + +## Having fun with +## _Drupal 8_, _PHP libraries_ +## and the _Drupal.org API_ + +--- + +[.background-color: #FFFFFF] +[.build-lists: false] +[.header: #111111] +[.text: #111111, alignment(left)] + +![right 700%](../../me-phpnw.png) + +- Full stack Web Developer & System Administrator +- Senior Developer at Microserve +- Part-time freelancer +- Acquia certified Drupal 8 Grand Master +- Drupal 7 & 8 core contributor +- Open source project maintainer +- Drupal Bristol and PHPSW co-organiser +- opdavies (Drupal.org, GitHub, Twitter) +- www.oliverdavi.es + +^ Work at Microserve. +Maintain Drupal modules, PHP CLI tools and libraries +Talking about some open source project that I've written or in the process of writing. + +--- + +[.header: alignment(center)] + +## _Drupal 8 crash course_ + +### PHP libraries, Unit testing, +### Composer, Routing, Services, +### Dependency injection, caching + +^ Please feel free to ask questions as we go along! + +--- + +[.header: alignment(center)] + +## _Live Demo_ alert! + +--- + +### _Did you know that_ +## Drupal.org has an API? + +^ We're all familiar with Drupal.org (it's where everyone registered for this event), but did you know D.o has a public API? + +--- + +### _A PHP library for the_ +## Drupal.org API + +^ The first thing I built was... +It's what the Drupal examples are built on top of. +Does everyone understand what I mean by a PHP library? + +--- + +- Retrieve _node_ and _user_ data +- Filter by properties +- Provides own entity classes +- Methods for retrieving common properties +- Reusable +- Unit tested + +^ Re-usable by Drupal 7, Drupal 8, Symfony, Laravel etc +Testing already covered. +Demo + +--- + +```bash +$ composer require opdavies/drupalorg-api-php +``` + +--- + +### _Displaying Drupal.org_ +## project statistics + +--- + +[.text: alignment(left)] + +- 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 + +^ Demo + +--- + +### _When is your_ +## Drupalversary? + +--- + +[.text: alignment(left)] + +- 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 + +^ Stored in cache tables, but could use a custom entity? +Demo + +--- + +- oliverdavi.es/_talks_ +- oliverdavi.es/_youtube_ +- oliverdavi.es/_github_ +- oliverdavi.es/_packagist_ + +--- + +[.header: alignment(center)] + +## Questions? + +--- + +[.header: alignment(center)] + +# Thanks +### joind.in/_24044_