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 / Module.php
Created Feb 5, 2014
Example of attaching to the "authenticate" event.
View Module.php
class Module
public function onBootstrap($e)
$app = $e->getApplication();
$services = $app->getServiceManager();
$events = $app->getEventManager();
$events->attach('authenticate', function ($e) use ($services) {
weierophinney / rtut.zsh
Created Feb 11, 2014
PHPUnit test runner using inotifywait
View rtut.zsh
# Copyright (c) 2014, Joshua Thijssen
# Copyright (c) 2014, Matthew Weier O'Phinney
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.

Keybase proof

I hereby claim:

  • I am weierophinney on github.
  • I am mwop ( on keybase.
  • I have a public key whose fingerprint is 8D98 47CD E15F 050B 8197 6BA7 B545 7969 23ED 29DA

To claim this, I am signing this object:

weierophinney / composer.json
Created Apr 23, 2014
Adding apigility deps to an existing repo
View composer.json
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"homepage": "",
"require": {
weierophinney / Module.php
Created May 7, 2014
Returning early if a specific HTTP header is missing
View Module.php
namespace SomeApi;
use ZF\ApiProblem\ApiProblem;
use ZF\ApiProblem\ApiProblemResponse;
class Module
public function onBootstrap($e)
weierophinney / TableGatewayFeaturesDelegatorFactory.php
Last active Aug 29, 2015
delegator for injecting TableGateway features into TableGateways created as part of the Apigility DB-Connected functionality.
View TableGatewayFeaturesDelegatorFactory.php
use Zend\Db\TableGateway\Feature;
use Zend\ServiceManager\DelegatorFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class TableGatewayFeaturesDelegatorFactory implements DelegatorFactoryInterface
public function createDelegatorWithName(
ServiceLocatorInterface $services,
weierophinney / OAuth2PdoAdapterFactory.php
Created Aug 5, 2014
Example of pulling a PDO connection from an existing ZF2 DB adapter in order to seed a ZF\OAuth2\Adapter\PdoAdapter instance.
View OAuth2PdoAdapterFactory.php
use ZF\OAuth2\Adapter\PdoAdapter;
class OAuth2PdoAdapterFactory
public function __invoke($services)
$db = $services->get('DB\MyDbName');
if (! $db instanceof Adapter) {
weierophinney /
Created Oct 9, 2014
A comment posted to

In response to:

The comment is currently marked as moderated; I don't expect it will be approved.

Then link directly to the original article, and indicate the original author. Feeds provide both of these pieces of information. Right now, ALL articles indicate they are written by Ali El Manini (though I will admit that many include the original author in the title, the author listed is Ali, in both the articles and the feed). NONE of them link back to the original — which is alone enough reason for people to ask that you stop republishing. Add on to this that many are clearly the truncated versions aggregated by Planet PHP (which PROPERLY attributes the original author and links back to the original article), there’s even less indication of how to find the original in order to get the full version.

At the very least, this site adds confusion to the google results for given topics. It definitely violates copyright by republ

View listener.php
function injectLogoLink($e)
$halEntity = $e->getParam('entity');
'rel' => 'logo',
'route' => array(
'name' => 'cart-logo',
'params' => array(
'id' => $halEntity->id,
weierophinney / collection.php
Created Nov 24, 2014
Example of creating a collection with extra attributes.
View collection.php
$collection = new \ZF\Hal\Collection($actualCollectionUsuallyAPaginator);
'name' => 'BQSLIB',
'description' => 'BQSLib',
'creationDate' => '2010-11-08 12:12:42',
// Either add this as a property of the entity, or return it.
You can’t perform that action at this time.