Removing unused stat call and reducing complexity of index.php
[zf2.biz/galerie.git] / public / index.php
index 34c609d..ece1222 100644 (file)
@@ -4,21 +4,18 @@ use Zend\ServiceManager\ServiceManager,
 
 chdir(dirname(__DIR__));
 
-if (!file_exists('vendor/autoload.php')) {
-    throw new RuntimeException('vendor/autoload.php could not be found. Did you run php composer.phar install?');
-    exit;
-}
-
 // Composer autoloading
-require_once('vendor/autoload.php');
+if (!include_once('vendor/autoload.php')) {
+    throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?');
+}
 
-// Get application stack configuration.
+// Get application stack configuration
 $configuration = include 'config/application.config.php';
 
-// Setup service manager.
+// Setup service manager
 $serviceManager = new ServiceManager(new ServiceManagerConfiguration($configuration['service_manager']));
 $serviceManager->setService('ApplicationConfiguration', $configuration);
 $serviceManager->get('ModuleManager')->loadModules();
 
-// Run application.
+// Run application
 $serviceManager->get('Application')->bootstrap()->run()->send();