repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
phpclassic/php-shopify | lib/AuthHelper.php | AuthHelper.createAuthRequest | public static function createAuthRequest($scopes, $redirectUrl = null, $state = null, $options = null, $return = false)
{
$config = ShopifySDK::$config;
if(!isset($config['ShopUrl']) || !isset($config['ApiKey'])) {
throw new SdkException("ShopUrl and ApiKey are required for authenticati... | php | public static function createAuthRequest($scopes, $redirectUrl = null, $state = null, $options = null, $return = false)
{
$config = ShopifySDK::$config;
if(!isset($config['ShopUrl']) || !isset($config['ApiKey'])) {
throw new SdkException("ShopUrl and ApiKey are required for authenticati... | [
"public",
"static",
"function",
"createAuthRequest",
"(",
"$",
"scopes",
",",
"$",
"redirectUrl",
"=",
"null",
",",
"$",
"state",
"=",
"null",
",",
"$",
"options",
"=",
"null",
",",
"$",
"return",
"=",
"false",
")",
"{",
"$",
"config",
"=",
"ShopifySDK... | Redirect the user to the authorization page to allow the app access to the shop
@see https://help.shopify.com/api/guides/authentication/oauth#scopes For allowed scopes
@param string|string[] $scopes Scopes required by app
@param string $redirectUrl
@param string $state
@param string[] $options
@param bool $return If ... | [
"Redirect",
"the",
"user",
"to",
"the",
"authorization",
"page",
"to",
"allow",
"the",
"app",
"access",
"to",
"the",
"shop"
] | train | https://github.com/phpclassic/php-shopify/blob/d3c7f3bdfed59dd4fdcd005cef80f7bfb5d4a6c3/lib/AuthHelper.php#L90-L129 |
phpclassic/php-shopify | lib/AuthHelper.php | AuthHelper.getAccessToken | public static function getAccessToken()
{
$config = ShopifySDK::$config;
if(!isset($config['SharedSecret']) || !isset($config['ApiKey'])) {
throw new SdkException("SharedSecret and ApiKey are required for getting access token. Please check SDK configuration!");
}
if(sel... | php | public static function getAccessToken()
{
$config = ShopifySDK::$config;
if(!isset($config['SharedSecret']) || !isset($config['ApiKey'])) {
throw new SdkException("SharedSecret and ApiKey are required for getting access token. Please check SDK configuration!");
}
if(sel... | [
"public",
"static",
"function",
"getAccessToken",
"(",
")",
"{",
"$",
"config",
"=",
"ShopifySDK",
"::",
"$",
"config",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'SharedSecret'",
"]",
")",
"||",
"!",
"isset",
"(",
"$",
"config",
"[",
"'... | Get Access token for the API
Call this when being redirected from shopify page ( to the $redirectUrl) after authentication
@throws SdkException if SharedSecret or ApiKey is missing in SDK configuration or request is not valid
@return string | [
"Get",
"Access",
"token",
"for",
"the",
"API",
"Call",
"this",
"when",
"being",
"redirected",
"from",
"shopify",
"page",
"(",
"to",
"the",
"$redirectUrl",
")",
"after",
"authentication"
] | train | https://github.com/phpclassic/php-shopify/blob/d3c7f3bdfed59dd4fdcd005cef80f7bfb5d4a6c3/lib/AuthHelper.php#L139-L160 |
phpclassic/php-shopify | lib/GiftCard.php | GiftCard.disable | public function disable()
{
$url = $this->generateUrl(array(), 'disable');
$dataArray = array(
'id' => $this->id,
);
return $this->post($dataArray, $url);
} | php | public function disable()
{
$url = $this->generateUrl(array(), 'disable');
$dataArray = array(
'id' => $this->id,
);
return $this->post($dataArray, $url);
} | [
"public",
"function",
"disable",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"generateUrl",
"(",
"array",
"(",
")",
",",
"'disable'",
")",
";",
"$",
"dataArray",
"=",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"id",
",",
")",
";",
"ret... | Disable a gift card.
Disabling a gift card is permanent and cannot be undone.
@return array | [
"Disable",
"a",
"gift",
"card",
".",
"Disabling",
"a",
"gift",
"card",
"is",
"permanent",
"and",
"cannot",
"be",
"undone",
"."
] | train | https://github.com/phpclassic/php-shopify/blob/d3c7f3bdfed59dd4fdcd005cef80f7bfb5d4a6c3/lib/GiftCard.php#L38-L47 |
phpclassic/php-shopify | lib/HttpRequestJson.php | HttpRequestJson.prepareRequest | protected static function prepareRequest($httpHeaders = array(), $dataArray = array())
{
self::$postDataJSON = json_encode($dataArray);
self::$httpHeaders = $httpHeaders;
if (!empty($dataArray)) {
self::$httpHeaders['Content-type'] = 'application/json';
self::$http... | php | protected static function prepareRequest($httpHeaders = array(), $dataArray = array())
{
self::$postDataJSON = json_encode($dataArray);
self::$httpHeaders = $httpHeaders;
if (!empty($dataArray)) {
self::$httpHeaders['Content-type'] = 'application/json';
self::$http... | [
"protected",
"static",
"function",
"prepareRequest",
"(",
"$",
"httpHeaders",
"=",
"array",
"(",
")",
",",
"$",
"dataArray",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"$",
"postDataJSON",
"=",
"json_encode",
"(",
"$",
"dataArray",
")",
";",
"self",... | Prepare the data and request headers before making the call
@param array $dataArray
@param array $httpHeaders
@return void | [
"Prepare",
"the",
"data",
"and",
"request",
"headers",
"before",
"making",
"the",
"call"
] | train | https://github.com/phpclassic/php-shopify/blob/d3c7f3bdfed59dd4fdcd005cef80f7bfb5d4a6c3/lib/HttpRequestJson.php#L46-L57 |
phpclassic/php-shopify | lib/HttpRequestJson.php | HttpRequestJson.get | public static function get($url, $httpHeaders = array())
{
self::prepareRequest($httpHeaders);
$response = CurlRequest::get($url, self::$httpHeaders);
return self::processResponse($response);
} | php | public static function get($url, $httpHeaders = array())
{
self::prepareRequest($httpHeaders);
$response = CurlRequest::get($url, self::$httpHeaders);
return self::processResponse($response);
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"httpHeaders",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"prepareRequest",
"(",
"$",
"httpHeaders",
")",
";",
"$",
"response",
"=",
"CurlRequest",
"::",
"get",
"(",
"$",
"url",
"... | Implement a GET request and return json decoded output
@param string $url
@param array $httpHeaders
@return string | [
"Implement",
"a",
"GET",
"request",
"and",
"return",
"json",
"decoded",
"output"
] | train | https://github.com/phpclassic/php-shopify/blob/d3c7f3bdfed59dd4fdcd005cef80f7bfb5d4a6c3/lib/HttpRequestJson.php#L67-L74 |
phpclassic/php-shopify | lib/HttpRequestJson.php | HttpRequestJson.post | public static function post($url, $dataArray, $httpHeaders = array())
{
self::prepareRequest($httpHeaders, $dataArray);
$response = CurlRequest::post($url, self::$postDataJSON, self::$httpHeaders);
return self::processResponse($response);
} | php | public static function post($url, $dataArray, $httpHeaders = array())
{
self::prepareRequest($httpHeaders, $dataArray);
$response = CurlRequest::post($url, self::$postDataJSON, self::$httpHeaders);
return self::processResponse($response);
} | [
"public",
"static",
"function",
"post",
"(",
"$",
"url",
",",
"$",
"dataArray",
",",
"$",
"httpHeaders",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"prepareRequest",
"(",
"$",
"httpHeaders",
",",
"$",
"dataArray",
")",
";",
"$",
"response",
"=",
... | Implement a POST request and return json decoded output
@param string $url
@param array $dataArray
@param array $httpHeaders
@return string | [
"Implement",
"a",
"POST",
"request",
"and",
"return",
"json",
"decoded",
"output"
] | train | https://github.com/phpclassic/php-shopify/blob/d3c7f3bdfed59dd4fdcd005cef80f7bfb5d4a6c3/lib/HttpRequestJson.php#L85-L92 |
phpclassic/php-shopify | lib/HttpRequestJson.php | HttpRequestJson.delete | public static function delete($url, $httpHeaders = array())
{
self::prepareRequest($httpHeaders);
$response = CurlRequest::delete($url, self::$httpHeaders);
return self::processResponse($response);
} | php | public static function delete($url, $httpHeaders = array())
{
self::prepareRequest($httpHeaders);
$response = CurlRequest::delete($url, self::$httpHeaders);
return self::processResponse($response);
} | [
"public",
"static",
"function",
"delete",
"(",
"$",
"url",
",",
"$",
"httpHeaders",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"prepareRequest",
"(",
"$",
"httpHeaders",
")",
";",
"$",
"response",
"=",
"CurlRequest",
"::",
"delete",
"(",
"$",
"url... | Implement a DELETE request and return json decoded output
@param string $url
@param array $httpHeaders
@return string | [
"Implement",
"a",
"DELETE",
"request",
"and",
"return",
"json",
"decoded",
"output"
] | train | https://github.com/phpclassic/php-shopify/blob/d3c7f3bdfed59dd4fdcd005cef80f7bfb5d4a6c3/lib/HttpRequestJson.php#L120-L127 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.buckets | public function buckets($shared = true)
{
$includeShared = "false";
if ($shared === true) {
$includeShared = "true";
}
return $this->rsGet('/buckets?shared=' . $includeShared);
} | php | public function buckets($shared = true)
{
$includeShared = "false";
if ($shared === true) {
$includeShared = "true";
}
return $this->rsGet('/buckets?shared=' . $includeShared);
} | [
"public",
"function",
"buckets",
"(",
"$",
"shared",
"=",
"true",
")",
"{",
"$",
"includeShared",
"=",
"\"false\"",
";",
"if",
"(",
"$",
"shared",
"===",
"true",
")",
"{",
"$",
"includeShared",
"=",
"\"true\"",
";",
"}",
"return",
"$",
"this",
"->",
... | 获取指定账号下所有的空间名。
@return string[] 包含所有空间名 | [
"获取指定账号下所有的空间名。"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L35-L42 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.listFiles | public function listFiles($bucket, $prefix = null, $marker = null, $limit = 1000, $delimiter = null)
{
$query = array('bucket' => $bucket);
\Qiniu\setWithoutEmpty($query, 'prefix', $prefix);
\Qiniu\setWithoutEmpty($query, 'marker', $marker);
\Qiniu\setWithoutEmpty($query, 'limit', $l... | php | public function listFiles($bucket, $prefix = null, $marker = null, $limit = 1000, $delimiter = null)
{
$query = array('bucket' => $bucket);
\Qiniu\setWithoutEmpty($query, 'prefix', $prefix);
\Qiniu\setWithoutEmpty($query, 'marker', $marker);
\Qiniu\setWithoutEmpty($query, 'limit', $l... | [
"public",
"function",
"listFiles",
"(",
"$",
"bucket",
",",
"$",
"prefix",
"=",
"null",
",",
"$",
"marker",
"=",
"null",
",",
"$",
"limit",
"=",
"1000",
",",
"$",
"delimiter",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"array",
"(",
"'bucket'",
"=>"... | 列取空间的文件列表
@param $bucket 空间名
@param $prefix 列举前缀
@param $marker 列举标识符
@param $limit 单次列举个数限制
@param $delimiter 指定目录分隔符
@return array 包含文件信息的数组,类似:[
{
"hash" => "<Hash string>",
"key" => "<Key string>",
"fsize" => "<file size>",
"putTime" => "<file modify time>"
},
...
]
@link http://developer.qi... | [
"列取空间的文件列表"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L79-L88 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.stat | public function stat($bucket, $key)
{
$path = '/stat/' . \Qiniu\entry($bucket, $key);
return $this->rsGet($path);
} | php | public function stat($bucket, $key)
{
$path = '/stat/' . \Qiniu\entry($bucket, $key);
return $this->rsGet($path);
} | [
"public",
"function",
"stat",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
"{",
"$",
"path",
"=",
"'/stat/'",
".",
"\\",
"Qiniu",
"\\",
"entry",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
";",
"return",
"$",
"this",
"->",
"rsGet",
"(",
"$",
"path",
... | 获取资源的元信息,但不返回文件内容
@param $bucket 待获取信息资源所在的空间
@param $key 待获取资源的文件名
@return array 包含文件信息的数组,类似:
[
"hash" => "<Hash string>",
"key" => "<Key string>",
"fsize" => <file size>,
"putTime" => "<file modify time>"
"fileType" => <file type>
]
@link http://developer.qiniu.com/docs/v6/api/reference/rs/stat.htm... | [
"获取资源的元信息,但不返回文件内容"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L107-L111 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.delete | public function delete($bucket, $key)
{
$path = '/delete/' . \Qiniu\entry($bucket, $key);
list(, $error) = $this->rsPost($path);
return $error;
} | php | public function delete($bucket, $key)
{
$path = '/delete/' . \Qiniu\entry($bucket, $key);
list(, $error) = $this->rsPost($path);
return $error;
} | [
"public",
"function",
"delete",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
"{",
"$",
"path",
"=",
"'/delete/'",
".",
"\\",
"Qiniu",
"\\",
"entry",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
";",
"list",
"(",
",",
"$",
"error",
")",
"=",
"$",
"thi... | 删除指定资源
@param $bucket 待删除资源所在的空间
@param $key 待删除资源的文件名
@return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
@link http://developer.qiniu.com/docs/v6/api/reference/rs/delete.html | [
"删除指定资源"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L122-L127 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.rename | public function rename($bucket, $oldname, $newname)
{
return $this->move($bucket, $oldname, $bucket, $newname);
} | php | public function rename($bucket, $oldname, $newname)
{
return $this->move($bucket, $oldname, $bucket, $newname);
} | [
"public",
"function",
"rename",
"(",
"$",
"bucket",
",",
"$",
"oldname",
",",
"$",
"newname",
")",
"{",
"return",
"$",
"this",
"->",
"move",
"(",
"$",
"bucket",
",",
"$",
"oldname",
",",
"$",
"bucket",
",",
"$",
"newname",
")",
";",
"}"
] | 给资源进行重命名,本质为move操作。
@param $bucket 待操作资源所在空间
@param $oldname 待操作资源文件名
@param $newname 目标资源文件名
@return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error | [
"给资源进行重命名,本质为move操作。"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L139-L142 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.copy | public function copy($from_bucket, $from_key, $to_bucket, $to_key, $force = false)
{
$from = \Qiniu\entry($from_bucket, $from_key);
$to = \Qiniu\entry($to_bucket, $to_key);
$path = '/copy/' . $from . '/' . $to;
if ($force === true) {
$path .= '/force/true';
}
... | php | public function copy($from_bucket, $from_key, $to_bucket, $to_key, $force = false)
{
$from = \Qiniu\entry($from_bucket, $from_key);
$to = \Qiniu\entry($to_bucket, $to_key);
$path = '/copy/' . $from . '/' . $to;
if ($force === true) {
$path .= '/force/true';
}
... | [
"public",
"function",
"copy",
"(",
"$",
"from_bucket",
",",
"$",
"from_key",
",",
"$",
"to_bucket",
",",
"$",
"to_key",
",",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"from",
"=",
"\\",
"Qiniu",
"\\",
"entry",
"(",
"$",
"from_bucket",
",",
"$",
"f... | 给资源进行重命名,本质为move操作。
@param $from_bucket 待操作资源所在空间
@param $from_key 待操作资源文件名
@param $to_bucket 目标资源空间名
@param $to_key 目标资源文件名
@return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
@link http://developer.qiniu.com/docs/v6/api/reference/rs/copy.html | [
"给资源进行重命名,本质为move操作。"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L155-L165 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.changeMime | public function changeMime($bucket, $key, $mime)
{
$resource = \Qiniu\entry($bucket, $key);
$encode_mime = \Qiniu\base64_urlSafeEncode($mime);
$path = '/chgm/' . $resource . '/mime/' . $encode_mime;
list(, $error) = $this->rsPost($path);
return $error;
} | php | public function changeMime($bucket, $key, $mime)
{
$resource = \Qiniu\entry($bucket, $key);
$encode_mime = \Qiniu\base64_urlSafeEncode($mime);
$path = '/chgm/' . $resource . '/mime/' . $encode_mime;
list(, $error) = $this->rsPost($path);
return $error;
} | [
"public",
"function",
"changeMime",
"(",
"$",
"bucket",
",",
"$",
"key",
",",
"$",
"mime",
")",
"{",
"$",
"resource",
"=",
"\\",
"Qiniu",
"\\",
"entry",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
";",
"$",
"encode_mime",
"=",
"\\",
"Qiniu",
"\\",
... | 主动修改指定资源的文件类型
@param $bucket 待操作资源所在空间
@param $key 待操作资源文件名
@param $mime 待操作文件目标mimeType
@return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
@link http://developer.qiniu.com/docs/v6/api/reference/rs/chgm.html | [
"主动修改指定资源的文件类型"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L200-L207 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.changeType | public function changeType($bucket, $key, $fileType)
{
$resource = \Qiniu\entry($bucket, $key);
$path = '/chtype/' . $resource . '/type/' . $fileType;
list(, $error) = $this->rsPost($path);
return $error;
} | php | public function changeType($bucket, $key, $fileType)
{
$resource = \Qiniu\entry($bucket, $key);
$path = '/chtype/' . $resource . '/type/' . $fileType;
list(, $error) = $this->rsPost($path);
return $error;
} | [
"public",
"function",
"changeType",
"(",
"$",
"bucket",
",",
"$",
"key",
",",
"$",
"fileType",
")",
"{",
"$",
"resource",
"=",
"\\",
"Qiniu",
"\\",
"entry",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
";",
"$",
"path",
"=",
"'/chtype/'",
".",
"$",
... | 修改指定资源的存储类型
@param $bucket 待操作资源所在空间
@param $key 待操作资源文件名
@param $fileType 待操作文件目标文件类型
@return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
@link https://developer.qiniu.com/kodo/api/3710/modify-the-file-type | [
"修改指定资源的存储类型"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L220-L226 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.changeStatus | public function changeStatus($bucket, $key, $status)
{
$resource = \Qiniu\entry($bucket, $key);
$path = '/chstatus/' . $resource . '/status/' . $status;
list(, $error) = $this->rsPost($path);
return $error;
} | php | public function changeStatus($bucket, $key, $status)
{
$resource = \Qiniu\entry($bucket, $key);
$path = '/chstatus/' . $resource . '/status/' . $status;
list(, $error) = $this->rsPost($path);
return $error;
} | [
"public",
"function",
"changeStatus",
"(",
"$",
"bucket",
",",
"$",
"key",
",",
"$",
"status",
")",
"{",
"$",
"resource",
"=",
"\\",
"Qiniu",
"\\",
"entry",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
";",
"$",
"path",
"=",
"'/chstatus/'",
".",
"$",
... | 修改文件的存储状态,即禁用状态和启用状态间的的互相转换
@param $bucket 待操作资源所在空间
@param $key 待操作资源文件名
@param $status 待操作文件目标文件类型
@return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
@link https://developer.qiniu.com/kodo/api/4173/modify-the-file-status | [
"修改文件的存储状态,即禁用状态和启用状态间的的互相转换"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L238-L244 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.prefetch | public function prefetch($bucket, $key)
{
$resource = \Qiniu\entry($bucket, $key);
$path = '/prefetch/' . $resource;
$ak = $this->auth->getAccessKey();
$ioHost = $this->config->getIovipHost($ak, $bucket);
$url = $ioHost . $path;
list(, $error) = $this->post($url, nu... | php | public function prefetch($bucket, $key)
{
$resource = \Qiniu\entry($bucket, $key);
$path = '/prefetch/' . $resource;
$ak = $this->auth->getAccessKey();
$ioHost = $this->config->getIovipHost($ak, $bucket);
$url = $ioHost . $path;
list(, $error) = $this->post($url, nu... | [
"public",
"function",
"prefetch",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
"{",
"$",
"resource",
"=",
"\\",
"Qiniu",
"\\",
"entry",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
";",
"$",
"path",
"=",
"'/prefetch/'",
".",
"$",
"resource",
";",
"$",
... | 从镜像源站抓取资源到空间中,如果空间中已经存在,则覆盖该资源
@param $bucket 待获取资源所在的空间
@param $key 代获取资源文件名
@return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
@link http://developer.qiniu.com/docs/v6/api/reference/rs/prefetch.html | [
"从镜像源站抓取资源到空间中,如果空间中已经存在,则覆盖该资源"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L291-L302 |
qiniu/php-sdk | src/Qiniu/Storage/BucketManager.php | BucketManager.deleteAfterDays | public function deleteAfterDays($bucket, $key, $days)
{
$entry = \Qiniu\entry($bucket, $key);
$path = "/deleteAfterDays/$entry/$days";
list(, $error) = $this->rsPost($path);
return $error;
} | php | public function deleteAfterDays($bucket, $key, $days)
{
$entry = \Qiniu\entry($bucket, $key);
$path = "/deleteAfterDays/$entry/$days";
list(, $error) = $this->rsPost($path);
return $error;
} | [
"public",
"function",
"deleteAfterDays",
"(",
"$",
"bucket",
",",
"$",
"key",
",",
"$",
"days",
")",
"{",
"$",
"entry",
"=",
"\\",
"Qiniu",
"\\",
"entry",
"(",
"$",
"bucket",
",",
"$",
"key",
")",
";",
"$",
"path",
"=",
"\"/deleteAfterDays/$entry/$days... | 设置文件的生命周期
@param $bucket 设置文件生命周期文件所在的空间
@param $key 设置文件生命周期文件的文件名
@param $days 设置该文件多少天后删除,当$days设置为0时表示取消该文件的生命周期
@return Mixed
@link https://developer.qiniu.com/kodo/api/update-file-lifecycle | [
"设置文件的生命周期"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/BucketManager.php#L336-L342 |
qiniu/php-sdk | src/Qiniu/Rtc/AppClient.php | AppClient.createApp | public function createApp($hub, $title, $maxUsers = null, $noAutoKickUser = null)
{
$params['hub'] = $hub;
$params['title'] = $title;
if (!empty($maxUsers)) {
$params['maxUsers'] = $maxUsers;
}
if (!empty($noAutoKickUser)) {
$params['noAutoKickUser'] =... | php | public function createApp($hub, $title, $maxUsers = null, $noAutoKickUser = null)
{
$params['hub'] = $hub;
$params['title'] = $title;
if (!empty($maxUsers)) {
$params['maxUsers'] = $maxUsers;
}
if (!empty($noAutoKickUser)) {
$params['noAutoKickUser'] =... | [
"public",
"function",
"createApp",
"(",
"$",
"hub",
",",
"$",
"title",
",",
"$",
"maxUsers",
"=",
"null",
",",
"$",
"noAutoKickUser",
"=",
"null",
")",
"{",
"$",
"params",
"[",
"'hub'",
"]",
"=",
"$",
"hub",
";",
"$",
"params",
"[",
"'title'",
"]",... | /*
创建应用
hub: 直播空间名
title: app 的名称 注意,Title 不是唯一标识,重复 create 动作将生成多个 app
maxUsers:人数限制
NoAutoKickUser: bool 类型,可选,禁止自动踢人(抢流)。默认为 false ,
即同一个身份的 client (app/room/user) ,新的连麦请求可以成功,旧连接被关闭。 | [
"/",
"*",
"创建应用",
"hub",
":",
"直播空间名",
"title",
":",
"app",
"的名称",
"注意,Title",
"不是唯一标识,重复",
"create",
"动作将生成多个",
"app",
"maxUsers:人数限制",
"NoAutoKickUser",
":",
"bool",
"类型,可选,禁止自动踢人(抢流)。默认为",
"false",
",",
"即同一个身份的",
"client",
"(",
"app",
"/",
"room",
"/",
"... | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Rtc/AppClient.php#L29-L42 |
qiniu/php-sdk | src/Qiniu/Rtc/AppClient.php | AppClient.updateApp | public function updateApp($appId, $hub, $title, $maxUsers = null, $mergePublishRtmp = null, $noAutoKickUser = null)
{
$url = $this->baseURL . '/' . $appId;
$params['hub'] = $hub;
$params['title'] = $title;
if (!empty($maxUsers)) {
$params['maxUsers'] = $maxUsers;
... | php | public function updateApp($appId, $hub, $title, $maxUsers = null, $mergePublishRtmp = null, $noAutoKickUser = null)
{
$url = $this->baseURL . '/' . $appId;
$params['hub'] = $hub;
$params['title'] = $title;
if (!empty($maxUsers)) {
$params['maxUsers'] = $maxUsers;
... | [
"public",
"function",
"updateApp",
"(",
"$",
"appId",
",",
"$",
"hub",
",",
"$",
"title",
",",
"$",
"maxUsers",
"=",
"null",
",",
"$",
"mergePublishRtmp",
"=",
"null",
",",
"$",
"noAutoKickUser",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"$",
"this",
... | /*
更新应用
appId: app 的唯一标识,创建的时候由系统生成。
Title: app 的名称, 可选。
Hub: 绑定的直播 hub,可选,用于合流后 rtmp 推流。
MaxUsers: int 类型,可选,连麦房间支持的最大在线人数。
NoAutoKickUser: bool 类型,可选,禁止自动踢人。
MergePublishRtmp: 连麦合流转推 RTMP 的配置,可选择。其详细配置包括如下
Enable: 布尔类型,用于开启和关闭所有房间的合流功能。
AudioOnly: 布尔类型,可选,指定是否只合成音频。
Height, Width: int64,可选,指定合流输出的高和宽,默认为 640 x 480。
O... | [
"/",
"*",
"更新应用",
"appId",
":",
"app",
"的唯一标识,创建的时候由系统生成。",
"Title",
":",
"app",
"的名称,",
"可选。",
"Hub",
":",
"绑定的直播",
"hub,可选,用于合流后",
"rtmp",
"推流。",
"MaxUsers",
":",
"int",
"类型,可选,连麦房间支持的最大在线人数。",
"NoAutoKickUser",
":",
"bool",
"类型,可选,禁止自动踢人。",
"MergePublishRtmp",
... | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Rtc/AppClient.php#L60-L77 |
qiniu/php-sdk | src/Qiniu/Rtc/AppClient.php | AppClient.getApp | public function getApp($appId)
{
$url = $this->baseURL . '/' . $appId;
$ret = $this->get($url);
return $ret;
} | php | public function getApp($appId)
{
$url = $this->baseURL . '/' . $appId;
$ret = $this->get($url);
return $ret;
} | [
"public",
"function",
"getApp",
"(",
"$",
"appId",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"baseURL",
".",
"'/'",
".",
"$",
"appId",
";",
"$",
"ret",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"url",
")",
";",
"return",
"$",
"ret",
";",
"... | /*
获取应用信息
appId: app 的唯一标识,创建的时候由系统生成。 | [
"/",
"*",
"获取应用信息",
"appId",
":",
"app",
"的唯一标识,创建的时候由系统生成。"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Rtc/AppClient.php#L83-L88 |
qiniu/php-sdk | src/Qiniu/Rtc/AppClient.php | AppClient.deleteApp | public function deleteApp($appId)
{
$url = $this->baseURL . '/' . $appId;
list(, $err) = $this->delete($url);
return $err;
} | php | public function deleteApp($appId)
{
$url = $this->baseURL . '/' . $appId;
list(, $err) = $this->delete($url);
return $err;
} | [
"public",
"function",
"deleteApp",
"(",
"$",
"appId",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"baseURL",
".",
"'/'",
".",
"$",
"appId",
";",
"list",
"(",
",",
"$",
"err",
")",
"=",
"$",
"this",
"->",
"delete",
"(",
"$",
"url",
")",
";",
... | /*
删除应用
appId: app 的唯一标识,创建的时候由系统生成 | [
"/",
"*",
"删除应用",
"appId",
":",
"app",
"的唯一标识,创建的时候由系统生成"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Rtc/AppClient.php#L94-L99 |
qiniu/php-sdk | src/Qiniu/Rtc/AppClient.php | AppClient.listUser | public function listUser($appId, $roomName)
{
$url = sprintf("%s/%s/rooms/%s/users", $this->baseURL, $appId, $roomName);
$ret = $this->get($url);
return $ret;
} | php | public function listUser($appId, $roomName)
{
$url = sprintf("%s/%s/rooms/%s/users", $this->baseURL, $appId, $roomName);
$ret = $this->get($url);
return $ret;
} | [
"public",
"function",
"listUser",
"(",
"$",
"appId",
",",
"$",
"roomName",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"\"%s/%s/rooms/%s/users\"",
",",
"$",
"this",
"->",
"baseURL",
",",
"$",
"appId",
",",
"$",
"roomName",
")",
";",
"$",
"ret",
"=",
"... | /*
获取房间内用户列表
appId: app 的唯一标识,创建的时候由系统生成。
roomName: 操作所查询的连麦房间。 | [
"/",
"*",
"获取房间内用户列表",
"appId",
":",
"app",
"的唯一标识,创建的时候由系统生成。",
"roomName",
":",
"操作所查询的连麦房间。"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Rtc/AppClient.php#L106-L111 |
qiniu/php-sdk | src/Qiniu/Rtc/AppClient.php | AppClient.kickUser | public function kickUser($appId, $roomName, $userId)
{
$url = sprintf("%s/%s/rooms/%s/users/%s", $this->baseURL, $appId, $roomName, $userId);
list(, $err) = $this->delete($url);
return $err;
} | php | public function kickUser($appId, $roomName, $userId)
{
$url = sprintf("%s/%s/rooms/%s/users/%s", $this->baseURL, $appId, $roomName, $userId);
list(, $err) = $this->delete($url);
return $err;
} | [
"public",
"function",
"kickUser",
"(",
"$",
"appId",
",",
"$",
"roomName",
",",
"$",
"userId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"\"%s/%s/rooms/%s/users/%s\"",
",",
"$",
"this",
"->",
"baseURL",
",",
"$",
"appId",
",",
"$",
"roomName",
",",
"$... | /*
踢出用户
appId: app 的唯一标识,创建的时候由系统生成。
roomName: 连麦房间
userId: 请求加入房间的用户ID | [
"/",
"*",
"踢出用户",
"appId",
":",
"app",
"的唯一标识,创建的时候由系统生成。",
"roomName",
":",
"连麦房间",
"userId",
":",
"请求加入房间的用户ID"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Rtc/AppClient.php#L119-L124 |
qiniu/php-sdk | src/Qiniu/Rtc/AppClient.php | AppClient.listActiveRooms | public function listActiveRooms($appId, $prefix = null, $offset = null, $limit = null)
{
if (isset($prefix)) {
$query['prefix'] = $prefix;
}
if (isset($offset)) {
$query['offset'] = $offset;
}
if (isset($limit)) {
$query['limit'] = $limit;
... | php | public function listActiveRooms($appId, $prefix = null, $offset = null, $limit = null)
{
if (isset($prefix)) {
$query['prefix'] = $prefix;
}
if (isset($offset)) {
$query['offset'] = $offset;
}
if (isset($limit)) {
$query['limit'] = $limit;
... | [
"public",
"function",
"listActiveRooms",
"(",
"$",
"appId",
",",
"$",
"prefix",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"prefix",
")",
")",
"{",
"$",
"query",
"[",
"'pr... | /*
获取应用中活跃房间
appId: app 的唯一标识,创建的时候由系统生成。
prefix: 所查询房间名的前缀索引,可以为空。
offset: int 类型,分页查询的位移标记。
limit: int 类型,此次查询的最大长度。
GET /v3/apps/<AppID>/rooms?prefix=<RoomNamePrefix>&offset=<Offset>&limit=<Limit> | [
"/",
"*",
"获取应用中活跃房间",
"appId",
":",
"app",
"的唯一标识,创建的时候由系统生成。",
"prefix",
":",
"所查询房间名的前缀索引,可以为空。",
"offset",
":",
"int",
"类型,分页查询的位移标记。",
"limit",
":",
"int",
"类型,此次查询的最大长度。",
"GET",
"/",
"v3",
"/",
"apps",
"/",
"<AppID",
">",
"/",
"rooms?prefix",
"=",
"<R... | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Rtc/AppClient.php#L134-L153 |
qiniu/php-sdk | src/Qiniu/Rtc/AppClient.php | AppClient.appToken | public function appToken($appId, $roomName, $userId, $expireAt, $permission)
{
$params['appId'] = $appId;
$params['userId'] = $userId;
$params['roomName'] = $roomName;
$params['permission'] = $permission;
$params['expireAt'] = $expireAt;
$appAccessString = json_encode... | php | public function appToken($appId, $roomName, $userId, $expireAt, $permission)
{
$params['appId'] = $appId;
$params['userId'] = $userId;
$params['roomName'] = $roomName;
$params['permission'] = $permission;
$params['expireAt'] = $expireAt;
$appAccessString = json_encode... | [
"public",
"function",
"appToken",
"(",
"$",
"appId",
",",
"$",
"roomName",
",",
"$",
"userId",
",",
"$",
"expireAt",
",",
"$",
"permission",
")",
"{",
"$",
"params",
"[",
"'appId'",
"]",
"=",
"$",
"appId",
";",
"$",
"params",
"[",
"'userId'",
"]",
... | /*
生成加入房间的令牌
appId: app 的唯一标识,创建的时候由系统生成。
roomName: 房间名称,需满足规格 ^[a-zA-Z0-9_-]{3,64}$
userId: 请求加入房间的用户 ID,需满足规格 ^[a-zA-Z0-9_-]{3,50}$
expireAt: int64 类型,鉴权的有效时间,传入以秒为单位的64位Unix
绝对时间,token 将在该时间后失效。
permission: 该用户的房间管理权限,"admin" 或 "user",默认为 "user" 。
当权限角色为 "admin" 时,拥有将其他用户移除出房间等特权. | [
"/",
"*",
"生成加入房间的令牌",
"appId",
":",
"app",
"的唯一标识,创建的时候由系统生成。",
"roomName",
":",
"房间名称,需满足规格",
"^",
"[",
"a",
"-",
"zA",
"-",
"Z0",
"-",
"9_",
"-",
"]",
"{",
"3",
"64",
"}",
"$",
"userId",
":",
"请求加入房间的用户",
"ID,需满足规格",
"^",
"[",
"a",
"-",
"zA",
... | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Rtc/AppClient.php#L165-L174 |
qiniu/php-sdk | src/Qiniu/Cdn/CdnManager.php | CdnManager.refreshUrlsAndDirs | public function refreshUrlsAndDirs(array $urls, array $dirs)
{
$req = array();
if (!empty($urls)) {
$req['urls'] = $urls;
}
if (!empty($dirs)) {
$req['dirs'] = $dirs;
}
$url = $this->server . '/v2/tune/refresh';
$body = json_encode($r... | php | public function refreshUrlsAndDirs(array $urls, array $dirs)
{
$req = array();
if (!empty($urls)) {
$req['urls'] = $urls;
}
if (!empty($dirs)) {
$req['dirs'] = $dirs;
}
$url = $this->server . '/v2/tune/refresh';
$body = json_encode($r... | [
"public",
"function",
"refreshUrlsAndDirs",
"(",
"array",
"$",
"urls",
",",
"array",
"$",
"dirs",
")",
"{",
"$",
"req",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"urls",
")",
")",
"{",
"$",
"req",
"[",
"'urls'",
"]",
"=",
... | @param array $urls 待刷新的文件链接数组
@param array $dirs 待刷新的目录链接数组
@return array 刷新的请求回复和错误,参考 examples/cdn_manager.php 代码
@link http://developer.qiniu.com/article/fusion/api/refresh.html
目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh
需要刷新目录请工单联系技术支持 https://support.qiniu.com/ticket... | [
"@param",
"array",
"$urls",
"待刷新的文件链接数组",
"@param",
"array",
"$dirs",
"待刷新的目录链接数组"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Cdn/CdnManager.php#L51-L64 |
qiniu/php-sdk | src/Qiniu/Cdn/CdnManager.php | CdnManager.prefetchUrls | public function prefetchUrls(array $urls)
{
$req = array(
'urls' => $urls,
);
$url = $this->server . '/v2/tune/prefetch';
$body = json_encode($req);
return $this->post($url, $body);
} | php | public function prefetchUrls(array $urls)
{
$req = array(
'urls' => $urls,
);
$url = $this->server . '/v2/tune/prefetch';
$body = json_encode($req);
return $this->post($url, $body);
} | [
"public",
"function",
"prefetchUrls",
"(",
"array",
"$",
"urls",
")",
"{",
"$",
"req",
"=",
"array",
"(",
"'urls'",
"=>",
"$",
"urls",
",",
")",
";",
"$",
"url",
"=",
"$",
"this",
"->",
"server",
".",
"'/v2/tune/prefetch'",
";",
"$",
"body",
"=",
"... | @param array $urls 待预取的文件链接数组
@return array 预取的请求回复和错误,参考 examples/cdn_manager.php 代码
@link http://developer.qiniu.com/article/fusion/api/refresh.html | [
"@param",
"array",
"$urls",
"待预取的文件链接数组"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Cdn/CdnManager.php#L73-L82 |
qiniu/php-sdk | src/Qiniu/Cdn/CdnManager.php | CdnManager.getBandwidthData | public function getBandwidthData(array $domains, $startDate, $endDate, $granularity)
{
$req = array();
$req['domains'] = implode(';', $domains);
$req['startDate'] = $startDate;
$req['endDate'] = $endDate;
$req['granularity'] = $granularity;
$url = $this->server . '/v... | php | public function getBandwidthData(array $domains, $startDate, $endDate, $granularity)
{
$req = array();
$req['domains'] = implode(';', $domains);
$req['startDate'] = $startDate;
$req['endDate'] = $endDate;
$req['granularity'] = $granularity;
$url = $this->server . '/v... | [
"public",
"function",
"getBandwidthData",
"(",
"array",
"$",
"domains",
",",
"$",
"startDate",
",",
"$",
"endDate",
",",
"$",
"granularity",
")",
"{",
"$",
"req",
"=",
"array",
"(",
")",
";",
"$",
"req",
"[",
"'domains'",
"]",
"=",
"implode",
"(",
"'... | @param array $domains 待获取带宽数据的域名数组
@param string $startDate 开始的日期,格式类似 2017-01-01
@param string $endDate 结束的日期,格式类似 2017-01-01
@param string $granularity 获取数据的时间间隔,可以是 5min, hour 或者 day
@return array 带宽数据和错误信息,参考 examples/cdn_manager.php 代码
@link http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html | [
"@param",
"array",
"$domains",
"待获取带宽数据的域名数组",
"@param",
"string",
"$startDate",
"开始的日期,格式类似",
"2017",
"-",
"01",
"-",
"01",
"@param",
"string",
"$endDate",
"结束的日期,格式类似",
"2017",
"-",
"01",
"-",
"01",
"@param",
"string",
"$granularity",
"获取数据的时间间隔,可以是",
"5min",
... | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Cdn/CdnManager.php#L94-L105 |
qiniu/php-sdk | src/Qiniu/Cdn/CdnManager.php | CdnManager.getCdnLogList | public function getCdnLogList(array $domains, $logDate)
{
$req = array();
$req['domains'] = implode(';', $domains);
$req['day'] = $logDate;
$url = $this->server . '/v2/tune/log/list';
$body = json_encode($req);
return $this->post($url, $body);
} | php | public function getCdnLogList(array $domains, $logDate)
{
$req = array();
$req['domains'] = implode(';', $domains);
$req['day'] = $logDate;
$url = $this->server . '/v2/tune/log/list';
$body = json_encode($req);
return $this->post($url, $body);
} | [
"public",
"function",
"getCdnLogList",
"(",
"array",
"$",
"domains",
",",
"$",
"logDate",
")",
"{",
"$",
"req",
"=",
"array",
"(",
")",
";",
"$",
"req",
"[",
"'domains'",
"]",
"=",
"implode",
"(",
"';'",
",",
"$",
"domains",
")",
";",
"$",
"req",
... | @param array $domains 待获取日志下载链接的域名数组
@param string $logDate 获取指定日期的日志下载链接,格式类似 2017-01-01
@return array 日志下载链接数据和错误信息,参考 examples/cdn_manager.php 代码
@link http://developer.qiniu.com/article/fusion/api/log.html | [
"@param",
"array",
"$domains",
"待获取日志下载链接的域名数组",
"@param",
"string",
"$logDate",
"获取指定日期的日志下载链接,格式类似",
"2017",
"-",
"01",
"-",
"01"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Cdn/CdnManager.php#L138-L147 |
qiniu/php-sdk | src/Qiniu/Cdn/CdnManager.php | CdnManager.createTimestampAntiLeechUrl | public static function createTimestampAntiLeechUrl($rawUrl, $encryptKey, $durationInSeconds)
{
$parsedUrl = parse_url($rawUrl);
$deadline = time() + $durationInSeconds;
$expireHex = dechex($deadline);
$path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
$path = impl... | php | public static function createTimestampAntiLeechUrl($rawUrl, $encryptKey, $durationInSeconds)
{
$parsedUrl = parse_url($rawUrl);
$deadline = time() + $durationInSeconds;
$expireHex = dechex($deadline);
$path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
$path = impl... | [
"public",
"static",
"function",
"createTimestampAntiLeechUrl",
"(",
"$",
"rawUrl",
",",
"$",
"encryptKey",
",",
"$",
"durationInSeconds",
")",
"{",
"$",
"parsedUrl",
"=",
"parse_url",
"(",
"$",
"rawUrl",
")",
";",
"$",
"deadline",
"=",
"time",
"(",
")",
"+... | 构建时间戳防盗链鉴权的访问外链
@param string $rawUrl 需要签名的资源url
@param string $encryptKey 时间戳防盗链密钥
@param string $durationInSeconds 链接的有效期(以秒为单位)
@return string 带鉴权信息的资源外链,参考 examples/cdn_timestamp_antileech.php 代码 | [
"构建时间戳防盗链鉴权的访问外链"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Cdn/CdnManager.php#L170-L190 |
qiniu/php-sdk | src/Qiniu/Storage/FormUploader.php | FormUploader.put | public static function put(
$upToken,
$key,
$data,
$config,
$params,
$mime,
$fname
) {
$fields = array('token' => $upToken);
if ($key === null) {
$fname='nullkey';
} else {
$fields['key'] = $key;
}
... | php | public static function put(
$upToken,
$key,
$data,
$config,
$params,
$mime,
$fname
) {
$fields = array('token' => $upToken);
if ($key === null) {
$fname='nullkey';
} else {
$fields['key'] = $key;
}
... | [
"public",
"static",
"function",
"put",
"(",
"$",
"upToken",
",",
"$",
"key",
",",
"$",
"data",
",",
"$",
"config",
",",
"$",
"params",
",",
"$",
"mime",
",",
"$",
"fname",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
"'token'",
"=>",
"$",
"upToken... | 上传二进制流到七牛, 内部使用
@param $upToken 上传凭证
@param $key 上传文件名
@param $data 上传二进制流
@param $config 上传配置
@param $params 自定义变量,规格参考
http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
@param $mime 上传数据的mimeType
@return array 包含已上传文件的信息,类似:
[
"hash" => "<Hash string>",
"key... | [
"上传二进制流到七牛",
"内部使用"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/FormUploader.php#L27-L65 |
qiniu/php-sdk | src/Qiniu/Storage/FormUploader.php | FormUploader.putFile | public static function putFile(
$upToken,
$key,
$filePath,
$config,
$params,
$mime
) {
$fields = array('token' => $upToken, 'file' => self::createFile($filePath, $mime));
if ($key !== null) {
$fields['key'] = $key;
}
$fie... | php | public static function putFile(
$upToken,
$key,
$filePath,
$config,
$params,
$mime
) {
$fields = array('token' => $upToken, 'file' => self::createFile($filePath, $mime));
if ($key !== null) {
$fields['key'] = $key;
}
$fie... | [
"public",
"static",
"function",
"putFile",
"(",
"$",
"upToken",
",",
"$",
"key",
",",
"$",
"filePath",
",",
"$",
"config",
",",
"$",
"params",
",",
"$",
"mime",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
"'token'",
"=>",
"$",
"upToken",
",",
"'fil... | 上传文件到七牛,内部使用
@param $upToken 上传凭证
@param $key 上传文件名
@param $filePath 上传文件的路径
@param $config 上传配置
@param $params 自定义变量,规格参考
http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
@param $mime 上传数据的mimeType
@return array 包含已上传文件的信息,类似:
[
"hash" => "<Hash string>",
"key" ... | [
"上传文件到七牛,内部使用"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/FormUploader.php#L84-L121 |
qiniu/php-sdk | src/Qiniu/Zone.php | Zone.queryZone | public static function queryZone($ak, $bucket)
{
$zone = new Zone();
$url = Config::UC_HOST . '/v2/query' . "?ak=$ak&bucket=$bucket";
$ret = Client::Get($url);
if (!$ret->ok()) {
return array(null, new Error($url, $ret));
}
$r = ($ret->body === null) ? arr... | php | public static function queryZone($ak, $bucket)
{
$zone = new Zone();
$url = Config::UC_HOST . '/v2/query' . "?ak=$ak&bucket=$bucket";
$ret = Client::Get($url);
if (!$ret->ok()) {
return array(null, new Error($url, $ret));
}
$r = ($ret->body === null) ? arr... | [
"public",
"static",
"function",
"queryZone",
"(",
"$",
"ak",
",",
"$",
"bucket",
")",
"{",
"$",
"zone",
"=",
"new",
"Zone",
"(",
")",
";",
"$",
"url",
"=",
"Config",
"::",
"UC_HOST",
".",
"'/v2/query'",
".",
"\"?ak=$ak&bucket=$bucket\"",
";",
"$",
"ret... | /*
GET /v2/query?ak=<ak>&&bucket=<bucket> | [
"/",
"*",
"GET",
"/",
"v2",
"/",
"query?ak",
"=",
"<ak",
">",
"&&bucket",
"=",
"<bucket",
">"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Zone.php#L143-L196 |
qiniu/php-sdk | src/Qiniu/Storage/UploadManager.php | UploadManager.put | public function put(
$upToken,
$key,
$data,
$params = null,
$mime = 'application/octet-stream',
$fname = null
) {
$params = self::trimParams($params);
return FormUploader::put(
$upToken,
$key,
$data,
... | php | public function put(
$upToken,
$key,
$data,
$params = null,
$mime = 'application/octet-stream',
$fname = null
) {
$params = self::trimParams($params);
return FormUploader::put(
$upToken,
$key,
$data,
... | [
"public",
"function",
"put",
"(",
"$",
"upToken",
",",
"$",
"key",
",",
"$",
"data",
",",
"$",
"params",
"=",
"null",
",",
"$",
"mime",
"=",
"'application/octet-stream'",
",",
"$",
"fname",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"... | 上传二进制流到七牛
@param $upToken 上传凭证
@param $key 上传文件名
@param $data 上传二进制流
@param $params 自定义变量,规格参考
http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
@param $mime 上传数据的mimeType
@param $checkCrc 是否校验crc32
@return array 包含已上传文件的信息,类似:
[
"hash" => "<Hash string>",
"key"... | [
"上传二进制流到七牛"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/UploadManager.php#L43-L62 |
qiniu/php-sdk | src/Qiniu/Processing/ImageUrlBuilder.php | ImageUrlBuilder.thumbnail | public function thumbnail(
$url,
$mode,
$width,
$height,
$format = null,
$interlace = null,
$quality = null,
$ignoreError = 1
) {
// url合法效验
if (!$this->isUrl($url)) {
return $url;
}
// 参数合法性效验
if (... | php | public function thumbnail(
$url,
$mode,
$width,
$height,
$format = null,
$interlace = null,
$quality = null,
$ignoreError = 1
) {
// url合法效验
if (!$this->isUrl($url)) {
return $url;
}
// 参数合法性效验
if (... | [
"public",
"function",
"thumbnail",
"(",
"$",
"url",
",",
"$",
"mode",
",",
"$",
"width",
",",
"$",
"height",
",",
"$",
"format",
"=",
"null",
",",
"$",
"interlace",
"=",
"null",
",",
"$",
"quality",
"=",
"null",
",",
"$",
"ignoreError",
"=",
"1",
... | 缩略图链接拼接
@param string $url 图片链接
@param int $mode 缩略模式
@param int $width 宽度
@param int $height 长度
@param string $format 输出类型
@param int $quality 图片质量
@param int $interlace 是否支持渐进显示
@param int $ignoreError 忽略结果
@return string
@link http://developer.qiniu.com/code/v6/api/kodo-api/image/imageview2.html
@author She... | [
"缩略图链接拼接"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Processing/ImageUrlBuilder.php#L50-L103 |
qiniu/php-sdk | src/Qiniu/Processing/ImageUrlBuilder.php | ImageUrlBuilder.waterImg | public function waterImg(
$url,
$image,
$dissolve = 100,
$gravity = 'SouthEast',
$dx = null,
$dy = null,
$watermarkScale = null
) {
// url合法效验
if (!$this->isUrl($url)) {
return $url;
}
$waterStr = 'watermark/1/image... | php | public function waterImg(
$url,
$image,
$dissolve = 100,
$gravity = 'SouthEast',
$dx = null,
$dy = null,
$watermarkScale = null
) {
// url合法效验
if (!$this->isUrl($url)) {
return $url;
}
$waterStr = 'watermark/1/image... | [
"public",
"function",
"waterImg",
"(",
"$",
"url",
",",
"$",
"image",
",",
"$",
"dissolve",
"=",
"100",
",",
"$",
"gravity",
"=",
"'SouthEast'",
",",
"$",
"dx",
"=",
"null",
",",
"$",
"dy",
"=",
"null",
",",
"$",
"watermarkScale",
"=",
"null",
")",... | 图片水印
@param string $url 图片链接
@param string $image 水印图片链接
@param numeric $dissolve 透明度
@param string $gravity 水印位置
@param numeric $dx 横轴边距
@param numeric $dy 纵轴边距
@param numeric $watermarkScale 自适应原图的短边比例
@link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html
@return string
@author Sherlock... | [
"图片水印"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Processing/ImageUrlBuilder.php#L119-L172 |
qiniu/php-sdk | src/Qiniu/Processing/ImageUrlBuilder.php | ImageUrlBuilder.waterText | public function waterText(
$url,
$text,
$font = '黑体',
$fontSize = 0,
$fontColor = null,
$dissolve = 100,
$gravity = 'SouthEast',
$dx = null,
$dy = null
) {
// url合法效验
if (!$this->isUrl($url)) {
return $url;
}... | php | public function waterText(
$url,
$text,
$font = '黑体',
$fontSize = 0,
$fontColor = null,
$dissolve = 100,
$gravity = 'SouthEast',
$dx = null,
$dy = null
) {
// url合法效验
if (!$this->isUrl($url)) {
return $url;
}... | [
"public",
"function",
"waterText",
"(",
"$",
"url",
",",
"$",
"text",
",",
"$",
"font",
"=",
"'黑体',",
"",
"$",
"fontSize",
"=",
"0",
",",
"$",
"fontColor",
"=",
"null",
",",
"$",
"dissolve",
"=",
"100",
",",
"$",
"gravity",
"=",
"'SouthEast'",
",",... | 文字水印
@param string $url 图片链接
@param string $text 文字
@param string $font 文字字体
@param string $fontSize 文字字号
@param string $fontColor 文字颜色
@param numeric $dissolve 透明度
@param string $gravity 水印位置
@param numeric $dx 横轴边距
@param numeric $dy 纵轴边距
@link http://developer.qiniu.com/code/v6/api/kodo-api/image/waterma... | [
"文字水印"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Processing/ImageUrlBuilder.php#L190-L250 |
qiniu/php-sdk | src/Qiniu/Processing/ImageUrlBuilder.php | ImageUrlBuilder.isUrl | protected function isUrl($url)
{
$urlArr = parse_url($url);
return $urlArr['scheme']
&& in_array($urlArr['scheme'], array('http', 'https'))
&& $urlArr['host']
&& $urlArr['path'];
} | php | protected function isUrl($url)
{
$urlArr = parse_url($url);
return $urlArr['scheme']
&& in_array($urlArr['scheme'], array('http', 'https'))
&& $urlArr['host']
&& $urlArr['path'];
} | [
"protected",
"function",
"isUrl",
"(",
"$",
"url",
")",
"{",
"$",
"urlArr",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"return",
"$",
"urlArr",
"[",
"'scheme'",
"]",
"&&",
"in_array",
"(",
"$",
"urlArr",
"[",
"'scheme'",
"]",
",",
"array",
"(",
"... | 效验url合法性
@param string $url url链接
@return string
@author Sherlock Ren <sherlock_ren@icloud.com> | [
"效验url合法性"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Processing/ImageUrlBuilder.php#L259-L267 |
qiniu/php-sdk | src/Qiniu/Storage/ResumeUploader.php | ResumeUploader.upload | public function upload($fname)
{
$uploaded = 0;
while ($uploaded < $this->size) {
$blockSize = $this->blockSize($uploaded);
$data = fread($this->inputStream, $blockSize);
if ($data === false) {
throw new \Exception("file read failed", 1);
... | php | public function upload($fname)
{
$uploaded = 0;
while ($uploaded < $this->size) {
$blockSize = $this->blockSize($uploaded);
$data = fread($this->inputStream, $blockSize);
if ($data === false) {
throw new \Exception("file read failed", 1);
... | [
"public",
"function",
"upload",
"(",
"$",
"fname",
")",
"{",
"$",
"uploaded",
"=",
"0",
";",
"while",
"(",
"$",
"uploaded",
"<",
"$",
"this",
"->",
"size",
")",
"{",
"$",
"blockSize",
"=",
"$",
"this",
"->",
"blockSize",
"(",
"$",
"uploaded",
")",
... | 上传操作 | [
"上传操作"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/ResumeUploader.php#L74-L110 |
qiniu/php-sdk | src/Qiniu/Storage/ResumeUploader.php | ResumeUploader.makeBlock | private function makeBlock($block, $blockSize)
{
$url = $this->host . '/mkblk/' . $blockSize;
return $this->post($url, $block);
} | php | private function makeBlock($block, $blockSize)
{
$url = $this->host . '/mkblk/' . $blockSize;
return $this->post($url, $block);
} | [
"private",
"function",
"makeBlock",
"(",
"$",
"block",
",",
"$",
"blockSize",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"host",
".",
"'/mkblk/'",
".",
"$",
"blockSize",
";",
"return",
"$",
"this",
"->",
"post",
"(",
"$",
"url",
",",
"$",
"block... | 创建块 | [
"创建块"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/ResumeUploader.php#L115-L119 |
qiniu/php-sdk | src/Qiniu/Storage/ResumeUploader.php | ResumeUploader.makeFile | private function makeFile($fname)
{
$url = $this->fileUrl($fname);
$body = implode(',', $this->contexts);
$response = $this->post($url, $body);
if ($response->needRetry()) {
$response = $this->post($url, $body);
}
if (!$response->ok()) {
return... | php | private function makeFile($fname)
{
$url = $this->fileUrl($fname);
$body = implode(',', $this->contexts);
$response = $this->post($url, $body);
if ($response->needRetry()) {
$response = $this->post($url, $body);
}
if (!$response->ok()) {
return... | [
"private",
"function",
"makeFile",
"(",
"$",
"fname",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"fileUrl",
"(",
"$",
"fname",
")",
";",
"$",
"body",
"=",
"implode",
"(",
"','",
",",
"$",
"this",
"->",
"contexts",
")",
";",
"$",
"response",
"=... | 创建文件 | [
"创建文件"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Storage/ResumeUploader.php#L141-L153 |
qiniu/php-sdk | src/Qiniu/Processing/Operation.php | Operation.execute | public function execute($key, $fops)
{
$url = $this->buildUrl($key, $fops);
$resp = Client::get($url);
if (!$resp->ok()) {
return array(null, new Error($url, $resp));
}
if ($resp->json() !== null) {
return array($resp->json(), null);
}
... | php | public function execute($key, $fops)
{
$url = $this->buildUrl($key, $fops);
$resp = Client::get($url);
if (!$resp->ok()) {
return array(null, new Error($url, $resp));
}
if ($resp->json() !== null) {
return array($resp->json(), null);
}
... | [
"public",
"function",
"execute",
"(",
"$",
"key",
",",
"$",
"fops",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"buildUrl",
"(",
"$",
"key",
",",
"$",
"fops",
")",
";",
"$",
"resp",
"=",
"Client",
"::",
"get",
"(",
"$",
"url",
")",
";",
"if... | 对资源文件进行处理
@param $key 待处理的资源文件名
@param $fops string|array fop操作,多次fop操作以array的形式传入。
eg. imageView2/1/w/200/h/200, imageMogr2/thumbnail/!75px
@return array 文件处理后的结果及错误。
@link http://developer.qiniu.com/docs/v6/api/reference/fop/ | [
"对资源文件进行处理"
] | train | https://github.com/qiniu/php-sdk/blob/f18dcd7419063db40b194ee76602490e0d3ed6db/src/Qiniu/Processing/Operation.php#L34-L45 |
onelogin/php-saml | lib/Saml2/IdPMetadataParser.php | OneLogin_Saml2_IdPMetadataParser.parseRemoteXML | public static function parseRemoteXML($url, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT)
{
$metadataInfo = array();
try {
$ch = curl_init($url);
... | php | public static function parseRemoteXML($url, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT)
{
$metadataInfo = array();
try {
$ch = curl_init($url);
... | [
"public",
"static",
"function",
"parseRemoteXML",
"(",
"$",
"url",
",",
"$",
"entityId",
"=",
"null",
",",
"$",
"desiredNameIdFormat",
"=",
"null",
",",
"$",
"desiredSSOBinding",
"=",
"OneLogin_Saml2_Constants",
"::",
"BINDING_HTTP_REDIRECT",
",",
"$",
"desiredSLO... | Get IdP Metadata Info from URL
@param string $url URL where the IdP metadata is published
@param string $entityId Entity Id of the desired IdP, if no
entity Id is provided and the XML
metadata contains more than one
IDPSSODescriptor, the first is returned
@param string $desiredNameIdForm... | [
"Get",
"IdP",
"Metadata",
"Info",
"from",
"URL"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/IdPMetadataParser.php#L24-L45 |
onelogin/php-saml | lib/Saml2/IdPMetadataParser.php | OneLogin_Saml2_IdPMetadataParser.parseFileXML | public static function parseFileXML($filepath, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT)
{
$metadataInfo = array();
try {
if (file_exists($fil... | php | public static function parseFileXML($filepath, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT)
{
$metadataInfo = array();
try {
if (file_exists($fil... | [
"public",
"static",
"function",
"parseFileXML",
"(",
"$",
"filepath",
",",
"$",
"entityId",
"=",
"null",
",",
"$",
"desiredNameIdFormat",
"=",
"null",
",",
"$",
"desiredSSOBinding",
"=",
"OneLogin_Saml2_Constants",
"::",
"BINDING_HTTP_REDIRECT",
",",
"$",
"desired... | Get IdP Metadata Info from File
@param string $filepath File path
@param string $entityId Entity Id of the desired IdP, if no
entity Id is provided and the XML
metadata contains more than one
IDPSSODescriptor, the first is returned
@param string $desiredNameIdFormat If available on IdP meta... | [
"Get",
"IdP",
"Metadata",
"Info",
"from",
"File"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/IdPMetadataParser.php#L61-L73 |
onelogin/php-saml | lib/Saml2/IdPMetadataParser.php | OneLogin_Saml2_IdPMetadataParser.parseXML | public static function parseXML($xml, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT)
{
$metadataInfo = array();
$dom = new DOMDocument();
$dom->preserv... | php | public static function parseXML($xml, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT)
{
$metadataInfo = array();
$dom = new DOMDocument();
$dom->preserv... | [
"public",
"static",
"function",
"parseXML",
"(",
"$",
"xml",
",",
"$",
"entityId",
"=",
"null",
",",
"$",
"desiredNameIdFormat",
"=",
"null",
",",
"$",
"desiredSSOBinding",
"=",
"OneLogin_Saml2_Constants",
"::",
"BINDING_HTTP_REDIRECT",
",",
"$",
"desiredSLOBindin... | Get IdP Metadata Info from URL
@param string $xml XML that contains IdP metadata
@param string $entityId Entity Id of the desired IdP, if no
entity Id is provided and the XML
metadata contains more than one
IDPSSODescriptor, the first is returned
@param string $desiredNameIdFormat If a... | [
"Get",
"IdP",
"Metadata",
"Info",
"from",
"URL"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/IdPMetadataParser.php#L91-L196 |
onelogin/php-saml | lib/Saml2/IdPMetadataParser.php | OneLogin_Saml2_IdPMetadataParser.injectIntoSettings | public static function injectIntoSettings($settings, $metadataInfo)
{
if (isset($metadataInfo['idp']) && isset($settings['idp'])) {
if (isset($metadataInfo['idp']['x509certMulti']) && !empty($metadataInfo['idp']['x509certMulti']) && isset($settings['idp']['x509cert'])) {
unset($s... | php | public static function injectIntoSettings($settings, $metadataInfo)
{
if (isset($metadataInfo['idp']) && isset($settings['idp'])) {
if (isset($metadataInfo['idp']['x509certMulti']) && !empty($metadataInfo['idp']['x509certMulti']) && isset($settings['idp']['x509cert'])) {
unset($s... | [
"public",
"static",
"function",
"injectIntoSettings",
"(",
"$",
"settings",
",",
"$",
"metadataInfo",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"metadataInfo",
"[",
"'idp'",
"]",
")",
"&&",
"isset",
"(",
"$",
"settings",
"[",
"'idp'",
"]",
")",
")",
"{",... | Inject metadata info into php-saml settings array
@param array $settings php-saml settings array
@param array $metadataInfo array metadata info
@return array settings | [
"Inject",
"metadata",
"info",
"into",
"php",
"-",
"saml",
"settings",
"array"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/IdPMetadataParser.php#L206-L219 |
onelogin/php-saml | lib/Saml2/LogoutResponse.php | OneLogin_Saml2_LogoutResponse.getIssuer | public function getIssuer()
{
$issuer = null;
$issuerNodes = $this->_query('/samlp:LogoutResponse/saml:Issuer');
if ($issuerNodes->length == 1) {
$issuer = $issuerNodes->item(0)->textContent;
}
return $issuer;
} | php | public function getIssuer()
{
$issuer = null;
$issuerNodes = $this->_query('/samlp:LogoutResponse/saml:Issuer');
if ($issuerNodes->length == 1) {
$issuer = $issuerNodes->item(0)->textContent;
}
return $issuer;
} | [
"public",
"function",
"getIssuer",
"(",
")",
"{",
"$",
"issuer",
"=",
"null",
";",
"$",
"issuerNodes",
"=",
"$",
"this",
"->",
"_query",
"(",
"'/samlp:LogoutResponse/saml:Issuer'",
")",
";",
"if",
"(",
"$",
"issuerNodes",
"->",
"length",
"==",
"1",
")",
... | Gets the Issuer of the Logout Response.
@return string|null $issuer The Issuer | [
"Gets",
"the",
"Issuer",
"of",
"the",
"Logout",
"Response",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutResponse.php#L86-L94 |
onelogin/php-saml | lib/Saml2/LogoutResponse.php | OneLogin_Saml2_LogoutResponse.getStatus | public function getStatus()
{
$entries = $this->_query('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode');
if ($entries->length != 1) {
return null;
}
$status = $entries->item(0)->getAttribute('Value');
return $status;
} | php | public function getStatus()
{
$entries = $this->_query('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode');
if ($entries->length != 1) {
return null;
}
$status = $entries->item(0)->getAttribute('Value');
return $status;
} | [
"public",
"function",
"getStatus",
"(",
")",
"{",
"$",
"entries",
"=",
"$",
"this",
"->",
"_query",
"(",
"'/samlp:LogoutResponse/samlp:Status/samlp:StatusCode'",
")",
";",
"if",
"(",
"$",
"entries",
"->",
"length",
"!=",
"1",
")",
"{",
"return",
"null",
";",... | Gets the Status of the Logout Response.
@return string|null The Status | [
"Gets",
"the",
"Status",
"of",
"the",
"Logout",
"Response",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutResponse.php#L101-L109 |
onelogin/php-saml | lib/Saml2/LogoutResponse.php | OneLogin_Saml2_LogoutResponse.isValid | public function isValid($requestId = null, $retrieveParametersFromServer = false)
{
$this->_error = null;
try {
$idpData = $this->_settings->getIdPData();
$idPEntityId = $idpData['entityId'];
if ($this->_settings->isStrict()) {
$security = $this->... | php | public function isValid($requestId = null, $retrieveParametersFromServer = false)
{
$this->_error = null;
try {
$idpData = $this->_settings->getIdPData();
$idPEntityId = $idpData['entityId'];
if ($this->_settings->isStrict()) {
$security = $this->... | [
"public",
"function",
"isValid",
"(",
"$",
"requestId",
"=",
"null",
",",
"$",
"retrieveParametersFromServer",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_error",
"=",
"null",
";",
"try",
"{",
"$",
"idpData",
"=",
"$",
"this",
"->",
"_settings",
"->",
... | Determines if the SAML LogoutResponse is valid
@param string|null $requestId The ID of the LogoutRequest sent by this SP to the IdP
@param bool $retrieveParametersFromServer
@return bool Returns if the SAML LogoutResponse is or not valid | [
"Determines",
"if",
"the",
"SAML",
"LogoutResponse",
"is",
"valid"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutResponse.php#L119-L198 |
onelogin/php-saml | lib/Saml2/LogoutResponse.php | OneLogin_Saml2_LogoutResponse.build | public function build($inResponseTo)
{
$spData = $this->_settings->getSPData();
$idpData = $this->_settings->getIdPData();
$this->id = OneLogin_Saml2_Utils::generateUniqueID();
$issueInstant = OneLogin_Saml2_Utils::parseTime2SAML(time());
$spEntityId = htmlspecialchars($sp... | php | public function build($inResponseTo)
{
$spData = $this->_settings->getSPData();
$idpData = $this->_settings->getIdPData();
$this->id = OneLogin_Saml2_Utils::generateUniqueID();
$issueInstant = OneLogin_Saml2_Utils::parseTime2SAML(time());
$spEntityId = htmlspecialchars($sp... | [
"public",
"function",
"build",
"(",
"$",
"inResponseTo",
")",
"{",
"$",
"spData",
"=",
"$",
"this",
"->",
"_settings",
"->",
"getSPData",
"(",
")",
";",
"$",
"idpData",
"=",
"$",
"this",
"->",
"_settings",
"->",
"getIdPData",
"(",
")",
";",
"$",
"thi... | Generates a Logout Response object.
@param string $inResponseTo InResponseTo value for the Logout Response. | [
"Generates",
"a",
"Logout",
"Response",
"object",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutResponse.php#L218-L244 |
onelogin/php-saml | lib/Saml2/LogoutResponse.php | OneLogin_Saml2_LogoutResponse.getResponse | public function getResponse($deflate = null)
{
$subject = $this->_logoutResponse;
if (is_null($deflate)) {
$deflate = $this->_settings->shouldCompressResponses();
}
if ($deflate) {
$subject = gzdeflate($this->_logoutResponse);
}
return base64... | php | public function getResponse($deflate = null)
{
$subject = $this->_logoutResponse;
if (is_null($deflate)) {
$deflate = $this->_settings->shouldCompressResponses();
}
if ($deflate) {
$subject = gzdeflate($this->_logoutResponse);
}
return base64... | [
"public",
"function",
"getResponse",
"(",
"$",
"deflate",
"=",
"null",
")",
"{",
"$",
"subject",
"=",
"$",
"this",
"->",
"_logoutResponse",
";",
"if",
"(",
"is_null",
"(",
"$",
"deflate",
")",
")",
"{",
"$",
"deflate",
"=",
"$",
"this",
"->",
"_setti... | Returns a Logout Response object.
@param bool|null $deflate Whether or not we should 'gzdeflate' the response body before we return it.
@return string Logout Response deflated and base64 encoded | [
"Returns",
"a",
"Logout",
"Response",
"object",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutResponse.php#L253-L265 |
onelogin/php-saml | lib/Saml/XmlSec.php | OneLogin_Saml_XmlSec.validateTimestamps | public function validateTimestamps()
{
$rootNode = $this->_document;
$timestampNodes = $rootNode->getElementsByTagName('Conditions');
for ($i = 0; $i < $timestampNodes->length; $i++) {
$nbAttribute = $timestampNodes->item($i)->attributes->getNamedItem("NotBefore");
$n... | php | public function validateTimestamps()
{
$rootNode = $this->_document;
$timestampNodes = $rootNode->getElementsByTagName('Conditions');
for ($i = 0; $i < $timestampNodes->length; $i++) {
$nbAttribute = $timestampNodes->item($i)->attributes->getNamedItem("NotBefore");
$n... | [
"public",
"function",
"validateTimestamps",
"(",
")",
"{",
"$",
"rootNode",
"=",
"$",
"this",
"->",
"_document",
";",
"$",
"timestampNodes",
"=",
"$",
"rootNode",
"->",
"getElementsByTagName",
"(",
"'Conditions'",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
... | Verify that the document is still valid according
@return bool | [
"Verify",
"that",
"the",
"document",
"is",
"still",
"valid",
"according"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml/XmlSec.php#L50-L65 |
onelogin/php-saml | lib/Saml/XmlSec.php | OneLogin_Saml_XmlSec.isValid | public function isValid()
{
$singleAssertion = $this->validateNumAssertions();
if (!$singleAssertion) {
throw new Exception('Multiple assertions are not supported');
}
$validTimestamps = $this->validateTimestamps();
if (!$validTimestamps) {
throw new ... | php | public function isValid()
{
$singleAssertion = $this->validateNumAssertions();
if (!$singleAssertion) {
throw new Exception('Multiple assertions are not supported');
}
$validTimestamps = $this->validateTimestamps();
if (!$validTimestamps) {
throw new ... | [
"public",
"function",
"isValid",
"(",
")",
"{",
"$",
"singleAssertion",
"=",
"$",
"this",
"->",
"validateNumAssertions",
"(",
")",
";",
"if",
"(",
"!",
"$",
"singleAssertion",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Multiple assertions are not supported'",... | @return bool
@throws Exception | [
"@return",
"bool"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml/XmlSec.php#L72-L109 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.isValid | public function isValid($requestId = null)
{
$this->_error = null;
try {
// Check SAML version
if ($this->document->documentElement->getAttribute('Version') != '2.0') {
throw new OneLogin_Saml2_ValidationError(
"Unsupported SAML version",
... | php | public function isValid($requestId = null)
{
$this->_error = null;
try {
// Check SAML version
if ($this->document->documentElement->getAttribute('Version') != '2.0') {
throw new OneLogin_Saml2_ValidationError(
"Unsupported SAML version",
... | [
"public",
"function",
"isValid",
"(",
"$",
"requestId",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_error",
"=",
"null",
";",
"try",
"{",
"// Check SAML version",
"if",
"(",
"$",
"this",
"->",
"document",
"->",
"documentElement",
"->",
"getAttribute",
"(",... | Determines if the SAML Response is valid using the certificate.
@param string|null $requestId The ID of the AuthNRequest sent by this SP to the IdP
@return bool Validate the document | [
"Determines",
"if",
"the",
"SAML",
"Response",
"is",
"valid",
"using",
"the",
"certificate",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L99-L406 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getAssertionId | public function getAssertionId()
{
if (!$this->validateNumAssertions()) {
throw new InvalidArgumentException("SAML Response must contain 1 Assertion.");
}
$assertionNodes = $this->_queryAssertion("");
$id = null;
if ($assertionNodes->length == 1 && $assertionNodes... | php | public function getAssertionId()
{
if (!$this->validateNumAssertions()) {
throw new InvalidArgumentException("SAML Response must contain 1 Assertion.");
}
$assertionNodes = $this->_queryAssertion("");
$id = null;
if ($assertionNodes->length == 1 && $assertionNodes... | [
"public",
"function",
"getAssertionId",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateNumAssertions",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"SAML Response must contain 1 Assertion.\"",
")",
";",
"}",
"$",
"assertionNod... | @return string|null the ID of the assertion in the Response
@throws InvalidArgumentException | [
"@return",
"string|null",
"the",
"ID",
"of",
"the",
"assertion",
"in",
"the",
"Response"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L425-L436 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.checkStatus | public function checkStatus()
{
$status = OneLogin_Saml2_Utils::getStatus($this->document);
if (isset($status['code']) && $status['code'] !== OneLogin_Saml2_Constants::STATUS_SUCCESS) {
$explodedCode = explode(':', $status['code']);
$printableCode = array_pop($explodedCode);... | php | public function checkStatus()
{
$status = OneLogin_Saml2_Utils::getStatus($this->document);
if (isset($status['code']) && $status['code'] !== OneLogin_Saml2_Constants::STATUS_SUCCESS) {
$explodedCode = explode(':', $status['code']);
$printableCode = array_pop($explodedCode);... | [
"public",
"function",
"checkStatus",
"(",
")",
"{",
"$",
"status",
"=",
"OneLogin_Saml2_Utils",
"::",
"getStatus",
"(",
"$",
"this",
"->",
"document",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"status",
"[",
"'code'",
"]",
")",
"&&",
"$",
"status",
"[",
... | Checks if the Status is success
@throws OneLogin_Saml2_ValidationError If status is not success | [
"Checks",
"if",
"the",
"Status",
"is",
"success"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L452-L469 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getAudiences | public function getAudiences()
{
$audiences = array();
$entries = $this->_queryAssertion('/saml:Conditions/saml:AudienceRestriction/saml:Audience');
foreach ($entries as $entry) {
$value = trim($entry->textContent);
if (!empty($value)) {
$audiences[] ... | php | public function getAudiences()
{
$audiences = array();
$entries = $this->_queryAssertion('/saml:Conditions/saml:AudienceRestriction/saml:Audience');
foreach ($entries as $entry) {
$value = trim($entry->textContent);
if (!empty($value)) {
$audiences[] ... | [
"public",
"function",
"getAudiences",
"(",
")",
"{",
"$",
"audiences",
"=",
"array",
"(",
")",
";",
"$",
"entries",
"=",
"$",
"this",
"->",
"_queryAssertion",
"(",
"'/saml:Conditions/saml:AudienceRestriction/saml:Audience'",
")",
";",
"foreach",
"(",
"$",
"entri... | Gets the audiences.
@return array @audience The valid audiences of the response | [
"Gets",
"the",
"audiences",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L506-L519 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getIssuers | public function getIssuers()
{
$issuers = array();
$responseIssuer = OneLogin_Saml2_Utils::query($this->document, '/samlp:Response/saml:Issuer');
if ($responseIssuer->length > 0) {
if ($responseIssuer->length == 1) {
$issuers[] = $responseIssuer->item(0)->textCon... | php | public function getIssuers()
{
$issuers = array();
$responseIssuer = OneLogin_Saml2_Utils::query($this->document, '/samlp:Response/saml:Issuer');
if ($responseIssuer->length > 0) {
if ($responseIssuer->length == 1) {
$issuers[] = $responseIssuer->item(0)->textCon... | [
"public",
"function",
"getIssuers",
"(",
")",
"{",
"$",
"issuers",
"=",
"array",
"(",
")",
";",
"$",
"responseIssuer",
"=",
"OneLogin_Saml2_Utils",
"::",
"query",
"(",
"$",
"this",
"->",
"document",
",",
"'/samlp:Response/saml:Issuer'",
")",
";",
"if",
"(",
... | Gets the Issuers (from Response and Assertion).
@return array @issuers The issuers of the assertion/response
@throws OneLogin_Saml2_ValidationError | [
"Gets",
"the",
"Issuers",
"(",
"from",
"Response",
"and",
"Assertion",
")",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L528-L555 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getNameIdData | public function getNameIdData()
{
$encryptedIdDataEntries = $this->_queryAssertion('/saml:Subject/saml:EncryptedID/xenc:EncryptedData');
if ($encryptedIdDataEntries->length == 1) {
$encryptedData = $encryptedIdDataEntries->item(0);
$key = $this->_settings->getSPkey();
... | php | public function getNameIdData()
{
$encryptedIdDataEntries = $this->_queryAssertion('/saml:Subject/saml:EncryptedID/xenc:EncryptedData');
if ($encryptedIdDataEntries->length == 1) {
$encryptedData = $encryptedIdDataEntries->item(0);
$key = $this->_settings->getSPkey();
... | [
"public",
"function",
"getNameIdData",
"(",
")",
"{",
"$",
"encryptedIdDataEntries",
"=",
"$",
"this",
"->",
"_queryAssertion",
"(",
"'/saml:Subject/saml:EncryptedID/xenc:EncryptedData'",
")",
";",
"if",
"(",
"$",
"encryptedIdDataEntries",
"->",
"length",
"==",
"1",
... | Gets the NameID Data provided by the SAML response from the IdP.
@return array Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
@throws OneLogin_Saml2_ValidationError | [
"Gets",
"the",
"NameID",
"Data",
"provided",
"by",
"the",
"SAML",
"response",
"from",
"the",
"IdP",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L564-L621 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getNameId | public function getNameId()
{
$nameIdvalue = null;
$nameIdData = $this->getNameIdData();
if (!empty($nameIdData) && isset($nameIdData['Value'])) {
$nameIdvalue = $nameIdData['Value'];
}
return $nameIdvalue;
} | php | public function getNameId()
{
$nameIdvalue = null;
$nameIdData = $this->getNameIdData();
if (!empty($nameIdData) && isset($nameIdData['Value'])) {
$nameIdvalue = $nameIdData['Value'];
}
return $nameIdvalue;
} | [
"public",
"function",
"getNameId",
"(",
")",
"{",
"$",
"nameIdvalue",
"=",
"null",
";",
"$",
"nameIdData",
"=",
"$",
"this",
"->",
"getNameIdData",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"nameIdData",
")",
"&&",
"isset",
"(",
"$",
"nameIdD... | Gets the NameID provided by the SAML response from the IdP.
@return string|null Name ID Value
@throws OneLogin_Saml2_ValidationError | [
"Gets",
"the",
"NameID",
"provided",
"by",
"the",
"SAML",
"response",
"from",
"the",
"IdP",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L630-L638 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getNameIdFormat | public function getNameIdFormat()
{
$nameIdFormat = null;
$nameIdData = $this->getNameIdData();
if (!empty($nameIdData) && isset($nameIdData['Format'])) {
$nameIdFormat = $nameIdData['Format'];
}
return $nameIdFormat;
} | php | public function getNameIdFormat()
{
$nameIdFormat = null;
$nameIdData = $this->getNameIdData();
if (!empty($nameIdData) && isset($nameIdData['Format'])) {
$nameIdFormat = $nameIdData['Format'];
}
return $nameIdFormat;
} | [
"public",
"function",
"getNameIdFormat",
"(",
")",
"{",
"$",
"nameIdFormat",
"=",
"null",
";",
"$",
"nameIdData",
"=",
"$",
"this",
"->",
"getNameIdData",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"nameIdData",
")",
"&&",
"isset",
"(",
"$",
"... | Gets the NameID Format provided by the SAML response from the IdP.
@return string|null Name ID Format
@throws OneLogin_Saml2_ValidationError | [
"Gets",
"the",
"NameID",
"Format",
"provided",
"by",
"the",
"SAML",
"response",
"from",
"the",
"IdP",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L647-L655 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getNameIdNameQualifier | public function getNameIdNameQualifier()
{
$nameIdNameQualifier = null;
$nameIdData = $this->getNameIdData();
if (!empty($nameIdData) && isset($nameIdData['NameQualifier'])) {
$nameIdNameQualifier = $nameIdData['NameQualifier'];
}
return $nameIdNameQualifier;
... | php | public function getNameIdNameQualifier()
{
$nameIdNameQualifier = null;
$nameIdData = $this->getNameIdData();
if (!empty($nameIdData) && isset($nameIdData['NameQualifier'])) {
$nameIdNameQualifier = $nameIdData['NameQualifier'];
}
return $nameIdNameQualifier;
... | [
"public",
"function",
"getNameIdNameQualifier",
"(",
")",
"{",
"$",
"nameIdNameQualifier",
"=",
"null",
";",
"$",
"nameIdData",
"=",
"$",
"this",
"->",
"getNameIdData",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"nameIdData",
")",
"&&",
"isset",
"... | Gets the NameID NameQualifier provided by the SAML response from the IdP.
@return string|null Name ID NameQualifier
@throws OneLogin_Saml2_ValidationError | [
"Gets",
"the",
"NameID",
"NameQualifier",
"provided",
"by",
"the",
"SAML",
"response",
"from",
"the",
"IdP",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L664-L672 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getSessionNotOnOrAfter | public function getSessionNotOnOrAfter()
{
$notOnOrAfter = null;
$entries = $this->_queryAssertion('/saml:AuthnStatement[@SessionNotOnOrAfter]');
if ($entries->length !== 0) {
$notOnOrAfter = OneLogin_Saml2_Utils::parseSAML2Time($entries->item(0)->getAttribute('SessionNotOnOrAfte... | php | public function getSessionNotOnOrAfter()
{
$notOnOrAfter = null;
$entries = $this->_queryAssertion('/saml:AuthnStatement[@SessionNotOnOrAfter]');
if ($entries->length !== 0) {
$notOnOrAfter = OneLogin_Saml2_Utils::parseSAML2Time($entries->item(0)->getAttribute('SessionNotOnOrAfte... | [
"public",
"function",
"getSessionNotOnOrAfter",
"(",
")",
"{",
"$",
"notOnOrAfter",
"=",
"null",
";",
"$",
"entries",
"=",
"$",
"this",
"->",
"_queryAssertion",
"(",
"'/saml:AuthnStatement[@SessionNotOnOrAfter]'",
")",
";",
"if",
"(",
"$",
"entries",
"->",
"leng... | Gets the SessionNotOnOrAfter from the AuthnStatement.
Could be used to set the local session expiration
@return int|null The SessionNotOnOrAfter value
@throws Exception | [
"Gets",
"the",
"SessionNotOnOrAfter",
"from",
"the",
"AuthnStatement",
".",
"Could",
"be",
"used",
"to",
"set",
"the",
"local",
"session",
"expiration"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L682-L690 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.getSessionIndex | public function getSessionIndex()
{
$sessionIndex = null;
$entries = $this->_queryAssertion('/saml:AuthnStatement[@SessionIndex]');
if ($entries->length !== 0) {
$sessionIndex = $entries->item(0)->getAttribute('SessionIndex');
}
return $sessionIndex;
} | php | public function getSessionIndex()
{
$sessionIndex = null;
$entries = $this->_queryAssertion('/saml:AuthnStatement[@SessionIndex]');
if ($entries->length !== 0) {
$sessionIndex = $entries->item(0)->getAttribute('SessionIndex');
}
return $sessionIndex;
} | [
"public",
"function",
"getSessionIndex",
"(",
")",
"{",
"$",
"sessionIndex",
"=",
"null",
";",
"$",
"entries",
"=",
"$",
"this",
"->",
"_queryAssertion",
"(",
"'/saml:AuthnStatement[@SessionIndex]'",
")",
";",
"if",
"(",
"$",
"entries",
"->",
"length",
"!==",
... | Gets the SessionIndex from the AuthnStatement.
Could be used to be stored in the local session in order
to be used in a future Logout Request that the SP could
send to the SP, to set what specific session must be deleted
@return string|null The SessionIndex value | [
"Gets",
"the",
"SessionIndex",
"from",
"the",
"AuthnStatement",
".",
"Could",
"be",
"used",
"to",
"be",
"stored",
"in",
"the",
"local",
"session",
"in",
"order",
"to",
"be",
"used",
"in",
"a",
"future",
"Logout",
"Request",
"that",
"the",
"SP",
"could",
... | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L701-L709 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response._getAttributesByKeyName | private function _getAttributesByKeyName($keyName="Name")
{
$attributes = array();
$entries = $this->_queryAssertion('/saml:AttributeStatement/saml:Attribute');
/** @var $entry DOMNode */
foreach ($entries as $entry) {
$attributeKeyNode = $entry->attributes->getNamedIte... | php | private function _getAttributesByKeyName($keyName="Name")
{
$attributes = array();
$entries = $this->_queryAssertion('/saml:AttributeStatement/saml:Attribute');
/** @var $entry DOMNode */
foreach ($entries as $entry) {
$attributeKeyNode = $entry->attributes->getNamedIte... | [
"private",
"function",
"_getAttributesByKeyName",
"(",
"$",
"keyName",
"=",
"\"Name\"",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"$",
"entries",
"=",
"$",
"this",
"->",
"_queryAssertion",
"(",
"'/saml:AttributeStatement/saml:Attribute'",
")",
";... | @param string $keyName
@return array
@throws OneLogin_Saml2_ValidationError | [
"@param",
"string",
"$keyName"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L742-L776 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.validateNumAssertions | public function validateNumAssertions()
{
$encryptedAssertionNodes = $this->document->getElementsByTagName('EncryptedAssertion');
$assertionNodes = $this->document->getElementsByTagName('Assertion');
$valid = $assertionNodes->length + $encryptedAssertionNodes->length == 1;
if ($thi... | php | public function validateNumAssertions()
{
$encryptedAssertionNodes = $this->document->getElementsByTagName('EncryptedAssertion');
$assertionNodes = $this->document->getElementsByTagName('Assertion');
$valid = $assertionNodes->length + $encryptedAssertionNodes->length == 1;
if ($thi... | [
"public",
"function",
"validateNumAssertions",
"(",
")",
"{",
"$",
"encryptedAssertionNodes",
"=",
"$",
"this",
"->",
"document",
"->",
"getElementsByTagName",
"(",
"'EncryptedAssertion'",
")",
";",
"$",
"assertionNodes",
"=",
"$",
"this",
"->",
"document",
"->",
... | Verifies that the document only contains a single Assertion (encrypted or not).
@return bool TRUE if the document passes. | [
"Verifies",
"that",
"the",
"document",
"only",
"contains",
"a",
"single",
"Assertion",
"(",
"encrypted",
"or",
"not",
")",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L783-L796 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response.validateSignedElements | public function validateSignedElements($signedElements)
{
if (count($signedElements) > 2) {
return false;
}
$responseTag = '{'.OneLogin_Saml2_Constants::NS_SAMLP.'}Response';
$assertionTag = '{'.OneLogin_Saml2_Constants::NS_SAML.'}Assertion';
$ocurrence = array_... | php | public function validateSignedElements($signedElements)
{
if (count($signedElements) > 2) {
return false;
}
$responseTag = '{'.OneLogin_Saml2_Constants::NS_SAMLP.'}Response';
$assertionTag = '{'.OneLogin_Saml2_Constants::NS_SAML.'}Assertion';
$ocurrence = array_... | [
"public",
"function",
"validateSignedElements",
"(",
"$",
"signedElements",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"signedElements",
")",
">",
"2",
")",
"{",
"return",
"false",
";",
"}",
"$",
"responseTag",
"=",
"'{'",
".",
"OneLogin_Saml2_Constants",
"::",... | Verifies that the document has the expected signed nodes.
@param $signedElements
@return bool
@throws OneLogin_Saml2_ValidationError | [
"Verifies",
"that",
"the",
"document",
"has",
"the",
"expected",
"signed",
"nodes",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L934-L974 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response._queryAssertion | protected function _queryAssertion($assertionXpath)
{
if ($this->encrypted) {
$xpath = new DOMXPath($this->decryptedDocument);
} else {
$xpath = new DOMXPath($this->document);
}
$xpath->registerNamespace('samlp', OneLogin_Saml2_Constants::NS_SAMLP);
$... | php | protected function _queryAssertion($assertionXpath)
{
if ($this->encrypted) {
$xpath = new DOMXPath($this->decryptedDocument);
} else {
$xpath = new DOMXPath($this->document);
}
$xpath->registerNamespace('samlp', OneLogin_Saml2_Constants::NS_SAMLP);
$... | [
"protected",
"function",
"_queryAssertion",
"(",
"$",
"assertionXpath",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"encrypted",
")",
"{",
"$",
"xpath",
"=",
"new",
"DOMXPath",
"(",
"$",
"this",
"->",
"decryptedDocument",
")",
";",
"}",
"else",
"{",
"$",
"... | Extracts a node from the DOMDocument (Assertion).
@param string $assertionXpath Xpath Expression
@return DOMNodeList The queried node | [
"Extracts",
"a",
"node",
"from",
"the",
"DOMDocument",
"(",
"Assertion",
")",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L983-L1025 |
onelogin/php-saml | lib/Saml2/Response.php | OneLogin_Saml2_Response._query | private function _query($query)
{
if ($this->encrypted) {
return OneLogin_Saml2_Utils::query($this->decryptedDocument, $query);
} else {
return OneLogin_Saml2_Utils::query($this->document, $query);
}
} | php | private function _query($query)
{
if ($this->encrypted) {
return OneLogin_Saml2_Utils::query($this->decryptedDocument, $query);
} else {
return OneLogin_Saml2_Utils::query($this->document, $query);
}
} | [
"private",
"function",
"_query",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"encrypted",
")",
"{",
"return",
"OneLogin_Saml2_Utils",
"::",
"query",
"(",
"$",
"this",
"->",
"decryptedDocument",
",",
"$",
"query",
")",
";",
"}",
"else",
"... | Extracts nodes that match the query from the DOMDocument (Response Menssage)
@param string $query Xpath Expresion
@return DOMNodeList The queried nodes | [
"Extracts",
"nodes",
"that",
"match",
"the",
"query",
"from",
"the",
"DOMDocument",
"(",
"Response",
"Menssage",
")"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Response.php#L1034-L1041 |
onelogin/php-saml | lib/Saml/AuthRequest.php | OneLogin_Saml_AuthRequest.getRedirectUrl | public function getRedirectUrl($returnTo = null)
{
$settings = $this->auth->getSettings();
$authnRequest = new OneLogin_Saml2_AuthnRequest($settings);
$parameters = array('SAMLRequest' => $authnRequest->getRequest());
if (!empty($returnTo)) {
$parameters['RelayState'] = $... | php | public function getRedirectUrl($returnTo = null)
{
$settings = $this->auth->getSettings();
$authnRequest = new OneLogin_Saml2_AuthnRequest($settings);
$parameters = array('SAMLRequest' => $authnRequest->getRequest());
if (!empty($returnTo)) {
$parameters['RelayState'] = $... | [
"public",
"function",
"getRedirectUrl",
"(",
"$",
"returnTo",
"=",
"null",
")",
"{",
"$",
"settings",
"=",
"$",
"this",
"->",
"auth",
"->",
"getSettings",
"(",
")",
";",
"$",
"authnRequest",
"=",
"new",
"OneLogin_Saml2_AuthnRequest",
"(",
"$",
"settings",
... | Obtains the SSO URL containing the AuthRequest
message deflated.
@param string|null $returnTo
@return string
@throws OneLogin_Saml2_Error | [
"Obtains",
"the",
"SSO",
"URL",
"containing",
"the",
"AuthRequest",
"message",
"deflated",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml/AuthRequest.php#L32-L44 |
onelogin/php-saml | lib/Saml2/LogoutRequest.php | OneLogin_Saml2_LogoutRequest.getRequest | public function getRequest($deflate = null)
{
$subject = $this->_logoutRequest;
if (is_null($deflate)) {
$deflate = $this->_settings->shouldCompressRequests();
}
if ($deflate) {
$subject = gzdeflate($this->_logoutRequest);
}
return base64_en... | php | public function getRequest($deflate = null)
{
$subject = $this->_logoutRequest;
if (is_null($deflate)) {
$deflate = $this->_settings->shouldCompressRequests();
}
if ($deflate) {
$subject = gzdeflate($this->_logoutRequest);
}
return base64_en... | [
"public",
"function",
"getRequest",
"(",
"$",
"deflate",
"=",
"null",
")",
"{",
"$",
"subject",
"=",
"$",
"this",
"->",
"_logoutRequest",
";",
"if",
"(",
"is_null",
"(",
"$",
"deflate",
")",
")",
"{",
"$",
"deflate",
"=",
"$",
"this",
"->",
"_setting... | Returns the Logout Request defated, base64encoded, unsigned
@param bool|null $deflate Whether or not we should 'gzdeflate' the request body before we return it.
@return string Deflated base64 encoded Logout Request | [
"Returns",
"the",
"Logout",
"Request",
"defated",
"base64encoded",
"unsigned"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutRequest.php#L134-L147 |
onelogin/php-saml | lib/Saml2/LogoutRequest.php | OneLogin_Saml2_LogoutRequest.getID | public static function getID($request)
{
if ($request instanceof DOMDocument) {
$dom = $request;
} else {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
if (false === $dom) {
throw new OneLogin_Saml2_Er... | php | public static function getID($request)
{
if ($request instanceof DOMDocument) {
$dom = $request;
} else {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
if (false === $dom) {
throw new OneLogin_Saml2_Er... | [
"public",
"static",
"function",
"getID",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"instanceof",
"DOMDocument",
")",
"{",
"$",
"dom",
"=",
"$",
"request",
";",
"}",
"else",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
")",
";",
... | Returns the ID of the Logout Request.
@param string|DOMDocument $request Logout Request Message
@return string ID
@throws OneLogin_Saml2_Error | [
"Returns",
"the",
"ID",
"of",
"the",
"Logout",
"Request",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutRequest.php#L158-L176 |
onelogin/php-saml | lib/Saml2/LogoutRequest.php | OneLogin_Saml2_LogoutRequest.getNameIdData | public static function getNameIdData($request, $key = null)
{
if ($request instanceof DOMDocument) {
$dom = $request;
} else {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
}
$encryptedEntries = OneLogin_Saml2_Uti... | php | public static function getNameIdData($request, $key = null)
{
if ($request instanceof DOMDocument) {
$dom = $request;
} else {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
}
$encryptedEntries = OneLogin_Saml2_Uti... | [
"public",
"static",
"function",
"getNameIdData",
"(",
"$",
"request",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"request",
"instanceof",
"DOMDocument",
")",
"{",
"$",
"dom",
"=",
"$",
"request",
";",
"}",
"else",
"{",
"$",
"dom",
"=",
... | Gets the NameID Data of the the Logout Request.
@param string|DOMDocument $request Logout Request Message
@param string|null $key The SP key
@return array Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
@throws OneLogin_Saml2_Error
@throws OneLogin_Saml2_ValidationError | [
"Gets",
"the",
"NameID",
"Data",
"of",
"the",
"the",
"Logout",
"Request",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutRequest.php#L189-L239 |
onelogin/php-saml | lib/Saml2/LogoutRequest.php | OneLogin_Saml2_LogoutRequest.getNameId | public static function getNameId($request, $key = null)
{
$nameId = self::getNameIdData($request, $key);
return $nameId['Value'];
} | php | public static function getNameId($request, $key = null)
{
$nameId = self::getNameIdData($request, $key);
return $nameId['Value'];
} | [
"public",
"static",
"function",
"getNameId",
"(",
"$",
"request",
",",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"nameId",
"=",
"self",
"::",
"getNameIdData",
"(",
"$",
"request",
",",
"$",
"key",
")",
";",
"return",
"$",
"nameId",
"[",
"'Value'",
"]",... | Gets the NameID of the Logout Request.
@param string|DOMDocument $request Logout Request Message
@param string|null $key The SP key
@return string Name ID Value
@throws OneLogin_Saml2_Error
@throws OneLogin_Saml2_ValidationError | [
"Gets",
"the",
"NameID",
"of",
"the",
"Logout",
"Request",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutRequest.php#L252-L256 |
onelogin/php-saml | lib/Saml2/LogoutRequest.php | OneLogin_Saml2_LogoutRequest.getIssuer | public static function getIssuer($request)
{
if ($request instanceof DOMDocument) {
$dom = $request;
} else {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
}
$issuer = null;
$issuerNodes = OneLogin_Saml2_U... | php | public static function getIssuer($request)
{
if ($request instanceof DOMDocument) {
$dom = $request;
} else {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
}
$issuer = null;
$issuerNodes = OneLogin_Saml2_U... | [
"public",
"static",
"function",
"getIssuer",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"instanceof",
"DOMDocument",
")",
"{",
"$",
"dom",
"=",
"$",
"request",
";",
"}",
"else",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
")",
";"... | Gets the Issuer of the Logout Request.
@param string|DOMDocument $request Logout Request Message
@return string|null $issuer The Issuer
@throws Exception | [
"Gets",
"the",
"Issuer",
"of",
"the",
"Logout",
"Request",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutRequest.php#L266-L281 |
onelogin/php-saml | lib/Saml2/LogoutRequest.php | OneLogin_Saml2_LogoutRequest.getSessionIndexes | public static function getSessionIndexes($request)
{
if ($request instanceof DOMDocument) {
$dom = $request;
} else {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
}
$sessionIndexes = array();
$sessionInde... | php | public static function getSessionIndexes($request)
{
if ($request instanceof DOMDocument) {
$dom = $request;
} else {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
}
$sessionIndexes = array();
$sessionInde... | [
"public",
"static",
"function",
"getSessionIndexes",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"instanceof",
"DOMDocument",
")",
"{",
"$",
"dom",
"=",
"$",
"request",
";",
"}",
"else",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
")... | Gets the SessionIndexes from the Logout Request.
Notice: Our Constructor only support 1 SessionIndex but this parser
extracts an array of all the SessionIndex found on a
Logout Request, that could be many.
@param string|DOMDocument $request Logout Request Message
@return array The SessionIndex value
@throws Excepti... | [
"Gets",
"the",
"SessionIndexes",
"from",
"the",
"Logout",
"Request",
".",
"Notice",
":",
"Our",
"Constructor",
"only",
"support",
"1",
"SessionIndex",
"but",
"this",
"parser",
"extracts",
"an",
"array",
"of",
"all",
"the",
"SessionIndex",
"found",
"on",
"a",
... | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutRequest.php#L295-L310 |
onelogin/php-saml | lib/Saml2/LogoutRequest.php | OneLogin_Saml2_LogoutRequest.isValid | public function isValid($retrieveParametersFromServer = false)
{
$this->_error = null;
try {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $this->_logoutRequest);
$idpData = $this->_settings->getIdPData();
$idPEntityId = $idpDat... | php | public function isValid($retrieveParametersFromServer = false)
{
$this->_error = null;
try {
$dom = new DOMDocument();
$dom = OneLogin_Saml2_Utils::loadXML($dom, $this->_logoutRequest);
$idpData = $this->_settings->getIdPData();
$idPEntityId = $idpDat... | [
"public",
"function",
"isValid",
"(",
"$",
"retrieveParametersFromServer",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_error",
"=",
"null",
";",
"try",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
")",
";",
"$",
"dom",
"=",
"OneLogin_Saml2_Utils",
"... | Checks if the Logout Request recieved is valid.
@param bool $retrieveParametersFromServer
@return bool If the Logout Request is or not valid | [
"Checks",
"if",
"the",
"Logout",
"Request",
"recieved",
"is",
"valid",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/LogoutRequest.php#L319-L404 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings._loadPaths | private function _loadPaths()
{
$basePath = dirname(dirname(__DIR__)).'/';
$this->_paths = array (
'base' => $basePath,
'config' => $basePath,
'cert' => $basePath.'certs/',
'lib' => $basePath.'lib/',
'extlib' => $basePath.'extlib/'
... | php | private function _loadPaths()
{
$basePath = dirname(dirname(__DIR__)).'/';
$this->_paths = array (
'base' => $basePath,
'config' => $basePath,
'cert' => $basePath.'certs/',
'lib' => $basePath.'lib/',
'extlib' => $basePath.'extlib/'
... | [
"private",
"function",
"_loadPaths",
"(",
")",
"{",
"$",
"basePath",
"=",
"dirname",
"(",
"dirname",
"(",
"__DIR__",
")",
")",
".",
"'/'",
";",
"$",
"this",
"->",
"_paths",
"=",
"array",
"(",
"'base'",
"=>",
"$",
"basePath",
",",
"'config'",
"=>",
"$... | Sets the paths of the different folders
@suppress PhanUndeclaredConstant | [
"Sets",
"the",
"paths",
"of",
"the",
"different",
"folders"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L155-L170 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings._loadSettingsFromArray | private function _loadSettingsFromArray($settings)
{
if (isset($settings['sp'])) {
$this->_sp = $settings['sp'];
}
if (isset($settings['idp'])) {
$this->_idp = $settings['idp'];
}
$errors = $this->checkSettings($settings);
if (empty($errors)) ... | php | private function _loadSettingsFromArray($settings)
{
if (isset($settings['sp'])) {
$this->_sp = $settings['sp'];
}
if (isset($settings['idp'])) {
$this->_idp = $settings['idp'];
}
$errors = $this->checkSettings($settings);
if (empty($errors)) ... | [
"private",
"function",
"_loadSettingsFromArray",
"(",
"$",
"settings",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"settings",
"[",
"'sp'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_sp",
"=",
"$",
"settings",
"[",
"'sp'",
"]",
";",
"}",
"if",
"(",
"isse... | Loads settings info from a settings Array
@param array $settings SAML Toolkit Settings
@return bool True if the settings info is valid | [
"Loads",
"settings",
"info",
"from",
"a",
"settings",
"Array"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L239-L285 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings._loadSettingsFromFile | private function _loadSettingsFromFile()
{
$filename = $this->getConfigPath().'settings.php';
if (!file_exists($filename)) {
throw new OneLogin_Saml2_Error(
'Settings file not found: %s',
OneLogin_Saml2_Error::SETTINGS_FILE_NOT_FOUND,
arra... | php | private function _loadSettingsFromFile()
{
$filename = $this->getConfigPath().'settings.php';
if (!file_exists($filename)) {
throw new OneLogin_Saml2_Error(
'Settings file not found: %s',
OneLogin_Saml2_Error::SETTINGS_FILE_NOT_FOUND,
arra... | [
"private",
"function",
"_loadSettingsFromFile",
"(",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"getConfigPath",
"(",
")",
".",
"'settings.php'",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"OneLogin_Sam... | Loads settings info from the settings file
@return bool True if the settings info is valid
@throws OneLogin_Saml2_Error
@suppress PhanUndeclaredVariable | [
"Loads",
"settings",
"info",
"from",
"the",
"settings",
"file"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L296-L323 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings._addDefaultValues | private function _addDefaultValues()
{
if (!isset($this->_sp['assertionConsumerService']['binding'])) {
$this->_sp['assertionConsumerService']['binding'] = OneLogin_Saml2_Constants::BINDING_HTTP_POST;
}
if (isset($this->_sp['singleLogoutService']) && !isset($this->_sp['singleLogo... | php | private function _addDefaultValues()
{
if (!isset($this->_sp['assertionConsumerService']['binding'])) {
$this->_sp['assertionConsumerService']['binding'] = OneLogin_Saml2_Constants::BINDING_HTTP_POST;
}
if (isset($this->_sp['singleLogoutService']) && !isset($this->_sp['singleLogo... | [
"private",
"function",
"_addDefaultValues",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_sp",
"[",
"'assertionConsumerService'",
"]",
"[",
"'binding'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_sp",
"[",
"'assertionConsumerService'",
"]... | Add default values if the settings info is not complete | [
"Add",
"default",
"values",
"if",
"the",
"settings",
"info",
"is",
"not",
"complete"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L328-L432 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.checkSettings | public function checkSettings($settings)
{
assert('is_array($settings)');
if (!is_array($settings) || empty($settings)) {
$errors = array('invalid_syntax');
} else {
$errors = array();
if (!$this->_spValidationOnly) {
$idpErrors = $this->c... | php | public function checkSettings($settings)
{
assert('is_array($settings)');
if (!is_array($settings) || empty($settings)) {
$errors = array('invalid_syntax');
} else {
$errors = array();
if (!$this->_spValidationOnly) {
$idpErrors = $this->c... | [
"public",
"function",
"checkSettings",
"(",
"$",
"settings",
")",
"{",
"assert",
"(",
"'is_array($settings)'",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"settings",
")",
"||",
"empty",
"(",
"$",
"settings",
")",
")",
"{",
"$",
"errors",
"=",
"arr... | Checks the settings info.
@param array $settings Array with settings data
@return array $errors Errors found on the settings data | [
"Checks",
"the",
"settings",
"info",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L441-L461 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.checkCompressionSettings | public function checkCompressionSettings($settings)
{
$errors = array();
if (isset($settings['compress'])) {
if (!is_array($settings['compress'])) {
$errors[] = "invalid_syntax";
} else if (isset($settings['compress']['requests'])
&& $settings... | php | public function checkCompressionSettings($settings)
{
$errors = array();
if (isset($settings['compress'])) {
if (!is_array($settings['compress'])) {
$errors[] = "invalid_syntax";
} else if (isset($settings['compress']['requests'])
&& $settings... | [
"public",
"function",
"checkCompressionSettings",
"(",
"$",
"settings",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"settings",
"[",
"'compress'",
"]",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"sett... | Checks the compression settings info.
@param array $settings Array with settings data
@return array $errors Errors found on the settings data | [
"Checks",
"the",
"compression",
"settings",
"info",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L470-L490 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.checkSPSettings | public function checkSPSettings($settings)
{
assert('is_array($settings)');
if (!is_array($settings) || empty($settings)) {
return array('invalid_syntax');
}
$errors = array();
if (!isset($settings['sp']) || empty($settings['sp'])) {
$errors[] = 'sp... | php | public function checkSPSettings($settings)
{
assert('is_array($settings)');
if (!is_array($settings) || empty($settings)) {
return array('invalid_syntax');
}
$errors = array();
if (!isset($settings['sp']) || empty($settings['sp'])) {
$errors[] = 'sp... | [
"public",
"function",
"checkSPSettings",
"(",
"$",
"settings",
")",
"{",
"assert",
"(",
"'is_array($settings)'",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"settings",
")",
"||",
"empty",
"(",
"$",
"settings",
")",
")",
"{",
"return",
"array",
"(",
... | Checks the SP settings info.
@param array $settings Array with settings data
@return array $errors Errors found on the SP settings data | [
"Checks",
"the",
"SP",
"settings",
"info",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L572-L660 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.checkSPCerts | public function checkSPCerts()
{
$key = $this->getSPkey();
$cert = $this->getSPcert();
return (!empty($key) && !empty($cert));
} | php | public function checkSPCerts()
{
$key = $this->getSPkey();
$cert = $this->getSPcert();
return (!empty($key) && !empty($cert));
} | [
"public",
"function",
"checkSPCerts",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getSPkey",
"(",
")",
";",
"$",
"cert",
"=",
"$",
"this",
"->",
"getSPcert",
"(",
")",
";",
"return",
"(",
"!",
"empty",
"(",
"$",
"key",
")",
"&&",
"!",
"... | Checks if the x509 certs of the SP exists and are valid.
@return bool | [
"Checks",
"if",
"the",
"x509",
"certs",
"of",
"the",
"SP",
"exists",
"and",
"are",
"valid",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L667-L672 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.getSPkey | public function getSPkey()
{
$key = null;
if (isset($this->_sp['privateKey']) && !empty($this->_sp['privateKey'])) {
$key = $this->_sp['privateKey'];
} else {
$keyFile = $this->_paths['cert'].'sp.key';
if (file_exists($keyFile)) {
$key = f... | php | public function getSPkey()
{
$key = null;
if (isset($this->_sp['privateKey']) && !empty($this->_sp['privateKey'])) {
$key = $this->_sp['privateKey'];
} else {
$keyFile = $this->_paths['cert'].'sp.key';
if (file_exists($keyFile)) {
$key = f... | [
"public",
"function",
"getSPkey",
"(",
")",
"{",
"$",
"key",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_sp",
"[",
"'privateKey'",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"_sp",
"[",
"'privateKey'",
"]",
")",
")"... | Returns the x509 private key of the SP.
@return string SP private key | [
"Returns",
"the",
"x509",
"private",
"key",
"of",
"the",
"SP",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L679-L692 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.getSPcert | public function getSPcert()
{
$cert = null;
if (isset($this->_sp['x509cert']) && !empty($this->_sp['x509cert'])) {
$cert = $this->_sp['x509cert'];
} else {
$certFile = $this->_paths['cert'].'sp.crt';
if (file_exists($certFile)) {
$cert = ... | php | public function getSPcert()
{
$cert = null;
if (isset($this->_sp['x509cert']) && !empty($this->_sp['x509cert'])) {
$cert = $this->_sp['x509cert'];
} else {
$certFile = $this->_paths['cert'].'sp.crt';
if (file_exists($certFile)) {
$cert = ... | [
"public",
"function",
"getSPcert",
"(",
")",
"{",
"$",
"cert",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_sp",
"[",
"'x509cert'",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"_sp",
"[",
"'x509cert'",
"]",
")",
")",
... | Returns the x509 public cert of the SP.
@return string SP public cert | [
"Returns",
"the",
"x509",
"public",
"cert",
"of",
"the",
"SP",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L699-L713 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.validateMetadata | public function validateMetadata($xml)
{
assert('is_string($xml)');
$errors = array();
$res = OneLogin_Saml2_Utils::validateXML($xml, 'saml-schema-metadata-2.0.xsd', $this->_debug);
if (!$res instanceof DOMDocument) {
$errors[] = $res;
} else {
$dom =... | php | public function validateMetadata($xml)
{
assert('is_string($xml)');
$errors = array();
$res = OneLogin_Saml2_Utils::validateXML($xml, 'saml-schema-metadata-2.0.xsd', $this->_debug);
if (!$res instanceof DOMDocument) {
$errors[] = $res;
} else {
$dom =... | [
"public",
"function",
"validateMetadata",
"(",
"$",
"xml",
")",
"{",
"assert",
"(",
"'is_string($xml)'",
")",
";",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"$",
"res",
"=",
"OneLogin_Saml2_Utils",
"::",
"validateXML",
"(",
"$",
"xml",
",",
"'saml-schema... | Validates an XML SP Metadata.
@param string $xml Metadata's XML that will be validate
@return Array The list of found errors
@throws Exception | [
"Validates",
"an",
"XML",
"SP",
"Metadata",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L914-L947 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.formatIdPCert | public function formatIdPCert()
{
if (isset($this->_idp['x509cert'])) {
$this->_idp['x509cert'] = OneLogin_Saml2_Utils::formatCert($this->_idp['x509cert']);
}
} | php | public function formatIdPCert()
{
if (isset($this->_idp['x509cert'])) {
$this->_idp['x509cert'] = OneLogin_Saml2_Utils::formatCert($this->_idp['x509cert']);
}
} | [
"public",
"function",
"formatIdPCert",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_idp",
"[",
"'x509cert'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_idp",
"[",
"'x509cert'",
"]",
"=",
"OneLogin_Saml2_Utils",
"::",
"formatCert",
"(",
"$... | Formats the IdP cert. | [
"Formats",
"the",
"IdP",
"cert",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L952-L957 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.formatIdPCertMulti | public function formatIdPCertMulti()
{
if (isset($this->_idp['x509certMulti'])) {
if (isset($this->_idp['x509certMulti']['signing'])) {
foreach ($this->_idp['x509certMulti']['signing'] as $i => $cert) {
$this->_idp['x509certMulti']['signing'][$i] = OneLogin_Sa... | php | public function formatIdPCertMulti()
{
if (isset($this->_idp['x509certMulti'])) {
if (isset($this->_idp['x509certMulti']['signing'])) {
foreach ($this->_idp['x509certMulti']['signing'] as $i => $cert) {
$this->_idp['x509certMulti']['signing'][$i] = OneLogin_Sa... | [
"public",
"function",
"formatIdPCertMulti",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_idp",
"[",
"'x509certMulti'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_idp",
"[",
"'x509certMulti'",
"]",
"[",
"'signing'"... | Formats the Multple IdP certs. | [
"Formats",
"the",
"Multple",
"IdP",
"certs",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L962-L976 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.formatSPCert | public function formatSPCert()
{
if (isset($this->_sp['x509cert'])) {
$this->_sp['x509cert'] = OneLogin_Saml2_Utils::formatCert($this->_sp['x509cert']);
}
} | php | public function formatSPCert()
{
if (isset($this->_sp['x509cert'])) {
$this->_sp['x509cert'] = OneLogin_Saml2_Utils::formatCert($this->_sp['x509cert']);
}
} | [
"public",
"function",
"formatSPCert",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_sp",
"[",
"'x509cert'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_sp",
"[",
"'x509cert'",
"]",
"=",
"OneLogin_Saml2_Utils",
"::",
"formatCert",
"(",
"$",
... | Formats the SP cert. | [
"Formats",
"the",
"SP",
"cert",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L981-L986 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.formatSPCertNew | public function formatSPCertNew()
{
if (isset($this->_sp['x509certNew'])) {
$this->_sp['x509certNew'] = OneLogin_Saml2_Utils::formatCert($this->_sp['x509certNew']);
}
} | php | public function formatSPCertNew()
{
if (isset($this->_sp['x509certNew'])) {
$this->_sp['x509certNew'] = OneLogin_Saml2_Utils::formatCert($this->_sp['x509certNew']);
}
} | [
"public",
"function",
"formatSPCertNew",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_sp",
"[",
"'x509certNew'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_sp",
"[",
"'x509certNew'",
"]",
"=",
"OneLogin_Saml2_Utils",
"::",
"formatCert",
"("... | Formats the SP cert. | [
"Formats",
"the",
"SP",
"cert",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L991-L996 |
onelogin/php-saml | lib/Saml2/Settings.php | OneLogin_Saml2_Settings.formatSPKey | public function formatSPKey()
{
if (isset($this->_sp['privateKey'])) {
$this->_sp['privateKey'] = OneLogin_Saml2_Utils::formatPrivateKey($this->_sp['privateKey']);
}
} | php | public function formatSPKey()
{
if (isset($this->_sp['privateKey'])) {
$this->_sp['privateKey'] = OneLogin_Saml2_Utils::formatPrivateKey($this->_sp['privateKey']);
}
} | [
"public",
"function",
"formatSPKey",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_sp",
"[",
"'privateKey'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_sp",
"[",
"'privateKey'",
"]",
"=",
"OneLogin_Saml2_Utils",
"::",
"formatPrivateKey",
"("... | Formats the SP private key. | [
"Formats",
"the",
"SP",
"private",
"key",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Settings.php#L1001-L1006 |
onelogin/php-saml | lib/Saml2/AuthnRequest.php | OneLogin_Saml2_AuthnRequest.getRequest | public function getRequest($deflate = null)
{
$subject = $this->_authnRequest;
if (is_null($deflate)) {
$deflate = $this->_settings->shouldCompressRequests();
}
if ($deflate) {
$subject = gzdeflate($this->_authnRequest);
}
$base64Request = b... | php | public function getRequest($deflate = null)
{
$subject = $this->_authnRequest;
if (is_null($deflate)) {
$deflate = $this->_settings->shouldCompressRequests();
}
if ($deflate) {
$subject = gzdeflate($this->_authnRequest);
}
$base64Request = b... | [
"public",
"function",
"getRequest",
"(",
"$",
"deflate",
"=",
"null",
")",
"{",
"$",
"subject",
"=",
"$",
"this",
"->",
"_authnRequest",
";",
"if",
"(",
"is_null",
"(",
"$",
"deflate",
")",
")",
"{",
"$",
"deflate",
"=",
"$",
"this",
"->",
"_settings... | Returns deflated, base64 encoded, unsigned AuthnRequest.
@param bool|null $deflate Whether or not we should 'gzdeflate' the request body before we return it.
@return string | [
"Returns",
"deflated",
"base64",
"encoded",
"unsigned",
"AuthnRequest",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/AuthnRequest.php#L158-L172 |
onelogin/php-saml | lib/Saml2/Utils.php | OneLogin_Saml2_Utils.t | public static function t($msg, $args = array())
{
assert('is_string($msg)');
if (extension_loaded('gettext')) {
bindtextdomain("phptoolkit", dirname(dirname(__DIR__)).'/locale');
textdomain('phptoolkit');
$translatedMsg = gettext($msg);
} else {
... | php | public static function t($msg, $args = array())
{
assert('is_string($msg)');
if (extension_loaded('gettext')) {
bindtextdomain("phptoolkit", dirname(dirname(__DIR__)).'/locale');
textdomain('phptoolkit');
$translatedMsg = gettext($msg);
} else {
... | [
"public",
"static",
"function",
"t",
"(",
"$",
"msg",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"assert",
"(",
"'is_string($msg)'",
")",
";",
"if",
"(",
"extension_loaded",
"(",
"'gettext'",
")",
")",
"{",
"bindtextdomain",
"(",
"\"phptoolkit\"... | Translates any string. Accepts args
@param string $msg Message to be translated
@param array|null $args Arguments
@return string $translatedMsg Translated text | [
"Translates",
"any",
"string",
".",
"Accepts",
"args"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Utils.php#L53-L69 |
onelogin/php-saml | lib/Saml2/Utils.php | OneLogin_Saml2_Utils.loadXML | public static function loadXML($dom, $xml)
{
assert('$dom instanceof DOMDocument');
assert('is_string($xml)');
$oldEntityLoader = libxml_disable_entity_loader(true);
$res = $dom->loadXML($xml);
libxml_disable_entity_loader($oldEntityLoader);
foreach ($dom->childNo... | php | public static function loadXML($dom, $xml)
{
assert('$dom instanceof DOMDocument');
assert('is_string($xml)');
$oldEntityLoader = libxml_disable_entity_loader(true);
$res = $dom->loadXML($xml);
libxml_disable_entity_loader($oldEntityLoader);
foreach ($dom->childNo... | [
"public",
"static",
"function",
"loadXML",
"(",
"$",
"dom",
",",
"$",
"xml",
")",
"{",
"assert",
"(",
"'$dom instanceof DOMDocument'",
")",
";",
"assert",
"(",
"'is_string($xml)'",
")",
";",
"$",
"oldEntityLoader",
"=",
"libxml_disable_entity_loader",
"(",
"true... | This function load an XML string in a save way.
Prevent XEE/XXE Attacks
@param DOMDocument $dom The document where load the xml.
@param string $xml The XML string to be loaded.
@return DOMDocument|false $dom The result of load the XML at the DomDocument
@throws Exception | [
"This",
"function",
"load",
"an",
"XML",
"string",
"in",
"a",
"save",
"way",
".",
"Prevent",
"XEE",
"/",
"XXE",
"Attacks"
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Utils.php#L82-L106 |
onelogin/php-saml | lib/Saml2/Utils.php | OneLogin_Saml2_Utils.validateXML | public static function validateXML($xml, $schema, $debug = false)
{
assert('is_string($xml) || $xml instanceof DOMDocument');
assert('is_string($schema)');
libxml_clear_errors();
libxml_use_internal_errors(true);
if ($xml instanceof DOMDocument) {
$dom = $xml;
... | php | public static function validateXML($xml, $schema, $debug = false)
{
assert('is_string($xml) || $xml instanceof DOMDocument');
assert('is_string($schema)');
libxml_clear_errors();
libxml_use_internal_errors(true);
if ($xml instanceof DOMDocument) {
$dom = $xml;
... | [
"public",
"static",
"function",
"validateXML",
"(",
"$",
"xml",
",",
"$",
"schema",
",",
"$",
"debug",
"=",
"false",
")",
"{",
"assert",
"(",
"'is_string($xml) || $xml instanceof DOMDocument'",
")",
";",
"assert",
"(",
"'is_string($schema)'",
")",
";",
"libxml_c... | This function attempts to validate an XML string against the specified schema.
It will parse the string into a DOM document and validate this document against the schema.
@param string|DOMDocument $xml The XML string or document which should be validated.
@param string $schema The schema filename which should be used... | [
"This",
"function",
"attempts",
"to",
"validate",
"an",
"XML",
"string",
"against",
"the",
"specified",
"schema",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Utils.php#L121-L158 |
onelogin/php-saml | lib/Saml2/Utils.php | OneLogin_Saml2_Utils.treeCopyReplace | public static function treeCopyReplace(DomNode $targetNode, DomNode $sourceNode, $recurse = false)
{
if ($targetNode->parentNode === null) {
throw new Exception('Illegal argument targetNode. It has no parentNode.');
}
$clonedNode = $targetNode->ownerDocument->importNode($sourceNo... | php | public static function treeCopyReplace(DomNode $targetNode, DomNode $sourceNode, $recurse = false)
{
if ($targetNode->parentNode === null) {
throw new Exception('Illegal argument targetNode. It has no parentNode.');
}
$clonedNode = $targetNode->ownerDocument->importNode($sourceNo... | [
"public",
"static",
"function",
"treeCopyReplace",
"(",
"DomNode",
"$",
"targetNode",
",",
"DomNode",
"$",
"sourceNode",
",",
"$",
"recurse",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"targetNode",
"->",
"parentNode",
"===",
"null",
")",
"{",
"throw",
"new",... | Import a node tree into a target document
Copy it before a reference node as a sibling
and at the end of the copy remove
the reference node in the target document
As it were 'replacing' it
Leaving nested default namespaces alone
(Standard importNode with deep copy
mangles nested default namespaces)
The reference node ... | [
"Import",
"a",
"node",
"tree",
"into",
"a",
"target",
"document",
"Copy",
"it",
"before",
"a",
"reference",
"node",
"as",
"a",
"sibling",
"and",
"at",
"the",
"end",
"of",
"the",
"copy",
"remove",
"the",
"reference",
"node",
"in",
"the",
"target",
"docume... | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Utils.php#L180-L200 |
onelogin/php-saml | lib/Saml2/Utils.php | OneLogin_Saml2_Utils.formatPrivateKey | public static function formatPrivateKey($key, $heads = true)
{
$key = str_replace(array("\x0D", "\r", "\n"), "", $key);
if (!empty($key)) {
if (strpos($key, '-----BEGIN PRIVATE KEY-----') !== false) {
$key = OneLogin_Saml2_Utils::getStringBetween($key, '-----BEGIN PRIVATE... | php | public static function formatPrivateKey($key, $heads = true)
{
$key = str_replace(array("\x0D", "\r", "\n"), "", $key);
if (!empty($key)) {
if (strpos($key, '-----BEGIN PRIVATE KEY-----') !== false) {
$key = OneLogin_Saml2_Utils::getStringBetween($key, '-----BEGIN PRIVATE... | [
"public",
"static",
"function",
"formatPrivateKey",
"(",
"$",
"key",
",",
"$",
"heads",
"=",
"true",
")",
"{",
"$",
"key",
"=",
"str_replace",
"(",
"array",
"(",
"\"\\x0D\"",
",",
"\"\\r\"",
",",
"\"\\n\"",
")",
",",
"\"\"",
",",
"$",
"key",
")",
";"... | Returns a private key (adding header & footer if required).
@param string $key A private key
@param bool $heads True if we want to include head and footer
@return string $rsaKey Formatted private key | [
"Returns",
"a",
"private",
"key",
"(",
"adding",
"header",
"&",
"footer",
"if",
"required",
")",
"."
] | train | https://github.com/onelogin/php-saml/blob/fc9c87d40d16cee0116ac580c948b66a8fb404aa/lib/Saml2/Utils.php#L236-L263 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.