Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (26 sloc) 0.904 kB
<?php
if(!defined('DS'))
define('DS', DIRECTORY_SEPARATOR);
define('APP_SRC', dirname(__FILE__));
$root = dirname(dirname(__FILE__));
$lib = $root . DS . 'lib';
//require composer autoloader
require_once $lib . DS . 'autoload.php';
//get composer loader that already has vendors loaded
$loader = ComposerAutoloaderInit::getLoader();
//load application namespaces
$namespaces = array_fill_keys(['Domain', 'Infrastructure', 'Test', 'Presentation'], APP_SRC);
foreach($namespaces as $namespace => $path) {
$loader->add($namespace, $path);
}
$classes = [
'TwigView' => $lib . DS . '/slim/extras/Views/TwigView.php',
'Slim_View' => $lib . DS . '/slim/slim/Slim/View.php',
'Slim_Http_Request' => $lib . DS . '/slim/slim/Slim/Http/Request.php'
];
$map = [];
foreach($classes as $class => $path) {
if(file_exists($path))
$map[$class] = $path;
}
$loader->addClassMap($map);
Jump to Line
Something went wrong with that request. Please try again.