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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
208,500 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.update_onDelete | public function update_onDelete($recordId = null)
{
$this->context = $this->getConfig('update[context]', self::CONTEXT_UPDATE);
$model = $this->controller->formFindModelObject($recordId);
$this->initForm($model);
$model->delete();
$this->controller->formAfterDelete($model);... | php | public function update_onDelete($recordId = null)
{
$this->context = $this->getConfig('update[context]', self::CONTEXT_UPDATE);
$model = $this->controller->formFindModelObject($recordId);
$this->initForm($model);
$model->delete();
$this->controller->formAfterDelete($model);... | [
"public",
"function",
"update_onDelete",
"(",
"$",
"recordId",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"context",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'update[context]'",
",",
"self",
"::",
"CONTEXT_UPDATE",
")",
";",
"$",
"model",
"=",
"$",
"thi... | AJAX handler "onDelete" called from the update action and
used for deleting existing records.
This handler will invoke the unique controller override
`formAfterDelete`.
@param int $recordId Record identifier
@return mixed | [
"AJAX",
"handler",
"onDelete",
"called",
"from",
"the",
"update",
"action",
"and",
"used",
"for",
"deleting",
"existing",
"records",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L337-L352 |
208,501 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.makeRedirect | public function makeRedirect($context = null, $model = null)
{
$redirectUrl = null;
if (post('close') && !ends_with($context, '-close')) {
$context .= '-close';
}
if (post('refresh', false)) {
return Redirect::refresh();
}
if (post('redirect'... | php | public function makeRedirect($context = null, $model = null)
{
$redirectUrl = null;
if (post('close') && !ends_with($context, '-close')) {
$context .= '-close';
}
if (post('refresh', false)) {
return Redirect::refresh();
}
if (post('redirect'... | [
"public",
"function",
"makeRedirect",
"(",
"$",
"context",
"=",
"null",
",",
"$",
"model",
"=",
"null",
")",
"{",
"$",
"redirectUrl",
"=",
"null",
";",
"if",
"(",
"post",
"(",
"'close'",
")",
"&&",
"!",
"ends_with",
"(",
"$",
"context",
",",
"'-close... | Returns a Redirect object based on supplied context and parses
the model primary key.
@param string $context Redirect context, eg: create, update, delete
@param Model $model The active model to parse in it's ID and attributes.
@return Redirect | [
"Returns",
"a",
"Redirect",
"object",
"based",
"on",
"supplied",
"context",
"and",
"parses",
"the",
"model",
"primary",
"key",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L455-L483 |
208,502 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.getRedirectUrl | protected function getRedirectUrl($context = null)
{
$redirectContext = explode('-', $context, 2)[0];
$redirectSource = ends_with($context, '-close') ? 'redirectClose' : 'redirect';
// Get the redirect for the provided context
$redirects = [$context => $this->getConfig("{$redirectCo... | php | protected function getRedirectUrl($context = null)
{
$redirectContext = explode('-', $context, 2)[0];
$redirectSource = ends_with($context, '-close') ? 'redirectClose' : 'redirect';
// Get the redirect for the provided context
$redirects = [$context => $this->getConfig("{$redirectCo... | [
"protected",
"function",
"getRedirectUrl",
"(",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"redirectContext",
"=",
"explode",
"(",
"'-'",
",",
"$",
"context",
",",
"2",
")",
"[",
"0",
"]",
";",
"$",
"redirectSource",
"=",
"ends_with",
"(",
"$",
"conte... | Internal method that returns a redirect URL from the config based on
supplied context. Otherwise the default redirect is used.
@param string $context Redirect context, eg: create, update, delete.
@return string | [
"Internal",
"method",
"that",
"returns",
"a",
"redirect",
"URL",
"from",
"the",
"config",
"based",
"on",
"supplied",
"context",
".",
"Otherwise",
"the",
"default",
"redirect",
"is",
"used",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L492-L509 |
208,503 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.getLang | protected function getLang($name, $default = null, $extras = [])
{
$name = $this->getConfig($name, $default);
$vars = [
'name' => Lang::get($this->getConfig('name', 'backend::lang.model.name'))
];
$vars = array_merge($vars, $extras);
return Lang::get($name, $vars)... | php | protected function getLang($name, $default = null, $extras = [])
{
$name = $this->getConfig($name, $default);
$vars = [
'name' => Lang::get($this->getConfig('name', 'backend::lang.model.name'))
];
$vars = array_merge($vars, $extras);
return Lang::get($name, $vars)... | [
"protected",
"function",
"getLang",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
",",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"$",
"name",
",",
"$",
"default",
")",
";",
"$",
"vars",
... | Parses in some default variables to a language string defined in config.
@param string $name Configuration property containing the language string
@param string $default A default language string to use if the config is not found
@param array $extras Any extra params to include in the language string variables
@return... | [
"Parses",
"in",
"some",
"default",
"variables",
"to",
"a",
"language",
"string",
"defined",
"in",
"config",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L519-L527 |
208,504 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.formFindModelObject | public function formFindModelObject($recordId)
{
if (!strlen($recordId)) {
throw new ApplicationException($this->getLang('not-found-message', 'backend::lang.form.missing_id'));
}
$model = $this->controller->formCreateModelObject();
/*
* Prepare query and find m... | php | public function formFindModelObject($recordId)
{
if (!strlen($recordId)) {
throw new ApplicationException($this->getLang('not-found-message', 'backend::lang.form.missing_id'));
}
$model = $this->controller->formCreateModelObject();
/*
* Prepare query and find m... | [
"public",
"function",
"formFindModelObject",
"(",
"$",
"recordId",
")",
"{",
"if",
"(",
"!",
"strlen",
"(",
"$",
"recordId",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"$",
"this",
"->",
"getLang",
"(",
"'not-found-message'",
",",
"'backend:... | Finds a Model record by its primary identifier, used by update actions. This logic
can be changed by overriding it in the controller.
@param string $recordId
@return Model | [
"Finds",
"a",
"Model",
"record",
"by",
"its",
"primary",
"identifier",
"used",
"by",
"update",
"actions",
".",
"This",
"logic",
"can",
"be",
"changed",
"by",
"overriding",
"it",
"in",
"the",
"controller",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L747-L771 |
208,505 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.extendFormFields | public static function extendFormFields($callback)
{
$calledClass = self::getCalledExtensionClass();
Event::listen('backend.form.extendFields', function ($widget) use ($calledClass, $callback) {
if (!is_a($widget->getController(), $calledClass)) {
return;
}
... | php | public static function extendFormFields($callback)
{
$calledClass = self::getCalledExtensionClass();
Event::listen('backend.form.extendFields', function ($widget) use ($calledClass, $callback) {
if (!is_a($widget->getController(), $calledClass)) {
return;
}
... | [
"public",
"static",
"function",
"extendFormFields",
"(",
"$",
"callback",
")",
"{",
"$",
"calledClass",
"=",
"self",
"::",
"getCalledExtensionClass",
"(",
")",
";",
"Event",
"::",
"listen",
"(",
"'backend.form.extendFields'",
",",
"function",
"(",
"$",
"widget",... | Static helper for extending form fields.
@param callable $callback
@return void | [
"Static",
"helper",
"for",
"extending",
"form",
"fields",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L857-L866 |
208,506 | octobercms/october | modules/backend/models/AccessLog.php | AccessLog.getRecent | public static function getRecent($user)
{
$records = static::where('user_id', $user->id)
->orderBy('created_at', 'desc')
->limit(2)
->get()
;
if (!count($records)) {
return null;
}
$first = $records->first();
return !... | php | public static function getRecent($user)
{
$records = static::where('user_id', $user->id)
->orderBy('created_at', 'desc')
->limit(2)
->get()
;
if (!count($records)) {
return null;
}
$first = $records->first();
return !... | [
"public",
"static",
"function",
"getRecent",
"(",
"$",
"user",
")",
"{",
"$",
"records",
"=",
"static",
"::",
"where",
"(",
"'user_id'",
",",
"$",
"user",
"->",
"id",
")",
"->",
"orderBy",
"(",
"'created_at'",
",",
"'desc'",
")",
"->",
"limit",
"(",
... | Returns a recent entry, latest entry is not considered recent
if the creation day is the same as today.
@return self | [
"Returns",
"a",
"recent",
"entry",
"latest",
"entry",
"is",
"not",
"considered",
"recent",
"if",
"the",
"creation",
"day",
"is",
"the",
"same",
"as",
"today",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/AccessLog.php#L46-L61 |
208,507 | octobercms/october | modules/cms/classes/Page.php | Page.getLayoutOptions | public function getLayoutOptions()
{
if (!($theme = Theme::getEditTheme())) {
throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
}
$layouts = Layout::listInTheme($theme, true);
$result = [];
$result[null] = Lang::get('cms::lang.page.no_l... | php | public function getLayoutOptions()
{
if (!($theme = Theme::getEditTheme())) {
throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
}
$layouts = Layout::listInTheme($theme, true);
$result = [];
$result[null] = Lang::get('cms::lang.page.no_l... | [
"public",
"function",
"getLayoutOptions",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"theme",
"=",
"Theme",
"::",
"getEditTheme",
"(",
")",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"Lang",
"::",
"get",
"(",
"'cms::lang.theme.edit.not_found'"... | Returns a list of layouts available in the theme.
This method is used by the form widget.
@return array Returns an array of strings. | [
"Returns",
"a",
"list",
"of",
"layouts",
"available",
"in",
"the",
"theme",
".",
"This",
"method",
"is",
"used",
"by",
"the",
"form",
"widget",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Page.php#L77-L98 |
208,508 | octobercms/october | modules/cms/classes/Page.php | Page.getNameList | public static function getNameList()
{
$result = [];
$pages = self::sortBy('baseFileName')->all();
foreach ($pages as $page) {
$result[$page->baseFileName] = $page->title . ' (' . $page->baseFileName . ')';
}
return $result;
} | php | public static function getNameList()
{
$result = [];
$pages = self::sortBy('baseFileName')->all();
foreach ($pages as $page) {
$result[$page->baseFileName] = $page->title . ' (' . $page->baseFileName . ')';
}
return $result;
} | [
"public",
"static",
"function",
"getNameList",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"pages",
"=",
"self",
"::",
"sortBy",
"(",
"'baseFileName'",
")",
"->",
"all",
"(",
")",
";",
"foreach",
"(",
"$",
"pages",
"as",
"$",
"page",
")"... | Helper that returns a nicer list of pages for use in dropdowns.
@return array | [
"Helper",
"that",
"returns",
"a",
"nicer",
"list",
"of",
"pages",
"for",
"use",
"in",
"dropdowns",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Page.php#L104-L113 |
208,509 | octobercms/october | modules/cms/classes/Page.php | Page.url | public static function url($page, array $params = [])
{
/*
* Reuse existing controller or create a new one,
* assuming that the method is called not during the front-end
* request processing.
*/
$controller = Controller::getController() ?: new Controller;
... | php | public static function url($page, array $params = [])
{
/*
* Reuse existing controller or create a new one,
* assuming that the method is called not during the front-end
* request processing.
*/
$controller = Controller::getController() ?: new Controller;
... | [
"public",
"static",
"function",
"url",
"(",
"$",
"page",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"/*\n * Reuse existing controller or create a new one,\n * assuming that the method is called not during the front-end\n * request processing.\n ... | Helper that makes a URL for a page in the active theme.
@param mixed $page Specifies the Cms Page file name.
@param array $params Route parameters to consider in the URL.
@return string | [
"Helper",
"that",
"makes",
"a",
"URL",
"for",
"a",
"page",
"in",
"the",
"active",
"theme",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Page.php#L121-L131 |
208,510 | octobercms/october | modules/cms/classes/Page.php | Page.getRichEditorTypeInfo | public static function getRichEditorTypeInfo(string $type)
{
$result = [];
if ($type === 'cms-page') {
$theme = Theme::getActiveTheme();
$pages = self::listInTheme($theme, true);
foreach ($pages as $page) {
$url = self::url($page->getBaseFileName... | php | public static function getRichEditorTypeInfo(string $type)
{
$result = [];
if ($type === 'cms-page') {
$theme = Theme::getActiveTheme();
$pages = self::listInTheme($theme, true);
foreach ($pages as $page) {
$url = self::url($page->getBaseFileName... | [
"public",
"static",
"function",
"getRichEditorTypeInfo",
"(",
"string",
"$",
"type",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"type",
"===",
"'cms-page'",
")",
"{",
"$",
"theme",
"=",
"Theme",
"::",
"getActiveTheme",
"(",
")",
";",
... | Handler for the backend.richeditor.getTypeInfo event.
Returns a menu item type information. The type information is returned as array
@param string $type Specifies the page link type
@return array | [
"Handler",
"for",
"the",
"backend",
".",
"richeditor",
".",
"getTypeInfo",
"event",
".",
"Returns",
"a",
"menu",
"item",
"type",
"information",
".",
"The",
"type",
"information",
"is",
"returned",
"as",
"array"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Page.php#L218-L233 |
208,511 | octobercms/october | modules/cms/helpers/File.php | File.validateExtension | public static function validateExtension($fileName, $allowedExtensions, $allowEmpty = true)
{
$extension = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
if (empty($extension)) {
return $allowEmpty;
}
return in_array($extension, $allowedExtensions);
} | php | public static function validateExtension($fileName, $allowedExtensions, $allowEmpty = true)
{
$extension = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
if (empty($extension)) {
return $allowEmpty;
}
return in_array($extension, $allowedExtensions);
} | [
"public",
"static",
"function",
"validateExtension",
"(",
"$",
"fileName",
",",
"$",
"allowedExtensions",
",",
"$",
"allowEmpty",
"=",
"true",
")",
"{",
"$",
"extension",
"=",
"strtolower",
"(",
"pathinfo",
"(",
"$",
"fileName",
",",
"PATHINFO_EXTENSION",
")",... | Validates whether a file has an allowed extension.
@param string $fileName Specifies a path to validate
@param array $allowedExtensions A list of allowed file extensions
@param boolean $allowEmpty Determines whether the file extension could be empty.
@return boolean Returns true if the file extension is valid. Otherwis... | [
"Validates",
"whether",
"a",
"file",
"has",
"an",
"allowed",
"extension",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/helpers/File.php#L30-L38 |
208,512 | octobercms/october | modules/cms/helpers/File.php | File.validatePath | public static function validatePath($filePath, $maxNesting = 2)
{
if (strpos($filePath, '..') !== false) {
return false;
}
if (strpos($filePath, './') !== false || strpos($filePath, '//') !== false) {
return false;
}
$segments = explode('/', $filePat... | php | public static function validatePath($filePath, $maxNesting = 2)
{
if (strpos($filePath, '..') !== false) {
return false;
}
if (strpos($filePath, './') !== false || strpos($filePath, '//') !== false) {
return false;
}
$segments = explode('/', $filePat... | [
"public",
"static",
"function",
"validatePath",
"(",
"$",
"filePath",
",",
"$",
"maxNesting",
"=",
"2",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"filePath",
",",
"'..'",
")",
"!==",
"false",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"strpos",... | Validates a CMS object path.
CMS object directory and file names can contain only alphanumeric symbols, dashes and dots.
CMS objects support only a single level of subdirectories.
@param string $filePath Specifies a path to validate
@param integer $maxNesting Specifies the maximum allowed nesting level
@return boolean ... | [
"Validates",
"a",
"CMS",
"object",
"path",
".",
"CMS",
"object",
"directory",
"and",
"file",
"names",
"can",
"contain",
"only",
"alphanumeric",
"symbols",
"dashes",
"and",
"dots",
".",
"CMS",
"objects",
"support",
"only",
"a",
"single",
"level",
"of",
"subdi... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/helpers/File.php#L48-L70 |
208,513 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.listNewVersions | public function listNewVersions($plugin)
{
$code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin);
if (!$this->hasVersionFile($code)) {
return [];
}
$databaseVersion = $this->getDatabaseVersion($code);
return $this->getNewFileVersion... | php | public function listNewVersions($plugin)
{
$code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin);
if (!$this->hasVersionFile($code)) {
return [];
}
$databaseVersion = $this->getDatabaseVersion($code);
return $this->getNewFileVersion... | [
"public",
"function",
"listNewVersions",
"(",
"$",
"plugin",
")",
"{",
"$",
"code",
"=",
"is_string",
"(",
"$",
"plugin",
")",
"?",
"$",
"plugin",
":",
"$",
"this",
"->",
"pluginManager",
"->",
"getIdentifier",
"(",
"$",
"plugin",
")",
";",
"if",
"(",
... | Returns a list of unapplied plugin versions. | [
"Returns",
"a",
"list",
"of",
"unapplied",
"plugin",
"versions",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L111-L121 |
208,514 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.applyPluginUpdate | protected function applyPluginUpdate($code, $version, $details)
{
if (is_array($details)) {
$comment = array_shift($details);
$scripts = $details;
}
else {
$comment = $details;
$scripts = [];
}
/*
* Apply scripts, if a... | php | protected function applyPluginUpdate($code, $version, $details)
{
if (is_array($details)) {
$comment = array_shift($details);
$scripts = $details;
}
else {
$comment = $details;
$scripts = [];
}
/*
* Apply scripts, if a... | [
"protected",
"function",
"applyPluginUpdate",
"(",
"$",
"code",
",",
"$",
"version",
",",
"$",
"details",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"details",
")",
")",
"{",
"$",
"comment",
"=",
"array_shift",
"(",
"$",
"details",
")",
";",
"$",
"sc... | Applies a single version update to a plugin. | [
"Applies",
"a",
"single",
"version",
"update",
"to",
"a",
"plugin",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L126-L158 |
208,515 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.purgePlugin | public function purgePlugin($pluginCode)
{
$versions = Db::table('system_plugin_versions')->where('code', $pluginCode);
if ($countVersions = $versions->count()) {
$versions->delete();
}
$history = Db::table('system_plugin_history')->where('code', $pluginCode);
if... | php | public function purgePlugin($pluginCode)
{
$versions = Db::table('system_plugin_versions')->where('code', $pluginCode);
if ($countVersions = $versions->count()) {
$versions->delete();
}
$history = Db::table('system_plugin_history')->where('code', $pluginCode);
if... | [
"public",
"function",
"purgePlugin",
"(",
"$",
"pluginCode",
")",
"{",
"$",
"versions",
"=",
"Db",
"::",
"table",
"(",
"'system_plugin_versions'",
")",
"->",
"where",
"(",
"'code'",
",",
"$",
"pluginCode",
")",
";",
"if",
"(",
"$",
"countVersions",
"=",
... | Deletes all records from the version and history tables for a plugin.
@param string $pluginCode Plugin code
@return void | [
"Deletes",
"all",
"records",
"from",
"the",
"version",
"and",
"history",
"tables",
"for",
"a",
"plugin",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L219-L232 |
208,516 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.getNewFileVersions | protected function getNewFileVersions($code, $version = null)
{
if ($version === null) {
$version = self::NO_VERSION_VALUE;
}
$versions = $this->getFileVersions($code);
$position = array_search($version, array_keys($versions));
return array_slice($versions, ++$po... | php | protected function getNewFileVersions($code, $version = null)
{
if ($version === null) {
$version = self::NO_VERSION_VALUE;
}
$versions = $this->getFileVersions($code);
$position = array_search($version, array_keys($versions));
return array_slice($versions, ++$po... | [
"protected",
"function",
"getNewFileVersions",
"(",
"$",
"code",
",",
"$",
"version",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"version",
"===",
"null",
")",
"{",
"$",
"version",
"=",
"self",
"::",
"NO_VERSION_VALUE",
";",
"}",
"$",
"versions",
"=",
"$",... | Returns any new versions from a supplied version, ie. unapplied versions. | [
"Returns",
"any",
"new",
"versions",
"from",
"a",
"supplied",
"version",
"ie",
".",
"unapplied",
"versions",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L254-L263 |
208,517 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.getFileVersions | protected function getFileVersions($code)
{
if ($this->fileVersions !== null && array_key_exists($code, $this->fileVersions)) {
return $this->fileVersions[$code];
}
$versionFile = $this->getVersionFile($code);
$versionInfo = Yaml::parseFile($versionFile);
if (!i... | php | protected function getFileVersions($code)
{
if ($this->fileVersions !== null && array_key_exists($code, $this->fileVersions)) {
return $this->fileVersions[$code];
}
$versionFile = $this->getVersionFile($code);
$versionInfo = Yaml::parseFile($versionFile);
if (!i... | [
"protected",
"function",
"getFileVersions",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fileVersions",
"!==",
"null",
"&&",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"this",
"->",
"fileVersions",
")",
")",
"{",
"return",
"$",
"this",... | Returns all versions of a plugin from its version file. | [
"Returns",
"all",
"versions",
"of",
"a",
"plugin",
"from",
"its",
"version",
"file",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L268-L288 |
208,518 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.getDatabaseVersion | protected function getDatabaseVersion($code)
{
if ($this->databaseVersions === null) {
$this->databaseVersions = Db::table('system_plugin_versions')->lists('version', 'code');
}
if (!isset($this->databaseVersions[$code])) {
$this->databaseVersions[$code] = Db::table(... | php | protected function getDatabaseVersion($code)
{
if ($this->databaseVersions === null) {
$this->databaseVersions = Db::table('system_plugin_versions')->lists('version', 'code');
}
if (!isset($this->databaseVersions[$code])) {
$this->databaseVersions[$code] = Db::table(... | [
"protected",
"function",
"getDatabaseVersion",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"databaseVersions",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"databaseVersions",
"=",
"Db",
"::",
"table",
"(",
"'system_plugin_versions'",
")",
"->",... | Returns the latest version of a plugin from the database. | [
"Returns",
"the",
"latest",
"version",
"of",
"a",
"plugin",
"from",
"the",
"database",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L315-L329 |
208,519 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.setDatabaseVersion | protected function setDatabaseVersion($code, $version = null)
{
$currentVersion = $this->getDatabaseVersion($code);
if ($version && !$currentVersion) {
Db::table('system_plugin_versions')->insert([
'code' => $code,
'version' => $version,
'... | php | protected function setDatabaseVersion($code, $version = null)
{
$currentVersion = $this->getDatabaseVersion($code);
if ($version && !$currentVersion) {
Db::table('system_plugin_versions')->insert([
'code' => $code,
'version' => $version,
'... | [
"protected",
"function",
"setDatabaseVersion",
"(",
"$",
"code",
",",
"$",
"version",
"=",
"null",
")",
"{",
"$",
"currentVersion",
"=",
"$",
"this",
"->",
"getDatabaseVersion",
"(",
"$",
"code",
")",
";",
"if",
"(",
"$",
"version",
"&&",
"!",
"$",
"cu... | Updates a plugin version in the database. | [
"Updates",
"a",
"plugin",
"version",
"in",
"the",
"database",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L334-L356 |
208,520 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.applyDatabaseComment | protected function applyDatabaseComment($code, $version, $comment)
{
Db::table('system_plugin_history')->insert([
'code' => $code,
'type' => self::HISTORY_TYPE_COMMENT,
'version' => $version,
'detail' => $comment,
'created_at' => new Carbon
... | php | protected function applyDatabaseComment($code, $version, $comment)
{
Db::table('system_plugin_history')->insert([
'code' => $code,
'type' => self::HISTORY_TYPE_COMMENT,
'version' => $version,
'detail' => $comment,
'created_at' => new Carbon
... | [
"protected",
"function",
"applyDatabaseComment",
"(",
"$",
"code",
",",
"$",
"version",
",",
"$",
"comment",
")",
"{",
"Db",
"::",
"table",
"(",
"'system_plugin_history'",
")",
"->",
"insert",
"(",
"[",
"'code'",
"=>",
"$",
"code",
",",
"'type'",
"=>",
"... | Registers a database update comment in the history table. | [
"Registers",
"a",
"database",
"update",
"comment",
"in",
"the",
"history",
"table",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L361-L370 |
208,521 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.removeDatabaseComment | protected function removeDatabaseComment($code, $version)
{
Db::table('system_plugin_history')
->where('code', $code)
->where('type', self::HISTORY_TYPE_COMMENT)
->where('version', $version)
->delete();
} | php | protected function removeDatabaseComment($code, $version)
{
Db::table('system_plugin_history')
->where('code', $code)
->where('type', self::HISTORY_TYPE_COMMENT)
->where('version', $version)
->delete();
} | [
"protected",
"function",
"removeDatabaseComment",
"(",
"$",
"code",
",",
"$",
"version",
")",
"{",
"Db",
"::",
"table",
"(",
"'system_plugin_history'",
")",
"->",
"where",
"(",
"'code'",
",",
"$",
"code",
")",
"->",
"where",
"(",
"'type'",
",",
"self",
"... | Removes a database update comment in the history table. | [
"Removes",
"a",
"database",
"update",
"comment",
"in",
"the",
"history",
"table",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L375-L382 |
208,522 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.applyDatabaseScript | protected function applyDatabaseScript($code, $version, $script)
{
/*
* Execute the database PHP script
*/
$updateFile = $this->pluginManager->getPluginPath($code) . '/updates/' . $script;
if (!File::isFile($updateFile)) {
$this->note('- <error>v' . $version . ... | php | protected function applyDatabaseScript($code, $version, $script)
{
/*
* Execute the database PHP script
*/
$updateFile = $this->pluginManager->getPluginPath($code) . '/updates/' . $script;
if (!File::isFile($updateFile)) {
$this->note('- <error>v' . $version . ... | [
"protected",
"function",
"applyDatabaseScript",
"(",
"$",
"code",
",",
"$",
"version",
",",
"$",
"script",
")",
"{",
"/*\n * Execute the database PHP script\n */",
"$",
"updateFile",
"=",
"$",
"this",
"->",
"pluginManager",
"->",
"getPluginPath",
"(",
... | Registers a database update script in the history table. | [
"Registers",
"a",
"database",
"update",
"script",
"in",
"the",
"history",
"table",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L387-L407 |
208,523 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.removeDatabaseScript | protected function removeDatabaseScript($code, $version, $script)
{
/*
* Execute the database PHP script
*/
$updateFile = $this->pluginManager->getPluginPath($code) . '/updates/' . $script;
$this->updater->packDown($updateFile);
Db::table('system_plugin_history')
... | php | protected function removeDatabaseScript($code, $version, $script)
{
/*
* Execute the database PHP script
*/
$updateFile = $this->pluginManager->getPluginPath($code) . '/updates/' . $script;
$this->updater->packDown($updateFile);
Db::table('system_plugin_history')
... | [
"protected",
"function",
"removeDatabaseScript",
"(",
"$",
"code",
",",
"$",
"version",
",",
"$",
"script",
")",
"{",
"/*\n * Execute the database PHP script\n */",
"$",
"updateFile",
"=",
"$",
"this",
"->",
"pluginManager",
"->",
"getPluginPath",
"(",... | Removes a database update script in the history table. | [
"Removes",
"a",
"database",
"update",
"script",
"in",
"the",
"history",
"table",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L412-L426 |
208,524 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.getDatabaseHistory | protected function getDatabaseHistory($code)
{
if ($this->databaseHistory !== null && array_key_exists($code, $this->databaseHistory)) {
return $this->databaseHistory[$code];
}
$historyInfo = Db::table('system_plugin_history')
->where('code', $code)
->ord... | php | protected function getDatabaseHistory($code)
{
if ($this->databaseHistory !== null && array_key_exists($code, $this->databaseHistory)) {
return $this->databaseHistory[$code];
}
$historyInfo = Db::table('system_plugin_history')
->where('code', $code)
->ord... | [
"protected",
"function",
"getDatabaseHistory",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"databaseHistory",
"!==",
"null",
"&&",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"this",
"->",
"databaseHistory",
")",
")",
"{",
"return",
"$",
... | Returns all the update history for a plugin. | [
"Returns",
"all",
"the",
"update",
"history",
"for",
"a",
"plugin",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L431-L444 |
208,525 | octobercms/october | modules/system/classes/VersionManager.php | VersionManager.hasDatabaseHistory | protected function hasDatabaseHistory($code, $version, $script = null)
{
$historyInfo = $this->getDatabaseHistory($code);
if (!$historyInfo) {
return false;
}
foreach ($historyInfo as $history) {
if ($history->version != $version) {
continue;
... | php | protected function hasDatabaseHistory($code, $version, $script = null)
{
$historyInfo = $this->getDatabaseHistory($code);
if (!$historyInfo) {
return false;
}
foreach ($historyInfo as $history) {
if ($history->version != $version) {
continue;
... | [
"protected",
"function",
"hasDatabaseHistory",
"(",
"$",
"code",
",",
"$",
"version",
",",
"$",
"script",
"=",
"null",
")",
"{",
"$",
"historyInfo",
"=",
"$",
"this",
"->",
"getDatabaseHistory",
"(",
"$",
"code",
")",
";",
"if",
"(",
"!",
"$",
"history... | Checks if a plugin has an applied update version. | [
"Checks",
"if",
"a",
"plugin",
"has",
"an",
"applied",
"update",
"version",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L449-L471 |
208,526 | octobercms/october | modules/backend/formwidgets/Repeater.php | Repeater.processExistingItems | protected function processExistingItems()
{
$loadedIndexes = $loadedGroups = [];
$loadValue = $this->getLoadValue();
// Ensure that the minimum number of items are preinitialized
// ONLY DONE WHEN NOT IN GROUP MODE
if (!$this->useGroups && $this->minItems > 0) {
... | php | protected function processExistingItems()
{
$loadedIndexes = $loadedGroups = [];
$loadValue = $this->getLoadValue();
// Ensure that the minimum number of items are preinitialized
// ONLY DONE WHEN NOT IN GROUP MODE
if (!$this->useGroups && $this->minItems > 0) {
... | [
"protected",
"function",
"processExistingItems",
"(",
")",
"{",
"$",
"loadedIndexes",
"=",
"$",
"loadedGroups",
"=",
"[",
"]",
";",
"$",
"loadValue",
"=",
"$",
"this",
"->",
"getLoadValue",
"(",
")",
";",
"// Ensure that the minimum number of items are preinitialize... | Processes existing form data and applies it to the form widgets.
@return void | [
"Processes",
"existing",
"form",
"data",
"and",
"applies",
"it",
"to",
"the",
"form",
"widgets",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/Repeater.php#L208-L251 |
208,527 | octobercms/october | modules/backend/formwidgets/Repeater.php | Repeater.makeItemFormWidget | protected function makeItemFormWidget($index = 0, $groupCode = null)
{
$configDefinition = $this->useGroups
? $this->getGroupFormFieldConfig($groupCode)
: $this->form;
$config = $this->makeConfig($configDefinition);
$config->model = $this->model;
$config->dat... | php | protected function makeItemFormWidget($index = 0, $groupCode = null)
{
$configDefinition = $this->useGroups
? $this->getGroupFormFieldConfig($groupCode)
: $this->form;
$config = $this->makeConfig($configDefinition);
$config->model = $this->model;
$config->dat... | [
"protected",
"function",
"makeItemFormWidget",
"(",
"$",
"index",
"=",
"0",
",",
"$",
"groupCode",
"=",
"null",
")",
"{",
"$",
"configDefinition",
"=",
"$",
"this",
"->",
"useGroups",
"?",
"$",
"this",
"->",
"getGroupFormFieldConfig",
"(",
"$",
"groupCode",
... | Creates a form widget based on a field index and optional group code.
@param int $index
@param string $index
@return \Backend\Widgets\Form | [
"Creates",
"a",
"form",
"widget",
"based",
"on",
"a",
"field",
"index",
"and",
"optional",
"group",
"code",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/Repeater.php#L259-L280 |
208,528 | octobercms/october | modules/backend/formwidgets/Repeater.php | Repeater.getLoadValueFromIndex | protected function getLoadValueFromIndex($index)
{
$loadValue = $this->getLoadValue();
if (!is_array($loadValue)) {
$loadValue = [];
}
return array_get($loadValue, $index, []);
} | php | protected function getLoadValueFromIndex($index)
{
$loadValue = $this->getLoadValue();
if (!is_array($loadValue)) {
$loadValue = [];
}
return array_get($loadValue, $index, []);
} | [
"protected",
"function",
"getLoadValueFromIndex",
"(",
"$",
"index",
")",
"{",
"$",
"loadValue",
"=",
"$",
"this",
"->",
"getLoadValue",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"loadValue",
")",
")",
"{",
"$",
"loadValue",
"=",
"[",
"]",
... | Returns the load data at a given index.
@param int $index | [
"Returns",
"the",
"load",
"data",
"at",
"a",
"given",
"index",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/Repeater.php#L286-L294 |
208,529 | octobercms/october | modules/backend/formwidgets/Repeater.php | Repeater.getGroupFormFieldConfig | protected function getGroupFormFieldConfig($code)
{
if (!$code) {
return null;
}
$fields = array_get($this->groupDefinitions, $code.'.fields');
if (!$fields) {
return null;
}
return ['fields' => $fields];
} | php | protected function getGroupFormFieldConfig($code)
{
if (!$code) {
return null;
}
$fields = array_get($this->groupDefinitions, $code.'.fields');
if (!$fields) {
return null;
}
return ['fields' => $fields];
} | [
"protected",
"function",
"getGroupFormFieldConfig",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"!",
"$",
"code",
")",
"{",
"return",
"null",
";",
"}",
"$",
"fields",
"=",
"array_get",
"(",
"$",
"this",
"->",
"groupDefinitions",
",",
"$",
"code",
".",
"'.fi... | Returns the form field configuration for a group, identified by code.
@param string $code
@return array|null | [
"Returns",
"the",
"form",
"field",
"configuration",
"for",
"a",
"group",
"identified",
"by",
"code",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/Repeater.php#L340-L353 |
208,530 | octobercms/october | modules/backend/formwidgets/Repeater.php | Repeater.processGroupMode | protected function processGroupMode()
{
$palette = [];
if (!$group = $this->getConfig('groups', [])) {
$this->useGroups = false;
return;
}
if (is_string($group)) {
$group = $this->makeConfig($group);
}
foreach ($group as $code =>... | php | protected function processGroupMode()
{
$palette = [];
if (!$group = $this->getConfig('groups', [])) {
$this->useGroups = false;
return;
}
if (is_string($group)) {
$group = $this->makeConfig($group);
}
foreach ($group as $code =>... | [
"protected",
"function",
"processGroupMode",
"(",
")",
"{",
"$",
"palette",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"group",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'groups'",
",",
"[",
"]",
")",
")",
"{",
"$",
"this",
"->",
"useGroups",
"=",
... | Process features related to group mode.
@return void | [
"Process",
"features",
"related",
"to",
"group",
"mode",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/Repeater.php#L359-L384 |
208,531 | octobercms/october | modules/cms/classes/CmsObjectCollection.php | CmsObjectCollection.withComponent | public function withComponent($components, $callback = null)
{
return $this->filter(function ($object) use ($components, $callback) {
$hasComponent = false;
foreach ((array) $components as $componentName) {
if (!$callback && $object->hasComponent($componentName)) {... | php | public function withComponent($components, $callback = null)
{
return $this->filter(function ($object) use ($components, $callback) {
$hasComponent = false;
foreach ((array) $components as $componentName) {
if (!$callback && $object->hasComponent($componentName)) {... | [
"public",
"function",
"withComponent",
"(",
"$",
"components",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"(",
"function",
"(",
"$",
"object",
")",
"use",
"(",
"$",
"components",
",",
"$",
"callback",
")",
"{",
... | Returns objects that use the supplied component.
@param string|array $components
@param null|callback $callback
@return static | [
"Returns",
"objects",
"that",
"use",
"the",
"supplied",
"component",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObjectCollection.php#L19-L38 |
208,532 | octobercms/october | modules/cms/classes/CmsObjectCollection.php | CmsObjectCollection.where | public function where($property, $value, $strict = true)
{
return $this->filter(function ($object) use ($property, $value, $strict) {
if (!array_key_exists($property, $object->settings)) {
return false;
}
return $strict
? $object->setting... | php | public function where($property, $value, $strict = true)
{
return $this->filter(function ($object) use ($property, $value, $strict) {
if (!array_key_exists($property, $object->settings)) {
return false;
}
return $strict
? $object->setting... | [
"public",
"function",
"where",
"(",
"$",
"property",
",",
"$",
"value",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"(",
"function",
"(",
"$",
"object",
")",
"use",
"(",
"$",
"property",
",",
"$",
"value",
",",... | Returns objects whose properties match the supplied value.
@param string $property
@param string $value
@param bool $strict
@return static | [
"Returns",
"objects",
"whose",
"properties",
"match",
"the",
"supplied",
"value",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObjectCollection.php#L47-L59 |
208,533 | octobercms/october | modules/cms/classes/CmsObjectCollection.php | CmsObjectCollection.whereComponent | public function whereComponent($components, $property, $value, $strict = false)
{
return $this->filter(function ($object) use ($components, $property, $value, $strict) {
$hasComponent = false;
foreach ((array) $components as $componentName) {
if (!$componentAlias =... | php | public function whereComponent($components, $property, $value, $strict = false)
{
return $this->filter(function ($object) use ($components, $property, $value, $strict) {
$hasComponent = false;
foreach ((array) $components as $componentName) {
if (!$componentAlias =... | [
"public",
"function",
"whereComponent",
"(",
"$",
"components",
",",
"$",
"property",
",",
"$",
"value",
",",
"$",
"strict",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"(",
"function",
"(",
"$",
"object",
")",
"use",
"(",
"$",
"co... | Returns objects whose component properties match the supplied value.
@param mixed $components
@param string $property
@param string $value
@param bool $strict
@return static | [
"Returns",
"objects",
"whose",
"component",
"properties",
"match",
"the",
"supplied",
"value",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObjectCollection.php#L69-L103 |
208,534 | octobercms/october | modules/system/console/OctoberEnv.php | OctoberEnv.overwriteConfig | private function overwriteConfig()
{
foreach (array_keys($this->config()) as $config) {
$this->config = $config;
$this->configToEnv();
}
} | php | private function overwriteConfig()
{
foreach (array_keys($this->config()) as $config) {
$this->config = $config;
$this->configToEnv();
}
} | [
"private",
"function",
"overwriteConfig",
"(",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"config",
"(",
")",
")",
"as",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"$",
"config",
";",
"$",
"this",
"->",
"configToE... | Overwrite config file | [
"Overwrite",
"config",
"file"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/console/OctoberEnv.php#L66-L73 |
208,535 | octobercms/october | modules/system/console/OctoberEnv.php | OctoberEnv.parseConfigFile | private function parseConfigFile()
{
$lines = [];
foreach ($this->lines() as $line) {
$keys = $this->config()[$this->config];
$lines[] = $this->parseLine($line, $keys);
}
$this->writeToEnv("\n");
return implode('', $lines);
} | php | private function parseConfigFile()
{
$lines = [];
foreach ($this->lines() as $line) {
$keys = $this->config()[$this->config];
$lines[] = $this->parseLine($line, $keys);
}
$this->writeToEnv("\n");
return implode('', $lines);
} | [
"private",
"function",
"parseConfigFile",
"(",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"lines",
"(",
")",
"as",
"$",
"line",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"[",
"$",
"th... | Parse config file line by line
@return string | [
"Parse",
"config",
"file",
"line",
"by",
"line"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/console/OctoberEnv.php#L90-L103 |
208,536 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.combineToFile | public function combineToFile($assets = [], $destination, $localPath = null)
{
// Disable cache always
$this->storagePath = null;
// Prefix all assets
if ($localPath) {
if (substr($localPath, -1) !== '/') {
$localPath = $localPath.'/';
}
... | php | public function combineToFile($assets = [], $destination, $localPath = null)
{
// Disable cache always
$this->storagePath = null;
// Prefix all assets
if ($localPath) {
if (substr($localPath, -1) !== '/') {
$localPath = $localPath.'/';
}
... | [
"public",
"function",
"combineToFile",
"(",
"$",
"assets",
"=",
"[",
"]",
",",
"$",
"destination",
",",
"$",
"localPath",
"=",
"null",
")",
"{",
"// Disable cache always",
"$",
"this",
"->",
"storagePath",
"=",
"null",
";",
"// Prefix all assets",
"if",
"(",... | Combines a collection of assets files to a destination file
$assets = [
'assets/less/header.less',
'assets/less/footer.less',
];
CombineAssets::combineToFile(
$assets,
base_path('themes/website/assets/theme.less'),
base_path('themes/website')
);
@param array $assets Collection of assets
@param string $destination Wr... | [
"Combines",
"a",
"collection",
"of",
"assets",
"files",
"to",
"a",
"destination",
"file"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L205-L228 |
208,537 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.prepareAssets | protected function prepareAssets(array $assets)
{
if (!is_array($assets)) {
$assets = [$assets];
}
/*
* Split assets in to groups.
*/
$combineJs = [];
$combineCss = [];
foreach ($assets as $asset) {
/*
* Allow a... | php | protected function prepareAssets(array $assets)
{
if (!is_array($assets)) {
$assets = [$assets];
}
/*
* Split assets in to groups.
*/
$combineJs = [];
$combineCss = [];
foreach ($assets as $asset) {
/*
* Allow a... | [
"protected",
"function",
"prepareAssets",
"(",
"array",
"$",
"assets",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"assets",
")",
")",
"{",
"$",
"assets",
"=",
"[",
"$",
"assets",
"]",
";",
"}",
"/*\n * Split assets in to groups.\n */",
"... | Prepares an array of assets by normalizing the collection
and processing aliases.
@param array $assets
@return array | [
"Prepares",
"an",
"array",
"of",
"assets",
"by",
"normalizing",
"the",
"collection",
"and",
"processing",
"aliases",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L285-L349 |
208,538 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.prepareRequest | protected function prepareRequest(array $assets, $localPath = null)
{
if (substr($localPath, -1) != '/') {
$localPath = $localPath.'/';
}
$this->localPath = $localPath;
$this->storagePath = storage_path('cms/combiner/assets');
list($assets, $extension) = $this->... | php | protected function prepareRequest(array $assets, $localPath = null)
{
if (substr($localPath, -1) != '/') {
$localPath = $localPath.'/';
}
$this->localPath = $localPath;
$this->storagePath = storage_path('cms/combiner/assets');
list($assets, $extension) = $this->... | [
"protected",
"function",
"prepareRequest",
"(",
"array",
"$",
"assets",
",",
"$",
"localPath",
"=",
"null",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"localPath",
",",
"-",
"1",
")",
"!=",
"'/'",
")",
"{",
"$",
"localPath",
"=",
"$",
"localPath",
".",... | Combines asset file references of a single type to produce
a URL reference to the combined contents.
@param array $assets List of asset files.
@param string $localPath File extension, used for aesthetic purposes only.
@return string URL to contents. | [
"Combines",
"asset",
"file",
"references",
"of",
"a",
"single",
"type",
"to",
"produce",
"a",
"URL",
"reference",
"to",
"the",
"combined",
"contents",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L358-L401 |
208,539 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.setHashOnCombinerFilters | protected function setHashOnCombinerFilters($hash)
{
$allFilters = call_user_func_array('array_merge', $this->getFilters());
foreach ($allFilters as $filter) {
if (method_exists($filter, 'setHash')) {
$filter->setHash($hash);
}
}
} | php | protected function setHashOnCombinerFilters($hash)
{
$allFilters = call_user_func_array('array_merge', $this->getFilters());
foreach ($allFilters as $filter) {
if (method_exists($filter, 'setHash')) {
$filter->setHash($hash);
}
}
} | [
"protected",
"function",
"setHashOnCombinerFilters",
"(",
"$",
"hash",
")",
"{",
"$",
"allFilters",
"=",
"call_user_func_array",
"(",
"'array_merge'",
",",
"$",
"this",
"->",
"getFilters",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"allFilters",
"as",
"$",
"fi... | Busts the cache based on a different cache key.
@return void | [
"Busts",
"the",
"cache",
"based",
"on",
"a",
"different",
"cache",
"key",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L453-L462 |
208,540 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getDeepHashFromAssets | protected function getDeepHashFromAssets($assets)
{
$key = '';
$assetFiles = array_map(function ($file) {
return file_exists($file) ? $file : File::symbolizePath($file, null) ?: $this->localPath . $file;
}, $assets);
foreach ($assetFiles as $file) {
$filters... | php | protected function getDeepHashFromAssets($assets)
{
$key = '';
$assetFiles = array_map(function ($file) {
return file_exists($file) ? $file : File::symbolizePath($file, null) ?: $this->localPath . $file;
}, $assets);
foreach ($assetFiles as $file) {
$filters... | [
"protected",
"function",
"getDeepHashFromAssets",
"(",
"$",
"assets",
")",
"{",
"$",
"key",
"=",
"''",
";",
"$",
"assetFiles",
"=",
"array_map",
"(",
"function",
"(",
"$",
"file",
")",
"{",
"return",
"file_exists",
"(",
"$",
"file",
")",
"?",
"$",
"fil... | Returns a deep hash on filters that support it.
@param array $assets List of asset files.
@return void | [
"Returns",
"a",
"deep",
"hash",
"on",
"filters",
"that",
"support",
"it",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L469-L488 |
208,541 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getCombinedUrl | protected function getCombinedUrl($outputFilename = 'undefined.css')
{
$combineAction = 'System\Classes\Controller@combine';
$actionExists = Route::getRoutes()->getByAction($combineAction) !== null;
if ($actionExists) {
return Url::action($combineAction, [$outputFilename], false... | php | protected function getCombinedUrl($outputFilename = 'undefined.css')
{
$combineAction = 'System\Classes\Controller@combine';
$actionExists = Route::getRoutes()->getByAction($combineAction) !== null;
if ($actionExists) {
return Url::action($combineAction, [$outputFilename], false... | [
"protected",
"function",
"getCombinedUrl",
"(",
"$",
"outputFilename",
"=",
"'undefined.css'",
")",
"{",
"$",
"combineAction",
"=",
"'System\\Classes\\Controller@combine'",
";",
"$",
"actionExists",
"=",
"Route",
"::",
"getRoutes",
"(",
")",
"->",
"getByAction",
"("... | Returns the URL used for accessing the combined files.
@param string $outputFilename A custom file name to use.
@return string | [
"Returns",
"the",
"URL",
"used",
"for",
"accessing",
"the",
"combined",
"files",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L495-L505 |
208,542 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getTargetPath | protected function getTargetPath($path = null)
{
if ($path === null) {
$baseUri = substr(Request::getBaseUrl(), strlen(Request::getBasePath()));
$path = $baseUri.'/combine';
}
if (strpos($path, '/') === 0) {
$path = substr($path, 1);
}
$p... | php | protected function getTargetPath($path = null)
{
if ($path === null) {
$baseUri = substr(Request::getBaseUrl(), strlen(Request::getBasePath()));
$path = $baseUri.'/combine';
}
if (strpos($path, '/') === 0) {
$path = substr($path, 1);
}
$p... | [
"protected",
"function",
"getTargetPath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"path",
"===",
"null",
")",
"{",
"$",
"baseUri",
"=",
"substr",
"(",
"Request",
"::",
"getBaseUrl",
"(",
")",
",",
"strlen",
"(",
"Request",
"::",
"get... | Returns the target path for use with the combiner. The target
path helps generate relative links within CSS.
/combine returns combine/
/index.php/combine returns index-php/combine/
@param string|null $path
@return string The new target path | [
"Returns",
"the",
"target",
"path",
"for",
"use",
"with",
"the",
"combiner",
".",
"The",
"target",
"path",
"helps",
"generate",
"relative",
"links",
"within",
"CSS",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L517-L530 |
208,543 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.registerFilter | public function registerFilter($extension, $filter)
{
if (is_array($extension)) {
foreach ($extension as $_extension) {
$this->registerFilter($_extension, $filter);
}
return;
}
$extension = strtolower($extension);
if (!isset($this... | php | public function registerFilter($extension, $filter)
{
if (is_array($extension)) {
foreach ($extension as $_extension) {
$this->registerFilter($_extension, $filter);
}
return;
}
$extension = strtolower($extension);
if (!isset($this... | [
"public",
"function",
"registerFilter",
"(",
"$",
"extension",
",",
"$",
"filter",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"extension",
")",
")",
"{",
"foreach",
"(",
"$",
"extension",
"as",
"$",
"_extension",
")",
"{",
"$",
"this",
"->",
"registerF... | Register a filter to apply to the combining process.
@param string|array $extension Extension name. Eg: css
@param object $filter Collection of files to combine.
@return self | [
"Register",
"a",
"filter",
"to",
"apply",
"to",
"the",
"combining",
"process",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L563-L583 |
208,544 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.resetFilters | public function resetFilters($extension = null)
{
if ($extension === null) {
$this->filters = [];
}
else {
$this->filters[$extension] = [];
}
return $this;
} | php | public function resetFilters($extension = null)
{
if ($extension === null) {
$this->filters = [];
}
else {
$this->filters[$extension] = [];
}
return $this;
} | [
"public",
"function",
"resetFilters",
"(",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"extension",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"filters",
"=",
"[",
"]",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"filters",
"[",
"$",
... | Clears any registered filters.
@param string $extension Extension name. Eg: css
@return self | [
"Clears",
"any",
"registered",
"filters",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L590-L600 |
208,545 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getFilters | public function getFilters($extension = null)
{
if ($extension === null) {
return $this->filters;
}
elseif (isset($this->filters[$extension])) {
return $this->filters[$extension];
}
else {
return null;
}
} | php | public function getFilters($extension = null)
{
if ($extension === null) {
return $this->filters;
}
elseif (isset($this->filters[$extension])) {
return $this->filters[$extension];
}
else {
return null;
}
} | [
"public",
"function",
"getFilters",
"(",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"extension",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filters",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"this",
"->",
"filters",
"[",
... | Returns filters.
@param string $extension Extension name. Eg: css
@return self | [
"Returns",
"filters",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L607-L618 |
208,546 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.registerBundle | public function registerBundle($files, $destination = null, $extension = null)
{
if (!is_array($files)) {
$files = [$files];
}
$firstFile = array_values($files)[0];
if ($extension === null) {
$extension = File::extension($firstFile);
}
$exte... | php | public function registerBundle($files, $destination = null, $extension = null)
{
if (!is_array($files)) {
$files = [$files];
}
$firstFile = array_values($files)[0];
if ($extension === null) {
$extension = File::extension($firstFile);
}
$exte... | [
"public",
"function",
"registerBundle",
"(",
"$",
"files",
",",
"$",
"destination",
"=",
"null",
",",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"files",
")",
")",
"{",
"$",
"files",
"=",
"[",
"$",
"files",
"]",
... | Registers bundle.
@param string|array $files Files to be registered to bundle
@param string $destination Destination file will be compiled to.
@param string $extension Extension name. Eg: css
@return self | [
"Registers",
"bundle",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L631-L668 |
208,547 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getBundles | public function getBundles($extension = null)
{
if ($extension === null) {
return $this->bundles;
}
elseif (isset($this->bundles[$extension])) {
return $this->bundles[$extension];
}
else {
return null;
}
} | php | public function getBundles($extension = null)
{
if ($extension === null) {
return $this->bundles;
}
elseif (isset($this->bundles[$extension])) {
return $this->bundles[$extension];
}
else {
return null;
}
} | [
"public",
"function",
"getBundles",
"(",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"extension",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"bundles",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"this",
"->",
"bundles",
"[",
... | Returns bundles.
@param string $extension Extension name. Eg: css
@return self | [
"Returns",
"bundles",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L675-L686 |
208,548 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.registerAlias | public function registerAlias($alias, $file, $extension = null)
{
if ($extension === null) {
$extension = File::extension($file);
}
$extension = strtolower($extension);
if (!isset($this->aliases[$extension])) {
$this->aliases[$extension] = [];
}
... | php | public function registerAlias($alias, $file, $extension = null)
{
if ($extension === null) {
$extension = File::extension($file);
}
$extension = strtolower($extension);
if (!isset($this->aliases[$extension])) {
$this->aliases[$extension] = [];
}
... | [
"public",
"function",
"registerAlias",
"(",
"$",
"alias",
",",
"$",
"file",
",",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"extension",
"===",
"null",
")",
"{",
"$",
"extension",
"=",
"File",
"::",
"extension",
"(",
"$",
"file",
")",
... | Register an alias to use for a longer file reference.
@param string $alias Alias name. Eg: framework
@param string $file Path to file to use for alias
@param string $extension Extension name. Eg: css
@return self | [
"Register",
"an",
"alias",
"to",
"use",
"for",
"a",
"longer",
"file",
"reference",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L699-L714 |
208,549 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.resetAliases | public function resetAliases($extension = null)
{
if ($extension === null) {
$this->aliases = [];
}
else {
$this->aliases[$extension] = [];
}
return $this;
} | php | public function resetAliases($extension = null)
{
if ($extension === null) {
$this->aliases = [];
}
else {
$this->aliases[$extension] = [];
}
return $this;
} | [
"public",
"function",
"resetAliases",
"(",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"extension",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"aliases",
"=",
"[",
"]",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"aliases",
"[",
"$",
... | Clears any registered aliases.
@param string $extension Extension name. Eg: css
@return self | [
"Clears",
"any",
"registered",
"aliases",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L721-L731 |
208,550 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getAliases | public function getAliases($extension = null)
{
if ($extension === null) {
return $this->aliases;
}
elseif (isset($this->aliases[$extension])) {
return $this->aliases[$extension];
}
else {
return null;
}
} | php | public function getAliases($extension = null)
{
if ($extension === null) {
return $this->aliases;
}
elseif (isset($this->aliases[$extension])) {
return $this->aliases[$extension];
}
else {
return null;
}
} | [
"public",
"function",
"getAliases",
"(",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"extension",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"aliases",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
... | Returns aliases.
@param string $extension Extension name. Eg: css
@return self | [
"Returns",
"aliases",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L738-L749 |
208,551 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.putCache | protected function putCache($cacheKey, array $cacheInfo)
{
$cacheKey = 'combiner.'.$cacheKey;
if (Cache::has($cacheKey)) {
return false;
}
$this->putCacheIndex($cacheKey);
Cache::forever($cacheKey, base64_encode(serialize($cacheInfo)));
return true;
... | php | protected function putCache($cacheKey, array $cacheInfo)
{
$cacheKey = 'combiner.'.$cacheKey;
if (Cache::has($cacheKey)) {
return false;
}
$this->putCacheIndex($cacheKey);
Cache::forever($cacheKey, base64_encode(serialize($cacheInfo)));
return true;
... | [
"protected",
"function",
"putCache",
"(",
"$",
"cacheKey",
",",
"array",
"$",
"cacheInfo",
")",
"{",
"$",
"cacheKey",
"=",
"'combiner.'",
".",
"$",
"cacheKey",
";",
"if",
"(",
"Cache",
"::",
"has",
"(",
"$",
"cacheKey",
")",
")",
"{",
"return",
"false"... | Stores information about a asset collection against
a cache identifier.
@param string $cacheKey Cache identifier.
@param array $cacheInfo List of asset files.
@return bool Successful | [
"Stores",
"information",
"about",
"a",
"asset",
"collection",
"against",
"a",
"cache",
"identifier",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L762-L773 |
208,552 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getCache | protected function getCache($cacheKey)
{
$cacheKey = 'combiner.'.$cacheKey;
if (!Cache::has($cacheKey)) {
return false;
}
return @unserialize(@base64_decode(Cache::get($cacheKey)));
} | php | protected function getCache($cacheKey)
{
$cacheKey = 'combiner.'.$cacheKey;
if (!Cache::has($cacheKey)) {
return false;
}
return @unserialize(@base64_decode(Cache::get($cacheKey)));
} | [
"protected",
"function",
"getCache",
"(",
"$",
"cacheKey",
")",
"{",
"$",
"cacheKey",
"=",
"'combiner.'",
".",
"$",
"cacheKey",
";",
"if",
"(",
"!",
"Cache",
"::",
"has",
"(",
"$",
"cacheKey",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"@"... | Look up information about a cache identifier.
@param string $cacheKey Cache identifier
@return array Cache information | [
"Look",
"up",
"information",
"about",
"a",
"cache",
"identifier",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L780-L789 |
208,553 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getCacheKey | protected function getCacheKey(array $assets)
{
$cacheKey = $this->localPath . implode('|', $assets);
/*
* Deep hashing
*/
if ($this->useDeepHashing) {
$cacheKey .= $this->getDeepHashFromAssets($assets);
}
/*
* Extensibility
*... | php | protected function getCacheKey(array $assets)
{
$cacheKey = $this->localPath . implode('|', $assets);
/*
* Deep hashing
*/
if ($this->useDeepHashing) {
$cacheKey .= $this->getDeepHashFromAssets($assets);
}
/*
* Extensibility
*... | [
"protected",
"function",
"getCacheKey",
"(",
"array",
"$",
"assets",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"this",
"->",
"localPath",
".",
"implode",
"(",
"'|'",
",",
"$",
"assets",
")",
";",
"/*\n * Deep hashing\n */",
"if",
"(",
"$",
"this",... | Builds a unique string based on assets
@param array $assets Asset files
@return string Unique identifier | [
"Builds",
"a",
"unique",
"string",
"based",
"on",
"assets"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L796-L815 |
208,554 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.resetCache | public static function resetCache()
{
if (Cache::has('combiner.index')) {
$index = (array) @unserialize(@base64_decode(Cache::get('combiner.index'))) ?: [];
foreach ($index as $cacheKey) {
Cache::forget($cacheKey);
}
Cache::forget('combiner.i... | php | public static function resetCache()
{
if (Cache::has('combiner.index')) {
$index = (array) @unserialize(@base64_decode(Cache::get('combiner.index'))) ?: [];
foreach ($index as $cacheKey) {
Cache::forget($cacheKey);
}
Cache::forget('combiner.i... | [
"public",
"static",
"function",
"resetCache",
"(",
")",
"{",
"if",
"(",
"Cache",
"::",
"has",
"(",
"'combiner.index'",
")",
")",
"{",
"$",
"index",
"=",
"(",
"array",
")",
"@",
"unserialize",
"(",
"@",
"base64_decode",
"(",
"Cache",
"::",
"get",
"(",
... | Resets the combiner cache
@return void | [
"Resets",
"the",
"combiner",
"cache"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L821-L834 |
208,555 | octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.putCacheIndex | protected function putCacheIndex($cacheKey)
{
$index = [];
if (Cache::has('combiner.index')) {
$index = (array) @unserialize(@base64_decode(Cache::get('combiner.index'))) ?: [];
}
if (in_array($cacheKey, $index)) {
return false;
}
$index[] =... | php | protected function putCacheIndex($cacheKey)
{
$index = [];
if (Cache::has('combiner.index')) {
$index = (array) @unserialize(@base64_decode(Cache::get('combiner.index'))) ?: [];
}
if (in_array($cacheKey, $index)) {
return false;
}
$index[] =... | [
"protected",
"function",
"putCacheIndex",
"(",
"$",
"cacheKey",
")",
"{",
"$",
"index",
"=",
"[",
"]",
";",
"if",
"(",
"Cache",
"::",
"has",
"(",
"'combiner.index'",
")",
")",
"{",
"$",
"index",
"=",
"(",
"array",
")",
"@",
"unserialize",
"(",
"@",
... | Adds a cache identifier to the index store used for
performing a reset of the cache.
@param string $cacheKey Cache identifier
@return bool Returns false if identifier is already in store | [
"Adds",
"a",
"cache",
"identifier",
"to",
"the",
"index",
"store",
"used",
"for",
"performing",
"a",
"reset",
"of",
"the",
"cache",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L842-L859 |
208,556 | octobercms/october | modules/cms/classes/ComponentHelpers.php | ComponentHelpers.getComponentsPropertyConfig | public static function getComponentsPropertyConfig($component, $addAliasProperty = true, $returnArray = false)
{
$result = [];
if ($addAliasProperty) {
$property = [
'property' => 'oc.alias',
'title' => Lang::get('cms::lang.co... | php | public static function getComponentsPropertyConfig($component, $addAliasProperty = true, $returnArray = false)
{
$result = [];
if ($addAliasProperty) {
$property = [
'property' => 'oc.alias',
'title' => Lang::get('cms::lang.co... | [
"public",
"static",
"function",
"getComponentsPropertyConfig",
"(",
"$",
"component",
",",
"$",
"addAliasProperty",
"=",
"true",
",",
"$",
"returnArray",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"addAliasProperty",
")",
"{... | Returns a component property configuration as a JSON string or array.
@param mixed $component The component object
@param boolean $addAliasProperty Determines if the Alias property should be added to the result.
@param boolean $returnArray Determines if the method should return an array.
@return string | [
"Returns",
"a",
"component",
"property",
"configuration",
"as",
"a",
"JSON",
"string",
"or",
"array",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentHelpers.php#L20-L82 |
208,557 | octobercms/october | modules/cms/classes/ComponentHelpers.php | ComponentHelpers.getComponentPropertyValues | public static function getComponentPropertyValues($component)
{
$result = [];
$result['oc.alias'] = $component->alias;
$properties = $component->defineProperties();
foreach ($properties as $name => $params) {
$result[$name] = $component->property($name);
}
... | php | public static function getComponentPropertyValues($component)
{
$result = [];
$result['oc.alias'] = $component->alias;
$properties = $component->defineProperties();
foreach ($properties as $name => $params) {
$result[$name] = $component->property($name);
}
... | [
"public",
"static",
"function",
"getComponentPropertyValues",
"(",
"$",
"component",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"result",
"[",
"'oc.alias'",
"]",
"=",
"$",
"component",
"->",
"alias",
";",
"$",
"properties",
"=",
"$",
"component",
... | Returns a component property values.
@param mixed $component The component object
@return mixed | [
"Returns",
"a",
"component",
"property",
"values",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentHelpers.php#L89-L101 |
208,558 | octobercms/october | modules/cms/classes/ComponentHelpers.php | ComponentHelpers.getComponentName | public static function getComponentName($component)
{
$details = $component->componentDetails();
$name = $details['name'] ?? 'cms::lang.component.unnamed';
return Lang::get($name);
} | php | public static function getComponentName($component)
{
$details = $component->componentDetails();
$name = $details['name'] ?? 'cms::lang.component.unnamed';
return Lang::get($name);
} | [
"public",
"static",
"function",
"getComponentName",
"(",
"$",
"component",
")",
"{",
"$",
"details",
"=",
"$",
"component",
"->",
"componentDetails",
"(",
")",
";",
"$",
"name",
"=",
"$",
"details",
"[",
"'name'",
"]",
"??",
"'cms::lang.component.unnamed'",
... | Returns a component name.
@param mixed $component The component object
@return string | [
"Returns",
"a",
"component",
"name",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentHelpers.php#L108-L114 |
208,559 | octobercms/october | modules/cms/classes/ComponentHelpers.php | ComponentHelpers.getComponentDescription | public static function getComponentDescription($component)
{
$details = $component->componentDetails();
$name = $details['description'] ?? 'cms::lang.component.no_description';
return Lang::get($name);
} | php | public static function getComponentDescription($component)
{
$details = $component->componentDetails();
$name = $details['description'] ?? 'cms::lang.component.no_description';
return Lang::get($name);
} | [
"public",
"static",
"function",
"getComponentDescription",
"(",
"$",
"component",
")",
"{",
"$",
"details",
"=",
"$",
"component",
"->",
"componentDetails",
"(",
")",
";",
"$",
"name",
"=",
"$",
"details",
"[",
"'description'",
"]",
"??",
"'cms::lang.component... | Returns a component description.
@param mixed $component The component object
@return string | [
"Returns",
"a",
"component",
"description",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentHelpers.php#L121-L127 |
208,560 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.loadItems | protected function loadItems()
{
/*
* Load module items
*/
foreach ($this->callbacks as $callback) {
$callback($this);
}
/*
* Load plugin items
*/
$plugins = $this->pluginManager->getPlugins();
foreach ($plugins as $id... | php | protected function loadItems()
{
/*
* Load module items
*/
foreach ($this->callbacks as $callback) {
$callback($this);
}
/*
* Load plugin items
*/
$plugins = $this->pluginManager->getPlugins();
foreach ($plugins as $id... | [
"protected",
"function",
"loadItems",
"(",
")",
"{",
"/*\n * Load module items\n */",
"foreach",
"(",
"$",
"this",
"->",
"callbacks",
"as",
"$",
"callback",
")",
"{",
"$",
"callback",
"(",
"$",
"this",
")",
";",
"}",
"/*\n * Load plugin ite... | Loads the menu items from modules and plugins
@return void | [
"Loads",
"the",
"menu",
"items",
"from",
"modules",
"and",
"plugins"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L74-L141 |
208,561 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.addMainMenuItems | public function addMainMenuItems($owner, array $definitions)
{
foreach ($definitions as $code => $definition) {
$this->addMainMenuItem($owner, $code, $definition);
}
} | php | public function addMainMenuItems($owner, array $definitions)
{
foreach ($definitions as $code => $definition) {
$this->addMainMenuItem($owner, $code, $definition);
}
} | [
"public",
"function",
"addMainMenuItems",
"(",
"$",
"owner",
",",
"array",
"$",
"definitions",
")",
"{",
"foreach",
"(",
"$",
"definitions",
"as",
"$",
"code",
"=>",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"addMainMenuItem",
"(",
"$",
"owner",
",... | Dynamically add an array of main menu items
@param string $owner
@param array $definitions | [
"Dynamically",
"add",
"an",
"array",
"of",
"main",
"menu",
"items"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L199-L204 |
208,562 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.addMainMenuItem | public function addMainMenuItem($owner, $code, array $definition)
{
$itemKey = $this->makeItemKey($owner, $code);
if (isset($this->items[$itemKey])) {
$definition = array_merge((array) $this->items[$itemKey], $definition);
}
$item = (object) array_merge(self::$mainItemD... | php | public function addMainMenuItem($owner, $code, array $definition)
{
$itemKey = $this->makeItemKey($owner, $code);
if (isset($this->items[$itemKey])) {
$definition = array_merge((array) $this->items[$itemKey], $definition);
}
$item = (object) array_merge(self::$mainItemD... | [
"public",
"function",
"addMainMenuItem",
"(",
"$",
"owner",
",",
"$",
"code",
",",
"array",
"$",
"definition",
")",
"{",
"$",
"itemKey",
"=",
"$",
"this",
"->",
"makeItemKey",
"(",
"$",
"owner",
",",
"$",
"code",
")",
";",
"if",
"(",
"isset",
"(",
... | Dynamically add a single main menu item
@param string $owner
@param string $code
@param array $definitions | [
"Dynamically",
"add",
"a",
"single",
"main",
"menu",
"item"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L212-L230 |
208,563 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.addSideMenuItems | public function addSideMenuItems($owner, $code, array $definitions)
{
foreach ($definitions as $sideCode => $definition) {
$this->addSideMenuItem($owner, $code, $sideCode, (array) $definition);
}
} | php | public function addSideMenuItems($owner, $code, array $definitions)
{
foreach ($definitions as $sideCode => $definition) {
$this->addSideMenuItem($owner, $code, $sideCode, (array) $definition);
}
} | [
"public",
"function",
"addSideMenuItems",
"(",
"$",
"owner",
",",
"$",
"code",
",",
"array",
"$",
"definitions",
")",
"{",
"foreach",
"(",
"$",
"definitions",
"as",
"$",
"sideCode",
"=>",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"addSideMenuItem",
... | Dynamically add an array of side menu items
@param string $owner
@param string $code
@param array $definitions | [
"Dynamically",
"add",
"an",
"array",
"of",
"side",
"menu",
"items"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L247-L252 |
208,564 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.addSideMenuItem | public function addSideMenuItem($owner, $code, $sideCode, array $definition)
{
$itemKey = $this->makeItemKey($owner, $code);
if (!isset($this->items[$itemKey])) {
return false;
}
$mainItem = $this->items[$itemKey];
$definition = array_merge($definition, [
... | php | public function addSideMenuItem($owner, $code, $sideCode, array $definition)
{
$itemKey = $this->makeItemKey($owner, $code);
if (!isset($this->items[$itemKey])) {
return false;
}
$mainItem = $this->items[$itemKey];
$definition = array_merge($definition, [
... | [
"public",
"function",
"addSideMenuItem",
"(",
"$",
"owner",
",",
"$",
"code",
",",
"$",
"sideCode",
",",
"array",
"$",
"definition",
")",
"{",
"$",
"itemKey",
"=",
"$",
"this",
"->",
"makeItemKey",
"(",
"$",
"owner",
",",
"$",
"code",
")",
";",
"if",... | Dynamically add a single side menu item
@param string $owner
@param string $code
@param string $sideCode
@param array $definitions | [
"Dynamically",
"add",
"a",
"single",
"side",
"menu",
"item"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L261-L283 |
208,565 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.listSideMenuItems | public function listSideMenuItems($owner = null, $code = null)
{
$activeItem = null;
if ($owner !== null && $code !== null) {
$activeItem = @$this->items[$this->makeItemKey($owner, $code)];
} else {
foreach ($this->listMainMenuItems() as $item) {
if (... | php | public function listSideMenuItems($owner = null, $code = null)
{
$activeItem = null;
if ($owner !== null && $code !== null) {
$activeItem = @$this->items[$this->makeItemKey($owner, $code)];
} else {
foreach ($this->listMainMenuItems() as $item) {
if (... | [
"public",
"function",
"listSideMenuItems",
"(",
"$",
"owner",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"activeItem",
"=",
"null",
";",
"if",
"(",
"$",
"owner",
"!==",
"null",
"&&",
"$",
"code",
"!==",
"null",
")",
"{",
"$",
"activ... | Returns a list of side menu items for the currently active main menu item.
The currently active main menu item is set with the setContext methods. | [
"Returns",
"a",
"list",
"of",
"side",
"menu",
"items",
"for",
"the",
"currently",
"active",
"main",
"menu",
"item",
".",
"The",
"currently",
"active",
"main",
"menu",
"item",
"is",
"set",
"with",
"the",
"setContext",
"methods",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L316-L344 |
208,566 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.setContext | public function setContext($owner, $mainMenuItemCode, $sideMenuItemCode = null)
{
$this->setContextOwner($owner);
$this->setContextMainMenu($mainMenuItemCode);
$this->setContextSideMenu($sideMenuItemCode);
} | php | public function setContext($owner, $mainMenuItemCode, $sideMenuItemCode = null)
{
$this->setContextOwner($owner);
$this->setContextMainMenu($mainMenuItemCode);
$this->setContextSideMenu($sideMenuItemCode);
} | [
"public",
"function",
"setContext",
"(",
"$",
"owner",
",",
"$",
"mainMenuItemCode",
",",
"$",
"sideMenuItemCode",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setContextOwner",
"(",
"$",
"owner",
")",
";",
"$",
"this",
"->",
"setContextMainMenu",
"(",
"$",
... | Sets the navigation context.
The function sets the navigation owner, main menu item code and the side menu item code.
@param string $owner Specifies the navigation owner in the format Vendor/Module
@param string $mainMenuItemCode Specifies the main menu item code
@param string $sideMenuItemCode Specifies the side menu ... | [
"Sets",
"the",
"navigation",
"context",
".",
"The",
"function",
"sets",
"the",
"navigation",
"owner",
"main",
"menu",
"item",
"code",
"and",
"the",
"side",
"menu",
"item",
"code",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L353-L358 |
208,567 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.isMainMenuItemActive | public function isMainMenuItemActive($item)
{
return $this->contextOwner == $item->owner && $this->contextMainMenuItemCode == $item->code;
} | php | public function isMainMenuItemActive($item)
{
return $this->contextOwner == $item->owner && $this->contextMainMenuItemCode == $item->code;
} | [
"public",
"function",
"isMainMenuItemActive",
"(",
"$",
"item",
")",
"{",
"return",
"$",
"this",
"->",
"contextOwner",
"==",
"$",
"item",
"->",
"owner",
"&&",
"$",
"this",
"->",
"contextMainMenuItemCode",
"==",
"$",
"item",
"->",
"code",
";",
"}"
] | Determines if a main menu item is active.
@param mixed $item Specifies the item object.
@return boolean Returns true if the menu item is active. | [
"Determines",
"if",
"a",
"main",
"menu",
"item",
"is",
"active",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L410-L413 |
208,568 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.getActiveMainMenuItem | public function getActiveMainMenuItem()
{
foreach ($this->listMainMenuItems() as $item) {
if ($this->isMainMenuItemActive($item)) {
return $item;
}
}
return null;
} | php | public function getActiveMainMenuItem()
{
foreach ($this->listMainMenuItems() as $item) {
if ($this->isMainMenuItemActive($item)) {
return $item;
}
}
return null;
} | [
"public",
"function",
"getActiveMainMenuItem",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listMainMenuItems",
"(",
")",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isMainMenuItemActive",
"(",
"$",
"item",
")",
")",
"{",
"return",
... | Returns the currently active main menu item
@param mixed $item Returns the item object or null. | [
"Returns",
"the",
"currently",
"active",
"main",
"menu",
"item"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L419-L428 |
208,569 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.isSideMenuItemActive | public function isSideMenuItemActive($item)
{
if ($this->contextSideMenuItemCode === true) {
$this->contextSideMenuItemCode = null;
return true;
}
return $this->contextOwner == $item->owner && $this->contextSideMenuItemCode == $item->code;
} | php | public function isSideMenuItemActive($item)
{
if ($this->contextSideMenuItemCode === true) {
$this->contextSideMenuItemCode = null;
return true;
}
return $this->contextOwner == $item->owner && $this->contextSideMenuItemCode == $item->code;
} | [
"public",
"function",
"isSideMenuItemActive",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"contextSideMenuItemCode",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"contextSideMenuItemCode",
"=",
"null",
";",
"return",
"true",
";",
"}",
"return",
... | Determines if a side menu item is active.
@param mixed $item Specifies the item object.
@return boolean Returns true if the side item is active. | [
"Determines",
"if",
"a",
"side",
"menu",
"item",
"is",
"active",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L435-L443 |
208,570 | octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.filterItemPermissions | protected function filterItemPermissions($user, array $items)
{
if (!$user) {
return $items;
}
$items = array_filter($items, function ($item) use ($user) {
if (!$item->permissions || !count($item->permissions)) {
return true;
}
... | php | protected function filterItemPermissions($user, array $items)
{
if (!$user) {
return $items;
}
$items = array_filter($items, function ($item) use ($user) {
if (!$item->permissions || !count($item->permissions)) {
return true;
}
... | [
"protected",
"function",
"filterItemPermissions",
"(",
"$",
"user",
",",
"array",
"$",
"items",
")",
"{",
"if",
"(",
"!",
"$",
"user",
")",
"{",
"return",
"$",
"items",
";",
"}",
"$",
"items",
"=",
"array_filter",
"(",
"$",
"items",
",",
"function",
... | Removes menu items from an array if the supplied user lacks permission.
@param User $user A user object
@param array $items A collection of menu items
@return array The filtered menu items | [
"Removes",
"menu",
"items",
"from",
"an",
"array",
"if",
"the",
"supplied",
"user",
"lacks",
"permission",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L478-L493 |
208,571 | octobercms/october | modules/cms/twig/Extension.php | Extension.getTokenParsers | public function getTokenParsers()
{
return [
new PageTokenParser,
new PartialTokenParser,
new ContentTokenParser,
new PutTokenParser,
new PlaceholderTokenParser,
new DefaultTokenParser,
new FrameworkTokenParser,
... | php | public function getTokenParsers()
{
return [
new PageTokenParser,
new PartialTokenParser,
new ContentTokenParser,
new PutTokenParser,
new PlaceholderTokenParser,
new DefaultTokenParser,
new FrameworkTokenParser,
... | [
"public",
"function",
"getTokenParsers",
"(",
")",
"{",
"return",
"[",
"new",
"PageTokenParser",
",",
"new",
"PartialTokenParser",
",",
"new",
"ContentTokenParser",
",",
"new",
"PutTokenParser",
",",
"new",
"PlaceholderTokenParser",
",",
"new",
"DefaultTokenParser",
... | Returns a list of token parsers this extensions provides.
@return array An array of token parsers | [
"Returns",
"a",
"list",
"of",
"token",
"parsers",
"this",
"extensions",
"provides",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/twig/Extension.php#L66-L81 |
208,572 | octobercms/october | modules/cms/twig/Extension.php | Extension.placeholderFunction | public function placeholderFunction($name, $default = null)
{
if (($result = Block::get($name)) === null) {
return null;
}
$result = str_replace('<!-- X_OCTOBER_DEFAULT_BLOCK_CONTENT -->', trim($default), $result);
return $result;
} | php | public function placeholderFunction($name, $default = null)
{
if (($result = Block::get($name)) === null) {
return null;
}
$result = str_replace('<!-- X_OCTOBER_DEFAULT_BLOCK_CONTENT -->', trim($default), $result);
return $result;
} | [
"public",
"function",
"placeholderFunction",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"$",
"result",
"=",
"Block",
"::",
"get",
"(",
"$",
"name",
")",
")",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
... | Renders a placeholder content, without removing the block,
must be called before the placeholder tag itself
@return string Returns the placeholder contents. | [
"Renders",
"a",
"placeholder",
"content",
"without",
"removing",
"the",
"block",
"must",
"be",
"called",
"before",
"the",
"placeholder",
"tag",
"itself"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/twig/Extension.php#L141-L149 |
208,573 | octobercms/october | modules/cms/twig/Extension.php | Extension.displayBlock | public function displayBlock($name, $default = null)
{
if (($result = Block::placeholder($name)) === null) {
return $default;
}
if ($event = Event::fire('cms.block.render', [$name, $result], true))
$result = $event;
$result = str_replace('<!-- X_OCTOBER_DEFA... | php | public function displayBlock($name, $default = null)
{
if (($result = Block::placeholder($name)) === null) {
return $default;
}
if ($event = Event::fire('cms.block.render', [$name, $result], true))
$result = $event;
$result = str_replace('<!-- X_OCTOBER_DEFA... | [
"public",
"function",
"displayBlock",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"$",
"result",
"=",
"Block",
"::",
"placeholder",
"(",
"$",
"name",
")",
")",
"===",
"null",
")",
"{",
"return",
"$",
"default",
";"... | Returns a layout block contents and removes the block.
@param string $name Specifies the block name
@param string $default The default placeholder contents.
@return mixed Returns the block contents string or null of the block doesn't exist | [
"Returns",
"a",
"layout",
"block",
"contents",
"and",
"removes",
"the",
"block",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/twig/Extension.php#L190-L201 |
208,574 | octobercms/october | modules/cms/classes/CmsException.php | CmsException.processCompoundObject | public function processCompoundObject(Exception $exception)
{
switch ($this->code) {
case 200:
$result = $this->processIni($exception);
break;
case 300:
$result = $this->processPhp($exception);
break;
case ... | php | public function processCompoundObject(Exception $exception)
{
switch ($this->code) {
case 200:
$result = $this->processIni($exception);
break;
case 300:
$result = $this->processPhp($exception);
break;
case ... | [
"public",
"function",
"processCompoundObject",
"(",
"Exception",
"$",
"exception",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"code",
")",
"{",
"case",
"200",
":",
"$",
"result",
"=",
"$",
"this",
"->",
"processIni",
"(",
"$",
"exception",
")",
";",
"... | Checks some conditions to confirm error has actually occurred
due to the CMS template code, not some external code. If the error
has occurred in external code, the function will return false. Otherwise return
true and modify the exception by overriding it's content, line and message values
to be accurate against a CMS ... | [
"Checks",
"some",
"conditions",
"to",
"confirm",
"error",
"has",
"actually",
"occurred",
"due",
"to",
"the",
"CMS",
"template",
"code",
"not",
"some",
"external",
"code",
".",
"If",
"the",
"error",
"has",
"occurred",
"in",
"external",
"code",
"the",
"functio... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsException.php#L68-L92 |
208,575 | octobercms/october | modules/cms/classes/CmsException.php | CmsException.processIni | protected function processIni(Exception $exception)
{
$message = $exception->getMessage();
/*
* Expecting: syntax error, unexpected '!' in Unknown on line 4
*/
if (!starts_with($message, 'syntax error')) {
return false;
}
if (strpos($message, 'U... | php | protected function processIni(Exception $exception)
{
$message = $exception->getMessage();
/*
* Expecting: syntax error, unexpected '!' in Unknown on line 4
*/
if (!starts_with($message, 'syntax error')) {
return false;
}
if (strpos($message, 'U... | [
"protected",
"function",
"processIni",
"(",
"Exception",
"$",
"exception",
")",
"{",
"$",
"message",
"=",
"$",
"exception",
"->",
"getMessage",
"(",
")",
";",
"/*\n * Expecting: syntax error, unexpected '!' in Unknown on line 4\n */",
"if",
"(",
"!",
"st... | Override properties of an exception specific to the INI section
of a CMS object.
@param \Exception $exception The exception to modify.
@return bool | [
"Override",
"properties",
"of",
"an",
"exception",
"specific",
"to",
"the",
"INI",
"section",
"of",
"a",
"CMS",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsException.php#L100-L135 |
208,576 | octobercms/october | modules/cms/classes/CmsException.php | CmsException.processPhp | protected function processPhp(Exception $exception)
{
/*
* Fatal Error
*/
if ($exception instanceof \Symfony\Component\Debug\Exception\FatalErrorException) {
$check = false;
// Expected: */modules/cms/classes/CodeParser.php(165) : eval()'d code line 7
... | php | protected function processPhp(Exception $exception)
{
/*
* Fatal Error
*/
if ($exception instanceof \Symfony\Component\Debug\Exception\FatalErrorException) {
$check = false;
// Expected: */modules/cms/classes/CodeParser.php(165) : eval()'d code line 7
... | [
"protected",
"function",
"processPhp",
"(",
"Exception",
"$",
"exception",
")",
"{",
"/*\n * Fatal Error\n */",
"if",
"(",
"$",
"exception",
"instanceof",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Debug",
"\\",
"Exception",
"\\",
"FatalErrorException"... | Override properties of an exception specific to the PHP section
of a CMS object.
@param \Exception $exception The exception to modify.
@return bool | [
"Override",
"properties",
"of",
"an",
"exception",
"specific",
"to",
"the",
"PHP",
"section",
"of",
"a",
"CMS",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsException.php#L143-L191 |
208,577 | octobercms/october | modules/cms/classes/CmsException.php | CmsException.processTwig | protected function processTwig(Exception $exception)
{
// Must be a Twig related exception
if (!$exception instanceof Twig_Error) {
return false;
}
$this->message = $exception->getRawMessage();
$this->line = $exception->getTemplateLine();
// Find where t... | php | protected function processTwig(Exception $exception)
{
// Must be a Twig related exception
if (!$exception instanceof Twig_Error) {
return false;
}
$this->message = $exception->getRawMessage();
$this->line = $exception->getTemplateLine();
// Find where t... | [
"protected",
"function",
"processTwig",
"(",
"Exception",
"$",
"exception",
")",
"{",
"// Must be a Twig related exception",
"if",
"(",
"!",
"$",
"exception",
"instanceof",
"Twig_Error",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"message",
"=",
... | Override properties of an exception specific to the Twig section
of a CMS object.
@param \Exception $exception The exception to modify.
@return bool | [
"Override",
"properties",
"of",
"an",
"exception",
"specific",
"to",
"the",
"Twig",
"section",
"of",
"a",
"CMS",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsException.php#L199-L217 |
208,578 | octobercms/october | modules/system/traits/PropertyContainer.php | PropertyContainer.validateProperties | public function validateProperties(array $properties)
{
$definedProperties = $this->defineProperties() ?: [];
/*
* Determine and implement default values
*/
$defaultProperties = [];
foreach ($definedProperties as $name => $information) {
if (array_key_... | php | public function validateProperties(array $properties)
{
$definedProperties = $this->defineProperties() ?: [];
/*
* Determine and implement default values
*/
$defaultProperties = [];
foreach ($definedProperties as $name => $information) {
if (array_key_... | [
"public",
"function",
"validateProperties",
"(",
"array",
"$",
"properties",
")",
"{",
"$",
"definedProperties",
"=",
"$",
"this",
"->",
"defineProperties",
"(",
")",
"?",
":",
"[",
"]",
";",
"/*\n * Determine and implement default values\n */",
"$",
... | Validates the properties against the defined properties of the class.
This method also sets default properties.
@param array $properties The supplied property values.
@return array The validated property set, with defaults applied. | [
"Validates",
"the",
"properties",
"against",
"the",
"defined",
"properties",
"of",
"the",
"class",
".",
"This",
"method",
"also",
"sets",
"default",
"properties",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/PropertyContainer.php#L26-L44 |
208,579 | octobercms/october | modules/backend/controllers/Users.php | Users.formExtendQuery | public function formExtendQuery($query)
{
if (!$this->user->isSuperUser()) {
$query->where('is_superuser', false);
}
// Ensure soft-deleted records can still be managed
$query->withTrashed();
} | php | public function formExtendQuery($query)
{
if (!$this->user->isSuperUser()) {
$query->where('is_superuser', false);
}
// Ensure soft-deleted records can still be managed
$query->withTrashed();
} | [
"public",
"function",
"formExtendQuery",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"user",
"->",
"isSuperUser",
"(",
")",
")",
"{",
"$",
"query",
"->",
"where",
"(",
"'is_superuser'",
",",
"false",
")",
";",
"}",
"// Ensure soft-d... | Extends the form query to prevent non-superusers from accessing superusers at all | [
"Extends",
"the",
"form",
"query",
"to",
"prevent",
"non",
"-",
"superusers",
"from",
"accessing",
"superusers",
"at",
"all"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/controllers/Users.php#L98-L106 |
208,580 | octobercms/october | modules/backend/controllers/Users.php | Users.update_onRestore | public function update_onRestore($recordId)
{
$this->formFindModelObject($recordId)->restore();
Flash::success(Lang::get('backend::lang.form.restore_success', ['name' => Lang::get('backend::lang.user.name')]));
return Redirect::refresh();
} | php | public function update_onRestore($recordId)
{
$this->formFindModelObject($recordId)->restore();
Flash::success(Lang::get('backend::lang.form.restore_success', ['name' => Lang::get('backend::lang.user.name')]));
return Redirect::refresh();
} | [
"public",
"function",
"update_onRestore",
"(",
"$",
"recordId",
")",
"{",
"$",
"this",
"->",
"formFindModelObject",
"(",
"$",
"recordId",
")",
"->",
"restore",
"(",
")",
";",
"Flash",
"::",
"success",
"(",
"Lang",
"::",
"get",
"(",
"'backend::lang.form.resto... | Handle restoring users | [
"Handle",
"restoring",
"users"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/controllers/Users.php#L124-L131 |
208,581 | octobercms/october | modules/backend/controllers/Users.php | Users.myaccount | public function myaccount()
{
SettingsManager::setContext('October.Backend', 'myaccount');
$this->pageTitle = 'backend::lang.myaccount.menu_label';
return $this->update($this->user->id, 'myaccount');
} | php | public function myaccount()
{
SettingsManager::setContext('October.Backend', 'myaccount');
$this->pageTitle = 'backend::lang.myaccount.menu_label';
return $this->update($this->user->id, 'myaccount');
} | [
"public",
"function",
"myaccount",
"(",
")",
"{",
"SettingsManager",
"::",
"setContext",
"(",
"'October.Backend'",
",",
"'myaccount'",
")",
";",
"$",
"this",
"->",
"pageTitle",
"=",
"'backend::lang.myaccount.menu_label'",
";",
"return",
"$",
"this",
"->",
"update"... | My Settings controller | [
"My",
"Settings",
"controller"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/controllers/Users.php#L136-L142 |
208,582 | octobercms/october | modules/backend/controllers/Users.php | Users.myaccount_onSave | public function myaccount_onSave()
{
$result = $this->asExtension('FormController')->update_onSave($this->user->id, 'myaccount');
/*
* If the password or login name has been updated, reauthenticate the user
*/
$loginChanged = $this->user->login != post('User[login]');
... | php | public function myaccount_onSave()
{
$result = $this->asExtension('FormController')->update_onSave($this->user->id, 'myaccount');
/*
* If the password or login name has been updated, reauthenticate the user
*/
$loginChanged = $this->user->login != post('User[login]');
... | [
"public",
"function",
"myaccount_onSave",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"asExtension",
"(",
"'FormController'",
")",
"->",
"update_onSave",
"(",
"$",
"this",
"->",
"user",
"->",
"id",
",",
"'myaccount'",
")",
";",
"/*\n * If t... | Proxy update onSave event | [
"Proxy",
"update",
"onSave",
"event"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/controllers/Users.php#L147-L161 |
208,583 | octobercms/october | modules/backend/controllers/Users.php | Users.formExtendFields | public function formExtendFields($form)
{
if ($form->getContext() == 'myaccount') {
return;
}
if (!$this->user->isSuperUser()) {
$form->removeField('is_superuser');
}
/*
* Add permissions tab
*/
$form->addTabFields($this->ge... | php | public function formExtendFields($form)
{
if ($form->getContext() == 'myaccount') {
return;
}
if (!$this->user->isSuperUser()) {
$form->removeField('is_superuser');
}
/*
* Add permissions tab
*/
$form->addTabFields($this->ge... | [
"public",
"function",
"formExtendFields",
"(",
"$",
"form",
")",
"{",
"if",
"(",
"$",
"form",
"->",
"getContext",
"(",
")",
"==",
"'myaccount'",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"user",
"->",
"isSuperUser",
"(",
")",
... | Add available permission fields to the User form.
Mark default groups as checked for new Users. | [
"Add",
"available",
"permission",
"fields",
"to",
"the",
"User",
"form",
".",
"Mark",
"default",
"groups",
"as",
"checked",
"for",
"new",
"Users",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/controllers/Users.php#L167-L191 |
208,584 | octobercms/october | modules/cms/classes/ThemeManager.php | ThemeManager.setInstalled | public function setInstalled($code, $dirName = null)
{
if (!$dirName) {
$dirName = strtolower(str_replace('.', '-', $code));
}
$history = Parameter::get('system::theme.history', []);
$history[$code] = $dirName;
Parameter::set('system::theme.history', $history);
... | php | public function setInstalled($code, $dirName = null)
{
if (!$dirName) {
$dirName = strtolower(str_replace('.', '-', $code));
}
$history = Parameter::get('system::theme.history', []);
$history[$code] = $dirName;
Parameter::set('system::theme.history', $history);
... | [
"public",
"function",
"setInstalled",
"(",
"$",
"code",
",",
"$",
"dirName",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"dirName",
")",
"{",
"$",
"dirName",
"=",
"strtolower",
"(",
"str_replace",
"(",
"'.'",
",",
"'-'",
",",
"$",
"code",
")",
")",... | Flags a theme as being installed, so it is not downloaded twice.
@param string $code Theme code
@param string|null $dirName | [
"Flags",
"a",
"theme",
"as",
"being",
"installed",
"so",
"it",
"is",
"not",
"downloaded",
"twice",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ThemeManager.php#L46-L55 |
208,585 | octobercms/october | modules/cms/classes/ThemeManager.php | ThemeManager.setUninstalled | public function setUninstalled($code)
{
$history = Parameter::get('system::theme.history', []);
if (array_key_exists($code, $history)) {
unset($history[$code]);
}
Parameter::set('system::theme.history', $history);
} | php | public function setUninstalled($code)
{
$history = Parameter::get('system::theme.history', []);
if (array_key_exists($code, $history)) {
unset($history[$code]);
}
Parameter::set('system::theme.history', $history);
} | [
"public",
"function",
"setUninstalled",
"(",
"$",
"code",
")",
"{",
"$",
"history",
"=",
"Parameter",
"::",
"get",
"(",
"'system::theme.history'",
",",
"[",
"]",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"history",
")",
")",
... | Flags a theme as being uninstalled.
@param string $code Theme code | [
"Flags",
"a",
"theme",
"as",
"being",
"uninstalled",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ThemeManager.php#L61-L69 |
208,586 | octobercms/october | modules/cms/classes/ThemeManager.php | ThemeManager.findByDirName | public function findByDirName($dirName)
{
$installed = $this->getInstalled();
foreach ($installed as $code => $name) {
if ($dirName == $name) {
return $code;
}
}
return null;
} | php | public function findByDirName($dirName)
{
$installed = $this->getInstalled();
foreach ($installed as $code => $name) {
if ($dirName == $name) {
return $code;
}
}
return null;
} | [
"public",
"function",
"findByDirName",
"(",
"$",
"dirName",
")",
"{",
"$",
"installed",
"=",
"$",
"this",
"->",
"getInstalled",
"(",
")",
";",
"foreach",
"(",
"$",
"installed",
"as",
"$",
"code",
"=>",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"dirName"... | Returns an installed theme's code from it's dirname.
@return string | [
"Returns",
"an",
"installed",
"theme",
"s",
"code",
"from",
"it",
"s",
"dirname",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ThemeManager.php#L75-L85 |
208,587 | octobercms/october | modules/cms/classes/ThemeManager.php | ThemeManager.deleteTheme | public function deleteTheme($theme)
{
if (!$theme) {
return false;
}
if (is_string($theme)) {
$theme = CmsTheme::load($theme);
}
if ($theme->isActiveTheme()) {
throw new ApplicationException(trans('cms::lang.theme.delete_active_theme_fail... | php | public function deleteTheme($theme)
{
if (!$theme) {
return false;
}
if (is_string($theme)) {
$theme = CmsTheme::load($theme);
}
if ($theme->isActiveTheme()) {
throw new ApplicationException(trans('cms::lang.theme.delete_active_theme_fail... | [
"public",
"function",
"deleteTheme",
"(",
"$",
"theme",
")",
"{",
"if",
"(",
"!",
"$",
"theme",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"theme",
")",
")",
"{",
"$",
"theme",
"=",
"CmsTheme",
"::",
"load",
"(",
"$"... | Completely delete a theme from the system.
@param string $theme Theme code/namespace
@return void | [
"Completely",
"delete",
"a",
"theme",
"from",
"the",
"system",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ThemeManager.php#L96-L124 |
208,588 | octobercms/october | modules/cms/classes/Layout.php | Layout.initFallback | public static function initFallback($theme)
{
$obj = self::inTheme($theme);
$obj->markup = '{% page %}';
$obj->fileName = self::FALLBACK_FILE_NAME;
return $obj;
} | php | public static function initFallback($theme)
{
$obj = self::inTheme($theme);
$obj->markup = '{% page %}';
$obj->fileName = self::FALLBACK_FILE_NAME;
return $obj;
} | [
"public",
"static",
"function",
"initFallback",
"(",
"$",
"theme",
")",
"{",
"$",
"obj",
"=",
"self",
"::",
"inTheme",
"(",
"$",
"theme",
")",
";",
"$",
"obj",
"->",
"markup",
"=",
"'{% page %}'",
";",
"$",
"obj",
"->",
"fileName",
"=",
"self",
"::",... | Initializes the fallback layout.
@param \Cms\Classes\Theme $theme Specifies a theme the file belongs to.
@return \Cms\Classes\Layout | [
"Initializes",
"the",
"fallback",
"layout",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Layout.php#L26-L32 |
208,589 | octobercms/october | modules/backend/classes/BackendController.php | BackendController.passToCmsController | protected function passToCmsController($url)
{
if (class_exists('\Cms\Classes\Controller')) {
return App::make('Cms\Classes\Controller')->run($url);
} else {
return Response::make(View::make('backend::404'), 404);
}
} | php | protected function passToCmsController($url)
{
if (class_exists('\Cms\Classes\Controller')) {
return App::make('Cms\Classes\Controller')->run($url);
} else {
return Response::make(View::make('backend::404'), 404);
}
} | [
"protected",
"function",
"passToCmsController",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\Cms\\Classes\\Controller'",
")",
")",
"{",
"return",
"App",
"::",
"make",
"(",
"'Cms\\Classes\\Controller'",
")",
"->",
"run",
"(",
"$",
"url",
")",
... | Pass unhandled URLs to the CMS Controller, if it exists
@param string $url
@return Response | [
"Pass",
"unhandled",
"URLs",
"to",
"the",
"CMS",
"Controller",
"if",
"it",
"exists"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/BackendController.php#L69-L76 |
208,590 | octobercms/october | modules/backend/classes/BackendController.php | BackendController.findController | protected function findController($controller, $action, $inPath)
{
/*
* Workaround: Composer does not support case insensitivity.
*/
if (!class_exists($controller)) {
$controller = Str::normalizeClassName($controller);
$controllerFile = $inPath.strtolower(st... | php | protected function findController($controller, $action, $inPath)
{
/*
* Workaround: Composer does not support case insensitivity.
*/
if (!class_exists($controller)) {
$controller = Str::normalizeClassName($controller);
$controllerFile = $inPath.strtolower(st... | [
"protected",
"function",
"findController",
"(",
"$",
"controller",
",",
"$",
"action",
",",
"$",
"inPath",
")",
"{",
"/*\n * Workaround: Composer does not support case insensitivity.\n */",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"controller",
")",
")"... | This method is used internally.
Finds a backend controller with a callable action method.
@param string $controller Specifies a method name to execute.
@param string $action Specifies a method name to execute.
@param string $inPath Base path for class file location.
@return ControllerBase Returns the backend controller... | [
"This",
"method",
"is",
"used",
"internally",
".",
"Finds",
"a",
"backend",
"controller",
"with",
"a",
"callable",
"action",
"method",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/BackendController.php#L153-L177 |
208,591 | octobercms/october | modules/cms/models/ThemeLog.php | ThemeLog.bindEventsToModel | public static function bindEventsToModel(HalcyonModel $template)
{
$template->bindEvent('model.beforeDelete', function () use ($template) {
self::add($template, self::TYPE_DELETE);
});
$template->bindEvent('model.beforeSave', function () use ($template) {
self::add($... | php | public static function bindEventsToModel(HalcyonModel $template)
{
$template->bindEvent('model.beforeDelete', function () use ($template) {
self::add($template, self::TYPE_DELETE);
});
$template->bindEvent('model.beforeSave', function () use ($template) {
self::add($... | [
"public",
"static",
"function",
"bindEventsToModel",
"(",
"HalcyonModel",
"$",
"template",
")",
"{",
"$",
"template",
"->",
"bindEvent",
"(",
"'model.beforeDelete'",
",",
"function",
"(",
")",
"use",
"(",
"$",
"template",
")",
"{",
"self",
"::",
"add",
"(",
... | Adds observers to the model for logging purposes. | [
"Adds",
"observers",
"to",
"the",
"model",
"for",
"logging",
"purposes",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeLog.php#L40-L49 |
208,592 | octobercms/october | modules/backend/traits/FormModelSaver.php | FormModelSaver.prepareModelsToSave | protected function prepareModelsToSave($model, $saveData)
{
$this->modelsToSave = [];
$this->setModelAttributes($model, $saveData);
$this->modelsToSave = array_reverse($this->modelsToSave);
return $this->modelsToSave;
} | php | protected function prepareModelsToSave($model, $saveData)
{
$this->modelsToSave = [];
$this->setModelAttributes($model, $saveData);
$this->modelsToSave = array_reverse($this->modelsToSave);
return $this->modelsToSave;
} | [
"protected",
"function",
"prepareModelsToSave",
"(",
"$",
"model",
",",
"$",
"saveData",
")",
"{",
"$",
"this",
"->",
"modelsToSave",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"setModelAttributes",
"(",
"$",
"model",
",",
"$",
"saveData",
")",
";",
"$",
"... | Takes a model and fills it with data from a multidimensional array.
If an attribute is found to be a relationship, that relationship
is also filled.
$modelsToSave = $this->prepareModelsToSave($model, [...]);
foreach ($modelsToSave as $modelToSave) {
$modelToSave->save();
}
@param \October\Rain\Database\Model $model ... | [
"Takes",
"a",
"model",
"and",
"fills",
"it",
"with",
"data",
"from",
"a",
"multidimensional",
"array",
".",
"If",
"an",
"attribute",
"is",
"found",
"to",
"be",
"a",
"relationship",
"that",
"relationship",
"is",
"also",
"filled",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/FormModelSaver.php#L37-L43 |
208,593 | octobercms/october | modules/backend/traits/FormModelSaver.php | FormModelSaver.setModelAttributes | protected function setModelAttributes($model, $saveData)
{
$this->modelsToSave[] = $model;
if (!is_array($saveData)) {
return;
}
if ($model instanceof HalcyonModel) {
$model->fill($saveData);
return;
}
$attributesToPurge = [];
... | php | protected function setModelAttributes($model, $saveData)
{
$this->modelsToSave[] = $model;
if (!is_array($saveData)) {
return;
}
if ($model instanceof HalcyonModel) {
$model->fill($saveData);
return;
}
$attributesToPurge = [];
... | [
"protected",
"function",
"setModelAttributes",
"(",
"$",
"model",
",",
"$",
"saveData",
")",
"{",
"$",
"this",
"->",
"modelsToSave",
"[",
"]",
"=",
"$",
"model",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"saveData",
")",
")",
"{",
"return",
";",
"}"... | Sets a data collection to a model attributes, relations are also set.
@param \October\Rain\Database\Model $model Model to fill.
@param array $saveData Attribute values to fill model.
@return void | [
"Sets",
"a",
"data",
"collection",
"to",
"a",
"model",
"attributes",
"relations",
"are",
"also",
"set",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/FormModelSaver.php#L52-L88 |
208,594 | octobercms/october | modules/backend/traits/FormModelSaver.php | FormModelSaver.deferPurgedSaveAttributes | protected function deferPurgedSaveAttributes($model, $attributesToPurge)
{
if (!is_array($attributesToPurge)) {
return;
}
/*
* Compatibility with Purgeable trait:
* This will give the ability to restore purged attributes
* and make them available again... | php | protected function deferPurgedSaveAttributes($model, $attributesToPurge)
{
if (!is_array($attributesToPurge)) {
return;
}
/*
* Compatibility with Purgeable trait:
* This will give the ability to restore purged attributes
* and make them available again... | [
"protected",
"function",
"deferPurgedSaveAttributes",
"(",
"$",
"model",
",",
"$",
"attributesToPurge",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"attributesToPurge",
")",
")",
"{",
"return",
";",
"}",
"/*\n * Compatibility with Purgeable trait:\n ... | Removes an array of attributes from the model. If the model implements
the Purgeable trait, this is preferred over the internal logic.
@param \October\Rain\Database\Model $model Model to adjust.
@param array $attributesToPurge Attribute values to remove from the model.
@return void | [
"Removes",
"an",
"array",
"of",
"attributes",
"from",
"the",
"model",
".",
"If",
"the",
"model",
"implements",
"the",
"Purgeable",
"trait",
"this",
"is",
"preferred",
"over",
"the",
"internal",
"logic",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/FormModelSaver.php#L98-L119 |
208,595 | octobercms/october | modules/backend/classes/FormField.php | FormField.options | public function options($value = null)
{
if ($value === null) {
if (is_array($this->options)) {
return $this->options;
}
elseif (is_callable($this->options)) {
$callable = $this->options;
return $callable();
}
... | php | public function options($value = null)
{
if ($value === null) {
if (is_array($this->options)) {
return $this->options;
}
elseif (is_callable($this->options)) {
$callable = $this->options;
return $callable();
}
... | [
"public",
"function",
"options",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"options",
")",
")",
"{",
"return",
"$",
"this",
"->",
"options",
";",
"}"... | Sets field options, for dropdowns, radio lists and checkbox lists.
@param array $value
@return self | [
"Sets",
"field",
"options",
"for",
"dropdowns",
"radio",
"lists",
"and",
"checkbox",
"lists",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L224-L241 |
208,596 | octobercms/october | modules/backend/classes/FormField.php | FormField.comment | public function comment($text, $position = 'below', $isHtml = null)
{
$this->comment = $text;
$this->commentPosition = $position;
if ($isHtml !== null) {
$this->commentHtml = $isHtml;
}
return $this;
} | php | public function comment($text, $position = 'below', $isHtml = null)
{
$this->comment = $text;
$this->commentPosition = $position;
if ($isHtml !== null) {
$this->commentHtml = $isHtml;
}
return $this;
} | [
"public",
"function",
"comment",
"(",
"$",
"text",
",",
"$",
"position",
"=",
"'below'",
",",
"$",
"isHtml",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"comment",
"=",
"$",
"text",
";",
"$",
"this",
"->",
"commentPosition",
"=",
"$",
"position",
";",
... | Adds a text comment above or below the field.
@param string $text Specifies a comment text.
@param string $position Specifies a comment position.
@param bool $isHtml Set to true if you use HTML formatting in the comment
Supported values are 'below' and 'above' | [
"Adds",
"a",
"text",
"comment",
"above",
"or",
"below",
"the",
"field",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L350-L360 |
208,597 | octobercms/october | modules/backend/classes/FormField.php | FormField.isSelected | public function isSelected($value = true)
{
if ($this->value === null) {
return false;
}
return (string) $value === (string) $this->value;
} | php | public function isSelected($value = true)
{
if ($this->value === null) {
return false;
}
return (string) $value === (string) $this->value;
} | [
"public",
"function",
"isSelected",
"(",
"$",
"value",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"string",
")",
"$",
"value",
"===",
"(",
"string",
")",
"$",
... | Determine if the provided value matches this field's value.
@param string $value
@return bool | [
"Determine",
"if",
"the",
"provided",
"value",
"matches",
"this",
"field",
"s",
"value",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L367-L374 |
208,598 | octobercms/october | modules/backend/classes/FormField.php | FormField.getAttributes | public function getAttributes($position = 'field', $htmlBuild = true)
{
$result = array_get($this->attributes, $position, []);
$result = $this->filterAttributes($result, $position);
return $htmlBuild ? Html::attributes($result) : $result;
} | php | public function getAttributes($position = 'field', $htmlBuild = true)
{
$result = array_get($this->attributes, $position, []);
$result = $this->filterAttributes($result, $position);
return $htmlBuild ? Html::attributes($result) : $result;
} | [
"public",
"function",
"getAttributes",
"(",
"$",
"position",
"=",
"'field'",
",",
"$",
"htmlBuild",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"array_get",
"(",
"$",
"this",
"->",
"attributes",
",",
"$",
"position",
",",
"[",
"]",
")",
";",
"$",
"res... | Returns the attributes for this field at a given position.
@param string $position
@return array | [
"Returns",
"the",
"attributes",
"for",
"this",
"field",
"at",
"a",
"given",
"position",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L423-L429 |
208,599 | octobercms/october | modules/backend/classes/FormField.php | FormField.filterAttributes | protected function filterAttributes($attributes, $position = 'field')
{
$position = strtolower($position);
$attributes = $this->filterTriggerAttributes($attributes, $position);
$attributes = $this->filterPresetAttributes($attributes, $position);
if ($position == 'field' && $this->d... | php | protected function filterAttributes($attributes, $position = 'field')
{
$position = strtolower($position);
$attributes = $this->filterTriggerAttributes($attributes, $position);
$attributes = $this->filterPresetAttributes($attributes, $position);
if ($position == 'field' && $this->d... | [
"protected",
"function",
"filterAttributes",
"(",
"$",
"attributes",
",",
"$",
"position",
"=",
"'field'",
")",
"{",
"$",
"position",
"=",
"strtolower",
"(",
"$",
"position",
")",
";",
"$",
"attributes",
"=",
"$",
"this",
"->",
"filterTriggerAttributes",
"("... | Adds any circumstantial attributes to the field based on other
settings, such as the 'disabled' option.
@param array $attributes
@param string $position
@return array | [
"Adds",
"any",
"circumstantial",
"attributes",
"to",
"the",
"field",
"based",
"on",
"other",
"settings",
"such",
"as",
"the",
"disabled",
"option",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L438-L458 |
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.