/source/includes/classes/Sys_xirang.php

http://prosporous.googlecode.com/ · PHP · 84 lines · 70 code · 4 blank · 10 comment · 4 complexity · 74be76c95804ebc8432ba4e3cb02a828 MD5 · raw file

  1. <?php
  2. /*................................................................
  3. [?? PHPCMS]
  4. . VERSION: 1.0
  5. . Author: SevenEl sevenelement@qq.com
  6. . Support: http://www.sevenel.cn
  7. ................................................................*/
  8. /*class configs
  9. * */
  10. class Sys {
  11. const VERSION = 1.0;
  12. //configure database
  13. private static $dbcfg = array(
  14. 'sevenel'=>array(
  15. 'host'=>"180.86.0.2",
  16. 'user'=>"project_f",
  17. 'psw'=>"project",
  18. 'database'=>"project",
  19. 'prefix'=>'se',
  20. 'new_link'=>true,
  21. 'encode'=>'utf8'
  22. ),
  23. 'sys'=>array(
  24. 'host'=>"localhost",
  25. 'user'=>"root",
  26. 'psw'=>"",
  27. 'database'=>"cms",
  28. 'prefix'=>'lm',
  29. 'new_link'=>true,
  30. 'encode'=>'utf8'
  31. )
  32. );
  33. //configure The web arguments
  34. private static $site_config = array(
  35. 'sitename' => '????'
  36. );
  37. private static $nowclass = array();
  38. static function Gv($name=''){
  39. if (!empty($name)){
  40. return self::$site_config[$name];
  41. }else
  42. return self::$site_config;
  43. }
  44. static function setc($classname,$handel){
  45. self::$nowclass[$classname][]=$handel;
  46. }
  47. static function getc(){
  48. return self::$nowclass;
  49. }
  50. static function Gp($name){
  51. switch (func_num_args()) {
  52. case 0:{
  53. return FALSE;
  54. break;
  55. }
  56. case 1:{
  57. if(is_array(func_get_arg(0))){
  58. $temp=func_get_arg(0);
  59. $now='';
  60. foreach ($temp as $value) {
  61. if(!$now){
  62. $now=self::${$value};
  63. }else{
  64. $now=$now[$value];
  65. }
  66. }
  67. return $now;
  68. }else {
  69. return self::${func_get_arg(0)};
  70. }
  71. break;
  72. }
  73. default:{
  74. return FALSE;
  75. break;
  76. }
  77. }
  78. }
  79. }
  80. ?>