Provides functions for the query function.
Starting Sofawiki 3.0.0, swQuery and swFilter are depreciated. Use swRelation and swRelationFilter.
swFilter($filter,$namespace,$mode='query',$flags='',$checkhint=NULL)
Returns a table based on the fields of the pages.
@param $filter
SELECT fieldlist (FROM namespace)? (WHERE field operator string|WHERE field operator expression)?
SELECT fieldlist FROM VIRTUAL pagename (WHERE field operator string|WHERE field dollaroperator expression)?
If a swVirtualLinkHook() function is present, the filter can access external data
@param $namespace is also limited by the namespaces the user has access to or that are transcludable
@param $filter always "filter"
@param $flags "refresh" or "internal"
@param $checkhint provide a limiting bitmapswQuery($args)
Returns a table from a entire query.
@param $args query lines
NB the actual code is in the swQueryFunction classswQueryFieldlistCompare($revision,$fieldlist,$fields,$field,$operator,$term,$comparefields)
Compares a tuple against an operation and a term and returns a tuple (the WHERE part in SELECT)
@param $revision revision number for the key
@param $fieldlist all key-value pairs from the tuple
@param $fields the fields to include in the tuple
@param $field the field to check
@param $operator the comparison operator (==, <, >...)
@param term the value to check against
@param comparefieldsswFilterCompare($operator,$values,$term)
Compares as list of values against a term and returns if one of them matches
@param $operator the comparison operator (==, <, >...)
@param $values the list of values
@param term the value to check againstswGetFilterCacheHeader($filter,$namespace,$mode='query')
Gets header of filter cache from file in /site/queries
@param $filter
@param $namespace
@param $modeswQueryTupleExpression($row,$term)
Evaluates a swQuery RPN expression based on values of a tuple and returns result as a string
@param $row tuple
@param $term RPN expression
Allowed operators are: + - / * . (concat) :: (concat ::) ABS SIGN COPY POP SWAPswQuerySetKey($set,$term)
Calculates and sets key for rows of a table using term.
@param $set
@param $termswCleanTupleFieldOrder($rows)
Makes sure that all rows have the same order of fields.
Input rows may have not all keys or not in the same order. Rowkey is maintained.
@param $rowsswUniqueTuples($set)
Makes sure that all rows in table are unique
@param $set tableswMultifieldSort($a,$b)
Custom compare function for two arrays.
Compares the array joined with "::"
@param $a
@param $bswQuerySort($keys)
Custom sort function for SwQuery
@param $keysswQuerySortCompare($a,$b=NULL)
Custom compare function for SwQuery
Flags are in the key
# numeric
! desc
? familyname
@ url
& case insensitive
@param $a
@param $b
swBitmap, swQueryFunction, swRecord, swTemplateParser, swTidyParser, swWiki
echomem, echotime, swFileGetContents, swFilter, swFilterCompare, swGetAllFields, swGetBloomBitmapFromTerm, swGetFamilyName, swGetFilterCacheHeader, swNameURL, swNotify, swQueryFieldlistCompare, swQuerySortCompare, swQueryTupleExpression, swReadField, swSemaphoreRelease, swSemaphoreSignal, swUnescape, swWriteRow
$_REQUEST, $db, $swDebugRefresh, $swFunctions, $swIndexError, $swMaxOverallSearchTime, $swMaxSearchTime, $swMemoryLimit, $swOvertime, $swRoot, $swStartTime
$args, $arguments, $array, $bitmap, $cachechanged, $cachefile, $cachefilebase, $calcstack, $chbm, $checkedbitmap, $checkedcount, $checkedlength, $checkhint, $chunk, $chunkfile, $chunks, $comparefields, $content, $contenturl, $currentbitmap, $deletedbitmap, $delimiter, $desc, $even, $familyname, $fargs, $field, $field2, $fieldlist, $fieldlist2, $fields, $filter, $filter2, $filtercache, $flags, $found, $fresult, $goodrevisionchunk, $goodrevisionchunknew, $goodrevisions, $handle, $handle2, $header, $hint, $hooklink, $indexedbitmap, $keys, $lastfoundrevision, $lastjoin, $len0, $line, $list, $matches, $maxcount, $maxlastrevision, $mdfilter, $mode, $namefilter, $namefilter0, $namespace, $newspaces, $nocase, $notchecked, $notgr, $nowtime, $numeric, $onefieldvalue, $operator, $overtime, $pos2, $primary, $query, $quotes, $rating, $record, $result, $revision, $row2, $rows, $rows2, $set2, $set3, $sortkey, $spaces, $starttime, $table, $term, $term2, $termlist, $termurl, $test, $titleurl, $tocheck, $tocheckcount, $touched, $tuple, $urlname, $valuelist, $values, $verbose, $virtualmode, $wordlist, $words
Short variables: $a, $arg, $arr, $b, $bm, $ca, $cb, $dur, $f, $f2, $fa, $fb, $fi, $fn, $foo, $fp, $fs, $gr, $i, $k, $key, $kr, $ns, $op, $p, $p2, $pos, $row, $s, $set, $sp, $t, $toc, $url, $v, $w
array, class, file, function, math, php, preg, str, string, time, url, variable
swVirtualLinkHook