Skip to content

Instantly share code, notes, and snippets.

@brandonsavage
Created March 7, 2014 18:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save brandonsavage/dd06beb9b9833ab8563c to your computer and use it in GitHub Desktop.
<?php
$di->set('current_user', function() use ($di) {
$session = $di->get('session');
$segment = $session->segment;
if($segment->AUTHENTICATED) {
$slave = $di->get('slave');
$g = new Application\Model\User\Gateway(new Application\Model\User\Storage($slave));
return $g->loadUser($segment->user_id);
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment