$default_rules= array( // Rules to display content array( 'name' => 'display_index', 'parse_regex' => '%^(?:page/(?P\d+))?/?$%', 'build_str' => '(page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_home', 'priority' => 1000, 'description' => 'Homepage (index) display' ), array( 'name' => 'display_entries_by_tag', 'parse_regex' => '%^tag/(?P[^/]*)(?:/page/(?P\d+))?/?$%i', 'build_str' => 'tag/{$tag}(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_tag', 'priority' => 5, 'description' => 'Return posts matching specified tag.' ), array( 'name' => 'display_entries_by_date', 'parse_regex' => '%^(?P[1,2]{1}[\d]{3})(?:/(?P[\d]{2}))?(?:/(?P[\d]{2}))?(?:/page/(?P\d+))?/?$%i', 'build_str' => '{$year}/({$month}/)({$day}/)(page/{$page}/)', 'handler' => 'UserThemeHandler', 'action' => 'display_date', 'priority' => 2, 'description' => 'Displays posts for a specific date.' ), array( 'name' => 'display_entry', 'parse_regex' => '%^(?P[^/]+)(?:/page/(?P\d+))?/?$%i', 'build_str' => '{$slug}(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_post', 'priority' => 100, 'description' => 'Return entry matching specified slug' ), array( 'name' => 'display_page', 'parse_regex' => '%^(?P[^/]+)(?:/page/(?P\d+))?/?$%i', 'build_str' => '{$slug}(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_post', 'priority' => 100, 'description' => 'Return page matching specified slug' ), array( 'name' => 'display_search', 'parse_regex' => '%^search(?:/(?P[^/]+))?(?:/page/(?P\d+))?/?$%i', 'build_str' => 'search(/{$criteria})(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'search', 'priority' => 8, 'description' => 'Searches posts' ), array( 'name' => 'submitted_comment', 'parse_regex' => '%^(?P[0-9]+)/feedback/?$%i', 'build_str' => '{$id}/feedback', 'handler' => 'FeedbackHandler', 'action' => 'add_comment', 'priority' => 8, 'description' => 'Adds a comment to a post' ), // Admin and user actions array( 'name' => 'admin', 'parse_regex' => '%^admin/?(?P[^/]*)/?(?P[^/]*)/?$%i', 'build_str' => 'admin(/{$action})(/{$call})', 'handler' => 'AdminHandler', 'action' => 'admin', 'priority' => 6, 'description' => 'An admin action' ), array( 'name' => 'user', 'parse_regex' => '%^user/(?P[^/]*)$%i', 'build_str' => 'user/{$action}(/{$call})', 'handler' => 'UserHandler', 'action' => '{$page}', 'priority' => 7, 'description' => 'A user action or display, for instance the login screen' ), // AJAX calls array( 'name' => 'ajax', 'parse_regex' => '%^ajax/(?P[^/]+)/?$%i', 'build_str' => 'ajax/{$context}', 'handler' => 'AjaxHandler', 'action' => 'ajax', 'priority' => 8, 'description' => 'Ajax handling' ), array( 'name' => 'ajax_auth', 'parse_regex' => '%^auth_ajax/(?P[^/]+)/?$%i', 'build_str' => 'auth_ajax/{$context}', 'handler' => 'AjaxHandler', 'action' => 'auth_ajax', 'priority' => 8, 'description' => 'Authenticated ajax handling' ), // Feed calls array( 'name' => 'rsd', 'parse_regex' => '%^rsd$%i', 'build_str' => 'rsd', 'handler' => 'AtomHandler', 'action' => 'rsd', 'priority' => 1, 'description' => 'RSD output' ), array( 'name' => 'atom_introspection', 'parse_regex' => '%^atom$%i', 'build_str' => 'atom', 'handler' => 'AtomHandler', 'action' => 'introspection', 'priority' => 1, 'description' => 'Atom introspection' ), array( 'name' => 'atom_feed', 'parse_regex' => '%^atom/(?P[^/]+)(?:/page/(?P\d+))?/?$%i', 'build_str' => 'atom/{$index}(/page/{$page})', 'handler' => 'AtomHandler', 'action' => 'collection', 'priority' => 8, 'description' => 'Atom collection' ), array( 'name' => 'atom_feed_tag', 'parse_regex' => '%^tag/(?P[^/]+)/atom(?:/page/(?P\d+))?/?$%i', 'build_str' => 'tag/{$tag}/atom(/page/{$page})', 'handler' => 'AtomHandler', 'action' => 'tag_collection', 'priority' => 8, 'description' => 'Atom Tag Collection' ), array( 'name' => 'atom_feed_comments', 'parse_regex' => '%^atom/comments(?:/page/(?P\d+))?/?$%i', 'build_str' => 'atom/comments(/page/{$page})', 'handler' => 'AtomHandler', 'action' => 'comments', 'priority' => 7, 'description' => 'Entries comments' ), array( 'name' => 'atom_entry', 'parse_regex' => '%^(?P[^/]+)/atom/?$%i', 'build_str' => '{$slug}/atom', 'handler' => 'AtomHandler', 'action' => 'entry', 'priority' => 8, 'description' => 'Atom Publishing Protocol' ), array( 'name' => 'atom_entry_comments', 'parse_regex' => '%^(?P[^/]+)/atom/comments(?:/page/(?P\d+))?/?$%i', 'build_str' => '{$slug}/atom/comments(/page/{$page})', 'handler' => 'AtomHandler', 'action' => 'entry_comments', 'priority' => 8, 'description' => 'Entry comments' ), array( 'name' => 'atompub', 'parse_regex' => '%^atompub(?:/(?P[^/]+))?/?$%i', 'build_str' => 'atompub(/{$action})', 'handler' => 'AtomPubHandler', 'action' => 'dispatch', 'priority' => 1, 'description' => 'Atom Publishing Protocol' ), // XMLRPC array( 'name' => 'xmlrpc', 'parse_regex' => '%^xmlrpc/?$%i', 'build_str' => 'xmlrpc', 'handler' => 'XMLRPCServer', 'action' => 'xmlrpc_call', 'priority' => 8, 'description' => 'Handle incoming XMLRPC requests.' ) );