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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
234,800 | shopgate/cart-integration-sdk | src/core.php | ShopgateObject.recursiveToUtf8 | public function recursiveToUtf8($subject, $sourceEncoding = 'ISO-8859-15', $force = false, $useIconv = false)
{
/** @var array $subject */
if (is_array($subject)) {
foreach ($subject as $key => $value) {
$subject[$key] = $this->recursiveToUtf8($value, $sourceEncoding, $fo... | php | public function recursiveToUtf8($subject, $sourceEncoding = 'ISO-8859-15', $force = false, $useIconv = false)
{
/** @var array $subject */
if (is_array($subject)) {
foreach ($subject as $key => $value) {
$subject[$key] = $this->recursiveToUtf8($value, $sourceEncoding, $fo... | [
"public",
"function",
"recursiveToUtf8",
"(",
"$",
"subject",
",",
"$",
"sourceEncoding",
"=",
"'ISO-8859-15'",
",",
"$",
"force",
"=",
"false",
",",
"$",
"useIconv",
"=",
"false",
")",
"{",
"/** @var array $subject */",
"if",
"(",
"is_array",
"(",
"$",
"sub... | Encodes the values of an array, object or string from a given encoding to UTF-8 recursively.
If the subject is an array, the values will be encoded, keys will be preserved.
If the subject is an object, all accessible properties' values will be encoded.
If the subject is a string, it will simply be encoded.
If the subj... | [
"Encodes",
"the",
"values",
"of",
"an",
"array",
"object",
"or",
"string",
"from",
"a",
"given",
"encoding",
"to",
"UTF",
"-",
"8",
"recursively",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L1314-L1337 |
234,801 | shopgate/cart-integration-sdk | src/core.php | ShopgateObject.recursiveFromUtf8 | public function recursiveFromUtf8($subject, $destinationEncoding = 'ISO-8859-15', $force = false, $useIconv = false)
{
if (is_array($subject)) {
/** @var array $subject */
foreach ($subject as $key => $value) {
$subject[$key] = $this->recursiveFromUtf8($value, $destin... | php | public function recursiveFromUtf8($subject, $destinationEncoding = 'ISO-8859-15', $force = false, $useIconv = false)
{
if (is_array($subject)) {
/** @var array $subject */
foreach ($subject as $key => $value) {
$subject[$key] = $this->recursiveFromUtf8($value, $destin... | [
"public",
"function",
"recursiveFromUtf8",
"(",
"$",
"subject",
",",
"$",
"destinationEncoding",
"=",
"'ISO-8859-15'",
",",
"$",
"force",
"=",
"false",
",",
"$",
"useIconv",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"subject",
")",
")",
"{... | Decodes the values of an array, object or string from UTF-8 to a given encoding recursively
If the subject is an array, the values will be decoded, keys will be preserved.
If the subject is an object, all accessible properties' values will be decoded.
If the subject is a string, it will simply be decoded.
If the subje... | [
"Decodes",
"the",
"values",
"of",
"an",
"array",
"object",
"or",
"string",
"from",
"UTF",
"-",
"8",
"to",
"a",
"given",
"encoding",
"recursively"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L1356-L1379 |
234,802 | shopgate/cart-integration-sdk | src/core.php | ShopgateObject.convertEncoding | protected function convertEncoding($string, $destinationEncoding, $sourceEncoding, $useIconv = false)
{
if (function_exists('mb_convert_encoding') && !$useIconv) {
$convertedString = mb_convert_encoding($string, $destinationEncoding, $sourceEncoding);
} else {
// I have no ex... | php | protected function convertEncoding($string, $destinationEncoding, $sourceEncoding, $useIconv = false)
{
if (function_exists('mb_convert_encoding') && !$useIconv) {
$convertedString = mb_convert_encoding($string, $destinationEncoding, $sourceEncoding);
} else {
// I have no ex... | [
"protected",
"function",
"convertEncoding",
"(",
"$",
"string",
",",
"$",
"destinationEncoding",
",",
"$",
"sourceEncoding",
",",
"$",
"useIconv",
"=",
"false",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'mb_convert_encoding'",
")",
"&&",
"!",
"$",
"useIcon... | Converts a string's encoding to another.
This wraps the mb_convert_encoding() and iconv() functions of PHP. If the mb_string extension is not installed,
iconv() will be used instead.
If iconv() must be used and an array is passed as $sourceEncoding all encodings will be tested and the
(probably)
best encoding will be... | [
"Converts",
"a",
"string",
"s",
"encoding",
"to",
"another",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L1402-L1426 |
234,803 | shopgate/cart-integration-sdk | src/core.php | ShopgateObject.user_print_r | protected function user_print_r($subject, $ignore = array(), $depth = 1, $refChain = array())
{
static $maxDepth = 5;
if ($depth > 20) {
return;
}
if (is_object($subject)) {
foreach ($refChain as $refVal) {
if ($refVal === $subject) {
... | php | protected function user_print_r($subject, $ignore = array(), $depth = 1, $refChain = array())
{
static $maxDepth = 5;
if ($depth > 20) {
return;
}
if (is_object($subject)) {
foreach ($refChain as $refVal) {
if ($refVal === $subject) {
... | [
"protected",
"function",
"user_print_r",
"(",
"$",
"subject",
",",
"$",
"ignore",
"=",
"array",
"(",
")",
",",
"$",
"depth",
"=",
"1",
",",
"$",
"refChain",
"=",
"array",
"(",
")",
")",
"{",
"static",
"$",
"maxDepth",
"=",
"5",
";",
"if",
"(",
"$... | Takes any big object that can contain recursion and dumps it to the output buffer
@param mixed $subject
@param array $ignore
@param int $depth
@param array $refChain | [
"Takes",
"any",
"big",
"object",
"that",
"can",
"contain",
"recursion",
"and",
"dumps",
"it",
"to",
"the",
"output",
"buffer"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L1436-L1488 |
234,804 | shopgate/cart-integration-sdk | src/core.php | ShopgateObject.getMemoryUsageString | protected function getMemoryUsageString()
{
switch (strtoupper(trim(ShopgateLogger::getInstance()->getMemoryAnalyserLoggingSizeUnit()))) {
case 'GB':
return (memory_get_usage() / (1024 * 1024 * 1024)) . " GB (real usage " . (memory_get_usage(
true
... | php | protected function getMemoryUsageString()
{
switch (strtoupper(trim(ShopgateLogger::getInstance()->getMemoryAnalyserLoggingSizeUnit()))) {
case 'GB':
return (memory_get_usage() / (1024 * 1024 * 1024)) . " GB (real usage " . (memory_get_usage(
true
... | [
"protected",
"function",
"getMemoryUsageString",
"(",
")",
"{",
"switch",
"(",
"strtoupper",
"(",
"trim",
"(",
"ShopgateLogger",
"::",
"getInstance",
"(",
")",
"->",
"getMemoryAnalyserLoggingSizeUnit",
"(",
")",
")",
")",
")",
"{",
"case",
"'GB'",
":",
"return... | Gets the used memory and real used memory and returns it as a string
@return string | [
"Gets",
"the",
"used",
"memory",
"and",
"real",
"used",
"memory",
"and",
"returns",
"it",
"as",
"a",
"string"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L1516-L1532 |
234,805 | shopgate/cart-integration-sdk | src/core.php | ShopgatePlugin.getCreateCsvLoaders | final private function getCreateCsvLoaders($subjectName)
{
$actions = array();
$subjectName = trim($subjectName);
if (!empty($subjectName)) {
$methodName = 'buildDefault' . $this->camelize($subjectName, true) . 'Row';
if (method_exists($this, $methodName)) {
... | php | final private function getCreateCsvLoaders($subjectName)
{
$actions = array();
$subjectName = trim($subjectName);
if (!empty($subjectName)) {
$methodName = 'buildDefault' . $this->camelize($subjectName, true) . 'Row';
if (method_exists($this, $methodName)) {
... | [
"final",
"private",
"function",
"getCreateCsvLoaders",
"(",
"$",
"subjectName",
")",
"{",
"$",
"actions",
"=",
"array",
"(",
")",
";",
"$",
"subjectName",
"=",
"trim",
"(",
"$",
"subjectName",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"subjectName",
... | Creates an array of corresponding helper method names, based on the export type given
@param string $subjectName
@return array | [
"Creates",
"an",
"array",
"of",
"corresponding",
"helper",
"method",
"names",
"based",
"on",
"the",
"export",
"type",
"given"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L2391-L2405 |
234,806 | shopgate/cart-integration-sdk | src/core.php | ShopgatePlugin.disableAction | public function disableAction($actionName)
{
$shopgateSettingsNew = array('enable_' . $actionName => 0);
$this->config->load($shopgateSettingsNew);
$this->config->save(array_keys($shopgateSettingsNew), true);
} | php | public function disableAction($actionName)
{
$shopgateSettingsNew = array('enable_' . $actionName => 0);
$this->config->load($shopgateSettingsNew);
$this->config->save(array_keys($shopgateSettingsNew), true);
} | [
"public",
"function",
"disableAction",
"(",
"$",
"actionName",
")",
"{",
"$",
"shopgateSettingsNew",
"=",
"array",
"(",
"'enable_'",
".",
"$",
"actionName",
"=>",
"0",
")",
";",
"$",
"this",
"->",
"config",
"->",
"load",
"(",
"$",
"shopgateSettingsNew",
")... | disables an API method in the local config
@param string $actionName | [
"disables",
"an",
"API",
"method",
"in",
"the",
"local",
"config"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L2458-L2463 |
234,807 | shopgate/cart-integration-sdk | src/core.php | ShopgatePlugin.createShopInfo | public function createShopInfo()
{
$shopInfo = array(
'category_count' => 0,
'item_count' => 0,
);
if ($this->config->getEnableGetReviewsCsv()) {
$shopInfo['review_count'] = 0;
}
if ($this->config->getEnableGetMediaCsv()) {
... | php | public function createShopInfo()
{
$shopInfo = array(
'category_count' => 0,
'item_count' => 0,
);
if ($this->config->getEnableGetReviewsCsv()) {
$shopInfo['review_count'] = 0;
}
if ($this->config->getEnableGetMediaCsv()) {
... | [
"public",
"function",
"createShopInfo",
"(",
")",
"{",
"$",
"shopInfo",
"=",
"array",
"(",
"'category_count'",
"=>",
"0",
",",
"'item_count'",
"=>",
"0",
",",
")",
";",
"if",
"(",
"$",
"this",
"->",
"config",
"->",
"getEnableGetReviewsCsv",
"(",
")",
")"... | Callback function for the Shopgate Plugin API ping action.
Override this to append additional information about shop system to the response of the ping action.
@return mixed[] An array with additional information. | [
"Callback",
"function",
"for",
"the",
"Shopgate",
"Plugin",
"API",
"ping",
"action",
".",
"Override",
"this",
"to",
"append",
"additional",
"information",
"about",
"shop",
"system",
"to",
"the",
"response",
"of",
"the",
"ping",
"action",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L2529-L2545 |
234,808 | shopgate/cart-integration-sdk | src/core.php | ShopgatePlugin.redeemCoupons | public function redeemCoupons(ShopgateCart $cart)
{
$this->disableAction('redeem_coupons');
throw new ShopgateLibraryException(
ShopgateLibraryException::PLUGIN_API_DISABLED_ACTION,
'The requested action is disabled and no longer supported.',
true,
fal... | php | public function redeemCoupons(ShopgateCart $cart)
{
$this->disableAction('redeem_coupons');
throw new ShopgateLibraryException(
ShopgateLibraryException::PLUGIN_API_DISABLED_ACTION,
'The requested action is disabled and no longer supported.',
true,
fal... | [
"public",
"function",
"redeemCoupons",
"(",
"ShopgateCart",
"$",
"cart",
")",
"{",
"$",
"this",
"->",
"disableAction",
"(",
"'redeem_coupons'",
")",
";",
"throw",
"new",
"ShopgateLibraryException",
"(",
"ShopgateLibraryException",
"::",
"PLUGIN_API_DISABLED_ACTION",
"... | Redeems coupons that are passed along with a ShopgateCart object.
@param ShopgateCart $cart The ShopgateCart object containing the coupons that should be redeemed.
@return array('external_coupons' => ShopgateExternalCoupon[])
@throws ShopgateLibraryException if an error occurs.
@see http://developer.shopgate.... | [
"Redeems",
"coupons",
"that",
"are",
"passed",
"along",
"with",
"a",
"ShopgateCart",
"object",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L2632-L2641 |
234,809 | shopgate/cart-integration-sdk | src/core.php | ShopgateContainer.loadArray | public function loadArray(array $data = array())
{
$unmappedData = array();
if (is_array($data)) {
$methods = get_class_methods($this);
foreach ($data as $key => $value) {
$setter = 'set' . $this->camelize($key, true);
if (!in_array($setter, $... | php | public function loadArray(array $data = array())
{
$unmappedData = array();
if (is_array($data)) {
$methods = get_class_methods($this);
foreach ($data as $key => $value) {
$setter = 'set' . $this->camelize($key, true);
if (!in_array($setter, $... | [
"public",
"function",
"loadArray",
"(",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"unmappedData",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"$",
"methods",
"=",
"get_class_methods",
"(",
... | Tries to map an associative array to the object's attributes.
The passed data must be an array, it's indices must be the un-camelized,
underscored names of the set* methods of the object.
Tha data that couldn't be mapped is returned as an array.
@param array <string, mixed> $data The data that should be mapped to th... | [
"Tries",
"to",
"map",
"an",
"associative",
"array",
"to",
"the",
"object",
"s",
"attributes",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L3207-L3224 |
234,810 | shopgate/cart-integration-sdk | src/core.php | ShopgateContainer.compare | public function compare($obj, $obj2, $whitelist)
{
foreach ($whitelist as $acceptedField) {
if ($obj->{$this->camelize('get_' . $acceptedField)}() != $obj2->{$this->camelize('get_' . $acceptedField)}(
)) {
return false;
}
}
return true... | php | public function compare($obj, $obj2, $whitelist)
{
foreach ($whitelist as $acceptedField) {
if ($obj->{$this->camelize('get_' . $acceptedField)}() != $obj2->{$this->camelize('get_' . $acceptedField)}(
)) {
return false;
}
}
return true... | [
"public",
"function",
"compare",
"(",
"$",
"obj",
",",
"$",
"obj2",
",",
"$",
"whitelist",
")",
"{",
"foreach",
"(",
"$",
"whitelist",
"as",
"$",
"acceptedField",
")",
"{",
"if",
"(",
"$",
"obj",
"->",
"{",
"$",
"this",
"->",
"camelize",
"(",
"'get... | Compares values of two containers.
@param ShopgateContainer $obj
@param ShopgateContainer $obj2
@param string[] $whitelist
@return bool | [
"Compares",
"values",
"of",
"two",
"containers",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L3235-L3245 |
234,811 | shopgate/cart-integration-sdk | src/core.php | ShopgateContainer.utf8Encode | public function utf8Encode($sourceEncoding = 'ISO-8859-15', $force = false, $useIconv = false)
{
$visitor = new ShopgateContainerUtf8Visitor(
ShopgateContainerUtf8Visitor::MODE_ENCODE, $sourceEncoding,
$force,
$useIconv
);
$visitor->visitContainer($this);
... | php | public function utf8Encode($sourceEncoding = 'ISO-8859-15', $force = false, $useIconv = false)
{
$visitor = new ShopgateContainerUtf8Visitor(
ShopgateContainerUtf8Visitor::MODE_ENCODE, $sourceEncoding,
$force,
$useIconv
);
$visitor->visitContainer($this);
... | [
"public",
"function",
"utf8Encode",
"(",
"$",
"sourceEncoding",
"=",
"'ISO-8859-15'",
",",
"$",
"force",
"=",
"false",
",",
"$",
"useIconv",
"=",
"false",
")",
"{",
"$",
"visitor",
"=",
"new",
"ShopgateContainerUtf8Visitor",
"(",
"ShopgateContainerUtf8Visitor",
... | Creates a new object of the same type with every value recursively utf-8 encoded.
@param String $sourceEncoding The source Encoding of the strings
@param bool $force Set this true to enforce encoding even if the source encoding is already UTF-8.
@param bool $useIconv True to use iconv instead of mb_... | [
"Creates",
"a",
"new",
"object",
"of",
"the",
"same",
"type",
"with",
"every",
"value",
"recursively",
"utf",
"-",
"8",
"encoded",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L3269-L3279 |
234,812 | shopgate/cart-integration-sdk | src/core.php | ShopgateContainer.utf8Decode | public function utf8Decode($destinationEncoding = 'ISO-8859-15', $force = false, $useIconv = false)
{
$visitor = new ShopgateContainerUtf8Visitor(
ShopgateContainerUtf8Visitor::MODE_DECODE,
$destinationEncoding,
$force, $useIconv
);
$visitor->visitContaine... | php | public function utf8Decode($destinationEncoding = 'ISO-8859-15', $force = false, $useIconv = false)
{
$visitor = new ShopgateContainerUtf8Visitor(
ShopgateContainerUtf8Visitor::MODE_DECODE,
$destinationEncoding,
$force, $useIconv
);
$visitor->visitContaine... | [
"public",
"function",
"utf8Decode",
"(",
"$",
"destinationEncoding",
"=",
"'ISO-8859-15'",
",",
"$",
"force",
"=",
"false",
",",
"$",
"useIconv",
"=",
"false",
")",
"{",
"$",
"visitor",
"=",
"new",
"ShopgateContainerUtf8Visitor",
"(",
"ShopgateContainerUtf8Visitor... | Creates a new object of the same type with every value recursively utf-8 decoded.
@param String $destinationEncoding The destination Encoding for the strings
@param bool $force Set this true to enforce encoding even if the destination encoding is set to
UTF-8.
@param bool $useIconv True to... | [
"Creates",
"a",
"new",
"object",
"of",
"the",
"same",
"type",
"with",
"every",
"value",
"recursively",
"utf",
"-",
"8",
"decoded",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L3292-L3302 |
234,813 | shopgate/cart-integration-sdk | src/core.php | ShopgateContainer.buildProperties | public function buildProperties()
{
$methods = get_class_methods($this);
$properties = get_object_vars($this);
$filteredProperties = array();
// only properties that have getters should be extracted
foreach ($properties as $property => $value) {
... | php | public function buildProperties()
{
$methods = get_class_methods($this);
$properties = get_object_vars($this);
$filteredProperties = array();
// only properties that have getters should be extracted
foreach ($properties as $property => $value) {
... | [
"public",
"function",
"buildProperties",
"(",
")",
"{",
"$",
"methods",
"=",
"get_class_methods",
"(",
"$",
"this",
")",
";",
"$",
"properties",
"=",
"get_object_vars",
"(",
"$",
"this",
")",
";",
"$",
"filteredProperties",
"=",
"array",
"(",
")",
";",
"... | Creates an array of all properties that have getters.
@return mixed[] | [
"Creates",
"an",
"array",
"of",
"all",
"properties",
"that",
"have",
"getters",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/core.php#L3309-L3324 |
234,814 | shpasser/GaeSupport | src/Shpasser/GaeSupport/Foundation/Application.php | Application.detectGae | protected function detectGae()
{
if (! class_exists(self::GAE_ID_SERVICE)) {
$this->runningOnGae = false;
$this->appId = null;
return;
}
$AppIdentityService = self::GAE_ID_SERVICE;
$this->appId = $AppIdentityService::getApplicationId();
$t... | php | protected function detectGae()
{
if (! class_exists(self::GAE_ID_SERVICE)) {
$this->runningOnGae = false;
$this->appId = null;
return;
}
$AppIdentityService = self::GAE_ID_SERVICE;
$this->appId = $AppIdentityService::getApplicationId();
$t... | [
"protected",
"function",
"detectGae",
"(",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"self",
"::",
"GAE_ID_SERVICE",
")",
")",
"{",
"$",
"this",
"->",
"runningOnGae",
"=",
"false",
";",
"$",
"this",
"->",
"appId",
"=",
"null",
";",
"return",
";",
... | Detect if the application is running on GAE.
If we run on GAE then 'realpath()' function replacement
'gae_realpath()' is declared, so it won't fail with GAE
bucket paths.
In order for 'gae_realpath()' function to be called the code has
to be patched to use 'gae_realpath()' instead of 'realpath()'
using the command 'p... | [
"Detect",
"if",
"the",
"application",
"is",
"running",
"on",
"GAE",
"."
] | 7f37f2bf177a4e8f1cbefdf04f49b51016e85ae3 | https://github.com/shpasser/GaeSupport/blob/7f37f2bf177a4e8f1cbefdf04f49b51016e85ae3/src/Shpasser/GaeSupport/Foundation/Application.php#L51-L66 |
234,815 | shpasser/GaeSupport | src/Shpasser/GaeSupport/Foundation/Application.php | Application.bindStoragePath | protected function bindStoragePath()
{
if ($this->runningOnGae) {
$buckets = ini_get('google_app_engine.allow_include_gs_buckets');
// Get the first bucket in the list.
$bucket = current(explode(', ', $buckets));
if ($bucket) {
$storagePath = ... | php | protected function bindStoragePath()
{
if ($this->runningOnGae) {
$buckets = ini_get('google_app_engine.allow_include_gs_buckets');
// Get the first bucket in the list.
$bucket = current(explode(', ', $buckets));
if ($bucket) {
$storagePath = ... | [
"protected",
"function",
"bindStoragePath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"runningOnGae",
")",
"{",
"$",
"buckets",
"=",
"ini_get",
"(",
"'google_app_engine.allow_include_gs_buckets'",
")",
";",
"// Get the first bucket in the list.",
"$",
"bucket",
"... | Binds the GAE storage path if running on GAE.
The binding of the new storage path overrides the
original one which appears in the 'paths.php' file.
The GAE storage directory is created if it does
not exist already.
@return void | [
"Binds",
"the",
"GAE",
"storage",
"path",
"if",
"running",
"on",
"GAE",
".",
"The",
"binding",
"of",
"the",
"new",
"storage",
"path",
"overrides",
"the",
"original",
"one",
"which",
"appears",
"in",
"the",
"paths",
".",
"php",
"file",
"."
] | 7f37f2bf177a4e8f1cbefdf04f49b51016e85ae3 | https://github.com/shpasser/GaeSupport/blob/7f37f2bf177a4e8f1cbefdf04f49b51016e85ae3/src/Shpasser/GaeSupport/Foundation/Application.php#L126-L143 |
234,816 | potsky/microsoft-translator-php-sdk | src/MicrosoftTranslator/Logger.php | Logger.fatal | public function fatal( $object , $category , $message )
{
$this->message( self::getMessagePrefix( $object , $category , 'fatal' ) . $message , self::LEVEL_FATAL );
throw new Exception( $message );
} | php | public function fatal( $object , $category , $message )
{
$this->message( self::getMessagePrefix( $object , $category , 'fatal' ) . $message , self::LEVEL_FATAL );
throw new Exception( $message );
} | [
"public",
"function",
"fatal",
"(",
"$",
"object",
",",
"$",
"category",
",",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"message",
"(",
"self",
"::",
"getMessagePrefix",
"(",
"$",
"object",
",",
"$",
"category",
",",
"'fatal'",
")",
".",
"$",
"mes... | fatal message and throw an MicrosoftTranslator\Exception
@param string $object
@param string $category
@param string $message
@throws \MicrosoftTranslator\Exception | [
"fatal",
"message",
"and",
"throw",
"an",
"MicrosoftTranslator",
"\\",
"Exception"
] | 102f2411be5abb0e57a73c475f8e9e185a9f4859 | https://github.com/potsky/microsoft-translator-php-sdk/blob/102f2411be5abb0e57a73c475f8e9e185a9f4859/src/MicrosoftTranslator/Logger.php#L147-L152 |
234,817 | potsky/microsoft-translator-php-sdk | src/MicrosoftTranslator/Logger.php | Logger.message | private function message( $message , $message_level )
{
if ( $message_level <= (int)$this->log_level )
{
if ( empty( $this->log_file_path ) )
{
error_log( $message );
}
else
{
if ( @file_put_contents( $this->log_file_path , $message . "\n" , FILE_APPEND ) === false )
{
$message = sp... | php | private function message( $message , $message_level )
{
if ( $message_level <= (int)$this->log_level )
{
if ( empty( $this->log_file_path ) )
{
error_log( $message );
}
else
{
if ( @file_put_contents( $this->log_file_path , $message . "\n" , FILE_APPEND ) === false )
{
$message = sp... | [
"private",
"function",
"message",
"(",
"$",
"message",
",",
"$",
"message_level",
")",
"{",
"if",
"(",
"$",
"message_level",
"<=",
"(",
"int",
")",
"$",
"this",
"->",
"log_level",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"log_file_path",
... | Log a message using error_log if log level is compliant
@param string $message
@param integer $message_level
@return bool true if message has been logged
@throws \MicrosoftTranslator\Exception | [
"Log",
"a",
"message",
"using",
"error_log",
"if",
"log",
"level",
"is",
"compliant"
] | 102f2411be5abb0e57a73c475f8e9e185a9f4859 | https://github.com/potsky/microsoft-translator-php-sdk/blob/102f2411be5abb0e57a73c475f8e9e185a9f4859/src/MicrosoftTranslator/Logger.php#L163-L187 |
234,818 | makinacorpus/drupal-ucms | ucms_seo/src/Controller/StoreLocatorController.php | StoreLocatorController.renderFieldAction | public function renderFieldAction(NodeInterface $node, $type, $sub_area = null, $locality = null)
{
$type = $type === 'all' ? null : $type;
$sub_area = $sub_area === 'all' ? null : $sub_area;
/** @var StoreLocatorInterface $storeLocator */
$storeLocator = $this
->get('uc... | php | public function renderFieldAction(NodeInterface $node, $type, $sub_area = null, $locality = null)
{
$type = $type === 'all' ? null : $type;
$sub_area = $sub_area === 'all' ? null : $sub_area;
/** @var StoreLocatorInterface $storeLocator */
$storeLocator = $this
->get('uc... | [
"public",
"function",
"renderFieldAction",
"(",
"NodeInterface",
"$",
"node",
",",
"$",
"type",
",",
"$",
"sub_area",
"=",
"null",
",",
"$",
"locality",
"=",
"null",
")",
"{",
"$",
"type",
"=",
"$",
"type",
"===",
"'all'",
"?",
"null",
":",
"$",
"typ... | This renders the field when viewing a store_locator bundle | [
"This",
"renders",
"the",
"field",
"when",
"viewing",
"a",
"store_locator",
"bundle"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Controller/StoreLocatorController.php#L37-L75 |
234,819 | makinacorpus/drupal-ucms | ucms_notification/src/EventDispatcher/ExtranetMemberEventSubscriber.php | ExtranetMemberEventSubscriber.notify | protected function notify(ExtranetMemberEvent $event, $action)
{
$userId = $event->getSubject()->id();
$siteId = $event->getSite()->getId();
$this->notificationService->notifyChannel('site:' . $siteId, 'member', $userId, $action, $event->getArguments());
} | php | protected function notify(ExtranetMemberEvent $event, $action)
{
$userId = $event->getSubject()->id();
$siteId = $event->getSite()->getId();
$this->notificationService->notifyChannel('site:' . $siteId, 'member', $userId, $action, $event->getArguments());
} | [
"protected",
"function",
"notify",
"(",
"ExtranetMemberEvent",
"$",
"event",
",",
"$",
"action",
")",
"{",
"$",
"userId",
"=",
"$",
"event",
"->",
"getSubject",
"(",
")",
"->",
"id",
"(",
")",
";",
"$",
"siteId",
"=",
"$",
"event",
"->",
"getSite",
"... | Sends a notification on the site's channel.
@param ExtranetMemberEvent $event
@param string $action | [
"Sends",
"a",
"notification",
"on",
"the",
"site",
"s",
"channel",
"."
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_notification/src/EventDispatcher/ExtranetMemberEventSubscriber.php#L66-L72 |
234,820 | makinacorpus/drupal-ucms | ucms_notification/src/NotificationService.php | NotificationService.getUserAccount | private function getUserAccount($userId)
{
$user = $this->entityManager->getStorage('user')->load($userId);
if (!$user) {
throw new \InvalidArgumentException(sprintf("User %d does not exist", $userId));
}
return $user;
} | php | private function getUserAccount($userId)
{
$user = $this->entityManager->getStorage('user')->load($userId);
if (!$user) {
throw new \InvalidArgumentException(sprintf("User %d does not exist", $userId));
}
return $user;
} | [
"private",
"function",
"getUserAccount",
"(",
"$",
"userId",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"getStorage",
"(",
"'user'",
")",
"->",
"load",
"(",
"$",
"userId",
")",
";",
"if",
"(",
"!",
"$",
"user",
")",
"{",
... | Get user account
@param int $userId
@return \Drupal\Core\Session\AccountInterface | [
"Get",
"user",
"account"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_notification/src/NotificationService.php#L47-L56 |
234,821 | makinacorpus/drupal-ucms | ucms_notification/src/NotificationService.php | NotificationService.refreshSubscriptionsFor | public function refreshSubscriptionsFor($userId)
{
$valid = ['client:' . $userId];
$account = $this->getUserAccount($userId);
$default = [
'admin:client',
'admin:content',
'admin:label',
'admin:seo',
'admin:site',
... | php | public function refreshSubscriptionsFor($userId)
{
$valid = ['client:' . $userId];
$account = $this->getUserAccount($userId);
$default = [
'admin:client',
'admin:content',
'admin:label',
'admin:seo',
'admin:site',
... | [
"public",
"function",
"refreshSubscriptionsFor",
"(",
"$",
"userId",
")",
"{",
"$",
"valid",
"=",
"[",
"'client:'",
".",
"$",
"userId",
"]",
";",
"$",
"account",
"=",
"$",
"this",
"->",
"getUserAccount",
"(",
"$",
"userId",
")",
";",
"$",
"default",
"=... | Ensure user mandatory subscriptions
Always remember that having the view notifications permissions does not
imply that you can see the content, so users might receive notifications
about content they cannot see; doing otherwise would mean to recheck
all permissions/access rights for all users on every content update w... | [
"Ensure",
"user",
"mandatory",
"subscriptions"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_notification/src/NotificationService.php#L69-L154 |
234,822 | makinacorpus/drupal-ucms | ucms_notification/src/NotificationService.php | NotificationService.deleteSubscriptionsFor | public function deleteSubscriptionsFor($userId, $chanIdList = null)
{
$conditions = [
Field::SUBER_NAME => $this
->notificationService
->getSubscriberName($userId),
];
if ($chanIdList) {
$conditions[Field::CHAN_ID] = $chanIdList;
... | php | public function deleteSubscriptionsFor($userId, $chanIdList = null)
{
$conditions = [
Field::SUBER_NAME => $this
->notificationService
->getSubscriberName($userId),
];
if ($chanIdList) {
$conditions[Field::CHAN_ID] = $chanIdList;
... | [
"public",
"function",
"deleteSubscriptionsFor",
"(",
"$",
"userId",
",",
"$",
"chanIdList",
"=",
"null",
")",
"{",
"$",
"conditions",
"=",
"[",
"Field",
"::",
"SUBER_NAME",
"=>",
"$",
"this",
"->",
"notificationService",
"->",
"getSubscriberName",
"(",
"$",
... | Delete user subscriptions
@param int $userId
@param string[] $chanIdList | [
"Delete",
"user",
"subscriptions"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_notification/src/NotificationService.php#L162-L180 |
234,823 | accompli/accompli | src/Console/Command/InitCommand.php | InitCommand.interact | protected function interact(InputInterface $input, OutputInterface $output)
{
$io = $this->getIO($input, $output);
$io->write(Accompli::LOGO);
$io->writeln(' =========================');
$io->writeln(' Configuration generator');
$io->writeln(' =========================');
... | php | protected function interact(InputInterface $input, OutputInterface $output)
{
$io = $this->getIO($input, $output);
$io->write(Accompli::LOGO);
$io->writeln(' =========================');
$io->writeln(' Configuration generator');
$io->writeln(' =========================');
... | [
"protected",
"function",
"interact",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"$",
"this",
"->",
"getIO",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"io",
"->",
"write",
"(",
"Ac... | Interacts with the user to retrieve the configuration for an accompli.json file.
@param InputInterface $input
@param OutputInterface $output | [
"Interacts",
"with",
"the",
"user",
"to",
"retrieve",
"the",
"configuration",
"for",
"an",
"accompli",
".",
"json",
"file",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Console/Command/InitCommand.php#L66-L92 |
234,824 | accompli/accompli | src/Console/Command/InitCommand.php | InitCommand.interactForHostConfigurations | private function interactForHostConfigurations(OutputStyle $io)
{
$io->writeln(' Add host configurations:');
$addHost = true;
while ($addHost) {
$stage = $io->choice('Stage', array(
Host::STAGE_PRODUCTION,
Host::STAGE_ACCEPTANCE,
H... | php | private function interactForHostConfigurations(OutputStyle $io)
{
$io->writeln(' Add host configurations:');
$addHost = true;
while ($addHost) {
$stage = $io->choice('Stage', array(
Host::STAGE_PRODUCTION,
Host::STAGE_ACCEPTANCE,
H... | [
"private",
"function",
"interactForHostConfigurations",
"(",
"OutputStyle",
"$",
"io",
")",
"{",
"$",
"io",
"->",
"writeln",
"(",
"' Add host configurations:'",
")",
";",
"$",
"addHost",
"=",
"true",
";",
"while",
"(",
"$",
"addHost",
")",
"{",
"$",
"stage",... | Interacts with the user to retrieve host configurations.
@param OutputStyle $io | [
"Interacts",
"with",
"the",
"user",
"to",
"retrieve",
"host",
"configurations",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Console/Command/InitCommand.php#L117-L141 |
234,825 | accompli/accompli | src/Console/Command/InitCommand.php | InitCommand.interactForTaskConfigurations | private function interactForTaskConfigurations(OutputStyle $io)
{
$io->writeln(' Add tasks:');
$addTask = true;
while ($addTask) {
$taskQuestion = new Question('Search for a task');
$taskQuestion->setAutocompleterValues($this->getAvailableTasks());
$taskQ... | php | private function interactForTaskConfigurations(OutputStyle $io)
{
$io->writeln(' Add tasks:');
$addTask = true;
while ($addTask) {
$taskQuestion = new Question('Search for a task');
$taskQuestion->setAutocompleterValues($this->getAvailableTasks());
$taskQ... | [
"private",
"function",
"interactForTaskConfigurations",
"(",
"OutputStyle",
"$",
"io",
")",
"{",
"$",
"io",
"->",
"writeln",
"(",
"' Add tasks:'",
")",
";",
"$",
"addTask",
"=",
"true",
";",
"while",
"(",
"$",
"addTask",
")",
"{",
"$",
"taskQuestion",
"=",... | Interacts with the user to retrieve task configurations.
@param OutputStyle $io | [
"Interacts",
"with",
"the",
"user",
"to",
"retrieve",
"task",
"configurations",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Console/Command/InitCommand.php#L148-L180 |
234,826 | accompli/accompli | src/Console/Command/InitCommand.php | InitCommand.getTaskConfigurationParameters | private function getTaskConfigurationParameters($taskClass)
{
$parameters = array();
$reflectionClass = new ReflectionClass($taskClass);
$reflectionConstructorMethod = $reflectionClass->getConstructor();
if ($reflectionConstructorMethod instanceof ReflectionMethod) {
for... | php | private function getTaskConfigurationParameters($taskClass)
{
$parameters = array();
$reflectionClass = new ReflectionClass($taskClass);
$reflectionConstructorMethod = $reflectionClass->getConstructor();
if ($reflectionConstructorMethod instanceof ReflectionMethod) {
for... | [
"private",
"function",
"getTaskConfigurationParameters",
"(",
"$",
"taskClass",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"taskClass",
")",
";",
"$",
"reflectionConstructorMethod",
... | Returns the required configuration parameters of the task.
@param string $taskClass
@return array | [
"Returns",
"the",
"required",
"configuration",
"parameters",
"of",
"the",
"task",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Console/Command/InitCommand.php#L189-L209 |
234,827 | accompli/accompli | src/Console/Command/InitCommand.php | InitCommand.getIO | private function getIO(InputInterface $input, OutputInterface $output)
{
if ($this->io instanceof OutputStyle === false) {
$this->io = new SymfonyStyle($input, $output);
}
return $this->io;
} | php | private function getIO(InputInterface $input, OutputInterface $output)
{
if ($this->io instanceof OutputStyle === false) {
$this->io = new SymfonyStyle($input, $output);
}
return $this->io;
} | [
"private",
"function",
"getIO",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"io",
"instanceof",
"OutputStyle",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"io",
"=",
"new",
"Symfony... | Returns the instance handling input and output of this command.
@param InputInterface $input
@param OutputInterface $output
@return OutputStyle | [
"Returns",
"the",
"instance",
"handling",
"input",
"and",
"output",
"of",
"this",
"command",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Console/Command/InitCommand.php#L229-L236 |
234,828 | accompli/accompli | src/Console/Command/InitCommand.php | InitCommand.getAvailableTasks | private function getAvailableTasks()
{
$tasks = array_map(function ($task) {
return substr($task, 0, -4);
}, array_diff(scandir(__DIR__.'/../../Task'), array('.', '..')));
sort($tasks);
return $tasks;
} | php | private function getAvailableTasks()
{
$tasks = array_map(function ($task) {
return substr($task, 0, -4);
}, array_diff(scandir(__DIR__.'/../../Task'), array('.', '..')));
sort($tasks);
return $tasks;
} | [
"private",
"function",
"getAvailableTasks",
"(",
")",
"{",
"$",
"tasks",
"=",
"array_map",
"(",
"function",
"(",
"$",
"task",
")",
"{",
"return",
"substr",
"(",
"$",
"task",
",",
"0",
",",
"-",
"4",
")",
";",
"}",
",",
"array_diff",
"(",
"scandir",
... | Returns the available tasks within Accompli.
@return array | [
"Returns",
"the",
"available",
"tasks",
"within",
"Accompli",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Console/Command/InitCommand.php#L258-L267 |
234,829 | jeremyFreeAgent/Bitter | src/FreeAgent/Bitter/Bitter.php | Bitter.mark | public function mark($eventName, $id, DateTime $dateTime = null)
{
$dateTime = is_null($dateTime) ? new DateTime : $dateTime;
$eventData = array(
new Year($eventName, $dateTime),
new Month($eventName, $dateTime),
new Week($eventName, $dateTime),
new D... | php | public function mark($eventName, $id, DateTime $dateTime = null)
{
$dateTime = is_null($dateTime) ? new DateTime : $dateTime;
$eventData = array(
new Year($eventName, $dateTime),
new Month($eventName, $dateTime),
new Week($eventName, $dateTime),
new D... | [
"public",
"function",
"mark",
"(",
"$",
"eventName",
",",
"$",
"id",
",",
"DateTime",
"$",
"dateTime",
"=",
"null",
")",
"{",
"$",
"dateTime",
"=",
"is_null",
"(",
"$",
"dateTime",
")",
"?",
"new",
"DateTime",
":",
"$",
"dateTime",
";",
"$",
"eventDa... | Marks an event for hours, days, weeks and months
@param string $eventName The name of the event, could be "active" or "new_signups"
@param integer $id An unique id, typically user id. The id should not be huge, read Redis documentation why (bitmaps)
@param DateTime $dateTime Which date should be used as a r... | [
"Marks",
"an",
"event",
"for",
"hours",
"days",
"weeks",
"and",
"months"
] | 018742b098c937039909997e005f47201161686f | https://github.com/jeremyFreeAgent/Bitter/blob/018742b098c937039909997e005f47201161686f/src/FreeAgent/Bitter/Bitter.php#L62-L81 |
234,830 | jeremyFreeAgent/Bitter | src/FreeAgent/Bitter/Bitter.php | Bitter.in | public function in($id, $key)
{
$key = $key instanceof UnitOfTimeInterface ? $this->prefixKey . $key->getKey() : $this->prefixTempKey . $key;
return (bool) $this->getRedisClient()->getbit($key, $id);
} | php | public function in($id, $key)
{
$key = $key instanceof UnitOfTimeInterface ? $this->prefixKey . $key->getKey() : $this->prefixTempKey . $key;
return (bool) $this->getRedisClient()->getbit($key, $id);
} | [
"public",
"function",
"in",
"(",
"$",
"id",
",",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"key",
"instanceof",
"UnitOfTimeInterface",
"?",
"$",
"this",
"->",
"prefixKey",
".",
"$",
"key",
"->",
"getKey",
"(",
")",
":",
"$",
"this",
"->",
"prefix... | Makes it possible to see if an id has been marked
@param integer $id An unique id
@param mixed $key The key or the event
@return boolean True if the id has been marked | [
"Makes",
"it",
"possible",
"to",
"see",
"if",
"an",
"id",
"has",
"been",
"marked"
] | 018742b098c937039909997e005f47201161686f | https://github.com/jeremyFreeAgent/Bitter/blob/018742b098c937039909997e005f47201161686f/src/FreeAgent/Bitter/Bitter.php#L90-L95 |
234,831 | jeremyFreeAgent/Bitter | src/FreeAgent/Bitter/Bitter.php | Bitter.count | public function count($key)
{
$key = $key instanceof UnitOfTimeInterface ? $this->prefixKey . $key->getKey() : $this->prefixTempKey . $key;
return (int) $this->getRedisClient()->bitcount($key);
} | php | public function count($key)
{
$key = $key instanceof UnitOfTimeInterface ? $this->prefixKey . $key->getKey() : $this->prefixTempKey . $key;
return (int) $this->getRedisClient()->bitcount($key);
} | [
"public",
"function",
"count",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"key",
"instanceof",
"UnitOfTimeInterface",
"?",
"$",
"this",
"->",
"prefixKey",
".",
"$",
"key",
"->",
"getKey",
"(",
")",
":",
"$",
"this",
"->",
"prefixTempKey",
".",
... | Counts the number of marks
@param mixed $key The key or the event
@return integer The value of the count result | [
"Counts",
"the",
"number",
"of",
"marks"
] | 018742b098c937039909997e005f47201161686f | https://github.com/jeremyFreeAgent/Bitter/blob/018742b098c937039909997e005f47201161686f/src/FreeAgent/Bitter/Bitter.php#L103-L108 |
234,832 | jeremyFreeAgent/Bitter | src/FreeAgent/Bitter/Bitter.php | Bitter.getIds | public function getIds($key)
{
$key = $key instanceof UnitOfTimeInterface ? $this->prefixKey . $key->getKey() : $this->prefixTempKey . $key;
$string = $this->getRedisClient()->get($key);
$data = $this->bitsetToString($string);
$ids = array();
while (false !== ($pos = strpo... | php | public function getIds($key)
{
$key = $key instanceof UnitOfTimeInterface ? $this->prefixKey . $key->getKey() : $this->prefixTempKey . $key;
$string = $this->getRedisClient()->get($key);
$data = $this->bitsetToString($string);
$ids = array();
while (false !== ($pos = strpo... | [
"public",
"function",
"getIds",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"key",
"instanceof",
"UnitOfTimeInterface",
"?",
"$",
"this",
"->",
"prefixKey",
".",
"$",
"key",
"->",
"getKey",
"(",
")",
":",
"$",
"this",
"->",
"prefixTempKey",
".",
... | Returns the ids of an key or event
@param mixed $key The key or the event
@return array The ids array | [
"Returns",
"the",
"ids",
"of",
"an",
"key",
"or",
"event"
] | 018742b098c937039909997e005f47201161686f | https://github.com/jeremyFreeAgent/Bitter/blob/018742b098c937039909997e005f47201161686f/src/FreeAgent/Bitter/Bitter.php#L199-L216 |
234,833 | jeremyFreeAgent/Bitter | src/FreeAgent/Bitter/Bitter.php | Bitter.removeAll | public function removeAll()
{
$keys_chunk = array_chunk($this->getRedisClient()->smembers($this->prefixKey . 'keys'), 100);
foreach ($keys_chunk as $keys) {
$this->getRedisClient()->del($keys);
}
return $this;
} | php | public function removeAll()
{
$keys_chunk = array_chunk($this->getRedisClient()->smembers($this->prefixKey . 'keys'), 100);
foreach ($keys_chunk as $keys) {
$this->getRedisClient()->del($keys);
}
return $this;
} | [
"public",
"function",
"removeAll",
"(",
")",
"{",
"$",
"keys_chunk",
"=",
"array_chunk",
"(",
"$",
"this",
"->",
"getRedisClient",
"(",
")",
"->",
"smembers",
"(",
"$",
"this",
"->",
"prefixKey",
".",
"'keys'",
")",
",",
"100",
")",
";",
"foreach",
"("... | Removes all Bitter keys | [
"Removes",
"all",
"Bitter",
"keys"
] | 018742b098c937039909997e005f47201161686f | https://github.com/jeremyFreeAgent/Bitter/blob/018742b098c937039909997e005f47201161686f/src/FreeAgent/Bitter/Bitter.php#L226-L235 |
234,834 | jeremyFreeAgent/Bitter | src/FreeAgent/Bitter/Bitter.php | Bitter.removeTemp | public function removeTemp()
{
$keys_chunk = array_chunk($this->getRedisClient()->smembers($this->prefixTempKey . 'keys'), 100);
foreach ($keys_chunk as $keys) {
$this->getRedisClient()->del($keys);
}
return $this;
} | php | public function removeTemp()
{
$keys_chunk = array_chunk($this->getRedisClient()->smembers($this->prefixTempKey . 'keys'), 100);
foreach ($keys_chunk as $keys) {
$this->getRedisClient()->del($keys);
}
return $this;
} | [
"public",
"function",
"removeTemp",
"(",
")",
"{",
"$",
"keys_chunk",
"=",
"array_chunk",
"(",
"$",
"this",
"->",
"getRedisClient",
"(",
")",
"->",
"smembers",
"(",
"$",
"this",
"->",
"prefixTempKey",
".",
"'keys'",
")",
",",
"100",
")",
";",
"foreach",
... | Removes all Bitter temp keys | [
"Removes",
"all",
"Bitter",
"temp",
"keys"
] | 018742b098c937039909997e005f47201161686f | https://github.com/jeremyFreeAgent/Bitter/blob/018742b098c937039909997e005f47201161686f/src/FreeAgent/Bitter/Bitter.php#L240-L249 |
234,835 | potsky/microsoft-translator-php-sdk | src/MicrosoftTranslator/Http.php | Http.get | public function get($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
{
return $this->doApiCall($url, 'GET', $access_token, $parameters, $contentType);
} | php | public function get($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
{
return $this->doApiCall($url, 'GET', $access_token, $parameters, $contentType);
} | [
"public",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"access_token",
"=",
"null",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"contentType",
"=",
"'text/xml'",
")",
"{",
"return",
"$",
"this",
"->",
"doApiCall",
"(",
"$",
"url",
",",
"'GET'",... | GET API endpoint
@param string $url
@param string|null $access_token
@param array $parameters
@param string $contentType
@return array | [
"GET",
"API",
"endpoint"
] | 102f2411be5abb0e57a73c475f8e9e185a9f4859 | https://github.com/potsky/microsoft-translator-php-sdk/blob/102f2411be5abb0e57a73c475f8e9e185a9f4859/src/MicrosoftTranslator/Http.php#L126-L129 |
234,836 | potsky/microsoft-translator-php-sdk | src/MicrosoftTranslator/Http.php | Http.post | public function post($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
{
return $this->doApiCall($url, 'POST', $access_token, $parameters, $contentType);
} | php | public function post($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
{
return $this->doApiCall($url, 'POST', $access_token, $parameters, $contentType);
} | [
"public",
"function",
"post",
"(",
"$",
"url",
",",
"$",
"access_token",
"=",
"null",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"contentType",
"=",
"'text/xml'",
")",
"{",
"return",
"$",
"this",
"->",
"doApiCall",
"(",
"$",
"url",
",",
"'POST'... | POST API endpoint
@param string $url
@param string|null $access_token
@param string|array $parameters
@param string $contentType
@return array | [
"POST",
"API",
"endpoint"
] | 102f2411be5abb0e57a73c475f8e9e185a9f4859 | https://github.com/potsky/microsoft-translator-php-sdk/blob/102f2411be5abb0e57a73c475f8e9e185a9f4859/src/MicrosoftTranslator/Http.php#L141-L144 |
234,837 | potsky/microsoft-translator-php-sdk | src/MicrosoftTranslator/Http.php | Http.put | public function put($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
{
return $this->doApiCall($url, 'PUT', $access_token, $parameters, $contentType);
} | php | public function put($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
{
return $this->doApiCall($url, 'PUT', $access_token, $parameters, $contentType);
} | [
"public",
"function",
"put",
"(",
"$",
"url",
",",
"$",
"access_token",
"=",
"null",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"contentType",
"=",
"'text/xml'",
")",
"{",
"return",
"$",
"this",
"->",
"doApiCall",
"(",
"$",
"url",
",",
"'PUT'",... | PUT API endpoint
@param string $url
@param string|null $access_token
@param string|array $parameters
@param string $contentType
@return array | [
"PUT",
"API",
"endpoint"
] | 102f2411be5abb0e57a73c475f8e9e185a9f4859 | https://github.com/potsky/microsoft-translator-php-sdk/blob/102f2411be5abb0e57a73c475f8e9e185a9f4859/src/MicrosoftTranslator/Http.php#L156-L159 |
234,838 | potsky/microsoft-translator-php-sdk | src/MicrosoftTranslator/Http.php | Http.delete | public function delete($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
{
return $this->doApiCall($url, 'DELETE', $access_token, $parameters, $contentType);
} | php | public function delete($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
{
return $this->doApiCall($url, 'DELETE', $access_token, $parameters, $contentType);
} | [
"public",
"function",
"delete",
"(",
"$",
"url",
",",
"$",
"access_token",
"=",
"null",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"contentType",
"=",
"'text/xml'",
")",
"{",
"return",
"$",
"this",
"->",
"doApiCall",
"(",
"$",
"url",
",",
"'DEL... | DELETE API endpoint
@param string $url
@param string|null $access_token
@param string|array $parameters
@param string $contentType
@return array | [
"DELETE",
"API",
"endpoint"
] | 102f2411be5abb0e57a73c475f8e9e185a9f4859 | https://github.com/potsky/microsoft-translator-php-sdk/blob/102f2411be5abb0e57a73c475f8e9e185a9f4859/src/MicrosoftTranslator/Http.php#L171-L174 |
234,839 | potsky/microsoft-translator-php-sdk | src/MicrosoftTranslator/Http.php | Http.execCurl | public function execCurl(array $config)
{
$config[CURLOPT_VERBOSE] = false;
$config[CURLOPT_SSL_VERIFYPEER] = false;
$config[CURLOPT_RETURNTRANSFER] = true;
if (defined('CURLOPT_IPRESOLVE')) // PHP5.3
{
$config[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
... | php | public function execCurl(array $config)
{
$config[CURLOPT_VERBOSE] = false;
$config[CURLOPT_SSL_VERIFYPEER] = false;
$config[CURLOPT_RETURNTRANSFER] = true;
if (defined('CURLOPT_IPRESOLVE')) // PHP5.3
{
$config[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
... | [
"public",
"function",
"execCurl",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"config",
"[",
"CURLOPT_VERBOSE",
"]",
"=",
"false",
";",
"$",
"config",
"[",
"CURLOPT_SSL_VERIFYPEER",
"]",
"=",
"false",
";",
"$",
"config",
"[",
"CURLOPT_RETURNTRANSFER",
"]",
... | Execute the request with cURL
Made public for unit tests, you can publicly call it but this method is not really interesting!
@param array $config
@return array | [
"Execute",
"the",
"request",
"with",
"cURL"
] | 102f2411be5abb0e57a73c475f8e9e185a9f4859 | https://github.com/potsky/microsoft-translator-php-sdk/blob/102f2411be5abb0e57a73c475f8e9e185a9f4859/src/MicrosoftTranslator/Http.php#L185-L210 |
234,840 | aimeos/ai-admin-extadm | controller/extjs/src/Controller/ExtJS/Product/Export/Text/Standard.php | Standard.addItem | protected function addItem( \Aimeos\MW\Container\Content\Iface $contentItem, \Aimeos\MShop\Product\Item\Iface $item, $langid )
{
$listTypes = [];
foreach( $item->getListItems( 'text' ) as $listItem ) {
$listTypes[$listItem->getRefId()] = $listItem->getType();
}
foreach( $this->getTextTypes( 'product' ) as ... | php | protected function addItem( \Aimeos\MW\Container\Content\Iface $contentItem, \Aimeos\MShop\Product\Item\Iface $item, $langid )
{
$listTypes = [];
foreach( $item->getListItems( 'text' ) as $listItem ) {
$listTypes[$listItem->getRefId()] = $listItem->getType();
}
foreach( $this->getTextTypes( 'product' ) as ... | [
"protected",
"function",
"addItem",
"(",
"\\",
"Aimeos",
"\\",
"MW",
"\\",
"Container",
"\\",
"Content",
"\\",
"Iface",
"$",
"contentItem",
",",
"\\",
"Aimeos",
"\\",
"MShop",
"\\",
"Product",
"\\",
"Item",
"\\",
"Iface",
"$",
"item",
",",
"$",
"langid",... | Adds all texts belonging to an product item.
@param \Aimeos\MW\Container\Content\Iface $contentItem Content item
@param \Aimeos\MShop\Product\Item\Iface $item product item object
@param string $langid Language id | [
"Adds",
"all",
"texts",
"belonging",
"to",
"an",
"product",
"item",
"."
] | 594ee7cec90fd63a4773c05c93f353e66d9b3408 | https://github.com/aimeos/ai-admin-extadm/blob/594ee7cec90fd63a4773c05c93f353e66d9b3408/controller/extjs/src/Controller/ExtJS/Product/Export/Text/Standard.php#L315-L351 |
234,841 | makinacorpus/drupal-ucms | ucms_tree/src/Datasource/TreeAdminDatasource.php | TreeAdminDatasource.getWebmasterSites | private function getWebmasterSites()
{
$ret = [];
foreach ($this->siteManager->loadWebmasterSites($this->account) as $site) {
$ret[$site->getId()] = check_plain($site->title);
}
return $ret;
} | php | private function getWebmasterSites()
{
$ret = [];
foreach ($this->siteManager->loadWebmasterSites($this->account) as $site) {
$ret[$site->getId()] = check_plain($site->title);
}
return $ret;
} | [
"private",
"function",
"getWebmasterSites",
"(",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"siteManager",
"->",
"loadWebmasterSites",
"(",
"$",
"this",
"->",
"account",
")",
"as",
"$",
"site",
")",
"{",
"$",
"ret",
... | Get current account sites he's webmaster on
@return string[] | [
"Get",
"current",
"account",
"sites",
"he",
"s",
"webmaster",
"on"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_tree/src/Datasource/TreeAdminDatasource.php#L40-L49 |
234,842 | scriptotek/php-oai-pmh-client | src/Client.php | Client.urlBuilder | public function urlBuilder($verb, $arguments = array())
{
$qs = array(
'verb' => $verb,
'metadataPrefix' => $this->schema,
);
foreach ($arguments as $key => $value) {
$qs[$key] = $value;
if (is_null($value)) {
// Allow removal ... | php | public function urlBuilder($verb, $arguments = array())
{
$qs = array(
'verb' => $verb,
'metadataPrefix' => $this->schema,
);
foreach ($arguments as $key => $value) {
$qs[$key] = $value;
if (is_null($value)) {
// Allow removal ... | [
"public",
"function",
"urlBuilder",
"(",
"$",
"verb",
",",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"$",
"qs",
"=",
"array",
"(",
"'verb'",
"=>",
"$",
"verb",
",",
"'metadataPrefix'",
"=>",
"$",
"this",
"->",
"schema",
",",
")",
";",
"fo... | Construct the URL for an OAI-PMH query
@param string $verb The OAI-PMH verb
@param array $arguments OAI-PMH arguments
@return string | [
"Construct",
"the",
"URL",
"for",
"an",
"OAI",
"-",
"PMH",
"query"
] | c1da394ccad86962d0f1c2bc120152092e4c1c88 | https://github.com/scriptotek/php-oai-pmh-client/blob/c1da394ccad86962d0f1c2bc120152092e4c1c88/src/Client.php#L125-L141 |
234,843 | scriptotek/php-oai-pmh-client | src/Client.php | Client.request | public function request($verb, $arguments)
{
$this->emit('request.start', array(
'verb' => $verb,
'arguments' => $arguments
));
$url = $this->urlBuilder($verb, $arguments);
$attempt = 0;
while (true) {
try {
$res = $this->ht... | php | public function request($verb, $arguments)
{
$this->emit('request.start', array(
'verb' => $verb,
'arguments' => $arguments
));
$url = $this->urlBuilder($verb, $arguments);
$attempt = 0;
while (true) {
try {
$res = $this->ht... | [
"public",
"function",
"request",
"(",
"$",
"verb",
",",
"$",
"arguments",
")",
"{",
"$",
"this",
"->",
"emit",
"(",
"'request.start'",
",",
"array",
"(",
"'verb'",
"=>",
"$",
"verb",
",",
"'arguments'",
"=>",
"$",
"arguments",
")",
")",
";",
"$",
"ur... | Perform a single OAI-PMH request
@param string $verb The OAI-PMH verb
@param array $arguments OAI-PMH arguments
@return string
@throws ConnectionError | [
"Perform",
"a",
"single",
"OAI",
"-",
"PMH",
"request"
] | c1da394ccad86962d0f1c2bc120152092e4c1c88 | https://github.com/scriptotek/php-oai-pmh-client/blob/c1da394ccad86962d0f1c2bc120152092e4c1c88/src/Client.php#L151-L188 |
234,844 | scriptotek/php-oai-pmh-client | src/Client.php | Client.records | public function records($from, $until, $set, $resumptionToken = null, $extraParams = array())
{
return new Records($from, $until, $set, $this, $resumptionToken, $extraParams);
} | php | public function records($from, $until, $set, $resumptionToken = null, $extraParams = array())
{
return new Records($from, $until, $set, $this, $resumptionToken, $extraParams);
} | [
"public",
"function",
"records",
"(",
"$",
"from",
",",
"$",
"until",
",",
"$",
"set",
",",
"$",
"resumptionToken",
"=",
"null",
",",
"$",
"extraParams",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Records",
"(",
"$",
"from",
",",
"$",
"unt... | Perform a ListRecords request and return an iterator over the records
@param string $from Start date
@param string $until End date
@param string $set Data set
@param string $resumptionToken To resume a harvest
@param array $extraParams Extra GET parameters
@return Records | [
"Perform",
"a",
"ListRecords",
"request",
"and",
"return",
"an",
"iterator",
"over",
"the",
"records"
] | c1da394ccad86962d0f1c2bc120152092e4c1c88 | https://github.com/scriptotek/php-oai-pmh-client/blob/c1da394ccad86962d0f1c2bc120152092e4c1c88/src/Client.php#L212-L215 |
234,845 | fintech-fab/bank-emulator | src/controllers/DemoController.php | DemoController.term | public function term()
{
$terminal = Terminal::whereUserId($this->userId())->first();
if (!$terminal) {
$terminal = new Terminal;
$terminal->user_id = $this->userId();
$terminal->secret = md5($terminal->user_id . time() . uniqid());
$terminal->mode = Terminal::C_STATE_OFFLINE;
$terminal->save();
}... | php | public function term()
{
$terminal = Terminal::whereUserId($this->userId())->first();
if (!$terminal) {
$terminal = new Terminal;
$terminal->user_id = $this->userId();
$terminal->secret = md5($terminal->user_id . time() . uniqid());
$terminal->mode = Terminal::C_STATE_OFFLINE;
$terminal->save();
}... | [
"public",
"function",
"term",
"(",
")",
"{",
"$",
"terminal",
"=",
"Terminal",
"::",
"whereUserId",
"(",
"$",
"this",
"->",
"userId",
"(",
")",
")",
"->",
"first",
"(",
")",
";",
"if",
"(",
"!",
"$",
"terminal",
")",
"{",
"$",
"terminal",
"=",
"n... | Terminal info
auto-create new term if not exists | [
"Terminal",
"info",
"auto",
"-",
"create",
"new",
"term",
"if",
"not",
"exists"
] | 6256be98509de0ff8e96b5683a0b0197acd67b9e | https://github.com/fintech-fab/bank-emulator/blob/6256be98509de0ff8e96b5683a0b0197acd67b9e/src/controllers/DemoController.php#L52-L64 |
234,846 | fintech-fab/bank-emulator | src/controllers/DemoController.php | DemoController.postTerm | public function postTerm()
{
$terminal = Terminal::whereUserId($this->userId())->first();
$inputs = Input::get('input');
if (empty($inputs['url'])) {
$inputs['url'] = '';
}
if (empty($inputs['email'])) {
$inputs['email'] = '';
}
$validator = Validator::make(
$inputs,
array(
'url' => '... | php | public function postTerm()
{
$terminal = Terminal::whereUserId($this->userId())->first();
$inputs = Input::get('input');
if (empty($inputs['url'])) {
$inputs['url'] = '';
}
if (empty($inputs['email'])) {
$inputs['email'] = '';
}
$validator = Validator::make(
$inputs,
array(
'url' => '... | [
"public",
"function",
"postTerm",
"(",
")",
"{",
"$",
"terminal",
"=",
"Terminal",
"::",
"whereUserId",
"(",
"$",
"this",
"->",
"userId",
"(",
")",
")",
"->",
"first",
"(",
")",
";",
"$",
"inputs",
"=",
"Input",
"::",
"get",
"(",
"'input'",
")",
";... | Change term options
@return string | [
"Change",
"term",
"options"
] | 6256be98509de0ff8e96b5683a0b0197acd67b9e | https://github.com/fintech-fab/bank-emulator/blob/6256be98509de0ff8e96b5683a0b0197acd67b9e/src/controllers/DemoController.php#L71-L101 |
234,847 | fintech-fab/bank-emulator | src/controllers/DemoController.php | DemoController.sign | public function sign()
{
$type = Input::get('type');
$input = Input::get('input');
$termId = $input['term'];
$term = Terminal::find($termId);
$input = Type::clearInput($type, $input);
Secure::sign($input, $type, $term->secret);
return $input['sign'];
} | php | public function sign()
{
$type = Input::get('type');
$input = Input::get('input');
$termId = $input['term'];
$term = Terminal::find($termId);
$input = Type::clearInput($type, $input);
Secure::sign($input, $type, $term->secret);
return $input['sign'];
} | [
"public",
"function",
"sign",
"(",
")",
"{",
"$",
"type",
"=",
"Input",
"::",
"get",
"(",
"'type'",
")",
";",
"$",
"input",
"=",
"Input",
"::",
"get",
"(",
"'input'",
")",
";",
"$",
"termId",
"=",
"$",
"input",
"[",
"'term'",
"]",
";",
"$",
"te... | Create signature for payment form | [
"Create",
"signature",
"for",
"payment",
"form"
] | 6256be98509de0ff8e96b5683a0b0197acd67b9e | https://github.com/fintech-fab/bank-emulator/blob/6256be98509de0ff8e96b5683a0b0197acd67b9e/src/controllers/DemoController.php#L114-L126 |
234,848 | fintech-fab/bank-emulator | src/controllers/DemoController.php | DemoController.callback | public function callback()
{
Log::info('callback.url.pull', array(
'message' => 'Request callback url',
'rawInput' => Input::all(),
));
$input = $this->getVerifiedInput('callback', Input::get('type'), Input::all(), true);
if ($input) {
// your business processing
}
} | php | public function callback()
{
Log::info('callback.url.pull', array(
'message' => 'Request callback url',
'rawInput' => Input::all(),
));
$input = $this->getVerifiedInput('callback', Input::get('type'), Input::all(), true);
if ($input) {
// your business processing
}
} | [
"public",
"function",
"callback",
"(",
")",
"{",
"Log",
"::",
"info",
"(",
"'callback.url.pull'",
",",
"array",
"(",
"'message'",
"=>",
"'Request callback url'",
",",
"'rawInput'",
"=>",
"Input",
"::",
"all",
"(",
")",
",",
")",
")",
";",
"$",
"input",
"... | Pull payment callbacks | [
"Pull",
"payment",
"callbacks"
] | 6256be98509de0ff8e96b5683a0b0197acd67b9e | https://github.com/fintech-fab/bank-emulator/blob/6256be98509de0ff8e96b5683a0b0197acd67b9e/src/controllers/DemoController.php#L131-L144 |
234,849 | fintech-fab/bank-emulator | src/controllers/DemoController.php | DemoController.shop | public function shop()
{
$terminal = Terminal::whereUserId($this->userId())->first();
$endpointParams = $this->getEndpointFields($terminal);
$status = Input::get('resultBankEmulatorPayment');
$statusSuccess = ($status === 'success');
$statusError = ($status === 'error');
$this->make('shop', compact(
... | php | public function shop()
{
$terminal = Terminal::whereUserId($this->userId())->first();
$endpointParams = $this->getEndpointFields($terminal);
$status = Input::get('resultBankEmulatorPayment');
$statusSuccess = ($status === 'success');
$statusError = ($status === 'error');
$this->make('shop', compact(
... | [
"public",
"function",
"shop",
"(",
")",
"{",
"$",
"terminal",
"=",
"Terminal",
"::",
"whereUserId",
"(",
"$",
"this",
"->",
"userId",
"(",
")",
")",
"->",
"first",
"(",
")",
";",
"$",
"endpointParams",
"=",
"$",
"this",
"->",
"getEndpointFields",
"(",
... | E-shop order page | [
"E",
"-",
"shop",
"order",
"page"
] | 6256be98509de0ff8e96b5683a0b0197acd67b9e | https://github.com/fintech-fab/bank-emulator/blob/6256be98509de0ff8e96b5683a0b0197acd67b9e/src/controllers/DemoController.php#L451-L468 |
234,850 | makinacorpus/drupal-ucms | ucms_list/src/Impl/TypeContentListWidget.php | TypeContentListWidget.getContentTagsList | protected function getContentTagsList()
{
$ret = [];
if (!$this->labelManager) {
return;
}
$tagList = $this->labelManager->loadAllLabels();
if ($tagList) {
foreach ($tagList as $tag) {
$ret[$tag->tid] = $tag->name;
}
... | php | protected function getContentTagsList()
{
$ret = [];
if (!$this->labelManager) {
return;
}
$tagList = $this->labelManager->loadAllLabels();
if ($tagList) {
foreach ($tagList as $tag) {
$ret[$tag->tid] = $tag->name;
}
... | [
"protected",
"function",
"getContentTagsList",
"(",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"labelManager",
")",
"{",
"return",
";",
"}",
"$",
"tagList",
"=",
"$",
"this",
"->",
"labelManager",
"->",
"loadAllLabels"... | Get allowed tags list. | [
"Get",
"allowed",
"tags",
"list",
"."
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_list/src/Impl/TypeContentListWidget.php#L114-L131 |
234,851 | mosbth/Anax-MVC | src/TConfigure.php | TConfigure.configure | public function configure($what)
{
if (is_array($what)) {
$options = $what;
} elseif (is_readable($what)) {
$options = include $what;
} else {
throw new Exception("Configure item '" . htmlentities($what)
. "' is not an array nor a readable ... | php | public function configure($what)
{
if (is_array($what)) {
$options = $what;
} elseif (is_readable($what)) {
$options = include $what;
} else {
throw new Exception("Configure item '" . htmlentities($what)
. "' is not an array nor a readable ... | [
"public",
"function",
"configure",
"(",
"$",
"what",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"what",
")",
")",
"{",
"$",
"options",
"=",
"$",
"what",
";",
"}",
"elseif",
"(",
"is_readable",
"(",
"$",
"what",
")",
")",
"{",
"$",
"options",
"=",... | Read configuration from file or array'.
@param array/string $what is an array with key/value config options or a file
to be included which returns such an array.
@return $this for chaining.
@throws Exception | [
"Read",
"configuration",
"from",
"file",
"or",
"array",
"."
] | 5574d105bcec9df8e57532a321585f6521b4581c | https://github.com/mosbth/Anax-MVC/blob/5574d105bcec9df8e57532a321585f6521b4581c/src/TConfigure.php#L27-L40 |
234,852 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.getMultiRepositoryPath | protected function getMultiRepositoryPath($path)
{
if ($this->isPathOfMultiRepository($path)) {
return $path;
}
$packageDir = pathinfo($path, PATHINFO_BASENAME);
if (!strpos($packageDir, self::MULTI_REPO_DELIMITER)) {
//package cannot be used in multi-repo
... | php | protected function getMultiRepositoryPath($path)
{
if ($this->isPathOfMultiRepository($path)) {
return $path;
}
$packageDir = pathinfo($path, PATHINFO_BASENAME);
if (!strpos($packageDir, self::MULTI_REPO_DELIMITER)) {
//package cannot be used in multi-repo
... | [
"protected",
"function",
"getMultiRepositoryPath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isPathOfMultiRepository",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"path",
";",
"}",
"$",
"packageDir",
"=",
"pathinfo",
"(",
"$",
"path"... | Get multi repository directory path
@param string $path
@return string | [
"Get",
"multi",
"repository",
"directory",
"path"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L85-L124 |
234,853 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.getParentMultiRepoDir | protected function getParentMultiRepoDir()
{
$rootConfig = $this->config->get('root_extra_config');
if (!empty($rootConfig[self::KEY_MULTI_REPO_PARENT_DIR])) {
$rootConfig[self::KEY_MULTI_REPO_PARENT_DIR] = rtrim($rootConfig[self::KEY_MULTI_REPO_PARENT_DIR], '\\/');
if ($this... | php | protected function getParentMultiRepoDir()
{
$rootConfig = $this->config->get('root_extra_config');
if (!empty($rootConfig[self::KEY_MULTI_REPO_PARENT_DIR])) {
$rootConfig[self::KEY_MULTI_REPO_PARENT_DIR] = rtrim($rootConfig[self::KEY_MULTI_REPO_PARENT_DIR], '\\/');
if ($this... | [
"protected",
"function",
"getParentMultiRepoDir",
"(",
")",
"{",
"$",
"rootConfig",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'root_extra_config'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"rootConfig",
"[",
"self",
"::",
"KEY_MULTI_REPO_PAREN... | Get custom parent multi repository directory
@return string|null | [
"Get",
"custom",
"parent",
"multi",
"repository",
"directory"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L131-L148 |
234,854 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.copyFilesToDefaultPath | protected function copyFilesToDefaultPath($source)
{
$target = $this->defaultPath;
if (!$target || $target == $source) {
return $this;
}
if (is_file($source)) {
//copy file
copy($source, $target);
return $this;
}
$it =... | php | protected function copyFilesToDefaultPath($source)
{
$target = $this->defaultPath;
if (!$target || $target == $source) {
return $this;
}
if (is_file($source)) {
//copy file
copy($source, $target);
return $this;
}
$it =... | [
"protected",
"function",
"copyFilesToDefaultPath",
"(",
"$",
"source",
")",
"{",
"$",
"target",
"=",
"$",
"this",
"->",
"defaultPath",
";",
"if",
"(",
"!",
"$",
"target",
"||",
"$",
"target",
"==",
"$",
"source",
")",
"{",
"return",
"$",
"this",
";",
... | Copy files to default package directory
@param $source
@return $this | [
"Copy",
"files",
"to",
"default",
"package",
"directory"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L156-L190 |
234,855 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.doDownload | public function doDownload(PackageInterface $package, $path, $url)
{
GitUtil::cleanEnv();
$path = $this->normalizePath($path);
if (!$this->isRequiredRepository($path, $url)) {
throw new FilesystemException('Unknown repository installed into ' . $path);
}
$ref = ... | php | public function doDownload(PackageInterface $package, $path, $url)
{
GitUtil::cleanEnv();
$path = $this->normalizePath($path);
if (!$this->isRequiredRepository($path, $url)) {
throw new FilesystemException('Unknown repository installed into ' . $path);
}
$ref = ... | [
"public",
"function",
"doDownload",
"(",
"PackageInterface",
"$",
"package",
",",
"$",
"path",
",",
"$",
"url",
")",
"{",
"GitUtil",
"::",
"cleanEnv",
"(",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"normalizePath",
"(",
"$",
"path",
")",
";",
"i... | Downloads specific package into specific folder
VCS repository will be created in a separated folder.
@param PackageInterface $package
@param string $path
@param string $url
@throws FilesystemException | [
"Downloads",
"specific",
"package",
"into",
"specific",
"folder"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L202-L232 |
234,856 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.initGitUtil | protected function initGitUtil()
{
$this->gitUtil = new GitUtil($this->io, $this->config, $this->process, $this->filesystem);
return $this;
} | php | protected function initGitUtil()
{
$this->gitUtil = new GitUtil($this->io, $this->config, $this->process, $this->filesystem);
return $this;
} | [
"protected",
"function",
"initGitUtil",
"(",
")",
"{",
"$",
"this",
"->",
"gitUtil",
"=",
"new",
"GitUtil",
"(",
"$",
"this",
"->",
"io",
",",
"$",
"this",
"->",
"config",
",",
"$",
"this",
"->",
"process",
",",
"$",
"this",
"->",
"filesystem",
")",
... | Init GitUtil object
@return $this | [
"Init",
"GitUtil",
"object"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L257-L261 |
234,857 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.getCloneCommandCallback | protected function getCloneCommandCallback($path, $ref, $command)
{
return function ($url) use ($ref, $path, $command) {
return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($path), ProcessExecutor::escape($ref));
};
} | php | protected function getCloneCommandCallback($path, $ref, $command)
{
return function ($url) use ($ref, $path, $command) {
return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($path), ProcessExecutor::escape($ref));
};
} | [
"protected",
"function",
"getCloneCommandCallback",
"(",
"$",
"path",
",",
"$",
"ref",
",",
"$",
"command",
")",
"{",
"return",
"function",
"(",
"$",
"url",
")",
"use",
"(",
"$",
"ref",
",",
"$",
"path",
",",
"$",
"command",
")",
"{",
"return",
"spri... | Get command callback for cloning
@param string $path
@param string $ref
@param string $command
@return callable | [
"Get",
"command",
"callback",
"for",
"cloning"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L280-L285 |
234,858 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.fetchRepositoryUpdates | protected function fetchRepositoryUpdates(PackageInterface $package, $path, $url)
{
/**
* Copy-pasted from doUpdate
*
* @see GitDownloader::doUpdate()
*/
$this->io->write(' Checking out ' . $package->getSourceReference());
$command = $this->getFetchComm... | php | protected function fetchRepositoryUpdates(PackageInterface $package, $path, $url)
{
/**
* Copy-pasted from doUpdate
*
* @see GitDownloader::doUpdate()
*/
$this->io->write(' Checking out ' . $package->getSourceReference());
$command = $this->getFetchComm... | [
"protected",
"function",
"fetchRepositoryUpdates",
"(",
"PackageInterface",
"$",
"package",
",",
"$",
"path",
",",
"$",
"url",
")",
"{",
"/**\n * Copy-pasted from doUpdate\n *\n * @see GitDownloader::doUpdate()\n */",
"$",
"this",
"->",
"io",
"... | Fetch remote VCS repository updates
@param PackageInterface $package
@param string $path
@param string $url
@return $this | [
"Fetch",
"remote",
"VCS",
"repository",
"updates"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L305-L319 |
234,859 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.isRequiredRepository | protected function isRequiredRepository($path, $url)
{
if ($this->isMultiRepository() && $this->isRepositoryCloned($path)) {
$this->process->execute(sprintf('git config --get remote.origin.url'), $output, $path);
return $url == trim($output);
}
return true; //empty di... | php | protected function isRequiredRepository($path, $url)
{
if ($this->isMultiRepository() && $this->isRepositoryCloned($path)) {
$this->process->execute(sprintf('git config --get remote.origin.url'), $output, $path);
return $url == trim($output);
}
return true; //empty di... | [
"protected",
"function",
"isRequiredRepository",
"(",
"$",
"path",
",",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isMultiRepository",
"(",
")",
"&&",
"$",
"this",
"->",
"isRepositoryCloned",
"(",
"$",
"path",
")",
")",
"{",
"$",
"this",
"->"... | Check mismatch of exists repository URL in remote origin
@param string $path
@param string $url
@return bool | [
"Check",
"mismatch",
"of",
"exists",
"repository",
"URL",
"in",
"remote",
"origin"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L361-L368 |
234,860 | andkirby/multi-repo-composer | src/Downloader/GitMultiRepoDownloader.php | GitMultiRepoDownloader.cleanUpDir | protected function cleanUpDir($directory)
{
$this->filesystem->removeDirectory($directory);
$this->filesystem->ensureDirectoryExists($directory);
return $this;
} | php | protected function cleanUpDir($directory)
{
$this->filesystem->removeDirectory($directory);
$this->filesystem->ensureDirectoryExists($directory);
return $this;
} | [
"protected",
"function",
"cleanUpDir",
"(",
"$",
"directory",
")",
"{",
"$",
"this",
"->",
"filesystem",
"->",
"removeDirectory",
"(",
"$",
"directory",
")",
";",
"$",
"this",
"->",
"filesystem",
"->",
"ensureDirectoryExists",
"(",
"$",
"directory",
")",
";"... | Clean up directory
@param string $directory
@return $this | [
"Clean",
"up",
"directory"
] | 2d9fed02edf7601f56f2998f9d99e646b713aef6 | https://github.com/andkirby/multi-repo-composer/blob/2d9fed02edf7601f56f2998f9d99e646b713aef6/src/Downloader/GitMultiRepoDownloader.php#L386-L391 |
234,861 | runcmf/runbb | src/RunBB/Core/Statical/Manager.php | Manager.addProxyService | public function addProxyService($alias, $proxy, $container, $id = null, $namespace = null)
{
$proxy = Input::checkNamespace($proxy);
$container = Input::checkContainer($container);
$id = $id ?: strtolower($alias);
$this->addProxy($proxy, $id, $container);
$this->aliasManager... | php | public function addProxyService($alias, $proxy, $container, $id = null, $namespace = null)
{
$proxy = Input::checkNamespace($proxy);
$container = Input::checkContainer($container);
$id = $id ?: strtolower($alias);
$this->addProxy($proxy, $id, $container);
$this->aliasManager... | [
"public",
"function",
"addProxyService",
"(",
"$",
"alias",
",",
"$",
"proxy",
",",
"$",
"container",
",",
"$",
"id",
"=",
"null",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"proxy",
"=",
"Input",
"::",
"checkNamespace",
"(",
"$",
"proxy",
")... | Adds a service as a proxy target
If $id is null then the lower-cased alias will be used.
@param string $alias The statical name you call
@param string $proxy The namespaced proxy class
@param mixed $container Reference to a container
@param mixed $id The id of the target in the container
@param mixed $namespace Optio... | [
"Adds",
"a",
"service",
"as",
"a",
"proxy",
"target"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Core/Statical/Manager.php#L99-L111 |
234,862 | runcmf/runbb | src/RunBB/Core/Statical/Manager.php | Manager.addProxyInstance | public function addProxyInstance($alias, $proxy, $target, $namespace = null)
{
$proxy = Input::checkNamespace($proxy);
if (!is_object($target)) {
throw new \InvalidArgumentException('Target must be an instance or closure.');
}
$this->addProxy($proxy, null, $target);
... | php | public function addProxyInstance($alias, $proxy, $target, $namespace = null)
{
$proxy = Input::checkNamespace($proxy);
if (!is_object($target)) {
throw new \InvalidArgumentException('Target must be an instance or closure.');
}
$this->addProxy($proxy, null, $target);
... | [
"public",
"function",
"addProxyInstance",
"(",
"$",
"alias",
",",
"$",
"proxy",
",",
"$",
"target",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"proxy",
"=",
"Input",
"::",
"checkNamespace",
"(",
"$",
"proxy",
")",
";",
"if",
"(",
"!",
"is_obj... | Adds an instance or closure as a proxy target
@param string $alias The statical name you call
@param string $proxy The namespaced proxy class
@param mixed $target The target instance or closure
@param mixed $namespace Optional namespace | [
"Adds",
"an",
"instance",
"or",
"closure",
"as",
"a",
"proxy",
"target"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Core/Statical/Manager.php#L121-L135 |
234,863 | runcmf/runbb | src/RunBB/Core/Statical/Manager.php | Manager.addNamespaceGroup | public function addNamespaceGroup($group, $alias, $namespace = null)
{
$namespace = Input::formatNamespace($namespace, $group);
$this->aliasManager->addNamespace($alias, $namespace);
} | php | public function addNamespaceGroup($group, $alias, $namespace = null)
{
$namespace = Input::formatNamespace($namespace, $group);
$this->aliasManager->addNamespace($alias, $namespace);
} | [
"public",
"function",
"addNamespaceGroup",
"(",
"$",
"group",
",",
"$",
"alias",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"namespace",
"=",
"Input",
"::",
"formatNamespace",
"(",
"$",
"namespace",
",",
"$",
"group",
")",
";",
"$",
"this",
"->... | Adds a namespace group for a single, or all aliases
The $alias can either be a single value or the wildcard '*' value, which
allows any registered alias in the namespace.
The group can be one of the following:
'name' - the alias can be called in the $namespace
'path' - the alias can be called in the $namespace and... | [
"Adds",
"a",
"namespace",
"group",
"for",
"a",
"single",
"or",
"all",
"aliases"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Core/Statical/Manager.php#L178-L182 |
234,864 | NicolasMahe/Laravel-SlackOutput | src/Library/JobFailed.php | JobFailed.output | static public function output(JB $event, $channel)
{
$message = "Job '" . $event->job->getName() . "' failed.";
Artisan::call('slack:post', [
'to' => $channel,
'message' => $message
]);
} | php | static public function output(JB $event, $channel)
{
$message = "Job '" . $event->job->getName() . "' failed.";
Artisan::call('slack:post', [
'to' => $channel,
'message' => $message
]);
} | [
"static",
"public",
"function",
"output",
"(",
"JB",
"$",
"event",
",",
"$",
"channel",
")",
"{",
"$",
"message",
"=",
"\"Job '\"",
".",
"$",
"event",
"->",
"job",
"->",
"getName",
"(",
")",
".",
"\"' failed.\"",
";",
"Artisan",
"::",
"call",
"(",
"'... | Output a failed job to slack
@param JB $event
@param $channel | [
"Output",
"a",
"failed",
"job",
"to",
"slack"
] | fc3722ba64a0ce4d833555bb1a27513e13959b34 | https://github.com/NicolasMahe/Laravel-SlackOutput/blob/fc3722ba64a0ce4d833555bb1a27513e13959b34/src/Library/JobFailed.php#L17-L24 |
234,865 | artkonekt/gears | src/Repository/PreferenceRepository.php | PreferenceRepository.get | public function get($key, $user = null)
{
$preference = $this->getPreferenceOrFail($key);
$value = $this->backend->getPreference($key, $this->getUserId($user));
return is_null($value) ? $preference->default() : $value;
} | php | public function get($key, $user = null)
{
$preference = $this->getPreferenceOrFail($key);
$value = $this->backend->getPreference($key, $this->getUserId($user));
return is_null($value) ? $preference->default() : $value;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"preference",
"=",
"$",
"this",
"->",
"getPreferenceOrFail",
"(",
"$",
"key",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"backend",
"->",
"getPreference"... | Returns the value of a preference
@param string $key
@param int|Authenticatable|null $user
@return mixed
@throws UnregisteredPreferenceException | [
"Returns",
"the",
"value",
"of",
"a",
"preference"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Repository/PreferenceRepository.php#L48-L55 |
234,866 | artkonekt/gears | src/Repository/PreferenceRepository.php | PreferenceRepository.set | public function set($key, $value, $user = null)
{
$this->getPreferenceOrFail($key);
$this->backend->setPreference($key, $value, $this->getUserId($user));
} | php | public function set($key, $value, $user = null)
{
$this->getPreferenceOrFail($key);
$this->backend->setPreference($key, $value, $this->getUserId($user));
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getPreferenceOrFail",
"(",
"$",
"key",
")",
";",
"$",
"this",
"->",
"backend",
"->",
"setPreference",
"(",
"$",
"key",
","... | Updates the value of a preference
@param string $key
@param mixed $value
@param int|Authenticatable|null $user
@throws UnregisteredPreferenceException | [
"Updates",
"the",
"value",
"of",
"a",
"preference"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Repository/PreferenceRepository.php#L65-L70 |
234,867 | artkonekt/gears | src/Repository/PreferenceRepository.php | PreferenceRepository.forget | public function forget($key, $user = null)
{
$this->getPreferenceOrFail($key);
$this->backend->removePreference($key, $this->getUserId($user));
} | php | public function forget($key, $user = null)
{
$this->getPreferenceOrFail($key);
$this->backend->removePreference($key, $this->getUserId($user));
} | [
"public",
"function",
"forget",
"(",
"$",
"key",
",",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getPreferenceOrFail",
"(",
"$",
"key",
")",
";",
"$",
"this",
"->",
"backend",
"->",
"removePreference",
"(",
"$",
"key",
",",
"$",
"this",
... | Deletes the value of a preference
@param string $key
@param int|Authenticatable|null $user
@throws UnregisteredPreferenceException | [
"Deletes",
"the",
"value",
"of",
"a",
"preference"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Repository/PreferenceRepository.php#L79-L84 |
234,868 | artkonekt/gears | src/Repository/PreferenceRepository.php | PreferenceRepository.update | public function update(array $preferences, $user = null)
{
foreach ($preferences as $key => $value) {
$this->getPreferenceOrFail($key);
}
$this->backend->setPreferences($preferences, $this->getUserId($user));
} | php | public function update(array $preferences, $user = null)
{
foreach ($preferences as $key => $value) {
$this->getPreferenceOrFail($key);
}
$this->backend->setPreferences($preferences, $this->getUserId($user));
} | [
"public",
"function",
"update",
"(",
"array",
"$",
"preferences",
",",
"$",
"user",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"preferences",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"getPreferenceOrFail",
"(",
"$",
"key",
... | Update multiple preferences at once. It's OK to pass preferences that have no saved values yet
@param array $preferences Pass key/value pairs
@param int|Authenticatable|null $user
@throws UnregisteredPreferenceException | [
"Update",
"multiple",
"preferences",
"at",
"once",
".",
"It",
"s",
"OK",
"to",
"pass",
"preferences",
"that",
"have",
"no",
"saved",
"values",
"yet"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Repository/PreferenceRepository.php#L108-L115 |
234,869 | artkonekt/gears | src/Repository/PreferenceRepository.php | PreferenceRepository.reset | public function reset(array $keys, $user = null)
{
foreach ($keys as $key) {
$this->getPreferenceOrFail($key);
}
$this->backend->removePreferences($keys, $this->getUserId($user));
} | php | public function reset(array $keys, $user = null)
{
foreach ($keys as $key) {
$this->getPreferenceOrFail($key);
}
$this->backend->removePreferences($keys, $this->getUserId($user));
} | [
"public",
"function",
"reset",
"(",
"array",
"$",
"keys",
",",
"$",
"user",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"getPreferenceOrFail",
"(",
"$",
"key",
")",
";",
"}",
"$",
"this",
"->... | Reset values of multiple preferences at once.
@param array $keys Pass an array of keys
@param int|Authenticatable|null $user
@throws UnregisteredPreferenceException | [
"Reset",
"values",
"of",
"multiple",
"preferences",
"at",
"once",
"."
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Repository/PreferenceRepository.php#L124-L131 |
234,870 | artkonekt/gears | src/Repository/PreferenceRepository.php | PreferenceRepository.getPreferenceOrFail | protected function getPreferenceOrFail(string $key)
{
if (!$this->registry->has($key)) {
throw new UnregisteredPreferenceException(
sprintf(
'There\'s no setting registered with key `%s`',
$key
)
);
}
... | php | protected function getPreferenceOrFail(string $key)
{
if (!$this->registry->has($key)) {
throw new UnregisteredPreferenceException(
sprintf(
'There\'s no setting registered with key `%s`',
$key
)
);
}
... | [
"protected",
"function",
"getPreferenceOrFail",
"(",
"string",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"registry",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"UnregisteredPreferenceException",
"(",
"sprintf",
"(",
"'There... | Returns the preference registered with the given key and throws an exception if not found
@param string $key
@return \Konekt\Gears\Contracts\Preference
@throws UnregisteredPreferenceException | [
"Returns",
"the",
"preference",
"registered",
"with",
"the",
"given",
"key",
"and",
"throws",
"an",
"exception",
"if",
"not",
"found"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Repository/PreferenceRepository.php#L152-L164 |
234,871 | shopgate/cart-integration-sdk | src/helper/error_handling/ErrorHandler.php | Shopgate_Helper_Error_Handling_ErrorHandler.handle | public function handle(
$severity,
$message,
$file,
$line = -1,
/** @noinspection PhpUnusedParameterInspection */
array $context = array()
) {
// on error supression with '@' do not log
if ($severity === 0) {
return $this->skipInternalError... | php | public function handle(
$severity,
$message,
$file,
$line = -1,
/** @noinspection PhpUnusedParameterInspection */
array $context = array()
) {
// on error supression with '@' do not log
if ($severity === 0) {
return $this->skipInternalError... | [
"public",
"function",
"handle",
"(",
"$",
"severity",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"line",
"=",
"-",
"1",
",",
"/** @noinspection PhpUnusedParameterInspection */",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"// on error su... | Handles non-fatal errors.
This will generate a stack trace and log it to the error log on any error it receives, unless the line in which
the error occured was prefixed with an '@'.
Severity of errors being logged depends on how this handler was set using set_error_handler() and types E_ERROR
E_PARSE, E_CORE_ERROR, E... | [
"Handles",
"non",
"-",
"fatal",
"errors",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/helper/error_handling/ErrorHandler.php#L83-L105 |
234,872 | tremendus/amazon-mws | src/MarketplaceWebServiceOrders/Client.php | MarketplaceWebServiceOrders_Client.getServiceStatus | public function getServiceStatus($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_GetServiceStatusRequest)) {
// // require_once (dirname(__FILE__) . '/Model/GetServiceStatusRequest.php');
$request = new MarketplaceWebServiceOrders_Model_GetServiceStatusRequest... | php | public function getServiceStatus($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_GetServiceStatusRequest)) {
// // require_once (dirname(__FILE__) . '/Model/GetServiceStatusRequest.php');
$request = new MarketplaceWebServiceOrders_Model_GetServiceStatusRequest... | [
"public",
"function",
"getServiceStatus",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"request",
"instanceof",
"MarketplaceWebServiceOrders_Model_GetServiceStatusRequest",
")",
")",
"{",
"// // require_once (dirname(__FILE__) . '/Model/GetServiceStatusRequest.php')... | Get Service Status
Returns the service status of a particular MWS API section. The operation
takes no input.
@param mixed $request array of parameters for MarketplaceWebServiceOrders_Model_GetServiceStatus request or MarketplaceWebServiceOrders_Model_GetServiceStatus object itself
@see MarketplaceWebServiceOrders_Mode... | [
"Get",
"Service",
"Status",
"Returns",
"the",
"service",
"status",
"of",
"a",
"particular",
"MWS",
"API",
"section",
".",
"The",
"operation",
"takes",
"no",
"input",
"."
] | 465312b0b75fb91ff9ae4ce63b6c299b6f7e030d | https://github.com/tremendus/amazon-mws/blob/465312b0b75fb91ff9ae4ce63b6c299b6f7e030d/src/MarketplaceWebServiceOrders/Client.php#L114-L128 |
234,873 | tremendus/amazon-mws | src/MarketplaceWebServiceOrders/Client.php | MarketplaceWebServiceOrders_Client.listOrderItemsByNextToken | public function listOrderItemsByNextToken($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_ListOrderItemsByNextTokenRequest)) {
// // require_once (dirname(__FILE__) . '/Model/ListOrderItemsByNextTokenRequest.php');
$request = new MarketplaceWebServiceOrders_Mo... | php | public function listOrderItemsByNextToken($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_ListOrderItemsByNextTokenRequest)) {
// // require_once (dirname(__FILE__) . '/Model/ListOrderItemsByNextTokenRequest.php');
$request = new MarketplaceWebServiceOrders_Mo... | [
"public",
"function",
"listOrderItemsByNextToken",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"request",
"instanceof",
"MarketplaceWebServiceOrders_Model_ListOrderItemsByNextTokenRequest",
")",
")",
"{",
"// // require_once (dirname(__FILE__) . '/Model/ListOrderIt... | List Order Items By Next Token
If ListOrderItems cannot return all the order items in one go, it will
provide a nextToken. That nextToken can be used with this operation to
retrive the next batch of items for that order.
@param mixed $request array of parameters for MarketplaceWebServiceOrders_Model_ListOrderItemsByNe... | [
"List",
"Order",
"Items",
"By",
"Next",
"Token",
"If",
"ListOrderItems",
"cannot",
"return",
"all",
"the",
"order",
"items",
"in",
"one",
"go",
"it",
"will",
"provide",
"a",
"nextToken",
".",
"That",
"nextToken",
"can",
"be",
"used",
"with",
"this",
"opera... | 465312b0b75fb91ff9ae4ce63b6c299b6f7e030d | https://github.com/tremendus/amazon-mws/blob/465312b0b75fb91ff9ae4ce63b6c299b6f7e030d/src/MarketplaceWebServiceOrders/Client.php#L210-L224 |
234,874 | stephweb/daw-php-orm | src/DawPhpOrm/Support/String/Str.php | Str.convertCamelCaseToSnakeCase | public static function convertCamelCaseToSnakeCase(string $value): string
{
if (isset(self::$snakeCache[$value])) {
return self::$snakeCache[$value];
}
$withUpperArray = str_split($value);
$snake_case = '';
foreach ($withUpperArray as $letter) {
... | php | public static function convertCamelCaseToSnakeCase(string $value): string
{
if (isset(self::$snakeCache[$value])) {
return self::$snakeCache[$value];
}
$withUpperArray = str_split($value);
$snake_case = '';
foreach ($withUpperArray as $letter) {
... | [
"public",
"static",
"function",
"convertCamelCaseToSnakeCase",
"(",
"string",
"$",
"value",
")",
":",
"string",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"snakeCache",
"[",
"$",
"value",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"snakeCache... | Pour remplacer format camelCase par format snake_case
@param string $value - snake_case
@return string | [
"Pour",
"remplacer",
"format",
"camelCase",
"par",
"format",
"snake_case"
] | 0c37e3baa1420cf9e3feff122016329de3764bcc | https://github.com/stephweb/daw-php-orm/blob/0c37e3baa1420cf9e3feff122016329de3764bcc/src/DawPhpOrm/Support/String/Str.php#L41-L59 |
234,875 | stephweb/daw-php-orm | src/DawPhpOrm/Support/String/Str.php | Str.snakePlural | public static function snakePlural(string $value): string
{
if (isset(self::$snakePluralCache[$value])) {
return self::$snakePluralCache[$value];
}
$snake_case = self::convertCamelCaseToSnakeCase($value);
$snakeCaseEx = explode('_', $snake_case);
$plura... | php | public static function snakePlural(string $value): string
{
if (isset(self::$snakePluralCache[$value])) {
return self::$snakePluralCache[$value];
}
$snake_case = self::convertCamelCaseToSnakeCase($value);
$snakeCaseEx = explode('_', $snake_case);
$plura... | [
"public",
"static",
"function",
"snakePlural",
"(",
"string",
"$",
"value",
")",
":",
"string",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"snakePluralCache",
"[",
"$",
"value",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"snakePluralCache",
... | Obtenir en snake_case la forme plurielle d'un mot anglais
@param string $value
@return string | [
"Obtenir",
"en",
"snake_case",
"la",
"forme",
"plurielle",
"d",
"un",
"mot",
"anglais"
] | 0c37e3baa1420cf9e3feff122016329de3764bcc | https://github.com/stephweb/daw-php-orm/blob/0c37e3baa1420cf9e3feff122016329de3764bcc/src/DawPhpOrm/Support/String/Str.php#L67-L96 |
234,876 | stephweb/daw-php-orm | src/DawPhpOrm/Support/String/Str.php | Str.convertSnakeCaseToCamelCase | public static function convertSnakeCaseToCamelCase(string $value): string
{
if (isset(self::$camelCache[$value])) {
return self::$camelCache[$value];
}
return self::$camelCache[$value] = str_replace(' ', '', ucwords(str_replace('_', ' ', $value)));
} | php | public static function convertSnakeCaseToCamelCase(string $value): string
{
if (isset(self::$camelCache[$value])) {
return self::$camelCache[$value];
}
return self::$camelCache[$value] = str_replace(' ', '', ucwords(str_replace('_', ' ', $value)));
} | [
"public",
"static",
"function",
"convertSnakeCaseToCamelCase",
"(",
"string",
"$",
"value",
")",
":",
"string",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"camelCache",
"[",
"$",
"value",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"camelCache... | Pour remplacer format snake_case par format camelCase
@param string $value - camelCase
@return string | [
"Pour",
"remplacer",
"format",
"snake_case",
"par",
"format",
"camelCase"
] | 0c37e3baa1420cf9e3feff122016329de3764bcc | https://github.com/stephweb/daw-php-orm/blob/0c37e3baa1420cf9e3feff122016329de3764bcc/src/DawPhpOrm/Support/String/Str.php#L104-L111 |
234,877 | accompli/accompli | src/DataCollector/EventDataCollector.php | EventDataCollector.hasCountedLogLevel | public function hasCountedLogLevel($logLevel)
{
if (isset($this->logLevelCount[$logLevel])) {
return $this->logLevelCount[$logLevel] > 0;
}
return false;
} | php | public function hasCountedLogLevel($logLevel)
{
if (isset($this->logLevelCount[$logLevel])) {
return $this->logLevelCount[$logLevel] > 0;
}
return false;
} | [
"public",
"function",
"hasCountedLogLevel",
"(",
"$",
"logLevel",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"logLevelCount",
"[",
"$",
"logLevel",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"logLevelCount",
"[",
"$",
"logLevel",
"]",
... | Returns true if LogEvent instances are counted for a certain LogLevel.
@param string $logLevel
@return bool | [
"Returns",
"true",
"if",
"LogEvent",
"instances",
"are",
"counted",
"for",
"a",
"certain",
"LogLevel",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/DataCollector/EventDataCollector.php#L60-L67 |
234,878 | makinacorpus/drupal-ucms | ucms_search/src/SearchFactory.php | SearchFactory.create | public function create($index)
{
$realname = $this->storage->getIndexRealname($index);
$search = (new Search($this->client))->setIndex($realname);
if ($this->dispatcher) {
$this->dispatcher->dispatch('ucms_search.search_create', new GenericEvent($search));
}
re... | php | public function create($index)
{
$realname = $this->storage->getIndexRealname($index);
$search = (new Search($this->client))->setIndex($realname);
if ($this->dispatcher) {
$this->dispatcher->dispatch('ucms_search.search_create', new GenericEvent($search));
}
re... | [
"public",
"function",
"create",
"(",
"$",
"index",
")",
"{",
"$",
"realname",
"=",
"$",
"this",
"->",
"storage",
"->",
"getIndexRealname",
"(",
"$",
"index",
")",
";",
"$",
"search",
"=",
"(",
"new",
"Search",
"(",
"$",
"this",
"->",
"client",
")",
... | Create a new search
@param string $index
@return Search | [
"Create",
"a",
"new",
"search"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_search/src/SearchFactory.php#L46-L57 |
234,879 | runcmf/runbb | src/RunBB/Model/Forum.php | Forum.getForumInfo | public function getForumInfo($id)
{
$id = Container::get('hooks')->fire('model.forum.get_info_forum_start', $id);
$cur_forum['where'] = [
['fp.read_forum' => 'IS NULL'],
['fp.read_forum' => '1']
];
if (!User::get()->is_guest) {
$cur_forum['select... | php | public function getForumInfo($id)
{
$id = Container::get('hooks')->fire('model.forum.get_info_forum_start', $id);
$cur_forum['where'] = [
['fp.read_forum' => 'IS NULL'],
['fp.read_forum' => '1']
];
if (!User::get()->is_guest) {
$cur_forum['select... | [
"public",
"function",
"getForumInfo",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"Container",
"::",
"get",
"(",
"'hooks'",
")",
"->",
"fire",
"(",
"'model.forum.get_info_forum_start'",
",",
"$",
"id",
")",
";",
"$",
"cur_forum",
"[",
"'where'",
"]",
"=",
... | Returns basic informations about the forum | [
"Returns",
"basic",
"informations",
"about",
"the",
"forum"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Model/Forum.php#L20-L100 |
234,880 | runcmf/runbb | src/RunBB/Model/Forum.php | Forum.sortForumBy | public function sortForumBy($sort_by_sql)
{
$sort_by_sql = Container::get('hooks')->fire('model.forum.sort_forum_by_start', $sort_by_sql);
switch ($sort_by_sql) {
case 0:
$sort_by = 'last_post DESC';
break;
case 1:
$sort_by = '... | php | public function sortForumBy($sort_by_sql)
{
$sort_by_sql = Container::get('hooks')->fire('model.forum.sort_forum_by_start', $sort_by_sql);
switch ($sort_by_sql) {
case 0:
$sort_by = 'last_post DESC';
break;
case 1:
$sort_by = '... | [
"public",
"function",
"sortForumBy",
"(",
"$",
"sort_by_sql",
")",
"{",
"$",
"sort_by_sql",
"=",
"Container",
"::",
"get",
"(",
"'hooks'",
")",
"->",
"fire",
"(",
"'model.forum.sort_forum_by_start'",
",",
"$",
"sort_by_sql",
")",
";",
"switch",
"(",
"$",
"so... | Returns the text required by the query to sort the forum | [
"Returns",
"the",
"text",
"required",
"by",
"the",
"query",
"to",
"sort",
"the",
"forum"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Model/Forum.php#L118-L140 |
234,881 | jonnnnyw/craft-awss3assets | src/JonnyW/AWSS3Assets/S3Bucket.php | S3Bucket.getInstance | public static function getInstance($region, $name, $key = null, $secret = null)
{
if (!self::$instance instanceof \JonnyW\AWSS3Assets\S3Bucket) {
$args = array(
'version' => 'latest',
'region' => $region
);
if (!empty($key) && !empty($se... | php | public static function getInstance($region, $name, $key = null, $secret = null)
{
if (!self::$instance instanceof \JonnyW\AWSS3Assets\S3Bucket) {
$args = array(
'version' => 'latest',
'region' => $region
);
if (!empty($key) && !empty($se... | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"region",
",",
"$",
"name",
",",
"$",
"key",
"=",
"null",
",",
"$",
"secret",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"instance",
"instanceof",
"\\",
"JonnyW",
"\\",
"AWSS3Ass... | Get singleton instance.
@access public
@static
@param string $region
@param string $name
@param string $key (default: null)
@param string $secret (default: null)
@return \JonnyW\AWSS3Assets\S3Bucket | [
"Get",
"singleton",
"instance",
"."
] | 6bc146a8f3496f148c28d431cd8a9e7dc8199a9d | https://github.com/jonnnnyw/craft-awss3assets/blob/6bc146a8f3496f148c28d431cd8a9e7dc8199a9d/src/JonnyW/AWSS3Assets/S3Bucket.php#L71-L93 |
234,882 | jonnnnyw/craft-awss3assets | src/JonnyW/AWSS3Assets/S3Bucket.php | S3Bucket.cp | public function cp($path, $filename)
{
if (!file_exists($path)) {
return false;
}
$type = mime_content_type($path);
$handle = fopen($path, 'r');
$body = fread($handle, filesize($path));
fclose($handle);
$result = $this->client
... | php | public function cp($path, $filename)
{
if (!file_exists($path)) {
return false;
}
$type = mime_content_type($path);
$handle = fopen($path, 'r');
$body = fread($handle, filesize($path));
fclose($handle);
$result = $this->client
... | [
"public",
"function",
"cp",
"(",
"$",
"path",
",",
"$",
"filename",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"type",
"=",
"mime_content_type",
"(",
"$",
"path",
")",
";",
"$",
"ha... | Copy media.
@access public
@param string $path
@param string $filename
@return \Aws\Result|false | [
"Copy",
"media",
"."
] | 6bc146a8f3496f148c28d431cd8a9e7dc8199a9d | https://github.com/jonnnnyw/craft-awss3assets/blob/6bc146a8f3496f148c28d431cd8a9e7dc8199a9d/src/JonnyW/AWSS3Assets/S3Bucket.php#L103-L125 |
234,883 | jonnnnyw/craft-awss3assets | src/JonnyW/AWSS3Assets/S3Bucket.php | S3Bucket.rm | public function rm($filename)
{
$result = $this->client
->deleteObject(array(
'Bucket' => $this->name,
'Key' => $filename
));
return $result;
} | php | public function rm($filename)
{
$result = $this->client
->deleteObject(array(
'Bucket' => $this->name,
'Key' => $filename
));
return $result;
} | [
"public",
"function",
"rm",
"(",
"$",
"filename",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"client",
"->",
"deleteObject",
"(",
"array",
"(",
"'Bucket'",
"=>",
"$",
"this",
"->",
"name",
",",
"'Key'",
"=>",
"$",
"filename",
")",
")",
";",
"... | Remove media.
@access public
@param string $filename
@return \Aws\Result | [
"Remove",
"media",
"."
] | 6bc146a8f3496f148c28d431cd8a9e7dc8199a9d | https://github.com/jonnnnyw/craft-awss3assets/blob/6bc146a8f3496f148c28d431cd8a9e7dc8199a9d/src/JonnyW/AWSS3Assets/S3Bucket.php#L134-L143 |
234,884 | runcmf/runbb | src/RunBB/Controller/Install.php | Install.getLangs | public static function getLangs($folder = '')
{
$langs = [];
$iterator = new \DirectoryIterator(ForumEnv::get('FORUM_ROOT').'lang/');
foreach ($iterator as $child) {
if (!$child->isDot() && $child->isDir() &&
file_exists($child->getPathname().DIRECTORY_SEPARATOR.... | php | public static function getLangs($folder = '')
{
$langs = [];
$iterator = new \DirectoryIterator(ForumEnv::get('FORUM_ROOT').'lang/');
foreach ($iterator as $child) {
if (!$child->isDot() && $child->isDir() &&
file_exists($child->getPathname().DIRECTORY_SEPARATOR.... | [
"public",
"static",
"function",
"getLangs",
"(",
"$",
"folder",
"=",
"''",
")",
"{",
"$",
"langs",
"=",
"[",
"]",
";",
"$",
"iterator",
"=",
"new",
"\\",
"DirectoryIterator",
"(",
"ForumEnv",
"::",
"get",
"(",
"'FORUM_ROOT'",
")",
".",
"'lang/'",
")",
... | Get available langs | [
"Get",
"available",
"langs"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Controller/Install.php#L447-L462 |
234,885 | shopgate/cart-integration-sdk | src/models/XmlResultObject.php | Shopgate_Model_XmlResultObject.addAttribute | public function addAttribute($name, $value = null, $namespace = null)
{
if (isset($value)) {
parent::addAttribute($name, $value, $namespace);
}
} | php | public function addAttribute($name, $value = null, $namespace = null)
{
if (isset($value)) {
parent::addAttribute($name, $value, $namespace);
}
} | [
"public",
"function",
"addAttribute",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"value",
")",
")",
"{",
"parent",
"::",
"addAttribute",
"(",
"$",
"name",
",",
"$",
... | Adds an attribute to the SimpleXML element is value not empty
@param string $name
@param string $value
@param string $namespace | [
"Adds",
"an",
"attribute",
"to",
"the",
"SimpleXML",
"element",
"is",
"value",
"not",
"empty"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/models/XmlResultObject.php#L114-L119 |
234,886 | makinacorpus/drupal-ucms | ucms_user/src/TokenManager.php | TokenManager.createToken | public function createToken(AccountInterface $user)
{
$lifespan = variable_get('user_password_reset_timeout', 86400);
$token = new Token();
$token->uid = $user->id();
$token->expiration_date = (new \DateTime())->add(new \DateInterval('PT' . $lifespan . 'S'));
$token->generat... | php | public function createToken(AccountInterface $user)
{
$lifespan = variable_get('user_password_reset_timeout', 86400);
$token = new Token();
$token->uid = $user->id();
$token->expiration_date = (new \DateTime())->add(new \DateInterval('PT' . $lifespan . 'S'));
$token->generat... | [
"public",
"function",
"createToken",
"(",
"AccountInterface",
"$",
"user",
")",
"{",
"$",
"lifespan",
"=",
"variable_get",
"(",
"'user_password_reset_timeout'",
",",
"86400",
")",
";",
"$",
"token",
"=",
"new",
"Token",
"(",
")",
";",
"$",
"token",
"->",
"... | Creates and saves a new token for the given user.
@param AccountInterface $user
@return Token | [
"Creates",
"and",
"saves",
"a",
"new",
"token",
"for",
"the",
"given",
"user",
"."
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_user/src/TokenManager.php#L39-L50 |
234,887 | makinacorpus/drupal-ucms | ucms_user/src/TokenManager.php | TokenManager.loadToken | public function loadToken($key)
{
$token = $this->db
->select('ucms_user_token', 'ut')
->fields('ut')
->condition('token', $key)
->range(0, 1)
->execute()
->fetchObject('MakinaCorpus\\Ucms\\User\\Token');
if (!$token) {
... | php | public function loadToken($key)
{
$token = $this->db
->select('ucms_user_token', 'ut')
->fields('ut')
->condition('token', $key)
->range(0, 1)
->execute()
->fetchObject('MakinaCorpus\\Ucms\\User\\Token');
if (!$token) {
... | [
"public",
"function",
"loadToken",
"(",
"$",
"key",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"db",
"->",
"select",
"(",
"'ucms_user_token'",
",",
"'ut'",
")",
"->",
"fields",
"(",
"'ut'",
")",
"->",
"condition",
"(",
"'token'",
",",
"$",
"key"... | Loads a token.
@param string $key
@return Token | [
"Loads",
"a",
"token",
"."
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_user/src/TokenManager.php#L59-L75 |
234,888 | makinacorpus/drupal-ucms | ucms_user/src/TokenManager.php | TokenManager.saveToken | public function saveToken(Token $token)
{
$this->db
->merge('ucms_user_token')
->key(['uid' => $token->uid])
->fields([
'token' => $token->token,
'expiration_date' => $token->expiration_date->format('Y-m-d H:i:s'),
])
... | php | public function saveToken(Token $token)
{
$this->db
->merge('ucms_user_token')
->key(['uid' => $token->uid])
->fields([
'token' => $token->token,
'expiration_date' => $token->expiration_date->format('Y-m-d H:i:s'),
])
... | [
"public",
"function",
"saveToken",
"(",
"Token",
"$",
"token",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"merge",
"(",
"'ucms_user_token'",
")",
"->",
"key",
"(",
"[",
"'uid'",
"=>",
"$",
"token",
"->",
"uid",
"]",
")",
"->",
"fields",
"(",
"[",
"'t... | Saves the given token.
@param Token $token
@param int $lifespan
Life duration in seconds.
If not provided wa assume the expiration date is already defined. | [
"Saves",
"the",
"given",
"token",
"."
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_user/src/TokenManager.php#L86-L96 |
234,889 | makinacorpus/drupal-ucms | ucms_user/src/TokenManager.php | TokenManager.deleteToken | public function deleteToken(Token $token)
{
$this->db
->delete('ucms_user_token')
->condition('uid', $token->uid)
->execute();
} | php | public function deleteToken(Token $token)
{
$this->db
->delete('ucms_user_token')
->condition('uid', $token->uid)
->execute();
} | [
"public",
"function",
"deleteToken",
"(",
"Token",
"$",
"token",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"delete",
"(",
"'ucms_user_token'",
")",
"->",
"condition",
"(",
"'uid'",
",",
"$",
"token",
"->",
"uid",
")",
"->",
"execute",
"(",
")",
";",
"... | Deletes the given token.
@param Token $token | [
"Deletes",
"the",
"given",
"token",
"."
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_user/src/TokenManager.php#L104-L110 |
234,890 | makinacorpus/drupal-ucms | ucms_user/src/TokenManager.php | TokenManager.sendTokenMail | public function sendTokenMail(AccountInterface $user, $mailModule, $mailKey, array $params = [])
{
global $language;
$token = $this->createToken($user);
$params = ['user' => $user, 'token' => $token] + $params;
drupal_mail($mailModule, $mailKey, $user->getEmail(), $language, $param... | php | public function sendTokenMail(AccountInterface $user, $mailModule, $mailKey, array $params = [])
{
global $language;
$token = $this->createToken($user);
$params = ['user' => $user, 'token' => $token] + $params;
drupal_mail($mailModule, $mailKey, $user->getEmail(), $language, $param... | [
"public",
"function",
"sendTokenMail",
"(",
"AccountInterface",
"$",
"user",
",",
"$",
"mailModule",
",",
"$",
"mailKey",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"global",
"$",
"language",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"creat... | Sends the asked mail type including a token generated for the given user.
@global $language
@param AccountInterface $user
The recipient of the mail.
@param string $mailModule
Name of the module containing the type of mail.
@param string $mailKey
Key of the type of mail you want to send.
@param mixed[] $params
Addition... | [
"Sends",
"the",
"asked",
"mail",
"type",
"including",
"a",
"token",
"generated",
"for",
"the",
"given",
"user",
"."
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_user/src/TokenManager.php#L140-L148 |
234,891 | runcmf/runbb | src/RunBB/Core/Interfaces/SlimStatic.php | SlimStatic.boot | public static function boot(App $slim)
{
// set Slim application for syntactic-sugar proxies
SlimSugar::$slim = $slim;
// create a new Manager
$manager = new Manager();
// Add proxies that use the Slim instance
$aliases = ['Config', 'Route', 'Router', 'ForumEnv', 'F... | php | public static function boot(App $slim)
{
// set Slim application for syntactic-sugar proxies
SlimSugar::$slim = $slim;
// create a new Manager
$manager = new Manager();
// Add proxies that use the Slim instance
$aliases = ['Config', 'Route', 'Router', 'ForumEnv', 'F... | [
"public",
"static",
"function",
"boot",
"(",
"App",
"$",
"slim",
")",
"{",
"// set Slim application for syntactic-sugar proxies",
"SlimSugar",
"::",
"$",
"slim",
"=",
"$",
"slim",
";",
"// create a new Manager",
"$",
"manager",
"=",
"new",
"Manager",
"(",
")",
"... | Boots up SlimStatic by registering its proxies with Statical.
@param \Slim\App $slim
@return \RunBB\Core\Statical\Manager | [
"Boots",
"up",
"SlimStatic",
"by",
"registering",
"its",
"proxies",
"with",
"Statical",
"."
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Core/Interfaces/SlimStatic.php#L15-L35 |
234,892 | runcmf/runbb | src/RunBB/Core/Interfaces/SlimStatic.php | SlimStatic.addInstances | protected static function addInstances($aliases, $manager, $instance)
{
foreach ($aliases as $alias) {
$proxy = __NAMESPACE__.'\\'.$alias;
$manager->addProxyInstance($alias, $proxy, $instance);
}
} | php | protected static function addInstances($aliases, $manager, $instance)
{
foreach ($aliases as $alias) {
$proxy = __NAMESPACE__.'\\'.$alias;
$manager->addProxyInstance($alias, $proxy, $instance);
}
} | [
"protected",
"static",
"function",
"addInstances",
"(",
"$",
"aliases",
",",
"$",
"manager",
",",
"$",
"instance",
")",
"{",
"foreach",
"(",
"$",
"aliases",
"as",
"$",
"alias",
")",
"{",
"$",
"proxy",
"=",
"__NAMESPACE__",
".",
"'\\\\'",
".",
"$",
"ali... | Adds instances to the Statical Manager
@param string[] $aliases
@param \RunBB\Core\Statical\Manager $manager
@param object $instance | [
"Adds",
"instances",
"to",
"the",
"Statical",
"Manager"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Core/Interfaces/SlimStatic.php#L44-L50 |
234,893 | runcmf/runbb | src/RunBB/Core/Interfaces/SlimStatic.php | SlimStatic.addServices | protected static function addServices($manager, $slim)
{
$services = [
'Input' => 'request',
'Request' => 'request',
'Response' => 'response',
'View' => 'template',
'Menu' => 'menu',
'Url' => 'url',
'Log' => 'log'
];... | php | protected static function addServices($manager, $slim)
{
$services = [
'Input' => 'request',
'Request' => 'request',
'Response' => 'response',
'View' => 'template',
'Menu' => 'menu',
'Url' => 'url',
'Log' => 'log'
];... | [
"protected",
"static",
"function",
"addServices",
"(",
"$",
"manager",
",",
"$",
"slim",
")",
"{",
"$",
"services",
"=",
"[",
"'Input'",
"=>",
"'request'",
",",
"'Request'",
"=>",
"'request'",
",",
"'Response'",
"=>",
"'response'",
",",
"'View'",
"=>",
"'t... | Adds services to the Statical Manager
@param \RunBB\Core\Statical\Manager $manager
@param \Slim\App $slim | [
"Adds",
"services",
"to",
"the",
"Statical",
"Manager"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Core/Interfaces/SlimStatic.php#L58-L76 |
234,894 | PHPixie/HTTP | src/PHPixie/HTTP/Data/Headers/Editable.php | Editable.set | public function set($name, $value)
{
$value = $this->normalizeValue($value);
$this->remove($name);
$this->setHeader($name, $value);
} | php | public function set($name, $value)
{
$value = $this->normalizeValue($value);
$this->remove($name);
$this->setHeader($name, $value);
} | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"normalizeValue",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"remove",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"setHeade... | Set header replacing all headers with the same name
@param string $name
@param string|array $value | [
"Set",
"header",
"replacing",
"all",
"headers",
"with",
"the",
"same",
"name"
] | 581c0df452fd07ca4ea0b3e24e8ddee8dddc2912 | https://github.com/PHPixie/HTTP/blob/581c0df452fd07ca4ea0b3e24e8ddee8dddc2912/src/PHPixie/HTTP/Data/Headers/Editable.php#L15-L21 |
234,895 | PHPixie/HTTP | src/PHPixie/HTTP/Data/Headers/Editable.php | Editable.add | public function add($name, $value)
{
$this->requireNames();
$value = $this->normalizeValue($value);
$lower = strtolower($name);
if(array_key_exists($lower, $this->names)) {
$name = $this->names[$lower];
foreach($value as $line) {
$this... | php | public function add($name, $value)
{
$this->requireNames();
$value = $this->normalizeValue($value);
$lower = strtolower($name);
if(array_key_exists($lower, $this->names)) {
$name = $this->names[$lower];
foreach($value as $line) {
$this... | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"requireNames",
"(",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"normalizeValue",
"(",
"$",
"value",
")",
";",
"$",
"lower",
"=",
"strtolower",
"(",... | Add header value
@param string $name
@param string|array $value | [
"Add",
"header",
"value"
] | 581c0df452fd07ca4ea0b3e24e8ddee8dddc2912 | https://github.com/PHPixie/HTTP/blob/581c0df452fd07ca4ea0b3e24e8ddee8dddc2912/src/PHPixie/HTTP/Data/Headers/Editable.php#L28-L42 |
234,896 | PHPixie/HTTP | src/PHPixie/HTTP/Data/Headers/Editable.php | Editable.remove | public function remove($name)
{
$this->requireNames();
$lower = strtolower($name);
if(array_key_exists($lower, $this->names)) {
$name = $this->names[$lower];
unset($this->names[$lower]);
unset($this->headers[$name]);
}
} | php | public function remove($name)
{
$this->requireNames();
$lower = strtolower($name);
if(array_key_exists($lower, $this->names)) {
$name = $this->names[$lower];
unset($this->names[$lower]);
unset($this->headers[$name]);
}
} | [
"public",
"function",
"remove",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"requireNames",
"(",
")",
";",
"$",
"lower",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"lower",
",",
"$",
"this",
"->",
"na... | Remove all header values
@param string $name | [
"Remove",
"all",
"header",
"values"
] | 581c0df452fd07ca4ea0b3e24e8ddee8dddc2912 | https://github.com/PHPixie/HTTP/blob/581c0df452fd07ca4ea0b3e24e8ddee8dddc2912/src/PHPixie/HTTP/Data/Headers/Editable.php#L48-L58 |
234,897 | tremendus/amazon-mws | src/FBAInventoryServiceMWS/Client.php | FBAInventoryServiceMWS_Client._convertListInventorySupply | private function _convertListInventorySupply($request) {
$parameters = array();
$parameters['Action'] = 'ListInventorySupply';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetMWSAuthToken()) {
$par... | php | private function _convertListInventorySupply($request) {
$parameters = array();
$parameters['Action'] = 'ListInventorySupply';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetMWSAuthToken()) {
$par... | [
"private",
"function",
"_convertListInventorySupply",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'ListInventorySupply'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
... | Convert ListInventorySupplyRequest to name value pairs | [
"Convert",
"ListInventorySupplyRequest",
"to",
"name",
"value",
"pairs"
] | 465312b0b75fb91ff9ae4ce63b6c299b6f7e030d | https://github.com/tremendus/amazon-mws/blob/465312b0b75fb91ff9ae4ce63b6c299b6f7e030d/src/FBAInventoryServiceMWS/Client.php#L165-L195 |
234,898 | tremendus/amazon-mws | src/FBAInventoryServiceMWS/Client.php | FBAInventoryServiceMWS_Client.listInventorySupplyByNextToken | public function listInventorySupplyByNextToken($request)
{
if (!($request instanceof FBAInventoryServiceMWS_Model_ListInventorySupplyByNextTokenRequest)) {
require_once (dirname(__FILE__) . '/Model/ListInventorySupplyByNextTokenRequest.php');
$request = new FBAInventoryServiceMWS_Mod... | php | public function listInventorySupplyByNextToken($request)
{
if (!($request instanceof FBAInventoryServiceMWS_Model_ListInventorySupplyByNextTokenRequest)) {
require_once (dirname(__FILE__) . '/Model/ListInventorySupplyByNextTokenRequest.php');
$request = new FBAInventoryServiceMWS_Mod... | [
"public",
"function",
"listInventorySupplyByNextToken",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"request",
"instanceof",
"FBAInventoryServiceMWS_Model_ListInventorySupplyByNextTokenRequest",
")",
")",
"{",
"require_once",
"(",
"dirname",
"(",
"__FILE__"... | List Inventory Supply By Next Token
Continues pagination over a resultset of inventory data for inventory
items.
This operation is used in conjunction with ListUpdatedInventorySupply.
Please refer to documentation for that operation for further details.
@param mixed $request array of parameters for FBAInventoryServic... | [
"List",
"Inventory",
"Supply",
"By",
"Next",
"Token",
"Continues",
"pagination",
"over",
"a",
"resultset",
"of",
"inventory",
"data",
"for",
"inventory",
"items",
"."
] | 465312b0b75fb91ff9ae4ce63b6c299b6f7e030d | https://github.com/tremendus/amazon-mws/blob/465312b0b75fb91ff9ae4ce63b6c299b6f7e030d/src/FBAInventoryServiceMWS/Client.php#L212-L226 |
234,899 | tremendus/amazon-mws | src/FBAInventoryServiceMWS/Client.php | FBAInventoryServiceMWS_Client._convertListInventorySupplyByNextToken | private function _convertListInventorySupplyByNextToken($request) {
$parameters = array();
$parameters['Action'] = 'ListInventorySupplyByNextToken';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetMWSAuthToken... | php | private function _convertListInventorySupplyByNextToken($request) {
$parameters = array();
$parameters['Action'] = 'ListInventorySupplyByNextToken';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetMWSAuthToken... | [
"private",
"function",
"_convertListInventorySupplyByNextToken",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'ListInventorySupplyByNextToken'",
";",
"if",
"(",
"$",
"request",
"->"... | Convert ListInventorySupplyByNextTokenRequest to name value pairs | [
"Convert",
"ListInventorySupplyByNextTokenRequest",
"to",
"name",
"value",
"pairs"
] | 465312b0b75fb91ff9ae4ce63b6c299b6f7e030d | https://github.com/tremendus/amazon-mws/blob/465312b0b75fb91ff9ae4ce63b6c299b6f7e030d/src/FBAInventoryServiceMWS/Client.php#L232-L253 |
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.