PageRenderTime 42ms CodeModel.GetById 29ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/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* */
10class 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
48	static function getc(){
49			return self::$nowclass;
50		}
51
52	static function Gp($name){
53		switch (func_num_args()) {
54			case 0:{
55				return FALSE;
56				break;
57			}
58			case 1:{
59				if(is_array(func_get_arg(0))){
60					$temp=func_get_arg(0);
61					$now='';
62					foreach ($temp as $value) {
63						if(!$now){
64							$now=self::${$value};
65						}else{
66							$now=$now[$value];
67						}
68
69					}
70					return $now;
71				}else {
72					return self::${func_get_arg(0)};
73				}
74
75				break;
76			}
77			default:{
78					return FALSE;
79				break;
80			}
81		}
82	}
83}
84?>