__construct() public method

public __construct ( $msg )
Beispiel #1
0
 /**
  * Constructor for SAML 2 response messages.
  *
  * @param string          $tagName The tag name of the root element.
  * @param \DOMElement|null $xml     The input message.
  * @throws \Exception
  */
 protected function __construct($tagName, \DOMElement $xml = null)
 {
     parent::__construct($tagName, $xml);
     $this->status = array('Code' => Constants::STATUS_SUCCESS, 'SubCode' => null, 'Message' => null);
     if ($xml === null) {
         return;
     }
     if ($xml->hasAttribute('InResponseTo')) {
         $this->inResponseTo = $xml->getAttribute('InResponseTo');
     }
     $status = Utils::xpQuery($xml, './saml_protocol:Status');
     if (empty($status)) {
         throw new \Exception('Missing status code on response.');
     }
     $status = $status[0];
     $statusCode = Utils::xpQuery($status, './saml_protocol:StatusCode');
     if (empty($statusCode)) {
         throw new \Exception('Missing status code in status element.');
     }
     $statusCode = $statusCode[0];
     $this->status['Code'] = $statusCode->getAttribute('Value');
     $subCode = Utils::xpQuery($statusCode, './saml_protocol:StatusCode');
     if (!empty($subCode)) {
         $this->status['SubCode'] = $subCode[0]->getAttribute('Value');
     }
     $message = Utils::xpQuery($status, './saml_protocol:StatusMessage');
     if (!empty($message)) {
         $this->status['Message'] = trim($message[0]->textContent);
     }
 }
 /**
  * MessageEcho constructor.
  *
  * @param bool $isEcho
  * @param int $appId
  * @param string $id
  * @param int $sequence
  * @param null|string $metadata
  * @param null|string $text
  * @param array $attachments
  */
 public function __construct($isEcho, $appId, $id, $sequence, $metadata = null, $text = null, array $attachments = [])
 {
     parent::__construct($id, $sequence, $text, $attachments);
     $this->isEcho = $isEcho;
     $this->appId = $appId;
     $this->metadata = $metadata;
 }
 /**
  * ReplyToMessage constructor.
  *
  * @param array  $data
  * @param string $bot_name
  *
  * @throws \Longman\TelegramBot\Exception\TelegramException
  */
 public function __construct(array $data, $bot_name = '')
 {
     //As explained in the documentation
     //Reply to message can't contain other reply to message entities
     unset($data['reply_to_message']);
     parent::__construct($data, $bot_name);
 }
Beispiel #4
0
 public function __construct()
 {
     parent::__construct();
     $this->BindSetting(Protocl::$byteOrder, Moudle::$Auth);
     $this->code = 0;
     $this->city = "Beijing";
 }
