JavaScript::sendMinified(); break; default: return false; } } elseif ($path === 'svg/chart.php') { if (!array_key_exists('data', $_GET)) { return false; } include __DIR__ . '/EmbeddedWeb.php'; EmbeddedWeb::start(); header('Content-Type: image/svg+xml'); $pie = new PieChart(); $pie->initFromRequest(); echo $pie->render(); } elseif ($path === 'png/chart.php') { if (!array_key_exists('data', $_GET)) { return false; } include __DIR__ . '/EmbeddedWeb.php'; EmbeddedWeb::start(); header('Content-Type: image/png'); $pie = new PieChart(); $pie->initFromRequest(); $pie->toPng(); } elseif (file_exists($baseDir . '/' . $path) && is_file($baseDir . '/' . $path)) { return false; } else { include __DIR__ . '/Web.php'; Web::start()->dispatch(); }
protected function bootstrap() { parent::bootstrap(); throw new ProgrammingError('Not yet'); // $this->setupIcingaLegacyWrapper(); }
/** * Add routes for static content and any route added via {@link addRoute()} to the route chain * * @return $this */ protected function registerRoutes() { $router = $this->app->getFrontController()->getRouter(); // TODO: We should not be required to do this. Please check dispatch() $this->app->getfrontController()->addControllerDirectory($this->getControllerDir(), $this->getName()); /** @var \Zend_Controller_Router_Rewrite $router */ foreach ($this->routes as $name => $route) { $router->addRoute($name, $route); } $router->addRoute($this->name . '_jsprovider', new Zend_Controller_Router_Route('js/' . $this->name . '/:file', array('action' => 'javascript', 'controller' => 'static', 'module' => 'default', 'module_name' => $this->name))); $router->addRoute($this->name . '_img', new Zend_Controller_Router_Route_Regex('img/' . $this->name . '/(.+)', array('action' => 'img', 'controller' => 'static', 'module' => 'default', 'module_name' => $this->name), array(1 => 'file'))); return $this; }
/** * Register routes for web access * * @return self */ protected function registerRoutes() { $this->app->getFrontController()->getRouter()->addRoute($this->name . '_jsprovider', new Route('js/' . $this->name . '/:file', array('controller' => 'static', 'action' => 'javascript', 'module_name' => $this->name))); $this->app->getFrontController()->getRouter()->addRoute($this->name . '_img', new Route('img/' . $this->name . '/:file', array('controller' => 'static', 'action' => 'img', 'module_name' => $this->name))); return $this; }
/** * Add routes for static content and any route added via {@link addRoute()} to the route chain * * @return $this */ protected function registerRoutes() { $router = $this->app->getFrontController()->getRouter(); /** @var \Zend_Controller_Router_Rewrite $router */ foreach ($this->routes as $name => $route) { $router->addRoute($name, $route); } $router->addRoute($this->name . '_jsprovider', new Zend_Controller_Router_Route('js/' . $this->name . '/:file', array('action' => 'javascript', 'controller' => 'static', 'module' => 'default', 'module_name' => $this->name))); $router->addRoute($this->name . '_img', new Zend_Controller_Router_Route_Regex('img/' . $this->name . '/(.+)', array('action' => 'img', 'controller' => 'static', 'module' => 'default', 'module_name' => $this->name), array(1 => 'file'))); return $this; }