SlideShare a Scribd company logo
Development Workflow
Tools for Open-Source
PHP Libraries
Greg Anderson
@greg_1_anderson
Drupal Site
Drupal Module
Re-usable PHP Library
http://robo.li/framework/
{
"name": "drupal/lcache",
"description": "LCache module.",
"type": "drupal-module",
"license": "GPLv2",
"require": {
"lcache/lcache": "0.3.*"
}
}
● Add a minimal composer.json to module
● Use Composer to manage Drupal site
○ drupal-composer/drupal-project
REPEAT
HOWEVER, we also need:
● Collaboration
● Reproducibility
● Analysis of
○ Test coverage
○ Code Quality
○ Open Source License Compliance
● Documentation
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
https://xkcd.com/1205/
Collaborate with other engineers across multiple branches.
Keep a record of all work done.
Integrate With All Of The Things.
Run tests and
other tasks.
Calculate test
coverage.
Analyze code
complexity.
Track dependency
versions and licenses.
Package manager
for composer.
Publish documentation
site from markdown.
●
●
●
http://dilbert.com/strip/1996-01-31
●
○
○
●
○
○
○
●
https://github.com
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
$ git clone … working-copy
$ cd working-copy
$ git checkout -b mywork
$ git add -A .
$ git commit -m "Awesomesauce."
$ git push origin mywork
Development Workflow Tools for Open-Source PHP Libraries
https://github.com/matiassingers/awesome-readme
●
●
●
●
●
●
●
Development Workflow Tools for Open-Source PHP Libraries
### Steps to reproduce
What did you do?
### Expected behavior
Tell us what should happen
### Actual behavior
Tell us what happens instead
### Overview
This pull request:
- [ ] Fixes a bug
- [ ] Adds a feature
- [ ] Breaks backwards compat
- [ ] Has tests covering changes
### Description
Any additional information.
.github/pull_request_template.md.github/issue_template.md
●
○
●
○
○
https://packagist.org
{
"name": "consolidation/bootstrap",
"description": "Locate and bootstrap components ...",
"autoload":{
"psr-4":{
"ConsolidationBootstrap": "src"
}
},
"require": {
"php": ">=5.5.0",
"psr/log": "~1.0",
"symfony/console": "~2.5|~3.0"
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
}
}
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
https://packagist.org/search/?type=drupal-drush
https://poser.pugx.org
●
○
○
●
○ phpunit.xml.dist
○
○ composer install --prefer dist
○
○
○ composer.lock
○ Provide scripts to run tests locally
https://travis-ci.org
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="annotation-command">
<directory prefix="test" suffix=".php">tests</directory>
</testsuite>
</testsuites>
</phpunit>
$ composer require squizlabs/php_codesniffer
language: php
php:
- 7.0
- 5.6
- 5.5
- 5.4
before_script:
- composer install --prefer-dist
script:
- vendor/bin/phpunit
- vendor/bin/phpcs --standard=PSR2 -n src
branches:
# Only test the master branch and SemVer tags.
only:
- master
- /^[[:digit:]]+.[[:digit:]]+.[[:digit:]]+.*$/
sudo: false
cache:
directories:
- $HOME/.composer/cache
matrix:
include:
- php: 7.0
env: deps=highest
- php: 5.6
- php: 5.5
- php: 5.4
env: deps=lowest
before_script:
- if [ -z "$deps" ]; then composer install --prefer-dist; fi;
- if [ "$deps" = "lowest" ]; then composer update --prefer-dist --prefer-lowest -n; fi;
- if [ "$deps" = "highest" ]; then composer update --prefer-dist -n; fi;
https://blog.wyrihaximus.net/2015/06/test-lowest-current-and-highest-possible-on-travis/
Development Workflow Tools for Open-Source PHP Libraries
Define a box.json file to define phar contents, then run:
$ composer require kherge/box
$ vendor/bin/box build .
{
"alias": "robo.phar",
"chmod": "0755",
"compactors": ["HerreraBoxCompactorPhp"],
"directories": ["src"],
"files": ["RoboFile.php"],
"finder": [
{
"name": [ "*.php", "*.exe", "GeneratedWrapper.tmpl" ],
"exclude": [ "test", "tests", "Test", "Tests", "Tester" ],
"in": "vendor"
}
],
"git-commit": "git-commit",
"git-version": "git-version",
"output": "robo.phar",
"main": "robo",
"stub": true
}
https://github.com/consolidation/Robo/pull/411
# Prior to a deploy, build a fresh robo.phar
before_deploy:
- vendor/bin/box build .
deploy:
provider: releases
api_key:
secure: REPLACE_WITH_OAUTH_TOKEN
file: robo.phar
skip_cleanup: true
on:
tags: true
https://help.github.com/articles/creating-an-access-token-for-command-line-use/
{
"name": "consolidation/annotated-command",
"scripts": {
"phar": "vendor/bin/box build .",
"cs": "phpcs --standard=PSR2 -n src",
"cbf": "phpcbf --standard=PSR2 -n src",
"unit": "SHELL_INTERACTIVE=true phpunit --colors=always",
"test": [
"@unit",
"@cs"
]
}
}
Development Workflow Tools for Open-Source PHP Libraries
Paste in badge image URLs
any place HTML can be
rendered (e.g. wiki pages) to
create summary pages.
●
○
○
●
○
https://coveralls.io
<phpunit bootstrap="vendor/autoload.php" colors="true">
…
<logging>
<!-- <log type="coverage-html" target="build/logs/coverage" lowUpperBound="35"
highLowerBound="70"/> -->
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
$ brew install php70-xdebug
$ composer require satooshi/php-coveralls
after_success:
- travis_retry php vendor/bin/coveralls -v
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
●
○
○
●
○
○
○
○
○
https://scrutinizer-ci.com
Development Workflow Tools for Open-Source PHP Libraries
https://scrutinizer-ci.com/docs/integration/chrome-extension
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
●
○
○
●
○
○
https://www.versioneye.com
{
"name": "consolidation/annotated-command",
"description": "Initialize Symfony Console commands …",
"license": "MIT",
"authors": [
{
"name": "Greg Anderson",
"email": "greg.1.anderson@greenknowe.org"
}
],
…
}
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
$ composer licenses
Name: consolidation/robo
Version: 1.x-dev
Licenses: MIT
Dependencies:
Name Version License
consolidation/annotated-command 2.4.3 MIT
consolidation/log 1.0.3 MIT
consolidation/output-formatters 3.1.7 MIT
container-interop/container-interop 1.2.0 MIT
guzzle/guzzle v3.8.1 MIT
guzzlehttp/psr7 1.4.1 MIT
jakubledl/dissect v1.0.1 unlicense
league/container 2.3.0 MIT
myclabs/deep-copy 1.6.0 MIT
patchwork/jsqueeze v2.0.5 (Apache-2.0 or GPL-2.0)
Development Workflow Tools for Open-Source PHP Libraries
https://poser.pugx.orghttps://…#tab-licenses
[![License](https://poser.pugx.org/ORG/PROJECT/license.png)](https://www.versioneye.com/user/projects/ID#tab-licenses)
●
○
●
○
○
https://readthedocs.org
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
http://outputformatters.readthedocs.io/en/latest
$ composer require victorjonsson/markdowndocs
$ vendor/bin/phpdoc-md phpdoc-md generate src > docs/api.md
$ git add docs/api.md
$ git commit -m "Add API documentation."
OH NO! It’s not automated!
● ReadTheDocs is a python service; it can’t run php.
● Can’t easily build from Travis and commit back to the
repository, as that would create a separate commit (not
part of the release, might cause another test run, etc.)
●
○
○
●
https://pages.github.com
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
●
○
●
○
●
○
Install Sami
$ curl --output $HOME/bin/sami.phar http://get.sensiolabs.org/sami.phar
In .travis.yml
after_success:
# Publish updated API documentation on every push to the master branch
- git config --global user.email $GITHUB_USER_EMAIL
- git config --global user.name "Travis LCache Documentation Bot"
- sami.phar --ansi update sami-config.php
- git clone --branch=gh-pages https://${TOKEN}@github.com/org/proj
work
- rm -rf work/api
- cp -R docs/api work/api
- cd work
- git add -A api
- git commit -m "API docs from $TRAVIS_BUILD_NUMBER/$TRAVIS_COMMIT"
- git push
Development Workflow Tools for Open-Source PHP Libraries
https://lcache.github.io/lcache/api/master

More Related Content

PDF
Best Practice Site Architecture in Drupal 8
PDF
Drupal 8: frontend development
PDF
Composer & Drupal
PDF
Headless Drupal
PDF
Terminus, the Pantheon command-line interface
PDF
HTML5 tutorial: canvas, offfline & sockets
PDF
Using Composer with Drupal and Drush
PDF
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Best Practice Site Architecture in Drupal 8
Drupal 8: frontend development
Composer & Drupal
Headless Drupal
Terminus, the Pantheon command-line interface
HTML5 tutorial: canvas, offfline & sockets
Using Composer with Drupal and Drush
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...

What's hot (20)

PDF
Drupal 8 improvements for developer productivity php symfony and more
PDF
[drupalday2017] - REST in pieces
PPTX
Debugging in drupal 8
PDF
Ninja Build: Simple Guide for Beginners
PDF
Lean Drupal Repositories with Composer and Drush
PDF
Your first d8 module
PPT
Build Automation of PHP Applications
PDF
Drupal + composer = new love !?
PDF
Brisbane Drupal meetup - 2016 Mar - Build module in Drupal 8
PDF
Composer Tools & Frameworks for Drupal
PDF
Efficient development workflows with composer
PDF
WordPress mit Composer und Git verwalten
PDF
Efficient development workflows with composer
PPT
Introduction to Module Development (Drupal 7)
PDF
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
PDF
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
PDF
[drupalday2017] - Devel - D8 release party
PDF
Dependency management in Magento with Composer
PDF
11 tools for your PHP devops stack
PDF
Phing
Drupal 8 improvements for developer productivity php symfony and more
[drupalday2017] - REST in pieces
Debugging in drupal 8
Ninja Build: Simple Guide for Beginners
Lean Drupal Repositories with Composer and Drush
Your first d8 module
Build Automation of PHP Applications
Drupal + composer = new love !?
Brisbane Drupal meetup - 2016 Mar - Build module in Drupal 8
Composer Tools & Frameworks for Drupal
Efficient development workflows with composer
WordPress mit Composer und Git verwalten
Efficient development workflows with composer
Introduction to Module Development (Drupal 7)
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
[drupalday2017] - Devel - D8 release party
Dependency management in Magento with Composer
11 tools for your PHP devops stack
Phing
Ad

Viewers also liked (19)

PPTX
Leap across persuasion hurdles vimarsa
PPTX
Amazon AWS basics needed to run a Cassandra Cluster in AWS
PDF
Tech art 20170315
PDF
Continuous Integration Is for Teams: Moving past buzzword driven development
PDF
El TAO de la programación
PDF
Consejos rápidos: Convertirse en el Asesor de confianza de medios digitales
PDF
Learning with a Wasserstein Loss (NIPS2015)
PPT
Mental Health and Cognitive Changes in the Older Adult
PDF
「望ましさ」による優先順位づけ
PPTX
発想の飛躍を生み出すクリエイティブシンキング
PDF
Terminology and information models
PPSX
Database Security Overview
PPTX
PDF
ICST 2017 Day1 Opening Ceremony Research Track
PDF
Architecting a Next Generation Data Platform
PDF
Actividades bullyng
PDF
こわくない Git
PDF
Trastornos psicológicos personalidad mediados
PPTX
From the Pulpit to the Podium
Leap across persuasion hurdles vimarsa
Amazon AWS basics needed to run a Cassandra Cluster in AWS
Tech art 20170315
Continuous Integration Is for Teams: Moving past buzzword driven development
El TAO de la programación
Consejos rápidos: Convertirse en el Asesor de confianza de medios digitales
Learning with a Wasserstein Loss (NIPS2015)
Mental Health and Cognitive Changes in the Older Adult
「望ましさ」による優先順位づけ
発想の飛躍を生み出すクリエイティブシンキング
Terminology and information models
Database Security Overview
ICST 2017 Day1 Opening Ceremony Research Track
Architecting a Next Generation Data Platform
Actividades bullyng
こわくない Git
Trastornos psicológicos personalidad mediados
From the Pulpit to the Podium
Ad

Similar to Development Workflow Tools for Open-Source PHP Libraries (20)

PDF
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
PDF
Mastering composer
PDF
PHP Development Tools
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PPTX
Composer JSON kills make files
PDF
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
PDF
DevOPS training - Day 2/2
PDF
Advanced debugging  techniques in different environments
PPTX
Настройка окружения для кросскомпиляции проектов на основе docker'a
PPTX
Toolbox of a Ruby Team
PDF
Before & After Docker Init
KEY
Practical introduction to dev ops with chef
PDF
Building applications with Serverless Framework and AWS Lambda - JavaZone 2019
PDF
2019 11-bgphp
PDF
OpenShift Origin Community Day (Boston) Extending OpenShift Origin: Build You...
PDF
OpenShift Origin Community Day (Boston) Writing Cartridges V2 by Jhon Honce
PDF
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
PDF
Docker module 1
PDF
Putting Phing to Work for You
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Mastering composer
PHP Development Tools
Dependencies Managers in C/C++. Using stdcpp 2014
Composer JSON kills make files
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
DevOPS training - Day 2/2
Advanced debugging  techniques in different environments
Настройка окружения для кросскомпиляции проектов на основе docker'a
Toolbox of a Ruby Team
Before & After Docker Init
Practical introduction to dev ops with chef
Building applications with Serverless Framework and AWS Lambda - JavaZone 2019
2019 11-bgphp
OpenShift Origin Community Day (Boston) Extending OpenShift Origin: Build You...
OpenShift Origin Community Day (Boston) Writing Cartridges V2 by Jhon Honce
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Docker module 1
Putting Phing to Work for You

More from Pantheon (20)

PDF
Drupal Migrations in 2018
PDF
Architecting Million Dollar Projects
PDF
Streamlined Drupal 8: Site Building Strategies for Tight Deadlines
PDF
Getting Started with Drupal
PDF
Defense in Depth: Lessons Learned Securing 200,000 Sites
PDF
Automate Your Automation | DrupalCon Vienna
PDF
Sub-Second Pageloads: Beat the Speed of Light with Pantheon & Fastly
PDF
Building a Network of 195 Drupal 8 Sites
PDF
Hacking Your Agency Workflow: Treating Your Process Like A Product
PDF
WordPress REST API: Expert Advice & Practical Use Cases
PDF
Testing Your Code as Part of an Industrial Grade Workflow
PDF
Test Coverage for Your WP REST API Project
PDF
Drupal 8 and Pantheon
PDF
Why Your Site is Slow: Performance Answers for Your Clients
PDF
Drupal Performance
PDF
WP or Drupal (or both): A Framework for Client CMS Decisions
PPTX
Level Up: 5 Expert Tips for Optimizing WordPress Performance
PDF
Migrating NYSenate.gov
PDF
Automating & Integrating Pantheon with JIRA, Slack, Jenkins and More
PDF
WordPress at Scale Webinar
Drupal Migrations in 2018
Architecting Million Dollar Projects
Streamlined Drupal 8: Site Building Strategies for Tight Deadlines
Getting Started with Drupal
Defense in Depth: Lessons Learned Securing 200,000 Sites
Automate Your Automation | DrupalCon Vienna
Sub-Second Pageloads: Beat the Speed of Light with Pantheon & Fastly
Building a Network of 195 Drupal 8 Sites
Hacking Your Agency Workflow: Treating Your Process Like A Product
WordPress REST API: Expert Advice & Practical Use Cases
Testing Your Code as Part of an Industrial Grade Workflow
Test Coverage for Your WP REST API Project
Drupal 8 and Pantheon
Why Your Site is Slow: Performance Answers for Your Clients
Drupal Performance
WP or Drupal (or both): A Framework for Client CMS Decisions
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Migrating NYSenate.gov
Automating & Integrating Pantheon with JIRA, Slack, Jenkins and More
WordPress at Scale Webinar

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
A Presentation on Artificial Intelligence
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MYSQL Presentation for SQL database connectivity
Unlocking AI with Model Context Protocol (MCP)
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
A Presentation on Artificial Intelligence
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Understanding_Digital_Forensics_Presentation.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Development Workflow Tools for Open-Source PHP Libraries