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
@weierophinney
weierophinney / db.global.php
Created Apr 19, 2016
Using the zend-db ConfigProvider within a zend-expressive application
View db.global.php
<?php
// config/autoload/db.global.php
$provider = new Zend\Db\ConfigProvider();
return $provider();
@weierophinney
weierophinney / routes.global.php
Created Mar 16, 2016
Alternate way to push middleware into the pipeline between routing and dispatch.
View routes.global.php
<?php
use Zend\Expressive\Container\ApplicationFactory;
use Zend\Expressive\Helper;
return [
'middleware_pipeline' => [
'always' => [
'middleware' => [
Helper\ServerUrlMiddleware::class,
],
@weierophinney
weierophinney / response.md
Created Mar 3, 2016
Response to twitter comments
View response.md

I received this comment on twitter earlier today, in response to https://github.com/zendframework/zend-mvc/issues/89#issuecomment-191404454

"recommended for literally years developers not [lazy load]" - official Zend certification taught it depends on situation!

To this, I have two responses.

When was the certification created?

The certification was created within the first year of the first ZF2 stable release, and is current to ZF 2.2.0. That release was almost three years ago,

@weierophinney
weierophinney / Testing-zend-mvc-2.7.0.md
Last active Mar 1, 2016
Testing zend-mvc (future) 2.7.0
View Testing-zend-mvc-2.7.0.md

How to test zend-mvc 2.7.0

We're prepping a 2.7.0 release of zend-mvc. It has a few features of interest:

  • New middleware dispatcher to allow dispatching PSR-7 middleware from within the zend-mvc workflow.
  • Updates to be forwards-compatible with v3 components.

This latter has been the result of a months of work getting all the components zend-mvc depends on updated, and then updating the plethora of factories, event listeners, and places where events are triggered exposed by zend-mvc to work across both the v2 and v3 versions of zend-servicemanager and zend-eventmanager.

@weierophinney
weierophinney / benchmarks-v2.log
Last active Sep 28, 2015
Athletic benchmark results of zend-eventmanager, to detail performance improvements from v2 to v3. Two separate benchmarks are shown for v3, one detailing the original strategy of "prepare shared listeners only on the first trigger" and one detailing the strategy where shared listeners are prepared on every trigger, demonstrating we can do so wi…
View benchmarks-v2.log
Benchmarks from current v2 master.
ZendBench\EventManager\MultipleEventIndividualSharedListener
Method Name Iterations Average Time Ops/second
------------ ------------ ----------------- -------------
trigger : [ 5,000] [0.0001748194695] [5,720.18668]
ZendBench\EventManager\MultipleEventLocalListener
Method Name Iterations Average Time Ops/second
@weierophinney
weierophinney / need-help-with-component-split.md
Last active Mar 31, 2016
Please help me with a tricky git component split problem
View need-help-with-component-split.md

UPDATE: I discovered the issue is with specifying a commit range to filter-branch. When that is omitted, everything works perfectly, including history truncation! Thanks to everyone who assisted with ideas and suggestions!

I am currently working on a project to split the various components of Zend Framework 2 into their own repositories.

Currently, our repository structure looks like this:

.coveralls.yml
.gitattributes
@weierophinney
weierophinney / summary.md
Created May 4, 2015
Summary of PSR-7 changes since Review 2 began.
View summary.md

Summary of changes since Review 2 Started

  • Expanded section on expected structure returned by getUploadedFiles(), with several examples ranging from a flat structure to a nested structure with a collection of files.
  • Clarifications and simplification of URI -> Host header interactions.
    • Updated withUri() to indicate it MUST update the Host header with the value present in the URI provided (if any) UNLESS the $preserveHost flag is boolean true.
@weierophinney
weierophinney / CompositeAdapter.php
Created Apr 23, 2015
Example of a composite authentication adapter for zf-mvc-auth
View CompositeAdapter.php
<?php
use Zend\Http\Request;
use Zend\Http\Response;;
use ZF\MvcAuth\Authentication\AdapterInterface;
use ZF\MvcAuth\Identity\IdentityInterface;
use ZF\MvcAuth\MvcAuthEvent;
class CompositeAdapter implements AdapterInterface
{
private $adapters = [];
@weierophinney
weierophinney / CallbackStream.php
Last active Mar 31, 2016
Examples of streams you can use for alternate output styles in PSR-7
View CallbackStream.php
<?php
/**
* @copyright Copyright (c) 2015 Matthew Weier O'Phinney (https://mwop.net)
* @license http://opensource.org/licenses/BSD-2-Clause BSD-2-Clause
*/
namespace Psr7Examples;
use Psr\Http\Message\StreamableInterface;
@weierophinney
weierophinney / anonymous_middleware.php
Created Feb 24, 2015
Potential use case for anonymous PHP classes to translate between middleware types
View anonymous_middleware.php
<?php
$conduit->pipe(new class implements MiddlewareInterface {
public function __invoke($request, $response, $next)
{
$laravelRequest = mungePsr7ToLaravelRequest($request);
$laravelNext = function ($request) use ($next, $response) {
$request = ;
return $next(mungeLaravelToPsr7Request($request), $response)
};
$laravelMiddleware = new SomeLaravelMiddleware();
You can’t perform that action at this time.