Example #1
0
 function __construct($from, $to, $time, $date, $timeSel, $results = 6, $lang = "EN", $format = "xml", $typeOfTransport = "all")
 {
     parent::__construct($format, $lang);
     if ($from == "" || $to == "") {
         throw new Exception("No stations specified");
     }
     //TODO: check on input
     $this->results = $results;
     $this->from = $from;
     $this->to = $to;
     $this->time = $time;
     $this->date = $date;
     $this->timeSel = $timeSel;
     $this->typeOfTransport = $typeOfTransport;
     //check for ID
     if (sizeof(explode(".", $from)) > 1) {
         $si = new StationsInput();
         $station = $si->getStationFromId($from, $this);
         $this->from = $station->getName();
     }
     if (sizeof(explode(".", $to)) > 1) {
         $si = new StationsInput();
         $station = $si->getStationFromId($to, $this);
         $this->to = $station->getName();
     }
 }
 public function __construct()
 {
     parent::__construct();
     parent::setGetVar("id", "");
     parent::setGetVar("fast", "false");
     parent::processRequiredVars(["id"]);
 }
Example #3
0
 public function __construct($op)
 {
     parent::__construct($op);
     // Override mapping with api-specific field maps
     self::$mapping['shipping_tracking_number'] = 'Tracking_Number';
     self::$mapping['shipping_carrier'] = 'Shipping_Carrier';
 }
Example #4
0
 public function __construct($url, $data = array(), $callback = NULL)
 {
     if (!empty($data)) {
         $url = trim($url, '/') . '/' . http_build_query($data);
     }
     return parent::__construct($url, array(), $callback);
 }
Example #5
0
 /**
  * Constructor for SAML 2 logout request messages.
  *
  * @param \DOMElement|null $xml The input message.
  * @throws \Exception
  */
 public function __construct(\DOMElement $xml = null)
 {
     parent::__construct('LogoutRequest', $xml);
     $this->sessionIndexes = array();
     if ($xml === null) {
         return;
     }
     if ($xml->hasAttribute('NotOnOrAfter')) {
         $this->notOnOrAfter = Utils::xsDateTimeToTimestamp($xml->getAttribute('NotOnOrAfter'));
     }
     $nameId = Utils::xpQuery($xml, './saml_assertion:NameID | ./saml_assertion:EncryptedID/xenc:EncryptedData');
     if (empty($nameId)) {
         throw new \Exception('Missing <saml:NameID> or <saml:EncryptedID> in <samlp:LogoutRequest>.');
     } elseif (count($nameId) > 1) {
         throw new \Exception('More than one <saml:NameID> or <saml:EncryptedD> in <samlp:LogoutRequest>.');
     }
     $nameId = $nameId[0];
     if ($nameId->localName === 'EncryptedData') {
         /* The NameID element is encrypted. */
         $this->encryptedNameId = $nameId;
     } else {
         $this->nameId = Utils::parseNameId($nameId);
     }
     $sessionIndexes = Utils::xpQuery($xml, './saml_protocol:SessionIndex');
     foreach ($sessionIndexes as $sessionIndex) {
         $this->sessionIndexes[] = trim($sessionIndex->textContent);
     }
 }
 /**
  * ListTopicsRequest constructor
  * 
  * @param string $project project name
  * @param string $logstore logstore name
  * @param string $token the start token to list topics
  * @param integer $line max topic counts to return
  */
 public function __construct($project = null, $logstore = null, $token = null, $line = null)
 {
     parent::__construct($project);
     $this->logstore = $logstore;
     $this->token = $token;
     $this->line = $line;
 }
Example #7
0
 public function __construct($op)
 {
     parent::__construct($op);
     switch ($this->op) {
         case 'TransactionAPI':
             $this->fields = $this->transfields;
             // Override mapping with api-specific field maps
             self::$mapping['safe_id'] = 'Safe_ID';
             self::$mapping['gateway_username'] = '******';
             break;
         case 'QuerySAFE':
             $this->fields = $this->safefields;
             // Override mapping with api-specific field maps
             self::$mapping['safe_id'] = 'SafeID';
             self::$mapping['gateway_username'] = '******';
             self::$mapping['gateway_key'] = 'APIKey';
             break;
         default:
             throw new \Agms\Exception\InvalidRequestException('Invalid op in Request.');
             break;
     }
     // switch op
     $this->needsAccount = true;
     $this->needsKey = true;
 }
 public function __construct(ParameterBag $parameters = null)
 {
     if (is_null($parameters)) {
         $parameters = new ParameterBag();
     }
     $parameters->set('Session_Type', self::SESSION_TYPE_RUNTIME)->set('Function', $this->getFunction());
     parent::__construct($parameters);
 }
Example #9
0
 /**
  * Initialize object
  *
  * @api
  *
  * @param array $data   Data from the $_SERVER array
  * @param Input $get    Input object generated from the $_GET array
  * @param Input $post   Input object generated from the $_POST array
  * @param Input $cookie Input object generated from the $_COOKIE array
  */
 public function __construct($data, Input $get = null, Input $post = null, Input $cookie = null, Input $files = null)
 {
     parent::__construct($data);
     $this->get = $get;
     $this->post = $post;
     $this->cookie = $cookie;
     $this->files = $files;
 }
 /**
  * PutLogsRequest cnstructor
  *
  * @param string $project
  *            project name
  * @param string $logstore
  *            logstore name
  * @param string $topic
  *            topic name
  * @param string $source
  *            source of the log
  * @param array $logitems
  *            LogItem array,log data
  */
 public function __construct($project = null, $logstore = null, $topic = null, $source = null, $logitems = null)
 {
     parent::__construct($project);
     $this->logstore = $logstore;
     $this->topic = $topic;
     $this->source = $source;
     $this->logitems = $logitems;
 }
Example #11
0
 public function __construct(\DOMElement $xml = null)
 {
     parent::__construct('ArtifactResolve', $xml);
     if (!is_null($xml)) {
         $results = Utils::xpQuery($xml, './saml_protocol:Artifact');
         $this->artifact = $results[0]->textContent;
     }
 }
Example #12
0
 public function __construct()
 {
     parent::__construct();
     parent::setGetVar('id', '');
     parent::setGetVar('fast', 'false');
     parent::setGetVar('alerts', 'false');
     parent::processRequiredVars(['id']);
 }
Example #13
0
 /**
  * Constructor for SAML 2 subject query messages.
  *
  * @param string          $tagName The tag name of the root element.
  * @param \DOMElement|null $xml     The input message.
  */
 protected function __construct($tagName, \DOMElement $xml = null)
 {
     parent::__construct($tagName, $xml);
     if ($xml === null) {
         return;
     }
     $this->parseSubject($xml);
 }
Example #14
0
 /**
  * Constructor
  * 
  * @param $root
  * @param $segments
  * @return unknown_type
  */
 public function __construct($dispatcher, $method, $root, &$segments, $query = null)
 {
     if (!$method) {
         $method = Request::get_request_method();
     }
     parent::__construct($dispatcher, strtoupper($method), $root, $segments, $query);
     $this->is_secure = $_SERVER['HTTPS'] == "on";
 }
 /**
  * GetHistogramsRequest constructor
  *
  * @param string $project
  *            project name
  * @param string $logstore
  *            logstore name
  * @param integer $from
  *            the begin time
  * @param integer $to
  *            the end time
  * @param string $topic
  *            topic name of logs
  * @param string $query
  *            user defined query
  */
 public function __construct($project = null, $logstore = null, $from = null, $to = null, $topic = null, $query = null)
 {
     parent::__construct($project);
     $this->logstore = $logstore;
     $this->from = $from;
     $this->to = $to;
     $this->topic = $topic;
     $this->query = $query;
 }
Example #16
0
 /**
  * Constructor
  * 
  * @param $root
  * @param $segments
  * @return unknown_type
  */
 public function __construct($dispatcher, $method, $root, &$segments, $query = null)
 {
     $result = parse_switches();
     foreach ($result as $key => $value) {
         $_GET[$key] = $value;
     }
     parent::__construct($dispatcher, $method, $root, $segments, $query);
     $this->method = 'POST';
 }
Example #17
0
 public function __construct($url, $data = array(), $callback = NULL)
 {
     $config = array();
     if (!empty($data)) {
         $config[CURLOPT_POST] = 1;
         $config[CURLOPT_POSTFIELDS] = $data;
     }
     return parent::__construct($url, $config, $callback);
 }
Example #18
0
 public function __construct()
 {
     parent::__construct();
     //set default values
     $this->IsCreateInvoice = "true";
     $this->InvoiceHead_SendByEmail = "true";
     $this->InvoiceHead_Language = self::INVOICE_LANGUAGE_HEBREW;
     $this->Operation = self::OPERATION_BILL;
 }
Example #19
0
File: cli.php Project: nexgenta/mq
 public function __construct($queueName)
 {
     parent::__construct();
     $this->sapi = 'mq';
     $this->method = '__MQ__';
     $this->queueName = $queueName;
     $this->params = array($queueName);
     $this->hostname = php_uname('n');
     $this->types = array('text/plain');
 }
Example #20
0
 /**
  * @final
  * @param array $serverParams
  * @param array $uploadedFiles
  * @param null|UriInterface $uri
  * @param string $method
  * @param mixed $body
  * @param array $headers
  * @param array $cookieParams
  * @param array $queryParams
  * @param mixed $parsedBody
  * @param array $attributes
  */
 public final function __construct(array $serverParams = [], array $uploadedFiles = [], UriInterface $uri = null, string $method = "GET", $body = "php://input", array $headers = [], array $cookieParams = [], array $queryParams = [], $parsedBody = null, $attributes = [])
 {
     parent::__construct($uri, $method, $body, $headers);
     $this->checkUploadedFiles($uploadedFiles);
     $this->serverParams = $serverParams;
     $this->cookieParams = $cookieParams;
     $this->queryParams = $queryParams;
     $this->uploadedFiles = $uploadedFiles;
     $this->parsedBody = $parsedBody;
     $this->attributes = $attributes;
 }
Example #21
0
 /**
  * @param array $data
  */
 public function __construct($data = array())
 {
     if (empty($data)) {
         $data = $_REQUEST;
     }
     //
     parent::__construct($data);
     //
     $this->detectURI();
     $this->detectDomain();
 }
Example #22
0
 /**
  * @param string $url
  */
 public function __construct($url)
 {
     $urlParts = parse_url($url);
     if (isset($urlParts['path'])) {
         $this->path = $urlParts['path'];
     }
     if (isset($urlParts['query'])) {
         parse_str($urlParts['query'], $this->queryParameters);
     }
     parent::__construct($this->createBaseUrl($urlParts));
 }
 public function __construct()
 {
     parent::__construct();
     $this->TokenToCharge_APILevel = '10';
     $this->TokenToCharge_Token = mb_strtoupper('9562a8da-2af2-48ce-8dd1-6ef122936f9f');
     $this->TokenToCharge_Salt = '10';
     //$this->TokenToCharge_CardValidityMonth = '16';
     //$this->TokenToCharge_CardValidityYear = '';
     $this->TokenToCharge_SumToBill = '10';
     $this->TokenToCharge_CoinID = '1';
     $this->TokenToCharge_NumOfPayments = '1';
 }
 /**
  * GetLogsRequest Constructor
  *
  * @param string $project
  *            project name
  * @param string $logStore
  *            logstore name
  * @param integer $from
  *            the begin time
  * @param integer $to
  *            the end time
  * @param string $topic
  *            topic name of logs
  * @param string $query
  *            user defined query
  * @param integer $line
  *            query return line number
  * @param integer $offset
  *            the log offset to return
  * @param bool $reverse
  *            if reverse is set to true, the query will return the latest logs first
  */
 public function __construct($project = null, $logstore = null, $from = null, $to = null, $topic = null, $query = null, $line = null, $offset = null, $reverse = null)
 {
     parent::__construct($project);
     $this->logstore = $logstore;
     $this->from = $from;
     $this->to = $to;
     $this->topic = $topic;
     $this->query = $query;
     $this->line = $line;
     $this->offset = $offset;
     $this->reverse = $reverse;
 }
 public function __construct($data)
 {
     parent::__construct($data);
     $this->intentName = $data['request']['intent']['name'];
     if (isset($data['request']['intent']['slots'])) {
         foreach ($data['request']['intent']['slots'] as $slot) {
             if (isset($slot['value'])) {
                 $this->slots[$slot['name']] = $slot['value'];
             }
         }
     }
 }
Example #26
0
 public function __construct($params = null, $file = null)
 {
     parent::__construct($params, $file);
     $this->isFusty = $this->getTotalSize() === null && $this->getFileName() && $this->getFile();
     if ($this->isFusty) {
         $this->params['flowTotalSize'] = isset($this->file['size']) ? $this->file['size'] : 0;
         $this->params['flowTotalChunks'] = 1;
         $this->params['flowChunkNumber'] = 1;
         $this->params['flowChunkSize'] = $this->params['flowTotalSize'];
         $this->params['flowCurrentChunkSize'] = $this->params['flowTotalSize'];
     }
 }
Example #27
0
 /**
  * @param array $data
  */
 public function __construct($data = array())
 {
     if (empty($data)) {
         $data = $_REQUEST;
     }
     //
     parent::__construct($data);
     //
     if (!empty($data)) {
         $this->parseURL();
     }
 }
Example #28
0
 function __construct($station, $date, $time, $arrdep = "DEP", $lang = "EN", $format = "xml", $isId = false)
 {
     parent::__construct($format, $lang);
     if (!$isId) {
         $this->station = $station;
     } else {
         $stin = new StationsInput();
         $this->station = $stin->getStationFromId($station, $this)->getName();
     }
     $this->date = $date;
     $this->time = $time;
     $this->arrdep = $arrdep;
 }
Example #29
0
 public function __construct($registry)
 {
     parent::__construct();
     $this->registry = $registry;
     if (function_exists('getallheaders')) {
         $this->headers = $this->clean(getallheaders());
     } else {
         $this->headers = $this->clean($this->getallheaders());
     }
     // Treat the PUT variables as POST variables.
     if ($this->server['REQUEST_METHOD'] == 'PUT') {
         parse_str(file_get_contents("php://input"), $this->post);
     }
 }
Example #30
0
 function __construct()
 {
     parent::__construct();
     parent::setGetVar("from", "");
     parent::setGetVar("to", "");
     parent::setGetVar("results", 6);
     parent::setGetVar("date", date("dmy"));
     parent::setGetVar("time", date("Hi"));
     parent::setGetVar("timeSel", "depart");
     parent::setGetVar("typeOfTransport", "train");
     parent::processRequiredVars(array("from", "to"));
     //reform date and time to wanted structure for hafas and railtime
     preg_match("/(..)(..)(..)/si", $this->date, $m);
     $this->date = "20" . $m[3] . $m[2] . $m[1];
     preg_match("/(..)(..)/si", $this->time, $m);
     $this->time = $m[1] . ":" . $m[2];
 }