本文整理汇总了PHP中Request::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::__construct方法的具体用法?PHP Request::__construct怎么用?PHP Request::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Exception
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();
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
parent::setGetVar("id", "");
parent::setGetVar("fast", "false");
parent::processRequiredVars(["id"]);
}
示例3: __construct
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';
}
示例4: __construct
public function __construct($url, $data = array(), $callback = NULL)
{
if (!empty($data)) {
$url = trim($url, '/') . '/' . http_build_query($data);
}
return parent::__construct($url, array(), $callback);
}
示例5: __construct
/**
* 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);
}
}
示例6: __construct
/**
* 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;
}
示例7: __construct
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'] = 'GatewayUsername';
break;
case 'QuerySAFE':
$this->fields = $this->safefields;
// Override mapping with api-specific field maps
self::$mapping['safe_id'] = 'SafeID';
self::$mapping['gateway_username'] = 'GatewayUsername';
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;
}
示例8: __construct
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);
}
示例9: __construct
/**
* 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;
}
示例10: __construct
/**
* 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;
}
示例11: __construct
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;
}
}
示例12: __construct
public function __construct()
{
parent::__construct();
parent::setGetVar('id', '');
parent::setGetVar('fast', 'false');
parent::setGetVar('alerts', 'false');
parent::processRequiredVars(['id']);
}
示例13: __construct
/**
* 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);
}
示例14: __construct
/**
* 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";
}
示例15: __construct
/**
* 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;
}