-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModule.php
34 lines (29 loc) · 889 Bytes
/
Module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace OmekaModuleStarterKit;
use Omeka\Module\AbstractModule;
use Zend\Config\Factory;
use Zend\ServiceManager\ServiceLocatorInterface;
class Module extends AbstractModule
{
private $config;
public function loadVendor() {
if (file_exists(__DIR__ . '/build/vendor-dist/autoload.php')) {
require_once __DIR__ . '/build/vendor-dist/autoload.php';
} elseif (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
}
public function getConfig()
{
if ($this->config) {
return $this->config;
}
// Load our composer dependencies.
$this->loadVendor();
// Load our configuration.
$this->config = Factory::fromFiles(
glob(__DIR__ . '/config/*.config.*')
);
return $this->config;
}
}