当前位置: 首页>>代码示例>>PHP>>正文


PHP Connection::__construct方法代码示例

本文整理汇总了PHP中Connection::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Connection::__construct方法的具体用法?PHP Connection::__construct怎么用?PHP Connection::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Connection的用法示例。


在下文中一共展示了Connection::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @param string $origin
  * @param string $destination
  * @param int $duration
  * @param string $mode
  * @param int $startTime
  * @param int $endTime
  */
 public function __construct($origin, $destination, $duration, $mode = parent::WALK, $startTime = 0, $endTime = PHP_INT_MAX)
 {
     parent::__construct($origin, $destination, $mode);
     $this->duration = $duration;
     $this->startTime = $startTime;
     $this->endTime = $endTime;
 }
开发者ID:linusnorton,项目名称:journey-planner,代码行数:15,代码来源:NonTimetableConnection.php

示例2: __construct

 /**
  * Constructor.
  * @param QueueInterface $queue
  * @param bool|true $autoconnect
  */
 public function __construct(QueueInterface &$queue, $autoconnect = true)
 {
     parent::__construct($queue);
     if ($autoconnect === true) {
         $this->queue->attachEventHandler('onBeforeProcess', [$this, 'open']);
         $this->queue->attachEventHandler('onAfterProcess', [$this, 'close']);
     }
 }
开发者ID:chervand,项目名称:yii-push,代码行数:13,代码来源:APNSConnection.php

示例3: __construct

 /**
  * @param string $origin
  * @param string $destination
  * @param int $departureTime
  * @param int $arrivalTime
  * @param string $service
  * @param string $operator
  * @param string $mode
  */
 public function __construct($origin, $destination, $departureTime, $arrivalTime, $service, $operator, $mode = parent::TRAIN)
 {
     parent::__construct($origin, $destination, $mode);
     $this->departureTime = $departureTime;
     $this->arrivalTime = $arrivalTime;
     $this->service = $service;
     $this->operator = $operator;
 }
开发者ID:linusnorton,项目名称:journey-planner,代码行数:17,代码来源:TimetableConnection.php

示例4:

 function __construct($concentrator, $name, $socket, $connected, $address = NULL, $port = NULL)
 {
     parent::__construct($concentrator, $name, $socket, $connected, $address = NULL, $port = NULL);
     $this->state = 'waiting_for_handshake';
     $this->mysql_connection = $this->concentrator->mysql_connection;
     if ($this->mysql_connection->handshake_init_packet != NULL) {
         $this->queue_write_packet($this->mysql_connection->handshake_init_packet);
     } else {
         $this->mysql_connection->queue($this);
     }
     $this->savepoint_name = "mysql_conc_{$this->port}";
 }
开发者ID:giant-rabbit,项目名称:mysql-concentrator,代码行数:12,代码来源:ClientConnection.php

示例5: __construct

 public function __construct($options = array())
 {
     $this->commands = ['MSG' => $this->MSG, '+OK' => $this->OK, '-ERR' => $this->ERR, 'PING' => $this->PING, 'PONG' => $this->PONG, 'INFO' => $this->INFO];
     $default_config = (require 'Config.php');
     $this->PING_REQUEST = 'PING' . $this->cr_lf;
     $this->PONG_RESPONSE = 'PONG' . $this->cr_lf;
     $this->pState = $this->AWAITING_CONTROL;
     $this->parseOptions($options, $default_config);
     // Create connection
     parent::__construct($this->options['url'], $this->options['port']);
     $this->sendCommand($this->buildConnectCommand());
     $this->flushPending();
     if ($this->reconnecting) {
         $this->sendSubscription();
     }
     $this->flush();
 }
开发者ID:skariuki,项目名称:php-nats,代码行数:17,代码来源:NATSClient.php

示例6: __construct

 public function __construct(&$socket, $handlerID)
 {
     parent::__construct($socket, $handlerID);
 }
开发者ID:johnvandeweghe,项目名称:JohnNet,代码行数:4,代码来源:ServerConnection.php

