push_factory.class.php 1006 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * push_factory.class.php 推送信息工厂类
  4. *
  5. * @copyright (C) 2005-2010 PHPCMS
  6. * @license http://www.phpcms.cn/license/
  7. * @lastmodify 2010-8-2
  8. */
  9. final class push_factory {
  10. /**
  11. * 推送信息工厂类静态实例
  12. */
  13. private static $push_factory;
  14. /**
  15. * 接口实例化列表
  16. */
  17. protected $api_list = array();
  18. /**
  19. * 返回当前终级类对象的实例
  20. * @return object
  21. */
  22. public static function get_instance() {
  23. if(push_factory::$push_factory == '') {
  24. push_factory::$push_factory = new push_factory();
  25. }
  26. return push_factory::$push_factory;
  27. }
  28. /**
  29. * 获取api操作实例
  30. * @param string $classname 接口调用的类文件名
  31. * @param sting $module 模块名
  32. * @return object
  33. */
  34. public function get_api($module = 'admin') {
  35. if(!isset($this->api_list[$module]) || !is_object($this->api_list[$module])) {
  36. $this->api_list[$module] = pc_base::load_app_class('push_api', $module);
  37. }
  38. return $this->api_list[$module];
  39. }
  40. }