id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
34,600 | nails/module-cdn | src/Service/Cdn.php | Cdn.getCountCommonBuckets | public function getCountCommonBuckets($aData = [])
{
if (!empty($aData['keywords'])) {
if (empty($aData['or_like'])) {
$aData['or_like'] = [];
}
$aData['or_like'][] = [
'column' => 'b.label',
'value' => $aData['keywords'],
... | php | public function getCountCommonBuckets($aData = [])
{
if (!empty($aData['keywords'])) {
if (empty($aData['or_like'])) {
$aData['or_like'] = [];
}
$aData['or_like'][] = [
'column' => 'b.label',
'value' => $aData['keywords'],
... | [
"public",
"function",
"getCountCommonBuckets",
"(",
"$",
"aData",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"aData",
"[",
"'keywords'",
"]",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"aData",
"[",
"'or_like'",
"]",
")",
")",
... | Applies keyword searching for buckets
@param array $aData Data to pass to parent::getCountCommon | [
"Applies",
"keyword",
"searching",
"for",
"buckets"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L1735-L1748 |
34,601 | nails/module-cdn | src/Service/Cdn.php | Cdn.getBucketsFlat | public function getBucketsFlat($page = null, $perPage = null, $data = [])
{
$aBuckets = $this->getBuckets($page, $perPage, $data);
$aOut = [];
foreach ($aBuckets as $oBucket) {
$aOut[$oBucket->id] = $oBucket->label;
}
return $aOut;
} | php | public function getBucketsFlat($page = null, $perPage = null, $data = [])
{
$aBuckets = $this->getBuckets($page, $perPage, $data);
$aOut = [];
foreach ($aBuckets as $oBucket) {
$aOut[$oBucket->id] = $oBucket->label;
}
return $aOut;
} | [
"public",
"function",
"getBucketsFlat",
"(",
"$",
"page",
"=",
"null",
",",
"$",
"perPage",
"=",
"null",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"aBuckets",
"=",
"$",
"this",
"->",
"getBuckets",
"(",
"$",
"page",
",",
"$",
"perPage",
",",
... | Returns an array of buckets as a flat array
@param integer $page The page to return
@param integer $perPage The number of items to return per page
@param array $data An array of data to pass to getCountCommonBuckets()
@return array | [
"Returns",
"an",
"array",
"of",
"buckets",
"as",
"a",
"flat",
"array"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L1761-L1771 |
34,602 | nails/module-cdn | src/Service/Cdn.php | Cdn.getBucket | public function getBucket($bucketIdSlug)
{
$aData = ['where' => []];
if (is_numeric($bucketIdSlug)) {
$aData['where'][] = ['b.id', $bucketIdSlug];
} else {
$aData['where'][] = ['b.slug', $bucketIdSlug];
}
$aBuckets = $this->getBuckets(null, null, $aD... | php | public function getBucket($bucketIdSlug)
{
$aData = ['where' => []];
if (is_numeric($bucketIdSlug)) {
$aData['where'][] = ['b.id', $bucketIdSlug];
} else {
$aData['where'][] = ['b.slug', $bucketIdSlug];
}
$aBuckets = $this->getBuckets(null, null, $aD... | [
"public",
"function",
"getBucket",
"(",
"$",
"bucketIdSlug",
")",
"{",
"$",
"aData",
"=",
"[",
"'where'",
"=>",
"[",
"]",
"]",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"bucketIdSlug",
")",
")",
"{",
"$",
"aData",
"[",
"'where'",
"]",
"[",
"]",
"=",
... | Returns a single bucket object
@param string
@return \stdClass|false | [
"Returns",
"a",
"single",
"bucket",
"object"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L1782-L1799 |
34,603 | nails/module-cdn | src/Service/Cdn.php | Cdn.bucketCreate | public function bucketCreate($sSlug, $sLabel = null, $aAllowedTypes = [])
{
if (is_array($sSlug)) {
$aBucketData = $sSlug;
} else {
$aBucketData = [
'slug' => $sSlug,
'label' => $sLabel,
'allowed_types' => $aAll... | php | public function bucketCreate($sSlug, $sLabel = null, $aAllowedTypes = [])
{
if (is_array($sSlug)) {
$aBucketData = $sSlug;
} else {
$aBucketData = [
'slug' => $sSlug,
'label' => $sLabel,
'allowed_types' => $aAll... | [
"public",
"function",
"bucketCreate",
"(",
"$",
"sSlug",
",",
"$",
"sLabel",
"=",
"null",
",",
"$",
"aAllowedTypes",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"sSlug",
")",
")",
"{",
"$",
"aBucketData",
"=",
"$",
"sSlug",
";",
"}",
... | Create a new bucket
@param string $sSlug The slug to give the bucket
@param string $sLabel The label to give the bucket
@param array $aAllowedTypes An array of file types the bucket will accept
@return boolean | [
"Create",
"a",
"new",
"bucket"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L1821-L1877 |
34,604 | nails/module-cdn | src/Service/Cdn.php | Cdn.bucketList | public function bucketList($bucket, $filter_tag = null, $sort_on = null, $sort_order = null)
{
$data = [];
$oDb = Factory::service('Database');
// --------------------------------------------------------------------------
// Sorting?
if ($sort_on) {
$_sort_or... | php | public function bucketList($bucket, $filter_tag = null, $sort_on = null, $sort_order = null)
{
$data = [];
$oDb = Factory::service('Database');
// --------------------------------------------------------------------------
// Sorting?
if ($sort_on) {
$_sort_or... | [
"public",
"function",
"bucketList",
"(",
"$",
"bucket",
",",
"$",
"filter_tag",
"=",
"null",
",",
"$",
"sort_on",
"=",
"null",
",",
"$",
"sort_order",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"oDb",
"=",
"Factory",
"::",
"servic... | Lists the contents of a bucket
@param int|string $bucket The bucket's ID or slug
@param null $filter_tag
@param null $sort_on
@param null $sort_order
@return array | [
"Lists",
"the",
"contents",
"of",
"a",
"bucket"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L1891-L1933 |
34,605 | nails/module-cdn | src/Service/Cdn.php | Cdn.bucketDestroy | public function bucketDestroy($bucket)
{
$oBucket = $this->getBucket($bucket);
if (!$oBucket) {
$this->setError('Not a valid bucket');
return false;
}
// --------------------------------------------------------------------------
// Destroy any cont... | php | public function bucketDestroy($bucket)
{
$oBucket = $this->getBucket($bucket);
if (!$oBucket) {
$this->setError('Not a valid bucket');
return false;
}
// --------------------------------------------------------------------------
// Destroy any cont... | [
"public",
"function",
"bucketDestroy",
"(",
"$",
"bucket",
")",
"{",
"$",
"oBucket",
"=",
"$",
"this",
"->",
"getBucket",
"(",
"$",
"bucket",
")",
";",
"if",
"(",
"!",
"$",
"oBucket",
")",
"{",
"$",
"this",
"->",
"setError",
"(",
"'Not a valid bucket'"... | Permanently delete a bucket and its contents
@param string
@return boolean | [
"Permanently",
"delete",
"a",
"bucket",
"and",
"its",
"contents"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L1944-L1984 |
34,606 | nails/module-cdn | src/Service/Cdn.php | Cdn.formatBucket | protected function formatBucket(&$bucket)
{
$bucket->id = (int) $bucket->id;
$bucket->max_size = (int) $bucket->max_size;
$bucket->modified_by = (int) $bucket->modified_by ?: null;
// --------------------------------------------------------------------------
if ... | php | protected function formatBucket(&$bucket)
{
$bucket->id = (int) $bucket->id;
$bucket->max_size = (int) $bucket->max_size;
$bucket->modified_by = (int) $bucket->modified_by ?: null;
// --------------------------------------------------------------------------
if ... | [
"protected",
"function",
"formatBucket",
"(",
"&",
"$",
"bucket",
")",
"{",
"$",
"bucket",
"->",
"id",
"=",
"(",
"int",
")",
"$",
"bucket",
"->",
"id",
";",
"$",
"bucket",
"->",
"max_size",
"=",
"(",
"int",
")",
"$",
"bucket",
"->",
"max_size",
";"... | Formats a bucket object
@param object $bucket The bucket to format
@return void | [
"Formats",
"a",
"bucket",
"object"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L1995-L2029 |
34,607 | nails/module-cdn | src/Service/Cdn.php | Cdn.getExtFromPath | public function getExtFromPath($sPath)
{
$sExtension = strpos($sPath, '.') !== false ? substr($sPath, (int) strrpos($sPath, '.') + 1) : $sPath;
return $this->sanitiseExtension($sExtension);
} | php | public function getExtFromPath($sPath)
{
$sExtension = strpos($sPath, '.') !== false ? substr($sPath, (int) strrpos($sPath, '.') + 1) : $sPath;
return $this->sanitiseExtension($sExtension);
} | [
"public",
"function",
"getExtFromPath",
"(",
"$",
"sPath",
")",
"{",
"$",
"sExtension",
"=",
"strpos",
"(",
"$",
"sPath",
",",
"'.'",
")",
"!==",
"false",
"?",
"substr",
"(",
"$",
"sPath",
",",
"(",
"int",
")",
"strrpos",
"(",
"$",
"sPath",
",",
"'... | Extract the extension from a path
@param string $sPath The path to extract from
@return string | [
"Extract",
"the",
"extension",
"from",
"a",
"path"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2081-L2085 |
34,608 | nails/module-cdn | src/Service/Cdn.php | Cdn.getMimeFromExt | public function getMimeFromExt($sExt)
{
$sExt = $this->sanitiseExtension($sExt);
$aMimes = $this->oMimeService->getMimesForExtension($sExt);
$sMime = reset($aMimes);
return !empty($sMime) ? $sMime : 'application/octet-stream';
} | php | public function getMimeFromExt($sExt)
{
$sExt = $this->sanitiseExtension($sExt);
$aMimes = $this->oMimeService->getMimesForExtension($sExt);
$sMime = reset($aMimes);
return !empty($sMime) ? $sMime : 'application/octet-stream';
} | [
"public",
"function",
"getMimeFromExt",
"(",
"$",
"sExt",
")",
"{",
"$",
"sExt",
"=",
"$",
"this",
"->",
"sanitiseExtension",
"(",
"$",
"sExt",
")",
";",
"$",
"aMimes",
"=",
"$",
"this",
"->",
"oMimeService",
"->",
"getMimesForExtension",
"(",
"$",
"sExt... | Gets the mime type from the extension
@param string $sExt The extension to return the mime type for
@return string | [
"Gets",
"the",
"mime",
"type",
"from",
"the",
"extension"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2111-L2117 |
34,609 | nails/module-cdn | src/Service/Cdn.php | Cdn.validExtForMime | public function validExtForMime($sExt, $sMime)
{
$sExt = $this->sanitiseExtension($sExt);
return in_array($sExt, $this->oMimeService->getExtensionsForMime($sMime));
} | php | public function validExtForMime($sExt, $sMime)
{
$sExt = $this->sanitiseExtension($sExt);
return in_array($sExt, $this->oMimeService->getExtensionsForMime($sMime));
} | [
"public",
"function",
"validExtForMime",
"(",
"$",
"sExt",
",",
"$",
"sMime",
")",
"{",
"$",
"sExt",
"=",
"$",
"this",
"->",
"sanitiseExtension",
"(",
"$",
"sExt",
")",
";",
"return",
"in_array",
"(",
"$",
"sExt",
",",
"$",
"this",
"->",
"oMimeService"... | Determines whether an extension is valid for a specific mime typ
@param string $sExt The extension to test, no leading period
@param string $sMime The mime type to test against
@return bool | [
"Determines",
"whether",
"an",
"extension",
"is",
"valid",
"for",
"a",
"specific",
"mime",
"typ"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2143-L2147 |
34,610 | nails/module-cdn | src/Service/Cdn.php | Cdn.getMimeMappings | protected function getMimeMappings()
{
$sCacheKey = 'mimes';
$aCache = $this->getCache($sCacheKey);
if ($aCache) {
return $aCache;
}
// --------------------------------------------------------------------------
// Try to work it out using Nail's map... | php | protected function getMimeMappings()
{
$sCacheKey = 'mimes';
$aCache = $this->getCache($sCacheKey);
if ($aCache) {
return $aCache;
}
// --------------------------------------------------------------------------
// Try to work it out using Nail's map... | [
"protected",
"function",
"getMimeMappings",
"(",
")",
"{",
"$",
"sCacheKey",
"=",
"'mimes'",
";",
"$",
"aCache",
"=",
"$",
"this",
"->",
"getCache",
"(",
"$",
"sCacheKey",
")",
";",
"if",
"(",
"$",
"aCache",
")",
"{",
"return",
"$",
"aCache",
";",
"}... | Returns an array of file extension to mime types
@return array | [
"Returns",
"an",
"array",
"of",
"file",
"extension",
"to",
"mime",
"types"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2156-L2188 |
34,611 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlServe | public function urlServe($objectId, $forceDownload = false)
{
$isTrashed = false;
if (empty($objectId)) {
$oObj = $this->emptyObject();
} elseif (is_numeric($objectId)) {
$oObj = $this->getObject($objectId);
if (!$oObj) {
/**
... | php | public function urlServe($objectId, $forceDownload = false)
{
$isTrashed = false;
if (empty($objectId)) {
$oObj = $this->emptyObject();
} elseif (is_numeric($objectId)) {
$oObj = $this->getObject($objectId);
if (!$oObj) {
/**
... | [
"public",
"function",
"urlServe",
"(",
"$",
"objectId",
",",
"$",
"forceDownload",
"=",
"false",
")",
"{",
"$",
"isTrashed",
"=",
"false",
";",
"if",
"(",
"empty",
"(",
"$",
"objectId",
")",
")",
"{",
"$",
"oObj",
"=",
"$",
"this",
"->",
"emptyObject... | Calls the driver's public urlServe method
@param int $objectId The ID of the object to serve
@param bool $forceDownload Whether or not to force download of the object
@return string
@throws UrlException | [
"Calls",
"the",
"driver",
"s",
"public",
"urlServe",
"method"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2203-L2246 |
34,612 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlServeRaw | public function urlServeRaw($iObjectId)
{
$bIsTrashed = false;
if (empty($iObjectId)) {
$oObj = $this->emptyObject();
} elseif (is_numeric($iObjectId)) {
$oObj = $this->getObject($iObjectId);
if (!$oObj) {
/**
* If the ... | php | public function urlServeRaw($iObjectId)
{
$bIsTrashed = false;
if (empty($iObjectId)) {
$oObj = $this->emptyObject();
} elseif (is_numeric($iObjectId)) {
$oObj = $this->getObject($iObjectId);
if (!$oObj) {
/**
* If the ... | [
"public",
"function",
"urlServeRaw",
"(",
"$",
"iObjectId",
")",
"{",
"$",
"bIsTrashed",
"=",
"false",
";",
"if",
"(",
"empty",
"(",
"$",
"iObjectId",
")",
")",
"{",
"$",
"oObj",
"=",
"$",
"this",
"->",
"emptyObject",
"(",
")",
";",
"}",
"elseif",
... | Returns the URL for serving raw content from the CDN driver's source and not running it through the main CDN
@param integer $iObjectId The ID of the object to serve
@return string
@throws UrlException | [
"Returns",
"the",
"URL",
"for",
"serving",
"raw",
"content",
"from",
"the",
"CDN",
"driver",
"s",
"source",
"and",
"not",
"running",
"it",
"through",
"the",
"main",
"CDN"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2258-L2297 |
34,613 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlServeZipped | public function urlServeZipped($objects, $filename = 'download.zip')
{
$_data = ['where_in' => [['o.id', $objects]]];
$_objects = $this->getObjects(null, null, $_data);
$_ids = [];
$_ids_hash = [];
foreach ($_objects as $obj) {
$_ids[] = $obj->id;
... | php | public function urlServeZipped($objects, $filename = 'download.zip')
{
$_data = ['where_in' => [['o.id', $objects]]];
$_objects = $this->getObjects(null, null, $_data);
$_ids = [];
$_ids_hash = [];
foreach ($_objects as $obj) {
$_ids[] = $obj->id;
... | [
"public",
"function",
"urlServeZipped",
"(",
"$",
"objects",
",",
"$",
"filename",
"=",
"'download.zip'",
")",
"{",
"$",
"_data",
"=",
"[",
"'where_in'",
"=>",
"[",
"[",
"'o.id'",
",",
"$",
"objects",
"]",
"]",
"]",
";",
"$",
"_objects",
"=",
"$",
"t... | Calls the driver's public urlServeZipped method
@param array $objects The objects to include in the zip file
@param string $filename The name to give the zip file
@return string | [
"Calls",
"the",
"driver",
"s",
"public",
"urlServeZipped",
"method"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2323-L2340 |
34,614 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlCrop | public function urlCrop($iObjectId, $iWidth, $iHeight)
{
if (!$this->isPermittedDimension($iWidth, $iHeight)) {
throw new PermittedDimensionException(
'CDN::urlCrop() - Transformation of image to ' . $iWidth . 'x' . $iHeight . ' is not permitted'
);
}
... | php | public function urlCrop($iObjectId, $iWidth, $iHeight)
{
if (!$this->isPermittedDimension($iWidth, $iHeight)) {
throw new PermittedDimensionException(
'CDN::urlCrop() - Transformation of image to ' . $iWidth . 'x' . $iHeight . ' is not permitted'
);
}
... | [
"public",
"function",
"urlCrop",
"(",
"$",
"iObjectId",
",",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPermittedDimension",
"(",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
")",
"{",
"throw",
"new",
"PermittedDime... | Calls the driver's public urlCrop method
@param int $iObjectId The ID of the object we're cropping
@param int $iWidth The width of the crop
@param int $iHeight The height of the crop
@return string | [
"Calls",
"the",
"driver",
"s",
"public",
"urlCrop",
"method"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2398-L2467 |
34,615 | nails/module-cdn | src/Service/Cdn.php | Cdn.getCacheUrl | public static function getCacheUrl(
$sBucket,
$sObject,
$sExtension,
$sCropMethod,
$sOrientation,
$iWidth,
$iHeight
) {
// Is there a cached version of the file on disk we can serve up instead?
// @todo (Pablo - 2018-03-13) - This won't be re... | php | public static function getCacheUrl(
$sBucket,
$sObject,
$sExtension,
$sCropMethod,
$sOrientation,
$iWidth,
$iHeight
) {
// Is there a cached version of the file on disk we can serve up instead?
// @todo (Pablo - 2018-03-13) - This won't be re... | [
"public",
"static",
"function",
"getCacheUrl",
"(",
"$",
"sBucket",
",",
"$",
"sObject",
",",
"$",
"sExtension",
",",
"$",
"sCropMethod",
",",
"$",
"sOrientation",
",",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
"{",
"// Is there a cached version of the file on d... | Checks the public cache for an image, and if it's there will return it's URL
@param string $sBucket The bucket slug
@param string $sObject The name on disk
@param string $sExtension The file extension
@param string $sCropMethod The crop method
@param integer $iWidth The width
@param integer $iHeight ... | [
"Checks",
"the",
"public",
"cache",
"for",
"an",
"image",
"and",
"if",
"it",
"s",
"there",
"will",
"return",
"it",
"s",
"URL"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2598-L2624 |
34,616 | nails/module-cdn | src/Service/Cdn.php | Cdn.getCachePath | public static function getCachePath(
$sBucket,
$sObject,
$sExtension,
$sCropMethod,
$sOrientation,
$iWidth,
$iHeight
) {
$sCropQuadrant = static::getCropQuadrant($sOrientation);
return implode(
'-',
array_filter(... | php | public static function getCachePath(
$sBucket,
$sObject,
$sExtension,
$sCropMethod,
$sOrientation,
$iWidth,
$iHeight
) {
$sCropQuadrant = static::getCropQuadrant($sOrientation);
return implode(
'-',
array_filter(... | [
"public",
"static",
"function",
"getCachePath",
"(",
"$",
"sBucket",
",",
"$",
"sObject",
",",
"$",
"sExtension",
",",
"$",
"sCropMethod",
",",
"$",
"sOrientation",
",",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
"{",
"$",
"sCropQuadrant",
"=",
"static",
"... | Generate the name of the cache file for the image
@param string $sBucket The bucket slug
@param string $sObject The name on disk
@param string $sExtension The file extension
@param string $sCropMethod The crop method
@param integer $iWidth The width
@param integer $iHeight The height
@return str... | [
"Generate",
"the",
"name",
"of",
"the",
"cache",
"file",
"for",
"the",
"image"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2640-L2660 |
34,617 | nails/module-cdn | src/Service/Cdn.php | Cdn.getCropQuadrant | public static function getCropQuadrant($sOrientation)
{
switch ($sOrientation) {
case 'PORTRAIT':
$sCropQuadrant = defined('APP_CDN_CROP_QUADRANT_PORTRAIT') ? APP_CDN_CROP_QUADRANT_PORTRAIT : 'C';
break;
case 'LANDSCAPE':
$sCropQuadran... | php | public static function getCropQuadrant($sOrientation)
{
switch ($sOrientation) {
case 'PORTRAIT':
$sCropQuadrant = defined('APP_CDN_CROP_QUADRANT_PORTRAIT') ? APP_CDN_CROP_QUADRANT_PORTRAIT : 'C';
break;
case 'LANDSCAPE':
$sCropQuadran... | [
"public",
"static",
"function",
"getCropQuadrant",
"(",
"$",
"sOrientation",
")",
"{",
"switch",
"(",
"$",
"sOrientation",
")",
"{",
"case",
"'PORTRAIT'",
":",
"$",
"sCropQuadrant",
"=",
"defined",
"(",
"'APP_CDN_CROP_QUADRANT_PORTRAIT'",
")",
"?",
"APP_CDN_CROP_Q... | Returns the crop quadrant being used for the orientation
@param string $sOrientation The image's orientation
@return string | [
"Returns",
"the",
"crop",
"quadrant",
"being",
"used",
"for",
"the",
"orientation"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2671-L2688 |
34,618 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlPlaceholder | public function urlPlaceholder($iWidth = 100, $iHeight = 100, $border = 0)
{
if (!$this->isPermittedDimension($iWidth, $iHeight)) {
throw new PermittedDimensionException(
'CDN::urlPlaceholder() - Transformation of image to ' . $iWidth . 'x' . $iHeight . ' is not permitted'
... | php | public function urlPlaceholder($iWidth = 100, $iHeight = 100, $border = 0)
{
if (!$this->isPermittedDimension($iWidth, $iHeight)) {
throw new PermittedDimensionException(
'CDN::urlPlaceholder() - Transformation of image to ' . $iWidth . 'x' . $iHeight . ' is not permitted'
... | [
"public",
"function",
"urlPlaceholder",
"(",
"$",
"iWidth",
"=",
"100",
",",
"$",
"iHeight",
"=",
"100",
",",
"$",
"border",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPermittedDimension",
"(",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
... | Calls the driver's public urlPlaceholder method
@param int $iWidth The width of the placeholder
@param int $iHeight The height of the placeholder
@param int $border The width of the border round the placeholder
@return string | [
"Calls",
"the",
"driver",
"s",
"public",
"urlPlaceholder",
"method"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2701-L2712 |
34,619 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlBlankAvatar | public function urlBlankAvatar($iWidth = 100, $iHeight = 100, $sex = '')
{
if (!$this->isPermittedDimension($iWidth, $iHeight)) {
throw new PermittedDimensionException(
'CDN::urlBlankAvatar() - Transformation of image to ' . $iWidth . 'x' . $iHeight . ' is not permitted'
... | php | public function urlBlankAvatar($iWidth = 100, $iHeight = 100, $sex = '')
{
if (!$this->isPermittedDimension($iWidth, $iHeight)) {
throw new PermittedDimensionException(
'CDN::urlBlankAvatar() - Transformation of image to ' . $iWidth . 'x' . $iHeight . ' is not permitted'
... | [
"public",
"function",
"urlBlankAvatar",
"(",
"$",
"iWidth",
"=",
"100",
",",
"$",
"iHeight",
"=",
"100",
",",
"$",
"sex",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPermittedDimension",
"(",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
... | Calls the driver's public urlBlankAvatar method
@param int $iWidth The width of the placeholder
@param int $iHeight The height of the placeholder
@param mixed $sex The gender of the blank avatar to show
@return string | [
"Calls",
"the",
"driver",
"s",
"public",
"urlBlankAvatar",
"method"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2739-L2750 |
34,620 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlAvatar | public function urlAvatar($iUserId = null, $iWidth = 100, $iHeight = 100)
{
if (is_null($iUserId)) {
$iUserId = activeUser('id');
}
if (empty($iUserId)) {
$avatarUrl = $this->urlBlankAvatar($iWidth, $iHeight);
} else {
$oUserModel = Factory::model... | php | public function urlAvatar($iUserId = null, $iWidth = 100, $iHeight = 100)
{
if (is_null($iUserId)) {
$iUserId = activeUser('id');
}
if (empty($iUserId)) {
$avatarUrl = $this->urlBlankAvatar($iWidth, $iHeight);
} else {
$oUserModel = Factory::model... | [
"public",
"function",
"urlAvatar",
"(",
"$",
"iUserId",
"=",
"null",
",",
"$",
"iWidth",
"=",
"100",
",",
"$",
"iHeight",
"=",
"100",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"iUserId",
")",
")",
"{",
"$",
"iUserId",
"=",
"activeUser",
"(",
"'id'"... | Returns the appropriate avatar for a user
@param int $iUserId The user's ID
@param int $iWidth The width of the avatar
@param int $iHeight The height of the avatar
@return string | [
"Returns",
"the",
"appropriate",
"avatar",
"for",
"a",
"user"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2777-L2798 |
34,621 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlAvatarScheme | public function urlAvatarScheme($iUserId = null)
{
if (is_null($iUserId)) {
$iUserId = activeUser('id');
}
if (empty($iUserId)) {
$avatarScheme = $this->urlBlankAvatarScheme();
} else {
$oUserModel = Factory::model('User', 'nails/module-auth');
... | php | public function urlAvatarScheme($iUserId = null)
{
if (is_null($iUserId)) {
$iUserId = activeUser('id');
}
if (empty($iUserId)) {
$avatarScheme = $this->urlBlankAvatarScheme();
} else {
$oUserModel = Factory::model('User', 'nails/module-auth');
... | [
"public",
"function",
"urlAvatarScheme",
"(",
"$",
"iUserId",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"iUserId",
")",
")",
"{",
"$",
"iUserId",
"=",
"activeUser",
"(",
"'id'",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"iUserId",
"... | Determines which scheme to use for a user's avatar and returns the appropriate one
@param integer $iUserId The User ID to check
@return string | [
"Determines",
"which",
"scheme",
"to",
"use",
"for",
"a",
"user",
"s",
"avatar",
"and",
"returns",
"the",
"appropriate",
"one"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2809-L2828 |
34,622 | nails/module-cdn | src/Service/Cdn.php | Cdn.urlExpiring | public function urlExpiring($iObjectId, $expires, $forceDownload = false)
{
if (is_numeric($iObjectId)) {
$oObj = $this->getObject($iObjectId);
if (!$oObj) {
// Let the renderer show a bad_src graphic
$oObj = (object) [
'file' ... | php | public function urlExpiring($iObjectId, $expires, $forceDownload = false)
{
if (is_numeric($iObjectId)) {
$oObj = $this->getObject($iObjectId);
if (!$oObj) {
// Let the renderer show a bad_src graphic
$oObj = (object) [
'file' ... | [
"public",
"function",
"urlExpiring",
"(",
"$",
"iObjectId",
",",
"$",
"expires",
",",
"$",
"forceDownload",
"=",
"false",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"iObjectId",
")",
")",
"{",
"$",
"oObj",
"=",
"$",
"this",
"->",
"getObject",
"(",
... | Generates an expiring URL for an object
@param integer $iObjectId The object's ID
@param integer $expires The length of time the URL should be valid for, in seconds
@param boolean $forceDownload Whether to force the download or not
@return string | [
"Generates",
"an",
"expiring",
"URL",
"for",
"an",
"object"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2841-L2870 |
34,623 | nails/module-cdn | src/Service/Cdn.php | Cdn.findOrphanedObjects | public function findOrphanedObjects()
{
$aOut = ['orphans' => [], 'elapsed_time' => 0];
$oDb = Factory::service('Database');
$oDb->select('o.id, o.filename, o.filename_display, o.mime, o.filesize, o.driver');
$oDb->select('b.slug bucket_slug, b.label bucket');
$oDb->join(NAI... | php | public function findOrphanedObjects()
{
$aOut = ['orphans' => [], 'elapsed_time' => 0];
$oDb = Factory::service('Database');
$oDb->select('o.id, o.filename, o.filename_display, o.mime, o.filesize, o.driver');
$oDb->select('b.slug bucket_slug, b.label bucket');
$oDb->join(NAI... | [
"public",
"function",
"findOrphanedObjects",
"(",
")",
"{",
"$",
"aOut",
"=",
"[",
"'orphans'",
"=>",
"[",
"]",
",",
"'elapsed_time'",
"=>",
"0",
"]",
";",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
")",
";",
"$",
"oDb",
"->",
"s... | Finds objects which have no file counterparts
@return array | [
"Finds",
"objects",
"which",
"have",
"no",
"file",
"counterparts"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2893-L2911 |
34,624 | nails/module-cdn | src/Service/Cdn.php | Cdn.isAllowedExt | protected function isAllowedExt($sExtension, array $aAllowedExt)
{
$aAllowedExt = array_filter($aAllowedExt);
if (empty($aAllowedExt)) {
return true;
}
// Sanitise and map common extensions
$sExtension = $this->sanitiseExtension($sExtension);
// Sanit... | php | protected function isAllowedExt($sExtension, array $aAllowedExt)
{
$aAllowedExt = array_filter($aAllowedExt);
if (empty($aAllowedExt)) {
return true;
}
// Sanitise and map common extensions
$sExtension = $this->sanitiseExtension($sExtension);
// Sanit... | [
"protected",
"function",
"isAllowedExt",
"(",
"$",
"sExtension",
",",
"array",
"$",
"aAllowedExt",
")",
"{",
"$",
"aAllowedExt",
"=",
"array_filter",
"(",
"$",
"aAllowedExt",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"aAllowedExt",
")",
")",
"{",
"return",
... | Determines whether a supplied extension is valid for a given array of acceptable extensions
@param string $sExtension The extension to test
@param array $aAllowedExt An array of valid extensions
@return boolean | [
"Determines",
"whether",
"a",
"supplied",
"extension",
"is",
"valid",
"for",
"a",
"given",
"array",
"of",
"acceptable",
"extensions"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2936-L2954 |
34,625 | nails/module-cdn | src/Service/Cdn.php | Cdn.sanitiseExtension | public function sanitiseExtension($sExt)
{
$sExt = trim(strtolower($sExt));
$sExt = preg_replace('/^\./', '', $sExt);
switch ($sExt) {
case 'jpeg':
$sExt = 'jpg';
break;
}
return $sExt;
} | php | public function sanitiseExtension($sExt)
{
$sExt = trim(strtolower($sExt));
$sExt = preg_replace('/^\./', '', $sExt);
switch ($sExt) {
case 'jpeg':
$sExt = 'jpg';
break;
}
return $sExt;
} | [
"public",
"function",
"sanitiseExtension",
"(",
"$",
"sExt",
")",
"{",
"$",
"sExt",
"=",
"trim",
"(",
"strtolower",
"(",
"$",
"sExt",
")",
")",
";",
"$",
"sExt",
"=",
"preg_replace",
"(",
"'/^\\./'",
",",
"''",
",",
"$",
"sExt",
")",
";",
"switch",
... | Maps variants of an extension to a definitive one, for consistency. Can be
overloaded by the developer to satisfy any preferences with regards file
extensions
@param string $sExt The extension to map
@return string | [
"Maps",
"variants",
"of",
"an",
"extension",
"to",
"a",
"definitive",
"one",
"for",
"consistency",
".",
"Can",
"be",
"overloaded",
"by",
"the",
"developer",
"to",
"satisfy",
"any",
"preferences",
"with",
"regards",
"file",
"extensions"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L2967-L2979 |
34,626 | nails/module-cdn | src/Service/Cdn.php | Cdn.formatBytes | public static function formatBytes($iBytes, $iPrecision = 2)
{
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
$iBytes = max($iBytes, 0);
$pow = floor(($iBytes ? log($iBytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
// Uncomment one of the following alternativ... | php | public static function formatBytes($iBytes, $iPrecision = 2)
{
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
$iBytes = max($iBytes, 0);
$pow = floor(($iBytes ? log($iBytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
// Uncomment one of the following alternativ... | [
"public",
"static",
"function",
"formatBytes",
"(",
"$",
"iBytes",
",",
"$",
"iPrecision",
"=",
"2",
")",
"{",
"$",
"units",
"=",
"[",
"'B'",
",",
"'KB'",
",",
"'MB'",
",",
"'GB'",
",",
"'TB'",
"]",
";",
"$",
"iBytes",
"=",
"max",
"(",
"$",
"iByt... | Formats a file size given in bytes into a human-friendly string
@param integer $iBytes The file size, in bytes
@param integer $iPrecision The precision to use
@return string | [
"Formats",
"a",
"file",
"size",
"given",
"in",
"bytes",
"into",
"a",
"human",
"-",
"friendly",
"string"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L3071-L3091 |
34,627 | nails/module-cdn | src/Service/Cdn.php | Cdn.getPermittedDimensions | public function getPermittedDimensions(): array
{
$aDimensions = array_map(function ($sDimension) {
return (object) array_combine(
['width', 'height'],
array_map('intval', explode('x', $sDimension))
);
}, $this->aPermittedDimensions);
... | php | public function getPermittedDimensions(): array
{
$aDimensions = array_map(function ($sDimension) {
return (object) array_combine(
['width', 'height'],
array_map('intval', explode('x', $sDimension))
);
}, $this->aPermittedDimensions);
... | [
"public",
"function",
"getPermittedDimensions",
"(",
")",
":",
"array",
"{",
"$",
"aDimensions",
"=",
"array_map",
"(",
"function",
"(",
"$",
"sDimension",
")",
"{",
"return",
"(",
"object",
")",
"array_combine",
"(",
"[",
"'width'",
",",
"'height'",
"]",
... | Return the permitted dimensions for this installation
@return \stdClass[] | [
"Return",
"the",
"permitted",
"dimensions",
"for",
"this",
"installation"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L3154-L3166 |
34,628 | nails/module-cdn | src/Service/Cdn.php | Cdn.isPermittedDimension | public function isPermittedDimension($iWidth, $iHeight): bool
{
if (Factory::property('allowDangerousImageTransformation', 'nails/module-cdn')) {
return true;
} else {
$sDimension = $iWidth . 'x' . $iHeight;
return in_array($sDimension, $this->aPermittedDimensions... | php | public function isPermittedDimension($iWidth, $iHeight): bool
{
if (Factory::property('allowDangerousImageTransformation', 'nails/module-cdn')) {
return true;
} else {
$sDimension = $iWidth . 'x' . $iHeight;
return in_array($sDimension, $this->aPermittedDimensions... | [
"public",
"function",
"isPermittedDimension",
"(",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
":",
"bool",
"{",
"if",
"(",
"Factory",
"::",
"property",
"(",
"'allowDangerousImageTransformation'",
",",
"'nails/module-cdn'",
")",
")",
"{",
"return",
"true",
";",
"... | Determines whether the dimensions are permitted by the CDN
@param int $iWidth The width to check
@param int $iHeight The height to check | [
"Determines",
"whether",
"the",
"dimensions",
"are",
"permitted",
"by",
"the",
"CDN"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Service/Cdn.php#L3176-L3184 |
34,629 | pckg/database | src/Pckg/Database/Repository/PDO/Command/GetRecords.php | GetRecords.executeAll | public function executeAll()
{
$repository = $this->repository;
$entity = $this->entity;
$prepare = $repository->prepareQuery($entity->getQuery(), $entity->getRecordClass());
$measure = str_replace("\n", " ", $prepare->queryString);
$hash = sha1($measure . microtime());
... | php | public function executeAll()
{
$repository = $this->repository;
$entity = $this->entity;
$prepare = $repository->prepareQuery($entity->getQuery(), $entity->getRecordClass());
$measure = str_replace("\n", " ", $prepare->queryString);
$hash = sha1($measure . microtime());
... | [
"public",
"function",
"executeAll",
"(",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"repository",
";",
"$",
"entity",
"=",
"$",
"this",
"->",
"entity",
";",
"$",
"prepare",
"=",
"$",
"repository",
"->",
"prepareQuery",
"(",
"$",
"entity",
"->... | Prepare query from entity, fetch records and fill them with relations.
@return CollectionInterface | [
"Prepare",
"query",
"from",
"entity",
"fetch",
"records",
"and",
"fill",
"them",
"with",
"relations",
"."
] | 99b26b4cb2bacc2bbbb83b7341a209c1cf0100d3 | https://github.com/pckg/database/blob/99b26b4cb2bacc2bbbb83b7341a209c1cf0100d3/src/Pckg/Database/Repository/PDO/Command/GetRecords.php#L44-L88 |
34,630 | jon48/webtrees-lib | src/Webtrees/ImageBuilder.php | ImageBuilder.renderError | protected function renderError() {
$error = I18N::translate('The media file was not found in this family tree.');
$width = (mb_strlen($error) * 6.5 + 50) * 1.15;
$height = 60;
$im = imagecreatetruecolor($width, $height); /* Create a black image */
$bgc = imagecolorallocate($im, 255, 2... | php | protected function renderError() {
$error = I18N::translate('The media file was not found in this family tree.');
$width = (mb_strlen($error) * 6.5 + 50) * 1.15;
$height = 60;
$im = imagecreatetruecolor($width, $height); /* Create a black image */
$bgc = imagecolorallocate($im, 255, 2... | [
"protected",
"function",
"renderError",
"(",
")",
"{",
"$",
"error",
"=",
"I18N",
"::",
"translate",
"(",
"'The media file was not found in this family tree.'",
")",
";",
"$",
"width",
"=",
"(",
"mb_strlen",
"(",
"$",
"error",
")",
"*",
"6.5",
"+",
"50",
")"... | Render an error as an image. | [
"Render",
"an",
"error",
"as",
"an",
"image",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/ImageBuilder.php#L274-L289 |
34,631 | jon48/webtrees-lib | src/Webtrees/ImageBuilder.php | ImageBuilder.applyWatermark | protected function applyWatermark($im) {
// text to watermark with
if(method_exists($this->media, 'getWatermarkText')) {
$word1_text = $this->media->getWatermarkText();
}
else {
$word1_text = $this->media->getTitle();
}
$this->embedText(
$im,
... | php | protected function applyWatermark($im) {
// text to watermark with
if(method_exists($this->media, 'getWatermarkText')) {
$word1_text = $this->media->getWatermarkText();
}
else {
$word1_text = $this->media->getTitle();
}
$this->embedText(
$im,
... | [
"protected",
"function",
"applyWatermark",
"(",
"$",
"im",
")",
"{",
"// text to watermark with\t ",
"if",
"(",
"method_exists",
"(",
"$",
"this",
"->",
"media",
",",
"'getWatermarkText'",
")",
")",
"{",
"$",
"word1_text",
"=",
"$",
"this",
"->",
"media",
... | Returns the entered image with a watermark printed.
Similar to the the media firewall function.
@param resource $im Certificate image to watermark
@return resource Watermarked image | [
"Returns",
"the",
"entered",
"image",
"with",
"a",
"watermark",
"printed",
".",
"Similar",
"to",
"the",
"the",
"media",
"firewall",
"function",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/ImageBuilder.php#L298-L319 |
34,632 | jon48/webtrees-lib | src/Webtrees/ImageBuilder.php | ImageBuilder.textLength | function textLength($t, $mxl, $text) {
$taille_c = $t;
$len = mb_strlen($text);
while (($taille_c - 2) * $len > $mxl) {
$taille_c--;
if ($taille_c == 2) {
break;
}
}
return $taille_c;
} | php | function textLength($t, $mxl, $text) {
$taille_c = $t;
$len = mb_strlen($text);
while (($taille_c - 2) * $len > $mxl) {
$taille_c--;
if ($taille_c == 2) {
break;
}
}
return $taille_c;
} | [
"function",
"textLength",
"(",
"$",
"t",
",",
"$",
"mxl",
",",
"$",
"text",
")",
"{",
"$",
"taille_c",
"=",
"$",
"t",
";",
"$",
"len",
"=",
"mb_strlen",
"(",
"$",
"text",
")",
";",
"while",
"(",
"(",
"$",
"taille_c",
"-",
"2",
")",
"*",
"$",
... | Generate an approximate length of text, in pixels.
@param int $t
@param int $mxl
@param string $text
@return int | [
"Generate",
"an",
"approximate",
"length",
"of",
"text",
"in",
"pixels",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/ImageBuilder.php#L450-L461 |
34,633 | jon48/webtrees-lib | src/Webtrees/ImageBuilder.php | ImageBuilder.imageTtfTextErrorHandler | function imageTtfTextErrorHandler($errno, $errstr) {
// log the error
Log::addErrorLog('Image Builder error: >' . $errno . '/' . $errstr . '< while processing file >' . $this->media->getServerFilename() . '<');
// change value of useTTF to false so the fallback watermarking can be used.
... | php | function imageTtfTextErrorHandler($errno, $errstr) {
// log the error
Log::addErrorLog('Image Builder error: >' . $errno . '/' . $errstr . '< while processing file >' . $this->media->getServerFilename() . '<');
// change value of useTTF to false so the fallback watermarking can be used.
... | [
"function",
"imageTtfTextErrorHandler",
"(",
"$",
"errno",
",",
"$",
"errstr",
")",
"{",
"// log the error",
"Log",
"::",
"addErrorLog",
"(",
"'Image Builder error: >'",
".",
"$",
"errno",
".",
"'/'",
".",
"$",
"errstr",
".",
"'< while processing file >'",
".",
... | imagettftext is the function that is most likely to throw an error
use this custom error handler to catch and log it
@param int $errno
@param string $errstr
@return bool | [
"imagettftext",
"is",
"the",
"function",
"that",
"is",
"most",
"likely",
"to",
"throw",
"an",
"error",
"use",
"this",
"custom",
"error",
"handler",
"to",
"catch",
"and",
"log",
"it"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/ImageBuilder.php#L472-L480 |
34,634 | c4studio/chronos | src/Chronos/Content/app/Models/ContentField.php | ContentField.getEnableAltAttribute | public function getEnableAltAttribute()
{
if ($this->attributes['data'] == '' || $this->attributes['type'] != 'image')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['enable_alt']))
return null;
else {
return $data[... | php | public function getEnableAltAttribute()
{
if ($this->attributes['data'] == '' || $this->attributes['type'] != 'image')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['enable_alt']))
return null;
else {
return $data[... | [
"public",
"function",
"getEnableAltAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'data'",
"]",
"==",
"''",
"||",
"$",
"this",
"->",
"attributes",
"[",
"'type'",
"]",
"!=",
"'image'",
")",
"return",
"null",
";",
"$",
"data... | Add enable alt tag to model. | [
"Add",
"enable",
"alt",
"tag",
"to",
"model",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Content/app/Models/ContentField.php#L56-L68 |
34,635 | c4studio/chronos | src/Chronos/Content/app/Models/ContentField.php | ContentField.getEnableTitleAttribute | public function getEnableTitleAttribute()
{
if ($this->attributes['data'] == '' || $this->attributes['type'] != 'image')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['enable_title']))
return null;
else {
return $d... | php | public function getEnableTitleAttribute()
{
if ($this->attributes['data'] == '' || $this->attributes['type'] != 'image')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['enable_title']))
return null;
else {
return $d... | [
"public",
"function",
"getEnableTitleAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'data'",
"]",
"==",
"''",
"||",
"$",
"this",
"->",
"attributes",
"[",
"'type'",
"]",
"!=",
"'image'",
")",
"return",
"null",
";",
"$",
"da... | Add enable title tag to model. | [
"Add",
"enable",
"title",
"tag",
"to",
"model",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Content/app/Models/ContentField.php#L73-L85 |
34,636 | c4studio/chronos | src/Chronos/Content/app/Models/ContentField.php | ContentField.getStepAttribute | public function getStepAttribute()
{
if ($this->attributes['data'] == '' || $this->attributes['type'] != 'number')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['step']))
return null;
else {
return $data['step'];
... | php | public function getStepAttribute()
{
if ($this->attributes['data'] == '' || $this->attributes['type'] != 'number')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['step']))
return null;
else {
return $data['step'];
... | [
"public",
"function",
"getStepAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'data'",
"]",
"==",
"''",
"||",
"$",
"this",
"->",
"attributes",
"[",
"'type'",
"]",
"!=",
"'number'",
")",
"return",
"null",
";",
"$",
"data",
... | Add step to model. | [
"Add",
"step",
"to",
"model",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Content/app/Models/ContentField.php#L150-L162 |
34,637 | c4studio/chronos | src/Chronos/Content/app/Models/ContentField.php | ContentField.getValuesAttribute | public function getValuesAttribute()
{
if ($this->attributes['data'] == '' || $this->attributes['type'] != 'list')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['values']))
return null;
else {
return $data['values'... | php | public function getValuesAttribute()
{
if ($this->attributes['data'] == '' || $this->attributes['type'] != 'list')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['values']))
return null;
else {
return $data['values'... | [
"public",
"function",
"getValuesAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'data'",
"]",
"==",
"''",
"||",
"$",
"this",
"->",
"attributes",
"[",
"'type'",
"]",
"!=",
"'list'",
")",
"return",
"null",
";",
"$",
"data",
... | Add values to model. | [
"Add",
"values",
"to",
"model",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Content/app/Models/ContentField.php#L167-L179 |
34,638 | c4studio/chronos | src/Chronos/Content/app/Models/ContentField.php | ContentField.getValuesParsedAttribute | public function getValuesParsedAttribute()
{
if ($this->attributes['data'] == '')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['values']))
return null;
else {
$values = preg_split("/\\r\\n|\\r|\\n/", $data['values... | php | public function getValuesParsedAttribute()
{
if ($this->attributes['data'] == '')
return null;
$data = unserialize($this->attributes['data']);
if (!isset($data['values']))
return null;
else {
$values = preg_split("/\\r\\n|\\r|\\n/", $data['values... | [
"public",
"function",
"getValuesParsedAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'data'",
"]",
"==",
"''",
")",
"return",
"null",
";",
"$",
"data",
"=",
"unserialize",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'data'",... | Add parsed values to model. | [
"Add",
"parsed",
"values",
"to",
"model",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Content/app/Models/ContentField.php#L184-L210 |
34,639 | GrupaZero/cms | src/Gzero/Cms/Handlers/Block/CacheBlockTrait.php | CacheBlockTrait.getFromCache | protected function getFromCache(Block $block, Language $language)
{
if ($block->is_cacheable) {
return cache()->tags(['blocks'])->get('blocks:cache:' . $block->id . ':' . $language->code, null);
}
return null;
} | php | protected function getFromCache(Block $block, Language $language)
{
if ($block->is_cacheable) {
return cache()->tags(['blocks'])->get('blocks:cache:' . $block->id . ':' . $language->code, null);
}
return null;
} | [
"protected",
"function",
"getFromCache",
"(",
"Block",
"$",
"block",
",",
"Language",
"$",
"language",
")",
"{",
"if",
"(",
"$",
"block",
"->",
"is_cacheable",
")",
"{",
"return",
"cache",
"(",
")",
"->",
"tags",
"(",
"[",
"'blocks'",
"]",
")",
"->",
... | Get rendered block from cache
@param Block $block Block
@param Language $language Language
@return string|null | [
"Get",
"rendered",
"block",
"from",
"cache"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Handlers/Block/CacheBlockTrait.php#L16-L22 |
34,640 | GrupaZero/cms | src/Gzero/Cms/Handlers/Block/CacheBlockTrait.php | CacheBlockTrait.putInCache | protected function putInCache(Block $block, Language $language, $html)
{
if ($block->is_cacheable) {
cache()->tags(['blocks'])->forever('blocks:cache:' . $block->id . ':' . $language->code, $html);
}
} | php | protected function putInCache(Block $block, Language $language, $html)
{
if ($block->is_cacheable) {
cache()->tags(['blocks'])->forever('blocks:cache:' . $block->id . ':' . $language->code, $html);
}
} | [
"protected",
"function",
"putInCache",
"(",
"Block",
"$",
"block",
",",
"Language",
"$",
"language",
",",
"$",
"html",
")",
"{",
"if",
"(",
"$",
"block",
"->",
"is_cacheable",
")",
"{",
"cache",
"(",
")",
"->",
"tags",
"(",
"[",
"'blocks'",
"]",
")",... | Put rendered html in to block cache
@param Block $block Block
@param Language $language Language
@param string $html Rendered html
@return void | [
"Put",
"rendered",
"html",
"in",
"to",
"block",
"cache"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Handlers/Block/CacheBlockTrait.php#L33-L38 |
34,641 | MetaModels/filter_range | src/EventListener/DcGeneral/Table/FilterSetting/AbstractAbstainingListener.php | AbstractAbstainingListener.isAllowedContext | protected function isAllowedContext($dataDefinition, $propertyName, $model)
{
// Check the name of the data def.
if ('tl_metamodel_filtersetting' !== $dataDefinition->getName()) {
return false;
}
// Check the name of the property.
if ('attr_id2' !== $propertyName... | php | protected function isAllowedContext($dataDefinition, $propertyName, $model)
{
// Check the name of the data def.
if ('tl_metamodel_filtersetting' !== $dataDefinition->getName()) {
return false;
}
// Check the name of the property.
if ('attr_id2' !== $propertyName... | [
"protected",
"function",
"isAllowedContext",
"(",
"$",
"dataDefinition",
",",
"$",
"propertyName",
",",
"$",
"model",
")",
"{",
"// Check the name of the data def.",
"if",
"(",
"'tl_metamodel_filtersetting'",
"!==",
"$",
"dataDefinition",
"->",
"getName",
"(",
")",
... | Check if the context of the event is a allowed one.
@param ContainerInterface $dataDefinition The data definition from the environment.
@param string $propertyName The current property name.
@param ModelInterface $model The current model.
@return bool True => It is a allowed one | False =... | [
"Check",
"if",
"the",
"context",
"of",
"the",
"event",
"is",
"a",
"allowed",
"one",
"."
] | 1875e4a2206df2c5c98f5b0a7f18feb17b34f393 | https://github.com/MetaModels/filter_range/blob/1875e4a2206df2c5c98f5b0a7f18feb17b34f393/src/EventListener/DcGeneral/Table/FilterSetting/AbstractAbstainingListener.php#L63-L78 |
34,642 | MetaModels/filter_range | src/EventListener/DcGeneral/Table/FilterSetting/AbstractAbstainingListener.php | AbstractAbstainingListener.getMetaModel | protected function getMetaModel(ModelInterface $model)
{
$filterSetting = $this->filterSettingFactory->createCollection($model->getProperty('fid'));
return $filterSetting->getMetaModel();
} | php | protected function getMetaModel(ModelInterface $model)
{
$filterSetting = $this->filterSettingFactory->createCollection($model->getProperty('fid'));
return $filterSetting->getMetaModel();
} | [
"protected",
"function",
"getMetaModel",
"(",
"ModelInterface",
"$",
"model",
")",
"{",
"$",
"filterSetting",
"=",
"$",
"this",
"->",
"filterSettingFactory",
"->",
"createCollection",
"(",
"$",
"model",
"->",
"getProperty",
"(",
"'fid'",
")",
")",
";",
"return... | Retrieve the MetaModel attached to the model filter setting.
@param ModelInterface $model The model for which to retrieve the MetaModel.
@return IMetaModel
@throws \RuntimeException When the MetaModel can not be determined. | [
"Retrieve",
"the",
"MetaModel",
"attached",
"to",
"the",
"model",
"filter",
"setting",
"."
] | 1875e4a2206df2c5c98f5b0a7f18feb17b34f393 | https://github.com/MetaModels/filter_range/blob/1875e4a2206df2c5c98f5b0a7f18feb17b34f393/src/EventListener/DcGeneral/Table/FilterSetting/AbstractAbstainingListener.php#L89-L94 |
34,643 | alexislefebvre/AsyncTweetsBundle | src/Controller/DefaultController.php | DefaultController.getTweetsVars | private function getTweetsVars($tweets, $vars)
{
/** @var string $firstTweetId */
$firstTweetId = $tweets[0]->getId();
$vars['previous'] = $this->tweetRepository
->getPreviousTweetId($firstTweetId);
$vars['next'] = $this->tweetRepository
->getNextTweetId($fir... | php | private function getTweetsVars($tweets, $vars)
{
/** @var string $firstTweetId */
$firstTweetId = $tweets[0]->getId();
$vars['previous'] = $this->tweetRepository
->getPreviousTweetId($firstTweetId);
$vars['next'] = $this->tweetRepository
->getNextTweetId($fir... | [
"private",
"function",
"getTweetsVars",
"(",
"$",
"tweets",
",",
"$",
"vars",
")",
"{",
"/** @var string $firstTweetId */",
"$",
"firstTweetId",
"=",
"$",
"tweets",
"[",
"0",
"]",
"->",
"getId",
"(",
")",
";",
"$",
"vars",
"[",
"'previous'",
"]",
"=",
"$... | If a Tweet is displayed, fetch data from repository.
@param Tweet[] $tweets
@param array $vars
@return array $vars | [
"If",
"a",
"Tweet",
"is",
"displayed",
"fetch",
"data",
"from",
"repository",
"."
] | 76266fae7de978963e05dadb14c81f8398bb00a6 | https://github.com/alexislefebvre/AsyncTweetsBundle/blob/76266fae7de978963e05dadb14c81f8398bb00a6/src/Controller/DefaultController.php#L86-L109 |
34,644 | datalaere/php-http | src/Input.php | Input.toSlug | public static function toSlug($string, $replace = array(), $delimiter = '-')
{
if (!empty($replace)) {
$string = str_replace((array) $replace, ' ', $string);
}
return preg_replace('/[^A-Za-z0-9-]+/', $delimiter, $string);
} | php | public static function toSlug($string, $replace = array(), $delimiter = '-')
{
if (!empty($replace)) {
$string = str_replace((array) $replace, ' ', $string);
}
return preg_replace('/[^A-Za-z0-9-]+/', $delimiter, $string);
} | [
"public",
"static",
"function",
"toSlug",
"(",
"$",
"string",
",",
"$",
"replace",
"=",
"array",
"(",
")",
",",
"$",
"delimiter",
"=",
"'-'",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"replace",
")",
")",
"{",
"$",
"string",
"=",
"str_replace",
... | This function expects the input to be UTF-8 encoded. | [
"This",
"function",
"expects",
"the",
"input",
"to",
"be",
"UTF",
"-",
"8",
"encoded",
"."
] | 575e12aa853465b1430b3f2c5b074937e8819e8b | https://github.com/datalaere/php-http/blob/575e12aa853465b1430b3f2c5b074937e8819e8b/src/Input.php#L38-L45 |
34,645 | GrupaZero/cms | src/Gzero/Cms/Menu/Register.php | Register.addChild | public function addChild($parentUrl, Link $link)
{
$this->links->each(
function ($value) use ($parentUrl, $link) {
if ($value->url === $parentUrl) {
$value->children->push($link);
return false;
}
}
);
... | php | public function addChild($parentUrl, Link $link)
{
$this->links->each(
function ($value) use ($parentUrl, $link) {
if ($value->url === $parentUrl) {
$value->children->push($link);
return false;
}
}
);
... | [
"public",
"function",
"addChild",
"(",
"$",
"parentUrl",
",",
"Link",
"$",
"link",
")",
"{",
"$",
"this",
"->",
"links",
"->",
"each",
"(",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"parentUrl",
",",
"$",
"link",
")",
"{",
"if",
"(",
"... | It adds child link to parent specified by url parameter
@param string $parentUrl Parent url
@param Link $link Menu link
@return void | [
"It",
"adds",
"child",
"link",
"to",
"parent",
"specified",
"by",
"url",
"parameter"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Menu/Register.php#L43-L53 |
34,646 | GrupaZero/cms | src/Gzero/Cms/Menu/Register.php | Register.getMenu | public function getMenu()
{
$this->links->each(
function ($link) {
if (!$link->children->isEmpty()) {
$link->children = $link->children->sortBy('weight')->values();
}
}
);
return $this->links->sortBy('weight')->value... | php | public function getMenu()
{
$this->links->each(
function ($link) {
if (!$link->children->isEmpty()) {
$link->children = $link->children->sortBy('weight')->values();
}
}
);
return $this->links->sortBy('weight')->value... | [
"public",
"function",
"getMenu",
"(",
")",
"{",
"$",
"this",
"->",
"links",
"->",
"each",
"(",
"function",
"(",
"$",
"link",
")",
"{",
"if",
"(",
"!",
"$",
"link",
"->",
"children",
"->",
"isEmpty",
"(",
")",
")",
"{",
"$",
"link",
"->",
"childre... | It returns whole menu as tree
@return Collection | [
"It",
"returns",
"whole",
"menu",
"as",
"tree"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Menu/Register.php#L60-L70 |
34,647 | jon48/webtrees-lib | src/Webtrees/Module/Sosa/SosaConfigController.php | SosaConfigController.canUpdate | protected function canUpdate() {
$user_id = Filter::postInteger('userid', -1) ?: Filter::getInteger('userid', -1);
return Auth::check() &&
(
$user_id == Auth::user()->getUserId() || // Allow update for yourself
($user_id == -1 && Auth::isManag... | php | protected function canUpdate() {
$user_id = Filter::postInteger('userid', -1) ?: Filter::getInteger('userid', -1);
return Auth::check() &&
(
$user_id == Auth::user()->getUserId() || // Allow update for yourself
($user_id == -1 && Auth::isManag... | [
"protected",
"function",
"canUpdate",
"(",
")",
"{",
"$",
"user_id",
"=",
"Filter",
"::",
"postInteger",
"(",
"'userid'",
",",
"-",
"1",
")",
"?",
":",
"Filter",
"::",
"getInteger",
"(",
"'userid'",
",",
"-",
"1",
")",
";",
"return",
"Auth",
"::",
"c... | Check if the user can update the sosa ancestors list
@return bool | [
"Check",
"if",
"the",
"user",
"can",
"update",
"the",
"sosa",
"ancestors",
"list"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/Sosa/SosaConfigController.php#L38-L45 |
34,648 | CESNET/perun-simplesamlphp-module | lib/AdapterRpc.php | AdapterRpc.getMemberByUser | public function getMemberByUser($user, $vo)
{
$member = $this->connector->get('membersManager', 'getMemberByUser', array(
'user' => $user->getId(),
'vo' => $vo->getId(),
));
if (is_null($member)) {
throw new Exception(
"Member for User with... | php | public function getMemberByUser($user, $vo)
{
$member = $this->connector->get('membersManager', 'getMemberByUser', array(
'user' => $user->getId(),
'vo' => $vo->getId(),
));
if (is_null($member)) {
throw new Exception(
"Member for User with... | [
"public",
"function",
"getMemberByUser",
"(",
"$",
"user",
",",
"$",
"vo",
")",
"{",
"$",
"member",
"=",
"$",
"this",
"->",
"connector",
"->",
"get",
"(",
"'membersManager'",
",",
"'getMemberByUser'",
",",
"array",
"(",
"'user'",
"=>",
"$",
"user",
"->",... | Returns member by User and Vo
@param User $user
@param Vo $vo
@return Member | [
"Returns",
"member",
"by",
"User",
"and",
"Vo"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/AdapterRpc.php#L360-L373 |
34,649 | CESNET/perun-simplesamlphp-module | lib/AdapterRpc.php | AdapterRpc.hasRegistrationForm | public function hasRegistrationForm($group)
{
try {
$this->connector->get('registrarManager', 'getApplicationForm', array(
'group' => $group->getId(),
));
return true;
} catch (\Exception $exception) {
return false;
}
} | php | public function hasRegistrationForm($group)
{
try {
$this->connector->get('registrarManager', 'getApplicationForm', array(
'group' => $group->getId(),
));
return true;
} catch (\Exception $exception) {
return false;
}
} | [
"public",
"function",
"hasRegistrationForm",
"(",
"$",
"group",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"connector",
"->",
"get",
"(",
"'registrarManager'",
",",
"'getApplicationForm'",
",",
"array",
"(",
"'group'",
"=>",
"$",
"group",
"->",
"getId",
"(",
... | Returns true if group has registration form, false otherwise
@param Group $group
@return bool | [
"Returns",
"true",
"if",
"group",
"has",
"registration",
"form",
"false",
"otherwise"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/AdapterRpc.php#L380-L390 |
34,650 | voslartomas/WebCMS2 | libs/Settings.php | Settings.get | public function get($key, $section = 'basic', $type = null, $options = array(), $language = true)
{
// system settings
if (array_key_exists($section, $this->settings)) {
if (array_key_exists($key, $this->settings[$section])) {
$settings = $this->settings[$section][$key];
... | php | public function get($key, $section = 'basic', $type = null, $options = array(), $language = true)
{
// system settings
if (array_key_exists($section, $this->settings)) {
if (array_key_exists($key, $this->settings[$section])) {
$settings = $this->settings[$section][$key];
... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"section",
"=",
"'basic'",
",",
"$",
"type",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"language",
"=",
"true",
")",
"{",
"// system settings",
"if",
"(",
"array_key_ex... | Gets settings by key and section.
@param String $key
@param String $section
@param string $type
@return String
@throws Exception | [
"Gets",
"settings",
"by",
"key",
"and",
"section",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/libs/Settings.php#L39-L56 |
34,651 | c4studio/chronos | src/Chronos/Scaffolding/app/Traits/ChronosUser.php | ChronosUser.hasOneOfPermissions | public function hasOneOfPermissions($permissions)
{
if ($this->hasRole('root'))
return true;
$has = false;
foreach ($permissions as $permission) {
$has = $has || $this->hasPermission($permission);
}
return $has;
} | php | public function hasOneOfPermissions($permissions)
{
if ($this->hasRole('root'))
return true;
$has = false;
foreach ($permissions as $permission) {
$has = $has || $this->hasPermission($permission);
}
return $has;
} | [
"public",
"function",
"hasOneOfPermissions",
"(",
"$",
"permissions",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasRole",
"(",
"'root'",
")",
")",
"return",
"true",
";",
"$",
"has",
"=",
"false",
";",
"foreach",
"(",
"$",
"permissions",
"as",
"$",
"perm... | Determine if the user has one of the given permissions.
@param $permissions
@return bool | [
"Determine",
"if",
"the",
"user",
"has",
"one",
"of",
"the",
"given",
"permissions",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Scaffolding/app/Traits/ChronosUser.php#L62-L74 |
34,652 | CESNET/perun-simplesamlphp-module | lib/IdpListsService.php | IdpListsService.getInstance | public static function getInstance()
{
$configuration = Configuration::getConfig(self::CONFIG_FILE_NAME);
$idpListServiceType = $configuration->getString(self::PROPNAME_IDP_LIST_SERVICE_TYPE, self::CSV);
if ($idpListServiceType === self::CSV) {
return new IdpListsServiceCsv();
... | php | public static function getInstance()
{
$configuration = Configuration::getConfig(self::CONFIG_FILE_NAME);
$idpListServiceType = $configuration->getString(self::PROPNAME_IDP_LIST_SERVICE_TYPE, self::CSV);
if ($idpListServiceType === self::CSV) {
return new IdpListsServiceCsv();
... | [
"public",
"static",
"function",
"getInstance",
"(",
")",
"{",
"$",
"configuration",
"=",
"Configuration",
"::",
"getConfig",
"(",
"self",
"::",
"CONFIG_FILE_NAME",
")",
";",
"$",
"idpListServiceType",
"=",
"$",
"configuration",
"->",
"getString",
"(",
"self",
... | Function returns the instance of sspmod_perun_IdPListsService by configuration
Default is CSV
@return IdpListsServiceCsv|IdpListsServiceDB | [
"Function",
"returns",
"the",
"instance",
"of",
"sspmod_perun_IdPListsService",
"by",
"configuration",
"Default",
"is",
"CSV"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/IdpListsService.php#L35-L48 |
34,653 | GrupaZero/cms | database/migrations/2014_11_16_114113_create_content.php | CreateContent.seedContentTypes | private function seedContentTypes()
{
ContentType::firstOrCreate(['name' => 'content', 'handler' => Gzero\Cms\Handlers\Content\ContentHandler::class]);
ContentType::firstOrCreate(['name' => 'category', 'handler' => Gzero\Cms\Handlers\Content\CategoryHandler::class]);
} | php | private function seedContentTypes()
{
ContentType::firstOrCreate(['name' => 'content', 'handler' => Gzero\Cms\Handlers\Content\ContentHandler::class]);
ContentType::firstOrCreate(['name' => 'category', 'handler' => Gzero\Cms\Handlers\Content\CategoryHandler::class]);
} | [
"private",
"function",
"seedContentTypes",
"(",
")",
"{",
"ContentType",
"::",
"firstOrCreate",
"(",
"[",
"'name'",
"=>",
"'content'",
",",
"'handler'",
"=>",
"Gzero",
"\\",
"Cms",
"\\",
"Handlers",
"\\",
"Content",
"\\",
"ContentHandler",
"::",
"class",
"]",
... | Seed content types
@return void | [
"Seed",
"content",
"types"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/database/migrations/2014_11_16_114113_create_content.php#L93-L97 |
34,654 | locomotivemtl/charcoal-user | src/Charcoal/User/AbstractUser.php | AbstractUser.logout | public function logout()
{
// Irrelevant call...
if (!$this->id()) {
return false;
}
$key = static::sessionKey();
$_SESSION[$key] = null;
unset($_SESSION[$key], static::$authenticatedUser[$key]);
return true;
} | php | public function logout()
{
// Irrelevant call...
if (!$this->id()) {
return false;
}
$key = static::sessionKey();
$_SESSION[$key] = null;
unset($_SESSION[$key], static::$authenticatedUser[$key]);
return true;
} | [
"public",
"function",
"logout",
"(",
")",
"{",
"// Irrelevant call...",
"if",
"(",
"!",
"$",
"this",
"->",
"id",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"key",
"=",
"static",
"::",
"sessionKey",
"(",
")",
";",
"$",
"_SESSION",
"[",
"$... | Empties the session var associated to the session key.
@return boolean Logged out or not. | [
"Empties",
"the",
"session",
"var",
"associated",
"to",
"the",
"session",
"key",
"."
] | 86405a592379ebc2b77a7a9a7f68a85f2afe85f0 | https://github.com/locomotivemtl/charcoal-user/blob/86405a592379ebc2b77a7a9a7f68a85f2afe85f0/src/Charcoal/User/AbstractUser.php#L478-L491 |
34,655 | locomotivemtl/charcoal-user | src/Charcoal/User/AbstractUser.php | AbstractUser.validate | public function validate(ValidatorInterface &$v = null)
{
$result = parent::validate($v);
$objType = self::objType();
$previousModel = $this->modelFactory()->create($objType)->load($this->id());
$email = $this->email();
if (empty($email)) {
$this->validator()->er... | php | public function validate(ValidatorInterface &$v = null)
{
$result = parent::validate($v);
$objType = self::objType();
$previousModel = $this->modelFactory()->create($objType)->load($this->id());
$email = $this->email();
if (empty($email)) {
$this->validator()->er... | [
"public",
"function",
"validate",
"(",
"ValidatorInterface",
"&",
"$",
"v",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"parent",
"::",
"validate",
"(",
"$",
"v",
")",
";",
"$",
"objType",
"=",
"self",
"::",
"objType",
"(",
")",
";",
"$",
"previousMod... | Validate the model.
@see \Charcoal\Validator\ValidatorInterface
@param ValidatorInterface $v Optional. A custom validator object to use for validation. If null, use object's.
@return boolean | [
"Validate",
"the",
"model",
"."
] | 86405a592379ebc2b77a7a9a7f68a85f2afe85f0 | https://github.com/locomotivemtl/charcoal-user/blob/86405a592379ebc2b77a7a9a7f68a85f2afe85f0/src/Charcoal/User/AbstractUser.php#L579-L609 |
34,656 | jon48/webtrees-lib | src/Webtrees/Module/PatronymicLineage/Views/LineageView.php | LineageView.printRootLineage | private function printRootLineage(LineageRootNode $node) {
print '<div class="patrolin_tree">';
if($node->getIndividual() === null) {
$fam_nodes = $node->getFamiliesNodes();
foreach($fam_nodes as $fam){
foreach($fam_nodes[$fam] as $child_node) {
if($child_node) {
$this... | php | private function printRootLineage(LineageRootNode $node) {
print '<div class="patrolin_tree">';
if($node->getIndividual() === null) {
$fam_nodes = $node->getFamiliesNodes();
foreach($fam_nodes as $fam){
foreach($fam_nodes[$fam] as $child_node) {
if($child_node) {
$this... | [
"private",
"function",
"printRootLineage",
"(",
"LineageRootNode",
"$",
"node",
")",
"{",
"print",
"'<div class=\"patrolin_tree\">'",
";",
"if",
"(",
"$",
"node",
"->",
"getIndividual",
"(",
")",
"===",
"null",
")",
"{",
"$",
"fam_nodes",
"=",
"$",
"node",
"... | Print a root lineage node
@param LineageRootNode $node | [
"Print",
"a",
"root",
"lineage",
"node"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/PatronymicLineage/Views/LineageView.php#L148-L171 |
34,657 | jon48/webtrees-lib | src/Webtrees/Module/PatronymicLineage/Views/LineageView.php | LineageView.printLineage | private function printLineage(LineageNode $node) {
echo '<ul>';
$fam_nodes = $node->getFamiliesNodes();
if(count($fam_nodes) > 0) {
$is_first_family = true;
foreach($fam_nodes as $fam) {
$node_indi = $node->getIndividual();
echo '<li>';
if($is_first_family){
... | php | private function printLineage(LineageNode $node) {
echo '<ul>';
$fam_nodes = $node->getFamiliesNodes();
if(count($fam_nodes) > 0) {
$is_first_family = true;
foreach($fam_nodes as $fam) {
$node_indi = $node->getIndividual();
echo '<li>';
if($is_first_family){
... | [
"private",
"function",
"printLineage",
"(",
"LineageNode",
"$",
"node",
")",
"{",
"echo",
"'<ul>'",
";",
"$",
"fam_nodes",
"=",
"$",
"node",
"->",
"getFamiliesNodes",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"fam_nodes",
")",
">",
"0",
")",
"{",
... | Print a lineage node, recursively.
@param LineageNode $node | [
"Print",
"a",
"lineage",
"node",
"recursively",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/PatronymicLineage/Views/LineageView.php#L177-L232 |
34,658 | jon48/webtrees-lib | src/Webtrees/Module/PatronymicLineage/LineageController.php | LineageController.getSurnamesList | protected function getSurnamesList() {
return QueryName::surnames(Globals::getTree(), $this->surname, $this->alpha, false, false);
} | php | protected function getSurnamesList() {
return QueryName::surnames(Globals::getTree(), $this->surname, $this->alpha, false, false);
} | [
"protected",
"function",
"getSurnamesList",
"(",
")",
"{",
"return",
"QueryName",
"::",
"surnames",
"(",
"Globals",
"::",
"getTree",
"(",
")",
",",
"$",
"this",
"->",
"surname",
",",
"$",
"this",
"->",
"alpha",
",",
"false",
",",
"false",
")",
";",
"}"... | Get list of surnames, starting with the specified initial
@return array | [
"Get",
"list",
"of",
"surnames",
"starting",
"with",
"the",
"specified",
"initial"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/PatronymicLineage/LineageController.php#L132-L134 |
34,659 | jon48/webtrees-lib | src/Webtrees/Module/PatronymicLineage/LineageController.php | LineageController.getLineages | protected function getLineages() {
$builder = new LineageBuilder($this->surname, Globals::getTree());
$lineages = $builder->buildLineages();
return $lineages;
} | php | protected function getLineages() {
$builder = new LineageBuilder($this->surname, Globals::getTree());
$lineages = $builder->buildLineages();
return $lineages;
} | [
"protected",
"function",
"getLineages",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"LineageBuilder",
"(",
"$",
"this",
"->",
"surname",
",",
"Globals",
"::",
"getTree",
"(",
")",
")",
";",
"$",
"lineages",
"=",
"$",
"builder",
"->",
"buildLineages",
"(",... | Get the lineages for the controller's specified surname | [
"Get",
"the",
"lineages",
"for",
"the",
"controller",
"s",
"specified",
"surname"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/PatronymicLineage/LineageController.php#L139-L144 |
34,660 | g4code/log | src/Writer.php | Writer.preVarDump | public static function preVarDump($var, $die = false, $color = '#000000', $parsable = false, $output = true, $indirect = false)
{
// last line of defense ;)
if(!defined('DEBUG') || DEBUG !== true) {
return false;
}
$formated = '';
// if ajax or cli, skip preform... | php | public static function preVarDump($var, $die = false, $color = '#000000', $parsable = false, $output = true, $indirect = false)
{
// last line of defense ;)
if(!defined('DEBUG') || DEBUG !== true) {
return false;
}
$formated = '';
// if ajax or cli, skip preform... | [
"public",
"static",
"function",
"preVarDump",
"(",
"$",
"var",
",",
"$",
"die",
"=",
"false",
",",
"$",
"color",
"=",
"'#000000'",
",",
"$",
"parsable",
"=",
"false",
",",
"$",
"output",
"=",
"true",
",",
"$",
"indirect",
"=",
"false",
")",
"{",
"/... | Dump debug variable
@author Dejan Samardzija <samardzija.dejan@gmail.com>
@param mixed $var - variable
@param bool $die - terminate script after dump
@param string $color - text color
@param bool $parsable - if true it uses var_export that dumps php usable value
@param bool $output - if true... | [
"Dump",
"debug",
"variable"
] | 909d06503abbb21ac6c79a61d1b2b1bd89eb26d7 | https://github.com/g4code/log/blob/909d06503abbb21ac6c79a61d1b2b1bd89eb26d7/src/Writer.php#L55-L87 |
34,661 | g4code/log | src/Writer.php | Writer.writeLog | public static function writeLog ($filename, $string)
{
$logs_path = defined('PATH_LOGS')
? PATH_LOGS
: getcwd();
$logs_path_real = realpath($logs_path);
if(!$logs_path_real || !is_writable($logs_path_real)) {
throw new \Exception("Log path is not accessi... | php | public static function writeLog ($filename, $string)
{
$logs_path = defined('PATH_LOGS')
? PATH_LOGS
: getcwd();
$logs_path_real = realpath($logs_path);
if(!$logs_path_real || !is_writable($logs_path_real)) {
throw new \Exception("Log path is not accessi... | [
"public",
"static",
"function",
"writeLog",
"(",
"$",
"filename",
",",
"$",
"string",
")",
"{",
"$",
"logs_path",
"=",
"defined",
"(",
"'PATH_LOGS'",
")",
"?",
"PATH_LOGS",
":",
"getcwd",
"(",
")",
";",
"$",
"logs_path_real",
"=",
"realpath",
"(",
"$",
... | Write to a log file
@param string $filename - log file name
@param string $string - text to write in log file
@return bool | [
"Write",
"to",
"a",
"log",
"file"
] | 909d06503abbb21ac6c79a61d1b2b1bd89eb26d7 | https://github.com/g4code/log/blob/909d06503abbb21ac6c79a61d1b2b1bd89eb26d7/src/Writer.php#L120-L149 |
34,662 | g4code/log | src/Writer.php | Writer._formatFilePath | private static function _formatFilePath($filename, $format, $extras = array(), $addHostname = false)
{
// we can parse scalars also
if(is_scalar($extras)) {
$extras = array($extras);
}
if(!is_array($extras)) {
throw new \Exception('Extras parameter must be ar... | php | private static function _formatFilePath($filename, $format, $extras = array(), $addHostname = false)
{
// we can parse scalars also
if(is_scalar($extras)) {
$extras = array($extras);
}
if(!is_array($extras)) {
throw new \Exception('Extras parameter must be ar... | [
"private",
"static",
"function",
"_formatFilePath",
"(",
"$",
"filename",
",",
"$",
"format",
",",
"$",
"extras",
"=",
"array",
"(",
")",
",",
"$",
"addHostname",
"=",
"false",
")",
"{",
"// we can parse scalars also",
"if",
"(",
"is_scalar",
"(",
"$",
"ex... | Format file path
@param string $filename
@param int $format
@param array $extras
@param bool $addHostname
@throws \Exception
@return string | [
"Format",
"file",
"path"
] | 909d06503abbb21ac6c79a61d1b2b1bd89eb26d7 | https://github.com/g4code/log/blob/909d06503abbb21ac6c79a61d1b2b1bd89eb26d7/src/Writer.php#L176-L220 |
34,663 | g4code/log | src/Writer.php | Writer.writeLogPre | public static function writeLogPre($var, $filename = '__preformated.log', $addRequestData = false, $traceIndex = 1)
{
$msg = self::_preFormat($var, false, $traceIndex, true);
if($addRequestData) {
$msg = Debug::formatHeaderWithTime() . $msg . Debug::formatRequestData();
}
... | php | public static function writeLogPre($var, $filename = '__preformated.log', $addRequestData = false, $traceIndex = 1)
{
$msg = self::_preFormat($var, false, $traceIndex, true);
if($addRequestData) {
$msg = Debug::formatHeaderWithTime() . $msg . Debug::formatRequestData();
}
... | [
"public",
"static",
"function",
"writeLogPre",
"(",
"$",
"var",
",",
"$",
"filename",
"=",
"'__preformated.log'",
",",
"$",
"addRequestData",
"=",
"false",
",",
"$",
"traceIndex",
"=",
"1",
")",
"{",
"$",
"msg",
"=",
"self",
"::",
"_preFormat",
"(",
"$",... | It will use preVarDump to format variable and WriteLogVerbose to log it to file
@param mixed $var variable to parse and log
@param string $filename log file name
@param bool $addRequestData if we want to log more data, request, time...
@param int $traceIndex debug trace index so we have ... | [
"It",
"will",
"use",
"preVarDump",
"to",
"format",
"variable",
"and",
"WriteLogVerbose",
"to",
"log",
"it",
"to",
"file"
] | 909d06503abbb21ac6c79a61d1b2b1bd89eb26d7 | https://github.com/g4code/log/blob/909d06503abbb21ac6c79a61d1b2b1bd89eb26d7/src/Writer.php#L231-L240 |
34,664 | nails/module-cdn | admin/controllers/Utilities.php | Utilities.index | public function index()
{
if (!userHasPermission('admin:cdn:utilities:findOrphan')) {
unauthorised();
}
// --------------------------------------------------------------------------
$oInput = Factory::service('Input');
if ($oInput::isCli()) {
$this->... | php | public function index()
{
if (!userHasPermission('admin:cdn:utilities:findOrphan')) {
unauthorised();
}
// --------------------------------------------------------------------------
$oInput = Factory::service('Input');
if ($oInput::isCli()) {
$this->... | [
"public",
"function",
"index",
"(",
")",
"{",
"if",
"(",
"!",
"userHasPermission",
"(",
"'admin:cdn:utilities:findOrphan'",
")",
")",
"{",
"unauthorised",
"(",
")",
";",
"}",
"// --------------------------------------------------------------------------",
"$",
"oInput",
... | Find orphaned CDN objects
@return void | [
"Find",
"orphaned",
"CDN",
"objects"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/admin/controllers/Utilities.php#L57-L149 |
34,665 | Rareloop/primer-core | src/Primer/Templating/View.php | View.render | public static function render($name, $params = array())
{
if (is_array($params)) {
$params = new ViewData($params);
}
$templateClass = Primer::$TEMPLATE_CLASS;
$template = new $templateClass(Primer::$VIEW_PATH, $name);
Event::fire('view.' . $name, $params);
... | php | public static function render($name, $params = array())
{
if (is_array($params)) {
$params = new ViewData($params);
}
$templateClass = Primer::$TEMPLATE_CLASS;
$template = new $templateClass(Primer::$VIEW_PATH, $name);
Event::fire('view.' . $name, $params);
... | [
"public",
"static",
"function",
"render",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"params",
")",
")",
"{",
"$",
"params",
"=",
"new",
"ViewData",
"(",
"$",
"params",
")",
";",
"}",
... | Load a template and optionally pass in params
@param string $name The name of the template to load (without .handlebars extension)
@param Array|ViewData $params An associative array of variables to export into the view
@return string HTML text
@author Joe Lambert | [
"Load",
"a",
"template",
"and",
"optionally",
"pass",
"in",
"params"
] | fe098d6794a4add368f97672397dc93d223a1786 | https://github.com/Rareloop/primer-core/blob/fe098d6794a4add368f97672397dc93d223a1786/src/Primer/Templating/View.php#L21-L33 |
34,666 | jon48/webtrees-lib | src/Webtrees/Module/PatronymicLineage/Model/LineageRootNode.php | LineageRootNode.addPlace | public function addPlace(Place $place) {
if(!is_null($place) && !$place->isEmpty()){
$place_name = $place->getFullName();
if(isset($this->places[$place_name])){
$this->places[$place_name]+=1;
}
else{
$this->places[$place_name] = 1;
}
}
} | php | public function addPlace(Place $place) {
if(!is_null($place) && !$place->isEmpty()){
$place_name = $place->getFullName();
if(isset($this->places[$place_name])){
$this->places[$place_name]+=1;
}
else{
$this->places[$place_name] = 1;
}
}
} | [
"public",
"function",
"addPlace",
"(",
"Place",
"$",
"place",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"place",
")",
"&&",
"!",
"$",
"place",
"->",
"isEmpty",
"(",
")",
")",
"{",
"$",
"place_name",
"=",
"$",
"place",
"->",
"getFullName",
"(",... | Adds a place to the list of lineage's place
@param Place $place | [
"Adds",
"a",
"place",
"to",
"the",
"list",
"of",
"lineage",
"s",
"place"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/PatronymicLineage/Model/LineageRootNode.php#L39-L49 |
34,667 | voslartomas/WebCMS2 | AdminModule/presenters/BasePresenter.php | BasePresenter.createGrid | public function createGrid(Nette\Application\UI\Presenter $presenter, $name, $entity, $order = null, $where = null)
{
$grid = new \Grido\Grid($presenter, $name);
$qb = $this->em->createQueryBuilder();
if ($order) {
foreach ($order as $o) {
$qb->addOrderBy('l.'.$... | php | public function createGrid(Nette\Application\UI\Presenter $presenter, $name, $entity, $order = null, $where = null)
{
$grid = new \Grido\Grid($presenter, $name);
$qb = $this->em->createQueryBuilder();
if ($order) {
foreach ($order as $o) {
$qb->addOrderBy('l.'.$... | [
"public",
"function",
"createGrid",
"(",
"Nette",
"\\",
"Application",
"\\",
"UI",
"\\",
"Presenter",
"$",
"presenter",
",",
"$",
"name",
",",
"$",
"entity",
",",
"$",
"order",
"=",
"null",
",",
"$",
"where",
"=",
"null",
")",
"{",
"$",
"grid",
"=",
... | Creates default basic grid.
@param Nette\Application\UI\Presenter $presenter
@param String $name
@param String $entity
@param string[] $where
@return \Grido\Grid | [
"Creates",
"default",
"basic",
"grid",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/AdminModule/presenters/BasePresenter.php#L291-L321 |
34,668 | voslartomas/WebCMS2 | AdminModule/presenters/BasePresenter.php | BasePresenter.createForm | public function createForm()
{
$form = new Nette\Application\UI\Form();
$form->getElementPrototype()->addAttributes(array('class' => 'ajax'));
$form->setTranslator($this->translator);
$form->setRenderer(new BootstrapRenderer());
return $form;
} | php | public function createForm()
{
$form = new Nette\Application\UI\Form();
$form->getElementPrototype()->addAttributes(array('class' => 'ajax'));
$form->setTranslator($this->translator);
$form->setRenderer(new BootstrapRenderer());
return $form;
} | [
"public",
"function",
"createForm",
"(",
")",
"{",
"$",
"form",
"=",
"new",
"Nette",
"\\",
"Application",
"\\",
"UI",
"\\",
"Form",
"(",
")",
";",
"$",
"form",
"->",
"getElementPrototype",
"(",
")",
"->",
"addAttributes",
"(",
"array",
"(",
"'class'",
... | Creates form and rewrite renderer for bootstrap.
@return UI\Form | [
"Creates",
"form",
"and",
"rewrite",
"renderer",
"for",
"bootstrap",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/AdminModule/presenters/BasePresenter.php#L327-L336 |
34,669 | voslartomas/WebCMS2 | AdminModule/presenters/BasePresenter.php | BasePresenter.injectEntityManager | public function injectEntityManager(\Doctrine\ORM\EntityManager $em)
{
if ($this->em) {
throw new \Nette\InvalidStateException('Entity manager has been already set.');
}
$this->em = $em;
return $this;
} | php | public function injectEntityManager(\Doctrine\ORM\EntityManager $em)
{
if ($this->em) {
throw new \Nette\InvalidStateException('Entity manager has been already set.');
}
$this->em = $em;
return $this;
} | [
"public",
"function",
"injectEntityManager",
"(",
"\\",
"Doctrine",
"\\",
"ORM",
"\\",
"EntityManager",
"$",
"em",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"em",
")",
"{",
"throw",
"new",
"\\",
"Nette",
"\\",
"InvalidStateException",
"(",
"'Entity manager has... | Injects entity manager.
@param \Doctrine\ORM\EntityManager $em
@return BasePresenter
@throws \Nette\InvalidStateException | [
"Injects",
"entity",
"manager",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/AdminModule/presenters/BasePresenter.php#L344-L353 |
34,670 | voslartomas/WebCMS2 | AdminModule/presenters/BasePresenter.php | BasePresenter.checkPermission | private function checkPermission()
{
// creates system acl
$acl = $this->initAcl();
$identity = $this->getUser()->getIdentity();
$permissions = $this->initPermissions($identity);
foreach ($permissions as $key => $p) {
if ($p && $acl->hasResource($key)) {
... | php | private function checkPermission()
{
// creates system acl
$acl = $this->initAcl();
$identity = $this->getUser()->getIdentity();
$permissions = $this->initPermissions($identity);
foreach ($permissions as $key => $p) {
if ($p && $acl->hasResource($key)) {
... | [
"private",
"function",
"checkPermission",
"(",
")",
"{",
"// creates system acl",
"$",
"acl",
"=",
"$",
"this",
"->",
"initAcl",
"(",
")",
";",
"$",
"identity",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
"->",
"getIdentity",
"(",
")",
";",
"$",
"perm... | Checks user permission.
@return void | [
"Checks",
"user",
"permission",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/AdminModule/presenters/BasePresenter.php#L451-L477 |
34,671 | voslartomas/WebCMS2 | AdminModule/presenters/BasePresenter.php | BasePresenter.formatLayoutTemplateFiles | public function formatLayoutTemplateFiles()
{
$name = $this->getName();
$presenter = substr($name, strrpos(':'.$name, ':'));
$layout = $this->layout ? $this->layout : 'layout';
$dir = dirname($this->getReflection()->getFileName());
$dir = is_dir("$dir/templates") ? $dir... | php | public function formatLayoutTemplateFiles()
{
$name = $this->getName();
$presenter = substr($name, strrpos(':'.$name, ':'));
$layout = $this->layout ? $this->layout : 'layout';
$dir = dirname($this->getReflection()->getFileName());
$dir = is_dir("$dir/templates") ? $dir... | [
"public",
"function",
"formatLayoutTemplateFiles",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"$",
"presenter",
"=",
"substr",
"(",
"$",
"name",
",",
"strrpos",
"(",
"':'",
".",
"$",
"name",
",",
"':'",
")",
")",
... | Formats layout template file names.
@return array | [
"Formats",
"layout",
"template",
"file",
"names",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/AdminModule/presenters/BasePresenter.php#L700-L719 |
34,672 | voslartomas/WebCMS2 | AdminModule/presenters/BasePresenter.php | BasePresenter.collectionToArray | public function collectionToArray($collection, $title = 'title')
{
$array = array();
foreach ($collection as $item) {
$getter = 'get'.ucfirst($title);
$array[$item->getId()] = $item->$getter();
}
return $array;
} | php | public function collectionToArray($collection, $title = 'title')
{
$array = array();
foreach ($collection as $item) {
$getter = 'get'.ucfirst($title);
$array[$item->getId()] = $item->$getter();
}
return $array;
} | [
"public",
"function",
"collectionToArray",
"(",
"$",
"collection",
",",
"$",
"title",
"=",
"'title'",
")",
"{",
"$",
"array",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"item",
")",
"{",
"$",
"getter",
"=",
"'get'",
".... | Transfer collection into array.
@param [type] $collection [description]
@param string $title [description]
@return array [description] | [
"Transfer",
"collection",
"into",
"array",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/AdminModule/presenters/BasePresenter.php#L729-L738 |
34,673 | jon48/webtrees-lib | src/Webtrees/Module/Sosa/Views/SosaListView.php | SosaListView.renderSosaHeader | protected function renderSosaHeader() {
$selectedgen = $this->data->get('generation');
$max_gen = $this->data->get('max_gen');
?>
<form method="get" name="setgen" action="module.php">
<input type="hidden" name="mod" value="<?php echo $this->data->get('url_module');?>">
<input... | php | protected function renderSosaHeader() {
$selectedgen = $this->data->get('generation');
$max_gen = $this->data->get('max_gen');
?>
<form method="get" name="setgen" action="module.php">
<input type="hidden" name="mod" value="<?php echo $this->data->get('url_module');?>">
<input... | [
"protected",
"function",
"renderSosaHeader",
"(",
")",
"{",
"$",
"selectedgen",
"=",
"$",
"this",
"->",
"data",
"->",
"get",
"(",
"'generation'",
")",
";",
"$",
"max_gen",
"=",
"$",
"this",
"->",
"data",
"->",
"get",
"(",
"'max_gen'",
")",
";",
"?>\n ... | Render the common header to Sosa Lists, made of the generation selector, and the generation navigator | [
"Render",
"the",
"common",
"header",
"to",
"Sosa",
"Lists",
"made",
"of",
"the",
"generation",
"selector",
"and",
"the",
"generation",
"navigator"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/Sosa/Views/SosaListView.php#L71-L119 |
34,674 | nails/module-cdn | admin/controllers/Manager.php | Manager.index | public function index()
{
if (!userHasPermission('admin:cdn:manager:object:browse')) {
unauthorised();
}
$oInput = Factory::service('Input');
$this->data['sBucketSlug'] = $oInput->get('bucket');
$oAsset = Factory::service('Asset');
$oA... | php | public function index()
{
if (!userHasPermission('admin:cdn:manager:object:browse')) {
unauthorised();
}
$oInput = Factory::service('Input');
$this->data['sBucketSlug'] = $oInput->get('bucket');
$oAsset = Factory::service('Asset');
$oA... | [
"public",
"function",
"index",
"(",
")",
"{",
"if",
"(",
"!",
"userHasPermission",
"(",
"'admin:cdn:manager:object:browse'",
")",
")",
"{",
"unauthorised",
"(",
")",
";",
"}",
"$",
"oInput",
"=",
"Factory",
"::",
"service",
"(",
"'Input'",
")",
";",
"$",
... | Browse CDN Objects
@return void | [
"Browse",
"CDN",
"Objects"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/admin/controllers/Manager.php#L62-L98 |
34,675 | RobinDev/PHPToJS | src/PHPToJS.php | PHPToJS.render | public static function render($mixed)
{
if (!is_array($mixed) && !is_object($mixed)) {
return strpos(str_replace(' ', '', $mixed), 'function(') === 0 ? $mixed : json_encode($mixed);
}
$isNumArr = array_keys((array) $mixed) === range(0, count((array) $mixed) - 1);
$isObje... | php | public static function render($mixed)
{
if (!is_array($mixed) && !is_object($mixed)) {
return strpos(str_replace(' ', '', $mixed), 'function(') === 0 ? $mixed : json_encode($mixed);
}
$isNumArr = array_keys((array) $mixed) === range(0, count((array) $mixed) - 1);
$isObje... | [
"public",
"static",
"function",
"render",
"(",
"$",
"mixed",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"mixed",
")",
"&&",
"!",
"is_object",
"(",
"$",
"mixed",
")",
")",
"{",
"return",
"strpos",
"(",
"str_replace",
"(",
"' '",
",",
"''",
",",... | Render the variable's content from PHP to Javascript
@param mixed $mixed
@return string Javascript code | [
"Render",
"the",
"variable",
"s",
"content",
"from",
"PHP",
"to",
"Javascript"
] | e2ea20b2d75478fb40352be06e69704488a248a1 | https://github.com/RobinDev/PHPToJS/blob/e2ea20b2d75478fb40352be06e69704488a248a1/src/PHPToJS.php#L22-L39 |
34,676 | jon48/webtrees-lib | src/Webtrees/Module/WelcomeBlock/PiwikController.php | PiwikController.getNumberOfVisitsPiwik | private function getNumberOfVisitsPiwik($block_id, $period='year'){
$piwik_url = $this->module->getBlockSetting($block_id, 'piwik_url');
$piwik_siteid = $this->module->getBlockSetting($block_id, 'piwik_siteid');
$piwik_token = $this->module->getBlockSetting($block_id, 'piwik_token');
... | php | private function getNumberOfVisitsPiwik($block_id, $period='year'){
$piwik_url = $this->module->getBlockSetting($block_id, 'piwik_url');
$piwik_siteid = $this->module->getBlockSetting($block_id, 'piwik_siteid');
$piwik_token = $this->module->getBlockSetting($block_id, 'piwik_token');
... | [
"private",
"function",
"getNumberOfVisitsPiwik",
"(",
"$",
"block_id",
",",
"$",
"period",
"=",
"'year'",
")",
"{",
"$",
"piwik_url",
"=",
"$",
"this",
"->",
"module",
"->",
"getBlockSetting",
"(",
"$",
"block_id",
",",
"'piwik_url'",
")",
";",
"$",
"piwik... | Retrieve the number of visitors from Piwik, for a given period.
@param string $block_id
@param string $period
@param (null|int) Number of visits | [
"Retrieve",
"the",
"number",
"of",
"visitors",
"from",
"Piwik",
"for",
"a",
"given",
"period",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/WelcomeBlock/PiwikController.php#L33-L58 |
34,677 | jon48/webtrees-lib | src/Webtrees/Module/PatronymicLineage/Model/LineageBuilder.php | LineageBuilder.buildLineages | public function buildLineages() {
$indis = \Fisharebest\Webtrees\Query\QueryName::individuals($this->tree, $this->surname, null, null, false, false);
if(count($indis) == 0) return null;
$root_lineages = array();
foreach($indis as $indi) {
$pid = $indi->getXref();
if(!isset($this->used_indis[$... | php | public function buildLineages() {
$indis = \Fisharebest\Webtrees\Query\QueryName::individuals($this->tree, $this->surname, null, null, false, false);
if(count($indis) == 0) return null;
$root_lineages = array();
foreach($indis as $indi) {
$pid = $indi->getXref();
if(!isset($this->used_indis[$... | [
"public",
"function",
"buildLineages",
"(",
")",
"{",
"$",
"indis",
"=",
"\\",
"Fisharebest",
"\\",
"Webtrees",
"\\",
"Query",
"\\",
"QueryName",
"::",
"individuals",
"(",
"$",
"this",
"->",
"tree",
",",
"$",
"this",
"->",
"surname",
",",
"null",
",",
... | Build all patronymic lineages for the reference surname.
@return array List of root patronymic lineages | [
"Build",
"all",
"patronymic",
"lineages",
"for",
"the",
"reference",
"surname",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/PatronymicLineage/Model/LineageBuilder.php#L54-L87 |
34,678 | jon48/webtrees-lib | src/Webtrees/Module/PatronymicLineage/Model/LineageBuilder.php | LineageBuilder.getLineageRootIndividual | protected function getLineageRootIndividual(Individual $indi) {
$is_first=false;
$dindi = new \MyArtJaub\Webtrees\Individual($indi);
$indi_surname=$dindi->getUnprotectedPrimarySurname();
$resIndi = $indi;
while(!$is_first){
//Get the individual parents family
$fam=$resIndi->getPrimaryChildFamily();
i... | php | protected function getLineageRootIndividual(Individual $indi) {
$is_first=false;
$dindi = new \MyArtJaub\Webtrees\Individual($indi);
$indi_surname=$dindi->getUnprotectedPrimarySurname();
$resIndi = $indi;
while(!$is_first){
//Get the individual parents family
$fam=$resIndi->getPrimaryChildFamily();
i... | [
"protected",
"function",
"getLineageRootIndividual",
"(",
"Individual",
"$",
"indi",
")",
"{",
"$",
"is_first",
"=",
"false",
";",
"$",
"dindi",
"=",
"new",
"\\",
"MyArtJaub",
"\\",
"Webtrees",
"\\",
"Individual",
"(",
"$",
"indi",
")",
";",
"$",
"indi_sur... | Retrieve the root individual, from any individual.
The Root individual is the individual without a father, or without a mother holding the same name.
@param Individual $indi
@return (Individual|null) Root individual | [
"Retrieve",
"the",
"root",
"individual",
"from",
"any",
"individual",
".",
"The",
"Root",
"individual",
"is",
"the",
"individual",
"without",
"a",
"father",
"or",
"without",
"a",
"mother",
"holding",
"the",
"same",
"name",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/PatronymicLineage/Model/LineageBuilder.php#L96-L138 |
34,679 | CESNET/perun-simplesamlphp-module | lib/Auth/Process/PerunIdentity.php | PerunIdentity.register | public function register($request, $vosForRegistration, $registerUrL = null, $dynamicRegistration = null)
{
if (is_null($registerUrL)) {
$registerUrL = $this->registerUrl;
}
if (is_null($dynamicRegistration)) {
$dynamicRegistration = $this->dynamicRegistration;
... | php | public function register($request, $vosForRegistration, $registerUrL = null, $dynamicRegistration = null)
{
if (is_null($registerUrL)) {
$registerUrL = $this->registerUrl;
}
if (is_null($dynamicRegistration)) {
$dynamicRegistration = $this->dynamicRegistration;
... | [
"public",
"function",
"register",
"(",
"$",
"request",
",",
"$",
"vosForRegistration",
",",
"$",
"registerUrL",
"=",
"null",
",",
"$",
"dynamicRegistration",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"registerUrL",
")",
")",
"{",
"$",
"regis... | Method for register user to Perun
@param $request
@param $vosForRegistration
@param string $registerUrL
@param bool $dynamicRegistration | [
"Method",
"for",
"register",
"user",
"to",
"Perun"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Auth/Process/PerunIdentity.php#L262-L294 |
34,680 | CESNET/perun-simplesamlphp-module | lib/Auth/Process/PerunIdentity.php | PerunIdentity.registerDirectly | protected function registerDirectly($request, $callback, $registerUrL, $vo = null, $group = null)
{
$params = array();
if (!is_null($vo)) {
$params['vo'] = $vo->getShortName();
if (!is_null($group)) {
$params['group'] = $group->getName();
}
... | php | protected function registerDirectly($request, $callback, $registerUrL, $vo = null, $group = null)
{
$params = array();
if (!is_null($vo)) {
$params['vo'] = $vo->getShortName();
if (!is_null($group)) {
$params['group'] = $group->getName();
}
... | [
"protected",
"function",
"registerDirectly",
"(",
"$",
"request",
",",
"$",
"callback",
",",
"$",
"registerUrL",
",",
"$",
"vo",
"=",
"null",
",",
"$",
"group",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"is_... | Redirect user to registerUrL
@param $request
@param string $callback
@param string $registerUrL
@param Vo|null $vo
@param Group|null $group | [
"Redirect",
"user",
"to",
"registerUrL"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Auth/Process/PerunIdentity.php#L304-L333 |
34,681 | CESNET/perun-simplesamlphp-module | lib/Auth/Process/PerunIdentity.php | PerunIdentity.registerChooseVoAndGroup | protected function registerChooseVoAndGroup($callback, $vosForRegistration, $request)
{
$vosId = array();
$chooseGroupUrl = Module::getModuleURL('perun/perun_identity_choose_vo_and_group.php');
$stateId = State::saveState($request, 'perun:PerunIdentity');
foreach ($vosForRegistrat... | php | protected function registerChooseVoAndGroup($callback, $vosForRegistration, $request)
{
$vosId = array();
$chooseGroupUrl = Module::getModuleURL('perun/perun_identity_choose_vo_and_group.php');
$stateId = State::saveState($request, 'perun:PerunIdentity');
foreach ($vosForRegistrat... | [
"protected",
"function",
"registerChooseVoAndGroup",
"(",
"$",
"callback",
",",
"$",
"vosForRegistration",
",",
"$",
"request",
")",
"{",
"$",
"vosId",
"=",
"array",
"(",
")",
";",
"$",
"chooseGroupUrl",
"=",
"Module",
"::",
"getModuleURL",
"(",
"'perun/perun_... | Redirect user to page with selection Vo and Group for registration
@param string $callback
@param $vosForRegistration
@param $request | [
"Redirect",
"user",
"to",
"page",
"with",
"selection",
"Vo",
"and",
"Group",
"for",
"registration"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Auth/Process/PerunIdentity.php#L341-L365 |
34,682 | CESNET/perun-simplesamlphp-module | lib/Auth/Process/PerunIdentity.php | PerunIdentity.containsMembersGroup | private function containsMembersGroup($entities)
{
if (empty($entities)) {
return false;
}
foreach ($entities as $entity) {
if (preg_match('/[^:]*:members$/', $entity->getName())) {
return true;
}
}
return false;
} | php | private function containsMembersGroup($entities)
{
if (empty($entities)) {
return false;
}
foreach ($entities as $entity) {
if (preg_match('/[^:]*:members$/', $entity->getName())) {
return true;
}
}
return false;
} | [
"private",
"function",
"containsMembersGroup",
"(",
"$",
"entities",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"entities",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"entities",
"as",
"$",
"entity",
")",
"{",
"if",
"(",
"preg_match"... | Returns true, if entities contains VO members group
@param Group[] $entities
@return bool | [
"Returns",
"true",
"if",
"entities",
"contains",
"VO",
"members",
"group"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Auth/Process/PerunIdentity.php#L373-L384 |
34,683 | CESNET/perun-simplesamlphp-module | lib/Auth/Process/PerunIdentity.php | PerunIdentity.getSPAttributes | protected function getSPAttributes($spEntityID)
{
try {
$facilities = $this->rpcAdapter->getFacilitiesByEntityId($spEntityID);
if (empty($facilities)) {
Logger::warning(
"perun:PerunIdentity: No facility with entityID '" . $spEntityID . "' found."
... | php | protected function getSPAttributes($spEntityID)
{
try {
$facilities = $this->rpcAdapter->getFacilitiesByEntityId($spEntityID);
if (empty($facilities)) {
Logger::warning(
"perun:PerunIdentity: No facility with entityID '" . $spEntityID . "' found."
... | [
"protected",
"function",
"getSPAttributes",
"(",
"$",
"spEntityID",
")",
"{",
"try",
"{",
"$",
"facilities",
"=",
"$",
"this",
"->",
"rpcAdapter",
"->",
"getFacilitiesByEntityId",
"(",
"$",
"spEntityID",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"facilities",
... | This functions get attributes for facility
@param string $spEntityID | [
"This",
"functions",
"get",
"attributes",
"for",
"facility"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Auth/Process/PerunIdentity.php#L428-L481 |
34,684 | CESNET/perun-simplesamlphp-module | lib/Auth/Process/PerunIdentity.php | PerunIdentity.getVosForRegistration | protected function getVosForRegistration($user)
{
$vos = array();
$members = array();
$vosIdForRegistration = array();
$vosForRegistration = array();
$vos = $this->getVosByFacilityVoShortNames();
foreach ($vos as $vo) {
Logger::debug("Vo:" . print_r($vo, ... | php | protected function getVosForRegistration($user)
{
$vos = array();
$members = array();
$vosIdForRegistration = array();
$vosForRegistration = array();
$vos = $this->getVosByFacilityVoShortNames();
foreach ($vos as $vo) {
Logger::debug("Vo:" . print_r($vo, ... | [
"protected",
"function",
"getVosForRegistration",
"(",
"$",
"user",
")",
"{",
"$",
"vos",
"=",
"array",
"(",
")",
";",
"$",
"members",
"=",
"array",
"(",
")",
";",
"$",
"vosIdForRegistration",
"=",
"array",
"(",
")",
";",
"$",
"vosForRegistration",
"=",
... | Returns list of sspmod_perun_model_Vo to which the user may register
@param User $user
@return array of Vo | [
"Returns",
"list",
"of",
"sspmod_perun_model_Vo",
"to",
"which",
"the",
"user",
"may",
"register"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Auth/Process/PerunIdentity.php#L551-L585 |
34,685 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/OutlineMap.php | OutlineMap.load | protected function load() {
if(file_exists(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename)){
$xml = simplexml_load_file(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename);
if($xml){
$this->description = ... | php | protected function load() {
if(file_exists(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename)){
$xml = simplexml_load_file(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename);
if($xml){
$this->description = ... | [
"protected",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"WT_ROOT",
".",
"WT_MODULES_DIR",
".",
"Constants",
"::",
"MODULE_MAJ_GEODISP_NAME",
".",
"'/maps/'",
".",
"$",
"this",
"->",
"filename",
")",
")",
"{",
"$",
"xml",
"=",
"simple... | Load the map settings contained within its XML representation
XML structure :
- displayName : Display name of the map
- topLevel : Values of the top level subdivisions (separated by commas, if multiple)
- canvas : all settings related to the map canvas.
- width : canvas width, in px
- height : canvas height, in px
- m... | [
"Load",
"the",
"map",
"settings",
"contained",
"within",
"its",
"XML",
"representation"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/OutlineMap.php#L102-L139 |
34,686 | GrupaZero/cms | src/Gzero/Cms/Repositories/BlockReadRepository.php | BlockReadRepository.getVisibleBlocks | public function getVisibleBlocks(array $ids, Language $language, $onlyActive = true)
{
$query = Block::query()->with(self::$loadRelations);
if (!empty($ids)) {
$query->where(function ($query) use ($ids) {
$query->whereIn('id', $ids)
->orWhere('filter'... | php | public function getVisibleBlocks(array $ids, Language $language, $onlyActive = true)
{
$query = Block::query()->with(self::$loadRelations);
if (!empty($ids)) {
$query->where(function ($query) use ($ids) {
$query->whereIn('id', $ids)
->orWhere('filter'... | [
"public",
"function",
"getVisibleBlocks",
"(",
"array",
"$",
"ids",
",",
"Language",
"$",
"language",
",",
"$",
"onlyActive",
"=",
"true",
")",
"{",
"$",
"query",
"=",
"Block",
"::",
"query",
"(",
")",
"->",
"with",
"(",
"self",
"::",
"$",
"loadRelatio... | Returns all visible blocks
@param array $ids Array with blocks ids returned from block finder
@param Language $language Language
@param bool $onlyActive Return only active blocks
@return Collection | [
"Returns",
"all",
"visible",
"blocks"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Repositories/BlockReadRepository.php#L99-L123 |
34,687 | GrupaZero/cms | src/Gzero/Cms/Repositories/BlockReadRepository.php | BlockReadRepository.getBlocksWithFilter | public function getBlocksWithFilter($onlyActive = true)
{
$query = Block::query()->with(self::$loadRelations)
->where('filter', '!=', null);
if ($onlyActive) {
$query->where('is_active', '=', true);
}
$blocks = $query->orderBy('weight', 'ASC')->get();
... | php | public function getBlocksWithFilter($onlyActive = true)
{
$query = Block::query()->with(self::$loadRelations)
->where('filter', '!=', null);
if ($onlyActive) {
$query->where('is_active', '=', true);
}
$blocks = $query->orderBy('weight', 'ASC')->get();
... | [
"public",
"function",
"getBlocksWithFilter",
"(",
"$",
"onlyActive",
"=",
"true",
")",
"{",
"$",
"query",
"=",
"Block",
"::",
"query",
"(",
")",
"->",
"with",
"(",
"self",
"::",
"$",
"loadRelations",
")",
"->",
"where",
"(",
"'filter'",
",",
"'!='",
",... | Returns all blocks with filter
@param bool $onlyActive Return only active blocks
@return Collection | [
"Returns",
"all",
"blocks",
"with",
"filter"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Repositories/BlockReadRepository.php#L132-L144 |
34,688 | GrupaZero/cms | src/Gzero/Cms/Repositories/BlockReadRepository.php | BlockReadRepository.getManyTranslations | public function getManyTranslations(Block $block, QueryBuilder $builder): LengthAwarePaginator
{
$query = $block->translations(false)->newQuery()->getQuery();
$builder->applyFilters($query, 'block_translations');
$builder->applySorts($query, 'block_translations');
$count = clone $q... | php | public function getManyTranslations(Block $block, QueryBuilder $builder): LengthAwarePaginator
{
$query = $block->translations(false)->newQuery()->getQuery();
$builder->applyFilters($query, 'block_translations');
$builder->applySorts($query, 'block_translations');
$count = clone $q... | [
"public",
"function",
"getManyTranslations",
"(",
"Block",
"$",
"block",
",",
"QueryBuilder",
"$",
"builder",
")",
":",
"LengthAwarePaginator",
"{",
"$",
"query",
"=",
"$",
"block",
"->",
"translations",
"(",
"false",
")",
"->",
"newQuery",
"(",
")",
"->",
... | Get all block translations for specified content.
@param Block $block Content model
@param QueryBuilder $builder Query builder
@return Collection|LengthAwarePaginator | [
"Get",
"all",
"block",
"translations",
"for",
"specified",
"content",
"."
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Repositories/BlockReadRepository.php#L197-L216 |
34,689 | GrupaZero/cms | src/Gzero/Cms/Repositories/BlockReadRepository.php | BlockReadRepository.getManyFiles | public function getManyFiles(Block $block, QueryBuilder $builder): LengthAwarePaginator
{
$query = $block->files(false)->with(['type','translations']);
$count = clone $query->getQuery();
$results = $query->limit($builder->getPageSize())
->offset($builder->getPageSize() * ($buil... | php | public function getManyFiles(Block $block, QueryBuilder $builder): LengthAwarePaginator
{
$query = $block->files(false)->with(['type','translations']);
$count = clone $query->getQuery();
$results = $query->limit($builder->getPageSize())
->offset($builder->getPageSize() * ($buil... | [
"public",
"function",
"getManyFiles",
"(",
"Block",
"$",
"block",
",",
"QueryBuilder",
"$",
"builder",
")",
":",
"LengthAwarePaginator",
"{",
"$",
"query",
"=",
"$",
"block",
"->",
"files",
"(",
"false",
")",
"->",
"with",
"(",
"[",
"'type'",
",",
"'tran... | Get all files with translations for specified block.
@param Block $block Block model
@param QueryBuilder $builder Query builder
@return Collection|LengthAwarePaginator | [
"Get",
"all",
"files",
"with",
"translations",
"for",
"specified",
"block",
"."
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Repositories/BlockReadRepository.php#L226-L242 |
34,690 | CESNET/perun-simplesamlphp-module | lib/Auth/Process/StringifyTargetedID.php | StringifyTargetedID.stringify | private function stringify($attributeValue)
{
if (is_object($attributeValue) && get_class($attributeValue) == "SAML2\XML\saml\NameID") {
return $attributeValue->NameQualifier . '!' . $attributeValue->SPNameQualifier . '!'
. $attributeValue->value;
} else {
ret... | php | private function stringify($attributeValue)
{
if (is_object($attributeValue) && get_class($attributeValue) == "SAML2\XML\saml\NameID") {
return $attributeValue->NameQualifier . '!' . $attributeValue->SPNameQualifier . '!'
. $attributeValue->value;
} else {
ret... | [
"private",
"function",
"stringify",
"(",
"$",
"attributeValue",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"attributeValue",
")",
"&&",
"get_class",
"(",
"$",
"attributeValue",
")",
"==",
"\"SAML2\\XML\\saml\\NameID\"",
")",
"{",
"return",
"$",
"attributeValue"... | Convert NameID value into the text representation. | [
"Convert",
"NameID",
"value",
"into",
"the",
"text",
"representation",
"."
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Auth/Process/StringifyTargetedID.php#L56-L64 |
34,691 | jon48/webtrees-lib | src/Webtrees/Mvc/MvcException.php | MvcException.setHttpCode | public function setHttpCode($http_code) {
if(!in_array($http_code, self::$VALID_HTTP))
throw new \InvalidArgumentException('Invalid HTTP code');
$this->http_code= $http_code;
} | php | public function setHttpCode($http_code) {
if(!in_array($http_code, self::$VALID_HTTP))
throw new \InvalidArgumentException('Invalid HTTP code');
$this->http_code= $http_code;
} | [
"public",
"function",
"setHttpCode",
"(",
"$",
"http_code",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"http_code",
",",
"self",
"::",
"$",
"VALID_HTTP",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid HTTP code'",
")",
";",
... | Set the HTTP code
@param int $http_code
@throws InvalidArgumentException Thrown if not valid Http code | [
"Set",
"the",
"HTTP",
"code"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Mvc/MvcException.php#L60-L64 |
34,692 | alexislefebvre/AsyncTweetsBundle | src/Utils/PersistTweet.php | PersistTweet.createTweet | protected function createTweet(\stdClass $tweetTmp, $user, $inTimeline)
{
$tweet = new Tweet();
$tweet
->setId($tweetTmp->id)
->setValues($tweetTmp)
->setUser($user)
->setInTimeline($inTimeline);
$this->addMedias($tweetTmp, $tweet);
... | php | protected function createTweet(\stdClass $tweetTmp, $user, $inTimeline)
{
$tweet = new Tweet();
$tweet
->setId($tweetTmp->id)
->setValues($tweetTmp)
->setUser($user)
->setInTimeline($inTimeline);
$this->addMedias($tweetTmp, $tweet);
... | [
"protected",
"function",
"createTweet",
"(",
"\\",
"stdClass",
"$",
"tweetTmp",
",",
"$",
"user",
",",
"$",
"inTimeline",
")",
"{",
"$",
"tweet",
"=",
"new",
"Tweet",
"(",
")",
";",
"$",
"tweet",
"->",
"setId",
"(",
"$",
"tweetTmp",
"->",
"id",
")",
... | Create a Tweet object and return it.
@param \stdClass $tweetTmp
@param User $user
@param bool $inTimeline
@return Tweet | [
"Create",
"a",
"Tweet",
"object",
"and",
"return",
"it",
"."
] | 76266fae7de978963e05dadb14c81f8398bb00a6 | https://github.com/alexislefebvre/AsyncTweetsBundle/blob/76266fae7de978963e05dadb14c81f8398bb00a6/src/Utils/PersistTweet.php#L80-L93 |
34,693 | GrupaZero/cms | src/Gzero/Cms/Http/Controllers/Api/PublicContentController.php | PublicContentController.index | public function index()
{
$results = $this->repository->getManyPublished(new QueryBuilder());
$results->setPath(apiUrl('public-contents'));
return new ContentCollection($results);
} | php | public function index()
{
$results = $this->repository->getManyPublished(new QueryBuilder());
$results->setPath(apiUrl('public-contents'));
return new ContentCollection($results);
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"repository",
"->",
"getManyPublished",
"(",
"new",
"QueryBuilder",
"(",
")",
")",
";",
"$",
"results",
"->",
"setPath",
"(",
"apiUrl",
"(",
"'public-contents'",
")",
"... | Display list of public contents
@SWG\Get(
path="/public-contents",
tags={"content","public"},
summary="List of public contents",
description="List of all publicly accessible contents",
produces={"application/json"},
@SWG\Response(
response=200,
description="Successful operation",
@SWG\Schema(type="array", @SWG\Items(r... | [
"Display",
"list",
"of",
"public",
"contents"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Http/Controllers/Api/PublicContentController.php#L50-L56 |
34,694 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGenerationsView.php | GeoAnalysisTabGenerationsView.htmlGenerationAllPlacesRow | protected function htmlGenerationAllPlacesRow($data, $analysis_level) {
$html =
'<table class="geodispersion_bigrow">
<tr>';
$sum_gen = $data['sum'];
$unknownother = $data['unknown'] + $data['other'];
foreach($data['places'] as $placename=> $dataplace){
... | php | protected function htmlGenerationAllPlacesRow($data, $analysis_level) {
$html =
'<table class="geodispersion_bigrow">
<tr>';
$sum_gen = $data['sum'];
$unknownother = $data['unknown'] + $data['other'];
foreach($data['places'] as $placename=> $dataplace){
... | [
"protected",
"function",
"htmlGenerationAllPlacesRow",
"(",
"$",
"data",
",",
"$",
"analysis_level",
")",
"{",
"$",
"html",
"=",
"'<table class=\"geodispersion_bigrow\">\n <tr>'",
";",
"$",
"sum_gen",
"=",
"$",
"data",
"[",
"'sum'",
"]",
";",
"$",
"unkn... | Return the HTML code to display a row with all places found in a generation.
@param array $data Data array
@param int $analysis_level Level of subdivision of analysis
@return string HTML code for all places row | [
"Return",
"the",
"HTML",
"code",
"to",
"display",
"a",
"row",
"with",
"all",
"places",
"found",
"in",
"a",
"generation",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGenerationsView.php#L85-L134 |
34,695 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGenerationsView.php | GeoAnalysisTabGenerationsView.htmlGenerationTopPlacesRow | protected function htmlGenerationTopPlacesRow($data, $analysis_level) {
$tmp_places = array();
$sum_gen = $data['sum'];
$other = $data['other'];
foreach($data['places'] as $placename => $count) {
if($placename != 'other'){
$levels = array_map('trim',e... | php | protected function htmlGenerationTopPlacesRow($data, $analysis_level) {
$tmp_places = array();
$sum_gen = $data['sum'];
$other = $data['other'];
foreach($data['places'] as $placename => $count) {
if($placename != 'other'){
$levels = array_map('trim',e... | [
"protected",
"function",
"htmlGenerationTopPlacesRow",
"(",
"$",
"data",
",",
"$",
"analysis_level",
")",
"{",
"$",
"tmp_places",
"=",
"array",
"(",
")",
";",
"$",
"sum_gen",
"=",
"$",
"data",
"[",
"'sum'",
"]",
";",
"$",
"other",
"=",
"$",
"data",
"["... | Returns the HTML code fo display a row of the Top Places found for a generation.
@param array $data Data array
@param int $analysis_level Level of subdivision of analysis
@return string HTML code for Top Places row | [
"Returns",
"the",
"HTML",
"code",
"fo",
"display",
"a",
"row",
"of",
"the",
"Top",
"Places",
"found",
"for",
"a",
"generation",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGenerationsView.php#L143-L160 |
34,696 | GrupaZero/cms | src/Gzero/Cms/Http/Controllers/Api/ContentTreeController.php | ContentTreeController.index | public function index(UrlParamsProcessor $processor)
{
$this->authorize('readList', Content::class);
// @TODO Implement contents/{id}/tree
$processor
->addFilter(new BoolParser('only_categories'))
->process($this->request);
Resource::wrap('data');
re... | php | public function index(UrlParamsProcessor $processor)
{
$this->authorize('readList', Content::class);
// @TODO Implement contents/{id}/tree
$processor
->addFilter(new BoolParser('only_categories'))
->process($this->request);
Resource::wrap('data');
re... | [
"public",
"function",
"index",
"(",
"UrlParamsProcessor",
"$",
"processor",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'readList'",
",",
"Content",
"::",
"class",
")",
";",
"// @TODO Implement contents/{id}/tree",
"$",
"processor",
"->",
"addFilter",
"(",
"... | Fetches all content in a tree structure
@SWG\Get(
path="/contents-tree",
tags={"content"},
summary="Fetches all content in a tree structure",
produces={"application/json"},
security={{"AdminAccess": {}}},
@SWG\Parameter(
name="only_category",
in="query",
description="Should fetch only categories?",
required=false,
typ... | [
"Fetches",
"all",
"content",
"in",
"a",
"tree",
"structure"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/Http/Controllers/Api/ContentTreeController.php#L71-L82 |
34,697 | MetaModels/filter_range | src/EventListener/DcGeneral/Table/FilterSetting/GetPropertyOptionsListener.php | GetPropertyOptionsListener.handle | public function handle(GetPropertyOptionsEvent $event)
{
$isAllowed = $this->isAllowedContext(
$event->getEnvironment()->getDataDefinition(),
$event->getPropertyName(),
$event->getModel()
);
if (!$isAllowed) {
return;
}
$resul... | php | public function handle(GetPropertyOptionsEvent $event)
{
$isAllowed = $this->isAllowedContext(
$event->getEnvironment()->getDataDefinition(),
$event->getPropertyName(),
$event->getModel()
);
if (!$isAllowed) {
return;
}
$resul... | [
"public",
"function",
"handle",
"(",
"GetPropertyOptionsEvent",
"$",
"event",
")",
"{",
"$",
"isAllowed",
"=",
"$",
"this",
"->",
"isAllowedContext",
"(",
"$",
"event",
"->",
"getEnvironment",
"(",
")",
"->",
"getDataDefinition",
"(",
")",
",",
"$",
"event",... | Prepares a option list with alias => name connection for all attributes.
This is used in the attr_id select box.
@param GetPropertyOptionsEvent $event The event.
@return void
@throws \RuntimeException When the MetaModel can not be determined. | [
"Prepares",
"a",
"option",
"list",
"with",
"alias",
"=",
">",
"name",
"connection",
"for",
"all",
"attributes",
"."
] | 1875e4a2206df2c5c98f5b0a7f18feb17b34f393 | https://github.com/MetaModels/filter_range/blob/1875e4a2206df2c5c98f5b0a7f18feb17b34f393/src/EventListener/DcGeneral/Table/FilterSetting/GetPropertyOptionsListener.php#L43-L78 |
34,698 | nepttune/nepttune | src/Model/PushNotificationModel.php | PushNotificationModel.sendAll | public function sendAll($msg) : void
{
foreach ($this->subscriptionTable->findActive() as $row)
{
$this->sendNotification($row, $msg, false);
}
if ($flush)
{
$this->flush();
}
} | php | public function sendAll($msg) : void
{
foreach ($this->subscriptionTable->findActive() as $row)
{
$this->sendNotification($row, $msg, false);
}
if ($flush)
{
$this->flush();
}
} | [
"public",
"function",
"sendAll",
"(",
"$",
"msg",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"subscriptionTable",
"->",
"findActive",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"this",
"->",
"sendNotification",
"(",
"$",
"row",
",",
"$... | Send notification to all active subscriptions.
@param string $msg | [
"Send",
"notification",
"to",
"all",
"active",
"subscriptions",
"."
] | 63b41f62e0589a0ebac698abd1b8cf65abfcb1d5 | https://github.com/nepttune/nepttune/blob/63b41f62e0589a0ebac698abd1b8cf65abfcb1d5/src/Model/PushNotificationModel.php#L61-L72 |
34,699 | nepttune/nepttune | src/Model/PushNotificationModel.php | PushNotificationModel.sendByUserId | public function sendByUserId(int $userId, string $msg, ?string $dest = null, bool $flush = false) : void
{
$msg = $this->composeMsg($msg, $dest);
foreach ($this->subscriptionTable->findActive()->where('user_id', $userId) as $row)
{
$this->sendNotification($row, $msg, false);
... | php | public function sendByUserId(int $userId, string $msg, ?string $dest = null, bool $flush = false) : void
{
$msg = $this->composeMsg($msg, $dest);
foreach ($this->subscriptionTable->findActive()->where('user_id', $userId) as $row)
{
$this->sendNotification($row, $msg, false);
... | [
"public",
"function",
"sendByUserId",
"(",
"int",
"$",
"userId",
",",
"string",
"$",
"msg",
",",
"?",
"string",
"$",
"dest",
"=",
"null",
",",
"bool",
"$",
"flush",
"=",
"false",
")",
":",
"void",
"{",
"$",
"msg",
"=",
"$",
"this",
"->",
"composeMs... | Send notification to all subscriptions paired with specific user.
@param int $userId
@param string $msg
@param string $dest
@param bool $flush | [
"Send",
"notification",
"to",
"all",
"subscriptions",
"paired",
"with",
"specific",
"user",
"."
] | 63b41f62e0589a0ebac698abd1b8cf65abfcb1d5 | https://github.com/nepttune/nepttune/blob/63b41f62e0589a0ebac698abd1b8cf65abfcb1d5/src/Model/PushNotificationModel.php#L81-L94 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.