/** * Prepares the passed request instance for generating the globals. * * @param \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest The request instance * * @return void */ protected function prepareGlobals(HttpServletRequestInterface $servletRequest) { // load the requested script name $scriptName = basename($servletRequest->getServerVar('SCRIPT_NAME')); // if the application has not been called over a vhost configuration append application folder name if ($servletRequest->getContext()->isVhostOf($servletRequest->getServerName()) === false) { $scriptName = $servletRequest->getContextPath() . DIRECTORY_SEPARATOR . $scriptName; } // initialize the server variables $this->serverVars['PHP_SELF'] = $scriptName; // ATTENTION: This is necessary because of a Magento bug!!!! $this->serverVars['SERVER_PORT'] = null; }