Skip to content

Commit da0d754

Browse files
committed
Adding Module.php
1 parent 3cccc65 commit da0d754

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

Module.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Zend Framework (http://framework.zend.com/)
4+
*
5+
* @link https://github.com/kuzmar/ZF2-Facebook-SKD-Module for the canonical source repository
6+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7+
* @license http://framework.zend.com/license/new-bsd New BSD License
8+
*/
9+
10+
namespace Facebook;
11+
12+
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
13+
use Zend\Mvc\ModuleRouteListener;
14+
15+
class Module implements AutoloaderProviderInterface
16+
{
17+
public function getAutoloaderConfig()
18+
{
19+
return array(
20+
'Zend\Loader\ClassMapAutoloader' => array(
21+
__DIR__ . '/autoload_classmap.php',
22+
),
23+
'Zend\Loader\StandardAutoloader' => array(
24+
'namespaces' => array(
25+
// if we're in a namespace deeper than one level we need to fix the \ in the path
26+
__NAMESPACE__ => __DIR__ . '/src/' . str_replace('\\', '/' , __NAMESPACE__),
27+
),
28+
),
29+
);
30+
}
31+
32+
public function getConfig()
33+
{
34+
return include __DIR__ . '/config/module.config.php';
35+
}
36+
37+
public function onBootstrap($e)
38+
{
39+
// You may not need to do this if you're doing it elsewhere in your
40+
// application
41+
$eventManager = $e->getApplication()->getEventManager();
42+
$moduleRouteListener = new ModuleRouteListener();
43+
$moduleRouteListener->attach($eventManager);
44+
}
45+
}

0 commit comments

Comments
 (0)