<?php

/**
 * Display all errors when APPLICATION_ENV is development.
 */
if (!isset($_SERVER['APPLICATION_ENV'])) {
    $_SERVER['APPLICATION_ENV'] = 'development';
}
if ($_SERVER['APPLICATION_ENV'] == 'development') {
    //error_reporting(E_ALL);
    ini_set("display_errors", 1);
}

ini_set("display_errors", 0);

date_default_timezone_set('Europe/Warsaw');

define("STORAGE_PATH",realpath(dirname(__FILE__))."/events");
define("PHOTOSOURCE_PATH", realpath(dirname(__FILE__))."/photos/");
define("PHOTOWEB_PATH","/photos/");
define("MOVIESOURCE_PATH", '');
/**
 * This makes our life easier when dealing with paths. Everything is relative
 * to the application root now.
 */
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';

// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
