Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 2e65b5c7da
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (45 sloc) 1.338 kB
<?php
namespace ZfcUser;
use Zend\Module\Manager,
Zend\EventManager\StaticEventManager,
Zend\Module\Consumer\AutoloaderProvider;
class Module implements AutoloaderProvider
{
protected static $options;
public function init(Manager $moduleManager)
{
$moduleManager->events()->attach('loadModules.post', array($this, 'modulesLoaded'));
}
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getConfig($env = null)
{
return include __DIR__ . '/config/module.config.php';
}
public function modulesLoaded($e)
{
$config = $e->getConfigListener()->getMergedConfig();
static::$options = $config['zfcuser'];
}
/**
* @TODO: Come up with a better way of handling module settings/options
*/
public static function getOption($option)
{
if (!isset(static::$options[$option])) {
return null;
}
return static::$options[$option];
}
}
Jump to Line
Something went wrong with that request. Please try again.