repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
neos/flow-development-collection | Neos.Eel/Classes/Helper/ArrayHelper.php | ArrayHelper.push | public function push(array $array, $element): array
{
$elements = func_get_args();
array_shift($elements);
foreach ($elements as $element) {
array_push($array, $element);
}
return $array;
} | php | public function push(array $array, $element): array
{
$elements = func_get_args();
array_shift($elements);
foreach ($elements as $element) {
array_push($array, $element);
}
return $array;
} | [
"public",
"function",
"push",
"(",
"array",
"$",
"array",
",",
"$",
"element",
")",
":",
"array",
"{",
"$",
"elements",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"elements",
")",
";",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"e... | Insert one or more elements at the end of an array
Allows to push multiple elements at once::
Array.push(array, e1, e2)
@param array $array
@param mixed $element
@return array The array with the inserted elements | [
"Insert",
"one",
"or",
"more",
"elements",
"at",
"the",
"end",
"of",
"an",
"array"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/ArrayHelper.php#L271-L279 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/ArrayHelper.php | ArrayHelper.unshift | public function unshift(array $array, $element): array
{
// get all elements that are supposed to be added
$elements = func_get_args();
array_shift($elements);
foreach ($elements as $element) {
array_unshift($array, $element);
}
return $array;
} | php | public function unshift(array $array, $element): array
{
// get all elements that are supposed to be added
$elements = func_get_args();
array_shift($elements);
foreach ($elements as $element) {
array_unshift($array, $element);
}
return $array;
} | [
"public",
"function",
"unshift",
"(",
"array",
"$",
"array",
",",
"$",
"element",
")",
":",
"array",
"{",
"// get all elements that are supposed to be added",
"$",
"elements",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"elements",
")",
";",
... | Insert one or more elements at the beginning of an array
Allows to insert multiple elements at once::
Array.unshift(array, e1, e2)
@param array $array
@param mixed $element
@return array The array with the inserted elements | [
"Insert",
"one",
"or",
"more",
"elements",
"at",
"the",
"beginning",
"of",
"an",
"array"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/ArrayHelper.php#L308-L317 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/ArrayHelper.php | ArrayHelper.splice | public function splice(array $array, $offset, $length = 1, $replacements = null): array
{
$arguments = func_get_args();
$replacements = array_slice($arguments, 3);
array_splice($array, $offset, $length, $replacements);
return $array;
} | php | public function splice(array $array, $offset, $length = 1, $replacements = null): array
{
$arguments = func_get_args();
$replacements = array_slice($arguments, 3);
array_splice($array, $offset, $length, $replacements);
return $array;
} | [
"public",
"function",
"splice",
"(",
"array",
"$",
"array",
",",
"$",
"offset",
",",
"$",
"length",
"=",
"1",
",",
"$",
"replacements",
"=",
"null",
")",
":",
"array",
"{",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"$",
"replacements",
"... | Replaces a range of an array by the given replacements
Allows to give multiple replacements at once::
Array.splice(array, 3, 2, 'a', 'b')
@param array $array
@param int $offset Index of the first element to remove
@param int $length Number of elements to remove
@param mixed $replacements Elements to insert instead o... | [
"Replaces",
"a",
"range",
"of",
"an",
"array",
"by",
"the",
"given",
"replacements"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/ArrayHelper.php#L332-L338 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/ArrayHelper.php | ArrayHelper.map | public function map(array $array, callable $callback): array
{
$result = [];
foreach ($array as $key => $element) {
$result[$key] = $callback($element, $key);
}
return $result;
} | php | public function map(array $array, callable $callback): array
{
$result = [];
foreach ($array as $key => $element) {
$result[$key] = $callback($element, $key);
}
return $result;
} | [
"public",
"function",
"map",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"element",
")",
"{",
"$",
"result",
"... | Apply the callback to each element of the array, passing each element and key as arguments
Examples::
Array.map([1, 2, 3, 4], x => x * x)
Array.map([1, 2, 3, 4], (x, index) => x * index)
@param array $array Array of elements to map
@param callable $callback Callback to apply for each element, current value and key w... | [
"Apply",
"the",
"callback",
"to",
"each",
"element",
"of",
"the",
"array",
"passing",
"each",
"element",
"and",
"key",
"as",
"arguments"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/ArrayHelper.php#L396-L403 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/ArrayHelper.php | ArrayHelper.reduce | public function reduce(array $array, callable $callback, $initialValue = null)
{
if ($initialValue !== null) {
$accumulator = $initialValue;
} else {
$accumulator = array_shift($array);
}
foreach ($array as $key => $element) {
$accumulator = $callb... | php | public function reduce(array $array, callable $callback, $initialValue = null)
{
if ($initialValue !== null) {
$accumulator = $initialValue;
} else {
$accumulator = array_shift($array);
}
foreach ($array as $key => $element) {
$accumulator = $callb... | [
"public",
"function",
"reduce",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
",",
"$",
"initialValue",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"initialValue",
"!==",
"null",
")",
"{",
"$",
"accumulator",
"=",
"$",
"initialValue",
";",
"... | Apply the callback to each element of the array and accumulate a single value
Examples::
Array.reduce([1, 2, 3, 4], (accumulator, currentValue) => accumulator + currentValue) // == 10
Array.reduce([1, 2, 3, 4], (accumulator, currentValue) => accumulator + currentValue, 1) // == 11
@param array $array Array of elemen... | [
"Apply",
"the",
"callback",
"to",
"each",
"element",
"of",
"the",
"array",
"and",
"accumulate",
"a",
"single",
"value"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/ArrayHelper.php#L418-L429 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/ArrayHelper.php | ArrayHelper.some | public function some(array $array, callable $callback): bool
{
foreach ($array as $key => $value) {
if ($callback($value, $key)) {
return true;
}
}
return false;
} | php | public function some(array $array, callable $callback): bool
{
foreach ($array as $key => $value) {
if ($callback($value, $key)) {
return true;
}
}
return false;
} | [
"public",
"function",
"some",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"callback",
"(",
"$",
"value",
",",
"... | Check if at least one element in an array passes a test given by the calback,
passing each element and key as arguments
Example::
Array.some([1, 2, 3, 4], x => x % 2 == 0) // == true
Array.some([1, 2, 3, 4], x => x > 4) // == false
@param array $array Array of elements to test
@param callable $callback Callback for ... | [
"Check",
"if",
"at",
"least",
"one",
"element",
"in",
"an",
"array",
"passes",
"a",
"test",
"given",
"by",
"the",
"calback",
"passing",
"each",
"element",
"and",
"key",
"as",
"arguments"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/ArrayHelper.php#L461-L469 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/ArrayHelper.php | ArrayHelper.every | public function every(array $array, callable $callback): bool
{
foreach ($array as $key => $value) {
if (!$callback($value, $key)) {
return false;
}
}
return true;
} | php | public function every(array $array, callable $callback): bool
{
foreach ($array as $key => $value) {
if (!$callback($value, $key)) {
return false;
}
}
return true;
} | [
"public",
"function",
"every",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"callback",
"(",
"$",
"value",
... | Check if all elements in an array pass a test given by the calback,
passing each element and key as arguments
Example::
Array.every([1, 2, 3, 4], x => x % 2 == 0) // == false
Array.every([2, 4, 6, 8], x => x % 2) // == true
@param array $array Array of elements to test
@param callable $callback Callback for testing ... | [
"Check",
"if",
"all",
"elements",
"in",
"an",
"array",
"pass",
"a",
"test",
"given",
"by",
"the",
"calback",
"passing",
"each",
"element",
"and",
"key",
"as",
"arguments"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/ArrayHelper.php#L484-L492 |
neos/flow-development-collection | Neos.FluidAdaptor/Classes/Service/XsdGenerator.php | XsdGenerator.generateXsd | public function generateXsd($viewHelperNamespace, $xsdNamespace)
{
if (substr($viewHelperNamespace, -1) !== '\\') {
$viewHelperNamespace .= '\\';
}
$classNames = $this->getClassNamesInNamespace($viewHelperNamespace);
if (count($classNames) === 0) {
throw new ... | php | public function generateXsd($viewHelperNamespace, $xsdNamespace)
{
if (substr($viewHelperNamespace, -1) !== '\\') {
$viewHelperNamespace .= '\\';
}
$classNames = $this->getClassNamesInNamespace($viewHelperNamespace);
if (count($classNames) === 0) {
throw new ... | [
"public",
"function",
"generateXsd",
"(",
"$",
"viewHelperNamespace",
",",
"$",
"xsdNamespace",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"viewHelperNamespace",
",",
"-",
"1",
")",
"!==",
"'\\\\'",
")",
"{",
"$",
"viewHelperNamespace",
".=",
"'\\\\'",
";",
... | Generate the XML Schema definition for a given namespace.
It will generate an XSD file for all view helpers in this namespace.
@param string $viewHelperNamespace Namespace identifier to generate the XSD for, without leading Backslash.
@param string $xsdNamespace $xsdNamespace unique target namespace used in the XSD sc... | [
"Generate",
"the",
"XML",
"Schema",
"definition",
"for",
"a",
"given",
"namespace",
".",
"It",
"will",
"generate",
"an",
"XSD",
"file",
"for",
"all",
"view",
"helpers",
"in",
"this",
"namespace",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.FluidAdaptor/Classes/Service/XsdGenerator.php#L39-L58 |
neos/flow-development-collection | Neos.FluidAdaptor/Classes/Service/XsdGenerator.php | XsdGenerator.generateXmlForClassName | protected function generateXmlForClassName($className, $viewHelperNamespace, \SimpleXMLElement $xmlRootNode)
{
$reflectionClass = new ClassReflection($className);
if (!$reflectionClass->isSubclassOf($this->abstractViewHelperReflectionClass)) {
return;
}
$tagName = $this-... | php | protected function generateXmlForClassName($className, $viewHelperNamespace, \SimpleXMLElement $xmlRootNode)
{
$reflectionClass = new ClassReflection($className);
if (!$reflectionClass->isSubclassOf($this->abstractViewHelperReflectionClass)) {
return;
}
$tagName = $this-... | [
"protected",
"function",
"generateXmlForClassName",
"(",
"$",
"className",
",",
"$",
"viewHelperNamespace",
",",
"\\",
"SimpleXMLElement",
"$",
"xmlRootNode",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"ClassReflection",
"(",
"$",
"className",
")",
";",
"if",
... | Generate the XML Schema for a given class name.
@param string $className Class name to generate the schema for.
@param string $viewHelperNamespace Namespace prefix. Used to split off the first parts of the class name.
@param \SimpleXMLElement $xmlRootNode XML root node where the xsd:element is appended.
@return void | [
"Generate",
"the",
"XML",
"Schema",
"for",
"a",
"given",
"class",
"name",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.FluidAdaptor/Classes/Service/XsdGenerator.php#L68-L90 |
neos/flow-development-collection | Neos.Flow/Classes/Persistence/Aspect/PersistenceMagicAspect.php | PersistenceMagicAspect.generateUuid | public function generateUuid(JoinPointInterface $joinPoint)
{
/** @var $proxy PersistenceMagicInterface */
$proxy = $joinPoint->getProxy();
ObjectAccess::setProperty($proxy, 'Persistence_Object_Identifier', Algorithms::generateUUID(), true);
$this->persistenceManager->registerNewObje... | php | public function generateUuid(JoinPointInterface $joinPoint)
{
/** @var $proxy PersistenceMagicInterface */
$proxy = $joinPoint->getProxy();
ObjectAccess::setProperty($proxy, 'Persistence_Object_Identifier', Algorithms::generateUUID(), true);
$this->persistenceManager->registerNewObje... | [
"public",
"function",
"generateUuid",
"(",
"JoinPointInterface",
"$",
"joinPoint",
")",
"{",
"/** @var $proxy PersistenceMagicInterface */",
"$",
"proxy",
"=",
"$",
"joinPoint",
"->",
"getProxy",
"(",
")",
";",
"ObjectAccess",
"::",
"setProperty",
"(",
"$",
"proxy",... | After returning advice, making sure we have an UUID for each and every entity.
@param JoinPointInterface $joinPoint The current join point
@return void
@Flow\Before("Neos\Flow\Persistence\Aspect\PersistenceMagicAspect->isEntity && method(.*->(__construct|__clone)()) && filter(Neos\Flow\Persistence\Doctrine\Mapping\Dri... | [
"After",
"returning",
"advice",
"making",
"sure",
"we",
"have",
"an",
"UUID",
"for",
"each",
"and",
"every",
"entity",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Persistence/Aspect/PersistenceMagicAspect.php#L96-L102 |
neos/flow-development-collection | Neos.Flow/Classes/Persistence/Aspect/PersistenceMagicAspect.php | PersistenceMagicAspect.generateValueHash | public function generateValueHash(JoinPointInterface $joinPoint)
{
$proxy = $joinPoint->getProxy();
$proxyClassName = get_class($proxy);
$hashSourceParts = [];
$classSchema = $this->reflectionService->getClassSchema($proxyClassName);
foreach ($classSchema->getProperties() as... | php | public function generateValueHash(JoinPointInterface $joinPoint)
{
$proxy = $joinPoint->getProxy();
$proxyClassName = get_class($proxy);
$hashSourceParts = [];
$classSchema = $this->reflectionService->getClassSchema($proxyClassName);
foreach ($classSchema->getProperties() as... | [
"public",
"function",
"generateValueHash",
"(",
"JoinPointInterface",
"$",
"joinPoint",
")",
"{",
"$",
"proxy",
"=",
"$",
"joinPoint",
"->",
"getProxy",
"(",
")",
";",
"$",
"proxyClassName",
"=",
"get_class",
"(",
"$",
"proxy",
")",
";",
"$",
"hashSourcePart... | After returning advice, generates the value hash for the object
@param JoinPointInterface $joinPoint The current join point
@return void
@Flow\After("Neos\Flow\Persistence\Aspect\PersistenceMagicAspect->isNonEmbeddedValueObject && method(.*->__construct()) && filter(Neos\Flow\Persistence\Doctrine\Mapping\Driver\FlowAn... | [
"After",
"returning",
"advice",
"generates",
"the",
"value",
"hash",
"for",
"the",
"object"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Persistence/Aspect/PersistenceMagicAspect.php#L111-L143 |
neos/flow-development-collection | Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php | PluralsReader.initializeObject | public function initializeObject()
{
if ($this->cache->has('rulesets') && $this->cache->has('rulesetsIndices')) {
$this->rulesets = $this->cache->get('rulesets');
$this->rulesetsIndices = $this->cache->get('rulesetsIndices');
} else {
$this->generateRulesets();
... | php | public function initializeObject()
{
if ($this->cache->has('rulesets') && $this->cache->has('rulesetsIndices')) {
$this->rulesets = $this->cache->get('rulesets');
$this->rulesetsIndices = $this->cache->get('rulesetsIndices');
} else {
$this->generateRulesets();
... | [
"public",
"function",
"initializeObject",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
"->",
"has",
"(",
"'rulesets'",
")",
"&&",
"$",
"this",
"->",
"cache",
"->",
"has",
"(",
"'rulesetsIndices'",
")",
")",
"{",
"$",
"this",
"->",
"rulesets",
... | Constructs the reader, loading parsed data from cache if available.
@return void | [
"Constructs",
"the",
"reader",
"loading",
"parsed",
"data",
"from",
"cache",
"if",
"available",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php#L124-L134 |
neos/flow-development-collection | Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php | PluralsReader.getPluralForm | public function getPluralForm($quantity, Locale $locale)
{
if (!isset($this->rulesetsIndices[$locale->getLanguage()])) {
return self::RULE_OTHER;
}
$ruleset = $this->rulesets[$locale->getLanguage()][$this->rulesetsIndices[$locale->getLanguage()]] ?? null;
if ($ruleset =... | php | public function getPluralForm($quantity, Locale $locale)
{
if (!isset($this->rulesetsIndices[$locale->getLanguage()])) {
return self::RULE_OTHER;
}
$ruleset = $this->rulesets[$locale->getLanguage()][$this->rulesetsIndices[$locale->getLanguage()]] ?? null;
if ($ruleset =... | [
"public",
"function",
"getPluralForm",
"(",
"$",
"quantity",
",",
"Locale",
"$",
"locale",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"rulesetsIndices",
"[",
"$",
"locale",
"->",
"getLanguage",
"(",
")",
"]",
")",
")",
"{",
"return",
... | Returns matching plural form based on $quantity and $locale provided.
Plural form is one of following: zero, one, two, few, many, other.
Last one (other) is returned when number provided doesn't match any
of the rules, or there is no rules for given locale.
@param mixed $quantity A number to find plural form for (flo... | [
"Returns",
"matching",
"plural",
"form",
"based",
"on",
"$quantity",
"and",
"$locale",
"provided",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php#L147-L215 |
neos/flow-development-collection | Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php | PluralsReader.getPluralForms | public function getPluralForms(Locale $locale)
{
if (!isset($this->rulesetsIndices[$locale->getLanguage()])) {
return [self::RULE_OTHER];
}
$ruleset = $this->rulesets[$locale->getLanguage()][$this->rulesetsIndices[$locale->getLanguage()]] ?? null;
if ($ruleset === null)... | php | public function getPluralForms(Locale $locale)
{
if (!isset($this->rulesetsIndices[$locale->getLanguage()])) {
return [self::RULE_OTHER];
}
$ruleset = $this->rulesets[$locale->getLanguage()][$this->rulesetsIndices[$locale->getLanguage()]] ?? null;
if ($ruleset === null)... | [
"public",
"function",
"getPluralForms",
"(",
"Locale",
"$",
"locale",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"rulesetsIndices",
"[",
"$",
"locale",
"->",
"getLanguage",
"(",
")",
"]",
")",
")",
"{",
"return",
"[",
"self",
"::",
"R... | Returns array of plural forms available for particular locale.
@param Locale $locale Locale to return plural forms for
@return array Plural forms' names (one, zero, two, few, many, other) available for language set in this model | [
"Returns",
"array",
"of",
"plural",
"forms",
"available",
"for",
"particular",
"locale",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php#L223-L236 |
neos/flow-development-collection | Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php | PluralsReader.generateRulesets | protected function generateRulesets()
{
$model = $this->cldrRepository->getModel('supplemental/plurals');
$pluralRulesSet = $model->getRawArray('plurals');
$index = 0;
foreach ($pluralRulesSet as $pluralRulesNodeString => $pluralRules) {
$localeLanguages = $model->getAtt... | php | protected function generateRulesets()
{
$model = $this->cldrRepository->getModel('supplemental/plurals');
$pluralRulesSet = $model->getRawArray('plurals');
$index = 0;
foreach ($pluralRulesSet as $pluralRulesNodeString => $pluralRules) {
$localeLanguages = $model->getAtt... | [
"protected",
"function",
"generateRulesets",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"cldrRepository",
"->",
"getModel",
"(",
"'supplemental/plurals'",
")",
";",
"$",
"pluralRulesSet",
"=",
"$",
"model",
"->",
"getRawArray",
"(",
"'plurals'",
")",... | Generates an internal representation of plural rules which can be found
in plurals.xml CLDR file.
The properties $rulesets and $rulesetsIndices should be empty before
running this method.
@return void
@see PluralsReader::$rulesets | [
"Generates",
"an",
"internal",
"representation",
"of",
"plural",
"rules",
"which",
"can",
"be",
"found",
"in",
"plurals",
".",
"xml",
"CLDR",
"file",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php#L248-L275 |
neos/flow-development-collection | Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php | PluralsReader.parseRule | protected function parseRule($rule)
{
$parsedRule = [];
if (preg_match_all(self::PATTERN_MATCH_SUBRULE, strtolower(str_replace(' ', '', $rule)), $matches, \PREG_SET_ORDER)) {
foreach ($matches as $matchedSubrule) {
$subrule = [];
if ($matchedSubrule[1] =... | php | protected function parseRule($rule)
{
$parsedRule = [];
if (preg_match_all(self::PATTERN_MATCH_SUBRULE, strtolower(str_replace(' ', '', $rule)), $matches, \PREG_SET_ORDER)) {
foreach ($matches as $matchedSubrule) {
$subrule = [];
if ($matchedSubrule[1] =... | [
"protected",
"function",
"parseRule",
"(",
"$",
"rule",
")",
"{",
"$",
"parsedRule",
"=",
"[",
"]",
";",
"if",
"(",
"preg_match_all",
"(",
"self",
"::",
"PATTERN_MATCH_SUBRULE",
",",
"strtolower",
"(",
"str_replace",
"(",
"' '",
",",
"''",
",",
"$",
"rul... | Parses a plural rule from CLDR.
A plural rule in CLDR is a string with one or more test conditions, with
'and' or 'or' logical operators between them. Whole expression can look
like this:
n is 0 OR n is not 1 AND n mod 100 in 1..19
As CLDR documentation says, following test conditions can be used:
- is x, is not x: ... | [
"Parses",
"a",
"plural",
"rule",
"from",
"CLDR",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/I18n/Cldr/Reader/PluralsReader.php#L300-L334 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.getUriPattern | public function getUriPattern()
{
if ($this->uriPattern === null) {
$classSchema = $this->reflectionService->getClassSchema($this->objectType);
$identityProperties = $classSchema->getIdentityProperties();
if (count($identityProperties) === 0) {
$this->uriP... | php | public function getUriPattern()
{
if ($this->uriPattern === null) {
$classSchema = $this->reflectionService->getClassSchema($this->objectType);
$identityProperties = $classSchema->getIdentityProperties();
if (count($identityProperties) === 0) {
$this->uriP... | [
"public",
"function",
"getUriPattern",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"uriPattern",
"===",
"null",
")",
"{",
"$",
"classSchema",
"=",
"$",
"this",
"->",
"reflectionService",
"->",
"getClassSchema",
"(",
"$",
"this",
"->",
"objectType",
")",
... | If $this->uriPattern is specified, this will be returned, otherwise identity properties of $this->objectType
are returned in the format {property1}/{property2}/{property3}.
If $this->objectType does not contain identity properties, an empty string is returned.
@return string | [
"If",
"$this",
"-",
">",
"uriPattern",
"is",
"specified",
"this",
"will",
"be",
"returned",
"otherwise",
"identity",
"properties",
"of",
"$this",
"-",
">",
"objectType",
"are",
"returned",
"in",
"the",
"format",
"{",
"property1",
"}",
"/",
"{",
"property2",
... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L102-L114 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.matchValue | protected function matchValue($value)
{
if ($value === null || $value === '') {
return false;
}
$identifier = $this->getObjectIdentifierFromPathSegment($value);
if ($identifier === null) {
return false;
}
$this->value = ['__identity' => $identi... | php | protected function matchValue($value)
{
if ($value === null || $value === '') {
return false;
}
$identifier = $this->getObjectIdentifierFromPathSegment($value);
if ($identifier === null) {
return false;
}
$this->value = ['__identity' => $identi... | [
"protected",
"function",
"matchValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"===",
"''",
")",
"{",
"return",
"false",
";",
"}",
"$",
"identifier",
"=",
"$",
"this",
"->",
"getObjectIdentifierFromPathSeg... | Checks, whether given value can be matched.
If the value is empty, false is returned.
Otherwise the ObjectPathMappingRepository is asked for a matching ObjectPathMapping.
If that is found the identifier is stored in $this->value, otherwise this route part does not match.
@param string $value value to match, usually th... | [
"Checks",
"whether",
"given",
"value",
"can",
"be",
"matched",
".",
"If",
"the",
"value",
"is",
"empty",
"false",
"is",
"returned",
".",
"Otherwise",
"the",
"ObjectPathMappingRepository",
"is",
"asked",
"for",
"a",
"matching",
"ObjectPathMapping",
".",
"If",
"... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L126-L137 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.getObjectIdentifierFromPathSegment | protected function getObjectIdentifierFromPathSegment($pathSegment)
{
if ($this->getUriPattern() === '') {
$identifier = rawurldecode($pathSegment);
$object = $this->persistenceManager->getObjectByIdentifier($identifier, $this->objectType);
if ($object !== null) {
... | php | protected function getObjectIdentifierFromPathSegment($pathSegment)
{
if ($this->getUriPattern() === '') {
$identifier = rawurldecode($pathSegment);
$object = $this->persistenceManager->getObjectByIdentifier($identifier, $this->objectType);
if ($object !== null) {
... | [
"protected",
"function",
"getObjectIdentifierFromPathSegment",
"(",
"$",
"pathSegment",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getUriPattern",
"(",
")",
"===",
"''",
")",
"{",
"$",
"identifier",
"=",
"rawurldecode",
"(",
"$",
"pathSegment",
")",
";",
"$",
... | Retrieves the object identifier from the given $pathSegment.
If no UriPattern is set, the $pathSegment is expected to be the (URL-encoded) identifier otherwise a matching ObjectPathMapping fetched from persistence
If no matching ObjectPathMapping was found or the given $pathSegment is no valid identifier NULL is return... | [
"Retrieves",
"the",
"object",
"identifier",
"from",
"the",
"given",
"$pathSegment",
".",
"If",
"no",
"UriPattern",
"is",
"set",
"the",
"$pathSegment",
"is",
"expected",
"to",
"be",
"the",
"(",
"URL",
"-",
"encoded",
")",
"identifier",
"otherwise",
"a",
"matc... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L147-L162 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.findValueToMatch | protected function findValueToMatch($routePath)
{
if (!isset($routePath) || $routePath === '' || $routePath[0] === '/') {
return '';
}
if ($this->getUriPattern() === '') {
return parent::findValueToMatch($routePath);
}
$regexPattern = preg_quote($this-... | php | protected function findValueToMatch($routePath)
{
if (!isset($routePath) || $routePath === '' || $routePath[0] === '/') {
return '';
}
if ($this->getUriPattern() === '') {
return parent::findValueToMatch($routePath);
}
$regexPattern = preg_quote($this-... | [
"protected",
"function",
"findValueToMatch",
"(",
"$",
"routePath",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"routePath",
")",
"||",
"$",
"routePath",
"===",
"''",
"||",
"$",
"routePath",
"[",
"0",
"]",
"===",
"'/'",
")",
"{",
"return",
"''",
";"... | Returns the first part of $routePath that should be evaluated in matchValue().
If no split string is set (route part is the last in the routes uriPattern), the complete $routePart is returned.
Otherwise the part is returned that matches the specified uriPattern of this route part.
@param string $routePath The request ... | [
"Returns",
"the",
"first",
"part",
"of",
"$routePath",
"that",
"should",
"be",
"evaluated",
"in",
"matchValue",
"()",
".",
"If",
"no",
"split",
"string",
"is",
"set",
"(",
"route",
"part",
"is",
"the",
"last",
"in",
"the",
"routes",
"uriPattern",
")",
"t... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L173-L189 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.resolveValue | protected function resolveValue($value)
{
$identifier = null;
if (is_array($value) && isset($value['__identity'])) {
$identifier = $value['__identity'];
} elseif ($value instanceof $this->objectType) {
$identifier = $this->persistenceManager->getIdentifierByObject($va... | php | protected function resolveValue($value)
{
$identifier = null;
if (is_array($value) && isset($value['__identity'])) {
$identifier = $value['__identity'];
} elseif ($value instanceof $this->objectType) {
$identifier = $this->persistenceManager->getIdentifierByObject($va... | [
"protected",
"function",
"resolveValue",
"(",
"$",
"value",
")",
"{",
"$",
"identifier",
"=",
"null",
";",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"&&",
"isset",
"(",
"$",
"value",
"[",
"'__identity'",
"]",
")",
")",
"{",
"$",
"identifier",
"=... | Resolves the given entity and sets the value to a URI representation (path segment) that matches $this->uriPattern and is unique for the given object.
@param mixed $value
@return boolean true if the object could be resolved and stored in $this->value, otherwise false. | [
"Resolves",
"the",
"given",
"entity",
"and",
"sets",
"the",
"value",
"to",
"a",
"URI",
"representation",
"(",
"path",
"segment",
")",
"that",
"matches",
"$this",
"-",
">",
"uriPattern",
"and",
"is",
"unique",
"for",
"the",
"given",
"object",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L197-L214 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.getPathSegmentByIdentifier | protected function getPathSegmentByIdentifier($identifier)
{
if ($this->getUriPattern() === '') {
return rawurlencode($identifier);
}
$objectPathMapping = $this->objectPathMappingRepository->findOneByObjectTypeUriPatternAndIdentifier($this->objectType, $this->getUriPattern(), $i... | php | protected function getPathSegmentByIdentifier($identifier)
{
if ($this->getUriPattern() === '') {
return rawurlencode($identifier);
}
$objectPathMapping = $this->objectPathMappingRepository->findOneByObjectTypeUriPatternAndIdentifier($this->objectType, $this->getUriPattern(), $i... | [
"protected",
"function",
"getPathSegmentByIdentifier",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getUriPattern",
"(",
")",
"===",
"''",
")",
"{",
"return",
"rawurlencode",
"(",
"$",
"identifier",
")",
";",
"}",
"$",
"objectPathMapping"... | Generates a unique string for the given identifier according to $this->uriPattern.
If no UriPattern is set, the path segment is equal to the (URL-encoded) $identifier - otherwise a matching
ObjectPathMapping is fetched from persistence.
If no ObjectPathMapping exists for the given identifier, a new ObjectPathMapping is... | [
"Generates",
"a",
"unique",
"string",
"for",
"the",
"given",
"identifier",
"according",
"to",
"$this",
"-",
">",
"uriPattern",
".",
"If",
"no",
"UriPattern",
"is",
"set",
"the",
"path",
"segment",
"is",
"equal",
"to",
"the",
"(",
"URL",
"-",
"encoded",
"... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L226-L254 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.createPathSegmentForObject | protected function createPathSegmentForObject($object)
{
$matches = [];
preg_match_all('/(?P<dynamic>{?)(?P<content>[^}{]+)}?/', $this->getUriPattern(), $matches, PREG_SET_ORDER);
$pathSegment = '';
foreach ($matches as $match) {
if (empty($match['dynamic'])) {
... | php | protected function createPathSegmentForObject($object)
{
$matches = [];
preg_match_all('/(?P<dynamic>{?)(?P<content>[^}{]+)}?/', $this->getUriPattern(), $matches, PREG_SET_ORDER);
$pathSegment = '';
foreach ($matches as $match) {
if (empty($match['dynamic'])) {
... | [
"protected",
"function",
"createPathSegmentForObject",
"(",
"$",
"object",
")",
"{",
"$",
"matches",
"=",
"[",
"]",
";",
"preg_match_all",
"(",
"'/(?P<dynamic>{?)(?P<content>[^}{]+)}?/'",
",",
"$",
"this",
"->",
"getUriPattern",
"(",
")",
",",
"$",
"matches",
",... | Creates a URI representation (path segment) for the given object matching $this->uriPattern.
@param mixed $object object of type $this->objectType
@return string URI representation (path segment) of the given object
@throws InvalidUriPatternException | [
"Creates",
"a",
"URI",
"representation",
"(",
"path",
"segment",
")",
"for",
"the",
"given",
"object",
"matching",
"$this",
"-",
">",
"uriPattern",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L263-L288 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.storeObjectPathMapping | protected function storeObjectPathMapping($pathSegment, $identifier)
{
$objectPathMapping = new ObjectPathMapping();
$objectPathMapping->setObjectType($this->objectType);
$objectPathMapping->setUriPattern($this->getUriPattern());
$objectPathMapping->setPathSegment($pathSegment);
... | php | protected function storeObjectPathMapping($pathSegment, $identifier)
{
$objectPathMapping = new ObjectPathMapping();
$objectPathMapping->setObjectType($this->objectType);
$objectPathMapping->setUriPattern($this->getUriPattern());
$objectPathMapping->setPathSegment($pathSegment);
... | [
"protected",
"function",
"storeObjectPathMapping",
"(",
"$",
"pathSegment",
",",
"$",
"identifier",
")",
"{",
"$",
"objectPathMapping",
"=",
"new",
"ObjectPathMapping",
"(",
")",
";",
"$",
"objectPathMapping",
"->",
"setObjectType",
"(",
"$",
"this",
"->",
"obje... | Creates a new ObjectPathMapping and stores it in the repository
@param string $pathSegment
@param string|integer $identifier
@return void | [
"Creates",
"a",
"new",
"ObjectPathMapping",
"and",
"stores",
"it",
"in",
"the",
"repository"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L297-L306 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php | IdentityRoutePart.rewriteForUri | protected function rewriteForUri($value)
{
$transliteration = [
'ä' => 'ae',
'Ä' => 'Ae',
'ö' => 'oe',
'Ö' => 'Oe',
'ü' => 'ue',
'Ü' => 'Ue',
'ß' => 'ss',
];
$value = strtr($value, $transliteration);
... | php | protected function rewriteForUri($value)
{
$transliteration = [
'ä' => 'ae',
'Ä' => 'Ae',
'ö' => 'oe',
'Ö' => 'Oe',
'ü' => 'ue',
'Ü' => 'Ue',
'ß' => 'ss',
];
$value = strtr($value, $transliteration);
... | [
"protected",
"function",
"rewriteForUri",
"(",
"$",
"value",
")",
"{",
"$",
"transliteration",
"=",
"[",
"'ä' ",
"> ",
"ae',",
"",
"'Ä' ",
"> ",
"Ae',",
"",
"'ö' ",
"> ",
"oe',",
"",
"'Ö' ",
"> ",
"Oe',",
"",
"'ü' ",
"> ",
"ue',",
"",
"'Ü' ",
"> ",
... | Transforms the given string into a URI compatible format without special characters.
In the long term this should be done with proper transliteration
@param string $value
@return string
@todo use transliteration of the I18n sub package | [
"Transforms",
"the",
"given",
"string",
"into",
"a",
"URI",
"compatible",
"format",
"without",
"special",
"characters",
".",
"In",
"the",
"long",
"term",
"this",
"should",
"be",
"done",
"with",
"proper",
"transliteration"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/IdentityRoutePart.php#L316-L338 |
neos/flow-development-collection | Neos.Flow/Classes/Security/RequestPattern/ControllerObjectName.php | ControllerObjectName.matchRequest | public function matchRequest(RequestInterface $request)
{
if (!isset($this->options['controllerObjectNamePattern'])) {
throw new InvalidRequestPatternException('Missing option "controllerObjectNamePattern" in the ControllerObjectName request pattern configuration', 1446224501);
}
... | php | public function matchRequest(RequestInterface $request)
{
if (!isset($this->options['controllerObjectNamePattern'])) {
throw new InvalidRequestPatternException('Missing option "controllerObjectNamePattern" in the ControllerObjectName request pattern configuration', 1446224501);
}
... | [
"public",
"function",
"matchRequest",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'controllerObjectNamePattern'",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidRequestPatternException",
"(",
... | Matches a \Neos\Flow\Mvc\RequestInterface against its set controller object name pattern rules
@param RequestInterface $request The request that should be matched
@return boolean true if the pattern matched, false otherwise
@throws InvalidRequestPatternException | [
"Matches",
"a",
"\\",
"Neos",
"\\",
"Flow",
"\\",
"Mvc",
"\\",
"RequestInterface",
"against",
"its",
"set",
"controller",
"object",
"name",
"pattern",
"rules"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Security/RequestPattern/ControllerObjectName.php#L45-L51 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/Route.php | Route.setUriPattern | public function setUriPattern($uriPattern)
{
if (!is_string($uriPattern)) {
throw new \InvalidArgumentException(sprintf('URI Pattern must be of type string, %s given.', gettype($uriPattern)), 1223499724);
}
$this->uriPattern = $uriPattern;
$this->isParsed = false;
} | php | public function setUriPattern($uriPattern)
{
if (!is_string($uriPattern)) {
throw new \InvalidArgumentException(sprintf('URI Pattern must be of type string, %s given.', gettype($uriPattern)), 1223499724);
}
$this->uriPattern = $uriPattern;
$this->isParsed = false;
} | [
"public",
"function",
"setUriPattern",
"(",
"$",
"uriPattern",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"uriPattern",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'URI Pattern must be of type string, %s given.'",
"... | Sets the URI pattern this route should match with
@param string $uriPattern
@return void
@throws \InvalidArgumentException | [
"Sets",
"the",
"URI",
"pattern",
"this",
"route",
"should",
"match",
"with"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/Route.php#L194-L201 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/Route.php | Route.matches | public function matches(RouteContext $routeContext)
{
$httpRequest = $routeContext->getHttpRequest();
$routePath = $httpRequest->getRelativePath();
$this->matchResults = null;
$this->matchedTags = RouteTags::createEmpty();
if ($this->uriPattern === null) {
return ... | php | public function matches(RouteContext $routeContext)
{
$httpRequest = $routeContext->getHttpRequest();
$routePath = $httpRequest->getRelativePath();
$this->matchResults = null;
$this->matchedTags = RouteTags::createEmpty();
if ($this->uriPattern === null) {
return ... | [
"public",
"function",
"matches",
"(",
"RouteContext",
"$",
"routeContext",
")",
"{",
"$",
"httpRequest",
"=",
"$",
"routeContext",
"->",
"getHttpRequest",
"(",
")",
";",
"$",
"routePath",
"=",
"$",
"httpRequest",
"->",
"getRelativePath",
"(",
")",
";",
"$",
... | Checks whether $routeContext corresponds to this Route.
If all Route Parts match successfully true is returned an $this->matchResults contains an array
combining Route default values and calculated matchResults from the individual Route Parts.
@param RouteContext $routeContext The Route Context containing the current ... | [
"Checks",
"whether",
"$routeContext",
"corresponds",
"to",
"this",
"Route",
".",
"If",
"all",
"Route",
"Parts",
"match",
"successfully",
"true",
"is",
"returned",
"an",
"$this",
"-",
">",
"matchResults",
"contains",
"an",
"array",
"combining",
"Route",
"default"... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/Route.php#L370-L442 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/Route.php | Route.resolves | public function resolves(array $routeValues)
{
$this->resolvedUriConstraints = UriConstraints::create();
$this->resolvedTags = RouteTags::createEmpty();
if ($this->uriPattern === null) {
return false;
}
if (!$this->isParsed) {
$this->parse();
}... | php | public function resolves(array $routeValues)
{
$this->resolvedUriConstraints = UriConstraints::create();
$this->resolvedTags = RouteTags::createEmpty();
if ($this->uriPattern === null) {
return false;
}
if (!$this->isParsed) {
$this->parse();
}... | [
"public",
"function",
"resolves",
"(",
"array",
"$",
"routeValues",
")",
"{",
"$",
"this",
"->",
"resolvedUriConstraints",
"=",
"UriConstraints",
"::",
"create",
"(",
")",
";",
"$",
"this",
"->",
"resolvedTags",
"=",
"RouteTags",
"::",
"createEmpty",
"(",
")... | Checks whether $routeValues can be resolved to a corresponding uri.
If all Route Parts can resolve one or more of the $routeValues, true is
returned and $this->resolvedUriConstraints contains an instance of UriConstraints that can be applied
to a template URI transforming it accordingly (@see Router::resolve())
@param... | [
"Checks",
"whether",
"$routeValues",
"can",
"be",
"resolved",
"to",
"a",
"corresponding",
"uri",
".",
"If",
"all",
"Route",
"Parts",
"can",
"resolve",
"one",
"or",
"more",
"of",
"the",
"$routeValues",
"true",
"is",
"returned",
"and",
"$this",
"-",
">",
"re... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/Route.php#L454-L542 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/Route.php | Route.compareAndRemoveMatchingDefaultValues | protected function compareAndRemoveMatchingDefaultValues(array $defaults, array &$routeValues)
{
foreach ($defaults as $key => $defaultValue) {
if (!isset($routeValues[$key])) {
if ($defaultValue === '' || ($key === '@format' && strtolower($defaultValue) === 'html')) {
... | php | protected function compareAndRemoveMatchingDefaultValues(array $defaults, array &$routeValues)
{
foreach ($defaults as $key => $defaultValue) {
if (!isset($routeValues[$key])) {
if ($defaultValue === '' || ($key === '@format' && strtolower($defaultValue) === 'html')) {
... | [
"protected",
"function",
"compareAndRemoveMatchingDefaultValues",
"(",
"array",
"$",
"defaults",
",",
"array",
"&",
"$",
"routeValues",
")",
"{",
"foreach",
"(",
"$",
"defaults",
"as",
"$",
"key",
"=>",
"$",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"isset",... | Recursively iterates through the defaults of this route.
If a route value is equal to a default value, it's removed
from $routeValues.
If a value exists but is not equal to is corresponding default,
iteration is interrupted and false is returned.
@param array $defaults
@param array $routeValues
@return boolean false i... | [
"Recursively",
"iterates",
"through",
"the",
"defaults",
"of",
"this",
"route",
".",
"If",
"a",
"route",
"value",
"is",
"equal",
"to",
"a",
"default",
"value",
"it",
"s",
"removed",
"from",
"$routeValues",
".",
"If",
"a",
"value",
"exists",
"but",
"is",
... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/Route.php#L555-L581 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/Route.php | Route.extractInternalArguments | protected function extractInternalArguments(array &$arguments)
{
$internalArguments = [];
foreach ($arguments as $argumentKey => &$argumentValue) {
if (substr($argumentKey, 0, 2) === '__') {
$internalArguments[$argumentKey] = $argumentValue;
unset($argumen... | php | protected function extractInternalArguments(array &$arguments)
{
$internalArguments = [];
foreach ($arguments as $argumentKey => &$argumentValue) {
if (substr($argumentKey, 0, 2) === '__') {
$internalArguments[$argumentKey] = $argumentValue;
unset($argumen... | [
"protected",
"function",
"extractInternalArguments",
"(",
"array",
"&",
"$",
"arguments",
")",
"{",
"$",
"internalArguments",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"arguments",
"as",
"$",
"argumentKey",
"=>",
"&",
"$",
"argumentValue",
")",
"{",
"if",
"... | Removes all internal arguments (prefixed with two underscores) from the given $arguments
and returns them as array
@param array $arguments
@return array the internal arguments | [
"Removes",
"all",
"internal",
"arguments",
"(",
"prefixed",
"with",
"two",
"underscores",
")",
"from",
"the",
"given",
"$arguments",
"and",
"returns",
"them",
"as",
"array"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/Route.php#L590-L610 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/Route.php | Route.containsObject | protected function containsObject($subject)
{
if (is_object($subject)) {
return true;
}
if (!is_array($subject)) {
return false;
}
foreach ($subject as $value) {
if ($this->containsObject($value)) {
return true;
... | php | protected function containsObject($subject)
{
if (is_object($subject)) {
return true;
}
if (!is_array($subject)) {
return false;
}
foreach ($subject as $value) {
if ($this->containsObject($value)) {
return true;
... | [
"protected",
"function",
"containsObject",
"(",
"$",
"subject",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"subject",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"subject",
")",
")",
"{",
"return",
"false",
";",
... | Checks if the given subject contains an object
@param mixed $subject
@return boolean If it contains an object or not | [
"Checks",
"if",
"the",
"given",
"subject",
"contains",
"an",
"object"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/Route.php#L618-L632 |
neos/flow-development-collection | Neos.Flow/Classes/Mvc/Routing/Route.php | Route.parse | public function parse()
{
if ($this->isParsed || $this->uriPattern === null || $this->uriPattern === '') {
return;
}
$this->routeParts = [];
$currentRoutePartIsOptional = false;
if (substr($this->uriPattern, -1) === '/') {
throw new InvalidUriPatternEx... | php | public function parse()
{
if ($this->isParsed || $this->uriPattern === null || $this->uriPattern === '') {
return;
}
$this->routeParts = [];
$currentRoutePartIsOptional = false;
if (substr($this->uriPattern, -1) === '/') {
throw new InvalidUriPatternEx... | [
"public",
"function",
"parse",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isParsed",
"||",
"$",
"this",
"->",
"uriPattern",
"===",
"null",
"||",
"$",
"this",
"->",
"uriPattern",
"===",
"''",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"rout... | Iterates through all segments in $this->uriPattern and creates
appropriate RoutePart instances.
@return void
@throws InvalidRoutePartHandlerException|InvalidRouteSetupException|InvalidUriPatternException | [
"Iterates",
"through",
"all",
"segments",
"in",
"$this",
"-",
">",
"uriPattern",
"and",
"creates",
"appropriate",
"RoutePart",
"instances",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Mvc/Routing/Route.php#L641-L729 |
neos/flow-development-collection | Neos.Flow/Classes/Property/TypeConverter/ArrayConverter.php | ArrayConverter.convertFrom | public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
{
if (is_array($source)) {
return $source;
}
if (is_string($source)) {
if ($source === '') {
return []... | php | public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
{
if (is_array($source)) {
return $source;
}
if (is_string($source)) {
if ($source === '') {
return []... | [
"public",
"function",
"convertFrom",
"(",
"$",
"source",
",",
"$",
"targetType",
",",
"array",
"$",
"convertedChildProperties",
"=",
"[",
"]",
",",
"PropertyMappingConfigurationInterface",
"$",
"configuration",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
... | Convert from $source to $targetType, a noop if the source is an array.
If it is a string it will be converted according to the configured string format.
@param mixed $source
@param string $targetType
@param array $convertedChildProperties
@param PropertyMappingConfigurationInterface $configuration
@return array
@thro... | [
"Convert",
"from",
"$source",
"to",
"$targetType",
"a",
"noop",
"if",
"the",
"source",
"is",
"an",
"array",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Property/TypeConverter/ArrayConverter.php#L123-L181 |
neos/flow-development-collection | Neos.Flow/Classes/Session/TransientSession.php | TransientSession.getData | public function getData($key)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034660);
}
return (array_key_exists($key, $this->data)) ? $this->data[$key] : null;
} | php | public function getData($key)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034660);
}
return (array_key_exists($key, $this->data)) ? $this->data[$key] : null;
} | [
"public",
"function",
"getData",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
"!==",
"true",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"SessionNotStartedException",
"(",
"'The session has not been started yet.'",
",",
"1218034660",
")",... | Returns the data associated with the given key.
@param string $key An identifier for the content stored in the session.
@return mixed The data associated with the given key or NULL
@throws Exception\SessionNotStartedException | [
"Returns",
"the",
"data",
"associated",
"with",
"the",
"given",
"key",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Session/TransientSession.php#L135-L141 |
neos/flow-development-collection | Neos.Flow/Classes/Session/TransientSession.php | TransientSession.putData | public function putData($key, $data)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034661);
}
$this->data[$key] = $data;
} | php | public function putData($key, $data)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034661);
}
$this->data[$key] = $data;
} | [
"public",
"function",
"putData",
"(",
"$",
"key",
",",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
"!==",
"true",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"SessionNotStartedException",
"(",
"'The session has not been started yet.'",
","... | Stores the given data under the given key in the session
@param string $key The key under which the data should be stored
@param object $data The data to be stored
@return void
@throws Exception\SessionNotStartedException | [
"Stores",
"the",
"given",
"data",
"under",
"the",
"given",
"key",
"in",
"the",
"session"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Session/TransientSession.php#L162-L168 |
neos/flow-development-collection | Neos.Flow/Classes/Session/TransientSession.php | TransientSession.destroy | public function destroy($reason = null)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034663);
}
$this->data = [];
$this->started = false;
} | php | public function destroy($reason = null)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034663);
}
$this->data = [];
$this->started = false;
} | [
"public",
"function",
"destroy",
"(",
"$",
"reason",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
"!==",
"true",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"SessionNotStartedException",
"(",
"'The session has not been started yet.'",
",",
... | Explicitly destroys all session data
@param string $reason A reason for destroying the session – used by the LoggingAspect
@return void
@throws Exception\SessionNotStartedException | [
"Explicitly",
"destroys",
"all",
"session",
"data"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Session/TransientSession.php#L191-L198 |
neos/flow-development-collection | Neos.Flow/Classes/Session/TransientSession.php | TransientSession.addTag | public function addTag($tag)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1422551048);
}
$this->tags[$tag] = true;
} | php | public function addTag($tag)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1422551048);
}
$this->tags[$tag] = true;
} | [
"public",
"function",
"addTag",
"(",
"$",
"tag",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
"!==",
"true",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"SessionNotStartedException",
"(",
"'The session has not been started yet.'",
",",
"1422551048",
")",
... | Tags this session with the given tag.
Note that third-party libraries might also tag your session. Therefore it is
recommended to use namespaced tags such as "Acme-Demo-MySpecialTag".
@param string $tag The tag – must match be a valid cache frontend tag
@return void
@throws Exception\SessionNotStartedException
@throw... | [
"Tags",
"this",
"session",
"with",
"the",
"given",
"tag",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Session/TransientSession.php#L255-L261 |
neos/flow-development-collection | Neos.Flow/Classes/Session/TransientSession.php | TransientSession.removeTag | public function removeTag($tag)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1422551049);
}
if (isset($this->tags[$tag])) {
unset($this->tags[$tag]);
}
} | php | public function removeTag($tag)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('The session has not been started yet.', 1422551049);
}
if (isset($this->tags[$tag])) {
unset($this->tags[$tag]);
}
} | [
"public",
"function",
"removeTag",
"(",
"$",
"tag",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
"!==",
"true",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"SessionNotStartedException",
"(",
"'The session has not been started yet.'",
",",
"1422551049",
")... | Removes the specified tag from this session.
@param string $tag The tag – must match be a valid cache frontend tag
@return void
@throws Exception\SessionNotStartedException
@api | [
"Removes",
"the",
"specified",
"tag",
"from",
"this",
"session",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Session/TransientSession.php#L271-L279 |
neos/flow-development-collection | Neos.Flow/Classes/Core/LockManager.php | LockManager.lockSiteOrExit | public function lockSiteOrExit()
{
touch($this->lockFlagPathAndFilename);
$this->lockResource = fopen($this->lockPathAndFilename, 'w+');
if (!flock($this->lockResource, LOCK_EX | LOCK_NB)) {
fclose($this->lockResource);
$this->doExit();
}
} | php | public function lockSiteOrExit()
{
touch($this->lockFlagPathAndFilename);
$this->lockResource = fopen($this->lockPathAndFilename, 'w+');
if (!flock($this->lockResource, LOCK_EX | LOCK_NB)) {
fclose($this->lockResource);
$this->doExit();
}
} | [
"public",
"function",
"lockSiteOrExit",
"(",
")",
"{",
"touch",
"(",
"$",
"this",
"->",
"lockFlagPathAndFilename",
")",
";",
"$",
"this",
"->",
"lockResource",
"=",
"fopen",
"(",
"$",
"this",
"->",
"lockPathAndFilename",
",",
"'w+'",
")",
";",
"if",
"(",
... | Locks the site for further requests.
@return void
@api | [
"Locks",
"the",
"site",
"for",
"further",
"requests",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Core/LockManager.php#L115-L123 |
neos/flow-development-collection | Neos.Flow/Classes/Core/LockManager.php | LockManager.unlockSite | public function unlockSite()
{
if (is_resource($this->lockResource)) {
flock($this->lockResource, LOCK_UN);
fclose($this->lockResource);
unlink($this->lockPathAndFilename);
}
@unlink($this->lockFlagPathAndFilename);
} | php | public function unlockSite()
{
if (is_resource($this->lockResource)) {
flock($this->lockResource, LOCK_UN);
fclose($this->lockResource);
unlink($this->lockPathAndFilename);
}
@unlink($this->lockFlagPathAndFilename);
} | [
"public",
"function",
"unlockSite",
"(",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"lockResource",
")",
")",
"{",
"flock",
"(",
"$",
"this",
"->",
"lockResource",
",",
"LOCK_UN",
")",
";",
"fclose",
"(",
"$",
"this",
"->",
"lockResour... | Unlocks the site if this request has locked it.
@return void
@api | [
"Unlocks",
"the",
"site",
"if",
"this",
"request",
"has",
"locked",
"it",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Core/LockManager.php#L131-L139 |
neos/flow-development-collection | Neos.Flow/Classes/Core/LockManager.php | LockManager.doExit | protected function doExit()
{
if (FLOW_SAPITYPE === 'Web') {
header('HTTP/1.1 503 Service Temporarily Unavailable');
readfile($this->lockHoldingPage);
} else {
$expiresIn = abs((time() - self::LOCKFILE_MAXIMUM_AGE - filemtime($this->lockFlagPathAndFilename)));
... | php | protected function doExit()
{
if (FLOW_SAPITYPE === 'Web') {
header('HTTP/1.1 503 Service Temporarily Unavailable');
readfile($this->lockHoldingPage);
} else {
$expiresIn = abs((time() - self::LOCKFILE_MAXIMUM_AGE - filemtime($this->lockFlagPathAndFilename)));
... | [
"protected",
"function",
"doExit",
"(",
")",
"{",
"if",
"(",
"FLOW_SAPITYPE",
"===",
"'Web'",
")",
"{",
"header",
"(",
"'HTTP/1.1 503 Service Temporarily Unavailable'",
")",
";",
"readfile",
"(",
"$",
"this",
"->",
"lockHoldingPage",
")",
";",
"}",
"else",
"{"... | Exit and emit a message about the reason.
@return void | [
"Exit",
"and",
"emit",
"a",
"message",
"about",
"the",
"reason",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Core/LockManager.php#L146-L156 |
neos/flow-development-collection | Neos.Flow/Classes/Security/Authorization/PrivilegeManager.php | PrivilegeManager.isGranted | public function isGranted($privilegeType, $subject, &$reason = '')
{
return $this->isGrantedForRoles($this->securityContext->getRoles(), $privilegeType, $subject, $reason);
} | php | public function isGranted($privilegeType, $subject, &$reason = '')
{
return $this->isGrantedForRoles($this->securityContext->getRoles(), $privilegeType, $subject, $reason);
} | [
"public",
"function",
"isGranted",
"(",
"$",
"privilegeType",
",",
"$",
"subject",
",",
"&",
"$",
"reason",
"=",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"isGrantedForRoles",
"(",
"$",
"this",
"->",
"securityContext",
"->",
"getRoles",
"(",
")",
",",... | Returns true, if the given privilege type is granted for the given subject based
on the current security context.
@param string $privilegeType The type of privilege that should be evaluated
@param mixed $subject The subject to check privileges for
@param string $reason This variable will be filled by a message giving ... | [
"Returns",
"true",
"if",
"the",
"given",
"privilege",
"type",
"is",
"granted",
"for",
"the",
"given",
"subject",
"based",
"on",
"the",
"current",
"security",
"context",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Security/Authorization/PrivilegeManager.php#L64-L67 |
neos/flow-development-collection | Neos.Flow/Classes/Security/Authorization/PrivilegeManager.php | PrivilegeManager.isGrantedForRoles | public function isGrantedForRoles(array $roles, $privilegeType, $subject, &$reason = '')
{
$availablePrivileges = array_reduce($roles, $this->getPrivilegeByTypeReducer($privilegeType), []);
$effectivePrivileges = array_filter($availablePrivileges, $this->getPrivilegeSubjectFilter($subject));
... | php | public function isGrantedForRoles(array $roles, $privilegeType, $subject, &$reason = '')
{
$availablePrivileges = array_reduce($roles, $this->getPrivilegeByTypeReducer($privilegeType), []);
$effectivePrivileges = array_filter($availablePrivileges, $this->getPrivilegeSubjectFilter($subject));
... | [
"public",
"function",
"isGrantedForRoles",
"(",
"array",
"$",
"roles",
",",
"$",
"privilegeType",
",",
"$",
"subject",
",",
"&",
"$",
"reason",
"=",
"''",
")",
"{",
"$",
"availablePrivileges",
"=",
"array_reduce",
"(",
"$",
"roles",
",",
"$",
"this",
"->... | Returns true, if the given privilege type would be granted for the given roles and subject
@param array<Role> $roles The roles that should be evaluated
@param string $privilegeType The type of privilege that should be evaluated
@param mixed $subject The subject to check privileges for
@param string $reason This variab... | [
"Returns",
"true",
"if",
"the",
"given",
"privilege",
"type",
"would",
"be",
"granted",
"for",
"the",
"given",
"roles",
"and",
"subject"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Security/Authorization/PrivilegeManager.php#L78-L107 |
neos/flow-development-collection | Neos.Flow/Classes/Security/Authorization/PrivilegeManager.php | PrivilegeManager.isPrivilegeTargetGranted | public function isPrivilegeTargetGranted($privilegeTargetIdentifier, array $privilegeParameters = [])
{
return $this->isPrivilegeTargetGrantedForRoles($this->securityContext->getRoles(), $privilegeTargetIdentifier, $privilegeParameters);
} | php | public function isPrivilegeTargetGranted($privilegeTargetIdentifier, array $privilegeParameters = [])
{
return $this->isPrivilegeTargetGrantedForRoles($this->securityContext->getRoles(), $privilegeTargetIdentifier, $privilegeParameters);
} | [
"public",
"function",
"isPrivilegeTargetGranted",
"(",
"$",
"privilegeTargetIdentifier",
",",
"array",
"$",
"privilegeParameters",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"isPrivilegeTargetGrantedForRoles",
"(",
"$",
"this",
"->",
"securityContext",
"-... | Returns true if access is granted on the given privilege target in the current security context
@param string $privilegeTargetIdentifier The identifier of the privilege target to decide on
@param array $privilegeParameters Optional array of privilege parameters (simple key => value array)
@return boolean true if acces... | [
"Returns",
"true",
"if",
"access",
"is",
"granted",
"on",
"the",
"given",
"privilege",
"target",
"in",
"the",
"current",
"security",
"context"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Security/Authorization/PrivilegeManager.php#L116-L119 |
neos/flow-development-collection | Neos.Flow/Classes/Security/Authorization/PrivilegeManager.php | PrivilegeManager.isPrivilegeTargetGrantedForRoles | public function isPrivilegeTargetGrantedForRoles(array $roles, $privilegeTargetIdentifier, array $privilegeParameters = [])
{
$privilegeMapper = function (Role $role) use ($privilegeTargetIdentifier, $privilegeParameters) {
return $role->getPrivilegeForTarget($privilegeTargetIdentifier, $privile... | php | public function isPrivilegeTargetGrantedForRoles(array $roles, $privilegeTargetIdentifier, array $privilegeParameters = [])
{
$privilegeMapper = function (Role $role) use ($privilegeTargetIdentifier, $privilegeParameters) {
return $role->getPrivilegeForTarget($privilegeTargetIdentifier, $privile... | [
"public",
"function",
"isPrivilegeTargetGrantedForRoles",
"(",
"array",
"$",
"roles",
",",
"$",
"privilegeTargetIdentifier",
",",
"array",
"$",
"privilegeParameters",
"=",
"[",
"]",
")",
"{",
"$",
"privilegeMapper",
"=",
"function",
"(",
"Role",
"$",
"role",
")"... | Returns true if access is granted on the given privilege target in the current security context
@param array<Role> $roles The roles that should be evaluated
@param string $privilegeTargetIdentifier The identifier of the privilege target to decide on
@param array $privilegeParameters Optional array of privilege paramet... | [
"Returns",
"true",
"if",
"access",
"is",
"granted",
"on",
"the",
"given",
"privilege",
"target",
"in",
"the",
"current",
"security",
"context"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Security/Authorization/PrivilegeManager.php#L129-L149 |
neos/flow-development-collection | Neos.Eel/Classes/FlowQuery/Operations/LastOperation.php | LastOperation.evaluate | public function evaluate(FlowQuery $flowQuery, array $arguments)
{
$context = $flowQuery->getContext();
if (count($context) > 0) {
$flowQuery->setContext([end($context)]);
} else {
$flowQuery->setContext([]);
}
} | php | public function evaluate(FlowQuery $flowQuery, array $arguments)
{
$context = $flowQuery->getContext();
if (count($context) > 0) {
$flowQuery->setContext([end($context)]);
} else {
$flowQuery->setContext([]);
}
} | [
"public",
"function",
"evaluate",
"(",
"FlowQuery",
"$",
"flowQuery",
",",
"array",
"$",
"arguments",
")",
"{",
"$",
"context",
"=",
"$",
"flowQuery",
"->",
"getContext",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"context",
")",
">",
"0",
")",
"{"... | {@inheritdoc}
@param FlowQuery $flowQuery the FlowQuery object
@param array $arguments Ignored for this operation
@return void | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/FlowQuery/Operations/LastOperation.php#L35-L43 |
neos/flow-development-collection | Neos.Flow/Classes/Http/AbstractMessage.php | AbstractMessage.setHeader | public function setHeader($name, $values, $replaceExistingHeader = true)
{
switch ($name) {
case 'Content-Type':
if (is_array($values)) {
if (count($values) !== 1) {
throw new \InvalidArgumentException('The "Content-Type" header must be... | php | public function setHeader($name, $values, $replaceExistingHeader = true)
{
switch ($name) {
case 'Content-Type':
if (is_array($values)) {
if (count($values) !== 1) {
throw new \InvalidArgumentException('The "Content-Type" header must be... | [
"public",
"function",
"setHeader",
"(",
"$",
"name",
",",
"$",
"values",
",",
"$",
"replaceExistingHeader",
"=",
"true",
")",
"{",
"switch",
"(",
"$",
"name",
")",
"{",
"case",
"'Content-Type'",
":",
"if",
"(",
"is_array",
"(",
"$",
"values",
")",
")",... | Sets the specified HTTP header
DateTime objects will be converted to a string representation internally but
will be returned as DateTime objects on calling getHeader().
Please note that dates are normalized to GMT internally, so that getHeader() will return
the same point in time, but not necessarily in the same time... | [
"Sets",
"the",
"specified",
"HTTP",
"header"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Http/AbstractMessage.php#L122-L140 |
neos/flow-development-collection | Neos.Flow/Classes/Http/AbstractMessage.php | AbstractMessage.setContent | public function setContent($content)
{
$this->content = null;
if ($content === null) {
return;
}
if (TypeHandling::isSimpleType(gettype($content)) && !is_array($content)) {
$this->content = (string)$content;
}
if (is_resource($content)) {
... | php | public function setContent($content)
{
$this->content = null;
if ($content === null) {
return;
}
if (TypeHandling::isSimpleType(gettype($content)) && !is_array($content)) {
$this->content = (string)$content;
}
if (is_resource($content)) {
... | [
"public",
"function",
"setContent",
"(",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"content",
"=",
"null",
";",
"if",
"(",
"$",
"content",
"===",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"TypeHandling",
"::",
"isSimpleType",
"(",
"gettype",
... | Explicitly sets the content of the message body
@param string $content The body content
@return self This message, for method chaining
@see withBody() | [
"Explicitly",
"sets",
"the",
"content",
"of",
"the",
"message",
"body"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Http/AbstractMessage.php#L149-L165 |
neos/flow-development-collection | Neos.Flow/Classes/Http/AbstractMessage.php | AbstractMessage.setCharset | public function setCharset($charset)
{
$this->charset = $charset;
if ($this->headers->has('Content-Type')) {
$contentType = $this->headers->get('Content-Type');
if (stripos($contentType, 'text/') === 0) {
$matches = [];
if (preg_match('/(?P<co... | php | public function setCharset($charset)
{
$this->charset = $charset;
if ($this->headers->has('Content-Type')) {
$contentType = $this->headers->get('Content-Type');
if (stripos($contentType, 'text/') === 0) {
$matches = [];
if (preg_match('/(?P<co... | [
"public",
"function",
"setCharset",
"(",
"$",
"charset",
")",
"{",
"$",
"this",
"->",
"charset",
"=",
"$",
"charset",
";",
"if",
"(",
"$",
"this",
"->",
"headers",
"->",
"has",
"(",
"'Content-Type'",
")",
")",
"{",
"$",
"contentType",
"=",
"$",
"this... | Sets the character set for this message.
If the content type of this message is a text/* media type, the character
set in the respective Content-Type header will be updated by this method.
@param string $charset A valid IANA character set identifier
@return self This message, for method chaining
@see http://www.iana.... | [
"Sets",
"the",
"character",
"set",
"for",
"this",
"message",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Http/AbstractMessage.php#L190-L206 |
neos/flow-development-collection | Neos.Flow/Classes/Http/AbstractMessage.php | AbstractMessage.getHeaderLine | public function getHeaderLine($name)
{
$headerLine = $this->headers->get($name);
if ($headerLine === null) {
$headerLine = '';
}
if (is_array($headerLine)) {
$headerLine = implode(', ', $headerLine);
}
return $headerLine;
} | php | public function getHeaderLine($name)
{
$headerLine = $this->headers->get($name);
if ($headerLine === null) {
$headerLine = '';
}
if (is_array($headerLine)) {
$headerLine = implode(', ', $headerLine);
}
return $headerLine;
} | [
"public",
"function",
"getHeaderLine",
"(",
"$",
"name",
")",
"{",
"$",
"headerLine",
"=",
"$",
"this",
"->",
"headers",
"->",
"get",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"headerLine",
"===",
"null",
")",
"{",
"$",
"headerLine",
"=",
"''",
"... | Retrieves a comma-separated string of the values for a single header.
This method returns all of the header values of the given
case-insensitive header name as a string concatenated together using
a comma.
NOTE: Not all header values may be appropriately represented using
comma concatenation. For such headers, use ge... | [
"Retrieves",
"a",
"comma",
"-",
"separated",
"string",
"of",
"the",
"values",
"for",
"a",
"single",
"header",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Http/AbstractMessage.php#L382-L394 |
neos/flow-development-collection | Neos.Flow/Classes/Http/AbstractMessage.php | AbstractMessage.withHeader | public function withHeader($name, $value)
{
$newMessage = clone $this;
$newMessage->setHeader($name, $value, true);
return $newMessage;
} | php | public function withHeader($name, $value)
{
$newMessage = clone $this;
$newMessage->setHeader($name, $value, true);
return $newMessage;
} | [
"public",
"function",
"withHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"newMessage",
"=",
"clone",
"$",
"this",
";",
"$",
"newMessage",
"->",
"setHeader",
"(",
"$",
"name",
",",
"$",
"value",
",",
"true",
")",
";",
"return",
"$",
"... | Return an instance with the provided value replacing the specified header.
While header names are case-insensitive, the casing of the header will
be preserved by this function, and returned from getHeaders().
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return a... | [
"Return",
"an",
"instance",
"with",
"the",
"provided",
"value",
"replacing",
"the",
"specified",
"header",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Http/AbstractMessage.php#L411-L416 |
neos/flow-development-collection | Neos.Flow/Classes/Http/AbstractMessage.php | AbstractMessage.withAddedHeader | public function withAddedHeader($name, $value)
{
$newMessage = clone $this;
$newMessage->setHeader($name, $value);
return $newMessage;
} | php | public function withAddedHeader($name, $value)
{
$newMessage = clone $this;
$newMessage->setHeader($name, $value);
return $newMessage;
} | [
"public",
"function",
"withAddedHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"newMessage",
"=",
"clone",
"$",
"this",
";",
"$",
"newMessage",
"->",
"setHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"return",
"$",
"newMessage",... | Return an instance with the specified header appended with the given value.
Existing values for the specified header will be maintained. The new
value(s) will be appended to the existing list. If the header did not
exist previously, it will be added.
This method MUST be implemented in such a way as to retain the
immu... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"header",
"appended",
"with",
"the",
"given",
"value",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Http/AbstractMessage.php#L434-L440 |
neos/flow-development-collection | Neos.Flow/Classes/Http/AbstractMessage.php | AbstractMessage.getBody | public function getBody()
{
$streamResource = fopen('php://memory', 'r+');
if (is_resource($this->content)) {
stream_copy_to_stream($this->content, $streamResource);
} else {
fwrite($streamResource, $this->content);
}
rewind($streamResource);
... | php | public function getBody()
{
$streamResource = fopen('php://memory', 'r+');
if (is_resource($this->content)) {
stream_copy_to_stream($this->content, $streamResource);
} else {
fwrite($streamResource, $this->content);
}
rewind($streamResource);
... | [
"public",
"function",
"getBody",
"(",
")",
"{",
"$",
"streamResource",
"=",
"fopen",
"(",
"'php://memory'",
",",
"'r+'",
")",
";",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"content",
")",
")",
"{",
"stream_copy_to_stream",
"(",
"$",
"this",
"->"... | Gets the body of the message.
@return StreamInterface Returns the body as a stream. | [
"Gets",
"the",
"body",
"of",
"the",
"message",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Http/AbstractMessage.php#L467-L478 |
neos/flow-development-collection | Neos.Flow/Classes/Http/AbstractMessage.php | AbstractMessage.withBody | public function withBody(StreamInterface $body)
{
$newMessage = clone $this;
$newMessage->setContent($body->getContents());
return $newMessage;
} | php | public function withBody(StreamInterface $body)
{
$newMessage = clone $this;
$newMessage->setContent($body->getContents());
return $newMessage;
} | [
"public",
"function",
"withBody",
"(",
"StreamInterface",
"$",
"body",
")",
"{",
"$",
"newMessage",
"=",
"clone",
"$",
"this",
";",
"$",
"newMessage",
"->",
"setContent",
"(",
"$",
"body",
"->",
"getContents",
"(",
")",
")",
";",
"return",
"$",
"newMessa... | Return an instance with the specified message body.
The body MUST be a StreamInterface object.
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return a new instance that has the
new body stream.
@param StreamInterface $body Body.
@return self
@throws \InvalidArgum... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"message",
"body",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Http/AbstractMessage.php#L493-L499 |
neos/flow-development-collection | Neos.FluidAdaptor/Classes/ViewHelpers/Format/CaseViewHelper.php | CaseViewHelper.initializeArguments | public function initializeArguments()
{
$this->registerArgument('value', 'string', 'The input value. If not given, the evaluated child nodes will be used', false, null);
$this->registerArgument('mode', 'string', 'The case to apply, must be one of this\' CASE_* constants. Defaults to uppercase applic... | php | public function initializeArguments()
{
$this->registerArgument('value', 'string', 'The input value. If not given, the evaluated child nodes will be used', false, null);
$this->registerArgument('mode', 'string', 'The case to apply, must be one of this\' CASE_* constants. Defaults to uppercase applic... | [
"public",
"function",
"initializeArguments",
"(",
")",
"{",
"$",
"this",
"->",
"registerArgument",
"(",
"'value'",
",",
"'string'",
",",
"'The input value. If not given, the evaluated child nodes will be used'",
",",
"false",
",",
"null",
")",
";",
"$",
"this",
"->",
... | Initialize the arguments.
@return void
@api | [
"Initialize",
"the",
"arguments",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.FluidAdaptor/Classes/ViewHelpers/Format/CaseViewHelper.php#L107-L111 |
neos/flow-development-collection | Neos.FluidAdaptor/Classes/ViewHelpers/Format/CaseViewHelper.php | CaseViewHelper.render | public function render()
{
return self::renderStatic(['value' => $this->arguments['value'], 'mode' => $this->arguments['mode']], $this->buildRenderChildrenClosure(), $this->renderingContext);
} | php | public function render()
{
return self::renderStatic(['value' => $this->arguments['value'], 'mode' => $this->arguments['mode']], $this->buildRenderChildrenClosure(), $this->renderingContext);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"return",
"self",
"::",
"renderStatic",
"(",
"[",
"'value'",
"=>",
"$",
"this",
"->",
"arguments",
"[",
"'value'",
"]",
",",
"'mode'",
"=>",
"$",
"this",
"->",
"arguments",
"[",
"'mode'",
"]",
"]",
",",
... | Changes the case of the input string
@return string the altered string.
@throws InvalidVariableException
@api | [
"Changes",
"the",
"case",
"of",
"the",
"input",
"string"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.FluidAdaptor/Classes/ViewHelpers/Format/CaseViewHelper.php#L120-L123 |
neos/flow-development-collection | Neos.Flow/Classes/Aop/Pointcut/PointcutClassNameFilter.php | PointcutClassNameFilter.matches | public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier): bool
{
try {
$matchResult = preg_match($this->classFilterExpression, $className);
} catch (\Exception $exception) {
throw new Exception('Error in regular expression "' . $th... | php | public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier): bool
{
try {
$matchResult = preg_match($this->classFilterExpression, $className);
} catch (\Exception $exception) {
throw new Exception('Error in regular expression "' . $th... | [
"public",
"function",
"matches",
"(",
"$",
"className",
",",
"$",
"methodName",
",",
"$",
"methodDeclaringClassName",
",",
"$",
"pointcutQueryIdentifier",
")",
":",
"bool",
"{",
"try",
"{",
"$",
"matchResult",
"=",
"preg_match",
"(",
"$",
"this",
"->",
"clas... | Checks if the specified class matches with the class filter pattern
@param string $className Name of the class to check against
@param string $methodName Name of the method - not used here
@param string $methodDeclaringClassName Name of the class the method was originally declared in - not used here
@param mixed $poin... | [
"Checks",
"if",
"the",
"specified",
"class",
"matches",
"with",
"the",
"class",
"filter",
"pattern"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Aop/Pointcut/PointcutClassNameFilter.php#L74-L85 |
neos/flow-development-collection | Neos.Flow/Classes/Aop/Pointcut/PointcutClassNameFilter.php | PointcutClassNameFilter.reduceTargetClassNames | public function reduceTargetClassNames(ClassNameIndex $classNameIndex): ClassNameIndex
{
if (!preg_match('/^([^\.\(\)\{\}\[\]\?\+\$\!\|]+)/', $this->originalExpressionString, $matches)) {
return $classNameIndex;
}
$prefixFilter = $matches[1];
// We sort here to make sure... | php | public function reduceTargetClassNames(ClassNameIndex $classNameIndex): ClassNameIndex
{
if (!preg_match('/^([^\.\(\)\{\}\[\]\?\+\$\!\|]+)/', $this->originalExpressionString, $matches)) {
return $classNameIndex;
}
$prefixFilter = $matches[1];
// We sort here to make sure... | [
"public",
"function",
"reduceTargetClassNames",
"(",
"ClassNameIndex",
"$",
"classNameIndex",
")",
":",
"ClassNameIndex",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^([^\\.\\(\\)\\{\\}\\[\\]\\?\\+\\$\\!\\|]+)/'",
",",
"$",
"this",
"->",
"originalExpressionString",
",",
... | This method is used to optimize the matching process.
@param ClassNameIndex $classNameIndex
@return ClassNameIndex | [
"This",
"method",
"is",
"used",
"to",
"optimize",
"the",
"matching",
"process",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Aop/Pointcut/PointcutClassNameFilter.php#L113-L124 |
neos/flow-development-collection | Neos.FluidAdaptor/Classes/Core/Widget/AjaxWidgetComponent.php | AjaxWidgetComponent.handle | public function handle(ComponentContext $componentContext)
{
$httpRequest = $componentContext->getHttpRequest();
$widgetContext = $this->extractWidgetContext($httpRequest);
if ($widgetContext === null) {
return;
}
$componentContext = $this->prepareActionRequest($... | php | public function handle(ComponentContext $componentContext)
{
$httpRequest = $componentContext->getHttpRequest();
$widgetContext = $this->extractWidgetContext($httpRequest);
if ($widgetContext === null) {
return;
}
$componentContext = $this->prepareActionRequest($... | [
"public",
"function",
"handle",
"(",
"ComponentContext",
"$",
"componentContext",
")",
"{",
"$",
"httpRequest",
"=",
"$",
"componentContext",
"->",
"getHttpRequest",
"(",
")",
";",
"$",
"widgetContext",
"=",
"$",
"this",
"->",
"extractWidgetContext",
"(",
"$",
... | Check if the current request contains a widget context.
If so dispatch it directly, otherwise continue with the next HTTP component.
@param ComponentContext $componentContext
@return void
@throws ComponentException | [
"Check",
"if",
"the",
"current",
"request",
"contains",
"a",
"widget",
"context",
".",
"If",
"so",
"dispatch",
"it",
"directly",
"otherwise",
"continue",
"with",
"the",
"next",
"HTTP",
"component",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.FluidAdaptor/Classes/Core/Widget/AjaxWidgetComponent.php#L50-L71 |
neos/flow-development-collection | Neos.FluidAdaptor/Classes/Core/Widget/AjaxWidgetComponent.php | AjaxWidgetComponent.extractWidgetContext | protected function extractWidgetContext(Request $httpRequest)
{
if ($httpRequest->hasArgument('__widgetId')) {
return $this->ajaxWidgetContextHolder->get($httpRequest->getArgument('__widgetId'));
} elseif ($httpRequest->hasArgument('__widgetContext')) {
$serializedWidgetConte... | php | protected function extractWidgetContext(Request $httpRequest)
{
if ($httpRequest->hasArgument('__widgetId')) {
return $this->ajaxWidgetContextHolder->get($httpRequest->getArgument('__widgetId'));
} elseif ($httpRequest->hasArgument('__widgetContext')) {
$serializedWidgetConte... | [
"protected",
"function",
"extractWidgetContext",
"(",
"Request",
"$",
"httpRequest",
")",
"{",
"if",
"(",
"$",
"httpRequest",
"->",
"hasArgument",
"(",
"'__widgetId'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"ajaxWidgetContextHolder",
"->",
"get",
"(",
"$"... | Extracts the WidgetContext from the given $httpRequest.
If the request contains an argument "__widgetId" the context is fetched from the session (AjaxWidgetContextHolder).
Otherwise the argument "__widgetContext" is expected to contain the serialized WidgetContext (protected by a HMAC suffix)
@param Request $httpReque... | [
"Extracts",
"the",
"WidgetContext",
"from",
"the",
"given",
"$httpRequest",
".",
"If",
"the",
"request",
"contains",
"an",
"argument",
"__widgetId",
"the",
"context",
"is",
"fetched",
"from",
"the",
"session",
"(",
"AjaxWidgetContextHolder",
")",
".",
"Otherwise",... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.FluidAdaptor/Classes/Core/Widget/AjaxWidgetComponent.php#L81-L91 |
neos/flow-development-collection | Neos.Flow/Classes/Security/Authentication/Token/UsernamePassword.php | UsernamePassword.updateCredentials | public function updateCredentials(ActionRequest $actionRequest)
{
$httpRequest = $actionRequest->getHttpRequest();
if ($httpRequest->getMethod() !== 'POST') {
return;
}
$arguments = $actionRequest->getInternalArguments();
$username = ObjectAccess::getPropertyPath... | php | public function updateCredentials(ActionRequest $actionRequest)
{
$httpRequest = $actionRequest->getHttpRequest();
if ($httpRequest->getMethod() !== 'POST') {
return;
}
$arguments = $actionRequest->getInternalArguments();
$username = ObjectAccess::getPropertyPath... | [
"public",
"function",
"updateCredentials",
"(",
"ActionRequest",
"$",
"actionRequest",
")",
"{",
"$",
"httpRequest",
"=",
"$",
"actionRequest",
"->",
"getHttpRequest",
"(",
")",
";",
"if",
"(",
"$",
"httpRequest",
"->",
"getMethod",
"(",
")",
"!==",
"'POST'",
... | Updates the username and password credentials from the POST vars, if the POST parameters
are available. Sets the authentication status to REAUTHENTICATION_NEEDED, if credentials have been sent.
Note: You need to send the username and password in these two POST parameters:
__authentication[Neos][Flow][Security][Authent... | [
"Updates",
"the",
"username",
"and",
"password",
"credentials",
"from",
"the",
"POST",
"vars",
"if",
"the",
"POST",
"parameters",
"are",
"available",
".",
"Sets",
"the",
"authentication",
"status",
"to",
"REAUTHENTICATION_NEEDED",
"if",
"credentials",
"have",
"bee... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Security/Authentication/Token/UsernamePassword.php#L41-L57 |
neos/flow-development-collection | Neos.Flow/Classes/I18n/Cldr/Reader/CurrencyReader.php | CurrencyReader.initializeObject | public function initializeObject()
{
if ($this->cache->has('fractions')) {
$this->fractions = $this->cache->get('fractions');
} else {
$this->generateFractions();
$this->cache->set('fractions', $this->fractions);
}
} | php | public function initializeObject()
{
if ($this->cache->has('fractions')) {
$this->fractions = $this->cache->get('fractions');
} else {
$this->generateFractions();
$this->cache->set('fractions', $this->fractions);
}
} | [
"public",
"function",
"initializeObject",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
"->",
"has",
"(",
"'fractions'",
")",
")",
"{",
"$",
"this",
"->",
"fractions",
"=",
"$",
"this",
"->",
"cache",
"->",
"get",
"(",
"'fractions'",
")",
";"... | Constructs the reader, loading parsed data from cache if available.
@return void | [
"Constructs",
"the",
"reader",
"loading",
"parsed",
"data",
"from",
"cache",
"if",
"available",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/I18n/Cldr/Reader/CurrencyReader.php#L67-L75 |
neos/flow-development-collection | Neos.Flow/Classes/I18n/Cldr/Reader/CurrencyReader.php | CurrencyReader.getFraction | public function getFraction($currencyCode)
{
if (array_key_exists($currencyCode, $this->fractions)) {
return $this->fractions[$currencyCode];
}
return $this->fractions['DEFAULT'];
} | php | public function getFraction($currencyCode)
{
if (array_key_exists($currencyCode, $this->fractions)) {
return $this->fractions[$currencyCode];
}
return $this->fractions['DEFAULT'];
} | [
"public",
"function",
"getFraction",
"(",
"$",
"currencyCode",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"currencyCode",
",",
"$",
"this",
"->",
"fractions",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fractions",
"[",
"$",
"currencyCode",
"]",
... | Returns an array with keys "digits" and "rounding", each an integer.
@param string $currencyCode
@return array ['digits' => int, 'rounding => int] | [
"Returns",
"an",
"array",
"with",
"keys",
"digits",
"and",
"rounding",
"each",
"an",
"integer",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/I18n/Cldr/Reader/CurrencyReader.php#L83-L90 |
neos/flow-development-collection | Neos.Flow/Classes/I18n/Cldr/Reader/CurrencyReader.php | CurrencyReader.generateFractions | protected function generateFractions()
{
$model = $this->cldrRepository->getModel('supplemental/supplementalData');
$currencyData = $model->getRawArray('currencyData');
foreach ($currencyData['fractions'] as $fractionString) {
$currencyCode = $model->getAttributeValue($fractionS... | php | protected function generateFractions()
{
$model = $this->cldrRepository->getModel('supplemental/supplementalData');
$currencyData = $model->getRawArray('currencyData');
foreach ($currencyData['fractions'] as $fractionString) {
$currencyCode = $model->getAttributeValue($fractionS... | [
"protected",
"function",
"generateFractions",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"cldrRepository",
"->",
"getModel",
"(",
"'supplemental/supplementalData'",
")",
";",
"$",
"currencyData",
"=",
"$",
"model",
"->",
"getRawArray",
"(",
"'currencyD... | Generates an internal representation of currency fractions which can be found
in supplementalData.xml CLDR file.
@return void
@see CurrencyReader::$fractions | [
"Generates",
"an",
"internal",
"representation",
"of",
"currency",
"fractions",
"which",
"can",
"be",
"found",
"in",
"supplementalData",
".",
"xml",
"CLDR",
"file",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/I18n/Cldr/Reader/CurrencyReader.php#L99-L111 |
neos/flow-development-collection | Neos.Flow/Classes/Validation/Validator/ConjunctionValidator.php | ConjunctionValidator.validate | public function validate($value)
{
$validators = $this->getValidators();
if ($validators->count() > 0) {
$result = null;
foreach ($validators as $validator) {
if ($result === null) {
$result = $validator->validate($value);
}... | php | public function validate($value)
{
$validators = $this->getValidators();
if ($validators->count() > 0) {
$result = null;
foreach ($validators as $validator) {
if ($result === null) {
$result = $validator->validate($value);
}... | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
"{",
"$",
"validators",
"=",
"$",
"this",
"->",
"getValidators",
"(",
")",
";",
"if",
"(",
"$",
"validators",
"->",
"count",
"(",
")",
">",
"0",
")",
"{",
"$",
"result",
"=",
"null",
";",
... | Checks if the given value is valid according to the validators of the conjunction.
Every validator has to be valid, to make the whole conjunction valid.
@param mixed $value The value that should be validated
@return ErrorResult
@api | [
"Checks",
"if",
"the",
"given",
"value",
"is",
"valid",
"according",
"to",
"the",
"validators",
"of",
"the",
"conjunction",
".",
"Every",
"validator",
"has",
"to",
"be",
"valid",
"to",
"make",
"the",
"whole",
"conjunction",
"valid",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Validation/Validator/ConjunctionValidator.php#L31-L48 |
neos/flow-development-collection | Neos.Flow/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php | QueryObjectModelFactory.comparison | public function comparison(DynamicOperand $operand1, $operator, $operand2 = null)
{
return new Comparison($operand1, $operator, $operand2);
} | php | public function comparison(DynamicOperand $operand1, $operator, $operand2 = null)
{
return new Comparison($operand1, $operator, $operand2);
} | [
"public",
"function",
"comparison",
"(",
"DynamicOperand",
"$",
"operand1",
",",
"$",
"operator",
",",
"$",
"operand2",
"=",
"null",
")",
"{",
"return",
"new",
"Comparison",
"(",
"$",
"operand1",
",",
"$",
"operator",
",",
"$",
"operand2",
")",
";",
"}"
... | Filters tuples based on the outcome of a binary operation.
@param DynamicOperand $operand1 the first operand; non-null
@param string $operator the operator; one of QueryObjectModelConstants.JCR_OPERATOR_*
@param mixed $operand2 the second operand; non-null
@return Comparison the constraint; non-null
@api | [
"Filters",
"tuples",
"based",
"on",
"the",
"outcome",
"of",
"a",
"binary",
"operation",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php#L86-L89 |
neos/flow-development-collection | Neos.Flow/Classes/Security/Cryptography/Algorithms.php | Algorithms.pbkdf2 | public static function pbkdf2($password, $salt, $iterationCount, $derivedKeyLength, $algorithm = 'sha256')
{
$hashLength = strlen(hash($algorithm, null, true));
$keyBlocksToCompute = ceil($derivedKeyLength / $hashLength);
$derivedKey = '';
for ($block = 1; $block <= $keyBlocksToComp... | php | public static function pbkdf2($password, $salt, $iterationCount, $derivedKeyLength, $algorithm = 'sha256')
{
$hashLength = strlen(hash($algorithm, null, true));
$keyBlocksToCompute = ceil($derivedKeyLength / $hashLength);
$derivedKey = '';
for ($block = 1; $block <= $keyBlocksToComp... | [
"public",
"static",
"function",
"pbkdf2",
"(",
"$",
"password",
",",
"$",
"salt",
",",
"$",
"iterationCount",
",",
"$",
"derivedKeyLength",
",",
"$",
"algorithm",
"=",
"'sha256'",
")",
"{",
"$",
"hashLength",
"=",
"strlen",
"(",
"hash",
"(",
"$",
"algori... | Compute a derived key from a password based on PBKDF2
See PKCS #5 v2.0 http://tools.ietf.org/html/rfc2898 for implementation details.
The implementation is tested with test vectors from http://tools.ietf.org/html/rfc6070 .
If https://wiki.php.net/rfc/hash_pbkdf2 is ever part of PHP we should check for the
existence o... | [
"Compute",
"a",
"derived",
"key",
"from",
"a",
"password",
"based",
"on",
"PBKDF2"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Security/Cryptography/Algorithms.php#L38-L56 |
neos/flow-development-collection | Neos.Flow/Scripts/Migrations/Tools.php | Tools.getPackagesData | public static function getPackagesData($packagesPath)
{
$packagesData = array();
$packagesDirectoryIterator = new \DirectoryIterator($packagesPath);
foreach ($packagesDirectoryIterator as $categoryFileInfo) {
$category = $categoryFileInfo->getFilename();
if (!$categor... | php | public static function getPackagesData($packagesPath)
{
$packagesData = array();
$packagesDirectoryIterator = new \DirectoryIterator($packagesPath);
foreach ($packagesDirectoryIterator as $categoryFileInfo) {
$category = $categoryFileInfo->getFilename();
if (!$categor... | [
"public",
"static",
"function",
"getPackagesData",
"(",
"$",
"packagesPath",
")",
"{",
"$",
"packagesData",
"=",
"array",
"(",
")",
";",
"$",
"packagesDirectoryIterator",
"=",
"new",
"\\",
"DirectoryIterator",
"(",
"$",
"packagesPath",
")",
";",
"foreach",
"("... | Will return an array with all available packages.
The data for each entry will be an array with the key, full path to
the package (index 'path') and a category (the packages subfolder,
index 'category'). The array is indexed by package key.
@param string $packagesPath
@return array | [
"Will",
"return",
"an",
"array",
"with",
"all",
"available",
"packages",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Scripts/Migrations/Tools.php#L31-L61 |
neos/flow-development-collection | Neos.Flow/Scripts/Migrations/Tools.php | Tools.readComposerManifest | public static function readComposerManifest($pathAndFileName)
{
if (file_exists($pathAndFileName)) {
$json = file_get_contents($pathAndFileName);
return json_decode($json, true);
} else {
return null;
}
} | php | public static function readComposerManifest($pathAndFileName)
{
if (file_exists($pathAndFileName)) {
$json = file_get_contents($pathAndFileName);
return json_decode($json, true);
} else {
return null;
}
} | [
"public",
"static",
"function",
"readComposerManifest",
"(",
"$",
"pathAndFileName",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"pathAndFileName",
")",
")",
"{",
"$",
"json",
"=",
"file_get_contents",
"(",
"$",
"pathAndFileName",
")",
";",
"return",
"json_d... | Read the package manifest from the composer.json file at $pathAndFileName
@param string $pathAndFileName
@return array | [
"Read",
"the",
"package",
"manifest",
"from",
"the",
"composer",
".",
"json",
"file",
"at",
"$pathAndFileName"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Scripts/Migrations/Tools.php#L69-L77 |
neos/flow-development-collection | Neos.Flow/Scripts/Migrations/Tools.php | Tools.writeComposerManifest | public static function writeComposerManifest(array $manifest, $pathAndFilename)
{
file_put_contents($pathAndFilename, json_encode($manifest, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
} | php | public static function writeComposerManifest(array $manifest, $pathAndFilename)
{
file_put_contents($pathAndFilename, json_encode($manifest, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
} | [
"public",
"static",
"function",
"writeComposerManifest",
"(",
"array",
"$",
"manifest",
",",
"$",
"pathAndFilename",
")",
"{",
"file_put_contents",
"(",
"$",
"pathAndFilename",
",",
"json_encode",
"(",
"$",
"manifest",
",",
"JSON_UNESCAPED_SLASHES",
"|",
"JSON_PRETT... | Write the manifest to the given file.
@param array $manifest
@param string $pathAndFilename
@return void | [
"Write",
"the",
"manifest",
"to",
"the",
"given",
"file",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Scripts/Migrations/Tools.php#L86-L89 |
neos/flow-development-collection | Neos.Flow/Scripts/Migrations/Tools.php | Tools.readPackageMetaData | protected static function readPackageMetaData($pathAndFileName)
{
if (file_exists($pathAndFileName)) {
$xml = simplexml_load_file($pathAndFileName);
$meta = array();
if ($xml === false) {
$meta['description'] = '[Package.xml could not be read.]';
... | php | protected static function readPackageMetaData($pathAndFileName)
{
if (file_exists($pathAndFileName)) {
$xml = simplexml_load_file($pathAndFileName);
$meta = array();
if ($xml === false) {
$meta['description'] = '[Package.xml could not be read.]';
... | [
"protected",
"static",
"function",
"readPackageMetaData",
"(",
"$",
"pathAndFileName",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"pathAndFileName",
")",
")",
"{",
"$",
"xml",
"=",
"simplexml_load_file",
"(",
"$",
"pathAndFileName",
")",
";",
"$",
"meta",
... | Read the package metadata from the Package.xml file at $pathAndFileName
@param string $pathAndFileName
@return array|NULL | [
"Read",
"the",
"package",
"metadata",
"from",
"the",
"Package",
".",
"xml",
"file",
"at",
"$pathAndFileName"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Scripts/Migrations/Tools.php#L97-L114 |
neos/flow-development-collection | Neos.Flow/Scripts/Migrations/Tools.php | Tools.searchAndReplace | public static function searchAndReplace($search, $replace, $pathAndFilename, $regularExpression = false)
{
$pathInfo = pathinfo($pathAndFilename);
if (!isset($pathInfo['filename']) || $pathAndFilename === __FILE__) {
return false;
}
$file = file_get_contents($pathAndFile... | php | public static function searchAndReplace($search, $replace, $pathAndFilename, $regularExpression = false)
{
$pathInfo = pathinfo($pathAndFilename);
if (!isset($pathInfo['filename']) || $pathAndFilename === __FILE__) {
return false;
}
$file = file_get_contents($pathAndFile... | [
"public",
"static",
"function",
"searchAndReplace",
"(",
"$",
"search",
",",
"$",
"replace",
",",
"$",
"pathAndFilename",
",",
"$",
"regularExpression",
"=",
"false",
")",
"{",
"$",
"pathInfo",
"=",
"pathinfo",
"(",
"$",
"pathAndFilename",
")",
";",
"if",
... | Does a search and replace operation on the given file.
A simple str_replace is used, unless $regularExpression is set
to true. In that case preg_replace is used. The given patterns
are used as given, no quoting is applied!
In case $regularExpression is true, a closure can be given for
the $replace variable. It should... | [
"Does",
"a",
"search",
"and",
"replace",
"operation",
"on",
"the",
"given",
"file",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Scripts/Migrations/Tools.php#L133-L156 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.initializeStreamWrapper | public static function initializeStreamWrapper($objectManager)
{
$streamWrapperClassNames = static::getStreamWrapperImplementationClassNames($objectManager);
/** @var StreamWrapperInterface $streamWrapperClassName */
foreach ($streamWrapperClassNames as $streamWrapperClassName) {
... | php | public static function initializeStreamWrapper($objectManager)
{
$streamWrapperClassNames = static::getStreamWrapperImplementationClassNames($objectManager);
/** @var StreamWrapperInterface $streamWrapperClassName */
foreach ($streamWrapperClassNames as $streamWrapperClassName) {
... | [
"public",
"static",
"function",
"initializeStreamWrapper",
"(",
"$",
"objectManager",
")",
"{",
"$",
"streamWrapperClassNames",
"=",
"static",
"::",
"getStreamWrapperImplementationClassNames",
"(",
"$",
"objectManager",
")",
";",
"/** @var StreamWrapperInterface $streamWrappe... | Initialize StreamWrappers with this adapter
@param ObjectManagerInterface $objectManager
@return void | [
"Initialize",
"StreamWrappers",
"with",
"this",
"adapter"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L51-L63 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.createStreamWrapper | protected function createStreamWrapper($path)
{
if ($this->streamWrapper === null) {
$explodedPath = explode(':', $path, 2);
$scheme = array_shift($explodedPath);
$registeredStreamWrappers = self::$registeredStreamWrappers;
$registeredStreamWrapperForScheme = ... | php | protected function createStreamWrapper($path)
{
if ($this->streamWrapper === null) {
$explodedPath = explode(':', $path, 2);
$scheme = array_shift($explodedPath);
$registeredStreamWrappers = self::$registeredStreamWrappers;
$registeredStreamWrapperForScheme = ... | [
"protected",
"function",
"createStreamWrapper",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"streamWrapper",
"===",
"null",
")",
"{",
"$",
"explodedPath",
"=",
"explode",
"(",
"':'",
",",
"$",
"path",
",",
"2",
")",
";",
"$",
"scheme",
... | Create the internal stream wrapper if needed.
@param string $path The path to fetch the scheme from.
@return void | [
"Create",
"the",
"internal",
"stream",
"wrapper",
"if",
"needed",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L94-L103 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.dir_opendir | public function dir_opendir($path, $options)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->openDirectory($path, $options);
} | php | public function dir_opendir($path, $options)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->openDirectory($path, $options);
} | [
"public",
"function",
"dir_opendir",
"(",
"$",
"path",
",",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"createStreamWrapper",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"streamWrapper",
"->",
"openDirectory",
"(",
"$",
"path",
",",
"$",
... | Open directory handle.
This method is called in response to opendir().
@param string $path Specifies the URL that was passed to opendir().
@param int $options Whether or not to enforce safe_mode (0x04).
@return boolean true on success or false on failure. | [
"Open",
"directory",
"handle",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L129-L133 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.mkdir | public function mkdir($path, $mode, $options)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->makeDirectory($path, $mode, $options);
} | php | public function mkdir($path, $mode, $options)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->makeDirectory($path, $mode, $options);
} | [
"public",
"function",
"mkdir",
"(",
"$",
"path",
",",
"$",
"mode",
",",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"createStreamWrapper",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"streamWrapper",
"->",
"makeDirectory",
"(",
"$",
"path... | Create a directory.
This method is called in response to mkdir().
Note: In order for the appropriate error message to be returned this
method should not be defined if the wrapper does not support creating
directories.
@param string $path Directory which should be created.
@param integer $mode The value passed to mkd... | [
"Create",
"a",
"directory",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L177-L181 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.rename | public function rename($path_from, $path_to)
{
$this->createStreamWrapper($path_from);
return $this->streamWrapper->rename($path_from, $path_to);
} | php | public function rename($path_from, $path_to)
{
$this->createStreamWrapper($path_from);
return $this->streamWrapper->rename($path_from, $path_to);
} | [
"public",
"function",
"rename",
"(",
"$",
"path_from",
",",
"$",
"path_to",
")",
"{",
"$",
"this",
"->",
"createStreamWrapper",
"(",
"$",
"path_from",
")",
";",
"return",
"$",
"this",
"->",
"streamWrapper",
"->",
"rename",
"(",
"$",
"path_from",
",",
"$"... | Renames a file or directory.
This method is called in response to rename().
Should attempt to rename path_from to path_to.
Note: In order for the appropriate error message to be returned this
method should not be defined if the wrapper does not support creating
directories.
@param string $path_from The URL to the c... | [
"Renames",
"a",
"file",
"or",
"directory",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L198-L202 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.rmdir | public function rmdir($path, $options)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->removeDirectory($path, $options);
} | php | public function rmdir($path, $options)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->removeDirectory($path, $options);
} | [
"public",
"function",
"rmdir",
"(",
"$",
"path",
",",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"createStreamWrapper",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"streamWrapper",
"->",
"removeDirectory",
"(",
"$",
"path",
",",
"$",
"op... | Removes a directory.
This method is called in response to rmdir().
Note: In order for the appropriate error message to be returned this
method should not be defined if the wrapper does not support creating
directories.
@param string $path The directory URL which should be removed.
@param integer $options A bitwise m... | [
"Removes",
"a",
"directory",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L217-L221 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.stream_lock | public function stream_lock($operation)
{
if ($operation === LOCK_UN) {
return $this->streamWrapper->unlock();
} else {
return $this->streamWrapper->lock($operation);
}
} | php | public function stream_lock($operation)
{
if ($operation === LOCK_UN) {
return $this->streamWrapper->unlock();
} else {
return $this->streamWrapper->lock($operation);
}
} | [
"public",
"function",
"stream_lock",
"(",
"$",
"operation",
")",
"{",
"if",
"(",
"$",
"operation",
"===",
"LOCK_UN",
")",
"{",
"return",
"$",
"this",
"->",
"streamWrapper",
"->",
"unlock",
"(",
")",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
... | Advisory file locking.
This method is called in response to flock(), when file_put_contents()
(when flags contains LOCK_EX), stream_set_blocking() and when closing the
stream (LOCK_UN).
$operation is one of the following:
LOCK_SH to acquire a shared lock (reader).
LOCK_EX to acquire an exclusive lock (writer).
LOCK_U... | [
"Advisory",
"file",
"locking",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L296-L303 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.stream_open | public function stream_open($path, $mode, $options, &$opened_path)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->open($path, $mode, $options, $opened_path);
} | php | public function stream_open($path, $mode, $options, &$opened_path)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->open($path, $mode, $options, $opened_path);
} | [
"public",
"function",
"stream_open",
"(",
"$",
"path",
",",
"$",
"mode",
",",
"$",
"options",
",",
"&",
"$",
"opened_path",
")",
"{",
"$",
"this",
"->",
"createStreamWrapper",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"streamWrapper",
"-... | Opens file or URL.
This method is called immediately after the wrapper is initialized (f.e.
by fopen() and file_get_contents()).
$options can hold one of the following values OR'd together:
STREAM_USE_PATH
If path is relative, search for the resource using the include_path.
STREAM_REPORT_ERRORS
If this flag is set, y... | [
"Opens",
"file",
"or",
"URL",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L325-L329 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.stream_set_option | public function stream_set_option($option, $arg1, $arg2)
{
return $this->streamWrapper->setOption($option, $arg1, $arg2);
} | php | public function stream_set_option($option, $arg1, $arg2)
{
return $this->streamWrapper->setOption($option, $arg1, $arg2);
} | [
"public",
"function",
"stream_set_option",
"(",
"$",
"option",
",",
"$",
"arg1",
",",
"$",
"arg2",
")",
"{",
"return",
"$",
"this",
"->",
"streamWrapper",
"->",
"setOption",
"(",
"$",
"option",
",",
"$",
"arg1",
",",
"$",
"arg2",
")",
";",
"}"
] | Change stream options.
This method is called to set options on the stream.
$option can be one of:
STREAM_OPTION_BLOCKING (The method was called in response to stream_set_blocking())
STREAM_OPTION_READ_TIMEOUT (The method was called in response to stream_set_timeout())
STREAM_OPTION_WRITE_BUFFER (The method was called... | [
"Change",
"stream",
"options",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L394-L397 |
neos/flow-development-collection | Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php | StreamWrapperAdapter.url_stat | public function url_stat($path, $flags)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->pathStat($path, $flags);
} | php | public function url_stat($path, $flags)
{
$this->createStreamWrapper($path);
return $this->streamWrapper->pathStat($path, $flags);
} | [
"public",
"function",
"url_stat",
"(",
"$",
"path",
",",
"$",
"flags",
")",
"{",
"$",
"this",
"->",
"createStreamWrapper",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"streamWrapper",
"->",
"pathStat",
"(",
"$",
"path",
",",
"$",
"flags",
... | Retrieve information about a file.
This method is called in response to all stat() related functions.
$flags can hold one or more of the following values OR'd together:
STREAM_URL_STAT_LINK
For resources with the ability to link to other resource (such as an
HTTP Location: forward, or a filesystem symlink). This flag... | [
"Retrieve",
"information",
"about",
"a",
"file",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/ResourceManagement/Streams/StreamWrapperAdapter.php#L481-L485 |
neos/flow-development-collection | Neos.Flow/Classes/Validation/Validator/UuidValidator.php | UuidValidator.isValid | protected function isValid($value)
{
if (!is_string($value) || !preg_match(self::PATTERN_MATCH_UUID, $value)) {
$this->addError('The given subject was not a valid UUID.', 1221565853);
}
} | php | protected function isValid($value)
{
if (!is_string($value) || !preg_match(self::PATTERN_MATCH_UUID, $value)) {
$this->addError('The given subject was not a valid UUID.', 1221565853);
}
} | [
"protected",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
"||",
"!",
"preg_match",
"(",
"self",
"::",
"PATTERN_MATCH_UUID",
",",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"addError",
"... | Checks if the given value is a syntactically valid UUID.
@param mixed $value The value that should be validated
@return void
@api | [
"Checks",
"if",
"the",
"given",
"value",
"is",
"a",
"syntactically",
"valid",
"UUID",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Validation/Validator/UuidValidator.php#L37-L42 |
neos/flow-development-collection | Neos.Flow/Classes/Persistence/Doctrine/Logging/SqlLogger.php | SqlLogger.startQuery | public function startQuery($sql, array $params = null, array $types = null)
{
// this is a safeguard for when no logger might be available...
if ($this->logger !== null) {
$this->logger->log($sql, LOG_DEBUG, ['params' => $params, 'types' => $types]);
}
} | php | public function startQuery($sql, array $params = null, array $types = null)
{
// this is a safeguard for when no logger might be available...
if ($this->logger !== null) {
$this->logger->log($sql, LOG_DEBUG, ['params' => $params, 'types' => $types]);
}
} | [
"public",
"function",
"startQuery",
"(",
"$",
"sql",
",",
"array",
"$",
"params",
"=",
"null",
",",
"array",
"$",
"types",
"=",
"null",
")",
"{",
"// this is a safeguard for when no logger might be available...",
"if",
"(",
"$",
"this",
"->",
"logger",
"!==",
... | Logs a SQL statement to the system logger (DEBUG priority).
@param string $sql The SQL to be executed
@param array $params The SQL parameters
@param array $types The SQL parameter types.
@return void | [
"Logs",
"a",
"SQL",
"statement",
"to",
"the",
"system",
"logger",
"(",
"DEBUG",
"priority",
")",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Classes/Persistence/Doctrine/Logging/SqlLogger.php#L35-L41 |
neos/flow-development-collection | Neos.Flow/Migrations/Code/Version20141113121400.php | Version20141113121400.processRoles | public function processRoles(array &$configuration)
{
if (!isset($configuration['roles'])) {
return;
}
$newRolesConfiguration = array();
foreach ($configuration['roles'] as $roleIdentifier => $roleConfiguration) {
$roleIdentifier = $this->expandRoleIdentifier(... | php | public function processRoles(array &$configuration)
{
if (!isset($configuration['roles'])) {
return;
}
$newRolesConfiguration = array();
foreach ($configuration['roles'] as $roleIdentifier => $roleConfiguration) {
$roleIdentifier = $this->expandRoleIdentifier(... | [
"public",
"function",
"processRoles",
"(",
"array",
"&",
"$",
"configuration",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"configuration",
"[",
"'roles'",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"newRolesConfiguration",
"=",
"array",
"(",
")",
"... | Replaces local role identifiers ("SomeRole") by their global representation ("Current.Package:SomeRole")
and sets "parentRoles"
@param array $configuration
@return void | [
"Replaces",
"local",
"role",
"identifiers",
"(",
"SomeRole",
")",
"by",
"their",
"global",
"representation",
"(",
"Current",
".",
"Package",
":",
"SomeRole",
")",
"and",
"sets",
"parentRoles"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Migrations/Code/Version20141113121400.php#L60-L85 |
neos/flow-development-collection | Neos.Flow/Migrations/Code/Version20141113121400.php | Version20141113121400.processResources | public function processResources(array &$configuration)
{
if (!isset($configuration['resources']) || !is_array($configuration['resources'])) {
return;
}
$newPrivilegeTargetConfiguration = array();
foreach ($configuration['resources'] as $resourceType => $resourceConfigura... | php | public function processResources(array &$configuration)
{
if (!isset($configuration['resources']) || !is_array($configuration['resources'])) {
return;
}
$newPrivilegeTargetConfiguration = array();
foreach ($configuration['resources'] as $resourceType => $resourceConfigura... | [
"public",
"function",
"processResources",
"(",
"array",
"&",
"$",
"configuration",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"configuration",
"[",
"'resources'",
"]",
")",
"||",
"!",
"is_array",
"(",
"$",
"configuration",
"[",
"'resources'",
"]",
")",
... | Replaces the "resource" configuration by the new "privilegeTargets" syntax
@param array $configuration
@return void | [
"Replaces",
"the",
"resource",
"configuration",
"by",
"the",
"new",
"privilegeTargets",
"syntax"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Migrations/Code/Version20141113121400.php#L93-L131 |
neos/flow-development-collection | Neos.Flow/Migrations/Code/Version20141113121400.php | Version20141113121400.convertEntityResourceMatcher | protected function convertEntityResourceMatcher($entityType, $resourceMatcher)
{
$newMatcher = 'isType("' . $entityType . '")';
if (trim($resourceMatcher) !== 'ANY') {
$newMatcher .= ' && ' . preg_replace(array('/\bcurrent\./', '/\bthis\.([^\s]+)/'), array('context.', 'property("$1")'), ... | php | protected function convertEntityResourceMatcher($entityType, $resourceMatcher)
{
$newMatcher = 'isType("' . $entityType . '")';
if (trim($resourceMatcher) !== 'ANY') {
$newMatcher .= ' && ' . preg_replace(array('/\bcurrent\./', '/\bthis\.([^\s]+)/'), array('context.', 'property("$1")'), ... | [
"protected",
"function",
"convertEntityResourceMatcher",
"(",
"$",
"entityType",
",",
"$",
"resourceMatcher",
")",
"{",
"$",
"newMatcher",
"=",
"'isType(\"'",
".",
"$",
"entityType",
".",
"'\")'",
";",
"if",
"(",
"trim",
"(",
"$",
"resourceMatcher",
")",
"!=="... | Converts the given $resourceMatcher string to the new syntax
@param string $entityType
@param string $resourceMatcher
@return string | [
"Converts",
"the",
"given",
"$resourceMatcher",
"string",
"to",
"the",
"new",
"syntax"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Migrations/Code/Version20141113121400.php#L140-L147 |
neos/flow-development-collection | Neos.Flow/Migrations/Code/Version20141113121400.php | Version20141113121400.processAcls | public function processAcls(array &$configuration)
{
if (!isset($configuration['acls'])) {
return;
}
$newRolesConfiguration = isset($configuration['roles']) ? $configuration['roles'] : array();
foreach ($configuration['acls'] as $roleIdentifier => $aclConfiguration) {
... | php | public function processAcls(array &$configuration)
{
if (!isset($configuration['acls'])) {
return;
}
$newRolesConfiguration = isset($configuration['roles']) ? $configuration['roles'] : array();
foreach ($configuration['acls'] as $roleIdentifier => $aclConfiguration) {
... | [
"public",
"function",
"processAcls",
"(",
"array",
"&",
"$",
"configuration",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"configuration",
"[",
"'acls'",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"newRolesConfiguration",
"=",
"isset",
"(",
"$",
"co... | Removes the "acls" configuration and adds privileges to related roles
@param array $configuration
@return void | [
"Removes",
"the",
"acls",
"configuration",
"and",
"adds",
"privileges",
"to",
"related",
"roles"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Migrations/Code/Version20141113121400.php#L155-L181 |
neos/flow-development-collection | Neos.Flow/Migrations/Code/Version20141113121400.php | Version20141113121400.expandRoleIdentifier | protected function expandRoleIdentifier($roleIdentifier)
{
if (strpos($roleIdentifier, ':') !== false) {
return $roleIdentifier;
}
if (in_array($roleIdentifier, array('Everybody', 'Anonymous', 'AuthenticatedUser'))) {
return 'Neos.Flow:' . $roleIdentifier;
}
... | php | protected function expandRoleIdentifier($roleIdentifier)
{
if (strpos($roleIdentifier, ':') !== false) {
return $roleIdentifier;
}
if (in_array($roleIdentifier, array('Everybody', 'Anonymous', 'AuthenticatedUser'))) {
return 'Neos.Flow:' . $roleIdentifier;
}
... | [
"protected",
"function",
"expandRoleIdentifier",
"(",
"$",
"roleIdentifier",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"roleIdentifier",
",",
"':'",
")",
"!==",
"false",
")",
"{",
"return",
"$",
"roleIdentifier",
";",
"}",
"if",
"(",
"in_array",
"(",
"$",
... | Convert a "relative" role identifier to one that includes the package key
@param string $roleIdentifier
@return string | [
"Convert",
"a",
"relative",
"role",
"identifier",
"to",
"one",
"that",
"includes",
"the",
"package",
"key"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Flow/Migrations/Code/Version20141113121400.php#L189-L198 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/DateHelper.php | DateHelper.format | public function format($date, $format)
{
if ($date instanceof \DateTimeInterface) {
return $date->format($format);
} elseif ($date instanceof \DateInterval) {
return $date->format($format);
} elseif ($date === 'now') {
return date($format);
} else ... | php | public function format($date, $format)
{
if ($date instanceof \DateTimeInterface) {
return $date->format($format);
} elseif ($date instanceof \DateInterval) {
return $date->format($format);
} elseif ($date === 'now') {
return date($format);
} else ... | [
"public",
"function",
"format",
"(",
"$",
"date",
",",
"$",
"format",
")",
"{",
"if",
"(",
"$",
"date",
"instanceof",
"\\",
"DateTimeInterface",
")",
"{",
"return",
"$",
"date",
"->",
"format",
"(",
"$",
"format",
")",
";",
"}",
"elseif",
"(",
"$",
... | Format a date (or interval) to a string with a given format
See formatting options as in PHP date()
@param integer|string|\DateTime|\DateInterval $date
@param string $format
@return string | [
"Format",
"a",
"date",
"(",
"or",
"interval",
")",
"to",
"a",
"string",
"with",
"a",
"given",
"format"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/DateHelper.php#L58-L70 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/DateHelper.php | DateHelper.formatCldr | public function formatCldr($date, $cldrFormat, $locale = null)
{
if ($date === 'now') {
$date = new \DateTime();
} elseif (is_int($date)) {
$timestamp = $date;
$date = new \DateTime();
$date->setTimestamp($timestamp);
} elseif (!$date instanceo... | php | public function formatCldr($date, $cldrFormat, $locale = null)
{
if ($date === 'now') {
$date = new \DateTime();
} elseif (is_int($date)) {
$timestamp = $date;
$date = new \DateTime();
$date->setTimestamp($timestamp);
} elseif (!$date instanceo... | [
"public",
"function",
"formatCldr",
"(",
"$",
"date",
",",
"$",
"cldrFormat",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"date",
"===",
"'now'",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"}",
"elseif",
"(... | Format a date to a string with a given cldr format
@param integer|string|\DateTime $date
@param string $cldrFormat Format string in CLDR format (see http://cldr.unicode.org/translation/date-time)
@param null|string $locale String locale - example (de|en|ru_RU)
@return string | [
"Format",
"a",
"date",
"to",
"a",
"string",
"with",
"a",
"given",
"cldr",
"format"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/DateHelper.php#L80-L100 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/DateHelper.php | DateHelper.add | public function add($date, $interval)
{
if (!$interval instanceof \DateInterval) {
$interval = new \DateInterval($interval);
}
$result = clone $date;
return $result->add($interval);
} | php | public function add($date, $interval)
{
if (!$interval instanceof \DateInterval) {
$interval = new \DateInterval($interval);
}
$result = clone $date;
return $result->add($interval);
} | [
"public",
"function",
"add",
"(",
"$",
"date",
",",
"$",
"interval",
")",
"{",
"if",
"(",
"!",
"$",
"interval",
"instanceof",
"\\",
"DateInterval",
")",
"{",
"$",
"interval",
"=",
"new",
"\\",
"DateInterval",
"(",
"$",
"interval",
")",
";",
"}",
"$",... | Add an interval to a date and return a new DateTime object
@param \DateTime $date
@param string|\DateInterval $interval
@return \DateTime | [
"Add",
"an",
"interval",
"to",
"a",
"date",
"and",
"return",
"a",
"new",
"DateTime",
"object"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/DateHelper.php#L149-L156 |
neos/flow-development-collection | Neos.Eel/Classes/Helper/DateHelper.php | DateHelper.subtract | public function subtract($date, $interval)
{
if (!$interval instanceof \DateInterval) {
$interval = new \DateInterval($interval);
}
$result = clone $date;
return $result->sub($interval);
} | php | public function subtract($date, $interval)
{
if (!$interval instanceof \DateInterval) {
$interval = new \DateInterval($interval);
}
$result = clone $date;
return $result->sub($interval);
} | [
"public",
"function",
"subtract",
"(",
"$",
"date",
",",
"$",
"interval",
")",
"{",
"if",
"(",
"!",
"$",
"interval",
"instanceof",
"\\",
"DateInterval",
")",
"{",
"$",
"interval",
"=",
"new",
"\\",
"DateInterval",
"(",
"$",
"interval",
")",
";",
"}",
... | Subtract an interval from a date and return a new DateTime object
@param \DateTime $date
@param string|\DateInterval $interval
@return \DateTime | [
"Subtract",
"an",
"interval",
"from",
"a",
"date",
"and",
"return",
"a",
"new",
"DateTime",
"object"
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Eel/Classes/Helper/DateHelper.php#L165-L172 |
neos/flow-development-collection | Neos.Cache/Classes/Backend/ApcuBackend.php | ApcuBackend.setCache | public function setCache(FrontendInterface $cache)
{
parent::setCache($cache);
$pathHash = substr(md5($this->environmentConfiguration->getApplicationIdentifier() . $cache->getIdentifier()), 0, 12);
$this->identifierPrefix = 'Flow_' . $pathHash . '_';
} | php | public function setCache(FrontendInterface $cache)
{
parent::setCache($cache);
$pathHash = substr(md5($this->environmentConfiguration->getApplicationIdentifier() . $cache->getIdentifier()), 0, 12);
$this->identifierPrefix = 'Flow_' . $pathHash . '_';
} | [
"public",
"function",
"setCache",
"(",
"FrontendInterface",
"$",
"cache",
")",
"{",
"parent",
"::",
"setCache",
"(",
"$",
"cache",
")",
";",
"$",
"pathHash",
"=",
"substr",
"(",
"md5",
"(",
"$",
"this",
"->",
"environmentConfiguration",
"->",
"getApplication... | Initializes the identifier prefix when setting the cache.
@param FrontendInterface $cache
@return void | [
"Initializes",
"the",
"identifier",
"prefix",
"when",
"setting",
"the",
"cache",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Cache/Classes/Backend/ApcuBackend.php#L80-L86 |
neos/flow-development-collection | Neos.Cache/Classes/Backend/ApcuBackend.php | ApcuBackend.set | public function set(string $entryIdentifier, string $data, array $tags = [], int $lifetime = null)
{
if (!$this->cache instanceof FrontendInterface) {
throw new Exception('No cache frontend has been set yet via setCache().', 1232986818);
}
$tags[] = '%APCUBE%' . $this->cacheIden... | php | public function set(string $entryIdentifier, string $data, array $tags = [], int $lifetime = null)
{
if (!$this->cache instanceof FrontendInterface) {
throw new Exception('No cache frontend has been set yet via setCache().', 1232986818);
}
$tags[] = '%APCUBE%' . $this->cacheIden... | [
"public",
"function",
"set",
"(",
"string",
"$",
"entryIdentifier",
",",
"string",
"$",
"data",
",",
"array",
"$",
"tags",
"=",
"[",
"]",
",",
"int",
"$",
"lifetime",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cache",
"instanceof",
... | Saves data in the cache.
@param string $entryIdentifier An identifier for this specific cache entry
@param string $data The data to be stored
@param array $tags Tags to associate with this cache entry
@param integer $lifetime Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. ... | [
"Saves",
"data",
"in",
"the",
"cache",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Cache/Classes/Backend/ApcuBackend.php#L118-L134 |
neos/flow-development-collection | Neos.Cache/Classes/Backend/ApcuBackend.php | ApcuBackend.get | public function get(string $entryIdentifier)
{
$success = false;
$value = apcu_fetch($this->identifierPrefix . 'entry_' . $entryIdentifier, $success);
return ($success ? $value : $success);
} | php | public function get(string $entryIdentifier)
{
$success = false;
$value = apcu_fetch($this->identifierPrefix . 'entry_' . $entryIdentifier, $success);
return ($success ? $value : $success);
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"entryIdentifier",
")",
"{",
"$",
"success",
"=",
"false",
";",
"$",
"value",
"=",
"apcu_fetch",
"(",
"$",
"this",
"->",
"identifierPrefix",
".",
"'entry_'",
".",
"$",
"entryIdentifier",
",",
"$",
"success",... | Loads data from the cache.
@param string $entryIdentifier An identifier which describes the cache entry to load
@return mixed The cache entry's content as a string or false if the cache entry could not be loaded
@api | [
"Loads",
"data",
"from",
"the",
"cache",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Cache/Classes/Backend/ApcuBackend.php#L143-L148 |
neos/flow-development-collection | Neos.Cache/Classes/Backend/ApcuBackend.php | ApcuBackend.has | public function has(string $entryIdentifier): bool
{
$success = false;
apcu_fetch($this->identifierPrefix . 'entry_' . $entryIdentifier, $success);
return $success;
} | php | public function has(string $entryIdentifier): bool
{
$success = false;
apcu_fetch($this->identifierPrefix . 'entry_' . $entryIdentifier, $success);
return $success;
} | [
"public",
"function",
"has",
"(",
"string",
"$",
"entryIdentifier",
")",
":",
"bool",
"{",
"$",
"success",
"=",
"false",
";",
"apcu_fetch",
"(",
"$",
"this",
"->",
"identifierPrefix",
".",
"'entry_'",
".",
"$",
"entryIdentifier",
",",
"$",
"success",
")",
... | Checks if a cache entry with the specified identifier exists.
@param string $entryIdentifier An identifier specifying the cache entry
@return boolean true if such an entry exists, false if not
@api | [
"Checks",
"if",
"a",
"cache",
"entry",
"with",
"the",
"specified",
"identifier",
"exists",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Cache/Classes/Backend/ApcuBackend.php#L157-L162 |
neos/flow-development-collection | Neos.Cache/Classes/Backend/ApcuBackend.php | ApcuBackend.remove | public function remove(string $entryIdentifier): bool
{
$this->removeIdentifierFromAllTags($entryIdentifier);
return apcu_delete($this->identifierPrefix . 'entry_' . $entryIdentifier);
} | php | public function remove(string $entryIdentifier): bool
{
$this->removeIdentifierFromAllTags($entryIdentifier);
return apcu_delete($this->identifierPrefix . 'entry_' . $entryIdentifier);
} | [
"public",
"function",
"remove",
"(",
"string",
"$",
"entryIdentifier",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"removeIdentifierFromAllTags",
"(",
"$",
"entryIdentifier",
")",
";",
"return",
"apcu_delete",
"(",
"$",
"this",
"->",
"identifierPrefix",
".",
"'e... | Removes all cache entries matching the specified identifier.
Usually this only affects one entry but if - for what reason ever -
old entries for the identifier still exist, they are removed as well.
@param string $entryIdentifier Specifies the cache entry to remove
@return boolean true if (at least) an entry could be ... | [
"Removes",
"all",
"cache",
"entries",
"matching",
"the",
"specified",
"identifier",
".",
"Usually",
"this",
"only",
"affects",
"one",
"entry",
"but",
"if",
"-",
"for",
"what",
"reason",
"ever",
"-",
"old",
"entries",
"for",
"the",
"identifier",
"still",
"exi... | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Cache/Classes/Backend/ApcuBackend.php#L173-L177 |
neos/flow-development-collection | Neos.Cache/Classes/Backend/ApcuBackend.php | ApcuBackend.findIdentifiersByTag | public function findIdentifiersByTag(string $tag): array
{
$success = false;
$identifiers = apcu_fetch($this->identifierPrefix . 'tag_' . $tag, $success);
if ($success === false) {
return [];
}
return (array) $identifiers;
} | php | public function findIdentifiersByTag(string $tag): array
{
$success = false;
$identifiers = apcu_fetch($this->identifierPrefix . 'tag_' . $tag, $success);
if ($success === false) {
return [];
}
return (array) $identifiers;
} | [
"public",
"function",
"findIdentifiersByTag",
"(",
"string",
"$",
"tag",
")",
":",
"array",
"{",
"$",
"success",
"=",
"false",
";",
"$",
"identifiers",
"=",
"apcu_fetch",
"(",
"$",
"this",
"->",
"identifierPrefix",
".",
"'tag_'",
".",
"$",
"tag",
",",
"$... | Finds and returns all cache entry identifiers which are tagged by the
specified tag.
@param string $tag The tag to search for
@return array An array with identifiers of all matching entries. An empty array if no entries matched
@api | [
"Finds",
"and",
"returns",
"all",
"cache",
"entry",
"identifiers",
"which",
"are",
"tagged",
"by",
"the",
"specified",
"tag",
"."
] | train | https://github.com/neos/flow-development-collection/blob/a4484ef2a57e050dc9bd87c8481eeb250c7a36fa/Neos.Cache/Classes/Backend/ApcuBackend.php#L187-L195 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.