예제 #1
0
파일: gitblog.php 프로젝트: rsms/gitblog
 if (gb::$is_preview === true && isset($_GET[gb::$pathspec_query_key])) {
     $preview_pathspec = $_GET[gb::$pathspec_query_key];
 }
 if (gb::$is_preview) {
     header('Cache-Control: no-cache');
 }
 # load plugins
 gb::load_plugins('request');
 gb::event('will-parse-request');
 register_shutdown_function(array('gb', 'event'), 'did-handle-request');
 if ($gb_request_uri) {
     if (strpos($gb_request_uri, gb::$categories_prefix) === 0) {
         # category(ies)
         $categories = array_map('urldecode', explode(',', substr($gb_request_uri, strlen(gb::$categories_prefix))));
         $postspage = GBExposedContent::findByCategories($categories, isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 0);
         gb::$is_categories = true;
         gb::$is_404 = $postspage === false;
     } elseif (strpos($gb_request_uri, gb::$tags_prefix) === 0) {
         # tag(s)
         $tags = array_map('urldecode', explode(',', substr($gb_request_uri, strlen(gb::$tags_prefix))));
         $postspage = GBExposedContent::findByTags($tags, isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 0);
         gb::$is_tags = true;
         gb::$is_404 = $postspage === false;
     } elseif (strpos($gb_request_uri, gb::$feed_prefix) === 0) {
         # feed
         $postspage = GBPost::pageByPageno(0);
         gb::$is_feed = true;
         gb::event('will-handle-request');
         # if we got this far it means no event observers took over this task, so
         # we run the built-in feed (Atom) code:
         require gb::$dir . '/helpers/feed.php';