PageRenderTime 65ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/source/class/discuz/discuz_extend.php

https://github.com/jinbo51/DiscuzX
PHP | 52 lines | 36 code | 10 blank | 6 comment | 4 complexity | 70a7604bce434b96f3a735470bdbf117 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: discuz_extend.php 30690 2012-06-12 05:57:59Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class discuz_extend extends discuz_container
  12. {
  13. public $setting;
  14. public $member;
  15. public $group;
  16. public $param;
  17. public function __construct($obj) {
  18. parent::__construct($obj);
  19. }
  20. public function __call($name, $p) {
  21. if(method_exists($this->_obj, $name)) {
  22. switch (count($p)) {
  23. case 0: return $this->_obj->{$name}();break;
  24. case 1: return $this->_obj->{$name}($p[0], $p[1]);break;
  25. case 2: return $this->_obj->{$name}($p[0], $p[1], $p[2]);break;
  26. case 3: return $this->_obj->{$name}($p[0], $p[1], $p[2], $p[3]);break;
  27. case 4: return $this->_obj->{$name}($p[0], $p[1], $p[2], $p[3], $p[4]);break;
  28. case 5: return $this->_obj->{$name}($p[0], $p[1], $p[2], $p[3], $p[4], $p[5]);break;
  29. default: return call_user_func_array(array($this->_obj, $name), $p);break;
  30. }
  31. } else {
  32. return parent::__call($name, $p);
  33. }
  34. }
  35. public function init_base_var(){
  36. $this->setting = &$this->_obj->setting;
  37. $this->member = &$this->_obj->member;
  38. $this->group = &$this->_obj->group;
  39. $this->param = &$this->_obj->param;
  40. }
  41. }
  42. ?>