[ 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: 502 lines (14 kb)
Included or required:0 times
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.

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

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.

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

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.

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

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

return: array
param: string $file

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

return: array    configuration values
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>

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

return: array              list of files, default before local before protected
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>

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

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

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

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

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

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

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

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