id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
27,200 | doganoo/PHPAlgorithms | src/Datastructure/Lists/LinkedLists/SinglyLinkedList.php | SinglyLinkedList.prepend | public function prepend(?Node $node): bool {
if ($node === null) {
return false;
}
$node->setNext($this->getHead());
$this->setHead($node);
return true;
} | php | public function prepend(?Node $node): bool {
if ($node === null) {
return false;
}
$node->setNext($this->getHead());
$this->setHead($node);
return true;
} | [
"public",
"function",
"prepend",
"(",
"?",
"Node",
"$",
"node",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"node",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"$",
"node",
"->",
"setNext",
"(",
"$",
"this",
"->",
"getHead",
"(",
")",
")",
... | the prepend method simply checks first if the node is still valid.
If it does not equal to null, the next pointer of the new node is
set to head and the head is set to the new node in order to create
the new head.
@param \doganoo\PHPAlgorithms\Datastructure\Lists\Node $node
@return bool | [
"the",
"prepend",
"method",
"simply",
"checks",
"first",
"if",
"the",
"node",
"is",
"still",
"valid",
".",
"If",
"it",
"does",
"not",
"equal",
"to",
"null",
"the",
"next",
"pointer",
"of",
"the",
"new",
"node",
"is",
"set",
"to",
"head",
"and",
"the",
... | 7d07d4b1970958defda3c88188b7683ec999735f | https://github.com/doganoo/PHPAlgorithms/blob/7d07d4b1970958defda3c88188b7683ec999735f/src/Datastructure/Lists/LinkedLists/SinglyLinkedList.php#L78-L85 |
27,201 | doganoo/PHPAlgorithms | src/Datastructure/Graph/Tree/Trie/Trie.php | Trie._countWords | private function _countWords(?Node $node): int {
$result = 0;
if (null === $node) return $result;
if ($node->isEndOfWordNode()) $result++;
for ($i = 0; $i < self::ALPHABET_SIZE; $i++) {
if ($node->hasChild($i)) {
$child = $node->getChildNode($i);
... | php | private function _countWords(?Node $node): int {
$result = 0;
if (null === $node) return $result;
if ($node->isEndOfWordNode()) $result++;
for ($i = 0; $i < self::ALPHABET_SIZE; $i++) {
if ($node->hasChild($i)) {
$child = $node->getChildNode($i);
... | [
"private",
"function",
"_countWords",
"(",
"?",
"Node",
"$",
"node",
")",
":",
"int",
"{",
"$",
"result",
"=",
"0",
";",
"if",
"(",
"null",
"===",
"$",
"node",
")",
"return",
"$",
"result",
";",
"if",
"(",
"$",
"node",
"->",
"isEndOfWordNode",
"(",... | helper method for counting number of words in the trie
@param Node $node
@return int | [
"helper",
"method",
"for",
"counting",
"number",
"of",
"words",
"in",
"the",
"trie"
] | 7d07d4b1970958defda3c88188b7683ec999735f | https://github.com/doganoo/PHPAlgorithms/blob/7d07d4b1970958defda3c88188b7683ec999735f/src/Datastructure/Graph/Tree/Trie/Trie.php#L136-L147 |
27,202 | doganoo/PHPAlgorithms | src/Datastructure/Lists/Node.php | Node.size | public function size() {
/** @var Node $node */
$node = $this->next;
$size = 1;
while ($node !== null) {
$size++;
$node = $node->getNext();
}
return $size;
} | php | public function size() {
/** @var Node $node */
$node = $this->next;
$size = 1;
while ($node !== null) {
$size++;
$node = $node->getNext();
}
return $size;
} | [
"public",
"function",
"size",
"(",
")",
"{",
"/** @var Node $node */",
"$",
"node",
"=",
"$",
"this",
"->",
"next",
";",
"$",
"size",
"=",
"1",
";",
"while",
"(",
"$",
"node",
"!==",
"null",
")",
"{",
"$",
"size",
"++",
";",
"$",
"node",
"=",
"$"... | counts the number of nodes
@return int | [
"counts",
"the",
"number",
"of",
"nodes"
] | 7d07d4b1970958defda3c88188b7683ec999735f | https://github.com/doganoo/PHPAlgorithms/blob/7d07d4b1970958defda3c88188b7683ec999735f/src/Datastructure/Lists/Node.php#L68-L78 |
27,203 | doganoo/PHPAlgorithms | src/Datastructure/Graph/Tree/BinarySearchTree.php | BinarySearchTree.createFromArrayWithMinimumHeight | public static function createFromArrayWithMinimumHeight(?array $array): ?BinarySearchTree {
if (null === $array) {
return null;
}
$tree = new BinarySearchTree();
if (0 === \count($array)) {
return $tree;
}
$sort = new MergeSort();
$array = ... | php | public static function createFromArrayWithMinimumHeight(?array $array): ?BinarySearchTree {
if (null === $array) {
return null;
}
$tree = new BinarySearchTree();
if (0 === \count($array)) {
return $tree;
}
$sort = new MergeSort();
$array = ... | [
"public",
"static",
"function",
"createFromArrayWithMinimumHeight",
"(",
"?",
"array",
"$",
"array",
")",
":",
"?",
"BinarySearchTree",
"{",
"if",
"(",
"null",
"===",
"$",
"array",
")",
"{",
"return",
"null",
";",
"}",
"$",
"tree",
"=",
"new",
"BinarySearc... | converts an array to a BST with minimum height.
@param array|null $array
@return BinarySearchTree|null | [
"converts",
"an",
"array",
"to",
"a",
"BST",
"with",
"minimum",
"height",
"."
] | 7d07d4b1970958defda3c88188b7683ec999735f | https://github.com/doganoo/PHPAlgorithms/blob/7d07d4b1970958defda3c88188b7683ec999735f/src/Datastructure/Graph/Tree/BinarySearchTree.php#L115-L129 |
27,204 | doganoo/PHPAlgorithms | src/Datastructure/Graph/Tree/BinarySearchTree.php | BinarySearchTree.search | public function search($value): ?BinarySearchNode {
/** @var BinarySearchNode $node */
$node = $this->getRoot();
while (null !== $node) {
if (Comparator::equals($value, $node->getValue())) {
return $node;
} else if (Comparator::lessThan($value, $node->getV... | php | public function search($value): ?BinarySearchNode {
/** @var BinarySearchNode $node */
$node = $this->getRoot();
while (null !== $node) {
if (Comparator::equals($value, $node->getValue())) {
return $node;
} else if (Comparator::lessThan($value, $node->getV... | [
"public",
"function",
"search",
"(",
"$",
"value",
")",
":",
"?",
"BinarySearchNode",
"{",
"/** @var BinarySearchNode $node */",
"$",
"node",
"=",
"$",
"this",
"->",
"getRoot",
"(",
")",
";",
"while",
"(",
"null",
"!==",
"$",
"node",
")",
"{",
"if",
"(",... | searches a value
@param $value
@return BinarySearchNode|null
@throws InvalidSearchComparisionException | [
"searches",
"a",
"value"
] | 7d07d4b1970958defda3c88188b7683ec999735f | https://github.com/doganoo/PHPAlgorithms/blob/7d07d4b1970958defda3c88188b7683ec999735f/src/Datastructure/Graph/Tree/BinarySearchTree.php#L164-L179 |
27,205 | ibrandcc/laravel-sms | src/Sms.php | Sms.checkAttempts | private function checkAttempts($code)
{
$maxAttempts = config('ibrand.sms.code.maxAttempts');
if ($code->expireAt > Carbon::now() && $code->attempts < $maxAttempts) {
return false;
}
return true;
} | php | private function checkAttempts($code)
{
$maxAttempts = config('ibrand.sms.code.maxAttempts');
if ($code->expireAt > Carbon::now() && $code->attempts < $maxAttempts) {
return false;
}
return true;
} | [
"private",
"function",
"checkAttempts",
"(",
"$",
"code",
")",
"{",
"$",
"maxAttempts",
"=",
"config",
"(",
"'ibrand.sms.code.maxAttempts'",
")",
";",
"if",
"(",
"$",
"code",
"->",
"expireAt",
">",
"Carbon",
"::",
"now",
"(",
")",
"&&",
"$",
"code",
"->"... | Check attempt times.
@param $code
@return bool | [
"Check",
"attempt",
"times",
"."
] | 6fd0325128721d0096faa6557e62e64886d6f737 | https://github.com/ibrandcc/laravel-sms/blob/6fd0325128721d0096faa6557e62e64886d6f737/src/Sms.php#L173-L182 |
27,206 | orchestral/kernel | src/Database/Console/Migrations/Packages.php | Packages.getPackageMigrationPaths | protected function getPackageMigrationPaths(string $package): array
{
return collect($this->option('path') ?: 'database/migrations')
->map(function ($path) use ($package) {
return $this->packagePath.'/'.$package.'/'.$path;
})->all();
} | php | protected function getPackageMigrationPaths(string $package): array
{
return collect($this->option('path') ?: 'database/migrations')
->map(function ($path) use ($package) {
return $this->packagePath.'/'.$package.'/'.$path;
})->all();
} | [
"protected",
"function",
"getPackageMigrationPaths",
"(",
"string",
"$",
"package",
")",
":",
"array",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"option",
"(",
"'path'",
")",
"?",
":",
"'database/migrations'",
")",
"->",
"map",
"(",
"function",
"(",
... | Get the path to the package migration directory.
@param string $package
@return array | [
"Get",
"the",
"path",
"to",
"the",
"package",
"migration",
"directory",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Database/Console/Migrations/Packages.php#L35-L41 |
27,207 | melisplatform/melis-core | src/Controller/PlatformsController.php | PlatformsController.renderPlatformGenericFormAction | public function renderPlatformGenericFormAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
// declare the Tool service that we will be using to completely create our tool.
$melisTool = $this->getServiceLocator()->get('MelisCoreTool');
// tell the To... | php | public function renderPlatformGenericFormAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
// declare the Tool service that we will be using to completely create our tool.
$melisTool = $this->getServiceLocator()->get('MelisCoreTool');
// tell the To... | [
"public",
"function",
"renderPlatformGenericFormAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"// declare the Tool service that we will be using to completely create our to... | Renders the Generic form of the Platform
for creating new and updating new platform
@return \Zend\View\Model\ViewModel | [
"Renders",
"the",
"Generic",
"form",
"of",
"the",
"Platform",
"for",
"creating",
"new",
"and",
"updating",
"new",
"platform"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformsController.php#L149-L186 |
27,208 | melisplatform/melis-core | src/Controller/PlatformsController.php | PlatformsController.deletePlatformAction | public function deletePlatformAction()
{
$response = array();
$this->getEventManager()->trigger('meliscore_platform_delete_start', $this, $response);
$translator = $this->getServiceLocator()->get('translator');
$platformTable = $this->getServiceLocator()->get('MelisCoreTablePlatform'... | php | public function deletePlatformAction()
{
$response = array();
$this->getEventManager()->trigger('meliscore_platform_delete_start', $this, $response);
$translator = $this->getServiceLocator()->get('translator');
$platformTable = $this->getServiceLocator()->get('MelisCoreTablePlatform'... | [
"public",
"function",
"deletePlatformAction",
"(",
")",
"{",
"$",
"response",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"getEventManager",
"(",
")",
"->",
"trigger",
"(",
"'meliscore_platform_delete_start'",
",",
"$",
"this",
",",
"$",
"response",
")",... | Deletion of the platform
@return \Zend\View\Model\JsonModel | [
"Deletion",
"of",
"the",
"platform"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformsController.php#L404-L453 |
27,209 | melisplatform/melis-core | src/Controller/PlatformsController.php | PlatformsController.hasAccess | private function hasAccess($key): bool
{
$hasAccess = $this->getServiceLocator()->get('MelisCoreRights')->canAccess($key);
return $hasAccess;
} | php | private function hasAccess($key): bool
{
$hasAccess = $this->getServiceLocator()->get('MelisCoreRights')->canAccess($key);
return $hasAccess;
} | [
"private",
"function",
"hasAccess",
"(",
"$",
"key",
")",
":",
"bool",
"{",
"$",
"hasAccess",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreRights'",
")",
"->",
"canAccess",
"(",
"$",
"key",
")",
";",
"return",
"$"... | Checks whether the user has access to this tools or not
@param $key
@return bool | [
"Checks",
"whether",
"the",
"user",
"has",
"access",
"to",
"this",
"tools",
"or",
"not"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformsController.php#L489-L494 |
27,210 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.checkFormAction | public function checkFormAction()
{
$request = $this->getRequest();
$success = 0;
$errors = [];
if ($request->isPost()) {
$formInputs = $this->getTool('meliscore', 'melis_core_gdpr_tool')->sanitizeRecursive(get_object_vars($request->getPost()), [], true);
$fo... | php | public function checkFormAction()
{
$request = $this->getRequest();
$success = 0;
$errors = [];
if ($request->isPost()) {
$formInputs = $this->getTool('meliscore', 'melis_core_gdpr_tool')->sanitizeRecursive(get_object_vars($request->getPost()), [], true);
$fo... | [
"public",
"function",
"checkFormAction",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"success",
"=",
"0",
";",
"$",
"errors",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"request",
"->",
"isPost",
"(",
")",
")... | This will get the data from the service which will get
user info from modules that listens to the event.
@return JsonModel | [
"This",
"will",
"get",
"the",
"data",
"from",
"the",
"service",
"which",
"will",
"get",
"user",
"info",
"from",
"modules",
"that",
"listens",
"to",
"the",
"event",
"."
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L25-L50 |
27,211 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.melisCoreGdprExtractSelectedAction | public function melisCoreGdprExtractSelectedAction()
{
$idsToBeExtracted = $this->getRequest()->getPost('id');
/** @var \MelisCore\Service\MelisCoreGdprService $melisCoreGdprService */
$melisCoreGdprService = $this->getServiceLocator()->get('MelisCoreGdprService');
$xml = $melisCore... | php | public function melisCoreGdprExtractSelectedAction()
{
$idsToBeExtracted = $this->getRequest()->getPost('id');
/** @var \MelisCore\Service\MelisCoreGdprService $melisCoreGdprService */
$melisCoreGdprService = $this->getServiceLocator()->get('MelisCoreGdprService');
$xml = $melisCore... | [
"public",
"function",
"melisCoreGdprExtractSelectedAction",
"(",
")",
"{",
"$",
"idsToBeExtracted",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getPost",
"(",
"'id'",
")",
";",
"/** @var \\MelisCore\\Service\\MelisCoreGdprService $melisCoreGdprService */",
"$",... | This will generate an xml file from the data based on the ids
@return HttpResponse | [
"This",
"will",
"generate",
"an",
"xml",
"file",
"from",
"the",
"data",
"based",
"on",
"the",
"ids"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L56-L83 |
27,212 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.melisCoreGdprDeleteSelectedAction | public function melisCoreGdprDeleteSelectedAction()
{
$request = $this->getRequest();
$success = 0;
if ($request->isPost()) {
$idsToBeDeleted = get_object_vars($request->getPost());
$melisCoreGdprService = $this->getServiceLocator()->get('MelisCoreGdprService');
... | php | public function melisCoreGdprDeleteSelectedAction()
{
$request = $this->getRequest();
$success = 0;
if ($request->isPost()) {
$idsToBeDeleted = get_object_vars($request->getPost());
$melisCoreGdprService = $this->getServiceLocator()->get('MelisCoreGdprService');
... | [
"public",
"function",
"melisCoreGdprDeleteSelectedAction",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"success",
"=",
"0",
";",
"if",
"(",
"$",
"request",
"->",
"isPost",
"(",
")",
")",
"{",
"$",
"idsToBeDe... | This will delete the data based on the selected ids
@return JsonModel | [
"This",
"will",
"delete",
"the",
"data",
"based",
"on",
"the",
"selected",
"ids"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L90-L112 |
27,213 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.renderMelisCoreGdprContainerAction | public function renderMelisCoreGdprContainerAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | php | public function renderMelisCoreGdprContainerAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | [
"public",
"function",
"renderMelisCoreGdprContainerAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
... | Container for the Gdpr page
which will call all interface
or zones inside of it which are
header and content
@return view model | [
"Container",
"for",
"the",
"Gdpr",
"page",
"which",
"will",
"call",
"all",
"interface",
"or",
"zones",
"inside",
"of",
"it",
"which",
"are",
"header",
"and",
"content"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L121-L129 |
27,214 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.renderMelisCoreGdprHeaderAction | public function renderMelisCoreGdprHeaderAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | php | public function renderMelisCoreGdprHeaderAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | [
"public",
"function",
"renderMelisCoreGdprHeaderAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"v... | Header for the Gdpr page
displays the title and the
description of the page
@return view model | [
"Header",
"for",
"the",
"Gdpr",
"page",
"displays",
"the",
"title",
"and",
"the",
"description",
"of",
"the",
"page"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L137-L145 |
27,215 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.renderMelisCoreGdprContentAction | public function renderMelisCoreGdprContentAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | php | public function renderMelisCoreGdprContentAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | [
"public",
"function",
"renderMelisCoreGdprContentAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"... | Content of the Gdpr page
which will call all the interfaces
under it. which are search form
and tabs
@return ViewModel | [
"Content",
"of",
"the",
"Gdpr",
"page",
"which",
"will",
"call",
"all",
"the",
"interfaces",
"under",
"it",
".",
"which",
"are",
"search",
"form",
"and",
"tabs"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L154-L162 |
27,216 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.renderMelisCoreGdprSearchFormAction | public function renderMelisCoreGdprSearchFormAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$form = $this->getTool('meliscore', 'melis_core_gdpr_tool')->getForm('melis_core_gdpr_search_form');
$view = new ViewModel();
$view->melisKey = $melisKey;
$view->... | php | public function renderMelisCoreGdprSearchFormAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$form = $this->getTool('meliscore', 'melis_core_gdpr_tool')->getForm('melis_core_gdpr_search_form');
$view = new ViewModel();
$view->melisKey = $melisKey;
$view->... | [
"public",
"function",
"renderMelisCoreGdprSearchFormAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"getTool",
"(",
"'mel... | Search form of the Gdpr page
which will be used for the
searching of user data
@return view model | [
"Search",
"form",
"of",
"the",
"Gdpr",
"page",
"which",
"will",
"be",
"used",
"for",
"the",
"searching",
"of",
"user",
"data"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L170-L181 |
27,217 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.renderMelisCoreGdprTabsAction | public function renderMelisCoreGdprTabsAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$show = $this->params()->fromQuery('show', false);
$formData = $this->params()->fromQuery('formData', []);
if (!empty($formData)) {
$finalData = [];
for... | php | public function renderMelisCoreGdprTabsAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$show = $this->params()->fromQuery('show', false);
$formData = $this->params()->fromQuery('formData', []);
if (!empty($formData)) {
$finalData = [];
for... | [
"public",
"function",
"renderMelisCoreGdprTabsAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"show",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",... | The tabs that will show the records of user in every module
@return view model | [
"The",
"tabs",
"that",
"will",
"show",
"the",
"records",
"of",
"user",
"in",
"every",
"module"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L187-L212 |
27,218 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.getTool | private function getTool($pluginKey, $toolKey)
{
$tool = $this->getServiceLocator()->get('MelisCoreTool');
$tool->setMelisToolKey($pluginKey, $toolKey);
return $tool;
} | php | private function getTool($pluginKey, $toolKey)
{
$tool = $this->getServiceLocator()->get('MelisCoreTool');
$tool->setMelisToolKey($pluginKey, $toolKey);
return $tool;
} | [
"private",
"function",
"getTool",
"(",
"$",
"pluginKey",
",",
"$",
"toolKey",
")",
"{",
"$",
"tool",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreTool'",
")",
";",
"$",
"tool",
"->",
"setMelisToolKey",
"(",
"$",
"... | Gets the tool
@param plugin key
@param tool key
@return array|object | [
"Gets",
"the",
"tool"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L221-L227 |
27,219 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.getForm | private function getForm($formConfig)
{
$factory = new \Zend\Form\Factory();
$formElements = $this->serviceLocator->get('FormElementManager');
$factory->setFormElementManager($formElements);
$form = $factory->createForm($formConfig);
return $form;
} | php | private function getForm($formConfig)
{
$factory = new \Zend\Form\Factory();
$formElements = $this->serviceLocator->get('FormElementManager');
$factory->setFormElementManager($formElements);
$form = $factory->createForm($formConfig);
return $form;
} | [
"private",
"function",
"getForm",
"(",
"$",
"formConfig",
")",
"{",
"$",
"factory",
"=",
"new",
"\\",
"Zend",
"\\",
"Form",
"\\",
"Factory",
"(",
")",
";",
"$",
"formElements",
"=",
"$",
"this",
"->",
"serviceLocator",
"->",
"get",
"(",
"'FormElementMana... | Gets the form
@param formConfig
@return \Zend\Form\ElementInterface | [
"Gets",
"the",
"form"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L234-L242 |
27,220 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.getFormConfig | private function getFormConfig($formPath, $form)
{
$melisCoreConfig = $this->getServiceLocator()->get('MelisCoreConfig');
$appConfigForm = $melisCoreConfig->getFormMergedAndOrdered($formPath, $form);
return $appConfigForm;
} | php | private function getFormConfig($formPath, $form)
{
$melisCoreConfig = $this->getServiceLocator()->get('MelisCoreConfig');
$appConfigForm = $melisCoreConfig->getFormMergedAndOrdered($formPath, $form);
return $appConfigForm;
} | [
"private",
"function",
"getFormConfig",
"(",
"$",
"formPath",
",",
"$",
"form",
")",
"{",
"$",
"melisCoreConfig",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreConfig'",
")",
";",
"$",
"appConfigForm",
"=",
"$",
"melis... | This will get the form config
@param $formPath
@param $form
@return mixed | [
"This",
"will",
"get",
"the",
"form",
"config"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L250-L256 |
27,221 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.downloadXml | private function downloadXml($fileName, $xml)
{
//$response = new HttpResponse();
$response = $this->getResponse();
$headers = $response->getHeaders();
$headers->addHeaderLine('Content-Type', 'text/xml; charset=utf-8');
$headers->addHeaderLine('Content-Disposition', "attach... | php | private function downloadXml($fileName, $xml)
{
//$response = new HttpResponse();
$response = $this->getResponse();
$headers = $response->getHeaders();
$headers->addHeaderLine('Content-Type', 'text/xml; charset=utf-8');
$headers->addHeaderLine('Content-Disposition', "attach... | [
"private",
"function",
"downloadXml",
"(",
"$",
"fileName",
",",
"$",
"xml",
")",
"{",
"//$response = new HttpResponse();",
"$",
"response",
"=",
"$",
"this",
"->",
"getResponse",
"(",
")",
";",
"$",
"headers",
"=",
"$",
"response",
"->",
"getHeaders",
"(",
... | This will download the xml as a file
@param file name
@param xml
@return HttpResponse | [
"This",
"will",
"download",
"the",
"xml",
"as",
"a",
"file"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L264-L279 |
27,222 | melisplatform/melis-core | src/Controller/MelisCoreGdprController.php | MelisCoreGdprController.getFormErrors | private function getFormErrors($errors, $formConfig)
{
foreach ($errors as $errorKey => $errorValue) {
foreach ($formConfig['elements'] as $elementKey => $elementValue) {
if ($elementValue['spec']['name'] == $errorKey && !empty($elementValue['spec']['options']['label'])) {
... | php | private function getFormErrors($errors, $formConfig)
{
foreach ($errors as $errorKey => $errorValue) {
foreach ($formConfig['elements'] as $elementKey => $elementValue) {
if ($elementValue['spec']['name'] == $errorKey && !empty($elementValue['spec']['options']['label'])) {
... | [
"private",
"function",
"getFormErrors",
"(",
"$",
"errors",
",",
"$",
"formConfig",
")",
"{",
"foreach",
"(",
"$",
"errors",
"as",
"$",
"errorKey",
"=>",
"$",
"errorValue",
")",
"{",
"foreach",
"(",
"$",
"formConfig",
"[",
"'elements'",
"]",
"as",
"$",
... | This will get the errors of the form
@param $errors
@param $formConfig
@return mixed | [
"This",
"will",
"get",
"the",
"errors",
"of",
"the",
"form"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/MelisCoreGdprController.php#L287-L299 |
27,223 | UseMuffin/Tokenize | src/Model/Behavior/TokenizeBehavior.php | TokenizeBehavior.initialize | public function initialize(array $config)
{
$this->verifyConfig();
$this->_table->hasMany($this->getConfig('associationAlias'), [
'className' => 'Muffin/Tokenize.Tokens',
'foreignKey' => 'foreign_key',
'conditions' => [
'foreign_alias' => $this->_... | php | public function initialize(array $config)
{
$this->verifyConfig();
$this->_table->hasMany($this->getConfig('associationAlias'), [
'className' => 'Muffin/Tokenize.Tokens',
'foreignKey' => 'foreign_key',
'conditions' => [
'foreign_alias' => $this->_... | [
"public",
"function",
"initialize",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"verifyConfig",
"(",
")",
";",
"$",
"this",
"->",
"_table",
"->",
"hasMany",
"(",
"$",
"this",
"->",
"getConfig",
"(",
"'associationAlias'",
")",
",",
"[",
"'... | Verifies the configuration and associates the table to the
`tokenize_tokens` table.
@param array $config Config
@return void | [
"Verifies",
"the",
"configuration",
"and",
"associates",
"the",
"table",
"to",
"the",
"tokenize_tokens",
"table",
"."
] | a7ecf4114782abe12b0ab36e8a32504428fe91ec | https://github.com/UseMuffin/Tokenize/blob/a7ecf4114782abe12b0ab36e8a32504428fe91ec/src/Model/Behavior/TokenizeBehavior.php#L32-L45 |
27,224 | UseMuffin/Tokenize | src/Model/Behavior/TokenizeBehavior.php | TokenizeBehavior.tokenize | public function tokenize($id, array $data = [])
{
$assoc = $this->getConfig('associationAlias');
$tokenData = [
'foreign_alias' => $this->_table->getAlias(),
'foreign_table' => $this->_table->getTable(),
'foreign_key' => $id,
'foreign_data' => $data,
... | php | public function tokenize($id, array $data = [])
{
$assoc = $this->getConfig('associationAlias');
$tokenData = [
'foreign_alias' => $this->_table->getAlias(),
'foreign_table' => $this->_table->getTable(),
'foreign_key' => $id,
'foreign_data' => $data,
... | [
"public",
"function",
"tokenize",
"(",
"$",
"id",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"assoc",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'associationAlias'",
")",
";",
"$",
"tokenData",
"=",
"[",
"'foreign_alias'",
"=>",
"$",
"t... | Creates a token for a data sample.
@param int|string $id Id
@param array $data Data
@return mixed | [
"Creates",
"a",
"token",
"for",
"a",
"data",
"sample",
"."
] | a7ecf4114782abe12b0ab36e8a32504428fe91ec | https://github.com/UseMuffin/Tokenize/blob/a7ecf4114782abe12b0ab36e8a32504428fe91ec/src/Model/Behavior/TokenizeBehavior.php#L96-L119 |
27,225 | UseMuffin/Tokenize | src/Model/Behavior/TokenizeBehavior.php | TokenizeBehavior.fields | public function fields(EntityInterface $entity)
{
$fields = [];
foreach ((array)$this->getConfig('fields') as $field) {
if (!$entity->isDirty($field)) {
continue;
}
$fields[$field] = $entity->$field;
$entity->setDirty($field, false);
... | php | public function fields(EntityInterface $entity)
{
$fields = [];
foreach ((array)$this->getConfig('fields') as $field) {
if (!$entity->isDirty($field)) {
continue;
}
$fields[$field] = $entity->$field;
$entity->setDirty($field, false);
... | [
"public",
"function",
"fields",
"(",
"EntityInterface",
"$",
"entity",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"getConfig",
"(",
"'fields'",
")",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"!... | Returns fields that have been marked as protected.
@param \Cake\Datasource\EntityInterface $entity Entity
@return array | [
"Returns",
"fields",
"that",
"have",
"been",
"marked",
"as",
"protected",
"."
] | a7ecf4114782abe12b0ab36e8a32504428fe91ec | https://github.com/UseMuffin/Tokenize/blob/a7ecf4114782abe12b0ab36e8a32504428fe91ec/src/Model/Behavior/TokenizeBehavior.php#L127-L139 |
27,226 | melisplatform/melis-core | src/Controller/DashboardController.php | DashboardController.leftmenuDashboardAction | public function leftmenuDashboardAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | php | public function leftmenuDashboardAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | [
"public",
"function",
"leftmenuDashboardAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"view",
... | Shows the leftmenu dasboard entry point
@return \Zend\View\Model\ViewModel | [
"Shows",
"the",
"leftmenu",
"dasboard",
"entry",
"point"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/DashboardController.php#L28-L36 |
27,227 | melisplatform/melis-core | src/Service/MelisCoreGeneralService.php | MelisCoreGeneralService.makeArrayFromParameters | public function makeArrayFromParameters($class_method, $parameterValues)
{
if (empty($class_method))
return array();
// Get the class name and the method name
list($className, $methodName) = explode('::', $class_method);
if (empty($className) || empty($methodName))
return ar... | php | public function makeArrayFromParameters($class_method, $parameterValues)
{
if (empty($class_method))
return array();
// Get the class name and the method name
list($className, $methodName) = explode('::', $class_method);
if (empty($className) || empty($methodName))
return ar... | [
"public",
"function",
"makeArrayFromParameters",
"(",
"$",
"class_method",
",",
"$",
"parameterValues",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"class_method",
")",
")",
"return",
"array",
"(",
")",
";",
"// Get the class name and the method name",
"list",
"(",
... | This method creates an array from the parameters, using parameters' name as keys
and taking values or default values.
It is used to prepare args for events listening.
@param string $class_method
@param mixed[] $parameterValues | [
"This",
"method",
"creates",
"an",
"array",
"from",
"the",
"parameters",
"using",
"parameters",
"name",
"as",
"keys",
"and",
"taking",
"values",
"or",
"default",
"values",
".",
"It",
"is",
"used",
"to",
"prepare",
"args",
"for",
"events",
"listening",
"."
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreGeneralService.php#L56-L100 |
27,228 | melisplatform/melis-core | src/Service/MelisCoreGeneralService.php | MelisCoreGeneralService.splitData | public function splitData($prefix, $haystack = array())
{
$data = array();
if($haystack) {
foreach($haystack as $key => $value) {
if(strpos($key, $prefix) !== false) {
$data[$key] = $value;
}
}
}
... | php | public function splitData($prefix, $haystack = array())
{
$data = array();
if($haystack) {
foreach($haystack as $key => $value) {
if(strpos($key, $prefix) !== false) {
$data[$key] = $value;
}
}
}
... | [
"public",
"function",
"splitData",
"(",
"$",
"prefix",
",",
"$",
"haystack",
"=",
"array",
"(",
")",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"haystack",
")",
"{",
"foreach",
"(",
"$",
"haystack",
"as",
"$",
"key",
"=>"... | Used to split array data and return the data you need
@param String $prefix of the array data
@param array $haystack | [
"Used",
"to",
"split",
"array",
"data",
"and",
"return",
"the",
"data",
"you",
"need"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreGeneralService.php#L118-L134 |
27,229 | melisplatform/melis-core | src/View/Helper/MelisGenericTable.php | MelisGenericTable.setColumns | public function setColumns($columnText, $css = null, $class = null)
{
$ctr = 0;
$text = '';
$colCss = array();
$dataClass = '';
$thClass = '';
foreach($columnText as $values)
{
$text .= '<th '.$dataClass.' class="'.$class.'">' . $values .... | php | public function setColumns($columnText, $css = null, $class = null)
{
$ctr = 0;
$text = '';
$colCss = array();
$dataClass = '';
$thClass = '';
foreach($columnText as $values)
{
$text .= '<th '.$dataClass.' class="'.$class.'">' . $values .... | [
"public",
"function",
"setColumns",
"(",
"$",
"columnText",
",",
"$",
"css",
"=",
"null",
",",
"$",
"class",
"=",
"null",
")",
"{",
"$",
"ctr",
"=",
"0",
";",
"$",
"text",
"=",
"''",
";",
"$",
"colCss",
"=",
"array",
"(",
")",
";",
"$",
"dataCl... | Creates a configuration table column.
@param Array $columnText
@param Array $css
@param String $class | [
"Creates",
"a",
"configuration",
"table",
"column",
"."
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/View/Helper/MelisGenericTable.php#L52-L69 |
27,230 | orchestral/kernel | src/Http/Providers/VersionServiceProvider.php | VersionServiceProvider.registerSupportedVersions | protected function registerSupportedVersions(VersionControl $version): void
{
foreach ($this->versions as $code => $namespace) {
$version->addVersion($code, $namespace);
}
if (! is_null($this->defaultVersion)) {
$version->setDefaultVersion($this->defaultVersion);
... | php | protected function registerSupportedVersions(VersionControl $version): void
{
foreach ($this->versions as $code => $namespace) {
$version->addVersion($code, $namespace);
}
if (! is_null($this->defaultVersion)) {
$version->setDefaultVersion($this->defaultVersion);
... | [
"protected",
"function",
"registerSupportedVersions",
"(",
"VersionControl",
"$",
"version",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"versions",
"as",
"$",
"code",
"=>",
"$",
"namespace",
")",
"{",
"$",
"version",
"->",
"addVersion",
"(",
... | Register supported version.
@param \Orchestra\Http\VersionControl $version
@return void | [
"Register",
"supported",
"version",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/Providers/VersionServiceProvider.php#L45-L54 |
27,231 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.addLostPassRequest | public function addLostPassRequest($login, $email)
{
$table = $this->getServiceLocator()->get('MelisLostPasswordTable');
$data = $this->getPassRequestDataByLogin($email);
$success = false;
if(!$this->isDataExists($login)) {
$table->save(array(
'rh_id' => n... | php | public function addLostPassRequest($login, $email)
{
$table = $this->getServiceLocator()->get('MelisLostPasswordTable');
$data = $this->getPassRequestDataByLogin($email);
$success = false;
if(!$this->isDataExists($login)) {
$table->save(array(
'rh_id' => n... | [
"public",
"function",
"addLostPassRequest",
"(",
"$",
"login",
",",
"$",
"email",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisLostPasswordTable'",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
... | Adds new record for lost password request
@param String $url
@param String $login
@param String $email | [
"Adds",
"new",
"record",
"for",
"lost",
"password",
"request"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L32-L58 |
27,232 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.processUpdatePassword | public function processUpdatePassword($hash, $password)
{
$data = $this->getPasswordRequestData($hash);
$login = '';
$success = false;
foreach($data as $val)
{
$login = $val->rh_login;
}
if($this->isDataExists($login))
{
... | php | public function processUpdatePassword($hash, $password)
{
$data = $this->getPasswordRequestData($hash);
$login = '';
$success = false;
foreach($data as $val)
{
$login = $val->rh_login;
}
if($this->isDataExists($login))
{
... | [
"public",
"function",
"processUpdatePassword",
"(",
"$",
"hash",
",",
"$",
"password",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getPasswordRequestData",
"(",
"$",
"hash",
")",
";",
"$",
"login",
"=",
"''",
";",
"$",
"success",
"=",
"false",
";",... | Processes the password reset and deletes the existing record in the lost password table
@param String $hash
@param String $password
@return boolean | [
"Processes",
"the",
"password",
"reset",
"and",
"deletes",
"the",
"existing",
"record",
"in",
"the",
"lost",
"password",
"table"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L66-L85 |
27,233 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.userExists | public function userExists($login)
{
$userTable = $this->getServiceLocator()->get('MelisCoreTableUser');
$data = $userTable->getEntryByField('usr_login', $login);
$user = '';
foreach($data as $val)
{
$user = $val->usr_login;
}
if(!empty(... | php | public function userExists($login)
{
$userTable = $this->getServiceLocator()->get('MelisCoreTableUser');
$data = $userTable->getEntryByField('usr_login', $login);
$user = '';
foreach($data as $val)
{
$user = $val->usr_login;
}
if(!empty(... | [
"public",
"function",
"userExists",
"(",
"$",
"login",
")",
"{",
"$",
"userTable",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreTableUser'",
")",
";",
"$",
"data",
"=",
"$",
"userTable",
"->",
"getEntryByField",
"(",
... | Checks if the user exists
@param String $login
@return boolean | [
"Checks",
"if",
"the",
"user",
"exists"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L92-L110 |
27,234 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.hashExists | public function hashExists($hash)
{
$data = $this->getPasswordRequestData($hash);
$h = '';
foreach($data as $val)
{
$h = $val->rh_login;
//echo $h;
}
if(!empty($h)) {
return true;
}
return false;
} | php | public function hashExists($hash)
{
$data = $this->getPasswordRequestData($hash);
$h = '';
foreach($data as $val)
{
$h = $val->rh_login;
//echo $h;
}
if(!empty($h)) {
return true;
}
return false;
} | [
"public",
"function",
"hashExists",
"(",
"$",
"hash",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getPasswordRequestData",
"(",
"$",
"hash",
")",
";",
"$",
"h",
"=",
"''",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"val",
")",
"{",
"$",
"h"... | Check if the provided hash exists
@param String $hash
@return boolean | [
"Check",
"if",
"the",
"provided",
"hash",
"exists"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L117-L132 |
27,235 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.isDataExists | public function isDataExists($login)
{
$data = $this->getPassRequestDataByLogin($login);
$login = '';
foreach($data as $val)
{
$login = $val->rh_login;
}
if(!empty($login)) {
return true;
}
return false;
} | php | public function isDataExists($login)
{
$data = $this->getPassRequestDataByLogin($login);
$login = '';
foreach($data as $val)
{
$login = $val->rh_login;
}
if(!empty($login)) {
return true;
}
return false;
} | [
"public",
"function",
"isDataExists",
"(",
"$",
"login",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getPassRequestDataByLogin",
"(",
"$",
"login",
")",
";",
"$",
"login",
"=",
"''",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"val",
")",
"{",
... | Checks if the username exists in the lost password table
@param String $login
@return boolean | [
"Checks",
"if",
"the",
"username",
"exists",
"in",
"the",
"lost",
"password",
"table"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L139-L153 |
27,236 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.getPassRequestDataByLogin | public function getPassRequestDataByLogin($login)
{
$table = $this->getServiceLocator()->get('MelisLostPasswordTable');
$data = $table->getEntryByField('rh_login', $login);
if($data)
return $data;
} | php | public function getPassRequestDataByLogin($login)
{
$table = $this->getServiceLocator()->get('MelisLostPasswordTable');
$data = $table->getEntryByField('rh_login', $login);
if($data)
return $data;
} | [
"public",
"function",
"getPassRequestDataByLogin",
"(",
"$",
"login",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisLostPasswordTable'",
")",
";",
"$",
"data",
"=",
"$",
"table",
"->",
"getEntryByFiel... | Returns the data of the provided username
@param String $login
@return boolean | [
"Returns",
"the",
"data",
"of",
"the",
"provided",
"username"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L160-L167 |
27,237 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.getPasswordRequestData | public function getPasswordRequestData($hash)
{
$table = $this->getServiceLocator()->get('MelisLostPasswordTable');
$data = $table->getEntryByField('rh_hash', $hash);
if($data)
return $data;
} | php | public function getPasswordRequestData($hash)
{
$table = $this->getServiceLocator()->get('MelisLostPasswordTable');
$data = $table->getEntryByField('rh_hash', $hash);
if($data)
return $data;
} | [
"public",
"function",
"getPasswordRequestData",
"(",
"$",
"hash",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisLostPasswordTable'",
")",
";",
"$",
"data",
"=",
"$",
"table",
"->",
"getEntryByField",
... | Returns the data of the provided hash
@param String $login
@return boolean | [
"Returns",
"the",
"data",
"of",
"the",
"provided",
"hash"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L174-L181 |
27,238 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.updatePassword | protected function updatePassword($login, $newPass)
{
$success = false;
$userTable = $this->getServiceLocator()->get('MelisCoreTableUser');
$melisCoreAuth = $this->serviceLocator->get('MelisCoreAuth');
if($this->isDataExists($login))
{
$userTable->upda... | php | protected function updatePassword($login, $newPass)
{
$success = false;
$userTable = $this->getServiceLocator()->get('MelisCoreTableUser');
$melisCoreAuth = $this->serviceLocator->get('MelisCoreAuth');
if($this->isDataExists($login))
{
$userTable->upda... | [
"protected",
"function",
"updatePassword",
"(",
"$",
"login",
",",
"$",
"newPass",
")",
"{",
"$",
"success",
"=",
"false",
";",
"$",
"userTable",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreTableUser'",
")",
";",
"... | Updates the user's password
@param String $login
@param String $newPass | [
"Updates",
"the",
"user",
"s",
"password"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L188-L204 |
27,239 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.deletePasswordRequestData | protected function deletePasswordRequestData($hash)
{
$table = $this->getServiceLocator()->get('MelisLostPasswordTable');
$data = $this->getPasswordRequestData($hash);
if($data)
$table->deleteByField('rh_hash', $hash);
} | php | protected function deletePasswordRequestData($hash)
{
$table = $this->getServiceLocator()->get('MelisLostPasswordTable');
$data = $this->getPasswordRequestData($hash);
if($data)
$table->deleteByField('rh_hash', $hash);
} | [
"protected",
"function",
"deletePasswordRequestData",
"(",
"$",
"hash",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisLostPasswordTable'",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"getPasswordRe... | Deletes a specific record in the lost password table
@param unknown $hash | [
"Deletes",
"a",
"specific",
"record",
"in",
"the",
"lost",
"password",
"table"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L210-L217 |
27,240 | melisplatform/melis-core | src/Service/MelisCoreLostPasswordService.php | MelisCoreLostPasswordService.sendPasswordLostEmail | protected function sendPasswordLostEmail($login, $email)
{
$datas = array();
foreach($this->getPassRequestDataByLogin($login) as $data) {
$datas['rh_login'] = $data->rh_login;
$datas['rh_hash'] = $data->rh_hash;
}
$login = $datas['rh_login'];
... | php | protected function sendPasswordLostEmail($login, $email)
{
$datas = array();
foreach($this->getPassRequestDataByLogin($login) as $data) {
$datas['rh_login'] = $data->rh_login;
$datas['rh_hash'] = $data->rh_hash;
}
$login = $datas['rh_login'];
... | [
"protected",
"function",
"sendPasswordLostEmail",
"(",
"$",
"login",
",",
"$",
"email",
")",
"{",
"$",
"datas",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getPassRequestDataByLogin",
"(",
"$",
"login",
")",
"as",
"$",
"data",
")",
... | Sends an email together with the link to the user
@param String $url
@param String $login
@param String $email | [
"Sends",
"an",
"email",
"together",
"with",
"the",
"link",
"to",
"the",
"user"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreLostPasswordService.php#L226-L279 |
27,241 | melisplatform/melis-core | src/Controller/PlatformSchemeController.php | PlatformSchemeController.toolContainerAction | public function toolContainerAction()
{
$form = $this->getForm();
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $this->getMelisKey();
$view->hasAccess = $this->hasAccess($melisKey);
$schemeData = $this->getPlatfo... | php | public function toolContainerAction()
{
$form = $this->getForm();
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $this->getMelisKey();
$view->hasAccess = $this->hasAccess($melisKey);
$schemeData = $this->getPlatfo... | [
"public",
"function",
"toolContainerAction",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
... | Tool display container
@return ViewModel | [
"Tool",
"display",
"container"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformSchemeController.php#L34-L57 |
27,242 | melisplatform/melis-core | src/Controller/PlatformSchemeController.php | PlatformSchemeController.getStyleColorCssAction | public function getStyleColorCssAction()
{
$primaryColor = null;
$secondaryColor = null;
$view = new ViewModel();
$response = $this->getResponse();
$view->setTerminal(true);
$response->getHeaders()
->addHeaderLine('Cache-Control', 'no-store, no-cache, mu... | php | public function getStyleColorCssAction()
{
$primaryColor = null;
$secondaryColor = null;
$view = new ViewModel();
$response = $this->getResponse();
$view->setTerminal(true);
$response->getHeaders()
->addHeaderLine('Cache-Control', 'no-store, no-cache, mu... | [
"public",
"function",
"getStyleColorCssAction",
"(",
")",
"{",
"$",
"primaryColor",
"=",
"null",
";",
"$",
"secondaryColor",
"=",
"null",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"getResponse",
"(... | Generates a dynamic CSS virtual file that will be rendered
in the platform
@return ViewModel | [
"Generates",
"a",
"dynamic",
"CSS",
"virtual",
"file",
"that",
"will",
"be",
"rendered",
"in",
"the",
"platform"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformSchemeController.php#L406-L434 |
27,243 | melisplatform/melis-core | src/Controller/PlatformSchemeController.php | PlatformSchemeController.formatErrorMessage | private function formatErrorMessage($errors = array())
{
$melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
$appConfigForm = $melisMelisCoreConfig->getItem('meliscore/forms/melis_core_platform_scheme_form');
$appConfigForm = $appConfigForm['elements'];
foreach ($... | php | private function formatErrorMessage($errors = array())
{
$melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
$appConfigForm = $melisMelisCoreConfig->getItem('meliscore/forms/melis_core_platform_scheme_form');
$appConfigForm = $appConfigForm['elements'];
foreach ($... | [
"private",
"function",
"formatErrorMessage",
"(",
"$",
"errors",
"=",
"array",
"(",
")",
")",
"{",
"$",
"melisMelisCoreConfig",
"=",
"$",
"this",
"->",
"serviceLocator",
"->",
"get",
"(",
"'MelisCoreConfig'",
")",
";",
"$",
"appConfigForm",
"=",
"$",
"melisM... | Returns the a formatted error messages with its labels
@param array $errors
@return array | [
"Returns",
"the",
"a",
"formatted",
"error",
"messages",
"with",
"its",
"labels"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformSchemeController.php#L473-L489 |
27,244 | melisplatform/melis-core | src/Controller/PlatformSchemeController.php | PlatformSchemeController.getSchemeFolder | private function getSchemeFolder()
{
$uriPath = '/media/platform-scheme/';
$config = $this->getServiceLocator()->get('MelisCoreConfig');
$path = $config->getItem('meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface... | php | private function getSchemeFolder()
{
$uriPath = '/media/platform-scheme/';
$config = $this->getServiceLocator()->get('MelisCoreConfig');
$path = $config->getItem('meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface... | [
"private",
"function",
"getSchemeFolder",
"(",
")",
"{",
"$",
"uriPath",
"=",
"'/media/platform-scheme/'",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreConfig'",
")",
";",
"$",
"path",
"=",
"$",
"c... | Returns the URI path of the platform scheme folder inside media folder
@return string | [
"Returns",
"the",
"URI",
"path",
"of",
"the",
"platform",
"scheme",
"folder",
"inside",
"media",
"folder"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformSchemeController.php#L504-L529 |
27,245 | melisplatform/melis-core | src/Controller/PlatformSchemeController.php | PlatformSchemeController.convertWithBytes | private function convertWithBytes($size)
{
$precision = 2;
$base = log($size, 1024);
$suffixes = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
return $bytes;
} | php | private function convertWithBytes($size)
{
$precision = 2;
$base = log($size, 1024);
$suffixes = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
return $bytes;
} | [
"private",
"function",
"convertWithBytes",
"(",
"$",
"size",
")",
"{",
"$",
"precision",
"=",
"2",
";",
"$",
"base",
"=",
"log",
"(",
"$",
"size",
",",
"1024",
")",
";",
"$",
"suffixes",
"=",
"array",
"(",
"'B'",
",",
"'KB'",
",",
"'MB'",
",",
"'... | Returns the formatted byte size
@param $size
@return string | [
"Returns",
"the",
"formatted",
"byte",
"size"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformSchemeController.php#L559-L567 |
27,246 | melisplatform/melis-core | src/Controller/PlatformSchemeController.php | PlatformSchemeController.getMaxImageSize | private function getMaxImageSize()
{
$config = $this->getServiceLocator()->get('MelisCoreConfig');
$path = $config->getItem('meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface/meliscore_tool_platform_scheme');
... | php | private function getMaxImageSize()
{
$config = $this->getServiceLocator()->get('MelisCoreConfig');
$path = $config->getItem('meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface/meliscore_tool_platform_scheme');
... | [
"private",
"function",
"getMaxImageSize",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreConfig'",
")",
";",
"$",
"path",
"=",
"$",
"config",
"->",
"getItem",
"(",
"'meliscore/interface/melis... | Returns the maximum file image size from the configuration
@return null|long | [
"Returns",
"the",
"maximum",
"file",
"image",
"size",
"from",
"the",
"configuration"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformSchemeController.php#L573-L585 |
27,247 | melisplatform/melis-core | src/Controller/PlatformSchemeController.php | PlatformSchemeController.getAllowedUploadableExtension | public function getAllowedUploadableExtension()
{
$config = $this->getServiceLocator()->get('MelisCoreConfig');
$path = $config->getItem('meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface/meliscore_tool_platform_scheme');
... | php | public function getAllowedUploadableExtension()
{
$config = $this->getServiceLocator()->get('MelisCoreConfig');
$path = $config->getItem('meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface/meliscore_tool_platform_scheme');
... | [
"public",
"function",
"getAllowedUploadableExtension",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreConfig'",
")",
";",
"$",
"path",
"=",
"$",
"config",
"->",
"getItem",
"(",
"'meliscore/in... | Returns the allowed extensions that can be uploaded
@return null|string | [
"Returns",
"the",
"allowed",
"extensions",
"that",
"can",
"be",
"uploaded"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/PlatformSchemeController.php#L591-L603 |
27,248 | melisplatform/melis-core | src/Service/MelisCoreTranslationService.php | MelisCoreTranslationService.getTranslationMessages | public function getTranslationMessages($locale = 'en_EN', $textDomain = 'default')
{
// Get the translation service, so we would be able to fetch the current configs
$translator = $this->getServiceLocator()->get('translator');
$translation = $translator->getTranslator();
$messages = ... | php | public function getTranslationMessages($locale = 'en_EN', $textDomain = 'default')
{
// Get the translation service, so we would be able to fetch the current configs
$translator = $this->getServiceLocator()->get('translator');
$translation = $translator->getTranslator();
$messages = ... | [
"public",
"function",
"getTranslationMessages",
"(",
"$",
"locale",
"=",
"'en_EN'",
",",
"$",
"textDomain",
"=",
"'default'",
")",
"{",
"// Get the translation service, so we would be able to fetch the current configs",
"$",
"translator",
"=",
"$",
"this",
"->",
"getServi... | Re-imports translation files from all the modules and re-writes it
so it can be used in Javascript or any other scripts that would like
to use translation on their messages
@param String $locale
@param string $textDomain
@return Array | [
"Re",
"-",
"imports",
"translation",
"files",
"from",
"all",
"the",
"modules",
"and",
"re",
"-",
"writes",
"it",
"so",
"it",
"can",
"be",
"used",
"in",
"Javascript",
"or",
"any",
"other",
"scripts",
"that",
"would",
"like",
"to",
"use",
"translation",
"o... | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreTranslationService.php#L54-L98 |
27,249 | melisplatform/melis-core | src/Service/MelisCoreTranslationService.php | MelisCoreTranslationService.checkLanguageDirectory | private function checkLanguageDirectory($dir, $modulePath)
{
$melisCoreConfig = $this->getServiceLocator()->get('MelisCoreConfig');
$confLanguage = $melisCoreConfig->getItem('meliscore/datas/default/langauges/default_trans_files');
$defaultTransInterface = $confLanguage['defaultTransInterfac... | php | private function checkLanguageDirectory($dir, $modulePath)
{
$melisCoreConfig = $this->getServiceLocator()->get('MelisCoreConfig');
$confLanguage = $melisCoreConfig->getItem('meliscore/datas/default/langauges/default_trans_files');
$defaultTransInterface = $confLanguage['defaultTransInterfac... | [
"private",
"function",
"checkLanguageDirectory",
"(",
"$",
"dir",
",",
"$",
"modulePath",
")",
"{",
"$",
"melisCoreConfig",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCoreConfig'",
")",
";",
"$",
"confLanguage",
"=",
"$",... | Checks the language directory if the path exist, creates a directory if with english translations if not existing
@param string $dir The directory path of the language directory
@param string $modulePath The directory path of melis english translations
@return boolean true if existing, otherwise false if failed to cr... | [
"Checks",
"the",
"language",
"directory",
"if",
"the",
"path",
"exist",
"creates",
"a",
"directory",
"if",
"with",
"english",
"translations",
"if",
"not",
"existing"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreTranslationService.php#L374-L393 |
27,250 | melisplatform/melis-core | src/Service/MelisCoreTranslationService.php | MelisCoreTranslationService.checkTranslationsDiff | public function checkTranslationsDiff($melisTrans, $currentTrans)
{
$new = include $melisTrans;
$new = is_array($new)? $new : array();
$current = include $currentTrans;
$current = is_array($current)? $current : array();
return array_diff_key($new, $current);
} | php | public function checkTranslationsDiff($melisTrans, $currentTrans)
{
$new = include $melisTrans;
$new = is_array($new)? $new : array();
$current = include $currentTrans;
$current = is_array($current)? $current : array();
return array_diff_key($new, $current);
} | [
"public",
"function",
"checkTranslationsDiff",
"(",
"$",
"melisTrans",
",",
"$",
"currentTrans",
")",
"{",
"$",
"new",
"=",
"include",
"$",
"melisTrans",
";",
"$",
"new",
"=",
"is_array",
"(",
"$",
"new",
")",
"?",
"$",
"new",
":",
"array",
"(",
")",
... | Checks if melis translations have new updates and returns the missing translations
@param string $melisTrans The path of the module translation
@param string $currentTrans The path of the current translation
returns array() Returns an array of missing translations with the keys and values | [
"Checks",
"if",
"melis",
"translations",
"have",
"new",
"updates",
"and",
"returns",
"the",
"missing",
"translations"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreTranslationService.php#L502-L511 |
27,251 | melisplatform/melis-core | src/Service/MelisCoreTranslationService.php | MelisCoreTranslationService.updateTranslations | public function updateTranslations($currentTrans, $transDiff)
{
$status = false;
$current = include $currentTrans;
$current = is_array($current)? $current : array();
$transUpdate = array_merge($current, $transDiff);
$content = "<?php". PHP_EOL . "\t return array(" . PHP_EOL... | php | public function updateTranslations($currentTrans, $transDiff)
{
$status = false;
$current = include $currentTrans;
$current = is_array($current)? $current : array();
$transUpdate = array_merge($current, $transDiff);
$content = "<?php". PHP_EOL . "\t return array(" . PHP_EOL... | [
"public",
"function",
"updateTranslations",
"(",
"$",
"currentTrans",
",",
"$",
"transDiff",
")",
"{",
"$",
"status",
"=",
"false",
";",
"$",
"current",
"=",
"include",
"$",
"currentTrans",
";",
"$",
"current",
"=",
"is_array",
"(",
"$",
"current",
")",
... | Updates the translation files
@param string $currentTrans The path of the current translation
@param array $transDiff array of translations to be added
@return boolean | [
"Updates",
"the",
"translation",
"files"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreTranslationService.php#L521-L540 |
27,252 | orchestral/kernel | src/Notifications/ChannelManager.php | ChannelManager.createMailDriver | protected function createMailDriver()
{
$mailer = $this->app->make('orchestra.mail');
return $this->app->make(MailChannel::class, [$mailer->getMailer()]);
} | php | protected function createMailDriver()
{
$mailer = $this->app->make('orchestra.mail');
return $this->app->make(MailChannel::class, [$mailer->getMailer()]);
} | [
"protected",
"function",
"createMailDriver",
"(",
")",
"{",
"$",
"mailer",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'orchestra.mail'",
")",
";",
"return",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"MailChannel",
"::",
"class",
",",
"[",
"$... | Create an instance of the mail driver.
@return \Illuminate\Notifications\Channels\MailChannel | [
"Create",
"an",
"instance",
"of",
"the",
"mail",
"driver",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Notifications/ChannelManager.php#L15-L20 |
27,253 | melisplatform/melis-core | src/Model/Tables/MelisGenericTable.php | MelisGenericTable.getTableColumns | public function getTableColumns()
{
$metadata = new MetaData($this->tableGateway->getAdapter());
$columns = $metadata->getColumnNames($this->tableGateway->getTable());
return $columns;
} | php | public function getTableColumns()
{
$metadata = new MetaData($this->tableGateway->getAdapter());
$columns = $metadata->getColumnNames($this->tableGateway->getTable());
return $columns;
} | [
"public",
"function",
"getTableColumns",
"(",
")",
"{",
"$",
"metadata",
"=",
"new",
"MetaData",
"(",
"$",
"this",
"->",
"tableGateway",
"->",
"getAdapter",
"(",
")",
")",
";",
"$",
"columns",
"=",
"$",
"metadata",
"->",
"getColumnNames",
"(",
"$",
"this... | Returns the columns of the table
@param Array $table | [
"Returns",
"the",
"columns",
"of",
"the",
"table"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Model/Tables/MelisGenericTable.php#L128-L134 |
27,254 | melisplatform/melis-core | src/Model/Tables/MelisGenericTable.php | MelisGenericTable.getTotalData | public function getTotalData($field = null, $idValue = null)
{
$select = $this->tableGateway->getSql()->select();
if (!empty($field) && !empty($idValue))
{
$select->where(array($field => (int) $idValue));
}
$resultSet = $this->tableGateway->selectWith($select);
return $... | php | public function getTotalData($field = null, $idValue = null)
{
$select = $this->tableGateway->getSql()->select();
if (!empty($field) && !empty($idValue))
{
$select->where(array($field => (int) $idValue));
}
$resultSet = $this->tableGateway->selectWith($select);
return $... | [
"public",
"function",
"getTotalData",
"(",
"$",
"field",
"=",
"null",
",",
"$",
"idValue",
"=",
"null",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"tableGateway",
"->",
"getSql",
"(",
")",
"->",
"select",
"(",
")",
";",
"if",
"(",
"!",
"empty... | Returns the total rows of the selected table
@return int | [
"Returns",
"the",
"total",
"rows",
"of",
"the",
"selected",
"table"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Model/Tables/MelisGenericTable.php#L303-L315 |
27,255 | melisplatform/melis-core | src/Model/Tables/MelisGenericTable.php | MelisGenericTable.getDataForExport | public function getDataForExport($filter, $columns = array())
{
$select = $this->tableGateway->getSql()->select();
$select->columns(array('*'));
$w = new Where();
$filters = array();
$likes = array();
foreach($columns as $columnKeys)
{
... | php | public function getDataForExport($filter, $columns = array())
{
$select = $this->tableGateway->getSql()->select();
$select->columns(array('*'));
$w = new Where();
$filters = array();
$likes = array();
foreach($columns as $columnKeys)
{
... | [
"public",
"function",
"getDataForExport",
"(",
"$",
"filter",
",",
"$",
"columns",
"=",
"array",
"(",
")",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"tableGateway",
"->",
"getSql",
"(",
")",
"->",
"select",
"(",
")",
";",
"$",
"select",
"->",
... | Returns all the data from the selected column
@param String $filter
@param array $columns
@return Array | [
"Returns",
"all",
"the",
"data",
"from",
"the",
"selected",
"column"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Model/Tables/MelisGenericTable.php#L332-L354 |
27,256 | orchestral/kernel | src/Http/VersionControl.php | VersionControl.addVersion | public function addVersion(string $code, string $namespace, bool $default = false)
{
$this->supportedVersions[$code] = $namespace;
if (is_null($this->defaultVersion) || $default === true) {
$this->setDefaultVersion($code);
}
return $this;
} | php | public function addVersion(string $code, string $namespace, bool $default = false)
{
$this->supportedVersions[$code] = $namespace;
if (is_null($this->defaultVersion) || $default === true) {
$this->setDefaultVersion($code);
}
return $this;
} | [
"public",
"function",
"addVersion",
"(",
"string",
"$",
"code",
",",
"string",
"$",
"namespace",
",",
"bool",
"$",
"default",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"supportedVersions",
"[",
"$",
"code",
"]",
"=",
"$",
"namespace",
";",
"if",
"(",
... | Add version.
@param string $code
@param string $namespace
@param bool $default
@return $this | [
"Add",
"version",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/VersionControl.php#L32-L41 |
27,257 | orchestral/kernel | src/Http/VersionControl.php | VersionControl.setDefaultVersion | public function setDefaultVersion(string $code)
{
if (! array_key_exists($code, $this->supportedVersions)) {
throw new InvalidArgumentException("Unable to set [{$code}] as default version!");
}
$this->defaultVersion = $code;
return $this;
} | php | public function setDefaultVersion(string $code)
{
if (! array_key_exists($code, $this->supportedVersions)) {
throw new InvalidArgumentException("Unable to set [{$code}] as default version!");
}
$this->defaultVersion = $code;
return $this;
} | [
"public",
"function",
"setDefaultVersion",
"(",
"string",
"$",
"code",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"this",
"->",
"supportedVersions",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Unable to set... | Set default version.
@param string $code
@throws \InvalidArgumentException
@return $this | [
"Set",
"default",
"version",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/VersionControl.php#L52-L61 |
27,258 | orchestral/kernel | src/Http/VersionControl.php | VersionControl.resolve | public function resolve(string $namespace, string $version, string $name): string
{
$class = str_replace('.', '\\', $name);
if (! array_key_exists($version, $this->supportedVersions)) {
$version = $this->defaultVersion;
}
return sprintf('%s\%s\%s\%s', $namespace, $this-... | php | public function resolve(string $namespace, string $version, string $name): string
{
$class = str_replace('.', '\\', $name);
if (! array_key_exists($version, $this->supportedVersions)) {
$version = $this->defaultVersion;
}
return sprintf('%s\%s\%s\%s', $namespace, $this-... | [
"public",
"function",
"resolve",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"version",
",",
"string",
"$",
"name",
")",
":",
"string",
"{",
"$",
"class",
"=",
"str_replace",
"(",
"'.'",
",",
"'\\\\'",
",",
"$",
"name",
")",
";",
"if",
"(",
... | Resolve version for requested class.
@param string $namespace
@param string $version
@param string $group
@param string $name
@return string | [
"Resolve",
"version",
"for",
"requested",
"class",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/VersionControl.php#L73-L82 |
27,259 | melisplatform/melis-core | src/Service/MelisCorePlatformSchemeService.php | MelisCorePlatformSchemeService.getCurrentScheme | public function getCurrentScheme($colorsOnly = false)
{
// Event parameters prepare
$arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());
$results = null;
// Sending service start event
$arrayParameters = $this->sendEvent('melis_core_packag... | php | public function getCurrentScheme($colorsOnly = false)
{
// Event parameters prepare
$arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());
$results = null;
// Sending service start event
$arrayParameters = $this->sendEvent('melis_core_packag... | [
"public",
"function",
"getCurrentScheme",
"(",
"$",
"colorsOnly",
"=",
"false",
")",
"{",
"// Event parameters prepare",
"$",
"arrayParameters",
"=",
"$",
"this",
"->",
"makeArrayFromParameters",
"(",
"__METHOD__",
",",
"func_get_args",
"(",
")",
")",
";",
"$",
... | Returns the currently active scheme, if there's none active
it returns the Melis default scheme
@param bool $colorsOnly : true|false - if true it returns only the colors that will be used in the platform
@return MelisCorePlatformScheme|null | [
"Returns",
"the",
"currently",
"active",
"scheme",
"if",
"there",
"s",
"none",
"active",
"it",
"returns",
"the",
"Melis",
"default",
"scheme"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCorePlatformSchemeService.php#L37-L83 |
27,260 | melisplatform/melis-core | src/Service/MelisCorePlatformSchemeService.php | MelisCorePlatformSchemeService.saveScheme | public function saveScheme($data, $id, $setAsActive = false)
{
// Event parameters prepare
$arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());
$results = false;
// Sending service start event
$arrayParameters = $this->sendEvent('melis_core_package... | php | public function saveScheme($data, $id, $setAsActive = false)
{
// Event parameters prepare
$arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());
$results = false;
// Sending service start event
$arrayParameters = $this->sendEvent('melis_core_package... | [
"public",
"function",
"saveScheme",
"(",
"$",
"data",
",",
"$",
"id",
",",
"$",
"setAsActive",
"=",
"false",
")",
"{",
"// Event parameters prepare",
"$",
"arrayParameters",
"=",
"$",
"this",
"->",
"makeArrayFromParameters",
"(",
"__METHOD__",
",",
"func_get_arg... | Handles the saving of the platform scheme
@param $data
@param $id
@param bool $setAsActive
@return mixed | [
"Handles",
"the",
"saving",
"of",
"the",
"platform",
"scheme"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCorePlatformSchemeService.php#L92-L117 |
27,261 | melisplatform/melis-core | src/Service/MelisCorePlatformSchemeService.php | MelisCorePlatformSchemeService.resetScheme | public function resetScheme($id)
{
// Event parameters prepare
$arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());
$results = false;
// Sending service start event
$arrayParameters = $this->sendEvent('melis_core_package_scheme_reset_start', $array... | php | public function resetScheme($id)
{
// Event parameters prepare
$arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());
$results = false;
// Sending service start event
$arrayParameters = $this->sendEvent('melis_core_package_scheme_reset_start', $array... | [
"public",
"function",
"resetScheme",
"(",
"$",
"id",
")",
"{",
"// Event parameters prepare",
"$",
"arrayParameters",
"=",
"$",
"this",
"->",
"makeArrayFromParameters",
"(",
"__METHOD__",
",",
"func_get_args",
"(",
")",
")",
";",
"$",
"results",
"=",
"false",
... | Handles the event for resetting the whole scheme of the selected template
@param $id
@return mixed | [
"Handles",
"the",
"event",
"for",
"resetting",
"the",
"whole",
"scheme",
"of",
"the",
"selected",
"template"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCorePlatformSchemeService.php#L124-L158 |
27,262 | melisplatform/melis-core | src/Controller/IndexController.php | IndexController.headerAction | public function headerAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$melisCoreAuth = $this->serviceLocator->get('MelisCoreAuth');
if ($melisCoreAuth->hasIdentity())
{
$melisAppConfig = $this->getServiceLocator()->get('MelisCoreConfig');
$... | php | public function headerAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$melisCoreAuth = $this->serviceLocator->get('MelisCoreAuth');
if ($melisCoreAuth->hasIdentity())
{
$melisAppConfig = $this->getServiceLocator()->get('MelisCoreConfig');
$... | [
"public",
"function",
"headerAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"melisCoreAuth",
"=",
"$",
"this",
"->",
"serviceLocator",
"->",
"get",
"(... | Shows the header section of Melis Platform
@return \Zend\View\Model\ViewModel | [
"Shows",
"the",
"header",
"section",
"of",
"Melis",
"Platform"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/IndexController.php#L53-L93 |
27,263 | melisplatform/melis-core | src/Controller/IndexController.php | IndexController.leftMenuAction | public function leftMenuAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | php | public function leftMenuAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | [
"public",
"function",
"leftMenuAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"view",
"->",
"... | Shows the left menu of the Melis Platform interface
@return \Zend\View\Model\ViewModel | [
"Shows",
"the",
"left",
"menu",
"of",
"the",
"Melis",
"Platform",
"interface"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/IndexController.php#L108-L116 |
27,264 | melisplatform/melis-core | src/Controller/IndexController.php | IndexController.footerAction | public function footerAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$moduleSvc = $this->getServiceLocator()->get('ModulesService');
$coreTool = $this->getServiceLocator()->get('MelisCoreTool');
$modules = $moduleSvc->getAllModules();
... | php | public function footerAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$moduleSvc = $this->getServiceLocator()->get('ModulesService');
$coreTool = $this->getServiceLocator()->get('MelisCoreTool');
$modules = $moduleSvc->getAllModules();
... | [
"public",
"function",
"footerAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"moduleSvc",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
... | Shows the footer of the Melis Platform interface
@return \Zend\View\Model\ViewModel | [
"Shows",
"the",
"footer",
"of",
"the",
"Melis",
"Platform",
"interface"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/IndexController.php#L123-L147 |
27,265 | melisplatform/melis-core | src/Controller/IndexController.php | IndexController.centerAction | public function centerAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | php | public function centerAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | [
"public",
"function",
"centerAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"view",
"->",
"me... | Shows the center zone of the Melis Platform interface
@return \Zend\View\Model\ViewModel | [
"Shows",
"the",
"center",
"zone",
"of",
"the",
"Melis",
"Platform",
"interface"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/IndexController.php#L154-L162 |
27,266 | melisplatform/melis-core | src/Controller/IndexController.php | IndexController.headerLanguageAction | public function headerLanguageAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | php | public function headerLanguageAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | [
"public",
"function",
"headerLanguageAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"view",
"->... | Shows the language select to change the language
@return \Zend\View\Model\ViewModel | [
"Shows",
"the",
"language",
"select",
"to",
"change",
"the",
"language"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/IndexController.php#L169-L176 |
27,267 | melisplatform/melis-core | src/Controller/IndexController.php | IndexController.closeAllTabsAction | public function closeAllTabsAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | php | public function closeAllTabsAction()
{
$melisKey = $this->params()->fromRoute('melisKey', '');
$view = new ViewModel();
$view->melisKey = $melisKey;
return $view;
} | [
"public",
"function",
"closeAllTabsAction",
"(",
")",
"{",
"$",
"melisKey",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'melisKey'",
",",
"''",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"view",
"->",... | Shows the close button for closing of tabs | [
"Shows",
"the",
"close",
"button",
"for",
"closing",
"of",
"tabs"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Controller/IndexController.php#L181-L188 |
27,268 | ublaboo/mailing | src/MailLogger.php | MailLogger.log | public function log($type, Message $mail): void
{
$timestamp = date('Y-m-d H:i:s');
$type .= '.' . time();
$file = $this->getLogFile($type, $timestamp);
if (file_exists($file) && filesize($file)) {
$file = str_replace(
static::LOG_EXTENSION,
'.' . uniqid() . static::LOG_EXTENSION,
$file
);
... | php | public function log($type, Message $mail): void
{
$timestamp = date('Y-m-d H:i:s');
$type .= '.' . time();
$file = $this->getLogFile($type, $timestamp);
if (file_exists($file) && filesize($file)) {
$file = str_replace(
static::LOG_EXTENSION,
'.' . uniqid() . static::LOG_EXTENSION,
$file
);
... | [
"public",
"function",
"log",
"(",
"$",
"type",
",",
"Message",
"$",
"mail",
")",
":",
"void",
"{",
"$",
"timestamp",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
")",
";",
"$",
"type",
".=",
"'.'",
".",
"time",
"(",
")",
";",
"$",
"file",
"=",
"$",
"this",... | Log mail messages to eml file | [
"Log",
"mail",
"messages",
"to",
"eml",
"file"
] | 1dc7751ceae2c5042f8017910c2c406ad8695740 | https://github.com/ublaboo/mailing/blob/1dc7751ceae2c5042f8017910c2c406ad8695740/src/MailLogger.php#L35-L50 |
27,269 | ublaboo/mailing | src/MailLogger.php | MailLogger.getLogFile | public function getLogFile(string $type, string $timestamp): string
{
preg_match('/^((([0-9]{4})-[0-9]{2})-[0-9]{2}).*/', $timestamp, $fragments);
$yearDir = $this->logDirectory . '/' . $fragments[3];
$monthDir = $yearDir . '/' . $fragments[2];
$dayDir = $monthDir . '/' . $fragments[1];
$file = $dayDir . '/... | php | public function getLogFile(string $type, string $timestamp): string
{
preg_match('/^((([0-9]{4})-[0-9]{2})-[0-9]{2}).*/', $timestamp, $fragments);
$yearDir = $this->logDirectory . '/' . $fragments[3];
$monthDir = $yearDir . '/' . $fragments[2];
$dayDir = $monthDir . '/' . $fragments[1];
$file = $dayDir . '/... | [
"public",
"function",
"getLogFile",
"(",
"string",
"$",
"type",
",",
"string",
"$",
"timestamp",
")",
":",
"string",
"{",
"preg_match",
"(",
"'/^((([0-9]{4})-[0-9]{2})-[0-9]{2}).*/'",
",",
"$",
"timestamp",
",",
"$",
"fragments",
")",
";",
"$",
"yearDir",
"=",... | If not already created, create a directory path that sticks to the standard described above | [
"If",
"not",
"already",
"created",
"create",
"a",
"directory",
"path",
"that",
"sticks",
"to",
"the",
"standard",
"described",
"above"
] | 1dc7751ceae2c5042f8017910c2c406ad8695740 | https://github.com/ublaboo/mailing/blob/1dc7751ceae2c5042f8017910c2c406ad8695740/src/MailLogger.php#L56-L74 |
27,270 | locomotivemtl/charcoal-app | src/Charcoal/App/Route/RouteManager.php | RouteManager.setupRoutes | public function setupRoutes()
{
$routes = $this->config();
if (PHP_SAPI == 'cli') {
$scripts = ( isset($routes['scripts']) ? $routes['scripts'] : [] );
foreach ($scripts as $scriptIdent => $scriptConfig) {
$this->setupScript($scriptIdent, $scriptConfig);
... | php | public function setupRoutes()
{
$routes = $this->config();
if (PHP_SAPI == 'cli') {
$scripts = ( isset($routes['scripts']) ? $routes['scripts'] : [] );
foreach ($scripts as $scriptIdent => $scriptConfig) {
$this->setupScript($scriptIdent, $scriptConfig);
... | [
"public",
"function",
"setupRoutes",
"(",
")",
"{",
"$",
"routes",
"=",
"$",
"this",
"->",
"config",
"(",
")",
";",
"if",
"(",
"PHP_SAPI",
"==",
"'cli'",
")",
"{",
"$",
"scripts",
"=",
"(",
"isset",
"(",
"$",
"routes",
"[",
"'scripts'",
"]",
")",
... | Set up the routes.
There are 3 types of routes:
- Templates
- Actions
- Scripts
@return void | [
"Set",
"up",
"the",
"routes",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Route/RouteManager.php#L48-L68 |
27,271 | locomotivemtl/charcoal-app | src/Charcoal/App/Route/RouteManager.php | RouteManager.setupTemplate | private function setupTemplate($routeIdent, $templateConfig)
{
$routePattern = isset($templateConfig['route'])
? $templateConfig['route']
: '/'.ltrim($routeIdent, '/');
$templateConfig['route'] = $routePattern;
$methods = isset($templateConfig['methods'])
... | php | private function setupTemplate($routeIdent, $templateConfig)
{
$routePattern = isset($templateConfig['route'])
? $templateConfig['route']
: '/'.ltrim($routeIdent, '/');
$templateConfig['route'] = $routePattern;
$methods = isset($templateConfig['methods'])
... | [
"private",
"function",
"setupTemplate",
"(",
"$",
"routeIdent",
",",
"$",
"templateConfig",
")",
"{",
"$",
"routePattern",
"=",
"isset",
"(",
"$",
"templateConfig",
"[",
"'route'",
"]",
")",
"?",
"$",
"templateConfig",
"[",
"'route'",
"]",
":",
"'/'",
".",... | Add template route.
Typically for a GET request, the route will render a template.
@param string $routeIdent The template's route identifier.
@param array|\ArrayAccess $templateConfig The template's config for the route.
@return \Slim\Interfaces\RouteInterface | [
"Add",
"template",
"route",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Route/RouteManager.php#L79-L144 |
27,272 | locomotivemtl/charcoal-app | src/Charcoal/App/Route/RouteManager.php | RouteManager.setupAction | private function setupAction($routeIdent, $actionConfig)
{
$routePattern = isset($actionConfig['route'])
? $actionConfig['route']
: '/'.ltrim($routeIdent, '/');
$actionConfig['route'] = $routePattern;
$methods = isset($actionConfig['methods'])
? $actionC... | php | private function setupAction($routeIdent, $actionConfig)
{
$routePattern = isset($actionConfig['route'])
? $actionConfig['route']
: '/'.ltrim($routeIdent, '/');
$actionConfig['route'] = $routePattern;
$methods = isset($actionConfig['methods'])
? $actionC... | [
"private",
"function",
"setupAction",
"(",
"$",
"routeIdent",
",",
"$",
"actionConfig",
")",
"{",
"$",
"routePattern",
"=",
"isset",
"(",
"$",
"actionConfig",
"[",
"'route'",
"]",
")",
"?",
"$",
"actionConfig",
"[",
"'route'",
"]",
":",
"'/'",
".",
"ltri... | Add action route.
Typically for a POST request, the route will execute an action (returns JSON).
@param string $routeIdent The action's route identifier.
@param array|\ArrayAccess $actionConfig The action's config for the route.
@return \Slim\Interfaces\RouteInterface | [
"Add",
"action",
"route",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Route/RouteManager.php#L155-L220 |
27,273 | locomotivemtl/charcoal-app | src/Charcoal/App/Route/RouteManager.php | RouteManager.setupScript | private function setupScript($routeIdent, $scriptConfig)
{
$routePattern = isset($scriptConfig['route'])
? $scriptConfig['route']
: '/'.ltrim($routeIdent, '/');
$scriptConfig['route'] = $routePattern;
$methods = isset($scriptConfig['methods'])
? $scriptC... | php | private function setupScript($routeIdent, $scriptConfig)
{
$routePattern = isset($scriptConfig['route'])
? $scriptConfig['route']
: '/'.ltrim($routeIdent, '/');
$scriptConfig['route'] = $routePattern;
$methods = isset($scriptConfig['methods'])
? $scriptC... | [
"private",
"function",
"setupScript",
"(",
"$",
"routeIdent",
",",
"$",
"scriptConfig",
")",
"{",
"$",
"routePattern",
"=",
"isset",
"(",
"$",
"scriptConfig",
"[",
"'route'",
"]",
")",
"?",
"$",
"scriptConfig",
"[",
"'route'",
"]",
":",
"'/'",
".",
"ltri... | Add script route.
Typically used for a CLI interface, the route will execute a script.
@param string $routeIdent The script's route identifier.
@param array|\ArrayAccess $scriptConfig The script's config for the route.
@return \Slim\Interfaces\RouteInterface | [
"Add",
"script",
"route",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Route/RouteManager.php#L231-L296 |
27,274 | melisplatform/melis-core | src/Service/MelisCoreConfigService.php | MelisCoreConfigService.setFormFieldRequired | public function setFormFieldRequired($array, $fieldName, $isRequired = false)
{
if (!empty($array['input_filter'])) {
foreach ($array['input_filter'] as $keyElement => $element) {
if ($keyElement == $fieldName) {
$array['input_filter'][$keyElement]['required']... | php | public function setFormFieldRequired($array, $fieldName, $isRequired = false)
{
if (!empty($array['input_filter'])) {
foreach ($array['input_filter'] as $keyElement => $element) {
if ($keyElement == $fieldName) {
$array['input_filter'][$keyElement]['required']... | [
"public",
"function",
"setFormFieldRequired",
"(",
"$",
"array",
",",
"$",
"fieldName",
",",
"$",
"isRequired",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"array",
"[",
"'input_filter'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"array",... | Set a required field in input filters from the the config form array
@param array $array
@param string $fieldName
@param boolean $isRequired
@return array | [
"Set",
"a",
"required",
"field",
"in",
"input",
"filters",
"from",
"the",
"the",
"config",
"form",
"array"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Service/MelisCoreConfigService.php#L69-L80 |
27,275 | orchestral/kernel | src/Http/Concerns/Transformable.php | Transformable.options | public function options(array $options = [])
{
$this->options = $options;
foreach ($this->meta as $name) {
$this->filterMetaType($name);
}
return $this;
} | php | public function options(array $options = [])
{
$this->options = $options;
foreach ($this->meta as $name) {
$this->filterMetaType($name);
}
return $this;
} | [
"public",
"function",
"options",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"$",
"options",
";",
"foreach",
"(",
"$",
"this",
"->",
"meta",
"as",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"filterMetaTy... | Add options.
@param array $options
@return $this | [
"Add",
"options",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/Concerns/Transformable.php#L38-L47 |
27,276 | orchestral/kernel | src/Http/Concerns/Transformable.php | Transformable.getRequest | public function getRequest()
{
if (is_null($this->request)) {
$this->setRequest(app()->refresh('request', $this, 'setRequest'));
}
return $this->request;
} | php | public function getRequest()
{
if (is_null($this->request)) {
$this->setRequest(app()->refresh('request', $this, 'setRequest'));
}
return $this->request;
} | [
"public",
"function",
"getRequest",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"request",
")",
")",
"{",
"$",
"this",
"->",
"setRequest",
"(",
"app",
"(",
")",
"->",
"refresh",
"(",
"'request'",
",",
"$",
"this",
",",
"'setRequest'"... | Get request instance.
@return \Illuminate\Http\Request | [
"Get",
"request",
"instance",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/Concerns/Transformable.php#L54-L61 |
27,277 | orchestral/kernel | src/Http/Concerns/Transformable.php | Transformable.merge | protected function merge($meta, array $options = []): array
{
if (is_array($meta) && empty($options)) {
$options = $meta;
$meta = null;
}
$options = array_merge(['includes' => [], 'excludes' => []], $options);
foreach ($options as $key => $value) {
... | php | protected function merge($meta, array $options = []): array
{
if (is_array($meta) && empty($options)) {
$options = $meta;
$meta = null;
}
$options = array_merge(['includes' => [], 'excludes' => []], $options);
foreach ($options as $key => $value) {
... | [
"protected",
"function",
"merge",
"(",
"$",
"meta",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"if",
"(",
"is_array",
"(",
"$",
"meta",
")",
"&&",
"empty",
"(",
"$",
"options",
")",
")",
"{",
"$",
"options",
"=",
"$",
... | Merge meta options.
@param string|array $meta
@param array $options
@return array | [
"Merge",
"meta",
"options",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/Concerns/Transformable.php#L85-L102 |
27,278 | orchestral/kernel | src/Http/Concerns/Transformable.php | Transformable.transformByMeta | protected function transformByMeta(string $meta, array $data, ...$parameters): array
{
$name = Str::singular($meta);
$types = $this->options[$meta];
if (empty($types)) {
return $data;
}
foreach ($types as $type => $index) {
if (is_array($type)) {
... | php | protected function transformByMeta(string $meta, array $data, ...$parameters): array
{
$name = Str::singular($meta);
$types = $this->options[$meta];
if (empty($types)) {
return $data;
}
foreach ($types as $type => $index) {
if (is_array($type)) {
... | [
"protected",
"function",
"transformByMeta",
"(",
"string",
"$",
"meta",
",",
"array",
"$",
"data",
",",
"...",
"$",
"parameters",
")",
":",
"array",
"{",
"$",
"name",
"=",
"Str",
"::",
"singular",
"(",
"$",
"meta",
")",
";",
"$",
"types",
"=",
"$",
... | Resolve includes for transformer.
@param string $group
@param array $data
@param mixed $parameters
@return array | [
"Resolve",
"includes",
"for",
"transformer",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/Concerns/Transformable.php#L113-L135 |
27,279 | orchestral/kernel | src/Http/Concerns/Transformable.php | Transformable.filterMetaType | protected function filterMetaType(string $name): void
{
$types = $this->options[$name] ?? $this->getRequest()->input($name);
if (is_string($types)) {
$types = explode(',', $types);
}
$this->options[$name] = is_array($types) ? Arr::expand(array_flip($types)) : [];
} | php | protected function filterMetaType(string $name): void
{
$types = $this->options[$name] ?? $this->getRequest()->input($name);
if (is_string($types)) {
$types = explode(',', $types);
}
$this->options[$name] = is_array($types) ? Arr::expand(array_flip($types)) : [];
} | [
"protected",
"function",
"filterMetaType",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"$",
"types",
"=",
"$",
"this",
"->",
"options",
"[",
"$",
"name",
"]",
"??",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"input",
"(",
"$",
"name",
... | Get option by group.
@param string $name
@return void | [
"Get",
"option",
"by",
"group",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/Concerns/Transformable.php#L144-L153 |
27,280 | melisplatform/melis-core | public/js/filemanager/include/php_image_magician.php | imageLib.gd_filter_monopin | public function gd_filter_monopin()
{
if ($this->imageResized)
{
imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE);
imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, -15);
imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -15);
$this->imageResized = $this->gd_apply_overlay($this->imageR... | php | public function gd_filter_monopin()
{
if ($this->imageResized)
{
imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE);
imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, -15);
imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -15);
$this->imageResized = $this->gd_apply_overlay($this->imageR... | [
"public",
"function",
"gd_filter_monopin",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"imageResized",
")",
"{",
"imagefilter",
"(",
"$",
"this",
"->",
"imageResized",
",",
"IMG_FILTER_GRAYSCALE",
")",
";",
"imagefilter",
"(",
"$",
"this",
"->",
"imageResiz... | Apply 'Monopin' preset | [
"Apply",
"Monopin",
"preset"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/public/js/filemanager/include/php_image_magician.php#L1201-L1211 |
27,281 | melisplatform/melis-core | public/js/filemanager/include/php_image_magician.php | imageLib.gd_apply_overlay | private function gd_apply_overlay($im, $type, $amount)
#
# Original Author: Marc Hibbins
# License: Attribution-ShareAlike 3.0
# Purpose:
# Params in:
# Params out:
# Notes:
#
{
$width = imagesx($im);
$height = imagesy($im);
$filter = imagecreatetruecolor($width, $height);
imagealphablendi... | php | private function gd_apply_overlay($im, $type, $amount)
#
# Original Author: Marc Hibbins
# License: Attribution-ShareAlike 3.0
# Purpose:
# Params in:
# Params out:
# Notes:
#
{
$width = imagesx($im);
$height = imagesy($im);
$filter = imagecreatetruecolor($width, $height);
imagealphablendi... | [
"private",
"function",
"gd_apply_overlay",
"(",
"$",
"im",
",",
"$",
"type",
",",
"$",
"amount",
")",
"#",
"# Original Author: Marc Hibbins",
"# License: Attribution-ShareAlike 3.0",
"# Purpose:",
"# Params in:",
"# Params out:",
"# Notes:",
"#",
"{",
"$",
"width",
... | Apply a PNG overlay | [
"Apply",
"a",
"PNG",
"overlay"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/public/js/filemanager/include/php_image_magician.php#L1231-L1264 |
27,282 | locomotivemtl/charcoal-app | src/Charcoal/App/AppConfig.php | AppConfig.setBasePath | public function setBasePath($path)
{
if ($path === null) {
throw new InvalidArgumentException(
'The base path is required.'
);
}
if (!is_string($path)) {
throw new InvalidArgumentException(
'The base path must be a string'
... | php | public function setBasePath($path)
{
if ($path === null) {
throw new InvalidArgumentException(
'The base path is required.'
);
}
if (!is_string($path)) {
throw new InvalidArgumentException(
'The base path must be a string'
... | [
"public",
"function",
"setBasePath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"path",
"===",
"null",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The base path is required.'",
")",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
"$",
"path",... | Set the application's absolute root path.
Resolves symlinks with realpath() and ensure trailing slash.
@param string $path The absolute path to the application's root directory.
@throws InvalidArgumentException If the argument is not a string.
@return self | [
"Set",
"the",
"application",
"s",
"absolute",
"root",
"path",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/AppConfig.php#L188-L204 |
27,283 | locomotivemtl/charcoal-app | src/Charcoal/App/AppConfig.php | AppConfig.setPublicPath | public function setPublicPath($path)
{
if ($path === null) {
$this->publicPath = null;
return $this;
}
if (!is_string($path)) {
throw new InvalidArgumentException(
'The public path must be a string'
);
}
$this-... | php | public function setPublicPath($path)
{
if ($path === null) {
$this->publicPath = null;
return $this;
}
if (!is_string($path)) {
throw new InvalidArgumentException(
'The public path must be a string'
);
}
$this-... | [
"public",
"function",
"setPublicPath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"path",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"publicPath",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
"$",
"path",
... | Set the application's absolute path to the public web directory.
@param string $path The path to the application's public directory.
@throws InvalidArgumentException If the argument is not a string.
@return self | [
"Set",
"the",
"application",
"s",
"absolute",
"path",
"to",
"the",
"public",
"web",
"directory",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/AppConfig.php#L223-L238 |
27,284 | locomotivemtl/charcoal-app | src/Charcoal/App/AppConfig.php | AppConfig.publicPath | public function publicPath()
{
if (!isset($this->publicPath)) {
$this->publicPath = $this->basePath().'www'.DIRECTORY_SEPARATOR;
}
return $this->publicPath;
} | php | public function publicPath()
{
if (!isset($this->publicPath)) {
$this->publicPath = $this->basePath().'www'.DIRECTORY_SEPARATOR;
}
return $this->publicPath;
} | [
"public",
"function",
"publicPath",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"publicPath",
")",
")",
"{",
"$",
"this",
"->",
"publicPath",
"=",
"$",
"this",
"->",
"basePath",
"(",
")",
".",
"'www'",
".",
"DIRECTORY_SEPARATOR",
... | Retrieve the application's absolute path to the public web directory.
@return string The absolute path to the application's public directory. | [
"Retrieve",
"the",
"application",
"s",
"absolute",
"path",
"to",
"the",
"public",
"web",
"directory",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/AppConfig.php#L245-L252 |
27,285 | locomotivemtl/charcoal-app | src/Charcoal/App/AppConfig.php | AppConfig.setBaseUrl | public function setBaseUrl($uri)
{
if (is_string($uri)) {
$this->baseUrl = Uri::createFromString($uri);
} else {
$this->baseUrl = $uri;
}
return $this;
} | php | public function setBaseUrl($uri)
{
if (is_string($uri)) {
$this->baseUrl = Uri::createFromString($uri);
} else {
$this->baseUrl = $uri;
}
return $this;
} | [
"public",
"function",
"setBaseUrl",
"(",
"$",
"uri",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"uri",
")",
")",
"{",
"$",
"this",
"->",
"baseUrl",
"=",
"Uri",
"::",
"createFromString",
"(",
"$",
"uri",
")",
";",
"}",
"else",
"{",
"$",
"this",
"... | Set the application's fully qualified base URL to the public web directory.
@param UriInterface|string $uri The base URI to the application's web directory.
@return self | [
"Set",
"the",
"application",
"s",
"fully",
"qualified",
"base",
"URL",
"to",
"the",
"public",
"web",
"directory",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/AppConfig.php#L260-L268 |
27,286 | locomotivemtl/charcoal-app | src/Charcoal/App/AppConfig.php | AppConfig.setProjectName | public function setProjectName($projectName)
{
if ($projectName === null) {
$this->projectName = null;
return $this;
}
if (!is_string($projectName)) {
throw new InvalidArgumentException(
'Project name must be a string'
);
... | php | public function setProjectName($projectName)
{
if ($projectName === null) {
$this->projectName = null;
return $this;
}
if (!is_string($projectName)) {
throw new InvalidArgumentException(
'Project name must be a string'
);
... | [
"public",
"function",
"setProjectName",
"(",
"$",
"projectName",
")",
"{",
"if",
"(",
"$",
"projectName",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"projectName",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
... | Sets the project name.
@param string|null $projectName The project name.
@throws InvalidArgumentException If the project argument is not a string (or null).
@return self | [
"Sets",
"the",
"project",
"name",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/AppConfig.php#L322-L336 |
27,287 | locomotivemtl/charcoal-app | src/Charcoal/App/Route/RouteConfig.php | RouteConfig.setHeaders | public function setHeaders(array $headers)
{
$this->headers = [];
foreach ($headers as $name => $val) {
$this->addHeader($name, $val);
}
return $this;
} | php | public function setHeaders(array $headers)
{
$this->headers = [];
foreach ($headers as $name => $val) {
$this->addHeader($name, $val);
}
return $this;
} | [
"public",
"function",
"setHeaders",
"(",
"array",
"$",
"headers",
")",
"{",
"$",
"this",
"->",
"headers",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"name",
"=>",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"addHeader",
"(",
"$",
... | Add custom headers
@param array $headers The custom headers, in key=>val pairs.
@return self | [
"Add",
"custom",
"headers"
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Route/RouteConfig.php#L186-L193 |
27,288 | locomotivemtl/charcoal-app | src/Charcoal/App/Route/RouteConfig.php | RouteConfig.addMethod | public function addMethod($method)
{
if (!is_string($method)) {
throw new InvalidArgumentException(
sprintf(
'Unsupported HTTP method; must be a string, received %s',
(is_object($method) ? get_class($method) : gettype($method))
... | php | public function addMethod($method)
{
if (!is_string($method)) {
throw new InvalidArgumentException(
sprintf(
'Unsupported HTTP method; must be a string, received %s',
(is_object($method) ? get_class($method) : gettype($method))
... | [
"public",
"function",
"addMethod",
"(",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"method",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Unsupported HTTP method; must be a string, received %s'",
",",
"(",
... | Add route HTTP method.
@param string $method The route's supported HTTP method.
@throws InvalidArgumentException If the HTTP method is invalid.
@return self | [
"Add",
"route",
"HTTP",
"method",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Route/RouteConfig.php#L287-L324 |
27,289 | locomotivemtl/charcoal-app | src/Charcoal/App/ServiceProvider/AppServiceProvider.php | AppServiceProvider.registerViewServices | protected function registerViewServices(Container $container)
{
if (!isset($container['view/mustache/helpers'])) {
$container['view/mustache/helpers'] = function () {
return [];
};
}
/**
* Extend helpers for the Mustache Engine
*
... | php | protected function registerViewServices(Container $container)
{
if (!isset($container['view/mustache/helpers'])) {
$container['view/mustache/helpers'] = function () {
return [];
};
}
/**
* Extend helpers for the Mustache Engine
*
... | [
"protected",
"function",
"registerViewServices",
"(",
"Container",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"container",
"[",
"'view/mustache/helpers'",
"]",
")",
")",
"{",
"$",
"container",
"[",
"'view/mustache/helpers'",
"]",
"=",
"func... | Add helpers to the view services.
@param Container $container A container instance.
@return void | [
"Add",
"helpers",
"to",
"the",
"view",
"services",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/ServiceProvider/AppServiceProvider.php#L456-L528 |
27,290 | locomotivemtl/charcoal-app | src/Charcoal/App/App.php | App.setup | private function setup()
{
$config = $this->config();
date_default_timezone_set($config['timezone']);
// Setup routes
$this->routeManager()->setupRoutes();
// Setup modules
$this->setupModules();
// Setup routable (if not running CLI mode)
if (PHP_S... | php | private function setup()
{
$config = $this->config();
date_default_timezone_set($config['timezone']);
// Setup routes
$this->routeManager()->setupRoutes();
// Setup modules
$this->setupModules();
// Setup routable (if not running CLI mode)
if (PHP_S... | [
"private",
"function",
"setup",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
"(",
")",
";",
"date_default_timezone_set",
"(",
"$",
"config",
"[",
"'timezone'",
"]",
")",
";",
"// Setup routes",
"$",
"this",
"->",
"routeManager",
"(",
"... | Registers the default services and features that Charcoal needs to work.
@return void | [
"Registers",
"the",
"default",
"services",
"and",
"features",
"that",
"Charcoal",
"needs",
"to",
"work",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/App.php#L126-L144 |
27,291 | locomotivemtl/charcoal-app | src/Charcoal/App/App.php | App.setupRoutables | private function setupRoutables()
{
$app = $this;
// For now, need to rely on a catch-all...
$this->get(
'{catchall:.*}',
function (
RequestInterface $request,
ResponseInterface $response,
array $args
) use (... | php | private function setupRoutables()
{
$app = $this;
// For now, need to rely on a catch-all...
$this->get(
'{catchall:.*}',
function (
RequestInterface $request,
ResponseInterface $response,
array $args
) use (... | [
"private",
"function",
"setupRoutables",
"(",
")",
"{",
"$",
"app",
"=",
"$",
"this",
";",
"// For now, need to rely on a catch-all...",
"$",
"this",
"->",
"get",
"(",
"'{catchall:.*}'",
",",
"function",
"(",
"RequestInterface",
"$",
"request",
",",
"ResponseInter... | Setup the application's "global" routables.
Routables can only be defined globally (app-level) for now.
@return void | [
"Setup",
"the",
"application",
"s",
"global",
"routables",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/App.php#L186-L220 |
27,292 | melisplatform/melis-core | src/Model/Tables/MelisPlatformSchemeTable.php | MelisPlatformSchemeTable.getSchemeById | public function getSchemeById($id, $colorsOnly = false)
{
$id = (int) $id;
$select = $this->tableGateway->getSql()->select();
if($colorsOnly) {
$select->columns(array(
'pscheme_id', 'pscheme_name', 'pscheme_colors', 'pscheme_is_active'
));
... | php | public function getSchemeById($id, $colorsOnly = false)
{
$id = (int) $id;
$select = $this->tableGateway->getSql()->select();
if($colorsOnly) {
$select->columns(array(
'pscheme_id', 'pscheme_name', 'pscheme_colors', 'pscheme_is_active'
));
... | [
"public",
"function",
"getSchemeById",
"(",
"$",
"id",
",",
"$",
"colorsOnly",
"=",
"false",
")",
"{",
"$",
"id",
"=",
"(",
"int",
")",
"$",
"id",
";",
"$",
"select",
"=",
"$",
"this",
"->",
"tableGateway",
"->",
"getSql",
"(",
")",
"->",
"select",... | Query scheme table by ID
@param $id
@param bool $colorsOnly
@return null|\Zend\Db\ResultSet\ResultSetInterface | [
"Query",
"scheme",
"table",
"by",
"ID"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Model/Tables/MelisPlatformSchemeTable.php#L28-L45 |
27,293 | melisplatform/melis-core | src/Model/Tables/MelisPlatformSchemeTable.php | MelisPlatformSchemeTable.getSchemeByName | public function getSchemeByName($name, $colorsOnly = false)
{
$select = $this->tableGateway->getSql()->select();
if($colorsOnly) {
$select->columns(array(
'pscheme_id', 'pscheme_name', 'pscheme_colors', 'pscheme_is_active'
));
}
$select->wher... | php | public function getSchemeByName($name, $colorsOnly = false)
{
$select = $this->tableGateway->getSql()->select();
if($colorsOnly) {
$select->columns(array(
'pscheme_id', 'pscheme_name', 'pscheme_colors', 'pscheme_is_active'
));
}
$select->wher... | [
"public",
"function",
"getSchemeByName",
"(",
"$",
"name",
",",
"$",
"colorsOnly",
"=",
"false",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"tableGateway",
"->",
"getSql",
"(",
")",
"->",
"select",
"(",
")",
";",
"if",
"(",
"$",
"colorsOnly",
"... | Query scheme table by name
@param $name
@param bool $colorsOnly
@return null|\Zend\Db\ResultSet\ResultSetInterface | [
"Query",
"scheme",
"table",
"by",
"name"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Model/Tables/MelisPlatformSchemeTable.php#L53-L68 |
27,294 | melisplatform/melis-core | src/Model/Tables/MelisPlatformSchemeTable.php | MelisPlatformSchemeTable.getActiveScheme | public function getActiveScheme($colorsOnly = false)
{
$select = $this->tableGateway->getSql()->select();
if($colorsOnly) {
$select->columns(array(
'pscheme_id', 'pscheme_name', 'pscheme_colors', 'pscheme_is_active'
));
}
$select->where->equa... | php | public function getActiveScheme($colorsOnly = false)
{
$select = $this->tableGateway->getSql()->select();
if($colorsOnly) {
$select->columns(array(
'pscheme_id', 'pscheme_name', 'pscheme_colors', 'pscheme_is_active'
));
}
$select->where->equa... | [
"public",
"function",
"getActiveScheme",
"(",
"$",
"colorsOnly",
"=",
"false",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"tableGateway",
"->",
"getSql",
"(",
")",
"->",
"select",
"(",
")",
";",
"if",
"(",
"$",
"colorsOnly",
")",
"{",
"$",
"sel... | Returns the currently active scheme
@param bool $colorsOnly
@return null|\Zend\Db\ResultSet\ResultSetInterface | [
"Returns",
"the",
"currently",
"active",
"scheme"
] | f8b0648930e21d1f2b2e5b9300781c335bd34ea4 | https://github.com/melisplatform/melis-core/blob/f8b0648930e21d1f2b2e5b9300781c335bd34ea4/src/Model/Tables/MelisPlatformSchemeTable.php#L75-L90 |
27,295 | locomotivemtl/charcoal-app | src/Charcoal/App/Handler/AbstractHandler.php | AbstractHandler.respondWith | protected function respondWith(ResponseInterface $response, $contentType, $output)
{
$body = new Body(fopen('php://temp', 'r+'));
$body->write($output);
return $response->withHeader('Content-Type', $contentType)
->withBody($body);
} | php | protected function respondWith(ResponseInterface $response, $contentType, $output)
{
$body = new Body(fopen('php://temp', 'r+'));
$body->write($output);
return $response->withHeader('Content-Type', $contentType)
->withBody($body);
} | [
"protected",
"function",
"respondWith",
"(",
"ResponseInterface",
"$",
"response",
",",
"$",
"contentType",
",",
"$",
"output",
")",
"{",
"$",
"body",
"=",
"new",
"Body",
"(",
"fopen",
"(",
"'php://temp'",
",",
"'r+'",
")",
")",
";",
"$",
"body",
"->",
... | Mutate the given response.
@param ResponseInterface $response The most recent Response object.
@param string $contentType The content type of the output.
@param string $output The text output.
@return ResponseInterface | [
"Mutate",
"the",
"given",
"response",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Handler/AbstractHandler.php#L275-L282 |
27,296 | UseMuffin/Tokenize | src/Model/Table/TokensTable.php | TokensTable.findToken | public function findToken(Query $query, array $options)
{
$options += [
'token' => null,
'expired >' => new DateTime(),
'status' => false
];
return $query->where($options);
} | php | public function findToken(Query $query, array $options)
{
$options += [
'token' => null,
'expired >' => new DateTime(),
'status' => false
];
return $query->where($options);
} | [
"public",
"function",
"findToken",
"(",
"Query",
"$",
"query",
",",
"array",
"$",
"options",
")",
"{",
"$",
"options",
"+=",
"[",
"'token'",
"=>",
"null",
",",
"'expired >'",
"=>",
"new",
"DateTime",
"(",
")",
",",
"'status'",
"=>",
"false",
"]",
";",
... | Custom finder "token"
@param \Cake\ORM\Query $query Query
@param array $options Options
@return \Cake\ORM\Query | [
"Custom",
"finder",
"token"
] | a7ecf4114782abe12b0ab36e8a32504428fe91ec | https://github.com/UseMuffin/Tokenize/blob/a7ecf4114782abe12b0ab36e8a32504428fe91ec/src/Model/Table/TokensTable.php#L42-L51 |
27,297 | locomotivemtl/charcoal-app | src/Charcoal/App/Config/LoggerConfig.php | LoggerConfig.addHandler | public function addHandler(array $handler, $key = null)
{
if (!isset($handler['type'])) {
throw new InvalidArgumentException(
'Handler type is required.'
);
}
if (!is_string($key)) {
$this->handlers[] = $handler;
} else {
... | php | public function addHandler(array $handler, $key = null)
{
if (!isset($handler['type'])) {
throw new InvalidArgumentException(
'Handler type is required.'
);
}
if (!is_string($key)) {
$this->handlers[] = $handler;
} else {
... | [
"public",
"function",
"addHandler",
"(",
"array",
"$",
"handler",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"handler",
"[",
"'type'",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Handler type is ... | Add a record handler to use.
@param array $handler The record handler structure.
@param string|null $key The handler's key.
@throws InvalidArgumentException If the handler is invalid.
@return self | [
"Add",
"a",
"record",
"handler",
"to",
"use",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Config/LoggerConfig.php#L143-L158 |
27,298 | locomotivemtl/charcoal-app | src/Charcoal/App/Config/LoggerConfig.php | LoggerConfig.addProcessor | public function addProcessor(array $processor, $key = null)
{
if (!isset($processor['type'])) {
throw new InvalidArgumentException(
'Processor type is required.'
);
}
if (!is_string($key)) {
$this->processors[] = $processor;
} else... | php | public function addProcessor(array $processor, $key = null)
{
if (!isset($processor['type'])) {
throw new InvalidArgumentException(
'Processor type is required.'
);
}
if (!is_string($key)) {
$this->processors[] = $processor;
} else... | [
"public",
"function",
"addProcessor",
"(",
"array",
"$",
"processor",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"processor",
"[",
"'type'",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Processor ... | Add a record processor to use.
@param array $processor The record processor structure.
@param string|null $key The processor's key.
@throws InvalidArgumentException If the processor is invalid.
@return self | [
"Add",
"a",
"record",
"processor",
"to",
"use",
"."
] | d25bdab08d40dda83c71b770c59e3b469e0ebfbc | https://github.com/locomotivemtl/charcoal-app/blob/d25bdab08d40dda83c71b770c59e3b469e0ebfbc/src/Charcoal/App/Config/LoggerConfig.php#L205-L220 |
27,299 | orchestral/kernel | src/Http/FormRequest.php | FormRequest.setupValidationScenario | protected function setupValidationScenario()
{
$current = $this->method();
$available = [
'POST' => 'store',
'PUT' => 'update',
'DELETE' => 'destroy',
];
if (in_array($current, $available)) {
$this->onValidationScenario($available[$cur... | php | protected function setupValidationScenario()
{
$current = $this->method();
$available = [
'POST' => 'store',
'PUT' => 'update',
'DELETE' => 'destroy',
];
if (in_array($current, $available)) {
$this->onValidationScenario($available[$cur... | [
"protected",
"function",
"setupValidationScenario",
"(",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"method",
"(",
")",
";",
"$",
"available",
"=",
"[",
"'POST'",
"=>",
"'store'",
",",
"'PUT'",
"=>",
"'update'",
",",
"'DELETE'",
"=>",
"'destroy'",
... | Setup validation scenario based on request method.
@return void | [
"Setup",
"validation",
"scenario",
"based",
"on",
"request",
"method",
"."
] | d4ebf0604e9aba6fe30813bc3446305157d93eb4 | https://github.com/orchestral/kernel/blob/d4ebf0604e9aba6fe30813bc3446305157d93eb4/src/Http/FormRequest.php#L45-L57 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.