public function indexAction()
 {
     $docroot = getcwd() . '/' . $this->options->getDocRoot();
     $docroot = rtrim($docroot, '/');
     $scriptName = $this->params('script');
     if (empty($scriptName)) {
         $path = $this->params('path') ? $this->params('path') : '';
         foreach ($this->options->getIndexFiles() as $indexFile) {
             if (file_exists($docroot . '/' . $path . $indexFile)) {
                 ob_start();
                 include $docroot . '/' . $path . $indexFile;
                 $output = ob_get_clean();
                 $this->getResponse()->setContent($output);
                 return $this->getResponse();
             }
         }
     }
     $scriptUri = '/' . ltrim($scriptName, '/');
     // force leading '/'
     $legacyScriptFilename = $docroot . $scriptUri;
     if (!file_exists($legacyScriptFilename)) {
         // if we're here, the file doesn't really exist and we do not know what to do
         $response = $this->getResponse();
         /* @var $response Response */
         //<-- this one for netbeans (WHY, NetBeans, WHY??)
         /** @var Response $response */
         // <-- this one for other IDEs and code analyzers :)
         $response->setStatusCode(404);
         return;
     }
     //inform the application about the used script
     $this->legacy->setLegacyScriptFilename($legacyScriptFilename);
     $this->legacy->setLegacyScriptName($scriptUri);
     //inject get and request variables
     $this->setGetVariables();
     ob_start();
     include $legacyScriptFilename;
     $output = ob_get_clean();
     $result = $this->getEventManager()->trigger(MaglLegacy::EVENT_SHORT_CIRCUIT_RESPONSE, $this);
     if ($result->stopped()) {
         return $result->last();
     }
     $this->getResponse()->setContent($output);
     return $this->getResponse();
 }