* @package WB * @subpackage content */ /** * Load base class */ WBClass::load('WBContent' ,'WBContent_SEO'); /** * Content component: SEO Favicon * * @version 1.1.0 * @package WB * @subpackage content */ class WBContent_SEO_Favicon extends WBContent_SEO { /** * my parameter list * @var array */ protected $config = array( 'path' => '/htdoc/s/favicon.ico' ); /** * run * * run component * * @see sendAndExit() * @return array parameter list */ public function run() { $path = trim($this->config['path'], '/'); $file = WBParam::get('wb/dir/base') . '/' . $path; $mime = 'image/png; charset=binary'; $ext = array_pop(explode('.', $path)); switch ($ext) { case 'ico': $mime = 'image/vnd.microsoft.icon; charset=binary'; break; case 'jpeg': $mime = 'image/jpeg; charset=binary'; break; case 'webp': $mime = 'image/webp; charset=binary'; break; case 'svg': $mime = 'image/svg+xml; charset=binary'; break; default: break; } $this->downloadFile($file, $mime); } }