12345678910111213141516171819202122232425262728 |
- <?php
- namespace common\logic;
- /**
- * Created by PhpStorm.
- * User: ZhangFeng
- * Date: 2018/1/30
- * Time: 11:41
- * Description:
- */
- use PhpAmqpLib\Connection\AMQPStreamConnection;
- class Connection
- {
- private static $_instance = null;
- static $HOST = '192.168.1.183';
- static $PORT = 5672;
- static $USER = 'zhaeng';
- static $PASS = 'zhaeng';
- static function getInstance()
- {
- if (is_null(self::$_instance)) {
- self::$_instance = new AMQPStreamConnection(self::$HOST, self::$PORT, self::$USER, self::$PASS);
- }
- return self::$_instance;
- }
- }
|