예제 #1
0
 public function __construct($obj = null)
 {
     if (isset($obj)) {
         if (is_object($obj)) {
             $this->_obj = $obj;
         } else {
             if (is_string($obj)) {
                 try {
                     if (func_num_args()) {
                         $p = func_get_args();
                         unset($p[0]);
                         $ref = new ReflectionClass($obj);
                         $this->_obj = $ref->newInstanceArgs($p);
                         unset($ref);
                     } else {
                         $this->_obj = new $obj();
                     }
                 } catch (Exception $e) {
                     throw new Exception('Class "' . $obj . '" does not exists.');
                 }
             }
         }
     }
     parent::__construct();
 }
예제 #2
0
 public function __construct()
 {
     $this->app = C::app();
     $this->setting =& $this->app->var['setting'];
     $this->group =& $this->app->var['group'];
     $this->member =& $this->app->var['member'];
     parent::__construct();
 }
예제 #3
0
 public function __construct($para = array())
 {
     if (!empty($para)) {
         $this->_table = $para['table'];
         $this->_pk = $para['pk'];
     }
     if (isset($this->_pre_cache_key) && (($ttl = getglobal('setting/memory/' . $this->_table)) !== null || ($ttl = $this->_cache_ttl) !== null) && memory('check')) {
         $this->_cache_ttl = $ttl;
         $this->_allowmem = true;
     }
     parent::__construct();
 }
예제 #4
0
 public function __construct($para = array())
 {
     if (!empty($para)) {
         $this->_table = $para['table'];
         $this->_pk = $para['pk'];
     }
     //如果 $this->_table 和 $this->_pk 不为空 则统一加上缓存
     if (!isset($this->_pre_cache_key) && !empty($this->_table) && !empty($this->_pk)) {
         $this->_pre_cache_key = $this->_table . '_';
         if ($ttl = getglobal('setting/memory/' . $this->_table) == null) {
             $this->_cache_ttl = 86400;
             //默认缓存一天
         }
     }
     if (isset($this->_pre_cache_key) && (($ttl = getglobal('setting/memory/' . $this->_table)) !== null || ($ttl = $this->_cache_ttl) !== null) && memory('check')) {
         $this->_cache_ttl = $ttl;
         $this->_allowmem = true;
     }
     $this->_init_extend();
     parent::__construct();
 }
예제 #5
0
 public function __construct()
 {
     parent::__construct();
 }