Esempio n. 1
0
 public function __construct($username, $password, $method = \Phirehose::METHOD_SAMPLE, $format = self::FORMAT_JSON, $lang = FALSE)
 {
     $context = new \ZMQContext();
     $socket = $context->getSocket(\ZMQ::SOCKET_PUSH, 'hadoch');
     $socket->connect("tcp://localhost:5555");
     $this->zmq = $socket;
     $this->log = new SimpleLogger(SimpleLogger::DEBUG, BASE_PATH . '/track.log');
     parent::__construct($username, $password, $method, $format, $lang);
 }
Esempio n. 2
0
 /**
  * Overidden constructor to take class-specific parameters
  * 
  * @param string $token
  * @param string $secret
  * @param string $queueDir
  * @param integer $rotateInterval
  */
 public function __construct($token, $secret, $queueDir = \OpenFuego\TMP_DIR, $rotateInterval = 10)
 {
     // Set subclass parameters
     $this->queueDir = $queueDir;
     $this->rotateInterval = $rotateInterval;
     $this->_pcntlEnabled = function_exists('pcntl_signal_dispatch') ? TRUE : FALSE;
     // Call parent constructor
     return parent::__construct($token, $secret, \Phirehose::METHOD_FILTER);
 }
 /**
  * Overidden constructor to take class-specific parameters
  *
  * @param string $username
  * @param string $password
  * @param string $queueDir
  * @param integer $rotateInterval
  */
 public function __construct($username, $password, $queueDir = '/tmp', $rotateInterval = 10)
 {
     // Sanity check
     if ($rotateInterval < 5) {
         throw new Exception('Rotate interval set too low - Must be >= 5 seconds');
     }
     // Set subclass parameters
     $this->queueDir = $queueDir;
     $this->rotateInterval = $rotateInterval;
     // Call parent constructor
     return parent::__construct($username, $password, Phirehose::METHOD_FILTER);
 }
 /**
  * This function just exists to send a different default for $method
  *
  * @param String $username,$password The oauth token and oauth secret.
  * @param String $method Set to self::METHOD_USER for user streams, and to
  *           self::METHOD_SITE for site streams.
  */
 public function __construct($username, $password, $method = self::METHOD_USER, $format = self::FORMAT_JSON, $lang = FALSE)
 {
     parent::__construct($username, $password, $method, $format, $lang);
 }