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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
222,600 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.index | public function index()
{
// SECURITY:
// if view_table_permission is false, abort
if (isset($this->crud['view_table_permission']) && !$this->crud['view_table_permission']) {
abort(403, 'Not allowed.');
}
// get all results for that entity
$model = $this->crud['model'];
if (property_exists($model, 't... | php | public function index()
{
// SECURITY:
// if view_table_permission is false, abort
if (isset($this->crud['view_table_permission']) && !$this->crud['view_table_permission']) {
abort(403, 'Not allowed.');
}
// get all results for that entity
$model = $this->crud['model'];
if (property_exists($model, 't... | [
"public",
"function",
"index",
"(",
")",
"{",
"// SECURITY:",
"// if view_table_permission is false, abort",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"crud",
"[",
"'view_table_permission'",
"]",
")",
"&&",
"!",
"$",
"this",
"->",
"crud",
"[",
"'view_table_per... | Display all rows in the database for this entity.
@return Response | [
"Display",
"all",
"rows",
"in",
"the",
"database",
"for",
"this",
"entity",
"."
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L46-L75 |
222,601 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.create | public function create()
{
// SECURITY:
// if add_permission is false, abort
if (isset($this->crud['add_permission']) && !$this->crud['add_permission']) {
abort(403, 'Not allowed.');
}
// get the fields you need to show
if (isset($this->data['crud']['create_fields']))
{
$this->crud['fields'] = $th... | php | public function create()
{
// SECURITY:
// if add_permission is false, abort
if (isset($this->crud['add_permission']) && !$this->crud['add_permission']) {
abort(403, 'Not allowed.');
}
// get the fields you need to show
if (isset($this->data['crud']['create_fields']))
{
$this->crud['fields'] = $th... | [
"public",
"function",
"create",
"(",
")",
"{",
"// SECURITY:",
"// if add_permission is false, abort",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"crud",
"[",
"'add_permission'",
"]",
")",
"&&",
"!",
"$",
"this",
"->",
"crud",
"[",
"'add_permission'",
"]",
... | Show the form for creating inserting a new row.
@return Response | [
"Show",
"the",
"form",
"for",
"creating",
"inserting",
"a",
"new",
"row",
"."
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L83-L103 |
222,602 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.storeCrud | public function storeCrud(StoreRequest $request = null)
{
// SECURITY:
// if add_permission is false, abort
if (isset($this->crud['add_permission']) && !$this->crud['add_permission']) {
abort(403, 'Not allowed.');
}
// compress the fake fields into one field
$model = $this->crud['model'];
$values_to_... | php | public function storeCrud(StoreRequest $request = null)
{
// SECURITY:
// if add_permission is false, abort
if (isset($this->crud['add_permission']) && !$this->crud['add_permission']) {
abort(403, 'Not allowed.');
}
// compress the fake fields into one field
$model = $this->crud['model'];
$values_to_... | [
"public",
"function",
"storeCrud",
"(",
"StoreRequest",
"$",
"request",
"=",
"null",
")",
"{",
"// SECURITY:",
"// if add_permission is false, abort",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"crud",
"[",
"'add_permission'",
"]",
")",
"&&",
"!",
"$",
"this"... | Store a newly created resource in the database.
@return Response | [
"Store",
"a",
"newly",
"created",
"resource",
"in",
"the",
"database",
"."
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L111-L146 |
222,603 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.updateCrud | public function updateCrud(UpdateRequest $request = null)
{
// if edit_permission is false, abort
if (isset($this->crud['edit_permission']) && !$this->crud['edit_permission']) {
abort(403, 'Not allowed.');
}
$model = $this->crud['model'];
$this->prepareFields($model::find(\Request::input('id')));
$ite... | php | public function updateCrud(UpdateRequest $request = null)
{
// if edit_permission is false, abort
if (isset($this->crud['edit_permission']) && !$this->crud['edit_permission']) {
abort(403, 'Not allowed.');
}
$model = $this->crud['model'];
$this->prepareFields($model::find(\Request::input('id')));
$ite... | [
"public",
"function",
"updateCrud",
"(",
"UpdateRequest",
"$",
"request",
"=",
"null",
")",
"{",
"// if edit_permission is false, abort",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"crud",
"[",
"'edit_permission'",
"]",
")",
"&&",
"!",
"$",
"this",
"->",
"c... | Update the specified resource in the database.
@param int $id
@return Response | [
"Update",
"the",
"specified",
"resource",
"in",
"the",
"database",
"."
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L188-L213 |
222,604 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.reorder | public function reorder($lang = false)
{
// if reorder_table_permission is false, abort
if (isset($this->crud['reorder_permission']) && !$this->crud['reorder_permission']) {
abort(403, 'Not allowed.');
}
if ($lang == false)
{
$lang = \Lang::locale();
}
// get all results for that entity
$model ... | php | public function reorder($lang = false)
{
// if reorder_table_permission is false, abort
if (isset($this->crud['reorder_permission']) && !$this->crud['reorder_permission']) {
abort(403, 'Not allowed.');
}
if ($lang == false)
{
$lang = \Lang::locale();
}
// get all results for that entity
$model ... | [
"public",
"function",
"reorder",
"(",
"$",
"lang",
"=",
"false",
")",
"{",
"// if reorder_table_permission is false, abort",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"crud",
"[",
"'reorder_permission'",
"]",
")",
"&&",
"!",
"$",
"this",
"->",
"crud",
"[",... | Reorder the items in the database using the Nested Set pattern.
Database columns needed: id, parent_id, lft, rgt, depth, name/title
@return Response | [
"Reorder",
"the",
"items",
"in",
"the",
"database",
"using",
"the",
"Nested",
"Set",
"pattern",
"."
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L264-L292 |
222,605 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.saveReorder | public function saveReorder()
{
// if reorder_table_permission is false, abort
if (isset($this->crud['reorder_permission']) && !$this->crud['reorder_permission']) {
abort(403, 'Not allowed.');
}
$model = $this->crud['model'];
$count = 0;
$all_entries = \Request::input('tree');
if (count($all_entries... | php | public function saveReorder()
{
// if reorder_table_permission is false, abort
if (isset($this->crud['reorder_permission']) && !$this->crud['reorder_permission']) {
abort(403, 'Not allowed.');
}
$model = $this->crud['model'];
$count = 0;
$all_entries = \Request::input('tree');
if (count($all_entries... | [
"public",
"function",
"saveReorder",
"(",
")",
"{",
"// if reorder_table_permission is false, abort",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"crud",
"[",
"'reorder_permission'",
"]",
")",
"&&",
"!",
"$",
"this",
"->",
"crud",
"[",
"'reorder_permission'",
"]... | Save the new order, using the Nested Set pattern.
Database columns needed: id, parent_id, lft, rgt, depth, name/title
@return | [
"Save",
"the",
"new",
"order",
"using",
"the",
"Nested",
"Set",
"pattern",
"."
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L302-L333 |
222,606 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.translateItem | public function translateItem($id, $lang)
{
$model = $this->crud['model'];
$this->data['entry'] = $model::find($id);
// check if there isn't a translation already
$existing_translation = $this->data['entry']->translation($lang);
if ($existing_translation)
{
$new_entry = $existing_translation;
}
els... | php | public function translateItem($id, $lang)
{
$model = $this->crud['model'];
$this->data['entry'] = $model::find($id);
// check if there isn't a translation already
$existing_translation = $this->data['entry']->translation($lang);
if ($existing_translation)
{
$new_entry = $existing_translation;
}
els... | [
"public",
"function",
"translateItem",
"(",
"$",
"id",
",",
"$",
"lang",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"crud",
"[",
"'model'",
"]",
";",
"$",
"this",
"->",
"data",
"[",
"'entry'",
"]",
"=",
"$",
"model",
"::",
"find",
"(",
"$",
... | Duplicate an existing item into another language and open it for editing. | [
"Duplicate",
"an",
"existing",
"item",
"into",
"another",
"language",
"and",
"open",
"it",
"for",
"editing",
"."
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L374-L398 |
222,607 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.compactFakeFields | protected function compactFakeFields($request) {
$this->prepareFields();
$fake_field_columns_to_encode = [];
// go through each defined field
foreach ($this->crud['fields'] as $k => $field) {
// if it's a fake field
if (isset($this->crud['fields'][$k]['fake']) && $this->crud['fields'][$k]['fake']==true... | php | protected function compactFakeFields($request) {
$this->prepareFields();
$fake_field_columns_to_encode = [];
// go through each defined field
foreach ($this->crud['fields'] as $k => $field) {
// if it's a fake field
if (isset($this->crud['fields'][$k]['fake']) && $this->crud['fields'][$k]['fake']==true... | [
"protected",
"function",
"compactFakeFields",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"prepareFields",
"(",
")",
";",
"$",
"fake_field_columns_to_encode",
"=",
"[",
"]",
";",
"// go through each defined field",
"foreach",
"(",
"$",
"this",
"->",
"crud"... | Refactor the request array to something that can be passed to the model's create or update function.
The resulting array will only include the fields that are stored in the database and their values,
plus the '_token' and 'redirect_after_save' variables.
@param Request $request - everything that was sent from the fo... | [
"Refactor",
"the",
"request",
"array",
"to",
"something",
"that",
"can",
"be",
"passed",
"to",
"the",
"model",
"s",
"create",
"or",
"update",
"function",
".",
"The",
"resulting",
"array",
"will",
"only",
"include",
"the",
"fields",
"that",
"are",
"stored",
... | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L437-L478 |
222,608 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.prepareColumns | protected function prepareColumns()
{
// if the columns aren't set, we can't show this page
// TODO: instead of dying, show the columns defined as visible on the model
if (!isset($this->crud['columns']))
{
abort(500, "CRUD columns are not defined.");
}
// if the columns are defined as a string, transfo... | php | protected function prepareColumns()
{
// if the columns aren't set, we can't show this page
// TODO: instead of dying, show the columns defined as visible on the model
if (!isset($this->crud['columns']))
{
abort(500, "CRUD columns are not defined.");
}
// if the columns are defined as a string, transfo... | [
"protected",
"function",
"prepareColumns",
"(",
")",
"{",
"// if the columns aren't set, we can't show this page",
"// TODO: instead of dying, show the columns defined as visible on the model",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"crud",
"[",
"'columns'",
"]",
")... | If it's not an array of array and it's a simple array, create a proper array of arrays for it | [
"If",
"it",
"s",
"not",
"an",
"array",
"of",
"array",
"and",
"it",
"s",
"a",
"simple",
"array",
"create",
"a",
"proper",
"array",
"of",
"arrays",
"for",
"it"
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L519-L543 |
222,609 | tabacitu/crud | src/Http/Controllers/CrudController.php | CrudController.prepareFields | protected function prepareFields($entry = false)
{
// if the fields have been defined separately for create and update, use that
if (!isset($this->crud['fields']))
{
if (isset($this->crud['create_fields']))
{
$this->crud['fields'] = $this->crud['create_fields'];
}
elseif (isset($this->crud['updat... | php | protected function prepareFields($entry = false)
{
// if the fields have been defined separately for create and update, use that
if (!isset($this->crud['fields']))
{
if (isset($this->crud['create_fields']))
{
$this->crud['fields'] = $this->crud['create_fields'];
}
elseif (isset($this->crud['updat... | [
"protected",
"function",
"prepareFields",
"(",
"$",
"entry",
"=",
"false",
")",
"{",
"// if the fields have been defined separately for create and update, use that",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"crud",
"[",
"'fields'",
"]",
")",
")",
"{",
"if"... | Prepare the fields to be shown, stored, updated or created.
Makes sure $this->crud['fields'] is in the proper format (array of arrays);
Makes sure $this->crud['fields'] also contains the id of the current item;
Makes sure $this->crud['fields'] also contains the values for each field; | [
"Prepare",
"the",
"fields",
"to",
"be",
"shown",
"stored",
"updated",
"or",
"created",
"."
] | 1236e1a51e75b86d48967272064b0f90c62568ad | https://github.com/tabacitu/crud/blob/1236e1a51e75b86d48967272064b0f90c62568ad/src/Http/Controllers/CrudController.php#L553-L618 |
222,610 | dmmlabo/dmm-php-sdk | src/Dmm/HttpClients/CurlHttpClient.php | CurlHttpClient.getHeaderSize | private function getHeaderSize()
{
$headerSize = $this->dmmCurl->getinfo(CURLINFO_HEADER_SIZE);
// This corrects a Curl bug where header size does not account
// for additional Proxy headers.
if ($this->needsCurlProxyFix()) {
// Additional way to calculate the request bod... | php | private function getHeaderSize()
{
$headerSize = $this->dmmCurl->getinfo(CURLINFO_HEADER_SIZE);
// This corrects a Curl bug where header size does not account
// for additional Proxy headers.
if ($this->needsCurlProxyFix()) {
// Additional way to calculate the request bod... | [
"private",
"function",
"getHeaderSize",
"(",
")",
"{",
"$",
"headerSize",
"=",
"$",
"this",
"->",
"dmmCurl",
"->",
"getinfo",
"(",
"CURLINFO_HEADER_SIZE",
")",
";",
"// This corrects a Curl bug where header size does not account",
"// for additional Proxy headers.",
"if",
... | Return proper header size
@return integer | [
"Return",
"proper",
"header",
"size"
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/HttpClients/CurlHttpClient.php#L157-L172 |
222,611 | dmmlabo/dmm-php-sdk | src/Dmm/HttpClients/CurlHttpClient.php | CurlHttpClient.needsCurlProxyFix | private function needsCurlProxyFix()
{
$ver = $this->dmmCurl->version();
$version = $ver['version_number'];
return $version < self::CURL_PROXY_QUIRK_VER;
} | php | private function needsCurlProxyFix()
{
$ver = $this->dmmCurl->version();
$version = $ver['version_number'];
return $version < self::CURL_PROXY_QUIRK_VER;
} | [
"private",
"function",
"needsCurlProxyFix",
"(",
")",
"{",
"$",
"ver",
"=",
"$",
"this",
"->",
"dmmCurl",
"->",
"version",
"(",
")",
";",
"$",
"version",
"=",
"$",
"ver",
"[",
"'version_number'",
"]",
";",
"return",
"$",
"version",
"<",
"self",
"::",
... | Detect versions of Curl which report incorrect header lengths when
using Proxies.
@return boolean | [
"Detect",
"versions",
"of",
"Curl",
"which",
"report",
"incorrect",
"header",
"lengths",
"when",
"using",
"Proxies",
"."
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/HttpClients/CurlHttpClient.php#L180-L186 |
222,612 | zackslash/PHP-Web-Article-Extractor | src/Filters/EndBlockFilter.php | EndBlockFilter.stringStartsWithResourceEntry | private static function stringStartsWithResourceEntry($blockText,$resource)
{
foreach ($resource->resourceContent as $resourceEntry)
{
if(EndBlockFilter::stringStartsWith($blockText,$resourceEntry))
{
return true;
}
}
return false;
} | php | private static function stringStartsWithResourceEntry($blockText,$resource)
{
foreach ($resource->resourceContent as $resourceEntry)
{
if(EndBlockFilter::stringStartsWith($blockText,$resourceEntry))
{
return true;
}
}
return false;
} | [
"private",
"static",
"function",
"stringStartsWithResourceEntry",
"(",
"$",
"blockText",
",",
"$",
"resource",
")",
"{",
"foreach",
"(",
"$",
"resource",
"->",
"resourceContent",
"as",
"$",
"resourceEntry",
")",
"{",
"if",
"(",
"EndBlockFilter",
"::",
"stringSta... | Checks all resources entries against block text for a 'starts with' qualifier | [
"Checks",
"all",
"resources",
"entries",
"against",
"block",
"text",
"for",
"a",
"starts",
"with",
"qualifier"
] | f93d25d588dc0f8ddc4572429288edddb69386f6 | https://github.com/zackslash/PHP-Web-Article-Extractor/blob/f93d25d588dc0f8ddc4572429288edddb69386f6/src/Filters/EndBlockFilter.php#L102-L112 |
222,613 | zackslash/PHP-Web-Article-Extractor | src/Filters/EndBlockFilter.php | EndBlockFilter.stringContainsResourceEntry | private static function stringContainsResourceEntry($blockText,$resource)
{
foreach ($resource->resourceContent as $resourceEntry)
{
if(EndBlockFilter::stringContains($blockText,$resourceEntry))
{
return true;
}
}
return false;
} | php | private static function stringContainsResourceEntry($blockText,$resource)
{
foreach ($resource->resourceContent as $resourceEntry)
{
if(EndBlockFilter::stringContains($blockText,$resourceEntry))
{
return true;
}
}
return false;
} | [
"private",
"static",
"function",
"stringContainsResourceEntry",
"(",
"$",
"blockText",
",",
"$",
"resource",
")",
"{",
"foreach",
"(",
"$",
"resource",
"->",
"resourceContent",
"as",
"$",
"resourceEntry",
")",
"{",
"if",
"(",
"EndBlockFilter",
"::",
"stringConta... | Checks all resource entries against block text for a 'contains' qualifier | [
"Checks",
"all",
"resource",
"entries",
"against",
"block",
"text",
"for",
"a",
"contains",
"qualifier"
] | f93d25d588dc0f8ddc4572429288edddb69386f6 | https://github.com/zackslash/PHP-Web-Article-Extractor/blob/f93d25d588dc0f8ddc4572429288edddb69386f6/src/Filters/EndBlockFilter.php#L115-L125 |
222,614 | zackslash/PHP-Web-Article-Extractor | src/Filters/EndBlockFilter.php | EndBlockFilter.stringMatchesResourceEntry | private static function stringMatchesResourceEntry($blockText,$resource)
{
foreach ($resource->resourceContent as $resourceEntry)
{
if($blockText === $resourceEntry)
{
return true;
}
}
return false;
} | php | private static function stringMatchesResourceEntry($blockText,$resource)
{
foreach ($resource->resourceContent as $resourceEntry)
{
if($blockText === $resourceEntry)
{
return true;
}
}
return false;
} | [
"private",
"static",
"function",
"stringMatchesResourceEntry",
"(",
"$",
"blockText",
",",
"$",
"resource",
")",
"{",
"foreach",
"(",
"$",
"resource",
"->",
"resourceContent",
"as",
"$",
"resourceEntry",
")",
"{",
"if",
"(",
"$",
"blockText",
"===",
"$",
"re... | Checks all resource entries against block text for a complete match | [
"Checks",
"all",
"resource",
"entries",
"against",
"block",
"text",
"for",
"a",
"complete",
"match"
] | f93d25d588dc0f8ddc4572429288edddb69386f6 | https://github.com/zackslash/PHP-Web-Article-Extractor/blob/f93d25d588dc0f8ddc4572429288edddb69386f6/src/Filters/EndBlockFilter.php#L128-L138 |
222,615 | zackslash/PHP-Web-Article-Extractor | src/Filters/EndBlockFilter.php | EndBlockFilter.stringStartsWithNumberFollowedByResource | private static function stringStartsWithNumberFollowedByResource($inString,$resource)
{
$followingTextArray = $resource->resourceContent;
$count = 0;
foreach (str_split($inString) as $character)
{
if(EndBlockFilter::characterIsDigit($character))
{
$count++;
}
else
{
brea... | php | private static function stringStartsWithNumberFollowedByResource($inString,$resource)
{
$followingTextArray = $resource->resourceContent;
$count = 0;
foreach (str_split($inString) as $character)
{
if(EndBlockFilter::characterIsDigit($character))
{
$count++;
}
else
{
brea... | [
"private",
"static",
"function",
"stringStartsWithNumberFollowedByResource",
"(",
"$",
"inString",
",",
"$",
"resource",
")",
"{",
"$",
"followingTextArray",
"=",
"$",
"resource",
"->",
"resourceContent",
";",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"str_sp... | Checks if text matches a specific format i.e '23 comments' | [
"Checks",
"if",
"text",
"matches",
"a",
"specific",
"format",
"i",
".",
"e",
"23",
"comments"
] | f93d25d588dc0f8ddc4572429288edddb69386f6 | https://github.com/zackslash/PHP-Web-Article-Extractor/blob/f93d25d588dc0f8ddc4572429288edddb69386f6/src/Filters/EndBlockFilter.php#L141-L171 |
222,616 | zackslash/PHP-Web-Article-Extractor | src/ResourceProvider.php | ResourceProvider.loadResource | public function loadResource($resourceName)
{
$resourceLocation = dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."res".DIRECTORY_SEPARATOR.$resourceName;
$this->resourceContent = $this->readResourceToArray($resourceLocation);
} | php | public function loadResource($resourceName)
{
$resourceLocation = dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."res".DIRECTORY_SEPARATOR.$resourceName;
$this->resourceContent = $this->readResourceToArray($resourceLocation);
} | [
"public",
"function",
"loadResource",
"(",
"$",
"resourceName",
")",
"{",
"$",
"resourceLocation",
"=",
"dirname",
"(",
"__FILE__",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"\"..\"",
".",
"DIRECTORY_SEPARATOR",
".",
"\"res\"",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
... | Loads resource into memory by name only into this instance's resourceContent
@param string $resourceName name of the resource to load. | [
"Loads",
"resource",
"into",
"memory",
"by",
"name",
"only",
"into",
"this",
"instance",
"s",
"resourceContent"
] | f93d25d588dc0f8ddc4572429288edddb69386f6 | https://github.com/zackslash/PHP-Web-Article-Extractor/blob/f93d25d588dc0f8ddc4572429288edddb69386f6/src/ResourceProvider.php#L74-L78 |
222,617 | zackslash/PHP-Web-Article-Extractor | src/ResourceProvider.php | ResourceProvider.loadResourceDirectory | public function loadResourceDirectory($directoryName)
{
$resourceLocation = dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."res".DIRECTORY_SEPARATOR.$directoryName;
$results = array();
foreach (scandir($resourceLocation) as $file)
{
//Only load file if it has a .lst extention (... | php | public function loadResourceDirectory($directoryName)
{
$resourceLocation = dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."res".DIRECTORY_SEPARATOR.$directoryName;
$results = array();
foreach (scandir($resourceLocation) as $file)
{
//Only load file if it has a .lst extention (... | [
"public",
"function",
"loadResourceDirectory",
"(",
"$",
"directoryName",
")",
"{",
"$",
"resourceLocation",
"=",
"dirname",
"(",
"__FILE__",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"\"..\"",
".",
"DIRECTORY_SEPARATOR",
".",
"\"res\"",
".",
"DIRECTORY_SEPARATOR",
".",... | Loads all resources found in a directory into memory by name only into this instance's resourceContent
@param string $resourceName name of the directory to load | [
"Loads",
"all",
"resources",
"found",
"in",
"a",
"directory",
"into",
"memory",
"by",
"name",
"only",
"into",
"this",
"instance",
"s",
"resourceContent"
] | f93d25d588dc0f8ddc4572429288edddb69386f6 | https://github.com/zackslash/PHP-Web-Article-Extractor/blob/f93d25d588dc0f8ddc4572429288edddb69386f6/src/ResourceProvider.php#L85-L103 |
222,618 | joomla-framework/form | src/Field/ListField.php | ListField.getInput | protected function getInput()
{
$html = array();
$attr = '';
$select = new HtmlSelect;
// Try to inject the text object into the field
try
{
$select->setText($this->getText());
}
catch (\RuntimeException $exception)
{
// A Text object was not set, ignore the error and try to continue processi... | php | protected function getInput()
{
$html = array();
$attr = '';
$select = new HtmlSelect;
// Try to inject the text object into the field
try
{
$select->setText($this->getText());
}
catch (\RuntimeException $exception)
{
// A Text object was not set, ignore the error and try to continue processi... | [
"protected",
"function",
"getInput",
"(",
")",
"{",
"$",
"html",
"=",
"array",
"(",
")",
";",
"$",
"attr",
"=",
"''",
";",
"$",
"select",
"=",
"new",
"HtmlSelect",
";",
"// Try to inject the text object into the field",
"try",
"{",
"$",
"select",
"->",
"se... | Method to get the field input markup for a generic list.
Use the multiple attribute to enable multiselect.
@return string The field input markup.
@since 1.0 | [
"Method",
"to",
"get",
"the",
"field",
"input",
"markup",
"for",
"a",
"generic",
"list",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Field/ListField.php#L40-L88 |
222,619 | enygma/yubikey | src/Yubikey/Validate.php | Validate.getApiKey | public function getApiKey($decoded = false)
{
return ($decoded === false) ? $this->apiKey : base64_decode($this->apiKey);
} | php | public function getApiKey($decoded = false)
{
return ($decoded === false) ? $this->apiKey : base64_decode($this->apiKey);
} | [
"public",
"function",
"getApiKey",
"(",
"$",
"decoded",
"=",
"false",
")",
"{",
"return",
"(",
"$",
"decoded",
"===",
"false",
")",
"?",
"$",
"this",
"->",
"apiKey",
":",
"base64_decode",
"(",
"$",
"this",
"->",
"apiKey",
")",
";",
"}"
] | Get the currently set API key
@return string API key | [
"Get",
"the",
"currently",
"set",
"API",
"key"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Validate.php#L86-L89 |
222,620 | enygma/yubikey | src/Yubikey/Validate.php | Validate.setApiKey | public function setApiKey($apiKey)
{
$key = base64_decode($apiKey, true);
if ($key === false) {
throw new \InvalidArgumentException('Invalid API key');
}
$this->apiKey = $key;
return $this;
} | php | public function setApiKey($apiKey)
{
$key = base64_decode($apiKey, true);
if ($key === false) {
throw new \InvalidArgumentException('Invalid API key');
}
$this->apiKey = $key;
return $this;
} | [
"public",
"function",
"setApiKey",
"(",
"$",
"apiKey",
")",
"{",
"$",
"key",
"=",
"base64_decode",
"(",
"$",
"apiKey",
",",
"true",
")",
";",
"if",
"(",
"$",
"key",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Inva... | Set the API key
@param string $apiKey API request key | [
"Set",
"the",
"API",
"key"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Validate.php#L96-L105 |
222,621 | enygma/yubikey | src/Yubikey/Validate.php | Validate.getHost | public function getHost()
{
if ($this->host === null) {
// pick a "random" host
$host = $this->hosts[mt_rand(0,count($this->hosts)-1)];
$this->setHost($host);
return $host;
} else {
return $this->host;
}
} | php | public function getHost()
{
if ($this->host === null) {
// pick a "random" host
$host = $this->hosts[mt_rand(0,count($this->hosts)-1)];
$this->setHost($host);
return $host;
} else {
return $this->host;
}
} | [
"public",
"function",
"getHost",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"host",
"===",
"null",
")",
"{",
"// pick a \"random\" host",
"$",
"host",
"=",
"$",
"this",
"->",
"hosts",
"[",
"mt_rand",
"(",
"0",
",",
"count",
"(",
"$",
"this",
"->",
... | Get the host for the request
If one is not set, it returns a random one from the host set
@return string Hostname string | [
"Get",
"the",
"host",
"for",
"the",
"request",
"If",
"one",
"is",
"not",
"set",
"it",
"returns",
"a",
"random",
"one",
"from",
"the",
"host",
"set"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Validate.php#L180-L190 |
222,622 | enygma/yubikey | src/Yubikey/Validate.php | Validate.generateSignature | public function generateSignature($data, $key = null)
{
if ($key === null) {
$key = $this->getApiKey();
if ($key === null || empty($key)) {
throw new \InvalidArgumentException('Invalid API key!');
}
}
$query = http_build_query($data);
... | php | public function generateSignature($data, $key = null)
{
if ($key === null) {
$key = $this->getApiKey();
if ($key === null || empty($key)) {
throw new \InvalidArgumentException('Invalid API key!');
}
}
$query = http_build_query($data);
... | [
"public",
"function",
"generateSignature",
"(",
"$",
"data",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getApiKey",
"(",
")",
";",
"if",
"(",
"$",
"key",
"===",
"... | Geenrate the signature for the request values
@param array $data Data for request
@throws \InvalidArgumentException when API key is invalid
@return Hashed request signature (string) | [
"Geenrate",
"the",
"signature",
"for",
"the",
"request",
"values"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Validate.php#L241-L259 |
222,623 | enygma/yubikey | src/Yubikey/Validate.php | Validate.check | public function check($otp, $multi = false)
{
$otp = trim($otp);
if (strlen($otp) < 32 || strlen($otp) > 48) {
throw new \InvalidArgumentException('Invalid OTP length');
}
$this->setOtp($otp);
$this->setYubikeyId();
$clientId = $this->getClientId();
... | php | public function check($otp, $multi = false)
{
$otp = trim($otp);
if (strlen($otp) < 32 || strlen($otp) > 48) {
throw new \InvalidArgumentException('Invalid OTP length');
}
$this->setOtp($otp);
$this->setYubikeyId();
$clientId = $this->getClientId();
... | [
"public",
"function",
"check",
"(",
"$",
"otp",
",",
"$",
"multi",
"=",
"false",
")",
"{",
"$",
"otp",
"=",
"trim",
"(",
"$",
"otp",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"otp",
")",
"<",
"32",
"||",
"strlen",
"(",
"$",
"otp",
")",
">",
... | Check the One-time Password with API request
@param string $otp One-time password
@param integer $clientId Client ID for API
@throws \InvalidArgumentException when OTP length is invalid
@return \Yubikey\Response object | [
"Check",
"the",
"One",
"-",
"time",
"Password",
"with",
"API",
"request"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Validate.php#L269-L297 |
222,624 | enygma/yubikey | src/Yubikey/Validate.php | Validate.generateNonce | public function generateNonce()
{
if (function_exists('openssl_random_pseudo_bytes') === true) {
$hash = md5(openssl_random_pseudo_bytes(32));
} else {
$hash = md5(uniqid(mt_rand()));
}
return $hash;
} | php | public function generateNonce()
{
if (function_exists('openssl_random_pseudo_bytes') === true) {
$hash = md5(openssl_random_pseudo_bytes(32));
} else {
$hash = md5(uniqid(mt_rand()));
}
return $hash;
} | [
"public",
"function",
"generateNonce",
"(",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'openssl_random_pseudo_bytes'",
")",
"===",
"true",
")",
"{",
"$",
"hash",
"=",
"md5",
"(",
"openssl_random_pseudo_bytes",
"(",
"32",
")",
")",
";",
"}",
"else",
"{",
... | Generate a good nonce for the request
@return string Generated hash | [
"Generate",
"a",
"good",
"nonce",
"for",
"the",
"request"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Validate.php#L304-L312 |
222,625 | enygma/yubikey | src/Yubikey/Validate.php | Validate.validateResponseSignature | public function validateResponseSignature(\Yubikey\Response $response)
{
$params = array();
foreach ($response->getProperties() as $property) {
$value = $response->$property;
if ($value !== null) {
$params[$property] = $value;
}
}
k... | php | public function validateResponseSignature(\Yubikey\Response $response)
{
$params = array();
foreach ($response->getProperties() as $property) {
$value = $response->$property;
if ($value !== null) {
$params[$property] = $value;
}
}
k... | [
"public",
"function",
"validateResponseSignature",
"(",
"\\",
"Yubikey",
"\\",
"Response",
"$",
"response",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"response",
"->",
"getProperties",
"(",
")",
"as",
"$",
"property",
")",
... | Validate the signature on the response
@param \Yubikey\Response $response Response instance
@return boolean Pass/fail status of signature validation | [
"Validate",
"the",
"signature",
"on",
"the",
"response"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Validate.php#L354-L367 |
222,626 | mickgeek/yii2-actionbar | Widget.php | Widget.initDefaultElements | protected function initDefaultElements()
{
if (!isset($this->elements['bulk-actions'])) {
if ($this->bulkActionsPrompt === null) {
$this->bulkActionsPrompt = $this->t('widget', 'Bulk Actions');
}
if (empty($this->bulkActionsItems)) {
$this-... | php | protected function initDefaultElements()
{
if (!isset($this->elements['bulk-actions'])) {
if ($this->bulkActionsPrompt === null) {
$this->bulkActionsPrompt = $this->t('widget', 'Bulk Actions');
}
if (empty($this->bulkActionsItems)) {
$this-... | [
"protected",
"function",
"initDefaultElements",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"elements",
"[",
"'bulk-actions'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"bulkActionsPrompt",
"===",
"null",
")",
"{",
"$",
"thi... | Initializes the default elements. | [
"Initializes",
"the",
"default",
"elements",
"."
] | 028f38229bfee69ced4748f2cb869c5d4a630436 | https://github.com/mickgeek/yii2-actionbar/blob/028f38229bfee69ced4748f2cb869c5d4a630436/Widget.php#L133-L175 |
222,627 | mickgeek/yii2-actionbar | Widget.php | Widget.renderElements | protected function renderElements($template)
{
return preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) {
$name = $matches[1];
if (isset($this->elements[$name])) {
if ($name === 'bulk-actions' && $this->grid !== null) {
$id = $this->... | php | protected function renderElements($template)
{
return preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) {
$name = $matches[1];
if (isset($this->elements[$name])) {
if ($name === 'bulk-actions' && $this->grid !== null) {
$id = $this->... | [
"protected",
"function",
"renderElements",
"(",
"$",
"template",
")",
"{",
"return",
"preg_replace_callback",
"(",
"'/\\\\{([\\w\\-\\/]+)\\\\}/'",
",",
"function",
"(",
"$",
"matches",
")",
"{",
"$",
"name",
"=",
"$",
"matches",
"[",
"1",
"]",
";",
"if",
"("... | Renders elements.
@param string $template the elements template.
@return string the rendering result. | [
"Renders",
"elements",
"."
] | 028f38229bfee69ced4748f2cb869c5d4a630436 | https://github.com/mickgeek/yii2-actionbar/blob/028f38229bfee69ced4748f2cb869c5d4a630436/Widget.php#L207-L249 |
222,628 | enygma/yubikey | src/Yubikey/Request.php | Request.setUrl | public function setUrl($url)
{
if (filter_var($url, FILTER_VALIDATE_URL) !== $url) {
throw new \Exception('Invalid URL: '.$url);
}
$this->url = $url;
} | php | public function setUrl($url)
{
if (filter_var($url, FILTER_VALIDATE_URL) !== $url) {
throw new \Exception('Invalid URL: '.$url);
}
$this->url = $url;
} | [
"public",
"function",
"setUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_VALIDATE_URL",
")",
"!==",
"$",
"url",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Invalid URL: '",
".",
"$",
"url",
")",
";",
"... | Set the URL location for the request
@param string $url URL location | [
"Set",
"the",
"URL",
"location",
"for",
"the",
"request"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Request.php#L66-L72 |
222,629 | dmmlabo/dmm-php-sdk | src/Dmm/HttpClients/GuzzleHttpClient.php | GuzzleHttpClient.getHeadersAsString | public function getHeadersAsString(ResponseInterface $response)
{
$headers = $response->getHeaders();
$rawHeaders = [];
foreach ($headers as $name => $values) {
$rawHeaders[] = $name . ": " . implode(", ", $values);
}
return implode("\r\n", $rawHeaders);
} | php | public function getHeadersAsString(ResponseInterface $response)
{
$headers = $response->getHeaders();
$rawHeaders = [];
foreach ($headers as $name => $values) {
$rawHeaders[] = $name . ": " . implode(", ", $values);
}
return implode("\r\n", $rawHeaders);
} | [
"public",
"function",
"getHeadersAsString",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"headers",
"=",
"$",
"response",
"->",
"getHeaders",
"(",
")",
";",
"$",
"rawHeaders",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"n... | Returns the Guzzle array of headers as a string.
@param ResponseInterface $response The Guzzle response.
@return string | [
"Returns",
"the",
"Guzzle",
"array",
"of",
"headers",
"as",
"a",
"string",
"."
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/HttpClients/GuzzleHttpClient.php#L67-L76 |
222,630 | apioo/psx-schema | src/SchemaTraverser.php | SchemaTraverser.traverse | public function traverse($data, SchemaInterface $schema, VisitorInterface $visitor = null)
{
$this->pathStack = [];
$this->recCount = -1;
if ($visitor === null) {
$visitor = new NullVisitor();
}
return $this->recTraverse($data, $schema->getDefinition(),... | php | public function traverse($data, SchemaInterface $schema, VisitorInterface $visitor = null)
{
$this->pathStack = [];
$this->recCount = -1;
if ($visitor === null) {
$visitor = new NullVisitor();
}
return $this->recTraverse($data, $schema->getDefinition(),... | [
"public",
"function",
"traverse",
"(",
"$",
"data",
",",
"SchemaInterface",
"$",
"schema",
",",
"VisitorInterface",
"$",
"visitor",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"pathStack",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"recCount",
"=",
"-",
"1",... | Traverses through the data and validates it according to the provided
schema. Calls also the visitor methods for each type
@param mixed $data
@param \PSX\Schema\SchemaInterface $schema
@param \PSX\Schema\VisitorInterface $visitor
@return mixed | [
"Traverses",
"through",
"the",
"data",
"and",
"validates",
"it",
"according",
"to",
"the",
"provided",
"schema",
".",
"Calls",
"also",
"the",
"visitor",
"methods",
"for",
"each",
"type"
] | b06eebe847364c4b57e2447cd04be8eb75044947 | https://github.com/apioo/psx-schema/blob/b06eebe847364c4b57e2447cd04be8eb75044947/src/SchemaTraverser.php#L54-L64 |
222,631 | zackslash/PHP-Web-Article-Extractor | src/TextBlock.php | TextBlock.calculateDensities | public function calculateDensities()
{
if ($this->numWordsInWrappedLines == 0)
{
$this->numWordsInWrappedLines = $this->numWords;
$this->numWrappedLines = 1;
}
$this->textDensity = $this->numWordsInWrappedLines / $this->numWrappedLines;
$this->linkDensity = $this->numWords == 0 ? 0 : $this->num... | php | public function calculateDensities()
{
if ($this->numWordsInWrappedLines == 0)
{
$this->numWordsInWrappedLines = $this->numWords;
$this->numWrappedLines = 1;
}
$this->textDensity = $this->numWordsInWrappedLines / $this->numWrappedLines;
$this->linkDensity = $this->numWords == 0 ? 0 : $this->num... | [
"public",
"function",
"calculateDensities",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"numWordsInWrappedLines",
"==",
"0",
")",
"{",
"$",
"this",
"->",
"numWordsInWrappedLines",
"=",
"$",
"this",
"->",
"numWords",
";",
"$",
"this",
"->",
"numWrappedLines"... | Calculates the text and link densities for this block | [
"Calculates",
"the",
"text",
"and",
"link",
"densities",
"for",
"this",
"block"
] | f93d25d588dc0f8ddc4572429288edddb69386f6 | https://github.com/zackslash/PHP-Web-Article-Extractor/blob/f93d25d588dc0f8ddc4572429288edddb69386f6/src/TextBlock.php#L38-L53 |
222,632 | sheadawson/silverstripe-blocks | src/forms/GridfieldConfigBlockManager.php | GridFieldConfigBlockManager.addExisting | public function addExisting()
{
$classes = $this->blockManager->getBlockClasses();
$this->addComponent($add = new GridFieldAddExistingSearchButton());
$add->setSearchList(Block::get()->filter(array(
'ClassName' => array_keys($classes),
)));
return $this;
} | php | public function addExisting()
{
$classes = $this->blockManager->getBlockClasses();
$this->addComponent($add = new GridFieldAddExistingSearchButton());
$add->setSearchList(Block::get()->filter(array(
'ClassName' => array_keys($classes),
)));
return $this;
} | [
"public",
"function",
"addExisting",
"(",
")",
"{",
"$",
"classes",
"=",
"$",
"this",
"->",
"blockManager",
"->",
"getBlockClasses",
"(",
")",
";",
"$",
"this",
"->",
"addComponent",
"(",
"$",
"add",
"=",
"new",
"GridFieldAddExistingSearchButton",
"(",
")",
... | Add the GridFieldAddExistingSearchButton component to this grid config.
@return $this | [
"Add",
"the",
"GridFieldAddExistingSearchButton",
"component",
"to",
"this",
"grid",
"config",
"."
] | 07b00124ea617f95f436fb98b09d304daf6334e1 | https://github.com/sheadawson/silverstripe-blocks/blob/07b00124ea617f95f436fb98b09d304daf6334e1/src/forms/GridfieldConfigBlockManager.php#L129-L139 |
222,633 | sheadawson/silverstripe-blocks | src/BlockManager.php | BlockManager.getAreas | public function getAreas($keyAsValue = true)
{
$areas = $this->config()->get('areas');
$areas = $keyAsValue ? ArrayLib::valuekey(array_keys($areas)) : $areas;
if (count($areas)) {
foreach ($areas as $k => $v) {
$areas[$k] = $keyAsValue ? FormField::name_to_label($k) : $v;
}
}
return $areas;
} | php | public function getAreas($keyAsValue = true)
{
$areas = $this->config()->get('areas');
$areas = $keyAsValue ? ArrayLib::valuekey(array_keys($areas)) : $areas;
if (count($areas)) {
foreach ($areas as $k => $v) {
$areas[$k] = $keyAsValue ? FormField::name_to_label($k) : $v;
}
}
return $areas;
} | [
"public",
"function",
"getAreas",
"(",
"$",
"keyAsValue",
"=",
"true",
")",
"{",
"$",
"areas",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"get",
"(",
"'areas'",
")",
";",
"$",
"areas",
"=",
"$",
"keyAsValue",
"?",
"ArrayLib",
"::",
"valuekey",... | Gets an array of all areas defined for blocks.
@param bool $keyAsValue
@return array $areas | [
"Gets",
"an",
"array",
"of",
"all",
"areas",
"defined",
"for",
"blocks",
"."
] | 07b00124ea617f95f436fb98b09d304daf6334e1 | https://github.com/sheadawson/silverstripe-blocks/blob/07b00124ea617f95f436fb98b09d304daf6334e1/src/BlockManager.php#L46-L58 |
222,634 | dmmlabo/dmm-php-sdk | src/Dmm/HttpClients/StreamHttpClient.php | StreamHttpClient.compileHeader | public function compileHeader(array $headers)
{
$header = [];
foreach ($headers as $k => $v) {
$header[] = $k . ': ' . $v;
}
return implode("\r\n", $header);
} | php | public function compileHeader(array $headers)
{
$header = [];
foreach ($headers as $k => $v) {
$header[] = $k . ': ' . $v;
}
return implode("\r\n", $header);
} | [
"public",
"function",
"compileHeader",
"(",
"array",
"$",
"headers",
")",
"{",
"$",
"header",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"header",
"[",
"]",
"=",
"$",
"k",
".",
"': '",
"."... | Formats the headers for use in the stream wrapper.
@param array $headers The request headers.
@return string | [
"Formats",
"the",
"headers",
"for",
"use",
"in",
"the",
"stream",
"wrapper",
"."
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/HttpClients/StreamHttpClient.php#L65-L73 |
222,635 | fedemotta/yii2-cronjob | models/CronJob.php | CronJob.execution_time | private static function execution_time(){
if (self::$execution_time === 0){
self::$execution_time = -microtime(true);
}else{
self::$execution_time += microtime(true);
}
return self::$execution_time;
} | php | private static function execution_time(){
if (self::$execution_time === 0){
self::$execution_time = -microtime(true);
}else{
self::$execution_time += microtime(true);
}
return self::$execution_time;
} | [
"private",
"static",
"function",
"execution_time",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"execution_time",
"===",
"0",
")",
"{",
"self",
"::",
"$",
"execution_time",
"=",
"-",
"microtime",
"(",
"true",
")",
";",
"}",
"else",
"{",
"self",
"::",
... | Get and set execution time
@return int The execution time | [
"Get",
"and",
"set",
"execution",
"time"
] | 01f99a808f7ff0ad7faa52711b0b49ed1a0e9992 | https://github.com/fedemotta/yii2-cronjob/blob/01f99a808f7ff0ad7faa52711b0b49ed1a0e9992/models/CronJob.php#L39-L46 |
222,636 | fedemotta/yii2-cronjob | models/CronJob.php | CronJob.initDatesInRange | public static function initDatesInRange($start_date, $end_date, $daysDifference = 1){
$dates_in_range = [];
$begin = new DateTime($start_date);
$end = new DateTime($end_date);
$endModify = $end->modify( '+'.$daysDifference.' day' );
$interval = new DateInterval('P'.$daysDiffere... | php | public static function initDatesInRange($start_date, $end_date, $daysDifference = 1){
$dates_in_range = [];
$begin = new DateTime($start_date);
$end = new DateTime($end_date);
$endModify = $end->modify( '+'.$daysDifference.' day' );
$interval = new DateInterval('P'.$daysDiffere... | [
"public",
"static",
"function",
"initDatesInRange",
"(",
"$",
"start_date",
",",
"$",
"end_date",
",",
"$",
"daysDifference",
"=",
"1",
")",
"{",
"$",
"dates_in_range",
"=",
"[",
"]",
";",
"$",
"begin",
"=",
"new",
"DateTime",
"(",
"$",
"start_date",
")"... | Generate dates in range
@param type $start_date
@param type $end_date
@param type $daysDifference
@return array of dates | [
"Generate",
"dates",
"in",
"range"
] | 01f99a808f7ff0ad7faa52711b0b49ed1a0e9992 | https://github.com/fedemotta/yii2-cronjob/blob/01f99a808f7ff0ad7faa52711b0b49ed1a0e9992/models/CronJob.php#L55-L68 |
222,637 | fedemotta/yii2-cronjob | models/CronJob.php | CronJob.initDatetimesInRange | public static function initDatetimesInRange($start_datetime, $end_datetime, $hoursDifference = 1){
$dates_in_range = [];
$begin = new DateTime($start_datetime);
$end = new DateTime($end_datetime);
$endModify = $end->modify( '+'.$hoursDifference.' hour' );
$interval = new DateIn... | php | public static function initDatetimesInRange($start_datetime, $end_datetime, $hoursDifference = 1){
$dates_in_range = [];
$begin = new DateTime($start_datetime);
$end = new DateTime($end_datetime);
$endModify = $end->modify( '+'.$hoursDifference.' hour' );
$interval = new DateIn... | [
"public",
"static",
"function",
"initDatetimesInRange",
"(",
"$",
"start_datetime",
",",
"$",
"end_datetime",
",",
"$",
"hoursDifference",
"=",
"1",
")",
"{",
"$",
"dates_in_range",
"=",
"[",
"]",
";",
"$",
"begin",
"=",
"new",
"DateTime",
"(",
"$",
"start... | Generate datetimes in range
@param type $start_datetime
@param type $end_datetime
@param type $hoursDifference
@return array of datetimes | [
"Generate",
"datetimes",
"in",
"range"
] | 01f99a808f7ff0ad7faa52711b0b49ed1a0e9992 | https://github.com/fedemotta/yii2-cronjob/blob/01f99a808f7ff0ad7faa52711b0b49ed1a0e9992/models/CronJob.php#L89-L102 |
222,638 | fedemotta/yii2-cronjob | models/CronJob.php | CronJob.get_cron | public static function get_cron($controller,$action){
$cron = self::find()->where(['controller'=>$controller,'action'=>$action, 'success' => 0])->orderBy('id_cron_job DESC')->one();
if (is_null($cron)){
$cron = new CronJob();
$cron->controller = $controller;
$cron->ac... | php | public static function get_cron($controller,$action){
$cron = self::find()->where(['controller'=>$controller,'action'=>$action, 'success' => 0])->orderBy('id_cron_job DESC')->one();
if (is_null($cron)){
$cron = new CronJob();
$cron->controller = $controller;
$cron->ac... | [
"public",
"static",
"function",
"get_cron",
"(",
"$",
"controller",
",",
"$",
"action",
")",
"{",
"$",
"cron",
"=",
"self",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"[",
"'controller'",
"=>",
"$",
"controller",
",",
"'action'",
"=>",
"$",
"action",
... | Get a cron or generates a new one
@param type $controller
@param type $action
@return CronJob The cronjob | [
"Get",
"a",
"cron",
"or",
"generates",
"a",
"new",
"one"
] | 01f99a808f7ff0ad7faa52711b0b49ed1a0e9992 | https://github.com/fedemotta/yii2-cronjob/blob/01f99a808f7ff0ad7faa52711b0b49ed1a0e9992/models/CronJob.php#L131-L139 |
222,639 | fedemotta/yii2-cronjob | models/CronJob.php | CronJob.get_previous_cron | public static function get_previous_cron($controller,$action){
return self::find()->where(['controller'=>$controller,'action'=>$action, 'success' => 1])->orderBy('id_cron_job DESC')->one();
} | php | public static function get_previous_cron($controller,$action){
return self::find()->where(['controller'=>$controller,'action'=>$action, 'success' => 1])->orderBy('id_cron_job DESC')->one();
} | [
"public",
"static",
"function",
"get_previous_cron",
"(",
"$",
"controller",
",",
"$",
"action",
")",
"{",
"return",
"self",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"[",
"'controller'",
"=>",
"$",
"controller",
",",
"'action'",
"=>",
"$",
"action",
"... | Get previous successful ran cron
@param type $controller
@param type $action
@return CronJob The cron job | [
"Get",
"previous",
"successful",
"ran",
"cron"
] | 01f99a808f7ff0ad7faa52711b0b49ed1a0e9992 | https://github.com/fedemotta/yii2-cronjob/blob/01f99a808f7ff0ad7faa52711b0b49ed1a0e9992/models/CronJob.php#L146-L148 |
222,640 | fedemotta/yii2-cronjob | models/CronJob.php | CronJob.run | public static function run($controller, $action, $limit, $max){
$current = self::get_cron($controller, $action);
$current::execution_time();
$current->limit = $limit;
$current->running = 1;
$current->success = 0;
//get previous cron to set offset
... | php | public static function run($controller, $action, $limit, $max){
$current = self::get_cron($controller, $action);
$current::execution_time();
$current->limit = $limit;
$current->running = 1;
$current->success = 0;
//get previous cron to set offset
... | [
"public",
"static",
"function",
"run",
"(",
"$",
"controller",
",",
"$",
"action",
",",
"$",
"limit",
",",
"$",
"max",
")",
"{",
"$",
"current",
"=",
"self",
"::",
"get_cron",
"(",
"$",
"controller",
",",
"$",
"action",
")",
";",
"$",
"current",
":... | Starts a cron job
@param type $controller
@param type $action
@param type $limit
@param type $max
@return boolean Success | [
"Starts",
"a",
"cron",
"job"
] | 01f99a808f7ff0ad7faa52711b0b49ed1a0e9992 | https://github.com/fedemotta/yii2-cronjob/blob/01f99a808f7ff0ad7faa52711b0b49ed1a0e9992/models/CronJob.php#L158-L185 |
222,641 | fedemotta/yii2-cronjob | models/CronJob.php | CronJob.finish | public function finish(){
$this->running = 0;
$this->success = 1;
$this->last_execution_time = self::execution_time();
if ($this->save()){
Console::stdout(Console::ansiFormat("*** finished ".$this->controller."/".$this->action." (time: " . sprintf("%.3f", $this->last... | php | public function finish(){
$this->running = 0;
$this->success = 1;
$this->last_execution_time = self::execution_time();
if ($this->save()){
Console::stdout(Console::ansiFormat("*** finished ".$this->controller."/".$this->action." (time: " . sprintf("%.3f", $this->last... | [
"public",
"function",
"finish",
"(",
")",
"{",
"$",
"this",
"->",
"running",
"=",
"0",
";",
"$",
"this",
"->",
"success",
"=",
"1",
";",
"$",
"this",
"->",
"last_execution_time",
"=",
"self",
"::",
"execution_time",
"(",
")",
";",
"if",
"(",
"$",
"... | Ends a cron job
@return boolean Success | [
"Ends",
"a",
"cron",
"job"
] | 01f99a808f7ff0ad7faa52711b0b49ed1a0e9992 | https://github.com/fedemotta/yii2-cronjob/blob/01f99a808f7ff0ad7faa52711b0b49ed1a0e9992/models/CronJob.php#L190-L202 |
222,642 | dmmlabo/dmm-php-sdk | src/Dmm/Http/RawResponse.php | RawResponse.setHeadersFromString | protected function setHeadersFromString($rawHeaders)
{
// Normalize line breaks
$rawHeaders = str_replace("\r\n", "\n", $rawHeaders);
// There will be multiple headers if a 301 was followed
// or a proxy was followed, etc
$headerCollection = explode("\n\n", trim($rawHeaders)... | php | protected function setHeadersFromString($rawHeaders)
{
// Normalize line breaks
$rawHeaders = str_replace("\r\n", "\n", $rawHeaders);
// There will be multiple headers if a 301 was followed
// or a proxy was followed, etc
$headerCollection = explode("\n\n", trim($rawHeaders)... | [
"protected",
"function",
"setHeadersFromString",
"(",
"$",
"rawHeaders",
")",
"{",
"// Normalize line breaks",
"$",
"rawHeaders",
"=",
"str_replace",
"(",
"\"\\r\\n\"",
",",
"\"\\n\"",
",",
"$",
"rawHeaders",
")",
";",
"// There will be multiple headers if a 301 was follo... | Parse the raw headers and set as an array.
@param string $rawHeaders The raw headers from the response. | [
"Parse",
"the",
"raw",
"headers",
"and",
"set",
"as",
"an",
"array",
"."
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/Http/RawResponse.php#L94-L114 |
222,643 | Telerivet/telerivet-php-client | lib/entity.php | Telerivet_Entity.save | function save()
{
$dirty_props = $this->_dirty;
if ($this->_vars)
{
$dirty_vars = $this->_vars->getDirtyVariables();
if ($dirty_vars)
{
$dirty_props['vars'] = $dirty_vars;
}
}
$this->_api->doRequest... | php | function save()
{
$dirty_props = $this->_dirty;
if ($this->_vars)
{
$dirty_vars = $this->_vars->getDirtyVariables();
if ($dirty_vars)
{
$dirty_props['vars'] = $dirty_vars;
}
}
$this->_api->doRequest... | [
"function",
"save",
"(",
")",
"{",
"$",
"dirty_props",
"=",
"$",
"this",
"->",
"_dirty",
";",
"if",
"(",
"$",
"this",
"->",
"_vars",
")",
"{",
"$",
"dirty_vars",
"=",
"$",
"this",
"->",
"_vars",
"->",
"getDirtyVariables",
"(",
")",
";",
"if",
"(",
... | Saves any updated properties to Telerivet. | [
"Saves",
"any",
"updated",
"properties",
"to",
"Telerivet",
"."
] | c0b04a5974b25e13047c3e86bd16530fd5feec04 | https://github.com/Telerivet/telerivet-php-client/blob/c0b04a5974b25e13047c3e86bd16530fd5feec04/lib/entity.php#L84-L104 |
222,644 | zackslash/PHP-Web-Article-Extractor | src/Mergers/CloseBlockMerger.php | CloseBlockMerger.merge | public static function merge(&$article)
{
if(sizeof($article->textBlocks) < 2)
{
return;
}
$previousBlock = null;
foreach ($article->textBlocks as $key => $textBlock)
{
if(!isset($previousBlock))
{
$previousBlock = $textBlock;
continue;
}
if(!$textBlock->is... | php | public static function merge(&$article)
{
if(sizeof($article->textBlocks) < 2)
{
return;
}
$previousBlock = null;
foreach ($article->textBlocks as $key => $textBlock)
{
if(!isset($previousBlock))
{
$previousBlock = $textBlock;
continue;
}
if(!$textBlock->is... | [
"public",
"static",
"function",
"merge",
"(",
"&",
"$",
"article",
")",
"{",
"if",
"(",
"sizeof",
"(",
"$",
"article",
"->",
"textBlocks",
")",
"<",
"2",
")",
"{",
"return",
";",
"}",
"$",
"previousBlock",
"=",
"null",
";",
"foreach",
"(",
"$",
"ar... | Executes this merger
@param article $article reference directly to the article object to merge | [
"Executes",
"this",
"merger"
] | f93d25d588dc0f8ddc4572429288edddb69386f6 | https://github.com/zackslash/PHP-Web-Article-Extractor/blob/f93d25d588dc0f8ddc4572429288edddb69386f6/src/Mergers/CloseBlockMerger.php#L27-L75 |
222,645 | joomla-framework/form | src/Form.php | Form.getFieldset | public function getFieldset($set = null)
{
$fields = array();
// Get all of the field elements in the fieldset.
if ($set)
{
$elements = $this->findFieldsByFieldset($set);
}
else
// Get all fields.
{
$elements = $this->findFieldsByGroup();
}
// If no field elements were found return empty.
... | php | public function getFieldset($set = null)
{
$fields = array();
// Get all of the field elements in the fieldset.
if ($set)
{
$elements = $this->findFieldsByFieldset($set);
}
else
// Get all fields.
{
$elements = $this->findFieldsByGroup();
}
// If no field elements were found return empty.
... | [
"public",
"function",
"getFieldset",
"(",
"$",
"set",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"// Get all of the field elements in the fieldset.",
"if",
"(",
"$",
"set",
")",
"{",
"$",
"elements",
"=",
"$",
"this",
"->",
"findFie... | Method to get an array of Field objects in a given fieldset by name. If no name is given then all fields are returned.
@param string $set The optional name of the fieldset.
@return Field[] An array of Field objects in the fieldset.
@since 1.0 | [
"Method",
"to",
"get",
"an",
"array",
"of",
"Field",
"objects",
"in",
"a",
"given",
"fieldset",
"by",
"name",
".",
"If",
"no",
"name",
"is",
"given",
"then",
"all",
"fields",
"are",
"returned",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Form.php#L341-L379 |
222,646 | joomla-framework/form | src/Form.php | Form.setField | public function setField(\SimpleXMLElement $element, $group = null, $replace = true)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
throw new \UnexpectedValueException(sprintf('%s::setField `xml` is not an instance of SimpleXMLElement', get_class($this)));... | php | public function setField(\SimpleXMLElement $element, $group = null, $replace = true)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
throw new \UnexpectedValueException(sprintf('%s::setField `xml` is not an instance of SimpleXMLElement', get_class($this)));... | [
"public",
"function",
"setField",
"(",
"\\",
"SimpleXMLElement",
"$",
"element",
",",
"$",
"group",
"=",
"null",
",",
"$",
"replace",
"=",
"true",
")",
"{",
"// Make sure there is a valid Form XML document.",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"xml",
"i... | Method to set a field XML element to the form definition. If the replace flag is set then
the field will be set whether it already exists or not. If it isn't set, then the field
will not be replaced if it already exists.
@param \SimpleXMLElement $element The XML element object representation of the form field.
@... | [
"Method",
"to",
"set",
"a",
"field",
"XML",
"element",
"to",
"the",
"form",
"definition",
".",
"If",
"the",
"replace",
"flag",
"is",
"set",
"then",
"the",
"field",
"will",
"be",
"set",
"whether",
"it",
"already",
"exists",
"or",
"not",
".",
"If",
"it",... | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Form.php#L933-L979 |
222,647 | joomla-framework/form | src/Form.php | Form.setFieldAttribute | public function setFieldAttribute($name, $attribute, $value, $group = null)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
throw new \UnexpectedValueException(sprintf('%s::setFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));... | php | public function setFieldAttribute($name, $attribute, $value, $group = null)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
throw new \UnexpectedValueException(sprintf('%s::setFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));... | [
"public",
"function",
"setFieldAttribute",
"(",
"$",
"name",
",",
"$",
"attribute",
",",
"$",
"value",
",",
"$",
"group",
"=",
"null",
")",
"{",
"// Make sure there is a valid Form XML document.",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"xml",
"instanceof",
... | Method to set an attribute value for a field XML element.
@param string $name The name of the form field for which to set the attribute value.
@param string $attribute The name of the attribute for which to set a value.
@param mixed $value The value to set for the attribute.
@param string $gro... | [
"Method",
"to",
"set",
"an",
"attribute",
"value",
"for",
"a",
"field",
"XML",
"element",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Form.php#L994-L1020 |
222,648 | joomla-framework/form | src/Form.php | Form.validate | public function validate($data, $group = null)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return false;
}
$return = true;
// Create an input registry object from the data to validate.
$input = new Registry($data);
// Get the fields for whi... | php | public function validate($data, $group = null)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return false;
}
$return = true;
// Create an input registry object from the data to validate.
$input = new Registry($data);
// Get the fields for whi... | [
"public",
"function",
"validate",
"(",
"$",
"data",
",",
"$",
"group",
"=",
"null",
")",
"{",
"// Make sure there is a valid Form XML document.",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"xml",
"instanceof",
"\\",
"SimpleXMLElement",
")",
")",
"{",
"return",
... | Method to validate form data.
Validation warnings will be pushed into Form::errors and should be
retrieved with Form::getErrors() when validate returns boolean false.
@param array $data An array of field values to validate.
@param string $group The optional dot-separated form group path on which to filter t... | [
"Method",
"to",
"validate",
"form",
"data",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Form.php#L1134-L1194 |
222,649 | joomla-framework/form | src/Form.php | Form.findField | protected function findField($name, $group = null)
{
$element = false;
$fields = array();
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return false;
}
// Let's get the appropriate field element based on the method arguments.
if ($group)
{
... | php | protected function findField($name, $group = null)
{
$element = false;
$fields = array();
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return false;
}
// Let's get the appropriate field element based on the method arguments.
if ($group)
{
... | [
"protected",
"function",
"findField",
"(",
"$",
"name",
",",
"$",
"group",
"=",
"null",
")",
"{",
"$",
"element",
"=",
"false",
";",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"// Make sure there is a valid Form XML document.",
"if",
"(",
"!",
"(",
"$",
... | Method to get a form field represented as an XML element object.
@param string $name The name of the form field.
@param string $group The optional dot-separated form group path on which to find the field.
@return \SimpleXMLElement|boolean Boolean false on error or a SimpleXMLElement object.
@since 1.0 | [
"Method",
"to",
"get",
"a",
"form",
"field",
"represented",
"as",
"an",
"XML",
"element",
"object",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Form.php#L1410-L1491 |
222,650 | joomla-framework/form | src/Form.php | Form.& | protected function &findGroup($group)
{
$false = false;
$groups = array();
$tmp = array();
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return $false;
}
// Make sure there is actually a group to find.
$group = explode('.', $group);
if (!em... | php | protected function &findGroup($group)
{
$false = false;
$groups = array();
$tmp = array();
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return $false;
}
// Make sure there is actually a group to find.
$group = explode('.', $group);
if (!em... | [
"protected",
"function",
"&",
"findGroup",
"(",
"$",
"group",
")",
"{",
"$",
"false",
"=",
"false",
";",
"$",
"groups",
"=",
"array",
"(",
")",
";",
"$",
"tmp",
"=",
"array",
"(",
")",
";",
"// Make sure there is a valid Form XML document.",
"if",
"(",
"... | Method to get a form field group represented as an XML element object.
@param string $group The dot-separated form group path on which to find the group.
@return \SimpleXMLElement[]|boolean Boolean false on error or array of SimpleXMLElement objects.
@since 1.0 | [
"Method",
"to",
"get",
"a",
"form",
"field",
"group",
"represented",
"as",
"an",
"XML",
"element",
"object",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Form.php#L1610-L1682 |
222,651 | sheadawson/silverstripe-blocks | src/extensions/BlocksSiteTreeExtension.php | BlocksSiteTreeExtension.showBlocksFields | public function showBlocksFields()
{
$whiteList = $this->blockManager->getWhiteListedPageTypes();
$blackList = $this->blockManager->getBlackListedPageTypes();
if (in_array($this->owner->ClassName, $blackList)) {
return false;
}
if (count($whiteList) && !in_array($this->owner->ClassName, $whiteList)) {
... | php | public function showBlocksFields()
{
$whiteList = $this->blockManager->getWhiteListedPageTypes();
$blackList = $this->blockManager->getBlackListedPageTypes();
if (in_array($this->owner->ClassName, $blackList)) {
return false;
}
if (count($whiteList) && !in_array($this->owner->ClassName, $whiteList)) {
... | [
"public",
"function",
"showBlocksFields",
"(",
")",
"{",
"$",
"whiteList",
"=",
"$",
"this",
"->",
"blockManager",
"->",
"getWhiteListedPageTypes",
"(",
")",
";",
"$",
"blackList",
"=",
"$",
"this",
"->",
"blockManager",
"->",
"getBlackListedPageTypes",
"(",
"... | Check if the Blocks CMSFields should be displayed for this Page
@return boolean | [
"Check",
"if",
"the",
"Blocks",
"CMSFields",
"should",
"be",
"displayed",
"for",
"this",
"Page"
] | 07b00124ea617f95f436fb98b09d304daf6334e1 | https://github.com/sheadawson/silverstripe-blocks/blob/07b00124ea617f95f436fb98b09d304daf6334e1/src/extensions/BlocksSiteTreeExtension.php#L62-L80 |
222,652 | sheadawson/silverstripe-blocks | src/extensions/BlocksSiteTreeExtension.php | BlocksSiteTreeExtension.updateCMSFields | public function updateCMSFields(FieldList $fields)
{
if ($fields->fieldByName('Root.Blocks') || !$this->showBlocksFields()) {
return;
}
$areas = $this->blockManager->getAreasForPageType($this->owner->ClassName);
if ($areas && count($areas)) {
$fields->addFieldToTab('Root', new Tab('Blocks', _t('Block.P... | php | public function updateCMSFields(FieldList $fields)
{
if ($fields->fieldByName('Root.Blocks') || !$this->showBlocksFields()) {
return;
}
$areas = $this->blockManager->getAreasForPageType($this->owner->ClassName);
if ($areas && count($areas)) {
$fields->addFieldToTab('Root', new Tab('Blocks', _t('Block.P... | [
"public",
"function",
"updateCMSFields",
"(",
"FieldList",
"$",
"fields",
")",
"{",
"if",
"(",
"$",
"fields",
"->",
"fieldByName",
"(",
"'Root.Blocks'",
")",
"||",
"!",
"$",
"this",
"->",
"showBlocksFields",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
... | Block manager for Pages. | [
"Block",
"manager",
"for",
"Pages",
"."
] | 07b00124ea617f95f436fb98b09d304daf6334e1 | https://github.com/sheadawson/silverstripe-blocks/blob/07b00124ea617f95f436fb98b09d304daf6334e1/src/extensions/BlocksSiteTreeExtension.php#L85-L149 |
222,653 | sheadawson/silverstripe-blocks | src/extensions/BlocksSiteTreeExtension.php | BlocksSiteTreeExtension.BlockArea | public function BlockArea($area, $limit = null)
{
if ($this->owner->ID <= 0) {
return;
} // blocks break on fake pages ie Security/login
$list = $this->getBlockList($area);
foreach ($list as $block) {
if (!$block->canView()) {
$list->remove($block);
}
}
if ($limit !== null) {
$list = $li... | php | public function BlockArea($area, $limit = null)
{
if ($this->owner->ID <= 0) {
return;
} // blocks break on fake pages ie Security/login
$list = $this->getBlockList($area);
foreach ($list as $block) {
if (!$block->canView()) {
$list->remove($block);
}
}
if ($limit !== null) {
$list = $li... | [
"public",
"function",
"BlockArea",
"(",
"$",
"area",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"ID",
"<=",
"0",
")",
"{",
"return",
";",
"}",
"// blocks break on fake pages ie Security/login",
"$",
"list",
"="... | Called from templates to get rendered blocks for the given area.
@param string $area
@param int $limit Limit the items to this number, or null for no limit | [
"Called",
"from",
"templates",
"to",
"get",
"rendered",
"blocks",
"for",
"the",
"given",
"area",
"."
] | 07b00124ea617f95f436fb98b09d304daf6334e1 | https://github.com/sheadawson/silverstripe-blocks/blob/07b00124ea617f95f436fb98b09d304daf6334e1/src/extensions/BlocksSiteTreeExtension.php#L157-L189 |
222,654 | sheadawson/silverstripe-blocks | src/extensions/BlocksSiteTreeExtension.php | BlocksSiteTreeExtension.getBlockList | public function getBlockList($area = null, $includeDisabled = false)
{
$includeSets = $this->blockManager->getUseBlockSets() && $this->owner->InheritBlockSets;
$blocks = ArrayList::create();
// get blocks directly linked to this page
$nativeBlocks = $this->owner->Blocks()->sort('Sort');
if ($area) {
$nat... | php | public function getBlockList($area = null, $includeDisabled = false)
{
$includeSets = $this->blockManager->getUseBlockSets() && $this->owner->InheritBlockSets;
$blocks = ArrayList::create();
// get blocks directly linked to this page
$nativeBlocks = $this->owner->Blocks()->sort('Sort');
if ($area) {
$nat... | [
"public",
"function",
"getBlockList",
"(",
"$",
"area",
"=",
"null",
",",
"$",
"includeDisabled",
"=",
"false",
")",
"{",
"$",
"includeSets",
"=",
"$",
"this",
"->",
"blockManager",
"->",
"getUseBlockSets",
"(",
")",
"&&",
"$",
"this",
"->",
"owner",
"->... | Get a merged list of all blocks on this page and ones inherited from BlockSets.
@param string|null $area filter by block area
@param bool $includeDisabled Include blocks that have been explicitly excluded from this page
i.e. blocks from block sets added to the "disable inherited blocks" list
@return... | [
"Get",
"a",
"merged",
"list",
"of",
"all",
"blocks",
"on",
"this",
"page",
"and",
"ones",
"inherited",
"from",
"BlockSets",
"."
] | 07b00124ea617f95f436fb98b09d304daf6334e1 | https://github.com/sheadawson/silverstripe-blocks/blob/07b00124ea617f95f436fb98b09d304daf6334e1/src/extensions/BlocksSiteTreeExtension.php#L217-L252 |
222,655 | sheadawson/silverstripe-blocks | src/extensions/BlocksSiteTreeExtension.php | BlocksSiteTreeExtension.getAppliedSets | public function getAppliedSets()
{
$list = ArrayList::create();
if (!$this->owner->InheritBlockSets) {
return $list;
}
$sets = BlockSet::get()->where("(PageTypesValue IS NULL) OR (PageTypesValue LIKE '%:\"{$this->owner->ClassName}%')");
$ancestors = $this->owner->getAncestors()->column('ID');
foreach ... | php | public function getAppliedSets()
{
$list = ArrayList::create();
if (!$this->owner->InheritBlockSets) {
return $list;
}
$sets = BlockSet::get()->where("(PageTypesValue IS NULL) OR (PageTypesValue LIKE '%:\"{$this->owner->ClassName}%')");
$ancestors = $this->owner->getAncestors()->column('ID');
foreach ... | [
"public",
"function",
"getAppliedSets",
"(",
")",
"{",
"$",
"list",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"owner",
"->",
"InheritBlockSets",
")",
"{",
"return",
"$",
"list",
";",
"}",
"$",
"sets",
"=",
... | Get Any BlockSets that apply to this page.
@return ArrayList | [
"Get",
"Any",
"BlockSets",
"that",
"apply",
"to",
"this",
"page",
"."
] | 07b00124ea617f95f436fb98b09d304daf6334e1 | https://github.com/sheadawson/silverstripe-blocks/blob/07b00124ea617f95f436fb98b09d304daf6334e1/src/extensions/BlocksSiteTreeExtension.php#L259-L293 |
222,656 | sheadawson/silverstripe-blocks | src/extensions/BlocksSiteTreeExtension.php | BlocksSiteTreeExtension.getBlocksFromAppliedBlockSets | public function getBlocksFromAppliedBlockSets($area = null, $includeDisabled = false)
{
$blocks = ArrayList::create();
$sets = $this->getAppliedSets();
if (!$sets->count()) {
return $blocks;
}
foreach ($sets as $set) {
$setBlocks = $set->Blocks()->sort('Sort DESC');
if (!$includeDisabled) {
$... | php | public function getBlocksFromAppliedBlockSets($area = null, $includeDisabled = false)
{
$blocks = ArrayList::create();
$sets = $this->getAppliedSets();
if (!$sets->count()) {
return $blocks;
}
foreach ($sets as $set) {
$setBlocks = $set->Blocks()->sort('Sort DESC');
if (!$includeDisabled) {
$... | [
"public",
"function",
"getBlocksFromAppliedBlockSets",
"(",
"$",
"area",
"=",
"null",
",",
"$",
"includeDisabled",
"=",
"false",
")",
"{",
"$",
"blocks",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"$",
"sets",
"=",
"$",
"this",
"->",
"getAppliedSets"... | Get all Blocks from BlockSets that apply to this page.
@return ArrayList | [
"Get",
"all",
"Blocks",
"from",
"BlockSets",
"that",
"apply",
"to",
"this",
"page",
"."
] | 07b00124ea617f95f436fb98b09d304daf6334e1 | https://github.com/sheadawson/silverstripe-blocks/blob/07b00124ea617f95f436fb98b09d304daf6334e1/src/extensions/BlocksSiteTreeExtension.php#L300-L326 |
222,657 | dmmlabo/dmm-php-sdk | src/Dmm/Dmm.php | Dmm.request | public function request($method, $endpoint, array $params = [])
{
return new DmmRequest(
$this->credential,
$method,
$endpoint,
$params
);
} | php | public function request($method, $endpoint, array $params = [])
{
return new DmmRequest(
$this->credential,
$method,
$endpoint,
$params
);
} | [
"public",
"function",
"request",
"(",
"$",
"method",
",",
"$",
"endpoint",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"new",
"DmmRequest",
"(",
"$",
"this",
"->",
"credential",
",",
"$",
"method",
",",
"$",
"endpoint",
",",
"$",
... | Instantiates a new DmmRequest entity.
@param string $method
@param string $endpoint
@param array $params
@return DmmRequest
@throws DmmSDKException | [
"Instantiates",
"a",
"new",
"DmmRequest",
"entity",
"."
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/Dmm.php#L151-L159 |
222,658 | dmmlabo/dmm-php-sdk | src/Dmm/Dmm.php | Dmm.api | public function api($name)
{
switch ($name) {
case 'actress':
$api = new Apis\Actress($this->client, $this->credential);
break;
case 'author':
$api = new Apis\Author($this->client, $this->credential);
break;
... | php | public function api($name)
{
switch ($name) {
case 'actress':
$api = new Apis\Actress($this->client, $this->credential);
break;
case 'author':
$api = new Apis\Author($this->client, $this->credential);
break;
... | [
"public",
"function",
"api",
"(",
"$",
"name",
")",
"{",
"switch",
"(",
"$",
"name",
")",
"{",
"case",
"'actress'",
":",
"$",
"api",
"=",
"new",
"Apis",
"\\",
"Actress",
"(",
"$",
"this",
"->",
"client",
",",
"$",
"this",
"->",
"credential",
")",
... | Get API interface
@param string $name
@return ApiInterface
@throws InvalidArgumentException | [
"Get",
"API",
"interface"
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/Dmm.php#L170-L199 |
222,659 | enygma/yubikey | src/Yubikey/Response.php | Response.parse | public function parse($data)
{
$result = array();
$parts = explode("\n", $data);
foreach($parts as $index => $part) {
$kv = explode("=", $part);
if (!empty($kv[1])) {
$result[$kv[0]] = $kv[1];
}
}
$this->load($result);
... | php | public function parse($data)
{
$result = array();
$parts = explode("\n", $data);
foreach($parts as $index => $part) {
$kv = explode("=", $part);
if (!empty($kv[1])) {
$result[$kv[0]] = $kv[1];
}
}
$this->load($result);
... | [
"public",
"function",
"parse",
"(",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"data",
")",
";",
"foreach",
"(",
"$",
"parts",
"as",
"$",
"index",
"=>",
"$",
"part",
... | Parse the return data from the request and
load it into the object properties
@param string $data API return data | [
"Parse",
"the",
"return",
"data",
"from",
"the",
"request",
"and",
"load",
"it",
"into",
"the",
"object",
"properties"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Response.php#L133-L146 |
222,660 | enygma/yubikey | src/Yubikey/Response.php | Response.getHash | public function getHash($encode = false)
{
$hash = $this->h;
if (substr($hash, -1) !== '=') {
$hash .= '=';
}
if ($encode === true) {
$hash = str_replace('+', '%2B', $hash);
}
return $hash;
} | php | public function getHash($encode = false)
{
$hash = $this->h;
if (substr($hash, -1) !== '=') {
$hash .= '=';
}
if ($encode === true) {
$hash = str_replace('+', '%2B', $hash);
}
return $hash;
} | [
"public",
"function",
"getHash",
"(",
"$",
"encode",
"=",
"false",
")",
"{",
"$",
"hash",
"=",
"$",
"this",
"->",
"h",
";",
"if",
"(",
"substr",
"(",
"$",
"hash",
",",
"-",
"1",
")",
"!==",
"'='",
")",
"{",
"$",
"hash",
".=",
"'='",
";",
"}",... | Get the hash from the response
@param boolean $encode "Encode" the data (replace + with %2B)
@return string Hash value | [
"Get",
"the",
"hash",
"from",
"the",
"response"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Response.php#L231-L241 |
222,661 | joomla-framework/form | src/Field.php | Field.__isset | public function __isset($name)
{
// These properties aren't directly accessible, so always return true
if ($name == 'input' || $name == 'label')
{
return true;
}
// Check if a property has an assigned value
if ($this->$name !== null)
{
return true;
}
return false;
} | php | public function __isset($name)
{
// These properties aren't directly accessible, so always return true
if ($name == 'input' || $name == 'label')
{
return true;
}
// Check if a property has an assigned value
if ($this->$name !== null)
{
return true;
}
return false;
} | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"// These properties aren't directly accessible, so always return true",
"if",
"(",
"$",
"name",
"==",
"'input'",
"||",
"$",
"name",
"==",
"'label'",
")",
"{",
"return",
"true",
";",
"}",
"// Check if a ... | Method to checks whether the value of certain inaccessible properties has been set or is it null.
@param string $name The property name.
@return boolean True if the value is set, false otherwise.
@since __DEPLOY_VERSION__ | [
"Method",
"to",
"checks",
"whether",
"the",
"value",
"of",
"certain",
"inaccessible",
"properties",
"has",
"been",
"set",
"or",
"is",
"it",
"null",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Field.php#L333-L348 |
222,662 | dmmlabo/dmm-php-sdk | src/Dmm/HttpClients/DmmStream.php | DmmStream.fileGetContents | public function fileGetContents($url)
{
$rawResponse = file_get_contents($url, false, $this->stream);
$this->responseHeaders = $http_response_header ?: [];
return $rawResponse;
} | php | public function fileGetContents($url)
{
$rawResponse = file_get_contents($url, false, $this->stream);
$this->responseHeaders = $http_response_header ?: [];
return $rawResponse;
} | [
"public",
"function",
"fileGetContents",
"(",
"$",
"url",
")",
"{",
"$",
"rawResponse",
"=",
"file_get_contents",
"(",
"$",
"url",
",",
"false",
",",
"$",
"this",
"->",
"stream",
")",
";",
"$",
"this",
"->",
"responseHeaders",
"=",
"$",
"http_response_head... | Send a stream wrapped request
@param string $url
@return mixed | [
"Send",
"a",
"stream",
"wrapped",
"request"
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/HttpClients/DmmStream.php#L51-L57 |
222,663 | dmmlabo/dmm-php-sdk | src/Dmm/Url/DmmUrlManipulator.php | DmmUrlManipulator.removeParamsFromUrl | public static function removeParamsFromUrl($url, array $paramsToFilter)
{
$parts = parse_url($url);
$query = '';
if (isset($parts['query'])) {
$params = [];
parse_str($parts['query'], $params);
// Remove query params
foreach ($paramsToFilter ... | php | public static function removeParamsFromUrl($url, array $paramsToFilter)
{
$parts = parse_url($url);
$query = '';
if (isset($parts['query'])) {
$params = [];
parse_str($parts['query'], $params);
// Remove query params
foreach ($paramsToFilter ... | [
"public",
"static",
"function",
"removeParamsFromUrl",
"(",
"$",
"url",
",",
"array",
"$",
"paramsToFilter",
")",
"{",
"$",
"parts",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"$",
"query",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"parts",
"["... | Remove params from a URL.
@param string $url The URL to filter.
@param array $paramsToFilter The params to filter from the URL.
@return string The URL with the params removed. | [
"Remove",
"params",
"from",
"a",
"URL",
"."
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/Url/DmmUrlManipulator.php#L19-L45 |
222,664 | dmmlabo/dmm-php-sdk | src/Dmm/Url/DmmUrlManipulator.php | DmmUrlManipulator.getParamsAsArray | public static function getParamsAsArray($url)
{
$query = parse_url($url, PHP_URL_QUERY);
if (!$query) {
return [];
}
$params = [];
parse_str($query, $params);
return $params;
} | php | public static function getParamsAsArray($url)
{
$query = parse_url($url, PHP_URL_QUERY);
if (!$query) {
return [];
}
$params = [];
parse_str($query, $params);
return $params;
} | [
"public",
"static",
"function",
"getParamsAsArray",
"(",
"$",
"url",
")",
"{",
"$",
"query",
"=",
"parse_url",
"(",
"$",
"url",
",",
"PHP_URL_QUERY",
")",
";",
"if",
"(",
"!",
"$",
"query",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"params",
"="... | Returns the params from a URL in the form of an array.
@param string $url The URL to parse the params from.
@return array | [
"Returns",
"the",
"params",
"from",
"a",
"URL",
"in",
"the",
"form",
"of",
"an",
"array",
"."
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/Url/DmmUrlManipulator.php#L85-L95 |
222,665 | enygma/yubikey | src/Yubikey/Client.php | Client.request | public function request(\Yubikey\RequestCollection $requests)
{
$responses = new \Yubikey\ResponseCollection();
$startTime = microtime(true);
$multi = curl_multi_init();
$curls = array();
foreach ($requests as $index => $request) {
$curls[$index] = curl_init();
... | php | public function request(\Yubikey\RequestCollection $requests)
{
$responses = new \Yubikey\ResponseCollection();
$startTime = microtime(true);
$multi = curl_multi_init();
$curls = array();
foreach ($requests as $index => $request) {
$curls[$index] = curl_init();
... | [
"public",
"function",
"request",
"(",
"\\",
"Yubikey",
"\\",
"RequestCollection",
"$",
"requests",
")",
"{",
"$",
"responses",
"=",
"new",
"\\",
"Yubikey",
"\\",
"ResponseCollection",
"(",
")",
";",
"$",
"startTime",
"=",
"microtime",
"(",
"true",
")",
";"... | Make the request given the Request set and content
@param \Yubikey\RequestCollection $requests Request collection
@return \Yubikey\ResponseCollection instance | [
"Make",
"the",
"request",
"given",
"the",
"Request",
"set",
"and",
"content"
] | d8487c4c28ee6ae75d10077c97795e8b64fa8ff4 | https://github.com/enygma/yubikey/blob/d8487c4c28ee6ae75d10077c97795e8b64fa8ff4/src/Yubikey/Client.php#L28-L64 |
222,666 | joomla-framework/form | src/Field/CheckboxesField.php | CheckboxesField.getInput | protected function getInput()
{
$html = array();
// Initialize some field attributes.
$class = $this->element['class'] ? ' class="checkboxes ' . (string) $this->element['class'] . '"' : ' class="checkboxes"';
$checkedOptions = explode(',', (string) $this->element['checked']);
// Start the checkbox field ou... | php | protected function getInput()
{
$html = array();
// Initialize some field attributes.
$class = $this->element['class'] ? ' class="checkboxes ' . (string) $this->element['class'] . '"' : ' class="checkboxes"';
$checkedOptions = explode(',', (string) $this->element['checked']);
// Start the checkbox field ou... | [
"protected",
"function",
"getInput",
"(",
")",
"{",
"$",
"html",
"=",
"array",
"(",
")",
";",
"// Initialize some field attributes.",
"$",
"class",
"=",
"$",
"this",
"->",
"element",
"[",
"'class'",
"]",
"?",
"' class=\"checkboxes '",
".",
"(",
"string",
")"... | Method to get the field input markup for check boxes.
@return string The field input markup.
@since 1.0 | [
"Method",
"to",
"get",
"the",
"field",
"input",
"markup",
"for",
"check",
"boxes",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Field/CheckboxesField.php#L45-L96 |
222,667 | joomla-framework/form | src/Field/PasswordField.php | PasswordField.getInput | protected function getInput()
{
// Initialize some field attributes.
$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
$class = $this->element['class'] ? ' class="' . ... | php | protected function getInput()
{
// Initialize some field attributes.
$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
$class = $this->element['class'] ? ' class="' . ... | [
"protected",
"function",
"getInput",
"(",
")",
"{",
"// Initialize some field attributes.",
"$",
"size",
"=",
"$",
"this",
"->",
"element",
"[",
"'size'",
"]",
"?",
"' size=\"'",
".",
"(",
"int",
")",
"$",
"this",
"->",
"element",
"[",
"'size'",
"]",
".",
... | Method to get the field input markup for password.
@return string The field input markup.
@since 1.0 | [
"Method",
"to",
"get",
"the",
"field",
"input",
"markup",
"for",
"password",
"."
] | 3bc5e3bc3c5c8ba5374623785483f7a677bfb012 | https://github.com/joomla-framework/form/blob/3bc5e3bc3c5c8ba5374623785483f7a677bfb012/src/Field/PasswordField.php#L38-L66 |
222,668 | dmmlabo/dmm-php-sdk | src/Dmm/Exceptions/DmmResponseException.php | DmmResponseException.create | public static function create(DmmResponse $response)
{
$data = $response->getDecodedBody();
$code = isset($data['status']) ? $data['status'] : null;
$message = isset($data['message']) ? $data['message'] : 'Unknown error from API.';
// All others
return new static($response,... | php | public static function create(DmmResponse $response)
{
$data = $response->getDecodedBody();
$code = isset($data['status']) ? $data['status'] : null;
$message = isset($data['message']) ? $data['message'] : 'Unknown error from API.';
// All others
return new static($response,... | [
"public",
"static",
"function",
"create",
"(",
"DmmResponse",
"$",
"response",
")",
"{",
"$",
"data",
"=",
"$",
"response",
"->",
"getDecodedBody",
"(",
")",
";",
"$",
"code",
"=",
"isset",
"(",
"$",
"data",
"[",
"'status'",
"]",
")",
"?",
"$",
"data... | A factory for creating the appropriate exception based on the response from API.
@param DmmResponse $response The response that threw the exception.
@return DmmResponseException | [
"A",
"factory",
"for",
"creating",
"the",
"appropriate",
"exception",
"based",
"on",
"the",
"response",
"from",
"API",
"."
] | 027fbe8fbf07178460e449ede116f9eae91061eb | https://github.com/dmmlabo/dmm-php-sdk/blob/027fbe8fbf07178460e449ede116f9eae91061eb/src/Dmm/Exceptions/DmmResponseException.php#L47-L56 |
222,669 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Config/Clone.php | EcomDev_Varnish_Model_Config_Clone.getPrefixes | public function getPrefixes()
{
$prefixes = array();
foreach (Mage::helper('ecomdev_varnish')->getAllowedPages() as $name => $label) {
$prefixes[] = array(
'field' => $name.'_',
'label' => $label
);
}
return $prefixes;
} | php | public function getPrefixes()
{
$prefixes = array();
foreach (Mage::helper('ecomdev_varnish')->getAllowedPages() as $name => $label) {
$prefixes[] = array(
'field' => $name.'_',
'label' => $label
);
}
return $prefixes;
} | [
"public",
"function",
"getPrefixes",
"(",
")",
"{",
"$",
"prefixes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"Mage",
"::",
"helper",
"(",
"'ecomdev_varnish'",
")",
"->",
"getAllowedPages",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"label",
")",
"{",... | Get field prefixes for generating translation config nodes
@return array | [
"Get",
"field",
"prefixes",
"for",
"generating",
"translation",
"config",
"nodes"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Config/Clone.php#L31-L42 |
222,670 | TerbiumLibs/dbConfig | src/Terbium/DbConfig/DbConfig.php | DbConfig.store | public function store($key, $value)
{
// save key => value into DB
$this->dbProvider->store($key, $value);
//set value to config
$this->origConfig->set($key, $value);
} | php | public function store($key, $value)
{
// save key => value into DB
$this->dbProvider->store($key, $value);
//set value to config
$this->origConfig->set($key, $value);
} | [
"public",
"function",
"store",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"// save key => value into DB",
"$",
"this",
"->",
"dbProvider",
"->",
"store",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"//set value to config",
"$",
"this",
"->",
"origConf... | Save item into database and set to current config
@param string $key
@param mixed $value
@return void
@throws Exceptions\SaveException | [
"Save",
"item",
"into",
"database",
"and",
"set",
"to",
"current",
"config"
] | c418de91cf13af8bce107e9da6226abc9a0167c6 | https://github.com/TerbiumLibs/dbConfig/blob/c418de91cf13af8bce107e9da6226abc9a0167c6/src/Terbium/DbConfig/DbConfig.php#L68-L78 |
222,671 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Catalogrule/Observer.php | EcomDev_Varnish_Model_Catalogrule_Observer.retrieveAppliedProducts | public function retrieveAppliedProducts(Varien_Event_Observer $observer)
{
$this->_productIds = $this->_getResource()->getAffectedProductIds(
$observer->getEvent()->getProductCondition()
);
} | php | public function retrieveAppliedProducts(Varien_Event_Observer $observer)
{
$this->_productIds = $this->_getResource()->getAffectedProductIds(
$observer->getEvent()->getProductCondition()
);
} | [
"public",
"function",
"retrieveAppliedProducts",
"(",
"Varien_Event_Observer",
"$",
"observer",
")",
"{",
"$",
"this",
"->",
"_productIds",
"=",
"$",
"this",
"->",
"_getResource",
"(",
")",
"->",
"getAffectedProductIds",
"(",
"$",
"observer",
"->",
"getEvent",
"... | Collects affected products by price rules
@param Varien_Event_Observer $observer | [
"Collects",
"affected",
"products",
"by",
"price",
"rules"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Catalogrule/Observer.php#L37-L42 |
222,672 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Catalogrule/Observer.php | EcomDev_Varnish_Model_Catalogrule_Observer.postApply | public function postApply(Varien_Event_Observer $observer)
{
$productIds = array();
foreach ($this->_productIds as $productId) {
$productIds[] = EcomDev_Varnish_Model_Processor_Product::TAG_PREFIX . $productId;
}
// Run cleaning process separately if amount of stored ta... | php | public function postApply(Varien_Event_Observer $observer)
{
$productIds = array();
foreach ($this->_productIds as $productId) {
$productIds[] = EcomDev_Varnish_Model_Processor_Product::TAG_PREFIX . $productId;
}
// Run cleaning process separately if amount of stored ta... | [
"public",
"function",
"postApply",
"(",
"Varien_Event_Observer",
"$",
"observer",
")",
"{",
"$",
"productIds",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_productIds",
"as",
"$",
"productId",
")",
"{",
"$",
"productIds",
"[",
"]",
"... | Clears cache after applying the price rules
@param Varien_Event_Observer $observer | [
"Clears",
"cache",
"after",
"applying",
"the",
"price",
"rules"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Catalogrule/Observer.php#L49-L67 |
222,673 | gordalina/easypay-php | src/Gordalina/Easypay/Payment/RecurringPayment.php | RecurringPayment.getAllowedPaymentFrequencies | protected function getAllowedPaymentFrequencies()
{
return array(
static::DAILY,
static::WEEKLY,
static::SEMIMONTHLY,
static::MONTHLY,
static::BIMONTHLY,
static::QUATERLY,
static::EVERY_4_MONTHS,
static::SEMIANNU... | php | protected function getAllowedPaymentFrequencies()
{
return array(
static::DAILY,
static::WEEKLY,
static::SEMIMONTHLY,
static::MONTHLY,
static::BIMONTHLY,
static::QUATERLY,
static::EVERY_4_MONTHS,
static::SEMIANNU... | [
"protected",
"function",
"getAllowedPaymentFrequencies",
"(",
")",
"{",
"return",
"array",
"(",
"static",
"::",
"DAILY",
",",
"static",
"::",
"WEEKLY",
",",
"static",
"::",
"SEMIMONTHLY",
",",
"static",
"::",
"MONTHLY",
",",
"static",
"::",
"BIMONTHLY",
",",
... | Returns an array of valid payment frequencies
@return array | [
"Returns",
"an",
"array",
"of",
"valid",
"payment",
"frequencies"
] | 23e8d462f33834233cad4e9fbe9fc57267c1e573 | https://github.com/gordalina/easypay-php/blob/23e8d462f33834233cad4e9fbe9fc57267c1e573/src/Gordalina/Easypay/Payment/RecurringPayment.php#L78-L91 |
222,674 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php | EcomDev_Varnish_Model_AbstractFacade.add | public function add($item)
{
foreach ($this->_requiredInterfaces as $interface) {
if (!$item instanceof $interface) {
throw new RuntimeException(
sprintf('Item "%s" should implement "%s" interface', get_class($item), $interface)
);
... | php | public function add($item)
{
foreach ($this->_requiredInterfaces as $interface) {
if (!$item instanceof $interface) {
throw new RuntimeException(
sprintf('Item "%s" should implement "%s" interface', get_class($item), $interface)
);
... | [
"public",
"function",
"add",
"(",
"$",
"item",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_requiredInterfaces",
"as",
"$",
"interface",
")",
"{",
"if",
"(",
"!",
"$",
"item",
"instanceof",
"$",
"interface",
")",
"{",
"throw",
"new",
"RuntimeException"... | Adds an item to facade
@param EcomDev_Varnish_Model_ApplicableInterface $item
@return $this
@throws RuntimeException | [
"Adds",
"an",
"item",
"to",
"facade"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php#L51-L63 |
222,675 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php | EcomDev_Varnish_Model_AbstractFacade.remove | public function remove($item)
{
$hash = spl_object_hash($item);
if (isset($this->_items[$hash])) {
unset($this->_items[$hash]);
}
return $this;
} | php | public function remove($item)
{
$hash = spl_object_hash($item);
if (isset($this->_items[$hash])) {
unset($this->_items[$hash]);
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"item",
")",
"{",
"$",
"hash",
"=",
"spl_object_hash",
"(",
"$",
"item",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_items",
"[",
"$",
"hash",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
... | Removes items from facade
@param EcomDev_Varnish_Model_ApplicableInterface $item
@return $this | [
"Removes",
"items",
"from",
"facade"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php#L71-L79 |
222,676 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php | EcomDev_Varnish_Model_AbstractFacade._initItems | protected function _initItems()
{
if (!$this->_itemsXmlPath) {
throw new RuntimeException('XML Path for facade items is not specified');
}
$config = Mage::getConfig()->getNode($this->_itemsXmlPath)->children();
foreach ($config as $class) {
$... | php | protected function _initItems()
{
if (!$this->_itemsXmlPath) {
throw new RuntimeException('XML Path for facade items is not specified');
}
$config = Mage::getConfig()->getNode($this->_itemsXmlPath)->children();
foreach ($config as $class) {
$... | [
"protected",
"function",
"_initItems",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_itemsXmlPath",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'XML Path for facade items is not specified'",
")",
";",
"}",
"$",
"config",
"=",
"Mage",
"::",
"getCo... | Initializes default facade items
@return $this
@throws RuntimeException | [
"Initializes",
"default",
"facade",
"items"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php#L87-L100 |
222,677 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php | EcomDev_Varnish_Model_AbstractFacade.items | public function items($object = null)
{
if (!$this->_items) {
$this->_initItems();
}
$items = array();
foreach ($this->_items as $item) {
if ($object !== null && !$item->isApplicable($object)) {
continue;
}
... | php | public function items($object = null)
{
if (!$this->_items) {
$this->_initItems();
}
$items = array();
foreach ($this->_items as $item) {
if ($object !== null && !$item->isApplicable($object)) {
continue;
}
... | [
"public",
"function",
"items",
"(",
"$",
"object",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_items",
")",
"{",
"$",
"this",
"->",
"_initItems",
"(",
")",
";",
"}",
"$",
"items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$"... | Retrieves facade items
If object is specified, it will filter out items by isApplicable interface
@param null|object $object
@return EcomDev_Varnish_Model_ApplicableInterface[] | [
"Retrieves",
"facade",
"items",
"If",
"object",
"is",
"specified",
"it",
"will",
"filter",
"out",
"items",
"by",
"isApplicable",
"interface"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php#L109-L126 |
222,678 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php | EcomDev_Varnish_Model_AbstractFacade.walk | public function walk($method, $arg = null, $object = null)
{
$result = array();
foreach ($this->items($object) as $item) {
$itemResult = $item->$method($arg);
if ($itemResult === $item) {
continue;
}
if (!is_array($itemResult)) {
... | php | public function walk($method, $arg = null, $object = null)
{
$result = array();
foreach ($this->items($object) as $item) {
$itemResult = $item->$method($arg);
if ($itemResult === $item) {
continue;
}
if (!is_array($itemResult)) {
... | [
"public",
"function",
"walk",
"(",
"$",
"method",
",",
"$",
"arg",
"=",
"null",
",",
"$",
"object",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"(",
"$",
"object",
")",
"as",
"$... | Invokes method on each facade item
with specified arguments
@param string $method
@param null|mixed $arg
@param null|object $object
@return array | [
"Invokes",
"method",
"on",
"each",
"facade",
"item",
"with",
"specified",
"arguments"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/AbstractFacade.php#L137-L155 |
222,679 | univicosa/laravel-openid-client | Services/Api.php | Api.initialize | private static function initialize()
{
if (self::$initialized) return;
self::$client = \OpenId::getClient();
self::$version = config('openid.api-version');
self::$initialized = TRUE;
} | php | private static function initialize()
{
if (self::$initialized) return;
self::$client = \OpenId::getClient();
self::$version = config('openid.api-version');
self::$initialized = TRUE;
} | [
"private",
"static",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"initialized",
")",
"return",
";",
"self",
"::",
"$",
"client",
"=",
"\\",
"OpenId",
"::",
"getClient",
"(",
")",
";",
"self",
"::",
"$",
"version",
"=",
"con... | Static class constructor | [
"Static",
"class",
"constructor"
] | 42ac511de250b597ba12ef0216f1d493fd7a2def | https://github.com/univicosa/laravel-openid-client/blob/42ac511de250b597ba12ef0216f1d493fd7a2def/Services/Api.php#L28-L35 |
222,680 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/StatusCallback.php | StatusCallback.isCancelled | public function isCancelled()
{
if (!$this->testMdSignatures()) {
return false;
}
return in_array($this->getStatus(), [self::STATUS_CHARGEBACK, self::STATUS_FAILED, self::STATUS_CANCELLED]);
} | php | public function isCancelled()
{
if (!$this->testMdSignatures()) {
return false;
}
return in_array($this->getStatus(), [self::STATUS_CHARGEBACK, self::STATUS_FAILED, self::STATUS_CANCELLED]);
} | [
"public",
"function",
"isCancelled",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"testMdSignatures",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"in_array",
"(",
"$",
"this",
"->",
"getStatus",
"(",
")",
",",
"[",
"self",
"::",
... | Was the payment cancelled?
@return bool | [
"Was",
"the",
"payment",
"cancelled?"
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/StatusCallback.php#L87-L94 |
222,681 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/StatusCallback.php | StatusCallback.validateSignatures | protected function validateSignatures()
{
if (!$this->testMdSignatures()) {
return false;
}
if ($this->getSha2Signature() !== null) {
return $this->getSha2Signature() === $this->calculateSha2Signature();
}
return true;
} | php | protected function validateSignatures()
{
if (!$this->testMdSignatures()) {
return false;
}
if ($this->getSha2Signature() !== null) {
return $this->getSha2Signature() === $this->calculateSha2Signature();
}
return true;
} | [
"protected",
"function",
"validateSignatures",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"testMdSignatures",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"getSha2Signature",
"(",
")",
"!==",
"null",
")",
"{",
... | Validates the MD5 signature and, if enabled, the SHA2 signature.
@return bool | [
"Validates",
"the",
"MD5",
"signature",
"and",
"if",
"enabled",
"the",
"SHA2",
"signature",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/StatusCallback.php#L101-L112 |
222,682 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/StatusCallback.php | StatusCallback.getSkrillAmount | public function getSkrillAmount($stringFormat = false)
{
$amount = (double)$this->data['mb_amount'];
if ($stringFormat) {
$amount = number_format($amount, 2, '.', '');
}
return $amount;
} | php | public function getSkrillAmount($stringFormat = false)
{
$amount = (double)$this->data['mb_amount'];
if ($stringFormat) {
$amount = number_format($amount, 2, '.', '');
}
return $amount;
} | [
"public",
"function",
"getSkrillAmount",
"(",
"$",
"stringFormat",
"=",
"false",
")",
"{",
"$",
"amount",
"=",
"(",
"double",
")",
"$",
"this",
"->",
"data",
"[",
"'mb_amount'",
"]",
";",
"if",
"(",
"$",
"stringFormat",
")",
"{",
"$",
"amount",
"=",
... | Get the total amount of the payment in merchant's currency.
@param $stringFormat
@return float|string amount | [
"Get",
"the",
"total",
"amount",
"of",
"the",
"payment",
"in",
"merchant",
"s",
"currency",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/StatusCallback.php#L212-L221 |
222,683 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/StatusCallback.php | StatusCallback.getMerchantFields | public function getMerchantFields(array $keys)
{
$fields = [];
foreach ($keys as $key) {
$fields[$key] = $this->data[$key];
}
return $fields;
} | php | public function getMerchantFields(array $keys)
{
$fields = [];
foreach ($keys as $key) {
$fields[$key] = $this->data[$key];
}
return $fields;
} | [
"public",
"function",
"getMerchantFields",
"(",
"array",
"$",
"keys",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"fields",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"data",
"[",
... | Get the fields that the merchant chose to submit in the merchant_fields parameter.
@param array $keys keys for the fields
@return array merchant fields | [
"Get",
"the",
"fields",
"that",
"the",
"merchant",
"chose",
"to",
"submit",
"in",
"the",
"merchant_fields",
"parameter",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/StatusCallback.php#L318-L326 |
222,684 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/StatusCallback.php | StatusCallback.calculateMd5Signature | public function calculateMd5Signature()
{
return strtoupper(md5(
$this->getMerchantId() .
$this->getTransactionReference() .
$this->getSecretWordForMd5Signature() .
$this->getSkrillAmount(true) .
$this->getSkrillCurrency() .
$this->getS... | php | public function calculateMd5Signature()
{
return strtoupper(md5(
$this->getMerchantId() .
$this->getTransactionReference() .
$this->getSecretWordForMd5Signature() .
$this->getSkrillAmount(true) .
$this->getSkrillCurrency() .
$this->getS... | [
"public",
"function",
"calculateMd5Signature",
"(",
")",
"{",
"return",
"strtoupper",
"(",
"md5",
"(",
"$",
"this",
"->",
"getMerchantId",
"(",
")",
".",
"$",
"this",
"->",
"getTransactionReference",
"(",
")",
".",
"$",
"this",
"->",
"getSecretWordForMd5Signat... | Calculate the 128 bit message digest, expressed as a string of thirty-two
hexadecimal digits in UPPERCASE.
The md5sig is constructed by performing a MD5 calculation on a string built up by
concatenating the other fields returned to the status url.
@return string md5 signature | [
"Calculate",
"the",
"128",
"bit",
"message",
"digest",
"expressed",
"as",
"a",
"string",
"of",
"thirty",
"-",
"two",
"hexadecimal",
"digits",
"in",
"UPPERCASE",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/StatusCallback.php#L337-L347 |
222,685 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/StatusCallback.php | StatusCallback.calculateSha2Signature | public function calculateSha2Signature()
{
return hash('sha256',
$this->getMerchantId() .
$this->getTransactionReference() .
$this->getSecretWordForMd5Signature() .
$this->getSkrillAmount() .
$this->getSkrillCurrency() .
$this->getStatu... | php | public function calculateSha2Signature()
{
return hash('sha256',
$this->getMerchantId() .
$this->getTransactionReference() .
$this->getSecretWordForMd5Signature() .
$this->getSkrillAmount() .
$this->getSkrillCurrency() .
$this->getStatu... | [
"public",
"function",
"calculateSha2Signature",
"(",
")",
"{",
"return",
"hash",
"(",
"'sha256'",
",",
"$",
"this",
"->",
"getMerchantId",
"(",
")",
".",
"$",
"this",
"->",
"getTransactionReference",
"(",
")",
".",
"$",
"this",
"->",
"getSecretWordForMd5Signat... | Calculate the 256 bit message digest, expressed as a string of sixty-four
hexadecimal digits in lowercase.
The sha2sig is constructed by performing a SHA256 calculation on a string built up
by concatenating the other fields returned to the status url.
@return string sha2 signature | [
"Calculate",
"the",
"256",
"bit",
"message",
"digest",
"expressed",
"as",
"a",
"string",
"of",
"sixty",
"-",
"four",
"hexadecimal",
"digits",
"in",
"lowercase",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/StatusCallback.php#L358-L368 |
222,686 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Esi/Tag.php | EcomDev_Varnish_Block_Esi_Tag._beforeToHtml | protected function _beforeToHtml()
{
Mage::helper('ecomdev_varnish')->setIsEsiUsed(true);
$handles = implode(',', $this->_handles);
$params = array(
'handles' => $handles,
'package' => Mage::getSingleton('core/design_package')->getPackageName(),
'theme' =>... | php | protected function _beforeToHtml()
{
Mage::helper('ecomdev_varnish')->setIsEsiUsed(true);
$handles = implode(',', $this->_handles);
$params = array(
'handles' => $handles,
'package' => Mage::getSingleton('core/design_package')->getPackageName(),
'theme' =>... | [
"protected",
"function",
"_beforeToHtml",
"(",
")",
"{",
"Mage",
"::",
"helper",
"(",
"'ecomdev_varnish'",
")",
"->",
"setIsEsiUsed",
"(",
"true",
")",
";",
"$",
"handles",
"=",
"implode",
"(",
"','",
",",
"$",
"this",
"->",
"_handles",
")",
";",
"$",
... | Outputs ESI tag
@return string | [
"Outputs",
"ESI",
"tag"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Esi/Tag.php#L69-L108 |
222,687 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Esi/Tag.php | EcomDev_Varnish_Block_Esi_Tag.getBlockJson | public function getBlockJson()
{
$result = array(
'htmlId' => $this->getHtmlId(),
'url' => $this->getBlockUrl()
);
return $this->helper('core')->jsonEncode($result);
} | php | public function getBlockJson()
{
$result = array(
'htmlId' => $this->getHtmlId(),
'url' => $this->getBlockUrl()
);
return $this->helper('core')->jsonEncode($result);
} | [
"public",
"function",
"getBlockJson",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"'htmlId'",
"=>",
"$",
"this",
"->",
"getHtmlId",
"(",
")",
",",
"'url'",
"=>",
"$",
"this",
"->",
"getBlockUrl",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
... | Returns block json
@return string[] | [
"Returns",
"block",
"json"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Esi/Tag.php#L115-L123 |
222,688 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Message.php | EcomDev_Varnish_Model_Message.getMessageTypes | public function getMessageTypes()
{
if ($this->messageTypes === null) {
$this->messageTypes = array();
$messageTypes = Mage::getConfig()->getNode(self::XML_PATH_MESSAGE_TYPES);
if ($messageTypes) {
foreach ($messageTypes->children() as $typeCode => $classA... | php | public function getMessageTypes()
{
if ($this->messageTypes === null) {
$this->messageTypes = array();
$messageTypes = Mage::getConfig()->getNode(self::XML_PATH_MESSAGE_TYPES);
if ($messageTypes) {
foreach ($messageTypes->children() as $typeCode => $classA... | [
"public",
"function",
"getMessageTypes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"messageTypes",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"messageTypes",
"=",
"array",
"(",
")",
";",
"$",
"messageTypes",
"=",
"Mage",
"::",
"getConfig",
"(",
")"... | Returns message types for varnish cache
@return string[] | [
"Returns",
"message",
"types",
"for",
"varnish",
"cache"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Message.php#L41-L54 |
222,689 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Message.php | EcomDev_Varnish_Model_Message.getMessageTypeByStorage | public function getMessageTypeByStorage($storageType)
{
if ($this->messageTypeByStorageType === null) {
$types = $this->getMessageTypes();
if ($types) {
$this->messageTypeByStorageType = array_combine(
array_values($types),
arra... | php | public function getMessageTypeByStorage($storageType)
{
if ($this->messageTypeByStorageType === null) {
$types = $this->getMessageTypes();
if ($types) {
$this->messageTypeByStorageType = array_combine(
array_values($types),
arra... | [
"public",
"function",
"getMessageTypeByStorage",
"(",
"$",
"storageType",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"messageTypeByStorageType",
"===",
"null",
")",
"{",
"$",
"types",
"=",
"$",
"this",
"->",
"getMessageTypes",
"(",
")",
";",
"if",
"(",
"$",
... | Returns message type by storage
@param string $storageType
@return string|bool | [
"Returns",
"message",
"type",
"by",
"storage"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Message.php#L62-L81 |
222,690 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Message.php | EcomDev_Varnish_Model_Message.getStorageByMessageType | public function getStorageByMessageType($messageType)
{
if ($this->messageTypes === null) {
$this->getMessageTypes();
}
if (!isset($this->messageTypes[$messageType])) {
return false;
}
return Mage::getSingleton($this->messageTypes[$messageType]);
... | php | public function getStorageByMessageType($messageType)
{
if ($this->messageTypes === null) {
$this->getMessageTypes();
}
if (!isset($this->messageTypes[$messageType])) {
return false;
}
return Mage::getSingleton($this->messageTypes[$messageType]);
... | [
"public",
"function",
"getStorageByMessageType",
"(",
"$",
"messageType",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"messageTypes",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"getMessageTypes",
"(",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"thi... | Returns storage by message type
@param string $messageType
@return Mage_Core_Model_Session_Abstract|bool | [
"Returns",
"storage",
"by",
"message",
"type"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Message.php#L89-L100 |
222,691 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Message.php | EcomDev_Varnish_Model_Message.addMessages | public function addMessages($messages, $storageType)
{
if ($messages instanceof Mage_Core_Model_Message_Collection) {
$messages = $messages->getItems();
}
$this->scheduledMessages[$storageType] = $messages;
return $this;
} | php | public function addMessages($messages, $storageType)
{
if ($messages instanceof Mage_Core_Model_Message_Collection) {
$messages = $messages->getItems();
}
$this->scheduledMessages[$storageType] = $messages;
return $this;
} | [
"public",
"function",
"addMessages",
"(",
"$",
"messages",
",",
"$",
"storageType",
")",
"{",
"if",
"(",
"$",
"messages",
"instanceof",
"Mage_Core_Model_Message_Collection",
")",
"{",
"$",
"messages",
"=",
"$",
"messages",
"->",
"getItems",
"(",
")",
";",
"}... | Adds messages for a later use
@param Mage_Core_Model_Message_Collection|Mage_Core_Model_Message_Abstract[] $messages
@param string $storageType
@return $this | [
"Adds",
"messages",
"for",
"a",
"later",
"use"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Message.php#L121-L129 |
222,692 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Message.php | EcomDev_Varnish_Model_Message.getMessages | public function getMessages($types)
{
$result = array();
foreach ($types as $type) {
$storage = $this->getStorageByMessageType($type);
if ($storage) {
$result[] = $storage->getMessages(true);
}
}
return $result;
} | php | public function getMessages($types)
{
$result = array();
foreach ($types as $type) {
$storage = $this->getStorageByMessageType($type);
if ($storage) {
$result[] = $storage->getMessages(true);
}
}
return $result;
} | [
"public",
"function",
"getMessages",
"(",
"$",
"types",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"types",
"as",
"$",
"type",
")",
"{",
"$",
"storage",
"=",
"$",
"this",
"->",
"getStorageByMessageType",
"(",
"$",
"typ... | Returns all messages from types passed in argument
@return Mage_Core_Model_Message_Collection[] | [
"Returns",
"all",
"messages",
"from",
"types",
"passed",
"in",
"argument"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Message.php#L136-L148 |
222,693 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Message.php | EcomDev_Varnish_Model_Message.apply | public function apply()
{
if (!isset($_SESSION) || empty($_SESSION)) {
return $this;
}
foreach ($this->messageBlocks as $messageBlock) {
foreach ($messageBlock->getMessagesByStorage() as $storageType => $messages) {
$this->addMessagesByStorageType($s... | php | public function apply()
{
if (!isset($_SESSION) || empty($_SESSION)) {
return $this;
}
foreach ($this->messageBlocks as $messageBlock) {
foreach ($messageBlock->getMessagesByStorage() as $storageType => $messages) {
$this->addMessagesByStorageType($s... | [
"public",
"function",
"apply",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_SESSION",
")",
"||",
"empty",
"(",
"$",
"_SESSION",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"messageBlocks",
"as",
"$",
... | Applies changes values stored in message block into session instances
@return $this | [
"Applies",
"changes",
"values",
"stored",
"in",
"message",
"block",
"into",
"session",
"instances"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Message.php#L155-L190 |
222,694 | basarevych/dynamic-table | php/DynamicTable/Table.php | Table.setSortColumn | public function setSortColumn($column)
{
$this->sortColumn = null;
$found = false;
foreach ($this->getColumns() as $id => $params) {
if ($id == $column) {
$found = ($params['sortable'] === true);
break;
}
}
if ($found)... | php | public function setSortColumn($column)
{
$this->sortColumn = null;
$found = false;
foreach ($this->getColumns() as $id => $params) {
if ($id == $column) {
$found = ($params['sortable'] === true);
break;
}
}
if ($found)... | [
"public",
"function",
"setSortColumn",
"(",
"$",
"column",
")",
"{",
"$",
"this",
"->",
"sortColumn",
"=",
"null",
";",
"$",
"found",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"getColumns",
"(",
")",
"as",
"$",
"id",
"=>",
"$",
"params",
... | Sort column setter
@param string $column
@return Table | [
"Sort",
"column",
"setter"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Table.php#L294-L310 |
222,695 | basarevych/dynamic-table | php/DynamicTable/Table.php | Table.setSortDir | public function setSortDir($dir)
{
if (in_array($dir, [ self::DIR_ASC, self::DIR_DESC ]))
$this->sortDir = $dir;
else
$this->sortDir = self::DIR_ASC;
return $this;
} | php | public function setSortDir($dir)
{
if (in_array($dir, [ self::DIR_ASC, self::DIR_DESC ]))
$this->sortDir = $dir;
else
$this->sortDir = self::DIR_ASC;
return $this;
} | [
"public",
"function",
"setSortDir",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"dir",
",",
"[",
"self",
"::",
"DIR_ASC",
",",
"self",
"::",
"DIR_DESC",
"]",
")",
")",
"$",
"this",
"->",
"sortDir",
"=",
"$",
"dir",
";",
"else",
"$... | Sort direction setter
@param string $dir
@return Table | [
"Sort",
"direction",
"setter"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Table.php#L328-L336 |
222,696 | basarevych/dynamic-table | php/DynamicTable/Table.php | Table.setPageNumber | public function setPageNumber($number)
{
$this->pageNumber = ($number === null ? 1 : (int)$number);
if ($this->pageNumber < 1)
$this->pageNumber = 1;
return $this;
} | php | public function setPageNumber($number)
{
$this->pageNumber = ($number === null ? 1 : (int)$number);
if ($this->pageNumber < 1)
$this->pageNumber = 1;
return $this;
} | [
"public",
"function",
"setPageNumber",
"(",
"$",
"number",
")",
"{",
"$",
"this",
"->",
"pageNumber",
"=",
"(",
"$",
"number",
"===",
"null",
"?",
"1",
":",
"(",
"int",
")",
"$",
"number",
")",
";",
"if",
"(",
"$",
"this",
"->",
"pageNumber",
"<",
... | Page number setter
@param integer $number
@return Table | [
"Page",
"number",
"setter"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Table.php#L354-L361 |
222,697 | basarevych/dynamic-table | php/DynamicTable/Table.php | Table.setPageSize | public function setPageSize($size)
{
$this->pageSize = ($size === null ? self::PAGE_SIZE : (int)$size);
if ($this->pageSize < 0)
$this->pageSize = self::PAGE_SIZE;
return $this;
} | php | public function setPageSize($size)
{
$this->pageSize = ($size === null ? self::PAGE_SIZE : (int)$size);
if ($this->pageSize < 0)
$this->pageSize = self::PAGE_SIZE;
return $this;
} | [
"public",
"function",
"setPageSize",
"(",
"$",
"size",
")",
"{",
"$",
"this",
"->",
"pageSize",
"=",
"(",
"$",
"size",
"===",
"null",
"?",
"self",
"::",
"PAGE_SIZE",
":",
"(",
"int",
")",
"$",
"size",
")",
";",
"if",
"(",
"$",
"this",
"->",
"page... | Page size setter
@param integer $size
@return Table | [
"Page",
"size",
"setter"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Table.php#L379-L386 |
222,698 | basarevych/dynamic-table | php/DynamicTable/Table.php | Table.setPageParams | public function setPageParams($params)
{
$this->setFilters(json_decode(@$params['filters'], true));
$this->setSortColumn(json_decode(@$params['sort_column'], true));
$this->setSortDir(json_decode(@$params['sort_dir'], true));
$this->setPageNumber(json_decode(@$params['page_number'], ... | php | public function setPageParams($params)
{
$this->setFilters(json_decode(@$params['filters'], true));
$this->setSortColumn(json_decode(@$params['sort_column'], true));
$this->setSortDir(json_decode(@$params['sort_dir'], true));
$this->setPageNumber(json_decode(@$params['page_number'], ... | [
"public",
"function",
"setPageParams",
"(",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"setFilters",
"(",
"json_decode",
"(",
"@",
"$",
"params",
"[",
"'filters'",
"]",
",",
"true",
")",
")",
";",
"$",
"this",
"->",
"setSortColumn",
"(",
"json_decode",
... | Sets sort, filter and pagination options
@param array $params
@return Table | [
"Sets",
"sort",
"filter",
"and",
"pagination",
"options"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Table.php#L414-L423 |
222,699 | basarevych/dynamic-table | php/DynamicTable/Table.php | Table.describe | public function describe()
{
$columns = [];
foreach ($this->columns as $id => $params) {
$columns[$id] = [
'title' => $params['title'],
'type' => $params['type'],
'filters' => $params['filters'],
'sortable' => $p... | php | public function describe()
{
$columns = [];
foreach ($this->columns as $id => $params) {
$columns[$id] = [
'title' => $params['title'],
'type' => $params['type'],
'filters' => $params['filters'],
'sortable' => $p... | [
"public",
"function",
"describe",
"(",
")",
"{",
"$",
"columns",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"columns",
"as",
"$",
"id",
"=>",
"$",
"params",
")",
"{",
"$",
"columns",
"[",
"$",
"id",
"]",
"=",
"[",
"'title'",
"=>",
"... | Return table description
@return array | [
"Return",
"table",
"description"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Table.php#L449-L465 |
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.