Skip to content

Instantly share code, notes, and snippets.

@fprochazka
Created March 10, 2011 14:08
Show Gist options
  • Save fprochazka/864134 to your computer and use it in GitHub Desktop.
Save fprochazka/864134 to your computer and use it in GitHub Desktop.
Overriding of Nette\Configurator
<?php
require_once __DIR__ . '/models/MyConfigurator.php';
Nette\Environment::setConfigurator(new MyConfigurator);
Nette\Environment::loadConfig();
Nette\Environment::getApplication()->getService('Nette\Web\IUser') instanceof MyUser;
service.Nette-Web-IUser.factory = MyConfigurator::createUser
<?php
class MyConfigurator extends Nette\Configurator
{
public static function createUser($options)
{
$user = new MyUser();
$user->authentificationHandler = Nette\Environment::getApplication()->getService(...
return $user;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment