Source for file ConfigBox.php

Documentation is available at ConfigBox.php

  1. <?php
  2. /*
  3. * This file is part of Sylar.
  4. *
  5. * Sylar is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * Sylar is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with Sylar. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * @copyright Copyright Sylar Development Team
  19. * @license http://www.gnu.org/licenses/ GNU Public License V2.0
  20. * @see https://launchpad.net/sylar/
  21. * @see http://www.giano-solutions.com
  22. */
  23.  
  24. /**
  25. * Configuration Box
  26. *
  27. * A class that conteins all Sylar Configuration values read from config and settings file.
  28. *
  29. * @package Sylar
  30. * @version 1.0
  31. * @since 16/feb/08
  32. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  33. * @copyright Sylar Development Team
  34. */
  35. class Sylar_ConfigBox{
  36. function __construct(){
  37. # nothing to do
  38. }
  39. function __destruct() {
  40. # nothing to do
  41. }
  42.  
  43. /**
  44. * Return the Sylar default Charset set in the config file
  45. *
  46. * @since 16/feb/08
  47. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  48. *
  49. * @see sylar.php
  50. *
  51. * @return string
  52. */
  53. public static function getDefaultCharset(){
  54. return SYLAR_DEFAULT_CHARSET;
  55. }
  56. /**
  57. * Return the Sylar default locale
  58. *
  59. * @since 16/feb/08
  60. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  61. *
  62. * @see sylar.php
  63. *
  64. * @return string
  65. */
  66. public static function getDefaultLocaleKey(){
  67. return SYLAR_DEFAULT_LOCALE;
  68. }
  69. /**
  70. * Level of logger
  71. *
  72. * @since 16/feb/08
  73. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  74. *
  75. * @return string
  76. */
  77. public static function getLogLevel(){
  78. return SYLAR_LOG_LEVEL;
  79. }
  80. /**
  81. * return the name of the PHP session
  82. *
  83. * @since 16/feb/08
  84. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  85. *
  86. * @return string
  87. */
  88. public static function getSessionName(){
  89. return SYLAR_SESSION_NAME;
  90. }
  91. /**
  92. * return the path of locale folder
  93. *
  94. * @since apr/08
  95. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  96. *
  97. * @return string
  98. */
  99. public static function getLocaleFsRoot(){
  100. return SYLAR_ROOT_FS."locale/";
  101. }
  102. /**
  103. * return the path root of Sylar javascript files
  104. *
  105. * @since 16/feb/08
  106. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  107. *
  108. * @return string
  109. */
  110. public static function getSylarJsUrlPath(){
  111. return SYLAR_ROOT_URL."javascript/";
  112. }
  113.  
  114.  
  115. /**
  116. * return the path root of Sylar javascript files
  117. *
  118. * @since 16/feb/08
  119. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  120. *
  121. * @return string
  122. */
  123. public static function getSylarCssUrlPath(){
  124. return Sylar_ConfigBox::getSylarDefaultLayoutUrlPath()."css/";
  125. }
  126. /**
  127. * return the path root of Sylar layout templates collaction
  128. *
  129. * @since 16/feb/08
  130. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  131. *
  132. * @return string
  133. */
  134. private static function getSylarDefaultLayoutUrlPath(){
  135. return SYLAR_ROOT_URL."layouts/".SYLAR_DEFAULT_LAYOUTNAME."/";
  136. }
  137. /**
  138. * return the name of the default layout template set in Sylar
  139. *
  140. * @since 16/feb/08
  141. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  142. *
  143. * @return string
  144. */
  145. public static function getSylarDefaultLayout(){
  146. return SYLAR_DEFAULT_LAYOUTNAME;
  147. }
  148. /**
  149. * Debugmode
  150. * Return true if Sylar is in debug mode, false otherwise
  151. *
  152. * @since 16/feb/08
  153. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  154. *
  155. * @return boolean
  156. *
  157. * @see SYLAR_DEBUG_MODE
  158. */
  159. public static function isSylarInDebugMode(){
  160. if(SYLAR_DEBUG_MODE){
  161. return true;
  162. }else{
  163. return false;
  164. }
  165. }
  166. /**
  167. * Chek if a session is enable and required.
  168. * return true if a session is ON, false otherwise.
  169. *
  170. * @since 16/feb/08
  171. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  172. *
  173. * @return boolean
  174. */
  175. public static function isSessionEnabled(){
  176. if(SYLAR_SESSION_NAME){
  177. return true;
  178. }else{
  179. return false;
  180. }
  181. }
  182.  
  183. }
  184. ?>

Documentation generated on Thu, 24 Apr 2008 16:14:13 +0200 by phpDocumentor 1.3.0RC3