Skip to content

Instantly share code, notes, and snippets.

@bognerf
Created November 13, 2013 09:54
Show Gist options
  • Save bognerf/7446473 to your computer and use it in GitHub Desktop.
Save bognerf/7446473 to your computer and use it in GitHub Desktop.
index.php für ZF2 (mit Custom Namespace im Vendor-Verzeichnis durch Autoloader!)
<?php
chdir(dirname(__DIR__));
// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
return false;
}
// Setup autoloading
require 'init_autoloader.php';
//Loading the UR-Namespace in APPLICATION/vendor
Zend\Loader\AutoloaderFactory::factory(array('Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
'ur' => dirname(__DIR__) . '/vendor/ur',
)
)));
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment