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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
207,500 | z-song/laravel-admin | src/Grid/Concerns/HasFooter.php | HasFooter.footer | public function footer(Closure $closure = null)
{
if (!$closure) {
return $this->footer;
}
$this->footer = $closure;
return $this;
} | php | public function footer(Closure $closure = null)
{
if (!$closure) {
return $this->footer;
}
$this->footer = $closure;
return $this;
} | [
"public",
"function",
"footer",
"(",
"Closure",
"$",
"closure",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"closure",
")",
"{",
"return",
"$",
"this",
"->",
"footer",
";",
"}",
"$",
"this",
"->",
"footer",
"=",
"$",
"closure",
";",
"return",
"$",
... | Set grid footer.
@param Closure|null $closure
@return $this|Closure | [
"Set",
"grid",
"footer",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Concerns/HasFooter.php#L22-L31 |
207,501 | z-song/laravel-admin | src/Form.php | Form.edit | public function edit($id)
{
$this->builder->setMode(Builder::MODE_EDIT);
$this->builder->setResourceId($id);
$this->setFieldValue($id);
return $this;
} | php | public function edit($id)
{
$this->builder->setMode(Builder::MODE_EDIT);
$this->builder->setResourceId($id);
$this->setFieldValue($id);
return $this;
} | [
"public",
"function",
"edit",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"setMode",
"(",
"Builder",
"::",
"MODE_EDIT",
")",
";",
"$",
"this",
"->",
"builder",
"->",
"setResourceId",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"s... | Generate a edit form.
@param $id
@return $this | [
"Generate",
"a",
"edit",
"form",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L254-L262 |
207,502 | z-song/laravel-admin | src/Form.php | Form.tab | public function tab($title, Closure $content, $active = false)
{
$this->getTab()->append($title, $content, $active);
return $this;
} | php | public function tab($title, Closure $content, $active = false)
{
$this->getTab()->append($title, $content, $active);
return $this;
} | [
"public",
"function",
"tab",
"(",
"$",
"title",
",",
"Closure",
"$",
"content",
",",
"$",
"active",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"getTab",
"(",
")",
"->",
"append",
"(",
"$",
"title",
",",
"$",
"content",
",",
"$",
"active",
")",
";... | Use tab to split form.
@param string $title
@param Closure $content
@return $this | [
"Use",
"tab",
"to",
"split",
"form",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L272-L277 |
207,503 | z-song/laravel-admin | src/Form.php | Form.getTab | public function getTab()
{
if (is_null($this->tab)) {
$this->tab = new Tab($this);
}
return $this->tab;
} | php | public function getTab()
{
if (is_null($this->tab)) {
$this->tab = new Tab($this);
}
return $this->tab;
} | [
"public",
"function",
"getTab",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"tab",
")",
")",
"{",
"$",
"this",
"->",
"tab",
"=",
"new",
"Tab",
"(",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
"->",
"tab",
";",
"}"
] | Get Tab instance.
@return Tab | [
"Get",
"Tab",
"instance",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L284-L291 |
207,504 | z-song/laravel-admin | src/Form.php | Form.deleteFiles | protected function deleteFiles(Model $model, $forceDelete = false)
{
// If it's a soft delete, the files in the data will not be deleted.
if (!$forceDelete && $this->isSoftDeletes) {
return;
}
$data = $model->toArray();
$this->builder->fields()->filter(function ... | php | protected function deleteFiles(Model $model, $forceDelete = false)
{
// If it's a soft delete, the files in the data will not be deleted.
if (!$forceDelete && $this->isSoftDeletes) {
return;
}
$data = $model->toArray();
$this->builder->fields()->filter(function ... | [
"protected",
"function",
"deleteFiles",
"(",
"Model",
"$",
"model",
",",
"$",
"forceDelete",
"=",
"false",
")",
"{",
"// If it's a soft delete, the files in the data will not be deleted.",
"if",
"(",
"!",
"$",
"forceDelete",
"&&",
"$",
"this",
"->",
"isSoftDeletes",
... | Remove files in record.
@param Model $model
@param bool $forceDelete | [
"Remove",
"files",
"in",
"record",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L351-L367 |
207,505 | z-song/laravel-admin | src/Form.php | Form.ajaxResponse | protected function ajaxResponse($message)
{
$request = Request::capture();
// ajax but not pjax
if ($request->ajax() && !$request->pjax()) {
return response()->json([
'status' => true,
'message' => $message,
]);
}
ret... | php | protected function ajaxResponse($message)
{
$request = Request::capture();
// ajax but not pjax
if ($request->ajax() && !$request->pjax()) {
return response()->json([
'status' => true,
'message' => $message,
]);
}
ret... | [
"protected",
"function",
"ajaxResponse",
"(",
"$",
"message",
")",
"{",
"$",
"request",
"=",
"Request",
"::",
"capture",
"(",
")",
";",
"// ajax but not pjax",
"if",
"(",
"$",
"request",
"->",
"ajax",
"(",
")",
"&&",
"!",
"$",
"request",
"->",
"pjax",
... | Get ajax response.
@param string $message
@return bool|\Illuminate\Http\JsonResponse | [
"Get",
"ajax",
"response",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L417-L430 |
207,506 | z-song/laravel-admin | src/Form.php | Form.redirectAfterStore | protected function redirectAfterStore()
{
$resourcesPath = $this->resource(0);
$key = $this->model->getKey();
return $this->redirectAfterSaving($resourcesPath, $key);
} | php | protected function redirectAfterStore()
{
$resourcesPath = $this->resource(0);
$key = $this->model->getKey();
return $this->redirectAfterSaving($resourcesPath, $key);
} | [
"protected",
"function",
"redirectAfterStore",
"(",
")",
"{",
"$",
"resourcesPath",
"=",
"$",
"this",
"->",
"resource",
"(",
"0",
")",
";",
"$",
"key",
"=",
"$",
"this",
"->",
"model",
"->",
"getKey",
"(",
")",
";",
"return",
"$",
"this",
"->",
"redi... | Get RedirectResponse after store.
@return \Illuminate\Http\RedirectResponse | [
"Get",
"RedirectResponse",
"after",
"store",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L567-L574 |
207,507 | z-song/laravel-admin | src/Form.php | Form.redirectAfterSaving | protected function redirectAfterSaving($resourcesPath, $key)
{
if (request('after-save') == 1) {
// continue editing
$url = rtrim($resourcesPath, '/')."/{$key}/edit";
} elseif (request('after-save') == 2) {
// continue creating
$url = rtrim($resourcesP... | php | protected function redirectAfterSaving($resourcesPath, $key)
{
if (request('after-save') == 1) {
// continue editing
$url = rtrim($resourcesPath, '/')."/{$key}/edit";
} elseif (request('after-save') == 2) {
// continue creating
$url = rtrim($resourcesP... | [
"protected",
"function",
"redirectAfterSaving",
"(",
"$",
"resourcesPath",
",",
"$",
"key",
")",
"{",
"if",
"(",
"request",
"(",
"'after-save'",
")",
"==",
"1",
")",
"{",
"// continue editing",
"$",
"url",
"=",
"rtrim",
"(",
"$",
"resourcesPath",
",",
"'/'... | Get RedirectResponse after data saving.
@param string $resourcesPath
@param string $key
@return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector | [
"Get",
"RedirectResponse",
"after",
"data",
"saving",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L598-L616 |
207,508 | z-song/laravel-admin | src/Form.php | Form.handleColumnUpdates | protected function handleColumnUpdates($id, $data)
{
$data = $this->handleEditable($data);
$data = $this->handleFileDelete($data);
$data = $this->handleFileSort($data);
if ($this->handleOrderable($id, $data)) {
return response([
'status' => true,
... | php | protected function handleColumnUpdates($id, $data)
{
$data = $this->handleEditable($data);
$data = $this->handleFileDelete($data);
$data = $this->handleFileSort($data);
if ($this->handleOrderable($id, $data)) {
return response([
'status' => true,
... | [
"protected",
"function",
"handleColumnUpdates",
"(",
"$",
"id",
",",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"handleEditable",
"(",
"$",
"data",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"handleFileDelete",
"(",
"$",
"data",
... | Handle updates for single column.
@param int $id
@param array $data
@return array|\Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response|Response | [
"Handle",
"updates",
"for",
"single",
"column",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L638-L654 |
207,509 | z-song/laravel-admin | src/Form.php | Form.isHasOneRelation | protected function isHasOneRelation($inserts)
{
$first = current($inserts);
if (!is_array($first)) {
return false;
}
if (is_array(current($first))) {
return false;
}
return Arr::isAssoc($first);
} | php | protected function isHasOneRelation($inserts)
{
$first = current($inserts);
if (!is_array($first)) {
return false;
}
if (is_array(current($first))) {
return false;
}
return Arr::isAssoc($first);
} | [
"protected",
"function",
"isHasOneRelation",
"(",
"$",
"inserts",
")",
"{",
"$",
"first",
"=",
"current",
"(",
"$",
"inserts",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"first",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_array",... | Is input data is has-one relation.
@param array $inserts
@return bool | [
"Is",
"input",
"data",
"is",
"has",
"-",
"one",
"relation",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L954-L967 |
207,510 | z-song/laravel-admin | src/Form.php | Form.validationMessages | public function validationMessages($input)
{
$failedValidators = [];
/** @var Field $field */
foreach ($this->builder->fields() as $field) {
if (!$validator = $field->getValidator($input)) {
continue;
}
if (($validator instanceof Validato... | php | public function validationMessages($input)
{
$failedValidators = [];
/** @var Field $field */
foreach ($this->builder->fields() as $field) {
if (!$validator = $field->getValidator($input)) {
continue;
}
if (($validator instanceof Validato... | [
"public",
"function",
"validationMessages",
"(",
"$",
"input",
")",
"{",
"$",
"failedValidators",
"=",
"[",
"]",
";",
"/** @var Field $field */",
"foreach",
"(",
"$",
"this",
"->",
"builder",
"->",
"fields",
"(",
")",
"as",
"$",
"field",
")",
"{",
"if",
... | Get validation messages.
@param array $input
@return MessageBag|bool | [
"Get",
"validation",
"messages",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1097-L1115 |
207,511 | z-song/laravel-admin | src/Form.php | Form.mergeValidationMessages | protected function mergeValidationMessages($validators)
{
$messageBag = new MessageBag();
foreach ($validators as $validator) {
$messageBag = $messageBag->merge($validator->messages());
}
return $messageBag;
} | php | protected function mergeValidationMessages($validators)
{
$messageBag = new MessageBag();
foreach ($validators as $validator) {
$messageBag = $messageBag->merge($validator->messages());
}
return $messageBag;
} | [
"protected",
"function",
"mergeValidationMessages",
"(",
"$",
"validators",
")",
"{",
"$",
"messageBag",
"=",
"new",
"MessageBag",
"(",
")",
";",
"foreach",
"(",
"$",
"validators",
"as",
"$",
"validator",
")",
"{",
"$",
"messageBag",
"=",
"$",
"messageBag",
... | Merge validation messages from input validators.
@param \Illuminate\Validation\Validator[] $validators
@return MessageBag | [
"Merge",
"validation",
"messages",
"from",
"input",
"validators",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1124-L1133 |
207,512 | z-song/laravel-admin | src/Form.php | Form.disableSubmit | public function disableSubmit(bool $disable = true)
{
$this->builder()->getFooter()->disableSubmit($disable);
return $this;
} | php | public function disableSubmit(bool $disable = true)
{
$this->builder()->getFooter()->disableSubmit($disable);
return $this;
} | [
"public",
"function",
"disableSubmit",
"(",
"bool",
"$",
"disable",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"builder",
"(",
")",
"->",
"getFooter",
"(",
")",
"->",
"disableSubmit",
"(",
"$",
"disable",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Disable form submit.
@param bool $disable
@return $this
@deprecated | [
"Disable",
"form",
"submit",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1263-L1268 |
207,513 | z-song/laravel-admin | src/Form.php | Form.disableReset | public function disableReset(bool $disable = true)
{
$this->builder()->getFooter()->disableReset($disable);
return $this;
} | php | public function disableReset(bool $disable = true)
{
$this->builder()->getFooter()->disableReset($disable);
return $this;
} | [
"public",
"function",
"disableReset",
"(",
"bool",
"$",
"disable",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"builder",
"(",
")",
"->",
"getFooter",
"(",
")",
"->",
"disableReset",
"(",
"$",
"disable",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Disable form reset.
@param bool $disable
@return $this
@deprecated | [
"Disable",
"form",
"reset",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1279-L1284 |
207,514 | z-song/laravel-admin | src/Form.php | Form.disableViewCheck | public function disableViewCheck(bool $disable = true)
{
$this->builder()->getFooter()->disableViewCheck($disable);
return $this;
} | php | public function disableViewCheck(bool $disable = true)
{
$this->builder()->getFooter()->disableViewCheck($disable);
return $this;
} | [
"public",
"function",
"disableViewCheck",
"(",
"bool",
"$",
"disable",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"builder",
"(",
")",
"->",
"getFooter",
"(",
")",
"->",
"disableViewCheck",
"(",
"$",
"disable",
")",
";",
"return",
"$",
"this",
";",
"}"
... | Disable View Checkbox on footer.
@param bool $disable
@return $this | [
"Disable",
"View",
"Checkbox",
"on",
"footer",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1293-L1298 |
207,515 | z-song/laravel-admin | src/Form.php | Form.disableEditingCheck | public function disableEditingCheck(bool $disable = true)
{
$this->builder()->getFooter()->disableEditingCheck($disable);
return $this;
} | php | public function disableEditingCheck(bool $disable = true)
{
$this->builder()->getFooter()->disableEditingCheck($disable);
return $this;
} | [
"public",
"function",
"disableEditingCheck",
"(",
"bool",
"$",
"disable",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"builder",
"(",
")",
"->",
"getFooter",
"(",
")",
"->",
"disableEditingCheck",
"(",
"$",
"disable",
")",
";",
"return",
"$",
"this",
";",
... | Disable Editing Checkbox on footer.
@param bool $disable
@return $this | [
"Disable",
"Editing",
"Checkbox",
"on",
"footer",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1307-L1312 |
207,516 | z-song/laravel-admin | src/Form.php | Form.disableCreatingCheck | public function disableCreatingCheck(bool $disable = true)
{
$this->builder()->getFooter()->disableCreatingCheck($disable);
return $this;
} | php | public function disableCreatingCheck(bool $disable = true)
{
$this->builder()->getFooter()->disableCreatingCheck($disable);
return $this;
} | [
"public",
"function",
"disableCreatingCheck",
"(",
"bool",
"$",
"disable",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"builder",
"(",
")",
"->",
"getFooter",
"(",
")",
"->",
"disableCreatingCheck",
"(",
"$",
"disable",
")",
";",
"return",
"$",
"this",
";"... | Disable Creating Checkbox on footer.
@param bool $disable
@return $this | [
"Disable",
"Creating",
"Checkbox",
"on",
"footer",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1321-L1326 |
207,517 | z-song/laravel-admin | src/Form.php | Form.resource | public function resource($slice = -2)
{
$segments = explode('/', trim(app('request')->getUri(), '/'));
if ($slice != 0) {
$segments = array_slice($segments, 0, $slice);
}
return implode('/', $segments);
} | php | public function resource($slice = -2)
{
$segments = explode('/', trim(app('request')->getUri(), '/'));
if ($slice != 0) {
$segments = array_slice($segments, 0, $slice);
}
return implode('/', $segments);
} | [
"public",
"function",
"resource",
"(",
"$",
"slice",
"=",
"-",
"2",
")",
"{",
"$",
"segments",
"=",
"explode",
"(",
"'/'",
",",
"trim",
"(",
"app",
"(",
"'request'",
")",
"->",
"getUri",
"(",
")",
",",
"'/'",
")",
")",
";",
"if",
"(",
"$",
"sli... | Get current resource route url.
@param int $slice
@return string | [
"Get",
"current",
"resource",
"route",
"url",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1345-L1354 |
207,518 | z-song/laravel-admin | src/Form.php | Form.findFieldClass | public static function findFieldClass($method)
{
// If alias exists.
if (isset(static::$fieldAlias[$method])) {
$method = static::$fieldAlias[$method];
}
$class = Arr::get(static::$availableFields, $method);
if (class_exists($class)) {
return $class;... | php | public static function findFieldClass($method)
{
// If alias exists.
if (isset(static::$fieldAlias[$method])) {
$method = static::$fieldAlias[$method];
}
$class = Arr::get(static::$availableFields, $method);
if (class_exists($class)) {
return $class;... | [
"public",
"static",
"function",
"findFieldClass",
"(",
"$",
"method",
")",
"{",
"// If alias exists.",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"fieldAlias",
"[",
"$",
"method",
"]",
")",
")",
"{",
"$",
"method",
"=",
"static",
"::",
"$",
"fieldAlia... | Find field class.
@param string $method
@return bool|mixed | [
"Find",
"field",
"class",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1492-L1506 |
207,519 | z-song/laravel-admin | src/Console/InstallCommand.php | InstallCommand.createRoutesFile | protected function createRoutesFile()
{
$file = $this->directory.'/routes.php';
$contents = $this->getStub('routes');
$this->laravel['files']->put($file, str_replace('DummyNamespace', config('admin.route.namespace'), $contents));
$this->line('<info>Routes file was created:</info> '.... | php | protected function createRoutesFile()
{
$file = $this->directory.'/routes.php';
$contents = $this->getStub('routes');
$this->laravel['files']->put($file, str_replace('DummyNamespace', config('admin.route.namespace'), $contents));
$this->line('<info>Routes file was created:</info> '.... | [
"protected",
"function",
"createRoutesFile",
"(",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"directory",
".",
"'/routes.php'",
";",
"$",
"contents",
"=",
"$",
"this",
"->",
"getStub",
"(",
"'routes'",
")",
";",
"$",
"this",
"->",
"laravel",
"[",
"... | Create routes file.
@return void | [
"Create",
"routes",
"file",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/InstallCommand.php#L156-L163 |
207,520 | z-song/laravel-admin | src/Grid/Tools/PerPageSelector.php | PerPageSelector.initialize | protected function initialize()
{
$this->perPageName = $this->grid->model()->getPerPageName();
$this->perPage = (int) app('request')->input(
$this->perPageName,
$this->grid->perPage
);
} | php | protected function initialize()
{
$this->perPageName = $this->grid->model()->getPerPageName();
$this->perPage = (int) app('request')->input(
$this->perPageName,
$this->grid->perPage
);
} | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"perPageName",
"=",
"$",
"this",
"->",
"grid",
"->",
"model",
"(",
")",
"->",
"getPerPageName",
"(",
")",
";",
"$",
"this",
"->",
"perPage",
"=",
"(",
"int",
")",
"app",
"(",
... | Do initialize work.
@return void | [
"Do",
"initialize",
"work",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools/PerPageSelector.php#L37-L45 |
207,521 | z-song/laravel-admin | src/Grid/Tools/PerPageSelector.php | PerPageSelector.getOptions | public function getOptions()
{
return collect($this->grid->perPages)
->push($this->grid->perPage)
->push($this->perPage)
->unique()
->sort();
} | php | public function getOptions()
{
return collect($this->grid->perPages)
->push($this->grid->perPage)
->push($this->perPage)
->unique()
->sort();
} | [
"public",
"function",
"getOptions",
"(",
")",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"grid",
"->",
"perPages",
")",
"->",
"push",
"(",
"$",
"this",
"->",
"grid",
"->",
"perPage",
")",
"->",
"push",
"(",
"$",
"this",
"->",
"perPage",
")",
... | Get options for selector.
@return static | [
"Get",
"options",
"for",
"selector",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools/PerPageSelector.php#L52-L59 |
207,522 | z-song/laravel-admin | src/Console/MakeCommand.php | MakeCommand.modelExists | protected function modelExists()
{
$model = $this->option('model');
if (empty($model)) {
return true;
}
return class_exists($model) && is_subclass_of($model, Model::class);
} | php | protected function modelExists()
{
$model = $this->option('model');
if (empty($model)) {
return true;
}
return class_exists($model) && is_subclass_of($model, Model::class);
} | [
"protected",
"function",
"modelExists",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"option",
"(",
"'model'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"model",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"class_exists",
"(",
"$",
"... | Determine if the model is exists.
@return bool | [
"Determine",
"if",
"the",
"model",
"is",
"exists",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/MakeCommand.php#L81-L90 |
207,523 | google/flatbuffers | php/Table.php | Table.__offset | protected function __offset($vtable_offset)
{
$vtable = $this->bb_pos - $this->bb->getInt($this->bb_pos);
return $vtable_offset < $this->bb->getShort($vtable) ? $this->bb->getShort($vtable + $vtable_offset) : 0;
} | php | protected function __offset($vtable_offset)
{
$vtable = $this->bb_pos - $this->bb->getInt($this->bb_pos);
return $vtable_offset < $this->bb->getShort($vtable) ? $this->bb->getShort($vtable + $vtable_offset) : 0;
} | [
"protected",
"function",
"__offset",
"(",
"$",
"vtable_offset",
")",
"{",
"$",
"vtable",
"=",
"$",
"this",
"->",
"bb_pos",
"-",
"$",
"this",
"->",
"bb",
"->",
"getInt",
"(",
"$",
"this",
"->",
"bb_pos",
")",
";",
"return",
"$",
"vtable_offset",
"<",
... | returns actual vtable offset
@param $vtable_offset
@return int offset > 0 means exist value. 0 means not exist | [
"returns",
"actual",
"vtable",
"offset"
] | af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1 | https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/Table.php#L51-L55 |
207,524 | google/flatbuffers | php/Table.php | Table.__string | protected function __string($offset)
{
$offset += $this->bb->getInt($offset);
$len = $this->bb->getInt($offset);
$startPos = $offset + Constants::SIZEOF_INT;
return substr($this->bb->_buffer, $startPos, $len);
} | php | protected function __string($offset)
{
$offset += $this->bb->getInt($offset);
$len = $this->bb->getInt($offset);
$startPos = $offset + Constants::SIZEOF_INT;
return substr($this->bb->_buffer, $startPos, $len);
} | [
"protected",
"function",
"__string",
"(",
"$",
"offset",
")",
"{",
"$",
"offset",
"+=",
"$",
"this",
"->",
"bb",
"->",
"getInt",
"(",
"$",
"offset",
")",
";",
"$",
"len",
"=",
"$",
"this",
"->",
"bb",
"->",
"getInt",
"(",
"$",
"offset",
")",
";",... | fetch utf8 encoded string.
@param $offset
@return string | [
"fetch",
"utf8",
"encoded",
"string",
"."
] | af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1 | https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/Table.php#L72-L78 |
207,525 | google/flatbuffers | php/FlatbufferBuilder.php | FlatbufferBuilder.addOffset | public function addOffset($off)
{
$this->prep(Constants::SIZEOF_INT, 0); // Ensure alignment is already done
if ($off > $this->offset()) {
throw new \Exception("");
}
$this->putOffset($off);
} | php | public function addOffset($off)
{
$this->prep(Constants::SIZEOF_INT, 0); // Ensure alignment is already done
if ($off > $this->offset()) {
throw new \Exception("");
}
$this->putOffset($off);
} | [
"public",
"function",
"addOffset",
"(",
"$",
"off",
")",
"{",
"$",
"this",
"->",
"prep",
"(",
"Constants",
"::",
"SIZEOF_INT",
",",
"0",
")",
";",
"// Ensure alignment is already done",
"if",
"(",
"$",
"off",
">",
"$",
"this",
"->",
"offset",
"(",
")",
... | Adds on offset, relative to where it will be written.
@param $off The offset to add to the buffer.
@throws \Exception Throws an exception if `$off` is greater than the underlying ByteBuffer's
offest. | [
"Adds",
"on",
"offset",
"relative",
"to",
"where",
"it",
"will",
"be",
"written",
"."
] | af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1 | https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/FlatbufferBuilder.php#L568-L575 |
207,526 | google/flatbuffers | php/FlatbufferBuilder.php | FlatbufferBuilder.sizedByteArray | public function sizedByteArray()
{
$start = $this->space;
$length = $this->bb->capacity() - $this->space;
$result = str_repeat("\0", $length);
$this->bb->setPosition($start);
$this->bb->getX($result);
return $result;
} | php | public function sizedByteArray()
{
$start = $this->space;
$length = $this->bb->capacity() - $this->space;
$result = str_repeat("\0", $length);
$this->bb->setPosition($start);
$this->bb->getX($result);
return $result;
} | [
"public",
"function",
"sizedByteArray",
"(",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"space",
";",
"$",
"length",
"=",
"$",
"this",
"->",
"bb",
"->",
"capacity",
"(",
")",
"-",
"$",
"this",
"->",
"space",
";",
"$",
"result",
"=",
"str_repea... | Utility function to copy and return the FlatBuffer data from the
underlying ByteBuffer.
@return string A string (representing a byte[]) that contains a copy
of the FlatBuffer data. | [
"Utility",
"function",
"to",
"copy",
"and",
"return",
"the",
"FlatBuffer",
"data",
"from",
"the",
"underlying",
"ByteBuffer",
"."
] | af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1 | https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/FlatbufferBuilder.php#L964-L974 |
207,527 | google/flatbuffers | php/ByteBuffer.php | ByteBuffer.writeLittleEndian | public function writeLittleEndian($offset, $count, $data)
{
if (ByteBuffer::isLittleEndian()) {
for ($i = 0; $i < $count; $i++) {
$this->_buffer[$offset + $i] = chr($data >> $i * 8);
}
} else {
for ($i = 0; $i < $count; $i++) {
$thi... | php | public function writeLittleEndian($offset, $count, $data)
{
if (ByteBuffer::isLittleEndian()) {
for ($i = 0; $i < $count; $i++) {
$this->_buffer[$offset + $i] = chr($data >> $i * 8);
}
} else {
for ($i = 0; $i < $count; $i++) {
$thi... | [
"public",
"function",
"writeLittleEndian",
"(",
"$",
"offset",
",",
"$",
"count",
",",
"$",
"data",
")",
"{",
"if",
"(",
"ByteBuffer",
"::",
"isLittleEndian",
"(",
")",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"count",
"... | write little endian value to the buffer.
@param $offset
@param $count byte length
@param $data actual values | [
"write",
"little",
"endian",
"value",
"to",
"the",
"buffer",
"."
] | af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1 | https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/ByteBuffer.php#L120-L131 |
207,528 | google/flatbuffers | php/ByteBuffer.php | ByteBuffer.readLittleEndian | public function readLittleEndian($offset, $count, $force_bigendian = false)
{
$this->assertOffsetAndLength($offset, $count);
$r = 0;
if (ByteBuffer::isLittleEndian() && $force_bigendian == false) {
for ($i = 0; $i < $count; $i++) {
$r |= ord($this->_buffer[$offse... | php | public function readLittleEndian($offset, $count, $force_bigendian = false)
{
$this->assertOffsetAndLength($offset, $count);
$r = 0;
if (ByteBuffer::isLittleEndian() && $force_bigendian == false) {
for ($i = 0; $i < $count; $i++) {
$r |= ord($this->_buffer[$offse... | [
"public",
"function",
"readLittleEndian",
"(",
"$",
"offset",
",",
"$",
"count",
",",
"$",
"force_bigendian",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"assertOffsetAndLength",
"(",
"$",
"offset",
",",
"$",
"count",
")",
";",
"$",
"r",
"=",
"0",
";",
... | read little endian value from the buffer
@param $offset
@param $count acutal size
@return int | [
"read",
"little",
"endian",
"value",
"from",
"the",
"buffer"
] | af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1 | https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/ByteBuffer.php#L140-L156 |
207,529 | apache/thrift | lib/php/lib/Transport/TFramedTransport.php | TFramedTransport.putBack | public function putBack($data)
{
if (TStringFuncFactory::create()->strlen($this->rBuf_) === 0) {
$this->rBuf_ = $data;
} else {
$this->rBuf_ = ($data . $this->rBuf_);
}
} | php | public function putBack($data)
{
if (TStringFuncFactory::create()->strlen($this->rBuf_) === 0) {
$this->rBuf_ = $data;
} else {
$this->rBuf_ = ($data . $this->rBuf_);
}
} | [
"public",
"function",
"putBack",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"TStringFuncFactory",
"::",
"create",
"(",
")",
"->",
"strlen",
"(",
"$",
"this",
"->",
"rBuf_",
")",
"===",
"0",
")",
"{",
"$",
"this",
"->",
"rBuf_",
"=",
"$",
"data",
";",
... | Put previously read data back into the buffer
@param string $data data to return | [
"Put",
"previously",
"read",
"data",
"back",
"into",
"the",
"buffer"
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TFramedTransport.php#L133-L140 |
207,530 | apache/thrift | lib/php/lib/Transport/TFramedTransport.php | TFramedTransport.readFrame | private function readFrame()
{
$buf = $this->transport_->readAll(4);
$val = unpack('N', $buf);
$sz = $val[1];
$this->rBuf_ = $this->transport_->readAll($sz);
} | php | private function readFrame()
{
$buf = $this->transport_->readAll(4);
$val = unpack('N', $buf);
$sz = $val[1];
$this->rBuf_ = $this->transport_->readAll($sz);
} | [
"private",
"function",
"readFrame",
"(",
")",
"{",
"$",
"buf",
"=",
"$",
"this",
"->",
"transport_",
"->",
"readAll",
"(",
"4",
")",
";",
"$",
"val",
"=",
"unpack",
"(",
"'N'",
",",
"$",
"buf",
")",
";",
"$",
"sz",
"=",
"$",
"val",
"[",
"1",
... | Reads a chunk of data into the internal read buffer. | [
"Reads",
"a",
"chunk",
"of",
"data",
"into",
"the",
"internal",
"read",
"buffer",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TFramedTransport.php#L145-L152 |
207,531 | apache/thrift | lib/php/lib/Transport/TFramedTransport.php | TFramedTransport.write | public function write($buf, $len = null)
{
if (!$this->write_) {
return $this->transport_->write($buf, $len);
}
if ($len !== null && $len < TStringFuncFactory::create()->strlen($buf)) {
$buf = TStringFuncFactory::create()->substr($buf, 0, $len);
}
$th... | php | public function write($buf, $len = null)
{
if (!$this->write_) {
return $this->transport_->write($buf, $len);
}
if ($len !== null && $len < TStringFuncFactory::create()->strlen($buf)) {
$buf = TStringFuncFactory::create()->substr($buf, 0, $len);
}
$th... | [
"public",
"function",
"write",
"(",
"$",
"buf",
",",
"$",
"len",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"write_",
")",
"{",
"return",
"$",
"this",
"->",
"transport_",
"->",
"write",
"(",
"$",
"buf",
",",
"$",
"len",
")",
";",... | Writes some data to the pending output buffer.
@param string $buf The data
@param int $len Limit of bytes to write | [
"Writes",
"some",
"data",
"to",
"the",
"pending",
"output",
"buffer",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TFramedTransport.php#L160-L170 |
207,532 | apache/thrift | lib/php/lib/Transport/TFramedTransport.php | TFramedTransport.flush | public function flush()
{
if (!$this->write_ || TStringFuncFactory::create()->strlen($this->wBuf_) == 0) {
return $this->transport_->flush();
}
$out = pack('N', TStringFuncFactory::create()->strlen($this->wBuf_));
$out .= $this->wBuf_;
// Note that we clear the ... | php | public function flush()
{
if (!$this->write_ || TStringFuncFactory::create()->strlen($this->wBuf_) == 0) {
return $this->transport_->flush();
}
$out = pack('N', TStringFuncFactory::create()->strlen($this->wBuf_));
$out .= $this->wBuf_;
// Note that we clear the ... | [
"public",
"function",
"flush",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"write_",
"||",
"TStringFuncFactory",
"::",
"create",
"(",
")",
"->",
"strlen",
"(",
"$",
"this",
"->",
"wBuf_",
")",
"==",
"0",
")",
"{",
"return",
"$",
"this",
"->",... | Writes the output buffer to the stream in the format of a 4-byte length
followed by the actual data. | [
"Writes",
"the",
"output",
"buffer",
"to",
"the",
"stream",
"in",
"the",
"format",
"of",
"a",
"4",
"-",
"byte",
"length",
"followed",
"by",
"the",
"actual",
"data",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TFramedTransport.php#L176-L191 |
207,533 | apache/thrift | lib/php/lib/Protocol/TProtocolDecorator.php | TProtocolDecorator.writeMessageBegin | public function writeMessageBegin($name, $type, $seqid)
{
return $this->concreteProtocol_->writeMessageBegin($name, $type, $seqid);
} | php | public function writeMessageBegin($name, $type, $seqid)
{
return $this->concreteProtocol_->writeMessageBegin($name, $type, $seqid);
} | [
"public",
"function",
"writeMessageBegin",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"seqid",
")",
"{",
"return",
"$",
"this",
"->",
"concreteProtocol_",
"->",
"writeMessageBegin",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"seqid",
")",
";",
"}... | Writes the message header.
@param string $name Function name
@param int $type message type TMessageType::CALL or TMessageType::REPLY
@param int $seqid The sequence id of this message | [
"Writes",
"the",
"message",
"header",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Protocol/TProtocolDecorator.php#L64-L67 |
207,534 | apache/thrift | lib/php/lib/Server/TForkingServer.php | TForkingServer.serve | public function serve()
{
$this->transport_->listen();
while (!$this->stop_) {
try {
$transport = $this->transport_->accept();
if ($transport != null) {
$pid = pcntl_fork();
if ($pid > 0) {
... | php | public function serve()
{
$this->transport_->listen();
while (!$this->stop_) {
try {
$transport = $this->transport_->accept();
if ($transport != null) {
$pid = pcntl_fork();
if ($pid > 0) {
... | [
"public",
"function",
"serve",
"(",
")",
"{",
"$",
"this",
"->",
"transport_",
"->",
"listen",
"(",
")",
";",
"while",
"(",
"!",
"$",
"this",
"->",
"stop_",
")",
"{",
"try",
"{",
"$",
"transport",
"=",
"$",
"this",
"->",
"transport_",
"->",
"accept... | Listens for new client using the supplied
transport. We fork when a new connection
arrives.
@return void | [
"Listens",
"for",
"new",
"client",
"using",
"the",
"supplied",
"transport",
".",
"We",
"fork",
"when",
"a",
"new",
"connection",
"arrives",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Server/TForkingServer.php#L37-L61 |
207,535 | apache/thrift | lib/php/lib/Server/TForkingServer.php | TForkingServer.handleChild | private function handleChild(TTransport $transport)
{
try {
$inputTransport = $this->inputTransportFactory_->getTransport($transport);
$outputTransport = $this->outputTransportFactory_->getTransport($transport);
$inputProtocol = $this->inputProtocolFactory_->getProtocol($... | php | private function handleChild(TTransport $transport)
{
try {
$inputTransport = $this->inputTransportFactory_->getTransport($transport);
$outputTransport = $this->outputTransportFactory_->getTransport($transport);
$inputProtocol = $this->inputProtocolFactory_->getProtocol($... | [
"private",
"function",
"handleChild",
"(",
"TTransport",
"$",
"transport",
")",
"{",
"try",
"{",
"$",
"inputTransport",
"=",
"$",
"this",
"->",
"inputTransportFactory_",
"->",
"getTransport",
"(",
"$",
"transport",
")",
";",
"$",
"outputTransport",
"=",
"$",
... | Code run by the child.
@param TTransport $transport
@return void | [
"Code",
"run",
"by",
"the",
"child",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Server/TForkingServer.php#L81-L95 |
207,536 | apache/thrift | lib/php/lib/Server/TForkingServer.php | TForkingServer.collectChildren | private function collectChildren()
{
foreach ($this->children_ as $pid => $transport) {
if (pcntl_waitpid($pid, $status, WNOHANG) > 0) {
unset($this->children_[$pid]);
if ($transport) {
@$transport->close();
}
}
... | php | private function collectChildren()
{
foreach ($this->children_ as $pid => $transport) {
if (pcntl_waitpid($pid, $status, WNOHANG) > 0) {
unset($this->children_[$pid]);
if ($transport) {
@$transport->close();
}
}
... | [
"private",
"function",
"collectChildren",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"children_",
"as",
"$",
"pid",
"=>",
"$",
"transport",
")",
"{",
"if",
"(",
"pcntl_waitpid",
"(",
"$",
"pid",
",",
"$",
"status",
",",
"WNOHANG",
")",
">",
"0... | Collects any children we may have
@return void | [
"Collects",
"any",
"children",
"we",
"may",
"have"
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Server/TForkingServer.php#L102-L112 |
207,537 | apache/thrift | lib/php/lib/Protocol/TSimpleJSONProtocol.php | TSimpleJSONProtocol.pushWriteContext | protected function pushWriteContext(Context $c)
{
$this->writeContextStack_[] = $this->writeContext_;
$this->writeContext_ = $c;
} | php | protected function pushWriteContext(Context $c)
{
$this->writeContextStack_[] = $this->writeContext_;
$this->writeContext_ = $c;
} | [
"protected",
"function",
"pushWriteContext",
"(",
"Context",
"$",
"c",
")",
"{",
"$",
"this",
"->",
"writeContextStack_",
"[",
"]",
"=",
"$",
"this",
"->",
"writeContext_",
";",
"$",
"this",
"->",
"writeContext_",
"=",
"$",
"c",
";",
"}"
] | Push a new write context onto the stack. | [
"Push",
"a",
"new",
"write",
"context",
"onto",
"the",
"stack",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Protocol/TSimpleJSONProtocol.php#L57-L61 |
207,538 | apache/thrift | lib/php/lib/Protocol/TSimpleJSONProtocol.php | TSimpleJSONProtocol.writeStructBegin | public function writeStructBegin($name)
{
$this->writeContext_->write();
$this->trans_->write(self::LBRACE);
$this->pushWriteContext(new StructContext($this));
} | php | public function writeStructBegin($name)
{
$this->writeContext_->write();
$this->trans_->write(self::LBRACE);
$this->pushWriteContext(new StructContext($this));
} | [
"public",
"function",
"writeStructBegin",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"writeContext_",
"->",
"write",
"(",
")",
";",
"$",
"this",
"->",
"trans_",
"->",
"write",
"(",
"self",
"::",
"LBRACE",
")",
";",
"$",
"this",
"->",
"pushWriteCont... | Writes a struct header.
@param string $name Struct name | [
"Writes",
"a",
"struct",
"header",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Protocol/TSimpleJSONProtocol.php#L164-L169 |
207,539 | apache/thrift | lib/php/lib/Serializer/TBinarySerializer.php | TBinarySerializer.serialize | public static function serialize($object)
{
$transport = new TMemoryBuffer();
$protocol = new TBinaryProtocolAccelerated($transport);
if (function_exists('thrift_protocol_write_binary')) {
thrift_protocol_write_binary(
$protocol,
$object->getName()... | php | public static function serialize($object)
{
$transport = new TMemoryBuffer();
$protocol = new TBinaryProtocolAccelerated($transport);
if (function_exists('thrift_protocol_write_binary')) {
thrift_protocol_write_binary(
$protocol,
$object->getName()... | [
"public",
"static",
"function",
"serialize",
"(",
"$",
"object",
")",
"{",
"$",
"transport",
"=",
"new",
"TMemoryBuffer",
"(",
")",
";",
"$",
"protocol",
"=",
"new",
"TBinaryProtocolAccelerated",
"(",
"$",
"transport",
")",
";",
"if",
"(",
"function_exists",... | normal deserialization. | [
"normal",
"deserialization",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Serializer/TBinarySerializer.php#L41-L62 |
207,540 | apache/thrift | lib/php/lib/Transport/TTransport.php | TTransport.readAll | public function readAll($len)
{
// return $this->read($len);
$data = '';
$got = 0;
while (($got = TStringFuncFactory::create()->strlen($data)) < $len) {
$data .= $this->read($len - $got);
}
return $data;
} | php | public function readAll($len)
{
// return $this->read($len);
$data = '';
$got = 0;
while (($got = TStringFuncFactory::create()->strlen($data)) < $len) {
$data .= $this->read($len - $got);
}
return $data;
} | [
"public",
"function",
"readAll",
"(",
"$",
"len",
")",
"{",
"// return $this->read($len);",
"$",
"data",
"=",
"''",
";",
"$",
"got",
"=",
"0",
";",
"while",
"(",
"(",
"$",
"got",
"=",
"TStringFuncFactory",
"::",
"create",
"(",
")",
"->",
"strlen",
"(",... | Guarantees that the full amount of data is read.
@return string The data, of exact length
@throws TTransportException if cannot read data | [
"Guarantees",
"that",
"the",
"full",
"amount",
"of",
"data",
"is",
"read",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TTransport.php#L69-L80 |
207,541 | apache/thrift | lib/php/lib/Server/TSSLServerSocket.php | TSSLServerSocket.listen | public function listen()
{
$this->listener_ = @stream_socket_server(
$this->host_ . ':' . $this->port_,
$errno,
$errstr,
STREAM_SERVER_BIND | STREAM_SERVER_LISTEN,
$this->context_
);
} | php | public function listen()
{
$this->listener_ = @stream_socket_server(
$this->host_ . ':' . $this->port_,
$errno,
$errstr,
STREAM_SERVER_BIND | STREAM_SERVER_LISTEN,
$this->context_
);
} | [
"public",
"function",
"listen",
"(",
")",
"{",
"$",
"this",
"->",
"listener_",
"=",
"@",
"stream_socket_server",
"(",
"$",
"this",
"->",
"host_",
".",
"':'",
".",
"$",
"this",
"->",
"port_",
",",
"$",
"errno",
",",
"$",
"errstr",
",",
"STREAM_SERVER_BI... | Opens a new socket server handle
@return void | [
"Opens",
"a",
"new",
"socket",
"server",
"handle"
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Server/TSSLServerSocket.php#L69-L78 |
207,542 | apache/thrift | lib/php/lib/Server/TSSLServerSocket.php | TSSLServerSocket.acceptImpl | protected function acceptImpl()
{
$handle = @stream_socket_accept($this->listener_, $this->acceptTimeout_ / 1000.0);
if (!$handle) {
return null;
}
$socket = new TSSLSocket();
$socket->setHandle($handle);
return $socket;
} | php | protected function acceptImpl()
{
$handle = @stream_socket_accept($this->listener_, $this->acceptTimeout_ / 1000.0);
if (!$handle) {
return null;
}
$socket = new TSSLSocket();
$socket->setHandle($handle);
return $socket;
} | [
"protected",
"function",
"acceptImpl",
"(",
")",
"{",
"$",
"handle",
"=",
"@",
"stream_socket_accept",
"(",
"$",
"this",
"->",
"listener_",
",",
"$",
"this",
"->",
"acceptTimeout_",
"/",
"1000.0",
")",
";",
"if",
"(",
"!",
"$",
"handle",
")",
"{",
"ret... | Implementation of accept. If not client is accepted in the given time
@return TSocket | [
"Implementation",
"of",
"accept",
".",
"If",
"not",
"client",
"is",
"accepted",
"in",
"the",
"given",
"time"
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Server/TSSLServerSocket.php#L85-L96 |
207,543 | apache/thrift | lib/php/lib/Server/TSimpleServer.php | TSimpleServer.serve | public function serve()
{
$this->transport_->listen();
while (!$this->stop_) {
try {
$transport = $this->transport_->accept();
if ($transport != null) {
$inputTransport = $this->inputTransportFactory_->getTransport($transport);
... | php | public function serve()
{
$this->transport_->listen();
while (!$this->stop_) {
try {
$transport = $this->transport_->accept();
if ($transport != null) {
$inputTransport = $this->inputTransportFactory_->getTransport($transport);
... | [
"public",
"function",
"serve",
"(",
")",
"{",
"$",
"this",
"->",
"transport_",
"->",
"listen",
"(",
")",
";",
"while",
"(",
"!",
"$",
"this",
"->",
"stop_",
")",
"{",
"try",
"{",
"$",
"transport",
"=",
"$",
"this",
"->",
"transport_",
"->",
"accept... | Listens for new client using the supplied
transport. It handles TTransportExceptions
to avoid timeouts etc killing it
@return void | [
"Listens",
"for",
"new",
"client",
"using",
"the",
"supplied",
"transport",
".",
"It",
"handles",
"TTransportExceptions",
"to",
"avoid",
"timeouts",
"etc",
"killing",
"it"
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Server/TSimpleServer.php#L28-L47 |
207,544 | apache/thrift | lib/php/lib/Transport/TSocket.php | TSocket.setSendTimeout | public function setSendTimeout($timeout)
{
$this->sendTimeoutSec_ = floor($timeout / 1000);
$this->sendTimeoutUsec_ =
($timeout - ($this->sendTimeoutSec_ * 1000)) * 1000;
} | php | public function setSendTimeout($timeout)
{
$this->sendTimeoutSec_ = floor($timeout / 1000);
$this->sendTimeoutUsec_ =
($timeout - ($this->sendTimeoutSec_ * 1000)) * 1000;
} | [
"public",
"function",
"setSendTimeout",
"(",
"$",
"timeout",
")",
"{",
"$",
"this",
"->",
"sendTimeoutSec_",
"=",
"floor",
"(",
"$",
"timeout",
"/",
"1000",
")",
";",
"$",
"this",
"->",
"sendTimeoutUsec_",
"=",
"(",
"$",
"timeout",
"-",
"(",
"$",
"this... | Sets the send timeout.
@param int $timeout Timeout in milliseconds. | [
"Sets",
"the",
"send",
"timeout",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TSocket.php#L149-L154 |
207,545 | apache/thrift | lib/php/lib/Transport/TCurlClient.php | TCurlClient.readAll | public function readAll($len)
{
$data = $this->read($len);
if (TStringFuncFactory::create()->strlen($data) !== $len) {
throw new TTransportException('TCurlClient could not read '.$len.' bytes');
}
return $data;
} | php | public function readAll($len)
{
$data = $this->read($len);
if (TStringFuncFactory::create()->strlen($data) !== $len) {
throw new TTransportException('TCurlClient could not read '.$len.' bytes');
}
return $data;
} | [
"public",
"function",
"readAll",
"(",
"$",
"len",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"read",
"(",
"$",
"len",
")",
";",
"if",
"(",
"TStringFuncFactory",
"::",
"create",
"(",
")",
"->",
"strlen",
"(",
"$",
"data",
")",
"!==",
"$",
"len... | Guarantees that the full amount of data is read. Since TCurlClient gets entire payload at
once, parent readAll cannot be used.
@return string The data, of exact length
@throws TTransportException if cannot read data | [
"Guarantees",
"that",
"the",
"full",
"amount",
"of",
"data",
"is",
"read",
".",
"Since",
"TCurlClient",
"gets",
"entire",
"payload",
"at",
"once",
"parent",
"readAll",
"cannot",
"be",
"used",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TCurlClient.php#L179-L188 |
207,546 | apache/thrift | lib/php/lib/ClassLoader/ThriftClassLoader.php | ThriftClassLoader.loadClass | public function loadClass($class)
{
if ((true === $this->apc && ($file = $this->findFileInApc($class))) or
($file = $this->findFile($class))
) {
require_once $file;
}
} | php | public function loadClass($class)
{
if ((true === $this->apc && ($file = $this->findFileInApc($class))) or
($file = $this->findFile($class))
) {
require_once $file;
}
} | [
"public",
"function",
"loadClass",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"(",
"true",
"===",
"$",
"this",
"->",
"apc",
"&&",
"(",
"$",
"file",
"=",
"$",
"this",
"->",
"findFileInApc",
"(",
"$",
"class",
")",
")",
")",
"or",
"(",
"$",
"file",
... | Loads the given class, definition or interface.
@param string $class The name of the class | [
"Loads",
"the",
"given",
"class",
"definition",
"or",
"interface",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/ClassLoader/ThriftClassLoader.php#L102-L109 |
207,547 | apache/thrift | lib/php/lib/ClassLoader/ThriftClassLoader.php | ThriftClassLoader.findFileInApc | protected function findFileInApc($class)
{
if (false === $file = apc_fetch($this->apc_prefix . $class)) {
apc_store($this->apc_prefix . $class, $file = $this->findFile($class));
}
return $file;
} | php | protected function findFileInApc($class)
{
if (false === $file = apc_fetch($this->apc_prefix . $class)) {
apc_store($this->apc_prefix . $class, $file = $this->findFile($class));
}
return $file;
} | [
"protected",
"function",
"findFileInApc",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"file",
"=",
"apc_fetch",
"(",
"$",
"this",
"->",
"apc_prefix",
".",
"$",
"class",
")",
")",
"{",
"apc_store",
"(",
"$",
"this",
"->",
"apc_prefix",
... | Loads the given class or interface in APC.
@param string $class The name of the class
@return string | [
"Loads",
"the",
"given",
"class",
"or",
"interface",
"in",
"APC",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/ClassLoader/ThriftClassLoader.php#L116-L123 |
207,548 | apache/thrift | lib/php/lib/ClassLoader/ThriftClassLoader.php | ThriftClassLoader.findFile | public function findFile($class)
{
// Remove first backslash
if ('\\' == $class[0]) {
$class = substr($class, 1);
}
if (false !== $pos = strrpos($class, '\\')) {
// Namespaced class name
$namespace = substr($class, 0, $pos);
// Iterat... | php | public function findFile($class)
{
// Remove first backslash
if ('\\' == $class[0]) {
$class = substr($class, 1);
}
if (false !== $pos = strrpos($class, '\\')) {
// Namespaced class name
$namespace = substr($class, 0, $pos);
// Iterat... | [
"public",
"function",
"findFile",
"(",
"$",
"class",
")",
"{",
"// Remove first backslash",
"if",
"(",
"'\\\\'",
"==",
"$",
"class",
"[",
"0",
"]",
")",
"{",
"$",
"class",
"=",
"substr",
"(",
"$",
"class",
",",
"1",
")",
";",
"}",
"if",
"(",
"false... | Find class in namespaces or definitions directories
@param string $class
@return string | [
"Find",
"class",
"in",
"namespaces",
"or",
"definitions",
"directories"
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/ClassLoader/ThriftClassLoader.php#L130-L205 |
207,549 | getgrav/grav | system/src/Grav/Common/Page/Medium/ImageFile.php | ImageFile.cacheFile | public function cacheFile($type = 'jpg', $quality = 80, $actual = false, $extras = [])
{
if ($type === 'guess') {
$type = $this->guessType();
}
if (!$this->forceCache && !count($this->operations) && $type === $this->guessType()) {
return $this->getFilename($this->get... | php | public function cacheFile($type = 'jpg', $quality = 80, $actual = false, $extras = [])
{
if ($type === 'guess') {
$type = $this->guessType();
}
if (!$this->forceCache && !count($this->operations) && $type === $this->guessType()) {
return $this->getFilename($this->get... | [
"public",
"function",
"cacheFile",
"(",
"$",
"type",
"=",
"'jpg'",
",",
"$",
"quality",
"=",
"80",
",",
"$",
"actual",
"=",
"false",
",",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"type",
"===",
"'guess'",
")",
"{",
"$",
"type",
"... | This is the same as the Gregwar Image class except this one fires a Grav Event on creation of new cached file
@param string $type the image type
@param int $quality the quality (for JPEG)
@param bool $actual
@param array $extras
@return string | [
"This",
"is",
"the",
"same",
"as",
"the",
"Gregwar",
"Image",
"class",
"except",
"this",
"one",
"fires",
"a",
"Grav",
"Event",
"on",
"creation",
"of",
"new",
"cached",
"file"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/ImageFile.php#L43-L106 |
207,550 | getgrav/grav | system/src/Grav/Common/Page/Medium/ImageFile.php | ImageFile.getHash | public function getHash($type = 'guess', $quality = 80, $extras = [])
{
if (null === $this->hash) {
$this->generateHash($type, $quality, $extras);
}
return $this->hash;
} | php | public function getHash($type = 'guess', $quality = 80, $extras = [])
{
if (null === $this->hash) {
$this->generateHash($type, $quality, $extras);
}
return $this->hash;
} | [
"public",
"function",
"getHash",
"(",
"$",
"type",
"=",
"'guess'",
",",
"$",
"quality",
"=",
"80",
",",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"hash",
")",
"{",
"$",
"this",
"->",
"generateHash",
"(",... | Gets the hash.
@param string $type
@param int $quality
@param [] $extras
@return null | [
"Gets",
"the",
"hash",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/ImageFile.php#L115-L122 |
207,551 | getgrav/grav | system/src/Grav/Common/Plugins.php | Plugins.init | public function init()
{
$grav = Grav::instance();
/** @var Config $config */
$config = $grav['config'];
/** @var EventDispatcher $events */
$events = $grav['events'];
foreach ($this->items as $instance) {
// Register only enabled plugins.
i... | php | public function init()
{
$grav = Grav::instance();
/** @var Config $config */
$config = $grav['config'];
/** @var EventDispatcher $events */
$events = $grav['events'];
foreach ($this->items as $instance) {
// Register only enabled plugins.
i... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"grav",
"=",
"Grav",
"::",
"instance",
"(",
")",
";",
"/** @var Config $config */",
"$",
"config",
"=",
"$",
"grav",
"[",
"'config'",
"]",
";",
"/** @var EventDispatcher $events */",
"$",
"events",
"=",
"$",
... | Registers all plugins.
@return Plugin[] array of Plugin objects
@throws \RuntimeException | [
"Registers",
"all",
"plugins",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Plugins.php#L96-L115 |
207,552 | getgrav/grav | system/src/Grav/Common/Plugins.php | Plugins.all | public static function all()
{
$plugins = Grav::instance()['plugins'];
$list = [];
foreach ($plugins as $instance) {
$name = $instance->name;
$result = self::get($name);
if ($result) {
$list[$name] = $result;
}
}
... | php | public static function all()
{
$plugins = Grav::instance()['plugins'];
$list = [];
foreach ($plugins as $instance) {
$name = $instance->name;
$result = self::get($name);
if ($result) {
$list[$name] = $result;
}
}
... | [
"public",
"static",
"function",
"all",
"(",
")",
"{",
"$",
"plugins",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'plugins'",
"]",
";",
"$",
"list",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"instance",
")",
"{",
"$",
"nam... | Return list of all plugin data with their blueprints.
@return array | [
"Return",
"list",
"of",
"all",
"plugin",
"data",
"with",
"their",
"blueprints",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Plugins.php#L134-L149 |
207,553 | getgrav/grav | system/src/Grav/Common/Plugins.php | Plugins.get | public static function get($name)
{
$blueprints = new Blueprints('plugins://');
$blueprint = $blueprints->get("{$name}/blueprints");
// Load default configuration.
$file = CompiledYamlFile::instance("plugins://{$name}/{$name}" . YAML_EXT);
// ensure this is a valid plugin
... | php | public static function get($name)
{
$blueprints = new Blueprints('plugins://');
$blueprint = $blueprints->get("{$name}/blueprints");
// Load default configuration.
$file = CompiledYamlFile::instance("plugins://{$name}/{$name}" . YAML_EXT);
// ensure this is a valid plugin
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"$",
"blueprints",
"=",
"new",
"Blueprints",
"(",
"'plugins://'",
")",
";",
"$",
"blueprint",
"=",
"$",
"blueprints",
"->",
"get",
"(",
"\"{$name}/blueprints\"",
")",
";",
"// Load default co... | Get a plugin by name
@param string $name
@return Data|null | [
"Get",
"a",
"plugin",
"by",
"name"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Plugins.php#L158-L181 |
207,554 | getgrav/grav | system/src/Grav/Common/GPM/Installer.php | Installer.unZip | public static function unZip($zip_file, $destination)
{
$zip = new \ZipArchive();
$archive = $zip->open($zip_file);
if ($archive === true) {
Folder::create($destination);
$unzip = $zip->extractTo($destination);
if (!$unzip) {
self::$err... | php | public static function unZip($zip_file, $destination)
{
$zip = new \ZipArchive();
$archive = $zip->open($zip_file);
if ($archive === true) {
Folder::create($destination);
$unzip = $zip->extractTo($destination);
if (!$unzip) {
self::$err... | [
"public",
"static",
"function",
"unZip",
"(",
"$",
"zip_file",
",",
"$",
"destination",
")",
"{",
"$",
"zip",
"=",
"new",
"\\",
"ZipArchive",
"(",
")",
";",
"$",
"archive",
"=",
"$",
"zip",
"->",
"open",
"(",
"$",
"zip_file",
")",
";",
"if",
"(",
... | Unzip a file to somewhere
@param string $zip_file
@param string $destination
@return bool|string | [
"Unzip",
"a",
"file",
"to",
"somewhere"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Installer.php#L173-L200 |
207,555 | getgrav/grav | system/src/Grav/Common/GPM/Installer.php | Installer.loadInstaller | private static function loadInstaller($installer_file_folder, $is_install)
{
$installer = null;
$installer_file_folder = rtrim($installer_file_folder, DS);
$install_file = $installer_file_folder . DS . 'install.php';
if (file_exists($install_file)) {
require_once $inst... | php | private static function loadInstaller($installer_file_folder, $is_install)
{
$installer = null;
$installer_file_folder = rtrim($installer_file_folder, DS);
$install_file = $installer_file_folder . DS . 'install.php';
if (file_exists($install_file)) {
require_once $inst... | [
"private",
"static",
"function",
"loadInstaller",
"(",
"$",
"installer_file_folder",
",",
"$",
"is_install",
")",
"{",
"$",
"installer",
"=",
"null",
";",
"$",
"installer_file_folder",
"=",
"rtrim",
"(",
"$",
"installer_file_folder",
",",
"DS",
")",
";",
"$",
... | Instantiates and returns the package installer class
@param string $installer_file_folder The folder path that contains install.php
@param bool $is_install True if install, false if removal
@return null|string | [
"Instantiates",
"and",
"returns",
"the",
"package",
"installer",
"class"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Installer.php#L210-L253 |
207,556 | getgrav/grav | system/src/Grav/Common/GPM/Installer.php | Installer.uninstall | public static function uninstall($path, $options = [])
{
$options = array_merge(self::$options, $options);
if (!self::isValidDestination($path, $options['exclude_checks'])
) {
return false;
}
$installer_file_folder = $path;
$is_install = false;
$i... | php | public static function uninstall($path, $options = [])
{
$options = array_merge(self::$options, $options);
if (!self::isValidDestination($path, $options['exclude_checks'])
) {
return false;
}
$installer_file_folder = $path;
$is_install = false;
$i... | [
"public",
"static",
"function",
"uninstall",
"(",
"$",
"path",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"self",
"::",
"$",
"options",
",",
"$",
"options",
")",
";",
"if",
"(",
"!",
"self",
"::",
"isVali... | Uninstalls one or more given package
@param string $path The slug of the package(s)
@param array $options Options to use for uninstalling
@return bool True if everything went fine, False otherwise. | [
"Uninstalls",
"one",
"or",
"more",
"given",
"package"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Installer.php#L337-L369 |
207,557 | getgrav/grav | system/src/Grav/Common/GPM/Installer.php | Installer.isValidDestination | public static function isValidDestination($destination, $exclude = [])
{
self::$error = 0;
self::$target = $destination;
if (is_link($destination)) {
self::$error = self::IS_LINK;
} elseif (file_exists($destination)) {
self::$error = self::EXISTS;
} e... | php | public static function isValidDestination($destination, $exclude = [])
{
self::$error = 0;
self::$target = $destination;
if (is_link($destination)) {
self::$error = self::IS_LINK;
} elseif (file_exists($destination)) {
self::$error = self::EXISTS;
} e... | [
"public",
"static",
"function",
"isValidDestination",
"(",
"$",
"destination",
",",
"$",
"exclude",
"=",
"[",
"]",
")",
"{",
"self",
"::",
"$",
"error",
"=",
"0",
";",
"self",
"::",
"$",
"target",
"=",
"$",
"destination",
";",
"if",
"(",
"is_link",
"... | Runs a set of checks on the destination and sets the Error if any
@param string $destination The directory to run validations at
@param array $exclude An array of constants to exclude from the validation
@return bool True if validation passed. False otherwise | [
"Runs",
"a",
"set",
"of",
"checks",
"on",
"the",
"destination",
"and",
"sets",
"the",
"Error",
"if",
"any"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Installer.php#L379-L399 |
207,558 | getgrav/grav | system/src/Grav/Common/GPM/Installer.php | Installer.isGravInstance | public static function isGravInstance($target)
{
self::$error = 0;
self::$target = $target;
if (
!file_exists($target . DS . 'index.php') ||
!file_exists($target . DS . 'bin') ||
!file_exists($target . DS . 'user') ||
!file_exists($target . DS... | php | public static function isGravInstance($target)
{
self::$error = 0;
self::$target = $target;
if (
!file_exists($target . DS . 'index.php') ||
!file_exists($target . DS . 'bin') ||
!file_exists($target . DS . 'user') ||
!file_exists($target . DS... | [
"public",
"static",
"function",
"isGravInstance",
"(",
"$",
"target",
")",
"{",
"self",
"::",
"$",
"error",
"=",
"0",
";",
"self",
"::",
"$",
"target",
"=",
"$",
"target",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"target",
".",
"DS",
".",
"'in... | Validates if the given path is a Grav Instance
@param string $target The local path to the Grav Instance
@return bool True if is a Grav Instance. False otherwise | [
"Validates",
"if",
"the",
"given",
"path",
"is",
"a",
"Grav",
"Instance"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Installer.php#L408-L423 |
207,559 | getgrav/grav | system/src/Grav/Common/GPM/Installer.php | Installer.lastErrorMsg | public static function lastErrorMsg()
{
if (is_string(self::$error)) {
return self::$error;
}
switch (self::$error) {
case 0:
$msg = 'No Error';
break;
case self::EXISTS:
$msg = 'The target path "' . self::... | php | public static function lastErrorMsg()
{
if (is_string(self::$error)) {
return self::$error;
}
switch (self::$error) {
case 0:
$msg = 'No Error';
break;
case self::EXISTS:
$msg = 'The target path "' . self::... | [
"public",
"static",
"function",
"lastErrorMsg",
"(",
")",
"{",
"if",
"(",
"is_string",
"(",
"self",
"::",
"$",
"error",
")",
")",
"{",
"return",
"self",
"::",
"$",
"error",
";",
"}",
"switch",
"(",
"self",
"::",
"$",
"error",
")",
"{",
"case",
"0",... | Returns the last error occurred in a string message format
@return string The message of the last error | [
"Returns",
"the",
"last",
"error",
"occurred",
"in",
"a",
"string",
"message",
"format"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Installer.php#L438-L522 |
207,560 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.base | public function base($path = null)
{
if ($path !== null) {
$path = trim($path, '/');
$this->base = $path ? '/' . $path : null;
$this->baseRoute = [];
}
return $this->base;
} | php | public function base($path = null)
{
if ($path !== null) {
$path = trim($path, '/');
$this->base = $path ? '/' . $path : null;
$this->baseRoute = [];
}
return $this->base;
} | [
"public",
"function",
"base",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"path",
"!==",
"null",
")",
"{",
"$",
"path",
"=",
"trim",
"(",
"$",
"path",
",",
"'/'",
")",
";",
"$",
"this",
"->",
"base",
"=",
"$",
"path",
"?",
"'/'",... | Get or set base path for the pages.
@param string $path
@return string | [
"Get",
"or",
"set",
"base",
"path",
"for",
"the",
"pages",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L123-L132 |
207,561 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.init | public function init()
{
$config = $this->grav['config'];
$this->ignore_files = $config->get('system.pages.ignore_files');
$this->ignore_folders = $config->get('system.pages.ignore_folders');
$this->ignore_hidden = $config->get('system.pages.ignore_hidden');
$this->instances... | php | public function init()
{
$config = $this->grav['config'];
$this->ignore_files = $config->get('system.pages.ignore_files');
$this->ignore_folders = $config->get('system.pages.ignore_folders');
$this->ignore_hidden = $config->get('system.pages.ignore_hidden');
$this->instances... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"grav",
"[",
"'config'",
"]",
";",
"$",
"this",
"->",
"ignore_files",
"=",
"$",
"config",
"->",
"get",
"(",
"'system.pages.ignore_files'",
")",
";",
"$",
"this",
"->",
... | Class initialization. Must be called before using this class. | [
"Class",
"initialization",
".",
"Must",
"be",
"called",
"before",
"using",
"this",
"class",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L240-L256 |
207,562 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.lastModified | public function lastModified($modified = null)
{
if ($modified && $modified > $this->last_modified) {
$this->last_modified = $modified;
}
return $this->last_modified;
} | php | public function lastModified($modified = null)
{
if ($modified && $modified > $this->last_modified) {
$this->last_modified = $modified;
}
return $this->last_modified;
} | [
"public",
"function",
"lastModified",
"(",
"$",
"modified",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"modified",
"&&",
"$",
"modified",
">",
"$",
"this",
"->",
"last_modified",
")",
"{",
"$",
"this",
"->",
"last_modified",
"=",
"$",
"modified",
";",
"}",... | Get or set last modification time.
@param int $modified
@return int|null | [
"Get",
"or",
"set",
"last",
"modification",
"time",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L265-L272 |
207,563 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.addPage | public function addPage(PageInterface $page, $route = null)
{
if (!isset($this->instances[$page->path()])) {
$this->instances[$page->path()] = $page;
}
$route = $page->route($route);
if ($page->parent()) {
$this->children[$page->parent()->path()][$page->path()... | php | public function addPage(PageInterface $page, $route = null)
{
if (!isset($this->instances[$page->path()])) {
$this->instances[$page->path()] = $page;
}
$route = $page->route($route);
if ($page->parent()) {
$this->children[$page->parent()->path()][$page->path()... | [
"public",
"function",
"addPage",
"(",
"PageInterface",
"$",
"page",
",",
"$",
"route",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"page",
"->",
"path",
"(",
")",
"]",
")",
")",
"{",
"$",
"this",... | Adds a page and assigns a route to it.
@param PageInterface $page Page to be added.
@param string $route Optional route (uses route from the object if not set). | [
"Adds",
"a",
"page",
"and",
"assigns",
"a",
"route",
"to",
"it",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L300-L312 |
207,564 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.sort | public function sort(PageInterface $page, $order_by = null, $order_dir = null, $sort_flags = null)
{
if ($order_by === null) {
$order_by = $page->orderBy();
}
if ($order_dir === null) {
$order_dir = $page->orderDir();
}
$path = $page->path();
... | php | public function sort(PageInterface $page, $order_by = null, $order_dir = null, $sort_flags = null)
{
if ($order_by === null) {
$order_by = $page->orderBy();
}
if ($order_dir === null) {
$order_dir = $page->orderDir();
}
$path = $page->path();
... | [
"public",
"function",
"sort",
"(",
"PageInterface",
"$",
"page",
",",
"$",
"order_by",
"=",
"null",
",",
"$",
"order_dir",
"=",
"null",
",",
"$",
"sort_flags",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"order_by",
"===",
"null",
")",
"{",
"$",
"order_by... | Sort sub-pages in a page.
@param PageInterface $page
@param string $order_by
@param string $order_dir
@return array | [
"Sort",
"sub",
"-",
"pages",
"in",
"a",
"page",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L323-L350 |
207,565 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.children | public function children($path)
{
$children = $this->children[(string)$path] ?? [];
return new Collection($children, [], $this);
} | php | public function children($path)
{
$children = $this->children[(string)$path] ?? [];
return new Collection($children, [], $this);
} | [
"public",
"function",
"children",
"(",
"$",
"path",
")",
"{",
"$",
"children",
"=",
"$",
"this",
"->",
"children",
"[",
"(",
"string",
")",
"$",
"path",
"]",
"??",
"[",
"]",
";",
"return",
"new",
"Collection",
"(",
"$",
"children",
",",
"[",
"]",
... | Get children of the path.
@param string $path
@return Collection | [
"Get",
"children",
"of",
"the",
"path",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L404-L409 |
207,566 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.ancestor | public function ancestor($route, $path = null)
{
if ($path !== null) {
$page = $this->dispatch($route, true);
if ($page && $page->path() === $path) {
return $page;
}
$parent = $page ? $page->parent() : null;
if ($parent && !$paren... | php | public function ancestor($route, $path = null)
{
if ($path !== null) {
$page = $this->dispatch($route, true);
if ($page && $page->path() === $path) {
return $page;
}
$parent = $page ? $page->parent() : null;
if ($parent && !$paren... | [
"public",
"function",
"ancestor",
"(",
"$",
"route",
",",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"path",
"!==",
"null",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"dispatch",
"(",
"$",
"route",
",",
"true",
")",
";",
"if",
"(",... | Get a page ancestor.
@param string $route The relative URL of the page
@param string $path The relative path of the ancestor folder
@return PageInterface|null | [
"Get",
"a",
"page",
"ancestor",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L419-L435 |
207,567 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.inherited | public function inherited($route, $field = null)
{
if ($field !== null) {
$page = $this->dispatch($route, true);
$parent = $page ? $page->parent() : null;
if ($parent && $parent->value('header.' . $field) !== null) {
return $parent;
}
... | php | public function inherited($route, $field = null)
{
if ($field !== null) {
$page = $this->dispatch($route, true);
$parent = $page ? $page->parent() : null;
if ($parent && $parent->value('header.' . $field) !== null) {
return $parent;
}
... | [
"public",
"function",
"inherited",
"(",
"$",
"route",
",",
"$",
"field",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"field",
"!==",
"null",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"dispatch",
"(",
"$",
"route",
",",
"true",
")",
";",
"$",
"p... | Get a page ancestor trait.
@param string $route The relative route of the page
@param string $field The field name of the ancestor to query for
@return PageInterface|null | [
"Get",
"a",
"page",
"ancestor",
"trait",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L445-L461 |
207,568 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.root | public function root()
{
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];
return $this->instances[rtrim($locator->findResource('page://'), DS)];
} | php | public function root()
{
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];
return $this->instances[rtrim($locator->findResource('page://'), DS)];
} | [
"public",
"function",
"root",
"(",
")",
"{",
"/** @var UniformResourceLocator $locator */",
"$",
"locator",
"=",
"$",
"this",
"->",
"grav",
"[",
"'locator'",
"]",
";",
"return",
"$",
"this",
"->",
"instances",
"[",
"rtrim",
"(",
"$",
"locator",
"->",
"findRe... | Get root page.
@return PageInterface | [
"Get",
"root",
"page",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L567-L573 |
207,569 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.blueprints | public function blueprints($type)
{
if ($this->blueprints === null) {
$this->blueprints = new Blueprints(self::getTypes());
}
try {
$blueprint = $this->blueprints->get($type);
} catch (\RuntimeException $e) {
$blueprint = $this->blueprints->get('d... | php | public function blueprints($type)
{
if ($this->blueprints === null) {
$this->blueprints = new Blueprints(self::getTypes());
}
try {
$blueprint = $this->blueprints->get($type);
} catch (\RuntimeException $e) {
$blueprint = $this->blueprints->get('d... | [
"public",
"function",
"blueprints",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"blueprints",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"blueprints",
"=",
"new",
"Blueprints",
"(",
"self",
"::",
"getTypes",
"(",
")",
")",
";",
"}",
... | Get a blueprint for a page type.
@param string $type
@return Blueprint | [
"Get",
"a",
"blueprint",
"for",
"a",
"page",
"type",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L582-L600 |
207,570 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.all | public function all(PageInterface $current = null)
{
$all = new Collection();
/** @var PageInterface $current */
$current = $current ?: $this->root();
if (!$current->root()) {
$all[$current->path()] = ['slug' => $current->slug()];
}
foreach ($current->c... | php | public function all(PageInterface $current = null)
{
$all = new Collection();
/** @var PageInterface $current */
$current = $current ?: $this->root();
if (!$current->root()) {
$all[$current->path()] = ['slug' => $current->slug()];
}
foreach ($current->c... | [
"public",
"function",
"all",
"(",
"PageInterface",
"$",
"current",
"=",
"null",
")",
"{",
"$",
"all",
"=",
"new",
"Collection",
"(",
")",
";",
"/** @var PageInterface $current */",
"$",
"current",
"=",
"$",
"current",
"?",
":",
"$",
"this",
"->",
"root",
... | Get all pages
@param PageInterface $current
@return \Grav\Common\Page\Collection | [
"Get",
"all",
"pages"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L609-L625 |
207,571 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.getParents | private static function getParents($rawRoutes)
{
$grav = Grav::instance();
/** @var Pages $pages */
$pages = $grav['pages'];
$parents = $pages->getList(null, 0, $rawRoutes);
if (isset($grav['admin'])) {
// Remove current route from parents
/** @var... | php | private static function getParents($rawRoutes)
{
$grav = Grav::instance();
/** @var Pages $pages */
$pages = $grav['pages'];
$parents = $pages->getList(null, 0, $rawRoutes);
if (isset($grav['admin'])) {
// Remove current route from parents
/** @var... | [
"private",
"static",
"function",
"getParents",
"(",
"$",
"rawRoutes",
")",
"{",
"$",
"grav",
"=",
"Grav",
"::",
"instance",
"(",
")",
";",
"/** @var Pages $pages */",
"$",
"pages",
"=",
"$",
"grav",
"[",
"'pages'",
"]",
";",
"$",
"parents",
"=",
"$",
"... | Get available parents routes
@param bool $rawRoutes get the raw route or the normal route
@return array | [
"Get",
"available",
"parents",
"routes"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L646-L670 |
207,572 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.getTypes | public static function getTypes()
{
if (!self::$types) {
$grav = Grav::instance();
$scanBlueprintsAndTemplates = function () use ($grav) {
// Scan blueprints
$event = new Event();
$event->types = self::$types;
$grav->fi... | php | public static function getTypes()
{
if (!self::$types) {
$grav = Grav::instance();
$scanBlueprintsAndTemplates = function () use ($grav) {
// Scan blueprints
$event = new Event();
$event->types = self::$types;
$grav->fi... | [
"public",
"static",
"function",
"getTypes",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"types",
")",
"{",
"$",
"grav",
"=",
"Grav",
"::",
"instance",
"(",
")",
";",
"$",
"scanBlueprintsAndTemplates",
"=",
"function",
"(",
")",
"use",
"(",
"$",... | Get available page types.
@return Types | [
"Get",
"available",
"page",
"types",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L735-L790 |
207,573 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.accessLevels | public function accessLevels()
{
$accessLevels = [];
foreach ($this->all() as $page) {
if (isset($page->header()->access)) {
if (\is_array($page->header()->access)) {
foreach ($page->header()->access as $index => $accessLevel) {
... | php | public function accessLevels()
{
$accessLevels = [];
foreach ($this->all() as $page) {
if (isset($page->header()->access)) {
if (\is_array($page->header()->access)) {
foreach ($page->header()->access as $index => $accessLevel) {
... | [
"public",
"function",
"accessLevels",
"(",
")",
"{",
"$",
"accessLevels",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"all",
"(",
")",
"as",
"$",
"page",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"page",
"->",
"header",
"(",
")",
"->",
... | Get access levels of the site pages
@return array | [
"Get",
"access",
"levels",
"of",
"the",
"site",
"pages"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L845-L867 |
207,574 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.getHomeRoute | public static function getHomeRoute()
{
if (empty(self::$home_route)) {
$grav = Grav::instance();
/** @var Config $config */
$config = $grav['config'];
/** @var Language $language */
$language = $grav['language'];
$home = $config->ge... | php | public static function getHomeRoute()
{
if (empty(self::$home_route)) {
$grav = Grav::instance();
/** @var Config $config */
$config = $grav['config'];
/** @var Language $language */
$language = $grav['language'];
$home = $config->ge... | [
"public",
"static",
"function",
"getHomeRoute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"home_route",
")",
")",
"{",
"$",
"grav",
"=",
"Grav",
"::",
"instance",
"(",
")",
";",
"/** @var Config $config */",
"$",
"config",
"=",
"$",
"g... | Gets the home route
@return string | [
"Gets",
"the",
"home",
"route"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L888-L924 |
207,575 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.buildPages | protected function buildPages()
{
$this->sort = [];
/** @var Config $config */
$config = $this->grav['config'];
/** @var Language $language */
$language = $this->grav['language'];
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator']... | php | protected function buildPages()
{
$this->sort = [];
/** @var Config $config */
$config = $this->grav['config'];
/** @var Language $language */
$language = $this->grav['language'];
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator']... | [
"protected",
"function",
"buildPages",
"(",
")",
"{",
"$",
"this",
"->",
"sort",
"=",
"[",
"]",
";",
"/** @var Config $config */",
"$",
"config",
"=",
"$",
"this",
"->",
"grav",
"[",
"'config'",
"]",
";",
"/** @var Language $language */",
"$",
"language",
"=... | Builds pages.
@internal | [
"Builds",
"pages",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L940-L995 |
207,576 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.resetPages | public function resetPages($pages_dir)
{
$this->recurse($pages_dir);
$this->buildRoutes();
// cache if needed
if ($this->grav['config']->get('system.cache.enabled')) {
/** @var Cache $cache */
$cache = $this->grav['cache'];
/** @var Taxonomy $taxo... | php | public function resetPages($pages_dir)
{
$this->recurse($pages_dir);
$this->buildRoutes();
// cache if needed
if ($this->grav['config']->get('system.cache.enabled')) {
/** @var Cache $cache */
$cache = $this->grav['cache'];
/** @var Taxonomy $taxo... | [
"public",
"function",
"resetPages",
"(",
"$",
"pages_dir",
")",
"{",
"$",
"this",
"->",
"recurse",
"(",
"$",
"pages_dir",
")",
";",
"$",
"this",
"->",
"buildRoutes",
"(",
")",
";",
"// cache if needed",
"if",
"(",
"$",
"this",
"->",
"grav",
"[",
"'conf... | Accessible method to manually reset the pages cache
@param string $pages_dir | [
"Accessible",
"method",
"to",
"manually",
"reset",
"the",
"pages",
"cache"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L1002-L1017 |
207,577 | getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.arrayShuffle | protected function arrayShuffle($list)
{
$keys = array_keys($list);
shuffle($keys);
$new = [];
foreach ($keys as $key) {
$new[$key] = $list[$key];
}
return $new;
} | php | protected function arrayShuffle($list)
{
$keys = array_keys($list);
shuffle($keys);
$new = [];
foreach ($keys as $key) {
$new[$key] = $list[$key];
}
return $new;
} | [
"protected",
"function",
"arrayShuffle",
"(",
"$",
"list",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"list",
")",
";",
"shuffle",
"(",
"$",
"keys",
")",
";",
"$",
"new",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",... | Shuffles an associative array
@param array $list
@return array | [
"Shuffles",
"an",
"associative",
"array"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L1392-L1403 |
207,578 | getgrav/grav | system/src/Grav/Common/User/DataUser/UserCollection.php | UserCollection.delete | public function delete($username): bool
{
$file_path = Grav::instance()['locator']->findResource('account://' . $username . YAML_EXT);
return $file_path && unlink($file_path);
} | php | public function delete($username): bool
{
$file_path = Grav::instance()['locator']->findResource('account://' . $username . YAML_EXT);
return $file_path && unlink($file_path);
} | [
"public",
"function",
"delete",
"(",
"$",
"username",
")",
":",
"bool",
"{",
"$",
"file_path",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'locator'",
"]",
"->",
"findResource",
"(",
"'account://'",
".",
"$",
"username",
".",
"YAML_EXT",
")",
";",
"... | Remove user account.
@param string $username
@return bool True if the action was performed | [
"Remove",
"user",
"account",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/User/DataUser/UserCollection.php#L115-L120 |
207,579 | getgrav/grav | system/src/Grav/Common/Page/Medium/AudioMedium.php | AudioMedium.controls | public function controls($display = true)
{
if($display) {
$this->attributes['controls'] = true;
} else {
unset($this->attributes['controls']);
}
return $this;
} | php | public function controls($display = true)
{
if($display) {
$this->attributes['controls'] = true;
} else {
unset($this->attributes['controls']);
}
return $this;
} | [
"public",
"function",
"controls",
"(",
"$",
"display",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"display",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'controls'",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
"attrib... | Allows to set or remove the HTML5 default controls
@param bool $display
@return $this | [
"Allows",
"to",
"set",
"or",
"remove",
"the",
"HTML5",
"default",
"controls"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/AudioMedium.php#L40-L49 |
207,580 | getgrav/grav | system/src/Grav/Common/Page/Medium/AudioMedium.php | AudioMedium.preload | public function preload($preload)
{
$validPreloadAttrs = ['auto', 'metadata', 'none'];
if (\in_array($preload, $validPreloadAttrs, true)) {
$this->attributes['preload'] = $preload;
}
return $this;
} | php | public function preload($preload)
{
$validPreloadAttrs = ['auto', 'metadata', 'none'];
if (\in_array($preload, $validPreloadAttrs, true)) {
$this->attributes['preload'] = $preload;
}
return $this;
} | [
"public",
"function",
"preload",
"(",
"$",
"preload",
")",
"{",
"$",
"validPreloadAttrs",
"=",
"[",
"'auto'",
",",
"'metadata'",
",",
"'none'",
"]",
";",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"preload",
",",
"$",
"validPreloadAttrs",
",",
"true",
")",
... | Allows to set the preload behaviour
@param string $preload
@return $this | [
"Allows",
"to",
"set",
"the",
"preload",
"behaviour"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/AudioMedium.php#L57-L66 |
207,581 | getgrav/grav | system/src/Grav/Common/Page/Medium/AudioMedium.php | AudioMedium.muted | public function muted($status = false)
{
if($status) {
$this->attributes['muted'] = true;
} else {
unset($this->attributes['muted']);
}
return $this;
} | php | public function muted($status = false)
{
if($status) {
$this->attributes['muted'] = true;
} else {
unset($this->attributes['muted']);
}
return $this;
} | [
"public",
"function",
"muted",
"(",
"$",
"status",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"status",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'muted'",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
"attributes",
... | Allows to set the muted attribute
@param bool $status
@return $this | [
"Allows",
"to",
"set",
"the",
"muted",
"attribute"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/AudioMedium.php#L89-L98 |
207,582 | getgrav/grav | system/src/Grav/Common/Page/Medium/AudioMedium.php | AudioMedium.loop | public function loop($status = false)
{
if($status) {
$this->attributes['loop'] = true;
} else {
unset($this->attributes['loop']);
}
return $this;
} | php | public function loop($status = false)
{
if($status) {
$this->attributes['loop'] = true;
} else {
unset($this->attributes['loop']);
}
return $this;
} | [
"public",
"function",
"loop",
"(",
"$",
"status",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"status",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'loop'",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
"attributes",
... | Allows to set the loop attribute
@param bool $status
@return $this | [
"Allows",
"to",
"set",
"the",
"loop",
"attribute"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/AudioMedium.php#L106-L115 |
207,583 | getgrav/grav | system/src/Grav/Common/Page/Medium/AudioMedium.php | AudioMedium.autoplay | public function autoplay($status = false)
{
if($status) {
$this->attributes['autoplay'] = true;
} else {
unset($this->attributes['autoplay']);
}
return $this;
} | php | public function autoplay($status = false)
{
if($status) {
$this->attributes['autoplay'] = true;
} else {
unset($this->attributes['autoplay']);
}
return $this;
} | [
"public",
"function",
"autoplay",
"(",
"$",
"status",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"status",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'autoplay'",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
"attribu... | Allows to set the autoplay attribute
@param bool $status
@return $this | [
"Allows",
"to",
"set",
"the",
"autoplay",
"attribute"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/AudioMedium.php#L123-L132 |
207,584 | getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.lastModifiedFolder | public static function lastModifiedFolder($path)
{
$last_modified = 0;
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$flags = \RecursiveDirectoryIterator::SKIP_DOTS;
if ($locator->isStream($path)) {
$directory = $locator->get... | php | public static function lastModifiedFolder($path)
{
$last_modified = 0;
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$flags = \RecursiveDirectoryIterator::SKIP_DOTS;
if ($locator->isStream($path)) {
$directory = $locator->get... | [
"public",
"static",
"function",
"lastModifiedFolder",
"(",
"$",
"path",
")",
"{",
"$",
"last_modified",
"=",
"0",
";",
"/** @var UniformResourceLocator $locator */",
"$",
"locator",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'locator'",
"]",
";",
"$",
"fla... | Recursively find the last modified time under given path.
@param string $path
@return int | [
"Recursively",
"find",
"the",
"last",
"modified",
"time",
"under",
"given",
"path",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L23-L47 |
207,585 | getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.lastModifiedFile | public static function lastModifiedFile($path, $extensions = 'md|yaml')
{
$last_modified = 0;
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$flags = \RecursiveDirectoryIterator::SKIP_DOTS;
if ($locator->isStream($path)) {
$di... | php | public static function lastModifiedFile($path, $extensions = 'md|yaml')
{
$last_modified = 0;
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$flags = \RecursiveDirectoryIterator::SKIP_DOTS;
if ($locator->isStream($path)) {
$di... | [
"public",
"static",
"function",
"lastModifiedFile",
"(",
"$",
"path",
",",
"$",
"extensions",
"=",
"'md|yaml'",
")",
"{",
"$",
"last_modified",
"=",
"0",
";",
"/** @var UniformResourceLocator $locator */",
"$",
"locator",
"=",
"Grav",
"::",
"instance",
"(",
")",... | Recursively find the last modified time under given path by file.
@param string $path
@param string $extensions which files to search for specifically
@return int | [
"Recursively",
"find",
"the",
"last",
"modified",
"time",
"under",
"given",
"path",
"by",
"file",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L57-L85 |
207,586 | getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.hashAllFiles | public static function hashAllFiles($path)
{
$flags = \RecursiveDirectoryIterator::SKIP_DOTS;
$files = [];
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
if ($locator->isStream($path)) {
$directory = $locator->getRecursiveIter... | php | public static function hashAllFiles($path)
{
$flags = \RecursiveDirectoryIterator::SKIP_DOTS;
$files = [];
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
if ($locator->isStream($path)) {
$directory = $locator->getRecursiveIter... | [
"public",
"static",
"function",
"hashAllFiles",
"(",
"$",
"path",
")",
"{",
"$",
"flags",
"=",
"\\",
"RecursiveDirectoryIterator",
"::",
"SKIP_DOTS",
";",
"$",
"files",
"=",
"[",
"]",
";",
"/** @var UniformResourceLocator $locator */",
"$",
"locator",
"=",
"Grav... | Recursively md5 hash all files in a path
@param string $path
@return string | [
"Recursively",
"md5",
"hash",
"all",
"files",
"in",
"a",
"path"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L93-L113 |
207,587 | getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.shift | public static function shift(&$path)
{
$parts = explode('/', trim($path, '/'), 2);
$result = array_shift($parts);
$path = array_shift($parts);
return $result ?: null;
} | php | public static function shift(&$path)
{
$parts = explode('/', trim($path, '/'), 2);
$result = array_shift($parts);
$path = array_shift($parts);
return $result ?: null;
} | [
"public",
"static",
"function",
"shift",
"(",
"&",
"$",
"path",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"trim",
"(",
"$",
"path",
",",
"'/'",
")",
",",
"2",
")",
";",
"$",
"result",
"=",
"array_shift",
"(",
"$",
"parts",
")",
"... | Shift first directory out of the path.
@param string $path
@return string | [
"Shift",
"first",
"directory",
"out",
"of",
"the",
"path",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L180-L187 |
207,588 | getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.copy | public static function copy($source, $target, $ignore = null)
{
$source = rtrim($source, '\\/');
$target = rtrim($target, '\\/');
if (!is_dir($source)) {
throw new \RuntimeException('Cannot copy non-existing folder.');
}
// Make sure that path to the target exis... | php | public static function copy($source, $target, $ignore = null)
{
$source = rtrim($source, '\\/');
$target = rtrim($target, '\\/');
if (!is_dir($source)) {
throw new \RuntimeException('Cannot copy non-existing folder.');
}
// Make sure that path to the target exis... | [
"public",
"static",
"function",
"copy",
"(",
"$",
"source",
",",
"$",
"target",
",",
"$",
"ignore",
"=",
"null",
")",
"{",
"$",
"source",
"=",
"rtrim",
"(",
"$",
"source",
",",
"'\\\\/'",
")",
";",
"$",
"target",
"=",
"rtrim",
"(",
"$",
"target",
... | Recursively copy directory in filesystem.
@param string $source
@param string $target
@param string $ignore Ignore files matching pattern (regular expression).
@throws \RuntimeException | [
"Recursively",
"copy",
"directory",
"in",
"filesystem",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L285-L326 |
207,589 | getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.move | public static function move($source, $target)
{
if (!file_exists($source) || !is_dir($source)) {
// Rename fails if source folder does not exist.
throw new \RuntimeException('Cannot move non-existing folder.');
}
// Don't do anything if the source is the same as the ... | php | public static function move($source, $target)
{
if (!file_exists($source) || !is_dir($source)) {
// Rename fails if source folder does not exist.
throw new \RuntimeException('Cannot move non-existing folder.');
}
// Don't do anything if the source is the same as the ... | [
"public",
"static",
"function",
"move",
"(",
"$",
"source",
",",
"$",
"target",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"source",
")",
"||",
"!",
"is_dir",
"(",
"$",
"source",
")",
")",
"{",
"// Rename fails if source folder does not exist.",
"t... | Move directory in filesystem.
@param string $source
@param string $target
@throws \RuntimeException | [
"Move",
"directory",
"in",
"filesystem",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L335-L373 |
207,590 | getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.delete | public static function delete($target, $include_target = true)
{
if (!is_dir($target)) {
return false;
}
$success = self::doDelete($target, $include_target);
if (!$success) {
$error = error_get_last();
throw new \RuntimeException($error['message'... | php | public static function delete($target, $include_target = true)
{
if (!is_dir($target)) {
return false;
}
$success = self::doDelete($target, $include_target);
if (!$success) {
$error = error_get_last();
throw new \RuntimeException($error['message'... | [
"public",
"static",
"function",
"delete",
"(",
"$",
"target",
",",
"$",
"include_target",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"target",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"success",
"=",
"self",
"::",
"doDelete",
... | Recursively delete directory from filesystem.
@param string $target
@param bool $include_target
@return bool
@throws \RuntimeException | [
"Recursively",
"delete",
"directory",
"from",
"filesystem",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L383-L404 |
207,591 | getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.rcopy | public static function rcopy($src, $dest)
{
// If the src is not a directory do a simple file copy
if (!is_dir($src)) {
copy($src, $dest);
return true;
}
// If the destination directory does not exist create it
if (!is_dir($dest)) {
stati... | php | public static function rcopy($src, $dest)
{
// If the src is not a directory do a simple file copy
if (!is_dir($src)) {
copy($src, $dest);
return true;
}
// If the destination directory does not exist create it
if (!is_dir($dest)) {
stati... | [
"public",
"static",
"function",
"rcopy",
"(",
"$",
"src",
",",
"$",
"dest",
")",
"{",
"// If the src is not a directory do a simple file copy",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"src",
")",
")",
"{",
"copy",
"(",
"$",
"src",
",",
"$",
"dest",
")",
";",... | Recursive copy of one directory to another
@param string $src
@param string $dest
@return bool
@throws \RuntimeException | [
"Recursive",
"copy",
"of",
"one",
"directory",
"to",
"another"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L446-L473 |
207,592 | getgrav/grav | system/src/Grav/Common/GPM/Response.php | Response.setMethod | public static function setMethod($method = 'auto')
{
if (!\in_array($method, ['auto', 'curl', 'fopen'], true)) {
$method = 'auto';
}
self::$method = $method;
return new self();
} | php | public static function setMethod($method = 'auto')
{
if (!\in_array($method, ['auto', 'curl', 'fopen'], true)) {
$method = 'auto';
}
self::$method = $method;
return new self();
} | [
"public",
"static",
"function",
"setMethod",
"(",
"$",
"method",
"=",
"'auto'",
")",
"{",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"method",
",",
"[",
"'auto'",
",",
"'curl'",
",",
"'fopen'",
"]",
",",
"true",
")",
")",
"{",
"$",
"method",
"=",
... | Sets the preferred method to use for making HTTP calls.
@param string $method Default is `auto`
@return Response | [
"Sets",
"the",
"preferred",
"method",
"to",
"use",
"for",
"making",
"HTTP",
"calls",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Response.php#L79-L88 |
207,593 | getgrav/grav | system/src/Grav/Common/GPM/Response.php | Response.progress | public static function progress()
{
static $filesize = null;
$args = func_get_args();
$isCurlResource = is_resource($args[0]) && get_resource_type($args[0]) === 'curl';
$notification_code = !$isCurlResource ? $args[0] : false;
$bytes_transferred = $isCurlResource ... | php | public static function progress()
{
static $filesize = null;
$args = func_get_args();
$isCurlResource = is_resource($args[0]) && get_resource_type($args[0]) === 'curl';
$notification_code = !$isCurlResource ? $args[0] : false;
$bytes_transferred = $isCurlResource ... | [
"public",
"static",
"function",
"progress",
"(",
")",
"{",
"static",
"$",
"filesize",
"=",
"null",
";",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"isCurlResource",
"=",
"is_resource",
"(",
"$",
"args",
"[",
"0",
"]",
")",
"&&",
"get_resour... | Progress normalized for cURL and Fopen
Accepts a variable length of arguments passed in by stream method | [
"Progress",
"normalized",
"for",
"cURL",
"and",
"Fopen",
"Accepts",
"a",
"variable",
"length",
"of",
"arguments",
"passed",
"in",
"by",
"stream",
"method"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Response.php#L218-L249 |
207,594 | getgrav/grav | system/src/Grav/Common/GPM/Response.php | Response.getAuto | private static function getAuto()
{
if (!ini_get('open_basedir') && self::isFopenAvailable()) {
return self::getFopen(func_get_args());
}
if (self::isCurlAvailable()) {
return self::getCurl(func_get_args());
}
return null;
} | php | private static function getAuto()
{
if (!ini_get('open_basedir') && self::isFopenAvailable()) {
return self::getFopen(func_get_args());
}
if (self::isCurlAvailable()) {
return self::getCurl(func_get_args());
}
return null;
} | [
"private",
"static",
"function",
"getAuto",
"(",
")",
"{",
"if",
"(",
"!",
"ini_get",
"(",
"'open_basedir'",
")",
"&&",
"self",
"::",
"isFopenAvailable",
"(",
")",
")",
"{",
"return",
"self",
"::",
"getFopen",
"(",
"func_get_args",
"(",
")",
")",
";",
... | Automatically picks the preferred method
@return string The response of the request | [
"Automatically",
"picks",
"the",
"preferred",
"method"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Response.php#L256-L267 |
207,595 | getgrav/grav | system/src/Grav/Common/GPM/Response.php | Response.getFopen | private static function getFopen()
{
if (\count($args = func_get_args()) === 1) {
$args = $args[0];
}
$uri = $args[0];
$options = $args[1] ?? [];
$callback = $args[2] ?? null;
if ($callback) {
$options['fopen']['notification'] = ['self'... | php | private static function getFopen()
{
if (\count($args = func_get_args()) === 1) {
$args = $args[0];
}
$uri = $args[0];
$options = $args[1] ?? [];
$callback = $args[2] ?? null;
if ($callback) {
$options['fopen']['notification'] = ['self'... | [
"private",
"static",
"function",
"getFopen",
"(",
")",
"{",
"if",
"(",
"\\",
"count",
"(",
"$",
"args",
"=",
"func_get_args",
"(",
")",
")",
"===",
"1",
")",
"{",
"$",
"args",
"=",
"$",
"args",
"[",
"0",
"]",
";",
"}",
"$",
"uri",
"=",
"$",
"... | Starts a HTTP request via fopen
@return string The response of the request | [
"Starts",
"a",
"HTTP",
"request",
"via",
"fopen"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Response.php#L274-L321 |
207,596 | getgrav/grav | system/src/Grav/Common/GPM/Response.php | Response.getCurl | private static function getCurl()
{
$args = func_get_args();
$args = count($args) > 1 ? $args : array_shift($args);
$uri = $args[0];
$options = $args[1] ?? [];
$callback = $args[2] ?? null;
$ch = curl_init($uri);
$response = static::curlExecFollow($ch... | php | private static function getCurl()
{
$args = func_get_args();
$args = count($args) > 1 ? $args : array_shift($args);
$uri = $args[0];
$options = $args[1] ?? [];
$callback = $args[2] ?? null;
$ch = curl_init($uri);
$response = static::curlExecFollow($ch... | [
"private",
"static",
"function",
"getCurl",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"args",
"=",
"count",
"(",
"$",
"args",
")",
">",
"1",
"?",
"$",
"args",
":",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"uri",... | Starts a HTTP request via cURL
@return string The response of the request | [
"Starts",
"a",
"HTTP",
"request",
"via",
"cURL"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Response.php#L328-L359 |
207,597 | getgrav/grav | system/src/Grav/Framework/Route/Route.php | Route.getParam | public function getParam($param)
{
$value = $this->getGravParam($param);
if ($value === null) {
$value = $this->getQueryParam($param);
}
return $value;
} | php | public function getParam($param)
{
$value = $this->getGravParam($param);
if ($value === null) {
$value = $this->getQueryParam($param);
}
return $value;
} | [
"public",
"function",
"getParam",
"(",
"$",
"param",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getGravParam",
"(",
"$",
"param",
")",
";",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getQueryParam... | Return value of the parameter, looking into both Grav parameters and query parameters.
If the parameter exists in both, return Grav parameter.
@param string $param
@return string|null | [
"Return",
"value",
"of",
"the",
"parameter",
"looking",
"into",
"both",
"Grav",
"parameters",
"and",
"query",
"parameters",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Route/Route.php#L159-L167 |
207,598 | getgrav/grav | system/src/Grav/Common/Config/Setup.php | Setup.initializeLocator | public function initializeLocator(UniformResourceLocator $locator)
{
$locator->reset();
$schemes = (array) $this->get('streams.schemes', []);
foreach ($schemes as $scheme => $config) {
if (isset($config['paths'])) {
$locator->addPath($scheme, '', $config['paths'... | php | public function initializeLocator(UniformResourceLocator $locator)
{
$locator->reset();
$schemes = (array) $this->get('streams.schemes', []);
foreach ($schemes as $scheme => $config) {
if (isset($config['paths'])) {
$locator->addPath($scheme, '', $config['paths'... | [
"public",
"function",
"initializeLocator",
"(",
"UniformResourceLocator",
"$",
"locator",
")",
"{",
"$",
"locator",
"->",
"reset",
"(",
")",
";",
"$",
"schemes",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"get",
"(",
"'streams.schemes'",
",",
"[",
"]",
"... | Initialize resource locator by using the configuration.
@param UniformResourceLocator $locator
@throws \BadMethodCallException | [
"Initialize",
"resource",
"locator",
"by",
"using",
"the",
"configuration",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Config/Setup.php#L238-L258 |
207,599 | getgrav/grav | system/src/Grav/Common/Config/Setup.php | Setup.getStreams | public function getStreams()
{
$schemes = [];
foreach ((array) $this->get('streams.schemes') as $scheme => $config) {
$type = $config['type'] ?? 'ReadOnlyStream';
if ($type[0] !== '\\') {
$type = '\\RocketTheme\\Toolbox\\StreamWrapper\\' . $type;
}... | php | public function getStreams()
{
$schemes = [];
foreach ((array) $this->get('streams.schemes') as $scheme => $config) {
$type = $config['type'] ?? 'ReadOnlyStream';
if ($type[0] !== '\\') {
$type = '\\RocketTheme\\Toolbox\\StreamWrapper\\' . $type;
}... | [
"public",
"function",
"getStreams",
"(",
")",
"{",
"$",
"schemes",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"get",
"(",
"'streams.schemes'",
")",
"as",
"$",
"scheme",
"=>",
"$",
"config",
")",
"{",
"$",
"type",
"=",... | Get available streams and their types from the configuration.
@return array | [
"Get",
"available",
"streams",
"and",
"their",
"types",
"from",
"the",
"configuration",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Config/Setup.php#L265-L278 |
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.