/** * @param $isHashHost Boolean Is this host a router * @param $hostNumber Number How many host there * @param $packImages Boolean make a zip pack for images? */ function main($isHashHost, $hostNumber, $packImages) { $url = isset($_GET['url']) ? $_GET['url'] : ''; # URL given if ($url) { # it's an image url if (Input::isImageUrl($url)) { Output::redirect($url); } elseif ($isHashHost) { Router::route($url, $hostNumber); } else { $mc = new mc(); Input::loadMemcached($mc); Output::loadMemcached($mc); Handler::loadMemcached($mc); Handler::handle($url, $packImages); } } else { exit_script('Hello Tumblr!'); } }