protected function retrievePathToApplication()
    {
        // If path to app was defined before return this (priority 1)
        if (false === defined('DOOZR_APP_ROOT')) {
            if (false !== $environment = getenv('DOOZR_APP_ROOT')) {
                // assume that path to application is like the default environment (one folder up)
                $path = $this->mergePath($environment, 'app/');
            } else {
                // assume that path to application is like the default environment (one folder up)
                $path = $this->mergePath(DOOZR_DOCUMENT_ROOT, '../app/');
            }

            // we need a constant of the path as counterpart to DOOZR_DOCUMENT_ROOT
            define('DOOZR_APP_ROOT', $path);
        }

        // Always use constant
        return DOOZR_APP_ROOT;
    }