/** * @param \Components\Http_Scriptlet_Context $context_ * @param \Components\Uri $uri_ */ public static function dispatch(Http_Scriptlet_Context $context_, Uri $uri_) { $key = $uri_->getFilename(); if (!($path = Cache::get($key))) { throw new Http_Exception('ui/scriptlet/image', null, Http_Exception::NOT_FOUND); } // TODO Cache headers. readfile($path); }
public function testSetGetPath() { $path = 'this/is/another/path/with-file.other'; $this->uri->setPath($path); $this->assertEquals($path, $this->uri->getPath()); $this->assertEquals('this/is/another/path', $this->uri->getDirname()); $this->assertEquals('with-file.other', $this->uri->getBasename()); $this->assertEquals('with-file', $this->uri->getFilename()); $this->assertEquals('other', $this->uri->getExtension()); $this->uri->setPath(''); $this->assertEquals('', $this->uri->getDirname()); $this->assertEquals('', $this->uri->getBasename()); $this->assertEquals('', $this->uri->getFilename()); $this->assertEquals('', $this->uri->getExtension()); }