XYZRefillFactory.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace refill;
  3. require_once(BASE_HELPER_PATH . '/refill/RefillBase.php');
  4. require_once(BASE_HELPER_PATH . '/refill/ProviderManager.php');
  5. require_once(BASE_HELPER_PATH . '/refill/order.php');
  6. require_once(BASE_HELPER_PATH . '/refill/divert_account.php');
  7. require_once(BASE_HELPER_PATH . '/refill/store_member.php');
  8. require_once(BASE_HELPER_PATH . '/rbridge/RBridgeFactory.php');
  9. require_once(BASE_HELPER_PATH . '/refill/policy/IPolicy.php');
  10. require_once(BASE_HELPER_PATH . '/refill/policy/xyz/policy.php');
  11. require_once(BASE_HELPER_PATH . '/refill/policy/try_judge.php');
  12. require_once(BASE_HELPER_PATH . '/refill/policy/chctl.php');
  13. require_once(BASE_HELPER_PATH . '/refill/policy/chctlex.php');
  14. require_once(BASE_HELPER_PATH . '/refill/policy/ctl_itemex.php');
  15. require_once(BASE_HELPER_PATH . '/refill/policy/mchctl.php');
  16. require_once(BASE_HELPER_PATH . '/refill/policy/mchoilctl.php');
  17. require_once(BASE_HELPER_PATH . '/refill/policy/times_caller.php');
  18. require_once(BASE_HELPER_PATH . '/refill/policy/quaility.php');
  19. require_once(BASE_HELPER_PATH . '/refill/policy/merchant_price.php');
  20. require_once(BASE_HELPER_PATH . '/refill/policy/rlock.php');
  21. require_once(BASE_HELPER_PATH . '/refill/policy/rstorage.php');
  22. require_once(BASE_HELPER_PATH . '/refill/policy/PolicyUtil.php');
  23. require_once(BASE_HELPER_PATH . '/refill/policy/xyz/quality_ploy.php');
  24. require_once(BASE_HELPER_PATH . '/refill/policy/mgroup.php');
  25. require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
  26. require_once(BASE_HELPER_PATH . '/refill/policy/mratio_control.php');
  27. require_once(BASE_HELPER_PATH . '/refill/policy/mratio_controlex.php');
  28. require_once(BASE_HELPER_PATH . '/refill/policy/overload_assigner.php');
  29. require_once(BASE_HELPER_PATH . '/refill/policy/interceptor.php');
  30. require_once(BASE_HELPER_PATH . '/refill/policy/transfer.php');
  31. require_once(BASE_HELPER_PATH . '/refill/policy/mchannel.php');
  32. require_once(BASE_HELPER_PATH . '/refill/functional.php');
  33. require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
  34. use Log;
  35. use StatesHelper;
  36. class XYZRefillFactory extends RefillBase
  37. {
  38. private static $stInstance = null;
  39. public static function instance()
  40. {
  41. if (self::$stInstance == null) {
  42. self::$stInstance = new XYZRefillFactory();
  43. }
  44. if(defined('SUPPORT_PTHREAD') && SUPPORT_PTHREAD === true)
  45. {
  46. Log::record("MOBILE_SERVER defined call load",Log::DEBUG);
  47. if(StatesHelper::fetch_state('channel')) {
  48. Log::record("RefillFactory reload channel config.",Log::DEBUG);
  49. self::$stInstance->load();
  50. }
  51. }
  52. return self::$stInstance;
  53. }
  54. private function __construct()
  55. {
  56. parent::__construct(new policy());
  57. if (defined('SUPPORT_PTHREAD') && SUPPORT_PTHREAD === true) {
  58. Log::record("SUPPORT_PTHREAD defined dont call load",Log::DEBUG);
  59. } else {
  60. Log::record("SUPPORT_PTHREAD has not defined and call load",Log::DEBUG);
  61. $this->load();
  62. }
  63. }
  64. }