escape_tag($matches[2]) . $matches[3]; } interface PostdataInterface { /* Postdata format: * * The Postdata array is a simple intermediate data format * for the Post content and metadata. * It is slightly abstracted from the SQL format itself but will * only reformat keys, *not* do any alteration of the data itself. * * Any supported fields will be integrated into the database. * Other fields will be saved in a JSON structure, and will * be restored afterward. * * The following fields are mandatory for *writing* * - path: String, must be sanitized to consist of just alphanumeric * characters, `_-./` * used to identify the post itself * * The following fields may be returned by the database: * - id * - created_at * - updated_at * - view_count * * The following fields may be supported by the database: * - markdown: String, markdown of the post. May be * stored separately and won't be returned by default! * - type: String, defining the type of the post * - title: String, self-explanatory * - tags: Array of strings * - settings: Hash, recursively merged settings (calculated by DB!) * * The following fields are *recommended*, but nothing more: * - icon: String, optionally defining */ public function stub_postdata($path); public function stub_postdata_tree($path); public function set_postdata($data); public function set_post_markdown($id, $markdown); public function get_postdata($path); // Returns a key-value pair of child paths => child data public function get_post_children($path, $limit = 50, $depth_start = 1, $depth_end = 1, $order_by = 'path'); public function get_post_markdown($id); // Returns an array of PostData information // based on various search parameters. // // search_options can either be: // - An Array // - Or a String // // In case of it being an Array, it may include // the keys: // - "query" (which will be processed similar // to how $search_options will be processed), // - "text", which is searched for in text fields // (title, brief, fulltext), // - "tags", which is matched IN BINARY MODE against // the post tags // - "path", which is used as filter // - "order_by": determines which column to order by. NULL // will order by FULLTEXT match scores // - "limit" and "offset", self-explanatory public function search_posts($search_options); } ?>