Skip to content

Instantly share code, notes, and snippets.

Working from home during quarantine. In other words, just like always.

Matthew Weier O'Phinney weierophinney

Working from home during quarantine. In other words, just like always.
Block or report user

Report or block weierophinney

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
weierophinney / SoapController.php
Created Feb 12, 2014
Example of creating a SOAP controller for handling both WSDL and SOAP requests in ZF2.
View SoapController.php
namespace Soap\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Soap\AutoDiscover as SoapWsdlGenerator;
use Zend\Soap\Server as SoapServer;
class SoapController
View zf2-workflow.txt
We rename "master" to "develop"
We rename "release" to "master"
Thus "master" stays the default branch, which means most PRs will be made
against it.
Bugfixes are merged to:
- master
- develop
Features are merged to:
- develop
When develop looks like the next minor or major version:
weierophinney / Dockerfile
Created Nov 1, 2018
Getting ext-tidy to work on alpine-based PHP images
View Dockerfile
FROM php:7.2-cli-alpine3.8
# Compile-time dependencies
RUN echo '' >> /etc/apk/repositories
RUN apk update && \
apk add --no-cache 'tidyhtml-dev==5.2.0-r1'
# Install the extension
weierophinney / UserCollection.php
Created Jun 5, 2018
Example of casting an array of entities to a collection
View UserCollection.php
namespace App\Entity;
use ArrayIterator;
class UserCollection extends ArrayIterator
weierophinney / index.html
Created May 31, 2018
Prototype for auto-populating the component dropdown and making it searchable.
View index.html
<!doctype html>
<html lang="en">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Choices example</title>
<link rel="stylesheet" href="" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
weierophinney / changelog_generator.php
Created Jul 2, 2013
This is a version of the script I use to generate changelogs for my projects.
View changelog_generator.php
* composer.json:
* {
* "require": {
* "zendframework/zend-http": "2.*"
* }
* }
require __DIR__ . '/vendor/autoload.php';
weierophinney / rpc-hal-entity.php
Created Sep 25, 2014
One way to return a HAL entity from an Apigility RPC controller.
View rpc-hal-entity.php
public function someAction()
$data = doSomeWorkFetchSomeData();
$entity = new \ZF\Hal\Entity($data, $data['id']); // or similar
return new \ZF\ContentNegotiation\ViewModel([
'payload' => $entity,
weierophinney / RemoveDevPrefixMiddleware.php
Created Sep 14, 2017
Demonstrates stripping a path prefix prior to routing.
View RemoveDevPrefixMiddleware.php
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;
use Psr\Http\Message\ServerRequestInterface;
class RemoveDevPrefixMiddleware implements MiddlewareInterface
private $prefix;
weierophinney / Module.php
Created Aug 17, 2017
Demonstrates a zend-mvc listener that short-circuits, and how to register it
View Module.php
// In a module class somewhere...
use Zend\EventManager\LazyListener;
use Zend\Mvc\MvcEvent;
class Module
public function onBootstrap(MvcEvent $e)

[Expressive] RFC: Programmatic pipelines

When we originally created the API for Expressive, it was programmatic:

We had pipelines:

You can’t perform that action at this time.