Skip to content

Instantly share code, notes, and snippets.

Working on a transition plan

Matthew Weier O'Phinney weierophinney

Working on a transition plan
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
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
weierophinney / Dockerfile
Created Nov 1, 2018
Getting ext-tidy to work on alpine-based PHP images
View Dockerfile
# DOCKER-VERSION 1.3.2
FROM php:7.2-cli-alpine3.8
# Compile-time dependencies
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories
RUN apk update && \
apk add --no-cache 'tidyhtml-dev==5.2.0-r1'
# Install the extension
@weierophinney
weierophinney / UserCollection.php
Created Jun 5, 2018
Example of casting an array of entities to a collection
View UserCollection.php
<?php
namespace App\Entity;
use ArrayIterator;
class UserCollection extends ArrayIterator
{
}
@weierophinney
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">
<head>
<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="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
@weierophinney
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
<?php
/**
* composer.json:
* {
* "require": {
* "zendframework/zend-http": "2.*"
* }
* }
*/
require __DIR__ . '/vendor/autoload.php';
@weierophinney
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
<?php
public function someAction()
{
$data = doSomeWorkFetchSomeData();
$entity = new \ZF\Hal\Entity($data, $data['id']); // or similar
return new \ZF\ContentNegotiation\ViewModel([
'payload' => $entity,
]);
}
@weierophinney
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
<?php
namespace Soap\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Soap\AutoDiscover as SoapWsdlGenerator;
use Zend\Soap\Server as SoapServer;
class SoapController
{
@weierophinney
weierophinney / RemoveDevPrefixMiddleware.php
Created Sep 14, 2017
Demonstrates stripping a path prefix prior to routing.
View RemoveDevPrefixMiddleware.php
<?php
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;
use Psr\Http\Message\ServerRequestInterface;
class RemoveDevPrefixMiddleware implements MiddlewareInterface
{
private $prefix;
@weierophinney
weierophinney / Module.php
Created Aug 17, 2017
Demonstrates a zend-mvc listener that short-circuits, and how to register it
View Module.php
<?php
// In a module class somewhere...
use Zend\EventManager\LazyListener;
use Zend\Mvc\MvcEvent;
class Module
{
public function onBootstrap(MvcEvent $e)
{
View rfc-expressive-programmatic.md

[Expressive] RFC: Programmatic pipelines

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

We had pipelines:

$pipeline->pipe($loggingMiddleware);
$pipeline->pipe($serverUrlHelperMiddleware);
$pipeline->pipeRoutingMiddleware();
You can’t perform that action at this time.