/**
  * @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;
 }
예제 #2
0
 /**
  * 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']);
     }
 }
 /**
  * @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;
 }
 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}";
 }
예제 #5
0
 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();
 }
예제 #6
0
 public function __construct(&$socket, $handlerID)
 {
     parent::__construct($socket, $handlerID);
 }
예제 #7
0
 /**
  * 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");
         }
     }
 }
예제 #8
0
 public function __construct(\PDO $pdo = null)
 {
     parent::__construct($pdo);
 }
예제 #9
0
 public function __construct()
 {
     parent::__construct();
     $this->trigger = $this->_drvlib('Trigger');
 }
예제 #10
0
 function __construct($merchantObj)
 {
     // call parent ctor to init members
     parent::__construct($merchantObj);
 }
예제 #11
0
 public function __construct()
 {
     parent::__construct();
     $this->user = $this->_drvlib('User');
 }
예제 #12
0
 public function __construct()
 {
     parent::__construct();
     $this->forge = $this->_drvlib('Forge');
 }
예제 #13
0
 public function __construct()
 {
     parent::__construct('http://example.com', 'guest', 'guest');
 }
예제 #14
0
 /**
  * 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);
 }
예제 #15
0
 /**
  * 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;
 }
 public function __construct($fd, $id = null, $pool = null)
 {
     parent::__construct($fd, $id, $pool);
     $this->onResponse = new SplStack();
 }
예제 #17
0
 public function __construct($host, $port = 21, $timeout = 90, $passive = false)
 {
     parent::__construct($host, 'anonymous', 'guest', $port, $timeout, $passive);
 }
예제 #18
0
 function __construct($host, $port, $path)
 {
     parent::__construct($host, $port);
     $this->path = $path;
 }
예제 #19
0
 public function __construct()
 {
     parent::__construct();
 }
예제 #20
0
파일: Client.php 프로젝트: shulard/Socket
 /**
  * Start a connection.
  *
  * @param   string  $socket     Socket URI.
  * @param   int     $timeout    Timeout.
  * @param   int     $flag       Flag, see the child::* constants.
  * @param   string  $context    Context ID (please, see the
  *                              \Hoa\Stream\Context class).
  * @return  void
  */
 public function __construct($socket, $timeout = 30, $flag = self::CONNECT, $context = null)
 {
     parent::__construct($socket, $timeout, self::CONNECT | $flag, $context);
     return;
 }
		public function AuthenticatedConnection($socket)
		{
			parent::__construct($socket);
			$this->rid = rand();      
		}     
예제 #22
0
 /**
  * Start a connection.
  *
  * @param   string  $socket     Socket URI.
  * @param   int     $timeout    Timeout.
  * @param   int     $flag       Flag, see the child::* constants.
  * @param   string  $context    Context ID (please, see the
  *                              \Hoa\Stream\Context class).
  * @return  void
  * @throws  \Hoa\Socket\Exception
  */
 public function __construct($socket, $timeout = 30, $flag = -1, $context = null)
 {
     $this->setSocket($socket);
     $socket = $this->getSocket();
     if ($flag == -1) {
         switch ($socket->getTransport()) {
             case 'tcp':
                 $flag = self::BIND | self::LISTEN;
                 break;
             case 'udp':
                 $flag = self::BIND;
                 break;
         }
     } else {
         switch ($socket->getTransport()) {
             case 'tcp':
                 $flag &= self::LISTEN;
                 break;
             case 'udp':
                 if ($flag & self::LISTEN) {
                     throw new Exception('Cannot use the flag ' . '\\Hoa\\Socket\\Server::LISTEN ' . 'for connect-less transports (such as UDP).', 0);
                 }
                 $flag = self::BIND;
                 break;
         }
     }
     parent::__construct(null, $timeout, $flag, $context);
     return;
 }
예제 #23
0
 public function __construct()
 {
     parent::__construct();
     $this->tool = $this->_drvlib('Tool');
 }