/** * @see \Components\Media_Storage::uriByScheme() \Components\Media_Storage::uriByScheme() */ public function uriByScheme($scheme_, $id_, $category_ = null) { if (@is_file(Environment::pathResource("{$this->store->path}/{$scheme_}/{$category_}/{$id_}"))) { return "{$this->store->uri}/{$scheme_}/{$category_}/{$id_}"; } // TODO (CSH) Http_Scriptlet_Router return Environment::uriComponents(sprintf('media/image/%1$s%2$s', \str\encodeBase64Url(serialize(array($this->store->path, $id_, $category_, $scheme_))), substr($id_, strrpos($id_, '.')))); }
/** * @param string $path_ * @param integer $width_ * @param integer $height_ * * @return string */ public static function imagePath($route_, Io_Path $path_, $width_ = null, $height_ = null) { $file = \str\encodeBase64Url(json_encode([(string) Io::path(Environment::pathWeb())->getRelativePath($path_), $width_, $height_])) . '.' . Io::fileExtension($path_); return Http_Router::path($route_) . "/{$file}"; }
/** * @see \str\encodeBase64Url() encodeBase64Url */ public static function encodeBase64Url($string_) { return \str\encodeBase64Url($string_); }