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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
217,400 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Printer/HTMLDefinition.php | HTMLPurifier_Printer_HTMLDefinition.listifyObjectList | protected function listifyObjectList($array)
{
ksort($array);
$list = array();
foreach ($array as $obj) {
$list[] = $this->getClass($obj, 'AttrTransform_');
}
return $this->listify($list);
} | php | protected function listifyObjectList($array)
{
ksort($array);
$list = array();
foreach ($array as $obj) {
$list[] = $this->getClass($obj, 'AttrTransform_');
}
return $this->listify($list);
} | [
"protected",
"function",
"listifyObjectList",
"(",
"$",
"array",
")",
"{",
"ksort",
"(",
"$",
"array",
")",
";",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"obj",
")",
"{",
"$",
"list",
"[",
"]",
"=",
"$",
... | Listifies a list of objects by retrieving class names and internal state
@param array $array List of objects
@return string
@todo Also add information about internal state | [
"Listifies",
"a",
"list",
"of",
"objects",
"by",
"retrieving",
"class",
"names",
"and",
"internal",
"state"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Printer/HTMLDefinition.php#L280-L288 |
217,401 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Printer/HTMLDefinition.php | HTMLPurifier_Printer_HTMLDefinition.heavyHeader | protected function heavyHeader($text, $num = 1)
{
$ret = '';
$ret .= $this->start('tr');
$ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy'));
$ret .= $this->end('tr');
return $ret;
} | php | protected function heavyHeader($text, $num = 1)
{
$ret = '';
$ret .= $this->start('tr');
$ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy'));
$ret .= $this->end('tr');
return $ret;
} | [
"protected",
"function",
"heavyHeader",
"(",
"$",
"text",
",",
"$",
"num",
"=",
"1",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"$",
"ret",
".=",
"$",
"this",
"->",
"start",
"(",
"'tr'",
")",
";",
"$",
"ret",
".=",
"$",
"this",
"->",
"element",
"(",... | Creates a heavy header row
@param string $text
@param int $num
@return string | [
"Creates",
"a",
"heavy",
"header",
"row"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Printer/HTMLDefinition.php#L314-L321 |
217,402 | moodle/moodle | lib/pear/HTML/QuickForm/Rule/Range.php | HTML_QuickForm_Rule_Range.validate | function validate($value, $options = null)
{
$length = core_text::strlen($value);
switch ($this->name) {
case 'minlength': return ($length >= $options);
case 'maxlength': return ($length <= $options);
default: return ($length >= $options[0] && $length <= ... | php | function validate($value, $options = null)
{
$length = core_text::strlen($value);
switch ($this->name) {
case 'minlength': return ($length >= $options);
case 'maxlength': return ($length <= $options);
default: return ($length >= $options[0] && $length <= ... | [
"function",
"validate",
"(",
"$",
"value",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"length",
"=",
"core_text",
"::",
"strlen",
"(",
"$",
"value",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"name",
")",
"{",
"case",
"'minlength'",
":",
"re... | Validates a value using a range comparison
@param string $value Value to be checked
@param mixed $options Int for length, array for range
@access public
@return boolean true if value is valid | [
"Validates",
"a",
"value",
"using",
"a",
"range",
"comparison"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/Rule/Range.php#L37-L45 |
217,403 | moodle/moodle | lib/pear/HTML/QuickForm/Rule/Range.php | HTML_QuickForm_Rule_Range.getValidationScript | function getValidationScript($options = null)
{
switch ($this->name) {
case 'minlength':
$test = '{jsVar}.length < '.$options;
break;
case 'maxlength':
$test = '{jsVar}.length > '.$options;
break;
default:
... | php | function getValidationScript($options = null)
{
switch ($this->name) {
case 'minlength':
$test = '{jsVar}.length < '.$options;
break;
case 'maxlength':
$test = '{jsVar}.length > '.$options;
break;
default:
... | [
"function",
"getValidationScript",
"(",
"$",
"options",
"=",
"null",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"name",
")",
"{",
"case",
"'minlength'",
":",
"$",
"test",
"=",
"'{jsVar}.length < '",
".",
"$",
"options",
";",
"break",
";",
"case",
"'maxl... | end func validate | [
"end",
"func",
"validate"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/HTML/QuickForm/Rule/Range.php#L48-L61 |
217,404 | moodle/moodle | portfolio/mahara/lib.php | portfolio_plugin_mahara.send_intent | public function send_intent() {
global $CFG, $DB;
require_once($CFG->dirroot . '/mnet/xmlrpc/client.php');
$client = new mnet_xmlrpc_client();
$client->set_method('portfolio/mahara/lib.php/send_content_intent');
$client->add_param($this->get('user')->username);
$this->ens... | php | public function send_intent() {
global $CFG, $DB;
require_once($CFG->dirroot . '/mnet/xmlrpc/client.php');
$client = new mnet_xmlrpc_client();
$client->set_method('portfolio/mahara/lib.php/send_content_intent');
$client->add_param($this->get('user')->username);
$this->ens... | [
"public",
"function",
"send_intent",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mnet/xmlrpc/client.php'",
")",
";",
"$",
"client",
"=",
"new",
"mnet_xmlrpc_client",
"(",
")",
";",
"... | sends the 'content_intent' ping to mahara
if all goes well, this will set the 'token' and 'sendtype' member variables. | [
"sends",
"the",
"content_intent",
"ping",
"to",
"mahara",
"if",
"all",
"goes",
"well",
"this",
"will",
"set",
"the",
"token",
"and",
"sendtype",
"member",
"variables",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/portfolio/mahara/lib.php#L270-L307 |
217,405 | moodle/moodle | search/classes/area_category.php | area_category.set_areas | public function set_areas(array $areas) {
foreach ($areas as $area) {
if ($area instanceof base && !key_exists($area->get_area_id(), $this->areas)) {
$this->areas[$area->get_area_id()] = $area;
}
}
} | php | public function set_areas(array $areas) {
foreach ($areas as $area) {
if ($area instanceof base && !key_exists($area->get_area_id(), $this->areas)) {
$this->areas[$area->get_area_id()] = $area;
}
}
} | [
"public",
"function",
"set_areas",
"(",
"array",
"$",
"areas",
")",
"{",
"foreach",
"(",
"$",
"areas",
"as",
"$",
"area",
")",
"{",
"if",
"(",
"$",
"area",
"instanceof",
"base",
"&&",
"!",
"key_exists",
"(",
"$",
"area",
"->",
"get_area_id",
"(",
")"... | Set list of search areas for this category,
@param \core_search\base[] $areas | [
"Set",
"list",
"of",
"search",
"areas",
"for",
"this",
"category"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/search/classes/area_category.php#L118-L124 |
217,406 | moodle/moodle | backup/util/structure/backup_nested_element.class.php | backup_nested_element.process | public function process($processor) {
if (!$processor instanceof base_processor) { // No correct processor, throw exception
throw new base_element_struct_exception('incorrect_processor');
}
$iterator = $this->get_iterator($processor); // Get the iterator over backup-able data
... | php | public function process($processor) {
if (!$processor instanceof base_processor) { // No correct processor, throw exception
throw new base_element_struct_exception('incorrect_processor');
}
$iterator = $this->get_iterator($processor); // Get the iterator over backup-able data
... | [
"public",
"function",
"process",
"(",
"$",
"processor",
")",
"{",
"if",
"(",
"!",
"$",
"processor",
"instanceof",
"base_processor",
")",
"{",
"// No correct processor, throw exception",
"throw",
"new",
"base_element_struct_exception",
"(",
"'incorrect_processor'",
")",
... | Process the nested element
@param object $processor the processor
@return void | [
"Process",
"the",
"nested",
"element"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/structure/backup_nested_element.class.php#L72-L126 |
217,407 | moodle/moodle | backup/util/structure/backup_nested_element.class.php | backup_nested_element.add_log | protected function add_log($message, $level, $a = null, $depth = null, $display = false) {
// Adding the result to the oldest parent.
if ($this->get_parent()) {
$parent = $this->get_grandparent();
$parent->add_log($message, $level, $a, $depth, $display);
} else {
... | php | protected function add_log($message, $level, $a = null, $depth = null, $display = false) {
// Adding the result to the oldest parent.
if ($this->get_parent()) {
$parent = $this->get_grandparent();
$parent->add_log($message, $level, $a, $depth, $display);
} else {
... | [
"protected",
"function",
"add_log",
"(",
"$",
"message",
",",
"$",
"level",
",",
"$",
"a",
"=",
"null",
",",
"$",
"depth",
"=",
"null",
",",
"$",
"display",
"=",
"false",
")",
"{",
"// Adding the result to the oldest parent.",
"if",
"(",
"$",
"this",
"->... | Saves a log message to an array
@see backup_helper::log()
@param string $message to add to the logs
@param int $level level of importance {@link backup::LOG_DEBUG} and other constants
@param mixed $a to be included in $message
@param int $depth of the message
@param display $bool supporting translation via get_string(... | [
"Saves",
"a",
"log",
"message",
"to",
"an",
"array"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/structure/backup_nested_element.class.php#L139-L153 |
217,408 | moodle/moodle | backup/util/structure/backup_nested_element.class.php | backup_nested_element.add_result | protected function add_result($result) {
if (is_array($result)) {
// Adding the result to the oldest parent.
if ($this->get_parent()) {
$parent = $this->get_grandparent();
$parent->add_result($result);
} else {
$this->results = ... | php | protected function add_result($result) {
if (is_array($result)) {
// Adding the result to the oldest parent.
if ($this->get_parent()) {
$parent = $this->get_grandparent();
$parent->add_result($result);
} else {
$this->results = ... | [
"protected",
"function",
"add_result",
"(",
"$",
"result",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"result",
")",
")",
"{",
"// Adding the result to the oldest parent.",
"if",
"(",
"$",
"this",
"->",
"get_parent",
"(",
")",
")",
"{",
"$",
"parent",
"=",... | Saves the results to an array
@param array $result associative array
@return void | [
"Saves",
"the",
"results",
"to",
"an",
"array"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/structure/backup_nested_element.class.php#L161-L171 |
217,409 | moodle/moodle | grade/report/history/classes/helper.php | helper.get_users | public static function get_users($context, $search = '', $page = 0, $perpage = 25) {
global $DB;
list($sql, $params) = self::get_users_sql_and_params($context, $search);
$limitfrom = $page * $perpage;
$limitto = $limitfrom + $perpage;
$users = $DB->get_records_sql($sql, $params,... | php | public static function get_users($context, $search = '', $page = 0, $perpage = 25) {
global $DB;
list($sql, $params) = self::get_users_sql_and_params($context, $search);
$limitfrom = $page * $perpage;
$limitto = $limitfrom + $perpage;
$users = $DB->get_records_sql($sql, $params,... | [
"public",
"static",
"function",
"get_users",
"(",
"$",
"context",
",",
"$",
"search",
"=",
"''",
",",
"$",
"page",
"=",
"0",
",",
"$",
"perpage",
"=",
"25",
")",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"sql",
",",
"$",
"params",
")",
"... | Retrieve a list of users.
We're interested in anyone that had a grade history in this course. This api returns a list of such users based on various
criteria passed.
@param \context $context Context of the page where the results would be shown.
@param string $search the text to search for (empty string = find all).
@... | [
"Retrieve",
"a",
"list",
"of",
"users",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/helper.php#L95-L103 |
217,410 | moodle/moodle | grade/report/history/classes/helper.php | helper.get_users_count | public static function get_users_count($context, $search = '') {
global $DB;
list($sql, $params) = self::get_users_sql_and_params($context, $search, true);
return $DB->count_records_sql($sql, $params);
} | php | public static function get_users_count($context, $search = '') {
global $DB;
list($sql, $params) = self::get_users_sql_and_params($context, $search, true);
return $DB->count_records_sql($sql, $params);
} | [
"public",
"static",
"function",
"get_users_count",
"(",
"$",
"context",
",",
"$",
"search",
"=",
"''",
")",
"{",
"global",
"$",
"DB",
";",
"list",
"(",
"$",
"sql",
",",
"$",
"params",
")",
"=",
"self",
"::",
"get_users_sql_and_params",
"(",
"$",
"conte... | Get total number of users present for the given search criteria.
@param \context $context Context of the page where the results would be shown.
@param string $search the text to search for (empty string = find all).
@return int number of users found. | [
"Get",
"total",
"number",
"of",
"users",
"present",
"for",
"the",
"given",
"search",
"criteria",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/helper.php#L113-L119 |
217,411 | moodle/moodle | grade/report/history/classes/helper.php | helper.get_users_sql_and_params | protected static function get_users_sql_and_params($context, $search = '', $count = false) {
// Fields we need from the user table.
$extrafields = get_extra_user_fields($context);
$params = array();
if (!empty($search)) {
list($filtersql, $params) = users_search_sql($search,... | php | protected static function get_users_sql_and_params($context, $search = '', $count = false) {
// Fields we need from the user table.
$extrafields = get_extra_user_fields($context);
$params = array();
if (!empty($search)) {
list($filtersql, $params) = users_search_sql($search,... | [
"protected",
"static",
"function",
"get_users_sql_and_params",
"(",
"$",
"context",
",",
"$",
"search",
"=",
"''",
",",
"$",
"count",
"=",
"false",
")",
"{",
"// Fields we need from the user table.",
"$",
"extrafields",
"=",
"get_extra_user_fields",
"(",
"$",
"con... | Get sql and params to use to get list of users.
@param \context $context Context of the page where the results would be shown.
@param string $search the text to search for (empty string = find all).
@param bool $count setting this to true, returns an sql to get count only instead of the complete data records.
@return... | [
"Get",
"sql",
"and",
"params",
"to",
"use",
"to",
"get",
"list",
"of",
"users",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/helper.php#L130-L159 |
217,412 | moodle/moodle | grade/report/history/classes/helper.php | helper.get_graders | public static function get_graders($courseid) {
global $DB;
$ufields = get_all_user_name_fields(true, 'u');
$sql = "SELECT u.id, $ufields
FROM {user} u
JOIN {grade_grades_history} ggh ON ggh.usermodified = u.id
JOIN {grade_items} gi ON gi.id... | php | public static function get_graders($courseid) {
global $DB;
$ufields = get_all_user_name_fields(true, 'u');
$sql = "SELECT u.id, $ufields
FROM {user} u
JOIN {grade_grades_history} ggh ON ggh.usermodified = u.id
JOIN {grade_items} gi ON gi.id... | [
"public",
"static",
"function",
"get_graders",
"(",
"$",
"courseid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"ufields",
"=",
"get_all_user_name_fields",
"(",
"true",
",",
"'u'",
")",
";",
"$",
"sql",
"=",
"\"SELECT u.id, $ufields\n FROM {user} u\... | Get a list of graders.
@param int $courseid Id of course for which we need to fetch graders.
@return array list of graders. | [
"Get",
"a",
"list",
"of",
"graders",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/helper.php#L168-L186 |
217,413 | moodle/moodle | grade/grading/form/rubric/backup/moodle2/backup_gradingform_rubric_plugin.class.php | backup_gradingform_rubric_plugin.define_definition_plugin_structure | protected function define_definition_plugin_structure() {
// Append data only if the grand-parent element has 'method' set to 'rubric'
$plugin = $this->get_plugin_element(null, '../../method', 'rubric');
// Create a visible container for our data
$pluginwrapper = new backup_nested_elem... | php | protected function define_definition_plugin_structure() {
// Append data only if the grand-parent element has 'method' set to 'rubric'
$plugin = $this->get_plugin_element(null, '../../method', 'rubric');
// Create a visible container for our data
$pluginwrapper = new backup_nested_elem... | [
"protected",
"function",
"define_definition_plugin_structure",
"(",
")",
"{",
"// Append data only if the grand-parent element has 'method' set to 'rubric'",
"$",
"plugin",
"=",
"$",
"this",
"->",
"get_plugin_element",
"(",
"null",
",",
"'../../method'",
",",
"'rubric'",
")",... | Declares rubric structures to append to the grading form definition | [
"Declares",
"rubric",
"structures",
"to",
"append",
"to",
"the",
"grading",
"form",
"definition"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/rubric/backup/moodle2/backup_gradingform_rubric_plugin.class.php#L39-L81 |
217,414 | moodle/moodle | login/set_password_form.php | login_set_password_form.definition | public function definition() {
global $CFG;
$mform = $this->_form;
$mform->setDisableShortforms(true);
$mform->addElement('header', 'setpassword', get_string('setpassword'), '');
// Include the username in the form so browsers will recognise that a password is being set.
... | php | public function definition() {
global $CFG;
$mform = $this->_form;
$mform->setDisableShortforms(true);
$mform->addElement('header', 'setpassword', get_string('setpassword'), '');
// Include the username in the form so browsers will recognise that a password is being set.
... | [
"public",
"function",
"definition",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"mform",
"=",
"$",
"this",
"->",
"_form",
";",
"$",
"mform",
"->",
"setDisableShortforms",
"(",
"true",
")",
";",
"$",
"mform",
"->",
"addElement",
"(",
"'header'",
",",... | Define the set password form. | [
"Define",
"the",
"set",
"password",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/login/set_password_form.php#L45-L82 |
217,415 | moodle/moodle | login/set_password_form.php | login_set_password_form.validation | public function validation($data, $files) {
$user = $this->_customdata;
$errors = parent::validation($data, $files);
// Ignore submitted username.
if ($data['password'] !== $data['password2']) {
$errors['password'] = get_string('passwordsdiffer');
$errors['passw... | php | public function validation($data, $files) {
$user = $this->_customdata;
$errors = parent::validation($data, $files);
// Ignore submitted username.
if ($data['password'] !== $data['password2']) {
$errors['password'] = get_string('passwordsdiffer');
$errors['passw... | [
"public",
"function",
"validation",
"(",
"$",
"data",
",",
"$",
"files",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"_customdata",
";",
"$",
"errors",
"=",
"parent",
"::",
"validation",
"(",
"$",
"data",
",",
"$",
"files",
")",
";",
"// Ignore su... | Perform extra password change validation.
@param array $data submitted form fields.
@param array $files submitted with the form.
@return array errors occuring during validation. | [
"Perform",
"extra",
"password",
"change",
"validation",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/login/set_password_form.php#L90-L115 |
217,416 | moodle/moodle | course/classes/analytics/target/no_teaching.php | no_teaching.is_valid_sample | public function is_valid_sample($sampleid, \core_analytics\analysable $analysable, $fortraining = true) {
$course = $this->retrieve('course', $sampleid);
$now = time();
// No courses without start date, no finished courses, no predictions before start - 1 week nor
// predictions for c... | php | public function is_valid_sample($sampleid, \core_analytics\analysable $analysable, $fortraining = true) {
$course = $this->retrieve('course', $sampleid);
$now = time();
// No courses without start date, no finished courses, no predictions before start - 1 week nor
// predictions for c... | [
"public",
"function",
"is_valid_sample",
"(",
"$",
"sampleid",
",",
"\\",
"core_analytics",
"\\",
"analysable",
"$",
"analysable",
",",
"$",
"fortraining",
"=",
"true",
")",
"{",
"$",
"course",
"=",
"$",
"this",
"->",
"retrieve",
"(",
"'course'",
",",
"$",... | Only process samples which start date is getting close.
@param int $sampleid
@param \core_analytics\analysable $analysable
@param bool $fortraining
@return bool | [
"Only",
"process",
"samples",
"which",
"start",
"date",
"is",
"getting",
"close",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/analytics/target/no_teaching.php#L148-L161 |
217,417 | moodle/moodle | lib/minify/matthiasmullie-minify/src/Minify.php | Minify.add | public function add($data /* $data = null, ... */)
{
// bogus "usage" of parameter $data: scrutinizer warns this variable is
// not used (we're using func_get_args instead to support overloading),
// but it still needs to be defined because it makes no sense to have
// this function ... | php | public function add($data /* $data = null, ... */)
{
// bogus "usage" of parameter $data: scrutinizer warns this variable is
// not used (we're using func_get_args instead to support overloading),
// but it still needs to be defined because it makes no sense to have
// this function ... | [
"public",
"function",
"add",
"(",
"$",
"data",
"/* $data = null, ... */",
")",
"{",
"// bogus \"usage\" of parameter $data: scrutinizer warns this variable is",
"// not used (we're using func_get_args instead to support overloading),",
"// but it still needs to be defined because it makes no s... | Add a file or straight-up code to be minified.
@param string|string[] $data
@return static | [
"Add",
"a",
"file",
"or",
"straight",
"-",
"up",
"code",
"to",
"be",
"minified",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/minify/matthiasmullie-minify/src/Minify.php#L60-L91 |
217,418 | moodle/moodle | lib/minify/matthiasmullie-minify/src/Minify.php | Minify.cache | public function cache(CacheItemInterface $item)
{
$content = $this->execute();
$item->set($content);
return $item;
} | php | public function cache(CacheItemInterface $item)
{
$content = $this->execute();
$item->set($content);
return $item;
} | [
"public",
"function",
"cache",
"(",
"CacheItemInterface",
"$",
"item",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"execute",
"(",
")",
";",
"$",
"item",
"->",
"set",
"(",
"$",
"content",
")",
";",
"return",
"$",
"item",
";",
"}"
] | Minify the data & write it to a CacheItemInterface object.
@param CacheItemInterface $item Cache item to write the data to
@return CacheItemInterface Cache item with the minifier data | [
"Minify",
"the",
"data",
"&",
"write",
"it",
"to",
"a",
"CacheItemInterface",
"object",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/minify/matthiasmullie-minify/src/Minify.php#L140-L146 |
217,419 | moodle/moodle | lib/minify/matthiasmullie-minify/src/Minify.php | Minify.save | protected function save($content, $path)
{
$handler = $this->openFileForWriting($path);
$this->writeToFile($handler, $content);
@fclose($handler);
} | php | protected function save($content, $path)
{
$handler = $this->openFileForWriting($path);
$this->writeToFile($handler, $content);
@fclose($handler);
} | [
"protected",
"function",
"save",
"(",
"$",
"content",
",",
"$",
"path",
")",
"{",
"$",
"handler",
"=",
"$",
"this",
"->",
"openFileForWriting",
"(",
"$",
"path",
")",
";",
"$",
"this",
"->",
"writeToFile",
"(",
"$",
"handler",
",",
"$",
"content",
")... | Save to file.
@param string $content The minified data
@param string $path The path to save the minified data to
@throws IOException | [
"Save",
"to",
"file",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/minify/matthiasmullie-minify/src/Minify.php#L187-L194 |
217,420 | moodle/moodle | lib/minify/matthiasmullie-minify/src/Minify.php | Minify.extractStrings | protected function extractStrings($chars = '\'"', $placeholderPrefix = '')
{
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$callback = function ($match) use ($minifier, $placeholderPrefix) {
// check the second index here, because the first al... | php | protected function extractStrings($chars = '\'"', $placeholderPrefix = '')
{
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$callback = function ($match) use ($minifier, $placeholderPrefix) {
// check the second index here, because the first al... | [
"protected",
"function",
"extractStrings",
"(",
"$",
"chars",
"=",
"'\\'\"'",
",",
"$",
"placeholderPrefix",
"=",
"''",
")",
"{",
"// PHP only supports $this inside anonymous functions since 5.4",
"$",
"minifier",
"=",
"$",
"this",
";",
"$",
"callback",
"=",
"functi... | Strings are a pattern we need to match, in order to ignore potential
code-like content inside them, but we just want all of the string
content to remain untouched.
This method will replace all string content with simple STRING#
placeholder text, so we've rid all strings from characters that may be
misinterpreted. Orig... | [
"Strings",
"are",
"a",
"pattern",
"we",
"need",
"to",
"match",
"in",
"order",
"to",
"ignore",
"potential",
"code",
"-",
"like",
"content",
"inside",
"them",
"but",
"we",
"just",
"want",
"all",
"of",
"the",
"string",
"content",
"to",
"remain",
"untouched",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/minify/matthiasmullie-minify/src/Minify.php#L329-L365 |
217,421 | moodle/moodle | mod/chat/classes/external.php | mod_chat_external.login_user | public static function login_user($chatid, $groupid = 0) {
global $DB;
$params = self::validate_parameters(self::login_user_parameters(),
array(
'chatid' => $chatid,
... | php | public static function login_user($chatid, $groupid = 0) {
global $DB;
$params = self::validate_parameters(self::login_user_parameters(),
array(
'chatid' => $chatid,
... | [
"public",
"static",
"function",
"login_user",
"(",
"$",
"chatid",
",",
"$",
"groupid",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"login_user_parameters",
"(",
")",
",",
"arra... | Log the current user into a chat room in the given chat.
@param int $chatid the chat instance id
@param int $groupid the user group id
@return array of warnings and the chat unique session id
@since Moodle 3.0
@throws moodle_exception | [
"Log",
"the",
"current",
"user",
"into",
"a",
"chat",
"room",
"in",
"the",
"given",
"chat",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/chat/classes/external.php#L70-L118 |
217,422 | moodle/moodle | mod/chat/classes/external.php | mod_chat_external.get_chat_users | public static function get_chat_users($chatsid) {
global $DB, $PAGE;
$params = self::validate_parameters(self::get_chat_users_parameters(),
array(
'chatsid' => $chatsid
... | php | public static function get_chat_users($chatsid) {
global $DB, $PAGE;
$params = self::validate_parameters(self::get_chat_users_parameters(),
array(
'chatsid' => $chatsid
... | [
"public",
"static",
"function",
"get_chat_users",
"(",
"$",
"chatsid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_chat_users_parameters",
"(",
")",
",",
"array",
"(... | Get the list of users in the given chat session.
@param int $chatsid the chat session id
@return array of warnings and the user lists
@since Moodle 3.0
@throws moodle_exception | [
"Get",
"the",
"list",
"of",
"users",
"in",
"the",
"given",
"chat",
"session",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/chat/classes/external.php#L157-L201 |
217,423 | moodle/moodle | mod/chat/classes/external.php | mod_chat_external.send_chat_message | public static function send_chat_message($chatsid, $messagetext, $beepid = '') {
global $DB;
$params = self::validate_parameters(self::send_chat_message_parameters(),
array(
'chatsid' => $chatsid,
... | php | public static function send_chat_message($chatsid, $messagetext, $beepid = '') {
global $DB;
$params = self::validate_parameters(self::send_chat_message_parameters(),
array(
'chatsid' => $chatsid,
... | [
"public",
"static",
"function",
"send_chat_message",
"(",
"$",
"chatsid",
",",
"$",
"messagetext",
",",
"$",
"beepid",
"=",
"''",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"send_chat_mes... | Send a message on the given chat session.
@param int $chatsid the chat session id
@param string $messagetext the message text
@param string $beepid the beep message id
@return array of warnings and the new message id (0 if the message was empty)
@since Moodle 3.0
@throws moodle_exception | [
"Send",
"a",
"message",
"on",
"the",
"given",
"chat",
"session",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/chat/classes/external.php#L254-L297 |
217,424 | moodle/moodle | mod/chat/classes/external.php | mod_chat_external.get_chats_by_courses | public static function get_chats_by_courses($courseids = array()) {
global $CFG;
$returnedchats = array();
$warnings = array();
$params = self::validate_parameters(self::get_chats_by_courses_parameters(), array('courseids' => $courseids));
$courses = array();
if (empty... | php | public static function get_chats_by_courses($courseids = array()) {
global $CFG;
$returnedchats = array();
$warnings = array();
$params = self::validate_parameters(self::get_chats_by_courses_parameters(), array('courseids' => $courseids));
$courses = array();
if (empty... | [
"public",
"static",
"function",
"get_chats_by_courses",
"(",
"$",
"courseids",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"returnedchats",
"=",
"array",
"(",
")",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
... | Returns a list of chats in a provided list of courses,
if no list is provided all chats that the user can view will be returned.
@param array $courseids the course ids
@return array of chats details
@since Moodle 3.0 | [
"Returns",
"a",
"list",
"of",
"chats",
"in",
"a",
"provided",
"list",
"of",
"courses",
"if",
"no",
"list",
"is",
"provided",
"all",
"chats",
"that",
"the",
"user",
"can",
"view",
"will",
"be",
"returned",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/chat/classes/external.php#L520-L578 |
217,425 | moodle/moodle | mod/chat/classes/external.php | mod_chat_external.get_chats_by_courses_returns | public static function get_chats_by_courses_returns() {
return new external_single_structure(
array(
'chats' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PA... | php | public static function get_chats_by_courses_returns() {
return new external_single_structure(
array(
'chats' => new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PA... | [
"public",
"static",
"function",
"get_chats_by_courses_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'chats'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"... | Describes the get_chats_by_courses return value.
@return external_single_structure
@since Moodle 3.0 | [
"Describes",
"the",
"get_chats_by_courses",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/chat/classes/external.php#L586-L616 |
217,426 | moodle/moodle | mod/chat/classes/external.php | mod_chat_external.get_sessions | public static function get_sessions($chatid, $groupid = 0, $showall = false) {
global $DB;
$params = self::validate_parameters(self::get_sessions_parameters(),
array(
'chatid' => $chatid,
... | php | public static function get_sessions($chatid, $groupid = 0, $showall = false) {
global $DB;
$params = self::validate_parameters(self::get_sessions_parameters(),
array(
'chatid' => $chatid,
... | [
"public",
"static",
"function",
"get_sessions",
"(",
"$",
"chatid",
",",
"$",
"groupid",
"=",
"0",
",",
"$",
"showall",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_s... | Retrieves chat sessions for a given chat.
@param int $chatid the chat instance id
@param int $groupid filter messages by this group. 0 to determine the group.
@param bool $showall whether to include incomplete sessions or not
@return array of warnings and the sessions
@since Moodle 3.4
@throws moodle_exception | [
"Retrieves",
"chat",
"sessions",
"for",
"a",
"given",
"chat",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/chat/classes/external.php#L645-L707 |
217,427 | moodle/moodle | mod/chat/classes/external.php | mod_chat_external.get_session_messages | public static function get_session_messages($chatid, $sessionstart, $sessionend, $groupid = 0) {
global $DB, $PAGE;
$params = self::validate_parameters(self::get_session_messages_parameters(),
array(
'chatid' =>... | php | public static function get_session_messages($chatid, $sessionstart, $sessionend, $groupid = 0) {
global $DB, $PAGE;
$params = self::validate_parameters(self::get_session_messages_parameters(),
array(
'chatid' =>... | [
"public",
"static",
"function",
"get_session_messages",
"(",
"$",
"chatid",
",",
"$",
"sessionstart",
",",
"$",
"sessionend",
",",
"$",
"groupid",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"valida... | Retrieves messages of the given chat session.
@param int $chatid the chat instance id
@param int $sessionstart the session start time (timestamp)
@param int $sessionend the session end time (timestamp)
@param int $groupid filter messages by this group. 0 to determine the group.
@return array of warnings and the messag... | [
"Retrieves",
"messages",
"of",
"the",
"given",
"chat",
"session",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/chat/classes/external.php#L770-L826 |
217,428 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.fetch_users_grades | public static function fetch_users_grades($grade_item, $userids, $include_missing=true) {
global $DB;
// hmm, there might be a problem with length of sql query
// if there are too many users requested - we might run out of memory anyway
$limit = 2000;
$count = count($userids);
... | php | public static function fetch_users_grades($grade_item, $userids, $include_missing=true) {
global $DB;
// hmm, there might be a problem with length of sql query
// if there are too many users requested - we might run out of memory anyway
$limit = 2000;
$count = count($userids);
... | [
"public",
"static",
"function",
"fetch_users_grades",
"(",
"$",
"grade_item",
",",
"$",
"userids",
",",
"$",
"include_missing",
"=",
"true",
")",
"{",
"global",
"$",
"DB",
";",
"// hmm, there might be a problem with length of sql query",
"// if there are too many users re... | Returns array of grades for given grade_item+users
@param grade_item $grade_item
@param array $userids
@param bool $include_missing include grades that do not exist yet
@return array userid=>grade_grade array | [
"Returns",
"array",
"of",
"grades",
"for",
"given",
"grade_item",
"+",
"users"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L199-L233 |
217,429 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.is_editable | public function is_editable() {
if ($this->is_locked()) {
return false;
}
$grade_item = $this->load_grade_item();
if ($grade_item->gradetype == GRADE_TYPE_NONE) {
return false;
}
if ($grade_item->is_course_item() or $grade_item->is_category_item... | php | public function is_editable() {
if ($this->is_locked()) {
return false;
}
$grade_item = $this->load_grade_item();
if ($grade_item->gradetype == GRADE_TYPE_NONE) {
return false;
}
if ($grade_item->is_course_item() or $grade_item->is_category_item... | [
"public",
"function",
"is_editable",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_locked",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"grade_item",
"=",
"$",
"this",
"->",
"load_grade_item",
"(",
")",
";",
"if",
"(",
"$",
"grade_item",... | Is grading object editable?
@return bool | [
"Is",
"grading",
"object",
"editable?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L263-L279 |
217,430 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.get_grade_min_and_max | protected function get_grade_min_and_max() {
global $CFG;
$this->load_grade_item();
// When the following setting is turned on we use the grade_grade raw min and max values.
$minmaxtouse = grade_get_setting($this->grade_item->courseid, 'minmaxtouse', $CFG->grade_minmaxtouse);
/... | php | protected function get_grade_min_and_max() {
global $CFG;
$this->load_grade_item();
// When the following setting is turned on we use the grade_grade raw min and max values.
$minmaxtouse = grade_get_setting($this->grade_item->courseid, 'minmaxtouse', $CFG->grade_minmaxtouse);
/... | [
"protected",
"function",
"get_grade_min_and_max",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"this",
"->",
"load_grade_item",
"(",
")",
";",
"// When the following setting is turned on we use the grade_grade raw min and max values.",
"$",
"minmaxtouse",
"=",
"grade_get_... | Returns the minimum and maximum number of points this grade is graded with respect to.
@since Moodle 2.8.7, 2.9.1
@return array A list containing, in order, the minimum and maximum number of points. | [
"Returns",
"the",
"minimum",
"and",
"maximum",
"number",
"of",
"points",
"this",
"grade",
"is",
"graded",
"with",
"respect",
"to",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L362-L389 |
217,431 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.get_dategraded | public function get_dategraded() {
//TODO: HACK - create new fields (MDL-31379)
if (is_null($this->finalgrade) and is_null($this->feedback)) {
return null; // no grade == no date
} else if ($this->overridden) {
return $this->overridden;
} else {
return... | php | public function get_dategraded() {
//TODO: HACK - create new fields (MDL-31379)
if (is_null($this->finalgrade) and is_null($this->feedback)) {
return null; // no grade == no date
} else if ($this->overridden) {
return $this->overridden;
} else {
return... | [
"public",
"function",
"get_dategraded",
"(",
")",
"{",
"//TODO: HACK - create new fields (MDL-31379)",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"finalgrade",
")",
"and",
"is_null",
"(",
"$",
"this",
"->",
"feedback",
")",
")",
"{",
"return",
"null",
";",
... | Returns timestamp when last graded, null if no grade present
@return int | [
"Returns",
"timestamp",
"when",
"last",
"graded",
"null",
"if",
"no",
"grade",
"present"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L420-L429 |
217,432 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.set_overridden | public function set_overridden($state, $refresh = true) {
if (empty($this->overridden) and $state) {
$this->overridden = time();
$this->update();
return true;
} else if (!empty($this->overridden) and !$state) {
$this->overridden = 0;
$this->up... | php | public function set_overridden($state, $refresh = true) {
if (empty($this->overridden) and $state) {
$this->overridden = time();
$this->update();
return true;
} else if (!empty($this->overridden) and !$state) {
$this->overridden = 0;
$this->up... | [
"public",
"function",
"set_overridden",
"(",
"$",
"state",
",",
"$",
"refresh",
"=",
"true",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"overridden",
")",
"and",
"$",
"state",
")",
"{",
"$",
"this",
"->",
"overridden",
"=",
"time",
"(",
... | Set the overridden status of grade
@param bool $state requested overridden state
@param bool $refresh refresh grades from external activities if needed
@return bool true is db state changed | [
"Set",
"the",
"overridden",
"status",
"of",
"grade"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L438-L456 |
217,433 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.set_excluded | public function set_excluded($state) {
if (empty($this->excluded) and $state) {
$this->excluded = time();
$this->update();
return true;
} else if (!empty($this->excluded) and !$state) {
$this->excluded = 0;
$this->update();
return ... | php | public function set_excluded($state) {
if (empty($this->excluded) and $state) {
$this->excluded = time();
$this->update();
return true;
} else if (!empty($this->excluded) and !$state) {
$this->excluded = 0;
$this->update();
return ... | [
"public",
"function",
"set_excluded",
"(",
"$",
"state",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"excluded",
")",
"and",
"$",
"state",
")",
"{",
"$",
"this",
"->",
"excluded",
"=",
"time",
"(",
")",
";",
"$",
"this",
"->",
"update",
... | Set the excluded status of grade
@param bool $state requested excluded state
@return bool True is database state changed | [
"Set",
"the",
"excluded",
"status",
"of",
"grade"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L473-L485 |
217,434 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.get_locktime | public function get_locktime() {
$this->load_grade_item();
$item_locktime = $this->grade_item->get_locktime();
if (empty($this->locktime) or ($item_locktime and $item_locktime < $this->locktime)) {
return $item_locktime;
} else {
return $this->locktime;
... | php | public function get_locktime() {
$this->load_grade_item();
$item_locktime = $this->grade_item->get_locktime();
if (empty($this->locktime) or ($item_locktime and $item_locktime < $this->locktime)) {
return $item_locktime;
} else {
return $this->locktime;
... | [
"public",
"function",
"get_locktime",
"(",
")",
"{",
"$",
"this",
"->",
"load_grade_item",
"(",
")",
";",
"$",
"item_locktime",
"=",
"$",
"this",
"->",
"grade_item",
"->",
"get_locktime",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"lock... | Get the locktime for this grade.
@return int $locktime timestamp for lock to activate | [
"Get",
"the",
"locktime",
"for",
"this",
"grade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L565-L576 |
217,435 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.is_passed | public function is_passed($grade_item = null) {
if (empty($grade_item)) {
if (!isset($this->grade_item)) {
$this->load_grade_item();
}
} else {
$this->grade_item = $grade_item;
$this->itemid = $grade_item->id;
}
// Return n... | php | public function is_passed($grade_item = null) {
if (empty($grade_item)) {
if (!isset($this->grade_item)) {
$this->load_grade_item();
}
} else {
$this->grade_item = $grade_item;
$this->itemid = $grade_item->id;
}
// Return n... | [
"public",
"function",
"is_passed",
"(",
"$",
"grade_item",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"grade_item",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"grade_item",
")",
")",
"{",
"$",
"this",
"->",
"load_grad... | Returns true if the grade's value is superior or equal to the grade item's gradepass value, false otherwise.
@param grade_item $grade_item An optional grade_item of which gradepass value we can use, saves having to load the grade_grade's grade_item
@return bool | [
"Returns",
"true",
"if",
"the",
"grade",
"s",
"value",
"is",
"superior",
"or",
"equal",
"to",
"the",
"grade",
"item",
"s",
"gradepass",
"value",
"false",
"otherwise",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L989-L1014 |
217,436 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.add_feedback_files | protected function add_feedback_files(int $historyid = null) {
global $CFG;
// We only support feedback files for modules atm.
if ($this->grade_item && $this->grade_item->is_external_item()) {
$context = $this->get_context();
$this->copy_feedback_files($context, GRADE_FE... | php | protected function add_feedback_files(int $historyid = null) {
global $CFG;
// We only support feedback files for modules atm.
if ($this->grade_item && $this->grade_item->is_external_item()) {
$context = $this->get_context();
$this->copy_feedback_files($context, GRADE_FE... | [
"protected",
"function",
"add_feedback_files",
"(",
"int",
"$",
"historyid",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"// We only support feedback files for modules atm.",
"if",
"(",
"$",
"this",
"->",
"grade_item",
"&&",
"$",
"this",
"->",
"grade_item",
... | Handles adding feedback files in the gradebook.
@param int|null $historyid | [
"Handles",
"adding",
"feedback",
"files",
"in",
"the",
"gradebook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L1049-L1063 |
217,437 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.update_feedback_files | protected function update_feedback_files(int $historyid = null) {
global $CFG;
// We only support feedback files for modules atm.
if ($this->grade_item && $this->grade_item->is_external_item()) {
$context = $this->get_context();
$fs = new file_storage();
$fs... | php | protected function update_feedback_files(int $historyid = null) {
global $CFG;
// We only support feedback files for modules atm.
if ($this->grade_item && $this->grade_item->is_external_item()) {
$context = $this->get_context();
$fs = new file_storage();
$fs... | [
"protected",
"function",
"update_feedback_files",
"(",
"int",
"$",
"historyid",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"// We only support feedback files for modules atm.",
"if",
"(",
"$",
"this",
"->",
"grade_item",
"&&",
"$",
"this",
"->",
"grade_item... | Handles updating feedback files in the gradebook.
@param int|null $historyid | [
"Handles",
"updating",
"feedback",
"files",
"in",
"the",
"gradebook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L1070-L1088 |
217,438 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.delete_feedback_files | protected function delete_feedback_files() {
// We only support feedback files for modules atm.
if ($this->grade_item && $this->grade_item->is_external_item()) {
$context = $this->get_context();
$fs = new file_storage();
$fs->delete_area_files($context->id, GRADE_FIL... | php | protected function delete_feedback_files() {
// We only support feedback files for modules atm.
if ($this->grade_item && $this->grade_item->is_external_item()) {
$context = $this->get_context();
$fs = new file_storage();
$fs->delete_area_files($context->id, GRADE_FIL... | [
"protected",
"function",
"delete_feedback_files",
"(",
")",
"{",
"// We only support feedback files for modules atm.",
"if",
"(",
"$",
"this",
"->",
"grade_item",
"&&",
"$",
"this",
"->",
"grade_item",
"->",
"is_external_item",
"(",
")",
")",
"{",
"$",
"context",
... | Handles deleting feedback files in the gradebook. | [
"Handles",
"deleting",
"feedback",
"files",
"in",
"the",
"gradebook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L1093-L1105 |
217,439 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.delete | public function delete($source = null) {
$success = parent::delete($source);
// If the grade was deleted successfully trigger a grade_deleted event.
if ($success) {
$this->load_grade_item();
\core\event\grade_deleted::create_from_grade($this)->trigger();
}
... | php | public function delete($source = null) {
$success = parent::delete($source);
// If the grade was deleted successfully trigger a grade_deleted event.
if ($success) {
$this->load_grade_item();
\core\event\grade_deleted::create_from_grade($this)->trigger();
}
... | [
"public",
"function",
"delete",
"(",
"$",
"source",
"=",
"null",
")",
"{",
"$",
"success",
"=",
"parent",
"::",
"delete",
"(",
"$",
"source",
")",
";",
"// If the grade was deleted successfully trigger a grade_deleted event.",
"if",
"(",
"$",
"success",
")",
"{"... | Deletes the grade_grade instance from the database.
@param string $source The location the deletion occurred (mod/forum, manual, etc.).
@return bool Returns true if the deletion was successful, false otherwise. | [
"Deletes",
"the",
"grade_grade",
"instance",
"from",
"the",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L1113-L1123 |
217,440 | moodle/moodle | lib/grade/grade_grade.php | grade_grade.copy_feedback_files | private function copy_feedback_files(context $context, string $filearea, int $itemid) {
if ($this->feedbackfiles) {
$filestocopycontextid = $this->feedbackfiles['contextid'];
$filestocopycomponent = $this->feedbackfiles['component'];
$filestocopyfilearea = $this->feedbackfile... | php | private function copy_feedback_files(context $context, string $filearea, int $itemid) {
if ($this->feedbackfiles) {
$filestocopycontextid = $this->feedbackfiles['contextid'];
$filestocopycomponent = $this->feedbackfiles['component'];
$filestocopyfilearea = $this->feedbackfile... | [
"private",
"function",
"copy_feedback_files",
"(",
"context",
"$",
"context",
",",
"string",
"$",
"filearea",
",",
"int",
"$",
"itemid",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"feedbackfiles",
")",
"{",
"$",
"filestocopycontextid",
"=",
"$",
"this",
"->",... | Handles copying feedback files to a specified gradebook file area.
@param context $context
@param string $filearea
@param int $itemid | [
"Handles",
"copying",
"feedback",
"files",
"to",
"a",
"specified",
"gradebook",
"file",
"area",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/grade/grade_grade.php#L1212-L1233 |
217,441 | moodle/moodle | lib/pear/PEAR/Exception.php | PEAR_Exception.getCauseMessage | public function getCauseMessage(&$causes)
{
$trace = $this->getTraceSafe();
$cause = array('class' => get_class($this),
'message' => $this->message,
'file' => 'unknown',
'line' => 'unknown');
if (isset($trace[0])) {
... | php | public function getCauseMessage(&$causes)
{
$trace = $this->getTraceSafe();
$cause = array('class' => get_class($this),
'message' => $this->message,
'file' => 'unknown',
'line' => 'unknown');
if (isset($trace[0])) {
... | [
"public",
"function",
"getCauseMessage",
"(",
"&",
"$",
"causes",
")",
"{",
"$",
"trace",
"=",
"$",
"this",
"->",
"getTraceSafe",
"(",
")",
";",
"$",
"cause",
"=",
"array",
"(",
"'class'",
"=>",
"get_class",
"(",
"$",
"this",
")",
",",
"'message'",
"... | Function must be public to call on caused exceptions
@param array | [
"Function",
"must",
"be",
"public",
"to",
"call",
"on",
"caused",
"exceptions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/pear/PEAR/Exception.php#L234-L289 |
217,442 | moodle/moodle | mod/assign/assignmentplugin.php | assign_plugin.is_first | public final function is_first() {
$order = get_config($this->get_subtype() . '_' . $this->get_type(), 'sortorder');
if ($order == 0) {
return true;
}
return false;
} | php | public final function is_first() {
$order = get_config($this->get_subtype() . '_' . $this->get_type(), 'sortorder');
if ($order == 0) {
return true;
}
return false;
} | [
"public",
"final",
"function",
"is_first",
"(",
")",
"{",
"$",
"order",
"=",
"get_config",
"(",
"$",
"this",
"->",
"get_subtype",
"(",
")",
".",
"'_'",
".",
"$",
"this",
"->",
"get_type",
"(",
")",
",",
"'sortorder'",
")",
";",
"if",
"(",
"$",
"ord... | Is this the first plugin in the list?
@return bool | [
"Is",
"this",
"the",
"first",
"plugin",
"in",
"the",
"list?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/assignmentplugin.php#L66-L73 |
217,443 | moodle/moodle | mod/assign/assignmentplugin.php | assign_plugin.is_last | public final function is_last() {
$lastindex = count(core_component::get_plugin_list($this->get_subtype()))-1;
$currentindex = get_config($this->get_subtype() . '_' . $this->get_type(), 'sortorder');
if ($lastindex == $currentindex) {
return true;
}
return false;
... | php | public final function is_last() {
$lastindex = count(core_component::get_plugin_list($this->get_subtype()))-1;
$currentindex = get_config($this->get_subtype() . '_' . $this->get_type(), 'sortorder');
if ($lastindex == $currentindex) {
return true;
}
return false;
... | [
"public",
"final",
"function",
"is_last",
"(",
")",
"{",
"$",
"lastindex",
"=",
"count",
"(",
"core_component",
"::",
"get_plugin_list",
"(",
"$",
"this",
"->",
"get_subtype",
"(",
")",
")",
")",
"-",
"1",
";",
"$",
"currentindex",
"=",
"get_config",
"("... | Is this the last plugin in the list?
@return bool | [
"Is",
"this",
"the",
"last",
"plugin",
"in",
"the",
"list?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/assignmentplugin.php#L80-L88 |
217,444 | moodle/moodle | mod/assign/assignmentplugin.php | assign_plugin.is_visible | public final function is_visible() {
if ($this->visiblecache === null) {
$disabled = get_config($this->get_subtype() . '_' . $this->get_type(), 'disabled');
$this->visiblecache = !$disabled;
}
return $this->visiblecache;
} | php | public final function is_visible() {
if ($this->visiblecache === null) {
$disabled = get_config($this->get_subtype() . '_' . $this->get_type(), 'disabled');
$this->visiblecache = !$disabled;
}
return $this->visiblecache;
} | [
"public",
"final",
"function",
"is_visible",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"visiblecache",
"===",
"null",
")",
"{",
"$",
"disabled",
"=",
"get_config",
"(",
"$",
"this",
"->",
"get_subtype",
"(",
")",
".",
"'_'",
".",
"$",
"this",
"->"... | Is this plugin enaled?
@return bool | [
"Is",
"this",
"plugin",
"enaled?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/assignmentplugin.php#L292-L298 |
217,445 | moodle/moodle | mod/assign/assignmentplugin.php | assign_plugin.has_admin_settings | public final function has_admin_settings() {
global $CFG;
$pluginroot = $CFG->dirroot . '/mod/assign/' . substr($this->get_subtype(), strlen('assign')) . '/' . $this->get_type();
$settingsfile = $pluginroot . '/settings.php';
return file_exists($settingsfile);
} | php | public final function has_admin_settings() {
global $CFG;
$pluginroot = $CFG->dirroot . '/mod/assign/' . substr($this->get_subtype(), strlen('assign')) . '/' . $this->get_type();
$settingsfile = $pluginroot . '/settings.php';
return file_exists($settingsfile);
} | [
"public",
"final",
"function",
"has_admin_settings",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"pluginroot",
"=",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/assign/'",
".",
"substr",
"(",
"$",
"this",
"->",
"get_subtype",
"(",
")",
",",
"strlen",
"(",... | Has this plugin got a custom settings.php file?
@return bool | [
"Has",
"this",
"plugin",
"got",
"a",
"custom",
"settings",
".",
"php",
"file?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/assignmentplugin.php#L306-L312 |
217,446 | moodle/moodle | mod/assign/assignmentplugin.php | assign_plugin.set_config | public final function set_config($name, $value) {
global $DB;
$dbparams = array('assignment'=>$this->assignment->get_instance()->id,
'subtype'=>$this->get_subtype(),
'plugin'=>$this->get_type(),
'name'=>$name);
$curre... | php | public final function set_config($name, $value) {
global $DB;
$dbparams = array('assignment'=>$this->assignment->get_instance()->id,
'subtype'=>$this->get_subtype(),
'plugin'=>$this->get_type(),
'name'=>$name);
$curre... | [
"public",
"final",
"function",
"set_config",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"dbparams",
"=",
"array",
"(",
"'assignment'",
"=>",
"$",
"this",
"->",
"assignment",
"->",
"get_instance",
"(",
")",
"->",
"id",... | Set a configuration value for this plugin
@param string $name The config key
@param string $value The config value
@return bool | [
"Set",
"a",
"configuration",
"value",
"for",
"this",
"plugin"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/assignmentplugin.php#L321-L343 |
217,447 | moodle/moodle | mod/assign/assignmentplugin.php | assign_plugin.get_config | public final function get_config($setting = null) {
global $DB;
if ($setting) {
if (!$this->assignment->has_instance()) {
return false;
}
$assignment = $this->assignment->get_instance();
if ($assignment) {
$dbparams = array... | php | public final function get_config($setting = null) {
global $DB;
if ($setting) {
if (!$this->assignment->has_instance()) {
return false;
}
$assignment = $this->assignment->get_instance();
if ($assignment) {
$dbparams = array... | [
"public",
"final",
"function",
"get_config",
"(",
"$",
"setting",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"setting",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"assignment",
"->",
"has_instance",
"(",
")",
")",
"{",
"retu... | Get a configuration value for this plugin
@param mixed $setting The config key (string) or null
@return mixed string | false | [
"Get",
"a",
"configuration",
"value",
"for",
"this",
"plugin"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/assignmentplugin.php#L351-L384 |
217,448 | moodle/moodle | mod/assign/assignmentplugin.php | assign_plugin.upgrade_settings | public function upgrade_settings(context $oldcontext, stdClass $oldassignment, & $log) {
$params = array('type'=>$this->type, 'subtype'=>$this->get_subtype());
$log .= ' ' . get_string('upgradenotimplemented', 'mod_assign', $params);
return false;
} | php | public function upgrade_settings(context $oldcontext, stdClass $oldassignment, & $log) {
$params = array('type'=>$this->type, 'subtype'=>$this->get_subtype());
$log .= ' ' . get_string('upgradenotimplemented', 'mod_assign', $params);
return false;
} | [
"public",
"function",
"upgrade_settings",
"(",
"context",
"$",
"oldcontext",
",",
"stdClass",
"$",
"oldassignment",
",",
"&",
"$",
"log",
")",
"{",
"$",
"params",
"=",
"array",
"(",
"'type'",
"=>",
"$",
"this",
"->",
"type",
",",
"'subtype'",
"=>",
"$",
... | Upgrade the settings from the old assignment to the new one
@param context $oldcontext The context for the old assignment module
@param stdClass $oldassignment The data record for the old assignment
@param string $log Record upgrade messages in the log
@return bool true or false - false will trigger a rollback | [
"Upgrade",
"the",
"settings",
"from",
"the",
"old",
"assignment",
"to",
"the",
"new",
"one"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/assignmentplugin.php#L498-L502 |
217,449 | moodle/moodle | mod/assign/assignmentplugin.php | assign_plugin.get_file_info | public function get_file_info($browser, $filearea, $itemid, $filepath, $filename) {
global $CFG, $DB, $USER;
$urlbase = $CFG->wwwroot.'/pluginfile.php';
$writeaccess = false;
// Permission check on the itemid.
$assignment = $this->assignment;
if ($this->get_subtype() == ... | php | public function get_file_info($browser, $filearea, $itemid, $filepath, $filename) {
global $CFG, $DB, $USER;
$urlbase = $CFG->wwwroot.'/pluginfile.php';
$writeaccess = false;
// Permission check on the itemid.
$assignment = $this->assignment;
if ($this->get_subtype() == ... | [
"public",
"function",
"get_file_info",
"(",
"$",
"browser",
",",
"$",
"filearea",
",",
"$",
"itemid",
",",
"$",
"filepath",
",",
"$",
"filename",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"urlbase",
"=",
"$",
"CFG"... | Default implementation of file_get_info for plugins.
This is used by the filebrowser to browse a plugins file areas.
This implementation should work for most plugins but can be overridden if required.
@param file_browser $browser
@param string $filearea
@param int $itemid
@param string $filepath
@param string $filenam... | [
"Default",
"implementation",
"of",
"file_get_info",
"for",
"plugins",
".",
"This",
"is",
"used",
"by",
"the",
"filebrowser",
"to",
"browse",
"a",
"plugins",
"file",
"areas",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/assignmentplugin.php#L580-L635 |
217,450 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.reset_caches | public static function reset_caches($phpunitreset = false) {
if ($phpunitreset) {
static::$singletoninstance = null;
} else {
if (static::$singletoninstance) {
static::$singletoninstance->pluginsinfo = null;
static::$singletoninstance->subpluginsin... | php | public static function reset_caches($phpunitreset = false) {
if ($phpunitreset) {
static::$singletoninstance = null;
} else {
if (static::$singletoninstance) {
static::$singletoninstance->pluginsinfo = null;
static::$singletoninstance->subpluginsin... | [
"public",
"static",
"function",
"reset_caches",
"(",
"$",
"phpunitreset",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"phpunitreset",
")",
"{",
"static",
"::",
"$",
"singletoninstance",
"=",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"static",
"::",
"$",
"s... | Reset all caches.
@param bool $phpunitreset | [
"Reset",
"all",
"caches",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L119-L138 |
217,451 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_installed_plugins | public function get_installed_plugins($type) {
$this->load_installed_plugins();
if (isset($this->installedplugins[$type])) {
return $this->installedplugins[$type];
}
return array();
} | php | public function get_installed_plugins($type) {
$this->load_installed_plugins();
if (isset($this->installedplugins[$type])) {
return $this->installedplugins[$type];
}
return array();
} | [
"public",
"function",
"get_installed_plugins",
"(",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"load_installed_plugins",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"installedplugins",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"$",
... | Return list of installed plugins of given type.
@param string $type
@return array $name=>$version | [
"Return",
"list",
"of",
"installed",
"plugins",
"of",
"given",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L212-L218 |
217,452 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_enabled_plugins | public function get_enabled_plugins($type) {
$this->load_enabled_plugins();
if (isset($this->enabledplugins[$type])) {
return $this->enabledplugins[$type];
}
return null;
} | php | public function get_enabled_plugins($type) {
$this->load_enabled_plugins();
if (isset($this->enabledplugins[$type])) {
return $this->enabledplugins[$type];
}
return null;
} | [
"public",
"function",
"get_enabled_plugins",
"(",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"load_enabled_plugins",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"enabledplugins",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"$",
"this"... | Get list of enabled plugins of given type,
the result may contain missing plugins.
@param string $type
@return array|null list of enabled plugins of this type, null if unknown | [
"Get",
"list",
"of",
"enabled",
"plugins",
"of",
"given",
"type",
"the",
"result",
"may",
"contain",
"missing",
"plugins",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L272-L278 |
217,453 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_present_plugins | public function get_present_plugins($type) {
$this->load_present_plugins();
if (isset($this->presentplugins[$type])) {
return $this->presentplugins[$type];
}
return null;
} | php | public function get_present_plugins($type) {
$this->load_present_plugins();
if (isset($this->presentplugins[$type])) {
return $this->presentplugins[$type];
}
return null;
} | [
"public",
"function",
"get_present_plugins",
"(",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"load_present_plugins",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"presentplugins",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"$",
"this"... | Get list of present plugins of given type.
@param string $type
@return array|null list of presnet plugins $name=>$diskversion, null if unknown | [
"Get",
"list",
"of",
"present",
"plugins",
"of",
"given",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L334-L340 |
217,454 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_plugins | public function get_plugins() {
$this->init_pluginsinfo_property();
// Make sure all types are initialised.
foreach ($this->pluginsinfo as $plugintype => $list) {
if ($list === null) {
$this->get_plugins_of_type($plugintype);
}
}
return $... | php | public function get_plugins() {
$this->init_pluginsinfo_property();
// Make sure all types are initialised.
foreach ($this->pluginsinfo as $plugintype => $list) {
if ($list === null) {
$this->get_plugins_of_type($plugintype);
}
}
return $... | [
"public",
"function",
"get_plugins",
"(",
")",
"{",
"$",
"this",
"->",
"init_pluginsinfo_property",
"(",
")",
";",
"// Make sure all types are initialised.",
"foreach",
"(",
"$",
"this",
"->",
"pluginsinfo",
"as",
"$",
"plugintype",
"=>",
"$",
"list",
")",
"{",
... | Returns a tree of known plugins and information about them
@return array 2D array. The first keys are plugin type names (e.g. qtype);
the second keys are the plugin local name (e.g. multichoice); and
the values are the corresponding objects extending {@link \core\plugininfo\base} | [
"Returns",
"a",
"tree",
"of",
"known",
"plugins",
"and",
"information",
"about",
"them"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L349-L360 |
217,455 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_plugins_of_type | public function get_plugins_of_type($type) {
global $CFG;
$this->init_pluginsinfo_property();
if (!array_key_exists($type, $this->pluginsinfo)) {
return array();
}
if (is_array($this->pluginsinfo[$type])) {
return $this->pluginsinfo[$type];
}
... | php | public function get_plugins_of_type($type) {
global $CFG;
$this->init_pluginsinfo_property();
if (!array_key_exists($type, $this->pluginsinfo)) {
return array();
}
if (is_array($this->pluginsinfo[$type])) {
return $this->pluginsinfo[$type];
}
... | [
"public",
"function",
"get_plugins_of_type",
"(",
"$",
"type",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"this",
"->",
"init_pluginsinfo_property",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"type",
",",
"$",
"this",
"->",
"pluginsinfo",
... | Returns list of known plugins of the given type.
This method returns the subset of the tree returned by {@link self::get_plugins()}.
If the given type is not known, empty array is returned.
@param string $type plugin type, e.g. 'mod' or 'workshopallocation'
@return \core\plugininfo\base[] (string)plugin name (e.g. 'w... | [
"Returns",
"list",
"of",
"known",
"plugins",
"of",
"the",
"given",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L371-L399 |
217,456 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.init_pluginsinfo_property | protected function init_pluginsinfo_property() {
if (is_array($this->pluginsinfo)) {
return;
}
$this->pluginsinfo = array();
$plugintypes = $this->get_plugin_types();
foreach ($plugintypes as $plugintype => $plugintyperootdir) {
$this->pluginsinfo[$plugi... | php | protected function init_pluginsinfo_property() {
if (is_array($this->pluginsinfo)) {
return;
}
$this->pluginsinfo = array();
$plugintypes = $this->get_plugin_types();
foreach ($plugintypes as $plugintype => $plugintyperootdir) {
$this->pluginsinfo[$plugi... | [
"protected",
"function",
"init_pluginsinfo_property",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"pluginsinfo",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"pluginsinfo",
"=",
"array",
"(",
")",
";",
"$",
"plugintypes",
"=",
... | Init placeholder array for plugin infos. | [
"Init",
"placeholder",
"array",
"for",
"plugin",
"infos",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L404-L423 |
217,457 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.resolve_plugininfo_class | public static function resolve_plugininfo_class($type) {
$plugintypes = core_component::get_plugin_types();
if (!isset($plugintypes[$type])) {
return '\core\plugininfo\orphaned';
}
$parent = core_component::get_subtype_parent($type);
if ($parent) {
$clas... | php | public static function resolve_plugininfo_class($type) {
$plugintypes = core_component::get_plugin_types();
if (!isset($plugintypes[$type])) {
return '\core\plugininfo\orphaned';
}
$parent = core_component::get_subtype_parent($type);
if ($parent) {
$clas... | [
"public",
"static",
"function",
"resolve_plugininfo_class",
"(",
"$",
"type",
")",
"{",
"$",
"plugintypes",
"=",
"core_component",
"::",
"get_plugin_types",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"plugintypes",
"[",
"$",
"type",
"]",
")",
")",
... | Find the plugin info class for given type.
@param string $type
@return string name of pluginfo class for give plugin type | [
"Find",
"the",
"plugin",
"info",
"class",
"for",
"given",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L431-L476 |
217,458 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_subplugins_of_plugin | public function get_subplugins_of_plugin($component) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return array();
}
$subplugins = $this->get_subplugins();
if (!isset($subplugins[$pluginfo->component])) {
return array();
... | php | public function get_subplugins_of_plugin($component) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return array();
}
$subplugins = $this->get_subplugins();
if (!isset($subplugins[$pluginfo->component])) {
return array();
... | [
"public",
"function",
"get_subplugins_of_plugin",
"(",
"$",
"component",
")",
"{",
"$",
"pluginfo",
"=",
"$",
"this",
"->",
"get_plugin_info",
"(",
"$",
"component",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"pluginfo",
")",
")",
"{",
"return",
"array",
... | Returns list of all known subplugins of the given plugin.
For plugins that do not provide subplugins (i.e. there is no support for it),
empty array is returned.
@param string $component full component name, e.g. 'mod_workshop'
@return array (string) component name (e.g. 'workshopallocation_random') => subclass of {@l... | [
"Returns",
"list",
"of",
"all",
"known",
"subplugins",
"of",
"the",
"given",
"plugin",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L487-L510 |
217,459 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.plugin_name | public function plugin_name($component) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
throw new moodle_exception('err_unknown_plugin', 'core_plugin', '', array('plugin' => $component));
}
return $pluginfo->displayname;
} | php | public function plugin_name($component) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
throw new moodle_exception('err_unknown_plugin', 'core_plugin', '', array('plugin' => $component));
}
return $pluginfo->displayname;
} | [
"public",
"function",
"plugin_name",
"(",
"$",
"component",
")",
"{",
"$",
"pluginfo",
"=",
"$",
"this",
"->",
"get_plugin_info",
"(",
"$",
"component",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"pluginfo",
")",
")",
"{",
"throw",
"new",
"moodle_exceptio... | Returns a localized name of a given plugin
@param string $component name of the plugin, eg mod_workshop or auth_ldap
@return string | [
"Returns",
"a",
"localized",
"name",
"of",
"a",
"given",
"plugin"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L569-L578 |
217,460 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.plugintype_name | public function plugintype_name($type) {
if (get_string_manager()->string_exists('type_' . $type, 'core_plugin')) {
// For most plugin types, their names are defined in core_plugin lang file.
return get_string('type_' . $type, 'core_plugin');
} else if ($parent = $this->get_par... | php | public function plugintype_name($type) {
if (get_string_manager()->string_exists('type_' . $type, 'core_plugin')) {
// For most plugin types, their names are defined in core_plugin lang file.
return get_string('type_' . $type, 'core_plugin');
} else if ($parent = $this->get_par... | [
"public",
"function",
"plugintype_name",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"get_string_manager",
"(",
")",
"->",
"string_exists",
"(",
"'type_'",
".",
"$",
"type",
",",
"'core_plugin'",
")",
")",
"{",
"// For most plugin types, their names are defined in core_p... | Returns a localized name of a plugin typed in singular form
Most plugin types define their names in core_plugin lang file. In case of subplugins,
we try to ask the parent plugin for the name. In the worst case, we will return
the value of the passed $type parameter.
@param string $type the type of the plugin, e.g. mo... | [
"Returns",
"a",
"localized",
"name",
"of",
"a",
"plugin",
"typed",
"in",
"singular",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L590-L607 |
217,461 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_plugin_info | public function get_plugin_info($component) {
list($type, $name) = core_component::normalize_component($component);
$plugins = $this->get_plugins_of_type($type);
if (isset($plugins[$name])) {
return $plugins[$name];
} else {
return null;
}
} | php | public function get_plugin_info($component) {
list($type, $name) = core_component::normalize_component($component);
$plugins = $this->get_plugins_of_type($type);
if (isset($plugins[$name])) {
return $plugins[$name];
} else {
return null;
}
} | [
"public",
"function",
"get_plugin_info",
"(",
"$",
"component",
")",
"{",
"list",
"(",
"$",
"type",
",",
"$",
"name",
")",
"=",
"core_component",
"::",
"normalize_component",
"(",
"$",
"component",
")",
";",
"$",
"plugins",
"=",
"$",
"this",
"->",
"get_p... | Returns information about the known plugin, or null
@param string $component frankenstyle component name.
@return \core\plugininfo\base|null the corresponding plugin information. | [
"Returns",
"information",
"about",
"the",
"known",
"plugin",
"or",
"null"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L644-L652 |
217,462 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.plugin_external_source | public function plugin_external_source($component) {
$plugininfo = $this->get_plugin_info($component);
if (is_null($plugininfo)) {
return false;
}
$pluginroot = $plugininfo->rootdir;
if (is_dir($pluginroot.'/.git')) {
return 'git';
}
i... | php | public function plugin_external_source($component) {
$plugininfo = $this->get_plugin_info($component);
if (is_null($plugininfo)) {
return false;
}
$pluginroot = $plugininfo->rootdir;
if (is_dir($pluginroot.'/.git')) {
return 'git';
}
i... | [
"public",
"function",
"plugin_external_source",
"(",
"$",
"component",
")",
"{",
"$",
"plugininfo",
"=",
"$",
"this",
"->",
"get_plugin_info",
"(",
"$",
"component",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"plugininfo",
")",
")",
"{",
"return",
"false",
... | Check to see if the current version of the plugin seems to be a checkout of an external repository.
@param string $component frankenstyle component name
@return false|string | [
"Check",
"to",
"see",
"if",
"the",
"current",
"version",
"of",
"the",
"plugin",
"seems",
"to",
"be",
"a",
"checkout",
"of",
"an",
"external",
"repository",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L660-L691 |
217,463 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.other_plugins_that_require | public function other_plugins_that_require($component) {
$others = array();
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
$required = $plugin->get_other_required_plugins();
if (isset($required[$component])) {
... | php | public function other_plugins_that_require($component) {
$others = array();
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
$required = $plugin->get_other_required_plugins();
if (isset($required[$component])) {
... | [
"public",
"function",
"other_plugins_that_require",
"(",
"$",
"component",
")",
"{",
"$",
"others",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"get_plugins",
"(",
")",
"as",
"$",
"type",
"=>",
"$",
"plugins",
")",
"{",
"foreach",
"... | Get a list of any other plugins that require this one.
@param string $component frankenstyle component name.
@return array of frankensyle component names that require this one. | [
"Get",
"a",
"list",
"of",
"any",
"other",
"plugins",
"that",
"require",
"this",
"one",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L698-L709 |
217,464 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.are_dependencies_satisfied | public function are_dependencies_satisfied($dependencies) {
foreach ($dependencies as $component => $requiredversion) {
$otherplugin = $this->get_plugin_info($component);
if (is_null($otherplugin)) {
return false;
}
if ($requiredversion != ANY_VER... | php | public function are_dependencies_satisfied($dependencies) {
foreach ($dependencies as $component => $requiredversion) {
$otherplugin = $this->get_plugin_info($component);
if (is_null($otherplugin)) {
return false;
}
if ($requiredversion != ANY_VER... | [
"public",
"function",
"are_dependencies_satisfied",
"(",
"$",
"dependencies",
")",
"{",
"foreach",
"(",
"$",
"dependencies",
"as",
"$",
"component",
"=>",
"$",
"requiredversion",
")",
"{",
"$",
"otherplugin",
"=",
"$",
"this",
"->",
"get_plugin_info",
"(",
"$"... | Check a dependencies list against the list of installed plugins.
@param array $dependencies compenent name to required version or ANY_VERSION.
@return bool true if all the dependencies are satisfied. | [
"Check",
"a",
"dependencies",
"list",
"against",
"the",
"list",
"of",
"installed",
"plugins",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L716-L729 |
217,465 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.all_plugins_ok | public function all_plugins_ok($moodleversion, &$failedplugins = array()) {
$return = true;
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
if (!$plugin->is_core_dependency_satisfied($moodleversion)) {
$return = fals... | php | public function all_plugins_ok($moodleversion, &$failedplugins = array()) {
$return = true;
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
if (!$plugin->is_core_dependency_satisfied($moodleversion)) {
$return = fals... | [
"public",
"function",
"all_plugins_ok",
"(",
"$",
"moodleversion",
",",
"&",
"$",
"failedplugins",
"=",
"array",
"(",
")",
")",
"{",
"$",
"return",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"get_plugins",
"(",
")",
"as",
"$",
"type",
"=>",
... | Checks all dependencies for all installed plugins
This is used by install and upgrade. The array passed by reference as the second
argument is populated with the list of plugins that have failed dependencies (note that
a single plugin can appear multiple times in the $failedplugins).
@param int $moodleversion the ver... | [
"Checks",
"all",
"dependencies",
"for",
"all",
"installed",
"plugins"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L742-L761 |
217,466 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.resolve_requirements | public function resolve_requirements(\core\plugininfo\base $plugin, $moodleversion=null, $moodlebranch=null) {
global $CFG;
if ($plugin->versiondisk === null) {
// Missing from disk, we have no version.php to read from.
return array();
}
if ($moodleversion === n... | php | public function resolve_requirements(\core\plugininfo\base $plugin, $moodleversion=null, $moodlebranch=null) {
global $CFG;
if ($plugin->versiondisk === null) {
// Missing from disk, we have no version.php to read from.
return array();
}
if ($moodleversion === n... | [
"public",
"function",
"resolve_requirements",
"(",
"\\",
"core",
"\\",
"plugininfo",
"\\",
"base",
"$",
"plugin",
",",
"$",
"moodleversion",
"=",
"null",
",",
"$",
"moodlebranch",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"$",
"plugin"... | Resolve requirements and dependencies of a plugin.
Returns an array of objects describing the requirement/dependency,
indexed by the frankenstyle name of the component. The returned array
can be empty. The objects in the array have following properties:
->(numeric)hasver
->(numeric)reqver
->(string)status
->(string)a... | [
"Resolve",
"requirements",
"and",
"dependencies",
"of",
"a",
"plugin",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L780-L808 |
217,467 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.resolve_core_requirements | protected function resolve_core_requirements(\core\plugininfo\base $plugin, $moodleversion) {
$reqs = (object)array(
'hasver' => null,
'reqver' => null,
'status' => null,
'availability' => null,
);
$reqs->hasver = $moodleversion;
if (emp... | php | protected function resolve_core_requirements(\core\plugininfo\base $plugin, $moodleversion) {
$reqs = (object)array(
'hasver' => null,
'reqver' => null,
'status' => null,
'availability' => null,
);
$reqs->hasver = $moodleversion;
if (emp... | [
"protected",
"function",
"resolve_core_requirements",
"(",
"\\",
"core",
"\\",
"plugininfo",
"\\",
"base",
"$",
"plugin",
",",
"$",
"moodleversion",
")",
"{",
"$",
"reqs",
"=",
"(",
"object",
")",
"array",
"(",
"'hasver'",
"=>",
"null",
",",
"'reqver'",
"=... | Helper method to resolve plugin's requirements on the moodle core.
@param \core\plugininfo\base $plugin the plugin we are checking
@param string|int|double $moodleversion moodle core branch to check against
@return stdObject | [
"Helper",
"method",
"to",
"resolve",
"plugin",
"s",
"requirements",
"on",
"the",
"moodle",
"core",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L817-L841 |
217,468 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.resolve_dependency_requirements | protected function resolve_dependency_requirements(\core\plugininfo\base $plugin, $otherpluginname,
$requiredversion, $moodlebranch) {
$reqs = (object)array(
'hasver' => null,
'reqver' => null,
'status' => null,
'availability' => null,
);
... | php | protected function resolve_dependency_requirements(\core\plugininfo\base $plugin, $otherpluginname,
$requiredversion, $moodlebranch) {
$reqs = (object)array(
'hasver' => null,
'reqver' => null,
'status' => null,
'availability' => null,
);
... | [
"protected",
"function",
"resolve_dependency_requirements",
"(",
"\\",
"core",
"\\",
"plugininfo",
"\\",
"base",
"$",
"plugin",
",",
"$",
"otherpluginname",
",",
"$",
"requiredversion",
",",
"$",
"moodlebranch",
")",
"{",
"$",
"reqs",
"=",
"(",
"object",
")",
... | Helper method to resolve plugin's dependecies on other plugins.
@param \core\plugininfo\base $plugin the plugin we are checking
@param string $otherpluginname
@param string|int $requiredversion
@param string|int $moodlebranch explicit moodle core branch to check against, defaults to $CFG->branch
@return stdClass | [
"Helper",
"method",
"to",
"resolve",
"plugin",
"s",
"dependecies",
"on",
"other",
"plugins",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L852-L891 |
217,469 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.is_remote_plugin_available | public function is_remote_plugin_available($component, $version, $exactmatch) {
$info = $this->get_remote_plugin_info($component, $version, $exactmatch);
if (empty($info)) {
// There is no available plugin of that name.
return false;
}
if (empty($info->version)... | php | public function is_remote_plugin_available($component, $version, $exactmatch) {
$info = $this->get_remote_plugin_info($component, $version, $exactmatch);
if (empty($info)) {
// There is no available plugin of that name.
return false;
}
if (empty($info->version)... | [
"public",
"function",
"is_remote_plugin_available",
"(",
"$",
"component",
",",
"$",
"version",
",",
"$",
"exactmatch",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"get_remote_plugin_info",
"(",
"$",
"component",
",",
"$",
"version",
",",
"$",
"exactmatch... | Is the given plugin version available in the plugins directory?
See {@link self::get_remote_plugin_info()} for the full explanation of how the $version
parameter is interpretted.
@param string $component plugin frankenstyle name
@param string|int $version ANY_VERSION or the version number
@param bool $exactmatch fals... | [
"Is",
"the",
"given",
"plugin",
"version",
"available",
"in",
"the",
"plugins",
"directory?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L904-L919 |
217,470 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.is_remote_plugin_installable | public function is_remote_plugin_installable($component, $version, &$reason=null) {
global $CFG;
// Make sure the feature is not disabled.
if (!empty($CFG->disableupdateautodeploy)) {
$reason = 'disabled';
return false;
}
// Make sure the version is avai... | php | public function is_remote_plugin_installable($component, $version, &$reason=null) {
global $CFG;
// Make sure the feature is not disabled.
if (!empty($CFG->disableupdateautodeploy)) {
$reason = 'disabled';
return false;
}
// Make sure the version is avai... | [
"public",
"function",
"is_remote_plugin_installable",
"(",
"$",
"component",
",",
"$",
"version",
",",
"&",
"$",
"reason",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"// Make sure the feature is not disabled.",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
... | Can the given plugin version be installed via the admin UI?
This check should be used whenever attempting to install a plugin from
the plugins directory (new install, available update, missing dependency).
@param string $component
@param int $version version number
@param string $reason returned code of the reason wh... | [
"Can",
"the",
"given",
"plugin",
"version",
"be",
"installed",
"via",
"the",
"admin",
"UI?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L932-L975 |
217,471 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.filter_installable | public function filter_installable($remoteinfos) {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return array();
}
if (empty($remoteinfos)) {
return array();
}
$installable = array();
foreach ($remoteinfos as $index => $remotei... | php | public function filter_installable($remoteinfos) {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return array();
}
if (empty($remoteinfos)) {
return array();
}
$installable = array();
foreach ($remoteinfos as $index => $remotei... | [
"public",
"function",
"filter_installable",
"(",
"$",
"remoteinfos",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"disableupdateautodeploy",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"if",
"(",
"empty... | Given the list of remote plugin infos, return just those installable.
This is typically used on lists returned by
{@link self::available_updates()} or {@link self::missing_dependencies()}
to perform bulk installation of remote plugins.
@param array $remoteinfos list of {@link \core\update\remote_info}
@return array | [
"Given",
"the",
"list",
"of",
"remote",
"plugin",
"infos",
"return",
"just",
"those",
"installable",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L987-L1003 |
217,472 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_remote_plugin_info | public function get_remote_plugin_info($component, $version, $exactmatch) {
if ($exactmatch and $version == ANY_VERSION) {
throw new coding_exception('Invalid request for exactly any version, it does not make sense.');
}
$client = $this->get_update_api_client();
if ($exact... | php | public function get_remote_plugin_info($component, $version, $exactmatch) {
if ($exactmatch and $version == ANY_VERSION) {
throw new coding_exception('Invalid request for exactly any version, it does not make sense.');
}
$client = $this->get_update_api_client();
if ($exact... | [
"public",
"function",
"get_remote_plugin_info",
"(",
"$",
"component",
",",
"$",
"version",
",",
"$",
"exactmatch",
")",
"{",
"if",
"(",
"$",
"exactmatch",
"and",
"$",
"version",
"==",
"ANY_VERSION",
")",
"{",
"throw",
"new",
"coding_exception",
"(",
"'Inval... | Returns information about a plugin in the plugins directory.
This is typically used when checking for available dependencies (in
which case the $version represents minimal version we need), or
when installing an available update or a new plugin from the plugins
directory (in which case the $version is exact version we... | [
"Returns",
"information",
"about",
"a",
"plugin",
"in",
"the",
"plugins",
"directory",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1030-L1052 |
217,473 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.missing_dependencies | public function missing_dependencies($availableonly=false) {
$dependencies = array();
foreach ($this->get_plugins() as $plugintype => $pluginfos) {
foreach ($pluginfos as $pluginname => $pluginfo) {
foreach ($this->resolve_requirements($pluginfo) as $reqname => $reqinfo) {
... | php | public function missing_dependencies($availableonly=false) {
$dependencies = array();
foreach ($this->get_plugins() as $plugintype => $pluginfos) {
foreach ($pluginfos as $pluginname => $pluginfo) {
foreach ($this->resolve_requirements($pluginfo) as $reqname => $reqinfo) {
... | [
"public",
"function",
"missing_dependencies",
"(",
"$",
"availableonly",
"=",
"false",
")",
"{",
"$",
"dependencies",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"get_plugins",
"(",
")",
"as",
"$",
"plugintype",
"=>",
"$",
"pluginfos",
... | Return a list of missing dependencies.
This should provide the full list of plugins that should be installed to
fulfill the requirements of all plugins, if possible.
@param bool $availableonly return only available missing dependencies
@return array of \core\update\remote_info|bool indexed by the component name | [
"Return",
"a",
"list",
"of",
"missing",
"dependencies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1114-L1160 |
217,474 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.can_uninstall_plugin | public function can_uninstall_plugin($component) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return false;
}
if (!$this->common_uninstall_check($pluginfo)) {
return false;
}
// Verify only if something else requi... | php | public function can_uninstall_plugin($component) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return false;
}
if (!$this->common_uninstall_check($pluginfo)) {
return false;
}
// Verify only if something else requi... | [
"public",
"function",
"can_uninstall_plugin",
"(",
"$",
"component",
")",
"{",
"$",
"pluginfo",
"=",
"$",
"this",
"->",
"get_plugin_info",
"(",
"$",
"component",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"pluginfo",
")",
")",
"{",
"return",
"false",
";",... | Is it possible to uninstall the given plugin?
False is returned if the plugininfo subclass declares the uninstall should
not be allowed via {@link \core\plugininfo\base::is_uninstall_allowed()} or if the
core vetoes it (e.g. becase the plugin or some of its subplugins is required
by some other installed plugin).
@par... | [
"Is",
"it",
"possible",
"to",
"uninstall",
"the",
"given",
"plugin?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1173-L1209 |
217,475 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_uninstall_url | public function get_uninstall_url($component, $return = 'overview') {
if (!$this->can_uninstall_plugin($component)) {
return null;
}
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return null;
}
if (method_exists($plug... | php | public function get_uninstall_url($component, $return = 'overview') {
if (!$this->can_uninstall_plugin($component)) {
return null;
}
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return null;
}
if (method_exists($plug... | [
"public",
"function",
"get_uninstall_url",
"(",
"$",
"component",
",",
"$",
"return",
"=",
"'overview'",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"can_uninstall_plugin",
"(",
"$",
"component",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"pluginfo... | Returns uninstall URL if exists.
@param string $component
@param string $return either 'overview' or 'manage'
@return moodle_url uninstall URL, null if uninstall not supported | [
"Returns",
"uninstall",
"URL",
"if",
"exists",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1391-L1408 |
217,476 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.uninstall_plugin | public function uninstall_plugin($component, progress_trace $progress) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return false;
}
// Give the pluginfo class a chance to execute some steps.
$result = $pluginfo->uninstall($progress);
... | php | public function uninstall_plugin($component, progress_trace $progress) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return false;
}
// Give the pluginfo class a chance to execute some steps.
$result = $pluginfo->uninstall($progress);
... | [
"public",
"function",
"uninstall_plugin",
"(",
"$",
"component",
",",
"progress_trace",
"$",
"progress",
")",
"{",
"$",
"pluginfo",
"=",
"$",
"this",
"->",
"get_plugin_info",
"(",
"$",
"component",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"pluginfo",
")",... | Uninstall the given plugin.
Automatically cleans-up all remaining configuration data, log records, events,
files from the file pool etc.
In the future, the functionality of {@link uninstall_plugin()} function may be moved
into this method and all the code should be refactored to use it. At the moment, we
mimic this f... | [
"Uninstall",
"the",
"given",
"plugin",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1424-L1444 |
217,477 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.some_plugins_updatable | public function some_plugins_updatable() {
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
if ($plugin->available_updates()) {
return true;
}
}
}
return false;
} | php | public function some_plugins_updatable() {
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
if ($plugin->available_updates()) {
return true;
}
}
}
return false;
} | [
"public",
"function",
"some_plugins_updatable",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_plugins",
"(",
")",
"as",
"$",
"type",
"=>",
"$",
"plugins",
")",
"{",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"plugin",
")",
"{",
"if",
"(",
"$... | Checks if there are some plugins with a known available update
@return bool true if there is at least one available update | [
"Checks",
"if",
"there",
"are",
"some",
"plugins",
"with",
"a",
"known",
"available",
"update"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1451-L1461 |
217,478 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.load_available_updates_for_plugin | public function load_available_updates_for_plugin($component) {
global $CFG;
$provider = \core\update\checker::instance();
if (!$provider->enabled() or during_initial_install()) {
return null;
}
if (isset($CFG->updateminmaturity)) {
$minmaturity = $CFG-... | php | public function load_available_updates_for_plugin($component) {
global $CFG;
$provider = \core\update\checker::instance();
if (!$provider->enabled() or during_initial_install()) {
return null;
}
if (isset($CFG->updateminmaturity)) {
$minmaturity = $CFG-... | [
"public",
"function",
"load_available_updates_for_plugin",
"(",
"$",
"component",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"provider",
"=",
"\\",
"core",
"\\",
"update",
"\\",
"checker",
"::",
"instance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"provider",
... | Returns list of available updates for the given component.
This method should be considered as internal API and is supposed to be
called by {@link \core\plugininfo\base::available_updates()} only
to lazy load the data once they are first requested.
@param string $component frankenstyle name of the plugin
@return null... | [
"Returns",
"list",
"of",
"available",
"updates",
"for",
"the",
"given",
"component",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1473-L1490 |
217,479 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.available_updates | public function available_updates() {
$updates = array();
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
$availableupdates = $plugin->available_updates();
if (empty($availableupdates)) {
continue;
... | php | public function available_updates() {
$updates = array();
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
$availableupdates = $plugin->available_updates();
if (empty($availableupdates)) {
continue;
... | [
"public",
"function",
"available_updates",
"(",
")",
"{",
"$",
"updates",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"get_plugins",
"(",
")",
"as",
"$",
"type",
"=>",
"$",
"plugins",
")",
"{",
"foreach",
"(",
"$",
"plugins",
"as"... | Returns a list of all available updates to be installed.
This is used when "update all plugins" action is performed at the
administration UI screen.
Returns array of remote info objects indexed by the plugin
component. If there are multiple updates available (typically a mix of
stable and non-stable ones), we pick th... | [
"Returns",
"a",
"list",
"of",
"all",
"available",
"updates",
"to",
"be",
"installed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1508-L1556 |
217,480 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.is_plugin_folder_removable | public function is_plugin_folder_removable($component) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return false;
}
// To be able to remove the plugin folder, its parent must be writable, too.
if (!is_writable(dirname($pluginfo->rootd... | php | public function is_plugin_folder_removable($component) {
$pluginfo = $this->get_plugin_info($component);
if (is_null($pluginfo)) {
return false;
}
// To be able to remove the plugin folder, its parent must be writable, too.
if (!is_writable(dirname($pluginfo->rootd... | [
"public",
"function",
"is_plugin_folder_removable",
"(",
"$",
"component",
")",
"{",
"$",
"pluginfo",
"=",
"$",
"this",
"->",
"get_plugin_info",
"(",
"$",
"component",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"pluginfo",
")",
")",
"{",
"return",
"false",
... | Check to see if the given plugin folder can be removed by the web server process.
@param string $component full frankenstyle component
@return bool | [
"Check",
"to",
"see",
"if",
"the",
"given",
"plugin",
"folder",
"can",
"be",
"removed",
"by",
"the",
"web",
"server",
"process",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1564-L1579 |
217,481 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.is_plugintype_writable | public function is_plugintype_writable($plugintype) {
$plugintypepath = $this->get_plugintype_root($plugintype);
if (is_null($plugintypepath)) {
throw new coding_exception('Unknown plugin type: '.$plugintype);
}
if ($plugintypepath === false) {
throw new coding... | php | public function is_plugintype_writable($plugintype) {
$plugintypepath = $this->get_plugintype_root($plugintype);
if (is_null($plugintypepath)) {
throw new coding_exception('Unknown plugin type: '.$plugintype);
}
if ($plugintypepath === false) {
throw new coding... | [
"public",
"function",
"is_plugintype_writable",
"(",
"$",
"plugintype",
")",
"{",
"$",
"plugintypepath",
"=",
"$",
"this",
"->",
"get_plugintype_root",
"(",
"$",
"plugintype",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"plugintypepath",
")",
")",
"{",
"throw"... | Is it possible to create a new plugin directory for the given plugin type?
@throws coding_exception for invalid plugin types or non-existing plugin type locations
@param string $plugintype
@return boolean | [
"Is",
"it",
"possible",
"to",
"create",
"a",
"new",
"plugin",
"directory",
"for",
"the",
"given",
"plugin",
"type?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1588-L1601 |
217,482 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_plugintype_root | public function get_plugintype_root($plugintype) {
$plugintypepath = null;
foreach (core_component::get_plugin_types() as $type => $fullpath) {
if ($type === $plugintype) {
$plugintypepath = $fullpath;
break;
}
}
if (is_null($plugi... | php | public function get_plugintype_root($plugintype) {
$plugintypepath = null;
foreach (core_component::get_plugin_types() as $type => $fullpath) {
if ($type === $plugintype) {
$plugintypepath = $fullpath;
break;
}
}
if (is_null($plugi... | [
"public",
"function",
"get_plugintype_root",
"(",
"$",
"plugintype",
")",
"{",
"$",
"plugintypepath",
"=",
"null",
";",
"foreach",
"(",
"core_component",
"::",
"get_plugin_types",
"(",
")",
"as",
"$",
"type",
"=>",
"$",
"fullpath",
")",
"{",
"if",
"(",
"$"... | Returns the full path of the root of the given plugin type
Null is returned if the plugin type is not known. False is returned if
the plugin type root is expected but not found. Otherwise, string is
returned.
@param string $plugintype
@return string|bool|null | [
"Returns",
"the",
"full",
"path",
"of",
"the",
"root",
"of",
"the",
"given",
"plugin",
"type"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1613-L1630 |
217,483 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.is_deleted_standard_plugin | public static function is_deleted_standard_plugin($type, $name) {
// Do not include plugins that were removed during upgrades to versions that are
// not supported as source versions for upgrade any more. For example, at MOODLE_23_STABLE
// branch, listed should be no plugins that were removed a... | php | public static function is_deleted_standard_plugin($type, $name) {
// Do not include plugins that were removed during upgrades to versions that are
// not supported as source versions for upgrade any more. For example, at MOODLE_23_STABLE
// branch, listed should be no plugins that were removed a... | [
"public",
"static",
"function",
"is_deleted_standard_plugin",
"(",
"$",
"type",
",",
"$",
"name",
")",
"{",
"// Do not include plugins that were removed during upgrades to versions that are",
"// not supported as source versions for upgrade any more. For example, at MOODLE_23_STABLE",
"/... | Defines a list of all plugins that were originally shipped in the standard Moodle distribution,
but are not anymore and are deleted during upgrades.
The main purpose of this list is to hide missing plugins during upgrade.
@param string $type plugin type
@param string $name plugin name
@return bool | [
"Defines",
"a",
"list",
"of",
"all",
"plugins",
"that",
"were",
"originally",
"shipped",
"in",
"the",
"standard",
"Moodle",
"distribution",
"but",
"are",
"not",
"anymore",
"and",
"are",
"deleted",
"during",
"upgrades",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1642-L1668 |
217,484 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.remove_plugin_folder | public function remove_plugin_folder(\core\plugininfo\base $plugin) {
if (!$this->is_plugin_folder_removable($plugin->component)) {
throw new moodle_exception('err_removing_unremovable_folder', 'core_plugin', '',
array('plugin' => $plugin->component, 'rootdir' => $plugin->rootdir),
... | php | public function remove_plugin_folder(\core\plugininfo\base $plugin) {
if (!$this->is_plugin_folder_removable($plugin->component)) {
throw new moodle_exception('err_removing_unremovable_folder', 'core_plugin', '',
array('plugin' => $plugin->component, 'rootdir' => $plugin->rootdir),
... | [
"public",
"function",
"remove_plugin_folder",
"(",
"\\",
"core",
"\\",
"plugininfo",
"\\",
"base",
"$",
"plugin",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"is_plugin_folder_removable",
"(",
"$",
"plugin",
"->",
"component",
")",
")",
"{",
"throw",
"new... | Remove the current plugin code from the dirroot.
If removing the currently installed version (which happens during
updates), we archive the code so that the upgrade can be cancelled.
To prevent accidental data-loss, we also archive the existing plugin
code if cancelling installation of it, so that the developer does ... | [
"Remove",
"the",
"current",
"plugin",
"code",
"from",
"the",
"dirroot",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1956-L1973 |
217,485 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.can_cancel_plugin_installation | public function can_cancel_plugin_installation(\core\plugininfo\base $plugin) {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return false;
}
if (empty($plugin) or $plugin->is_standard() or $plugin->is_subplugin()
or !$this->is_plugin_folder_remo... | php | public function can_cancel_plugin_installation(\core\plugininfo\base $plugin) {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return false;
}
if (empty($plugin) or $plugin->is_standard() or $plugin->is_subplugin()
or !$this->is_plugin_folder_remo... | [
"public",
"function",
"can_cancel_plugin_installation",
"(",
"\\",
"core",
"\\",
"plugininfo",
"\\",
"base",
"$",
"plugin",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"disableupdateautodeploy",
")",
")",
"{",
"retu... | Can the installation of the new plugin be cancelled?
Subplugins can be cancelled only via their parent plugin, not separately
(they are considered as implicit requirements if distributed together
with the main package).
@param \core\plugininfo\base $plugin
@return bool | [
"Can",
"the",
"installation",
"of",
"the",
"new",
"plugin",
"be",
"cancelled?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L1985-L2002 |
217,486 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.can_cancel_plugin_upgrade | public function can_cancel_plugin_upgrade(\core\plugininfo\base $plugin) {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
// Cancelling the plugin upgrade is actually installation of the
// previously archived version.
return false;
}
if (... | php | public function can_cancel_plugin_upgrade(\core\plugininfo\base $plugin) {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
// Cancelling the plugin upgrade is actually installation of the
// previously archived version.
return false;
}
if (... | [
"public",
"function",
"can_cancel_plugin_upgrade",
"(",
"\\",
"core",
"\\",
"plugininfo",
"\\",
"base",
"$",
"plugin",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"disableupdateautodeploy",
")",
")",
"{",
"// Cancel... | Can the upgrade of the existing plugin be cancelled?
Subplugins can be cancelled only via their parent plugin, not separately
(they are considered as implicit requirements if distributed together
with the main package).
@param \core\plugininfo\base $plugin
@return bool | [
"Can",
"the",
"upgrade",
"of",
"the",
"existing",
"plugin",
"be",
"cancelled?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2014-L2035 |
217,487 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.cancel_plugin_installation | public function cancel_plugin_installation($component) {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return false;
}
$plugin = $this->get_plugin_info($component);
if ($this->can_cancel_plugin_installation($plugin)) {
$this->remove_plugin_f... | php | public function cancel_plugin_installation($component) {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return false;
}
$plugin = $this->get_plugin_info($component);
if ($this->can_cancel_plugin_installation($plugin)) {
$this->remove_plugin_f... | [
"public",
"function",
"cancel_plugin_installation",
"(",
"$",
"component",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"disableupdateautodeploy",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"plugin",
"=",
"$"... | Removes the plugin code directory if it is not installed yet.
This is intended for the plugins check screen to give the admin a chance
to cancel the installation of just unzipped plugin before the database
upgrade happens.
@param string $component | [
"Removes",
"the",
"plugin",
"code",
"directory",
"if",
"it",
"is",
"not",
"installed",
"yet",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2046-L2060 |
217,488 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.list_cancellable_installations | public function list_cancellable_installations() {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return array();
}
$cancellable = array();
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
i... | php | public function list_cancellable_installations() {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return array();
}
$cancellable = array();
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($plugins as $plugin) {
i... | [
"public",
"function",
"list_cancellable_installations",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"disableupdateautodeploy",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"cancellable",
"=",
"a... | Returns plugins, the installation of which can be cancelled.
@return array [(string)component] => (\core\plugininfo\base)plugin | [
"Returns",
"plugins",
"the",
"installation",
"of",
"which",
"can",
"be",
"cancelled",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2067-L2084 |
217,489 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.archive_plugin_version | public function archive_plugin_version(\core\plugininfo\base $plugin) {
return $this->get_code_manager()->archive_plugin_version($plugin->rootdir, $plugin->component, $plugin->versiondisk);
} | php | public function archive_plugin_version(\core\plugininfo\base $plugin) {
return $this->get_code_manager()->archive_plugin_version($plugin->rootdir, $plugin->component, $plugin->versiondisk);
} | [
"public",
"function",
"archive_plugin_version",
"(",
"\\",
"core",
"\\",
"plugininfo",
"\\",
"base",
"$",
"plugin",
")",
"{",
"return",
"$",
"this",
"->",
"get_code_manager",
"(",
")",
"->",
"archive_plugin_version",
"(",
"$",
"plugin",
"->",
"rootdir",
",",
... | Archive the current on-disk plugin code.
@param \core\plugiinfo\base $plugin
@return bool | [
"Archive",
"the",
"current",
"on",
"-",
"disk",
"plugin",
"code",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2092-L2094 |
217,490 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.list_restorable_archives | public function list_restorable_archives() {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return false;
}
$codeman = $this->get_code_manager();
$restorable = array();
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($pl... | php | public function list_restorable_archives() {
global $CFG;
if (!empty($CFG->disableupdateautodeploy)) {
return false;
}
$codeman = $this->get_code_manager();
$restorable = array();
foreach ($this->get_plugins() as $type => $plugins) {
foreach ($pl... | [
"public",
"function",
"list_restorable_archives",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"disableupdateautodeploy",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"codeman",
"=",
"$",
"this",
"->",
"... | Returns list of all archives that can be installed to cancel the plugin upgrade.
@return array [(string)component] => {(string)->component, (string)->zipfilepath} | [
"Returns",
"list",
"of",
"all",
"archives",
"that",
"can",
"be",
"installed",
"to",
"cancel",
"the",
"plugin",
"upgrade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2101-L2122 |
217,491 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.reorder_plugin_types | protected function reorder_plugin_types(array $types) {
$fix = array('mod' => $types['mod']);
foreach (core_component::get_plugin_list('mod') as $plugin => $fulldir) {
if (!$subtypes = core_component::get_subplugins('mod_'.$plugin)) {
continue;
}
forea... | php | protected function reorder_plugin_types(array $types) {
$fix = array('mod' => $types['mod']);
foreach (core_component::get_plugin_list('mod') as $plugin => $fulldir) {
if (!$subtypes = core_component::get_subplugins('mod_'.$plugin)) {
continue;
}
forea... | [
"protected",
"function",
"reorder_plugin_types",
"(",
"array",
"$",
"types",
")",
"{",
"$",
"fix",
"=",
"array",
"(",
"'mod'",
"=>",
"$",
"types",
"[",
"'mod'",
"]",
")",
";",
"foreach",
"(",
"core_component",
"::",
"get_plugin_list",
"(",
"'mod'",
")",
... | Reorders plugin types into a sequence to be displayed
For technical reasons, plugin types returned by {@link core_component::get_plugin_types()} are
in a certain order that does not need to fit the expected order for the display.
Particularly, activity modules should be displayed first as they represent the
real heart... | [
"Reorders",
"plugin",
"types",
"into",
"a",
"sequence",
"to",
"be",
"displayed"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2137-L2183 |
217,492 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.is_directory_removable | public function is_directory_removable($fullpath) {
if (!is_writable($fullpath)) {
return false;
}
if (is_dir($fullpath)) {
$handle = opendir($fullpath);
} else {
return false;
}
$result = true;
while ($filename = readdir($h... | php | public function is_directory_removable($fullpath) {
if (!is_writable($fullpath)) {
return false;
}
if (is_dir($fullpath)) {
$handle = opendir($fullpath);
} else {
return false;
}
$result = true;
while ($filename = readdir($h... | [
"public",
"function",
"is_directory_removable",
"(",
"$",
"fullpath",
")",
"{",
"if",
"(",
"!",
"is_writable",
"(",
"$",
"fullpath",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_dir",
"(",
"$",
"fullpath",
")",
")",
"{",
"$",
"handle",
... | Check if the given directory can be removed by the web server process.
This recursively checks that the given directory and all its contents
it writable.
@param string $fullpath
@return boolean | [
"Check",
"if",
"the",
"given",
"directory",
"can",
"be",
"removed",
"by",
"the",
"web",
"server",
"process",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2194-L2227 |
217,493 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.common_uninstall_check | protected function common_uninstall_check(\core\plugininfo\base $pluginfo) {
if (!$pluginfo->is_uninstall_allowed()) {
// The plugin's plugininfo class declares it should not be uninstalled.
return false;
}
if ($pluginfo->get_status() === static::PLUGIN_STATUS_NEW) {
... | php | protected function common_uninstall_check(\core\plugininfo\base $pluginfo) {
if (!$pluginfo->is_uninstall_allowed()) {
// The plugin's plugininfo class declares it should not be uninstalled.
return false;
}
if ($pluginfo->get_status() === static::PLUGIN_STATUS_NEW) {
... | [
"protected",
"function",
"common_uninstall_check",
"(",
"\\",
"core",
"\\",
"plugininfo",
"\\",
"base",
"$",
"pluginfo",
")",
"{",
"if",
"(",
"!",
"$",
"pluginfo",
"->",
"is_uninstall_allowed",
"(",
")",
")",
"{",
"// The plugin's plugininfo class declares it should... | Helper method that implements common uninstall prerequisites
@param \core\plugininfo\base $pluginfo
@return bool | [
"Helper",
"method",
"that",
"implements",
"common",
"uninstall",
"prerequisites"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2235-L2256 |
217,494 | moodle/moodle | lib/classes/plugin_manager.php | core_plugin_manager.get_code_manager | protected function get_code_manager() {
if ($this->codemanager === null) {
$this->codemanager = new \core\update\code_manager();
}
return $this->codemanager;
} | php | protected function get_code_manager() {
if ($this->codemanager === null) {
$this->codemanager = new \core\update\code_manager();
}
return $this->codemanager;
} | [
"protected",
"function",
"get_code_manager",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"codemanager",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"codemanager",
"=",
"new",
"\\",
"core",
"\\",
"update",
"\\",
"code_manager",
"(",
")",
";",
"}",
"ret... | Returns a code_manager instance to be used for the plugins code operations.
@return \core\update\code_manager | [
"Returns",
"a",
"code_manager",
"instance",
"to",
"be",
"used",
"for",
"the",
"plugins",
"code",
"operations",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/plugin_manager.php#L2263-L2270 |
217,495 | moodle/moodle | lib/spout/src/Spout/Writer/Style/Color.php | Color.rgb | public static function rgb($red, $green, $blue)
{
self::throwIfInvalidColorComponentValue($red);
self::throwIfInvalidColorComponentValue($green);
self::throwIfInvalidColorComponentValue($blue);
return strtoupper(
self::convertColorComponentToHex($red) .
self:... | php | public static function rgb($red, $green, $blue)
{
self::throwIfInvalidColorComponentValue($red);
self::throwIfInvalidColorComponentValue($green);
self::throwIfInvalidColorComponentValue($blue);
return strtoupper(
self::convertColorComponentToHex($red) .
self:... | [
"public",
"static",
"function",
"rgb",
"(",
"$",
"red",
",",
"$",
"green",
",",
"$",
"blue",
")",
"{",
"self",
"::",
"throwIfInvalidColorComponentValue",
"(",
"$",
"red",
")",
";",
"self",
"::",
"throwIfInvalidColorComponentValue",
"(",
"$",
"green",
")",
... | Returns an RGB color from R, G and B values
@api
@param int $red Red component, 0 - 255
@param int $green Green component, 0 - 255
@param int $blue Blue component, 0 - 255
@return string RGB color | [
"Returns",
"an",
"RGB",
"color",
"from",
"R",
"G",
"and",
"B",
"values"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/Style/Color.php#L38-L49 |
217,496 | moodle/moodle | privacy/classes/local/sitepolicy/manager.php | manager.get_handler_classname | public function get_handler_classname() {
global $CFG;
if (!empty($CFG->sitepolicyhandler)) {
$sitepolicyhandlers = $this->get_all_handlers();
if (!isset($sitepolicyhandlers[$CFG->sitepolicyhandler])) {
return default_handler::class;
} else {
... | php | public function get_handler_classname() {
global $CFG;
if (!empty($CFG->sitepolicyhandler)) {
$sitepolicyhandlers = $this->get_all_handlers();
if (!isset($sitepolicyhandlers[$CFG->sitepolicyhandler])) {
return default_handler::class;
} else {
... | [
"public",
"function",
"get_handler_classname",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"sitepolicyhandler",
")",
")",
"{",
"$",
"sitepolicyhandlers",
"=",
"$",
"this",
"->",
"get_all_handlers",
"(",
")",
... | Returns the current site policy handler
@return handler | [
"Returns",
"the",
"current",
"site",
"policy",
"handler"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/sitepolicy/manager.php#L62-L78 |
217,497 | moodle/moodle | lib/classes/event/content_viewed.php | content_viewed.init | protected function init() {
global $PAGE;
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->context = $PAGE->context;
} | php | protected function init() {
global $PAGE;
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->context = $PAGE->context;
} | [
"protected",
"function",
"init",
"(",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"this",
"->",
"data",
"[",
"'crud'",
"]",
"=",
"'r'",
";",
"$",
"this",
"->",
"data",
"[",
"'edulevel'",
"]",
"=",
"self",
"::",
"LEVEL_OTHER",
";",
"$",
"this",
"->",... | Set basic properties of the event. | [
"Set",
"basic",
"properties",
"of",
"the",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/content_viewed.php#L59-L65 |
217,498 | moodle/moodle | lib/classes/event/content_viewed.php | content_viewed.set_page_detail | public function set_page_detail() {
global $PAGE;
if (!isset($this->data['other'])) {
$this->data['other'] = array();
}
$this->data['other'] = array_merge(array('url' => $PAGE->url->out_as_local_url(false),
'heading' => $PA... | php | public function set_page_detail() {
global $PAGE;
if (!isset($this->data['other'])) {
$this->data['other'] = array();
}
$this->data['other'] = array_merge(array('url' => $PAGE->url->out_as_local_url(false),
'heading' => $PA... | [
"public",
"function",
"set_page_detail",
"(",
")",
"{",
"global",
"$",
"PAGE",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'other'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"'other'",
"]",
"=",
"array",
"(",
")... | Set basic page properties. | [
"Set",
"basic",
"page",
"properties",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/content_viewed.php#L70-L78 |
217,499 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Interaction/Pipeline.php | Horde_Imap_Client_Interaction_Pipeline.add | public function add(Horde_Imap_Client_Interaction_Command $cmd,
$top = false)
{
if ($top) {
// This won't re-index keys, which may be numerical.
$this->_commands = array($cmd->tag => $cmd) + $this->_commands;
} else {
$this->_commands[$cmd-... | php | public function add(Horde_Imap_Client_Interaction_Command $cmd,
$top = false)
{
if ($top) {
// This won't re-index keys, which may be numerical.
$this->_commands = array($cmd->tag => $cmd) + $this->_commands;
} else {
$this->_commands[$cmd-... | [
"public",
"function",
"add",
"(",
"Horde_Imap_Client_Interaction_Command",
"$",
"cmd",
",",
"$",
"top",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"top",
")",
"{",
"// This won't re-index keys, which may be numerical.",
"$",
"this",
"->",
"_commands",
"=",
"array",
... | Add a command to the pipeline.
@param Horde_Imap_Client_Interaction_Command $cmd Command object.
@param boolean $top Add command to top
of queue? | [
"Add",
"a",
"command",
"to",
"the",
"pipeline",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Interaction/Pipeline.php#L87-L97 |
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.