[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> confutils.php (summary)

Utilities for collecting data from config files

Author: Harry Fuecks
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 467 lines (14 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 19 functions

  mimetype()
  getMimeTypes()
  getAcronyms()
  getSmileys()
  getEntities()
  getInterwiki()
  getCdnUrls()
  getWordblocks()
  getSchemes()
  linesToHash()
  confToHash()
  jsonToArray()
  retrieveConfig()
  getConfigFiles()
  actionOK()
  useHeading()
  conf_encodeString()
  conf_decodeString()
  array_merge_with_removal()

Functions
Functions that are not part of a class:

mimetype($file, $knownonly=true)   X-Ref
Returns the (known) extension and mimetype of a given filename

If $knownonly is true (the default), then only known extensions
are returned.

param: string $file file name
param: bool   $knownonly
author: Andreas Gohr <andi@splitbrain.org>
return: array with extension, mimetype and if it should be downloaded

getMimeTypes()   X-Ref
returns a hash of mimetypes

author: Andreas Gohr <andi@splitbrain.org>

getAcronyms()   X-Ref
returns a hash of acronyms

author: Harry Fuecks <hfuecks@gmail.com>

getSmileys()   X-Ref
returns a hash of smileys

author: Harry Fuecks <hfuecks@gmail.com>

getEntities()   X-Ref
returns a hash of entities

author: Harry Fuecks <hfuecks@gmail.com>

getInterwiki()   X-Ref
returns a hash of interwikilinks

author: Harry Fuecks <hfuecks@gmail.com>

getCdnUrls()   X-Ref
Returns the jquery script URLs for the versions defined in lib/scripts/jquery/versions

return: array

getWordblocks()   X-Ref
returns array of wordblock patterns


getSchemes()   X-Ref
Gets the list of configured schemes

return: array the schemes

linesToHash($lines, $lower = false)   X-Ref
Builds a hash from an array of lines

If $lower is set to true all hash keys are converted to
lower case.

param: array $lines
param: bool $lower
author: Harry Fuecks <hfuecks@gmail.com>
author: Andreas Gohr <andi@splitbrain.org>
author: Gina Haeussge <gina@foosel.net>
return: array

confToHash($file,$lower=false)   X-Ref
Builds a hash from a configfile

If $lower is set to true all hash keys are converted to
lower case.

param: string $file
param: bool $lower
author: Harry Fuecks <hfuecks@gmail.com>
author: Andreas Gohr <andi@splitbrain.org>
author: Gina Haeussge <gina@foosel.net>
return: array

jsonToArray($file)   X-Ref
Read a json config file into an array

param: string $file
return: array

retrieveConfig($type,$fn,$params=null,$combine='array_merge')   X-Ref
Retrieve the requested configuration information

param: string   $type     the configuration settings to be read, must correspond to a key/array in $config_cascade
param: callback $fn       the function used to process the configuration file into an array
param: array    $params   optional additional params to pass to the callback
param: callback $combine  the function used to combine arrays of values read from different configuration files;
author: Chris Smith <chris@jalakai.co.uk>
return: array    configuration values

getConfigFiles($type)   X-Ref
Include the requested configuration information

param: string   $type     the configuration settings to be read, must correspond to a key/array in $config_cascade
author: Chris Smith <chris@jalakai.co.uk>
return: array              list of files, default before local before protected

actionOK($action)   X-Ref
check if the given action was disabled in config

param: string $action
returns: boolean true if enabled, false if disabled
author: Andreas Gohr <andi@splitbrain.org>

useHeading($linktype)   X-Ref
check if headings should be used as link text for the specified link type

param: string  $linktype   'content'|'navigation', content applies to links in wiki text
author: Chris Smith <chris@jalakai.co.uk>
return: boolean             true if headings should be used for $linktype, false otherwise

conf_encodeString($str,$code)   X-Ref
obscure config data so information isn't plain text

param: string       $str     data to be encoded
param: string       $code    encoding method, values: plain, base64, uuencode.
return: string               the encoded value

conf_decodeString($str)   X-Ref
return obscured data as plain text

param: string      $str   encoded data
return: string             plain text

array_merge_with_removal($current, $new)   X-Ref
array combination function to remove negated values (prefixed by !)

param: array $current
param: array $new
return: array the combined array, numeric keys reset