CoMysqliPool.php 501 B

1234567891011121314151617181920212223242526
  1. <?php
  2. class CoMysqliPool extends CoRefPool
  3. {
  4. const max_clients = 100;
  5. private static $stInstance = null;
  6. public static function instance()
  7. {
  8. if (self::$stInstance == null) {
  9. self::$stInstance = new CoMysqliPool();
  10. }
  11. return self::$stInstance;
  12. }
  13. private function __construct()
  14. {
  15. parent::__construct(self::max_clients);
  16. }
  17. public function create_client()
  18. {
  19. return ['master' => null, 'slave' => null];
  20. }
  21. }