Skip to content

Instantly share code, notes, and snippets.

View mwillbanks's full-sized avatar
🏠
Working from home

Mike Willbanks mwillbanks

🏠
Working from home
View GitHub Profile
@mwillbanks
mwillbanks / ZF3Sessions.md
Last active August 29, 2015 14:02
Some ideas around sessions

Sessions

Zend Framework 3 (ZF3) will provide a new session management layer that will decouple it from ext/session. In doing this we will allow you to run multiple sessions at the same time in an application, utilize sessions in long-running applications, compatibility/convertibility with other applications, languages, etc.

With decoupling ext/session we will also provide a compatibility layer that will allow you to continue to utilize ext/session and the super global $_SESSION thus allowing you to continue with like behavior as you would have come to expect with generic session management in PHP.

In Zend Framework 2 (ZF2), we encountered numerous issues throughout the session management layer. Certain compatibility issues with ext/session specifically relating to session uploads. Session uploads caused corruption to the internal handing of sessions generally due to it's attempt to rewrite the session data. We also encountered several issues with PHP itself specifically regarding the usage

@mwillbanks
mwillbanks / generate-create-tables.php
Created August 13, 2015 18:55
ZF2: Create DDL from Existing Database (Using for PHPUnit myself)
<?php
$mysqli = new mysqli('HOST', 'USER', 'PASSWORD', 'information_schema');
if (mysqli_connect_errno()) {
printf('Connect failed: %s' . PHP_EOL, mysqli_connect_error());
exit();
}
$tables = [];
@mwillbanks
mwillbanks / syntastic_javascript_checkers.vimrc
Created March 21, 2016 18:02
This code will walk the path backwards looking for the proper javascript checker in each directory until it hits the root. Currently only supporting jscs and jshint as a fallback.
" jscs returns exit code when no config file is present
" if it does not exist, we use jshint
function! DetectSyntasticJavascriptChecker()
let stack = split(getcwd(), '/')
let len = len(stack)
while len >= 0
let len = len - 1
let path = '/' . join(stack[0:len], '/')
if (filereadable(path . '/.jscsrc'))