[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> search.php (summary)

DokuWiki search functions

Author: Andreas Gohr
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 510 lines (14 kb)
Included or required: 13 times
Referenced: 0 times
Includes or requires: 3 files
 inc/parserutils.php
 inc/JpegMeta.php
 inc/common.php

Defines 15 functions

  search()
  search_callback()
  search_qsearch()
  search_index()
  search_namespaces()
  search_media()
  search_list()
  search_pagename()
  search_allpages()
  search_backlinks()
  search_fulltext()
  search_reference()
  search_regex()
  sort_search_fulltext()
  pathID()

Functions
Functions that are not part of a class:

search(&$data,$base,$func,$opts,$dir='',$lvl=1)   X-Ref
recurse direcory

This function recurses into a given base directory
and calls the supplied function for each file and directory

author: Andreas Gohr <andi@splitbrain.org>
param: array ref $data The results of the search are stored here
param: string    $base Where to start the search
param: callback  $func Callback (function name or arayy with object,method)
param: string    $dir  Current directory beyond $base
param: int       $lvl  Recursion Level

search_callback($func,&$data,$base,$file,$type,$lvl,$opts)   X-Ref
Wrapper around call_user_func_array.


search_qsearch(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
Searches for pages beginning with the given query

author: Andreas Gohr <andi@splitbrain.org>

search_index(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
Build the browsable index of pages

$opts['ns'] is the current namespace

author: Andreas Gohr <andi@splitbrain.org>

search_namespaces(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
List all namespaces

author: Andreas Gohr <andi@splitbrain.org>

search_media(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
List all mediafiles in a namespace

author: Andreas Gohr <andi@splitbrain.org>

search_list(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
This function just lists documents (for RSS namespace export)

author: Andreas Gohr <andi@splitbrain.org>

search_pagename(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
Quicksearch for searching matching pagenames

$opts['query'] is the search query

author: Andreas Gohr <andi@splitbrain.org>

search_allpages(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
Just lists all documents

author: Andreas Gohr <andi@splitbrain.org>

search_backlinks(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
Search for backlinks to a given page

$opts['ns']    namespace of the page
$opts['name']  name of the page without namespace

author: Andreas Gohr <andi@splitbrain.org>

search_fulltext(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
Fulltextsearch

$opts['query'] is the search query

author: Andreas Gohr <andi@splitbrain.org>

search_reference(&$data,$base,$file,$type,$lvl,$opts)   X-Ref
Reference search
This fuction searches for existing references to a given media file
and returns an array with the found pages. It doesn't pay any
attention to ACL permissions to find every reference. The caller
must check if the user has the appropriate rights to see the found
page and eventually have to prevent the result from displaying.

author: Andreas Gohr <andi@splitbrain.org>
author: Matthias Grimm <matthiasgrimm@users.sourceforge.net>
param: array  $data Reference to the result data structure
param: string $base Base usually $conf['datadir']
param: string $file current file or directory relative to $base
param: char   $type Type either 'd' for directory or 'f' for file
param: int    $lvl  Current recursion depht
param: mixed  $opts option array as given to search()

search_regex(&$data,$base,$file,$reg,$words)   X-Ref
fulltext search helper
searches a text file with a given regular expression
no ACL checks are performed. This have to be done by
the caller if necessary.

author: Andreas Gohr <andi@splitbrain.org>
author: Matthias Grimm <matthiasgrimm@users.sourceforge.net>
param: array  $data  reference to array for results
param: string $base  base directory
param: string $file  file name to search in
param: string $reg   regular expression to search for
param: array  $words words that should be marked in the results

sort_search_fulltext($a,$b)   X-Ref
fulltext sort

Callback sort function for use with usort to sort the data
structure created by search_fulltext. Sorts descending by count

author: Andreas Gohr <andi@splitbrain.org>

pathID($path,$keeptxt=false)   X-Ref
translates a document path to an ID

author: Andreas Gohr <andi@splitbrain.org>



Generated: Tue Dec 2 01:30:01 2008 Cross-referenced by PHPXref 0.7