vlibIni.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP version 4.3.x (and higher), tested with 5.1.4 |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 2002-2006 Kelvin Jones, Claus van Beek, Stefan Deussen |
  7. // +----------------------------------------------------------------------+
  8. // | Authors: Kelvin Jones, Claus van Beek, Stefan Deussen |
  9. // +----------------------------------------------------------------------+
  10. //
  11. // $Id: vlibIni.php 3041 2007-05-22 19:19:55Z b4rt $
  12. /*
  13. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  14. ; This file contains configuration parametres for use ;
  15. ; with the vLIB library. [ NOW A CLASS!! ] ;
  16. ; ;
  17. ; vLIB uses this file so that for future releases, you ;
  18. ; will not have to delve through all the php script ;
  19. ; again to set your specific variable/properties ..etc ;
  20. ; ;
  21. ; ---------------------------------------------------- ;
  22. ; ATTENTION: Do NOT remove any variable given in the ;
  23. ; configurations below as they will probably still be ;
  24. ; needed by vLIB. If you do not need a variable simply ;
  25. ; let it be. ;
  26. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  27. */
  28. if (!defined('vlibIniClassLoaded')) {
  29. define('vlibIniClassLoaded', 1);
  30. /**
  31. * vlibIni is a class used to store configuration parameters
  32. * for the vLIB library.
  33. *
  34. * @since 21/07/2002
  35. * @author Kelvin Jones, Claus van Beek, Stefan Deussen
  36. * @package vLIB
  37. * @access private
  38. */
  39. class vlibIni {
  40. /** config vars for vlibTemplate */
  41. function vlibTemplate () {
  42. global $cfg;
  43. return array(
  44. 'TEMPLATE_DIR' => '/var/www/themes/default/tmpl', // Default directory for your template files (full path) leave the '/' or '\' off the end of the directory.
  45. 'MAX_INCLUDES' => 10, // Drill depth for tmpl_include's
  46. 'GLOBAL_VARS' => 1, // if set to 1, any variables not found in a loop will search for a global var as well
  47. 'GLOBAL_CONTEXT_VARS' => 1, // if set to 1, vlibTemplate will add global vars (__SELF__, __REQUEST_URI__, __PARSE_TIME__) reflecting the environment.
  48. 'LOOP_CONTEXT_VARS' => 1, // if set to 1, vlibTemplate will add loop specific vars (see dokumentation) on each row of the loop.
  49. 'SET_LOOP_VAR' => 1, // Sets a global variable for each top level loops
  50. 'DEFAULT_ESCAPE' => 'none', // 1 of the following: html, url, sq, dq, none
  51. 'STRICT' => 0, // Dies when encountering an incorrect tmpl_* style tags i.e. tmpl_vae
  52. 'CASELESS' => 0, // Removes case sensitivity on all variables
  53. 'UNKNOWNS' => 'ignore', // How to handle unknown variables.
  54. // 1 of the following: ignore, remove, leave, print, comment
  55. // 1 of the following: ignore, remove, leave, print, comment
  56. 'TIME_PARSE' => '0', // Will enable you to time how long vlibTemplate takes to parse your template. You then use the function: getParseTime().
  57. 'ENABLE_PHPINCLUDE' => '0', // Will allow template to include a php file using <TMPL_PHPINCLUDE>
  58. 'ENABLE_SHORTTAGS' => '0', // Will allow you to use short tags in your script i.e.: <VAR name="my_var">, <LOOP name="my_loop">...</LOOP>
  59. /* the following are only used by the vlibTemplateCache class. */
  60. 'CACHE_DIRECTORY' => $cfg["path"].'.templateCache',
  61. // Directory where the cached filesystem
  62. // will be set up (full path, and must be writable)
  63. // '/' or '\' off the end of the directory.
  64. 'CACHE_LIFETIME' => 604800, // Duration until file is re-cached in seconds (604800 = 1 week)
  65. 'CACHE_EXTENSION' => 'vtc', // extention to be used by the cached file i.e. index.php will become index.vtc (vlibTemplate Compiled)
  66. 'DEBUG_WITHOUT_JAVASCRIPT' => 0 // if set to 1, the external debug window won't be displayed and the debug output is placed below every template output.
  67. );
  68. } // << end function vlibTemplate
  69. /** config vars for vlibDate */
  70. function vlibDate () {
  71. return array(
  72. 'DEFAULT_LANG' => 'en' // default language for the date displays
  73. );
  74. }// << end function vlibDate
  75. /** config vars for vlibSearchToSQL */
  76. function vlibSearchToSQL () {
  77. return array(
  78. 'MIN_WORD_LENGTH' => 3, // minimum length of word
  79. 'ALLOW_WILDCARDS' => 0, // whether to allow % and _ as wildcards in SQL LIKE '' clause
  80. 'ENCLOSE_FIELDS_WITH' => '', // i.e., enclose with ` will give you `search_field` LIKE ... Leave Empty for nothing
  81. 'DEFAULT_SEPERATOR' => 'OR', // default clause seperator, can have 'AND' or 'OR'
  82. // list of words that are not used in search
  83. 'STOP_WORDS' => 'a all an and are as at be but by can for from had have he her his in is it may not of on or that the there this to was where which will with you your'
  84. );
  85. }// << end function vlibSearchToSQL
  86. }// << end class vlibIni
  87. }
  88. ?>