示例7: __construct

 /**
  * class constructor
  *
  * @param string $dsn CouchDB server data source name (eg. http://localhost:5984)
  * @param string $dbname CouchDB database name
  * @param array $options Additionnal configuration options
  * @throws Exception
  */
 public function __construct($dsn, $dbname, $options = array())
 {
     // in the case of a cookie based authentification we have to remove user and password infos from the DSN
     if (array_key_exists("cookie_auth", $options) && $options["cookie_auth"] == "true") {
         $parts = parse_url($dsn);
         if (!array_key_exists("user", $parts) || !array_key_exists("pass", $parts)) {
             throw new Exception("You should provide a user and a password to use cookie based authentification");
         }
         $user = $parts["user"];
         $pass = $parts["pass"];
         $dsn = $parts["scheme"] . "://" . $parts["host"];
         $dsn .= array_key_exists("port", $parts) ? ":" . $parts["port"] : "";
         $dsn .= array_key_exists("path", $parts) ? $parts["path"] : "";
     }
     $this->useDatabase($dbname);
     parent::__construct($dsn, $options);
     if (array_key_exists("cookie_auth", $options) && $options["cookie_auth"] == "true") {
         $raw_data = $this->query("POST", "/_session", null, http_build_query(array("name" => $user, "password" => $pass)), "application/x-www-form-urlencoded");
         list($headers, $body) = explode("\r\n\r\n", $raw_data, 2);
         $headers_array = explode("\n", $headers);
         foreach ($headers_array as $line) {
             if (strpos($line, "Set-Cookie: ") === 0) {
                 $line = substr($line, 12);
                 $line = explode("; ", $line, 2);
                 $this->setSessionCookie(reset($line));
                 break;
             }
         }
         if (!$this->sessioncookie) {
             throw new Exception("Cookie authentification failed");
         }
     }
 }
开发者ID:fibble,项目名称:PHP-on-CouchSync,代码行数:41,代码来源:Client.php

示例8: __construct

 public function __construct(\PDO $pdo = null)
 {
     parent::__construct($pdo);
 }
开发者ID:shenlu2011,项目名称:Hub-master,代码行数:4,代码来源:Table.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $this->trigger = $this->_drvlib('Trigger');
 }
开发者ID:znframework,项目名称:znframework,代码行数:5,代码来源:InternalDBTrigger.php

示例10:

 function __construct($merchantObj)
 {
     // call parent ctor to init members
     parent::__construct($merchantObj);
 }
开发者ID:neartux,项目名称:visitayucatan2.0,代码行数:5,代码来源:Parser.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     $this->user = $this->_drvlib('User');
 }
开发者ID:znframework,项目名称:znframework,代码行数:5,代码来源:InternalDBUser.php

示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $this->forge = $this->_drvlib('Forge');
 }
开发者ID:znframework,项目名称:znframework,代码行数:5,代码来源:InternalDBForge.php

示例13: __construct

 public function __construct()
 {
     parent::__construct('http://example.com', 'guest', 'guest');
 }
开发者ID:Angerslave,项目名称:youtrack,代码行数:4,代码来源:testconnection.php

示例14: __construct

 /**
  * Constructor
  *
  * @param string  $host    FTP Server adress
  * @param integer $port    Port to connect to
  * @param integer $timeout Default timeout
  */
 public function __construct($host, $port = 21, $timeout = 90)
 {
     parent::__construct($host, 'anonymous', 'guest', $port, $timeout);
 }
开发者ID:portey,项目名称:php-ftp-wrapper,代码行数:11,代码来源:AnonymousConnection.php

示例15: __construct

 /**
  * Constructor
  * 
  * @param string $address The address to listen on
  * @param int $port    The port to listen on
  */
 public function __construct($address, $port)
 {
     parent::__construct();
     $this->address = $address;
     $this->port = $port;
 }
开发者ID:emayk,项目名称:php-shellout,代码行数:12,代码来源:INETConnection.php


注:本文中的Connection::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。