Beispiel #5
0
 public function __construct($status = 200, array $headers = array(), Stream $body, $protocol = '1.1', $reason = null)
 {
     parent::__construct($headers, $body, $protocol);
     $this->statuses = array(100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authorative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported', 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Request Range Not Satisfied', 417 => 'Expectation Failed', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout');
     $this->status = $status;
     $this->reasonPhrase = $reason;
 }
Beispiel #6
0
 /**
  * Create a new SMS text message.
  *
  * @param string $to
  * @param string $from
  * @param string $title
  * @param string $url
  * @param int $validity
  */
 public function __construct($to, $from, $title, $url, $validity)
 {
     parent::__construct($to, $from);
     $this->title = (string) $title;
     $this->url = (string) $url;
     $this->validity = (int) $validity;
 }
 function __construct($requestId, $options, $topicName)
 {
     parent::__construct();
     $this->options = $options;
     $this->topicName = $topicName;
     $this->setRequestId($requestId);
 }
 public function __construct($data, $connection)
 {
     parent::__construct($data, $connection);
     $cache = \Cache::get($connection->session);
     $this->message = strip_tags($data->message);
     $this->nickname = $cache['nickname'];
 }
Beispiel #9
0
 /**
  * @param ConnectionInterface $connection
  * @param int $format notification format, defaults to 2
  * @throws CException
  */
 public function __construct(ConnectionInterface &$connection, $format = self::FORMAT_DEFAULT)
 {
     parent::__construct($connection);
     if (!in_array($format, [self::FORMAT_SIMPLE, self::FORMAT_ENHANCED, self::FORMAT_DEFAULT])) {
         throw new CException('Unknown message format.');
     }
     $this->_format = $format;
 }
Beispiel #10
0
 public function __construct()
 {
     $this->notify_id = 0;
     $this->notify_type = -1;
     $this->payload = '';
     $this->restricted_package_name = Constants::$packageName;
     parent::__construct();
 }
 public function __construct(array $params, $toUser)
 {
     #-------------------------------------------------------------------------------
     parent::__construct('DomainOrdersOnRegister', $toUser);
     #-------------------------------------------------------------------------------
     $this->setParams($params);
     #-------------------------------------------------------------------------------
 }
 /**
  * Creates a new guestbook comment object.
  * 
  * @param	integer		$commentID
  * @param	array		$row
  */
 public function __construct($entryID, $row = null)
 {
     if ($entryID !== null) {
         $sql = "SELECT\t\tcomment.*\n\t\t\t\tFROM\t\twcf" . WCF_N . "_user_guestbook_comment comment\n\t\t\t\tWHERE\t\tcomment.commentID = " . $commentID;
         $row = WCF::getDB()->getFirstRow($sql);
     }
     parent::__construct($row);
 }
 public function __construct($id = 0)
 {
     parent::__construct();
     if ($id) {
         if (!$this->charger_id($id)) {
             throw new TheliaAdminException("Message not found", TheliaAdminException::MESSAGE_NOT_FOUND);
         }
     }
 }
 /**
  * Creates a new guestbook entry object.
  * 
  * @param	integer		$entryID
  * @param	array		$row
  */
 public function __construct($entryID, $row = null)
 {
     if ($entryID !== null) {
         $sql = "SELECT\t\tentry.*,\n\t\t\t\t\t\tCOUNT(comment.commentID) AS commentCount,\n\t\t\t\t\t\tGROUP_CONCAT(comment.commentID ORDER BY comment.commentID ASC SEPARATOR ',') AS commentIDs\n\t\t\t\tFROM\t\twcf" . WCF_N . "_user_guestbook_entry entry\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_user_guestbook_comment comment\n\t\t\t\tON\t\t(entry.entryID = comment.entryID)\n\t\t\t\tWHERE\t\tentry.entryID = " . $entryID;
         $row = WCF::getDB()->getFirstRow($sql);
     }
     $this->commentList = new UserGuestbookCommentList();
     parent::__construct($row);
 }
Beispiel #15
0
 /**
  * Constructor
  *
  * @param int $requestId
  * @param mixed $options
  * @param string $topicName
  * @param mixed $arguments
  * @param mixed $argumentsKw
  */
 public function __construct($requestId, $options, $topicName, $arguments = null, $argumentsKw = null)
 {
     parent::__construct();
     $this->setRequestId($requestId);
     $this->setArguments($arguments);
     $this->setArgumentsKw($argumentsKw);
     $this->setOptions($options);
     $this->topicName = $topicName;
 }
Beispiel #16
0
 /**
  * Creates a new PM object.
  * 
  * @param	integer		$pmID
  * @param	array		$row
  */
 public function __construct($pmID, $row = null)
 {
     if ($pmID !== null) {
         $sql = "SELECT\t\trecipient.*,\n\t\t\t\t\t\tpm.*,\n\t\t\t\t\t\tuser.username\n\t\t\t\tFROM \t\twcf" . WCF_N . "_pm pm\n\t\t\t\tLEFT JOIN \twcf" . WCF_N . "_pm_to_user recipient\n\t\t\t\tON \t\t(recipient.pmID = pm.pmID\n\t\t\t\t\t\tAND recipient.recipientID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\tAND recipient.isDeleted < 2)\n\t\t\t\tLEFT JOIN \twcf" . WCF_N . "_user user\n\t\t\t\tON \t\t(user.userID = pm.userID)\n\t\t\t\tWHERE \t\tpm.pmID = " . $pmID;
         $row = WCF::getDB()->getFirstRow($sql);
     }
     $this->messageID = $row['pmID'];
     parent::__construct($row);
 }
Beispiel #17
0
 /**
  * Constructor
  *
  * @param int $requestId
  * @param mixed $options
  * @param string $procedureName
  * @param mixed $arguments
  * @param mixed $argumentsKw
  */
 public function __construct($requestId, $options, $procedureName, $arguments = null, $argumentsKw = null)
 {
     parent::__construct();
     $this->setRequestId($requestId);
     $this->setOptions($options);
     $this->setProcedureName($procedureName);
     $this->setArguments($arguments);
     $this->setArgumentsKw($argumentsKw);
 }
 /**
  * Creates a new post object.
  *
  * If id is set, the function reads the post data from database.
  * Otherwise it uses the given resultset.
  *
  * @param 	integer 	$postID		id of a post
  * @param 	array 		$row		resultset with post data form database
  */
 public function __construct($postID, $row = null)
 {
     if ($postID !== null) {
         $sql = "SELECT\t*\n\t\t\t\tFROM \twbb" . WBB_N . "_post\n\t\t\t\tWHERE \tpostID = " . $postID;
         $row = WCF::getDB()->getFirstRow($sql);
     }
     parent::__construct($row);
     $this->messageID = $row['postID'];
 }
Beispiel #19
0
 /**
  * Construct a response object.
  *
  * @param int $status Status code.
  * @param string|resource|\Psr\Http\Message\StreamInterface $body Response
  * body.
  */
 public function __construct($status, $body = 'php://memory')
 {
     if (!$body instanceof \Psr\Http\Message\StreamInterface) {
         $body = new PhpStream($body, 'wb+');
     }
     parent::__construct($body);
     $this->status = $status;
     $this->reason = Status::phrase($status);
 }
 /**
  * Creates a new entry message object.
  *
  * @param 	integer 	$messageID
  * @param 	array 		$row
  */
 public function __construct($messageID, $row = null)
 {
     if ($messageID !== null) {
         $sql = "SELECT\t\tmessage.*\n\t\t\t\tFROM \t\twcf" . WCF_N . "_cheat_database_entry_message message\n\t\t\t\tWHERE \t\tmessage.messageID = " . $messageID;
         $row = WCF::getDB()->getFirstRow($sql);
     }
     parent::__construct($row);
     $this->messageID = $row['messageID'];
 }
Beispiel #21
0
 /**
  * @param $subscriptionId
  * @param $publicationId
  * @param $details
  * @param null $arguments
  * @param null $argumentsKw
  */
 function __construct($subscriptionId, $publicationId, $details, $arguments = null, $argumentsKw = null)
 {
     parent::__construct();
     $this->setArguments($arguments);
     $this->setArgumentsKw($argumentsKw);
     $this->details = $details;
     $this->publicationId = $publicationId;
     $this->subscriptionId = $subscriptionId;
 }
 public function __construct($title = '', $body = '')
 {
     if ($title) {
         $this->title = $title;
     }
     if ($body) {
         $this->body = $body;
     }
     parent::__construct();
 }
Beispiel #23
0
 public function __construct($url = '', $method = self::METHOD_GET, $data = array(), $cookies = array(), $headers = array(), $files = array())
 {
     if ($url && !preg_match('/^[a-z][a-z0-9+.-]+:\\/\\//i', $url)) {
         $url = 'http://' . $url;
     }
     parent::__construct($url, $data, $cookies, $headers);
     $this->setMethod($method);
     // TODO: implement file uploads
     // $this->files = new FileCollection($files);
 }
Beispiel #24
0
 public function __construct($Me, $From, $User, $ID, $Type, $Time, $Name, $SubType, $URL, $File, $Size, $MIME, $Hash)
 {
     parent::__construct($Me, $From, $User, $ID, $Type, $Time, $Name);
     $this->SubType = $SubType;
     $this->URL = $URL;
     $this->File = $File;
     $this->Size = (int) $Size;
     $this->MIME = $MIME;
     $this->Hash = $Hash;
 }
 /**
  * Creates a new Newsletter object.
  *
  * @param int $newsletterID
  * @param array $row
  */
 public function __construct($newsletterID, array $row = array())
 {
     if ($newsletterID !== null && intval($newsletterID) > 0) {
         $sql = 'SELECT newsletterID, userID, deliveryTime, subject, text, enableSmilies, enableHtml, enableBBCodes
         		FROM wcf' . WCF_N . '_' . $this->databaseTable . ' newsletter
         		WHERE newsletter.newsletterID = ' . intval($newsletterID);
         $row = WCF::getDB()->getFirstRow($sql);
     }
     $this->messageID = $row['newsletterID'];
     parent::__construct($row);
 }
 public function __construct($data, $connection)
 {
     parent::__construct($data, $connection);
     $this->indexh = $data->indexh;
     $this->indexv = $data->indexv;
     $this->indexf = $data->indexf;
     $this->nextindexh = $data->nextindexh;
     $this->nextindexv = $data->nextindexv;
     $this->secret = $data->secret;
     $this->socketId = $data->socketId;
 }
Beispiel #27
0
 /**
  * Constructor.
  *
  * @param string $rawContent Original message as received from ami
  */
 public function __construct($rawContent)
 {
     parent::__construct();
     $this->rawContent = $rawContent;
     $lines = explode(Message::EOL, $rawContent);
     foreach ($lines as $line) {
         $content = explode(':', $line);
         $name = strtolower(trim($content[0]));
         unset($content[0]);
         $value = isset($content[1]) ? trim(implode(':', $content)) : '';
         $this->setKey($name, $value);
     }
 }
Beispiel #28
0
 public function __construct($Me, $From, $User, $ID, $Type, $Time, $Name, $SubType, $URL, $File, $Size, $MIME, $Hash)
 {
     $this->SubType = $SubType;
     $this->URL = !empty($URL) ? $URL : null;
     $this->File = $File;
     // It should be Filename => WhatsBot 2.2/3
     $this->Size = (int) $Size;
     $this->MIME = $MIME;
     $this->Hash = $Hash;
     parent::__construct($Me, $From, $User, $ID, $Type, $Time, $Name);
     $this->LoadData();
     $this->LoadPreview();
 }
Beispiel #29
0
 public function __construct($status, $data = '', $cookies = array(), $headers = array())
 {
     parent::__construct('', $data, $cookies, $headers);
     if (is_array($status)) {
         list($code, $message) = $status;
     } else {
         $code = $status;
         $message = '';
     }
     $this->setStatus($code, $message);
     /*$this->status(200)
     			 ->body('');
     
     		$this->headers = array();
     		$this->cookies = array();*/
 }
Beispiel #30
0
 /**
  * Constructor
  *
  * The constructor should be an array of options.
  *
  * If the option 'data' is provided, and is an instance of \ZendAPI_Job,
  * that object will be used as the internal job; if that option is not a
  * \ZendAPI_Job instance, an exception will be thrown.
  *
  * Alternately, you may specify the 'script' parameter, which should be a
  * JobQueue script the job will request. A new \ZendAPI_Job object will then
  * be created using that script and any options you provide.
  *
  * @param  array $options
  * @return void
  * @throws \ZendQueue\Exception
  */
 public function __construct(array $options = array())
 {
     if (isset($options['data'])) {
         if (!$options['data'] instanceof \ZendAPI_Job) {
             throw new Exception\InvalidArgumentException('Data must be an instance of \\ZendAPI_Job');
         }
         $this->_job = $options['data'];
         parent::__construct($this->_job->getProperties());
     } else {
         parent::__construct($options);
         if (!isset($options['script'])) {
             throw new Exception\InvalidArgumentException('The script is mandatory data');
         }
         $this->_job = new \ZendAPI_Job($options['script']);
         $this->_setJobProperties();
     }
 }