[ Index ]
 

Code source de DokuWiki 2006-11-06

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/inc/ -> search.php (sommaire)

DokuWiki search functions

Author: Andreas Gohr <andi@splitbrain.org>
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
Poids: 510 lignes (14 kb)
Inclus ou requis: 8 fois
Référencé: 0 fois
Nécessite: 3 fichiers
 inc/parserutils.php
 inc/JpegMeta.php
 inc/common.php

Définit 15 fonctions

  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()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

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
Used to run the a user callback

Makes sure the $data array is passed by reference (unlike when using
call_user_func())

author: Andreas Gohr <andi@splitbrain.org>

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>



Généré le : Tue Apr 3 20:47:31 2007 par Balluche grâce à PHPXref 0.7